zenxfi2: implement headphones detection
Change-Id: Ifbc8b10cebb3b7b126f1d6a212f6731f91e234e4
This commit is contained in:
parent
6b3c29da69
commit
f0f1758067
2 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,7 @@
|
|||
#define HAVE_SW_TONE_CONTROLS
|
||||
|
||||
#define CONFIG_KEYPAD CREATIVE_ZENXFI2_PAD
|
||||
#define HAVE_HEADPHONE_DETECTION
|
||||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
|
|
|
@ -78,6 +78,10 @@ void button_init_device(void)
|
|||
imx233_pinctrl_acquire(0, 14, "select");
|
||||
imx233_pinctrl_set_function(0, 14, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_pinctrl_enable_gpio(0, 14, false);
|
||||
/* jack detect */
|
||||
imx233_pinctrl_acquire(2, 7, "jack_detect");
|
||||
imx233_pinctrl_set_function(2, 7, PINCTRL_FUNCTION_GPIO);
|
||||
imx233_pinctrl_enable_gpio(2, 7, false);
|
||||
}
|
||||
|
||||
static int touch_to_pixels(int *val_x, int *val_y)
|
||||
|
@ -119,6 +123,11 @@ static int touchscreen_read_device(int *data)
|
|||
return touchscreen_to_pixels(x, y, data);
|
||||
}
|
||||
|
||||
bool headphones_inserted(void)
|
||||
{
|
||||
return imx233_pinctrl_get_gpio(2, 7);
|
||||
}
|
||||
|
||||
int button_read_device(int *data)
|
||||
{
|
||||
int res = 0;
|
||||
|
|
Loading…
Reference in a new issue