Misael lopez android

Misael-lopez-android-featured.jpg

Here are the my alterations in kernel side. As pointed out in the past
mail, I am using Switch GPIO driver (which utilizes Switch Class driver) to
create the headset uevent. Within the patch, it is also incorporated the
board file (for OMAP 3430SDP board) although it isn’t a part of standard
android kernel it might be helpful for reference.

Misael lopez android1 Misael lopez android

diff –git a/arch/arm/mach-omap2/board-3430sdp.c
b/arch/arm/mach-omap2/board-3430sdp.c
index 0000d3b..701c861 100644
— a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -24,6 +24,7 @@
#include #include #include +#include

#include
#include
@@ -1140,10 +1141,24 @@ static struct platform_device sdp3430_lcd_device =

+
+static struct gpio_switch_platform_data headset_switch_data = title = “h2w”,
+ .gpio = OMAP_MAX_GPIO_LINES + 2, /*TWL4030 GPIO_2 */
+
+
+static struct platform_device headset_switch_device = title = “switch-gpio”,
+ .dev =
+
+
static struct platform_device *sdp3430_products[] __initdata =

static inline void __init sdp3430_init_smc91x(void)
@@ -1224,6 +1239,7 @@ static struct twl4030_gpio_platform_data
sdp3430_gpio_data = finish = TWL4030_GPIO_IRQ_Finish,

+
static struct twl4030_usb_data sdp3430_usb_data =
diff –git a/motorists/switch/switch_gpio.c b/motorists/switch/switch_gpio.c
index cfd1339..82e29a2 100644
— a/motorists/switch/switch_gpio.c
+++ b/motorists/switch/switch_gpio.c
@@ -22,6 +22,7 @@
#include #include #include +#include

struct gpio_switch_data

ret = request_irq(switch_data->irq, gpio_irq_handler,
– IRQF_TRIGGER_LOW, pdev->name, switch_data)
+ IRQF_TRIGGER_RISING IRQF_TRIGGER_FALLING,
+ pdev->name, switch_data)
if (ret < 0)
goto err_request_irq

In Android side, the DEVPATH value produced through the uevent does not
complement the main one specified by HeadsetObserver.

diff –git a/services/java/com/android/server/HeadsetObserver.java
b/services/java/com/android/server/HeadsetObserver.java
index 2bea731..e5c7706 100644
— a/services/java/com/android/server/HeadsetObserver.java
+++ b/services/java/com/android/server/HeadsetObserver.java
@@ -32,7 +32,7 @@ import java.io.FileNotFoundException
class HeadsetObserver stretches UEventObserver products/virtual/switch/h2w”
+ private static final String HEADSET_UEVENT_MATCH =
“DEVPATH=/class/switch/h2w”
private static final String HEADSET_Condition_PATH =
“/sys/class/switch/h2w/condition”
private static final String HEADSET_Title_PATH =
“/sys/class/switch/h2w/title”

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)