summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c')
-rw-r--r--firmware/target/arm/imx233/creative-zenmozaic/button-zenmozaic.c69
1 files changed, 0 insertions, 69 deletions
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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2013 by Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "button-target.h"
22#include "system.h"
23#include "system-target.h"
24#include "pinctrl-imx233.h"
25#include "power-imx233.h"
26#include "button-lradc-imx233.h"
27
28struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] =
29{
30 {0, IMX233_BUTTON_LRADC_HOLD},
31 {200, BUTTON_MENU},
32 {445, BUTTON_SHORTCUT},
33 {645, BUTTON_UP},
34 {860, BUTTON_LEFT},
35 {1060, BUTTON_RIGHT},
36 {1260, BUTTON_DOWN},
37 {1480, BUTTON_SELECT},
38 {2700, BUTTON_BACK},
39 {2945, BUTTON_PLAYPAUSE},
40 {3400, 0},
41 {0, IMX233_BUTTON_LRADC_END},
42};
43
44void button_init_device(void)
45{
46 imx233_button_lradc_init();
47
48 imx233_pinctrl_acquire(2, 8, "jack_detect");
49 imx233_pinctrl_set_function(2, 8, PINCTRL_FUNCTION_GPIO);
50 imx233_pinctrl_enable_gpio(2, 8, false);
51}
52
53bool headphones_inserted(void)
54{
55 return imx233_pinctrl_get_gpio(2, 8);
56}
57
58bool button_hold(void)
59{
60 return imx233_button_lradc_hold();
61}
62
63int button_read_device(void)
64{
65 int btn = 0;
66 if(BF_RD(POWER_STS, PSWITCH) == 1)
67 btn |= BUTTON_POWER;
68 return imx233_button_lradc_read(btn);
69}