From a8b816ae9cc00fe216e43d9bd9276b5d8cf12b25 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 18 Nov 2013 15:08:53 +0000 Subject: creativezenmozaic: factor out code with the zen/zenxfi Most of the code is similar, only the lcd driver is significantly different. Change-Id: I9eab1faf08d2356f2d820d6930ef3b0653349aa1 --- .../imx233/creative-zenmozaic/button-zenmozaic.c | 69 ---------------------- 1 file changed, 69 deletions(-) delete mode 100644 firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c (limited to 'firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c') diff --git a/firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c b/firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c deleted file mode 100644 index bf6729a273..0000000000 --- a/firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "button-target.h" -#include "system.h" -#include "system-target.h" -#include "pinctrl-imx233.h" -#include "power-imx233.h" -#include "button-lradc-imx233.h" - -struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = -{ - {0, IMX233_BUTTON_LRADC_HOLD}, - {200, BUTTON_MENU}, - {445, BUTTON_SHORTCUT}, - {645, BUTTON_UP}, - {860, BUTTON_LEFT}, - {1060, BUTTON_RIGHT}, - {1260, BUTTON_DOWN}, - {1480, BUTTON_SELECT}, - {2700, BUTTON_BACK}, - {2945, BUTTON_PLAYPAUSE}, - {3400, 0}, - {0, IMX233_BUTTON_LRADC_END}, -}; - -void button_init_device(void) -{ - imx233_button_lradc_init(); - - imx233_pinctrl_acquire(2, 8, "jack_detect"); - imx233_pinctrl_set_function(2, 8, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_enable_gpio(2, 8, false); -} - -bool headphones_inserted(void) -{ - return imx233_pinctrl_get_gpio(2, 8); -} - -bool button_hold(void) -{ - return imx233_button_lradc_hold(); -} - -int button_read_device(void) -{ - int btn = 0; - if(BF_RD(POWER_STS, PSWITCH) == 1) - btn |= BUTTON_POWER; - return imx233_button_lradc_read(btn); -} -- cgit v1.2.3