Skip to content

Commit

Permalink
misc: dummy function for HTC ril
Browse files Browse the repository at this point in the history
  • Loading branch information
Kali- committed Apr 23, 2012
1 parent ac3270c commit 2a32a61
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
9 changes: 5 additions & 4 deletions arch/arm/configs/cyanogen_bravo_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.37.6 Kernel Configuration
# Tue Jan 10 12:38:57 2012
# Fri Mar 23 21:37:38 2012
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
Expand Down Expand Up @@ -413,7 +413,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
CONFIG_NEED_PER_CPU_KM=y
CONFIG_FORCE_MAX_ZONEORDER=11
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ALLOW_CPU_ALIGNMENT=y
# CONFIG_ALLOW_CPU_ALIGNMENT is not set
# CONFIG_UACCESS_WITH_MEMCPY is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
Expand Down Expand Up @@ -490,9 +490,9 @@ CONFIG_EARLYSUSPEND=y
# CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL is not set
CONFIG_FB_EARLYSUSPEND=y
# CONFIG_APM_EMULATION is not set
CONFIG_PM_RUNTIME=y
# CONFIG_PM_RUNTIME is not set
CONFIG_PM_OPS=y
CONFIG_SUSPEND_TIME=y
# CONFIG_SUSPEND_TIME is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y

Expand Down Expand Up @@ -1467,6 +1467,7 @@ CONFIG_USB_CSW_HACK=y
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
CONFIG_USB_HTC_SWITCH_STUB=y

#
# OTG and related infrastructure
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/cyanogen_bravoc_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.37.6 Kernel Configuration
# Wed Jan 11 02:32:39 2012
# Fri Mar 23 21:37:57 2012
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
Expand Down Expand Up @@ -1467,6 +1467,7 @@ CONFIG_USB_CSW_HACK=y
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
CONFIG_USB_HTC_SWITCH_STUB=y

#
# OTG and related infrastructure
Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/gadget/Kconfig
Expand Up @@ -1065,3 +1065,9 @@ config USB_BYPASS_VBUS_NOTIFY
endif # USB_MSM_72K_HTC

endif # USB_GADGET

config USB_HTC_SWITCH_STUB
bool "USB HTC function switch stub"
default n
help
HTC usb_function_switch stub
31 changes: 31 additions & 0 deletions drivers/usb/gadget/msm72k_udc.c
Expand Up @@ -1735,6 +1735,32 @@ static ssize_t usb_remote_wakeup(struct device *dev,
}
static DEVICE_ATTR(wakeup, S_IWUSR, 0, usb_remote_wakeup);

#ifdef CONFIG_USB_HTC_SWITCH_STUB
int android_show_function(char *buf)
{
unsigned length = 0;

length += sprintf(buf + length, "ether:disable\n");

return length;
}

static ssize_t show_usb_function_switch(struct device *dev,
struct device_attribute *attr, char *buf)
{
return android_show_function(buf);
}

static ssize_t store_usb_function_switch(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
return 0;
}

static DEVICE_ATTR(usb_function_switch, 0664,
show_usb_function_switch, store_usb_function_switch);
#endif

static int msm72k_probe(struct platform_device *pdev)
{
struct resource *res;
Expand Down Expand Up @@ -1884,6 +1910,11 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
goto fail;
}

#ifdef CONFIG_USB_HTC_SWITCH_STUB
retval = device_create_file(ui->gadget.dev.parent,
&dev_attr_usb_function_switch);
#endif

/* create sysfs node for remote wakeup */
retval = device_create_file(&ui->gadget.dev, &dev_attr_wakeup);
if (retval != 0)
Expand Down

0 comments on commit 2a32a61

Please sign in to comment.