Skip to content

Adding the option to disable disabling ports 2&3 when going into self po... #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions arch/arm/mach-exynos/mach-hkdk4412.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ static struct i2c_board_info hkdk4412_i2c_devs7[] __initdata = {
/* nothing here yet */
};

// Disable
#if 0

#if defined(CONFIG_ODROID_X_LINUX_LEDS)
static struct gpio_led hkdk4412_gpio_leds[] = {
{
.name = "led1", /* D5 on ODROID-X */
Expand Down Expand Up @@ -1096,10 +1096,11 @@ static struct platform_device *hkdk4412_devices[] __initdata = {
#endif
&exynos4_device_ohci,
&exynos4_device_dwmci,
#if defined(CONFIG_ODROID_X_LINUX_LEDS)

// Disable : ADD
// &hkdk4412_leds_gpio,

&hkdk4412_leds_gpio,
#endif
#if defined(CONFIG_LCD_LP101WH1)
&hkdk4412_lcd_lp101wh1,
#endif
Expand Down Expand Up @@ -1139,7 +1140,7 @@ static struct i2c_board_info hdmiphy_info = {
I2C_BOARD_INFO("hdmiphy-exynos4412", 0x38),
};
#endif

#if defined(CONFIG_ODROID_X_ANDROID_LEDS)
//------------------ ADD Hardkernel -------------------
#include <linux/hrtimer.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -1192,7 +1193,7 @@ static void hkdk4412_led_deinit(void)
}

//------------------ END Hardkernel -------------------

#endif
static void __init hkdk4412_gpio_init(void)
{
/* Peripheral power enable (P3V3) */
Expand Down Expand Up @@ -1221,10 +1222,12 @@ static void hkdk4412_power_off(void)
{
pr_emerg("Bye...\n");

#if defined(CONFIG_ODROID_X_ANDROID_LEDS)

// ADD Hardkernel
hkdk4412_led_deinit();
// END Hardkernel

#endif
writel(0x5200, S5P_PS_HOLD_CONTROL);
while (1) {
pr_emerg("%s : should not reach here!\n", __func__);
Expand All @@ -1235,11 +1238,12 @@ static void hkdk4412_power_off(void)
static void __init hkdk4412_machine_init(void)
{
hkdk4412_gpio_init();
#if defined(CONFIG_ODROID_X_ANDROID_LEDS)

// ADD Hardkernel
hkdk4412_led_init();
// END Hardkernel

#endif
/* Register power off function */
pm_power_off = hkdk4412_power_off;

Expand Down
21 changes: 21 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -537,4 +537,25 @@ config LEDS_TRIGGER_TRANSIENT
GPIO/PWM based hardware.
If unsure, say Y.

choice
prompt "ODROID-X LED Style"
default ODROID_X_ANDROID_LEDS
depends on MACH_HKDK4412
help
This is to choose between Android style (default on and flashing)
and Linux style (/sys/class/leds/ledX)

config ODROID_X_LINUX_LEDS
bool "Linux"
help
Linux style LEDs, Provides access to /sys/class/leds
default heartbeat on LED1

config ODROID_X_ANDROID_LEDS
bool "Android"
help
Android style LEDs, one always on, one blinking at 1s

endchoice

endif # NEW_LEDS
7 changes: 7 additions & 0 deletions drivers/usb/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,10 @@ config USB_HSIC_USB3503
depends on I2C
help
This option enables support for SMSC USB3503 HSIC to USB 2.0 Driver.
config USB3503_PORTS_SELF_POWER_DISABLED

boolean "Enable Ports 2 & 3 to be diabled"
depends on USB_HSIC_USB3503
help
Say Y here if you want the ports 2 and 3 to be disabled
when the hub goes into self power mode
5 changes: 5 additions & 0 deletions drivers/usb/misc/usb3503.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ static int usb3503_set_mode(struct usb3503_hubctl *hc, int mode)
goto exit;
}
#endif

/* PDS : Port2,3 Disable For Self Powered Operation */

err = -1;
#if defined(CONFIG_USB3503_PORTS_SELF_POWER_DISABLED)
err = reg_update(i2c_dev, PDS_REG, (PDS_PORT2 | PDS_PORT3), 1);
#endif
if (err < 0) {
pr_err(HUB_TAG "PDS update fail err = %d\n", err);
goto exit;
Expand Down