Skip to content

Commit f89abbe

Browse files
committed
Merge pull request #4 from xenoxaos/odroidx-next
Adding the option to disable disabling ports 2&3 when going into self po...
2 parents 58885ea + 8ac90a3 commit f89abbe

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

arch/arm/mach-exynos/mach-hkdk4412.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@ static struct i2c_board_info hkdk4412_i2c_devs7[] __initdata = {
892892
/* nothing here yet */
893893
};
894894

895-
// Disable
896-
#if 0
895+
896+
#if defined(CONFIG_ODROID_X_LINUX_LEDS)
897897
static struct gpio_led hkdk4412_gpio_leds[] = {
898898
{
899899
.name = "led1", /* D5 on ODROID-X */
@@ -1096,10 +1096,11 @@ static struct platform_device *hkdk4412_devices[] __initdata = {
10961096
#endif
10971097
&exynos4_device_ohci,
10981098
&exynos4_device_dwmci,
1099+
#if defined(CONFIG_ODROID_X_LINUX_LEDS)
10991100

11001101
// Disable : ADD
1101-
// &hkdk4412_leds_gpio,
1102-
1102+
&hkdk4412_leds_gpio,
1103+
#endif
11031104
#if defined(CONFIG_LCD_LP101WH1)
11041105
&hkdk4412_lcd_lp101wh1,
11051106
#endif
@@ -1139,7 +1140,7 @@ static struct i2c_board_info hdmiphy_info = {
11391140
I2C_BOARD_INFO("hdmiphy-exynos4412", 0x38),
11401141
};
11411142
#endif
1142-
1143+
#if defined(CONFIG_ODROID_X_ANDROID_LEDS)
11431144
//------------------ ADD Hardkernel -------------------
11441145
#include <linux/hrtimer.h>
11451146
#include <linux/slab.h>
@@ -1192,7 +1193,7 @@ static void hkdk4412_led_deinit(void)
11921193
}
11931194

11941195
//------------------ END Hardkernel -------------------
1195-
1196+
#endif
11961197
static void __init hkdk4412_gpio_init(void)
11971198
{
11981199
/* Peripheral power enable (P3V3) */
@@ -1221,10 +1222,12 @@ static void hkdk4412_power_off(void)
12211222
{
12221223
pr_emerg("Bye...\n");
12231224

1225+
#if defined(CONFIG_ODROID_X_ANDROID_LEDS)
1226+
12241227
// ADD Hardkernel
12251228
hkdk4412_led_deinit();
12261229
// END Hardkernel
1227-
1230+
#endif
12281231
writel(0x5200, S5P_PS_HOLD_CONTROL);
12291232
while (1) {
12301233
pr_emerg("%s : should not reach here!\n", __func__);
@@ -1235,11 +1238,12 @@ static void hkdk4412_power_off(void)
12351238
static void __init hkdk4412_machine_init(void)
12361239
{
12371240
hkdk4412_gpio_init();
1241+
#if defined(CONFIG_ODROID_X_ANDROID_LEDS)
12381242

12391243
// ADD Hardkernel
12401244
hkdk4412_led_init();
12411245
// END Hardkernel
1242-
1246+
#endif
12431247
/* Register power off function */
12441248
pm_power_off = hkdk4412_power_off;
12451249

drivers/leds/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,25 @@ config LEDS_TRIGGER_TRANSIENT
537537
GPIO/PWM based hardware.
538538
If unsure, say Y.
539539

540+
choice
541+
prompt "ODROID-X LED Style"
542+
default ODROID_X_ANDROID_LEDS
543+
depends on MACH_HKDK4412
544+
help
545+
This is to choose between Android style (default on and flashing)
546+
and Linux style (/sys/class/leds/ledX)
547+
548+
config ODROID_X_LINUX_LEDS
549+
bool "Linux"
550+
help
551+
Linux style LEDs, Provides access to /sys/class/leds
552+
default heartbeat on LED1
553+
554+
config ODROID_X_ANDROID_LEDS
555+
bool "Android"
556+
help
557+
Android style LEDs, one always on, one blinking at 1s
558+
559+
endchoice
560+
540561
endif # NEW_LEDS

drivers/usb/misc/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,10 @@ config USB_HSIC_USB3503
249249
depends on I2C
250250
help
251251
This option enables support for SMSC USB3503 HSIC to USB 2.0 Driver.
252+
config USB3503_PORTS_SELF_POWER_DISABLED
253+
254+
boolean "Enable Ports 2 & 3 to be diabled"
255+
depends on USB_HSIC_USB3503
256+
help
257+
Say Y here if you want the ports 2 and 3 to be disabled
258+
when the hub goes into self power mode

drivers/usb/misc/usb3503.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,13 @@ static int usb3503_set_mode(struct usb3503_hubctl *hc, int mode)
197197
goto exit;
198198
}
199199
#endif
200+
200201
/* PDS : Port2,3 Disable For Self Powered Operation */
202+
203+
err = -1;
204+
#if defined(CONFIG_USB3503_PORTS_SELF_POWER_DISABLED)
201205
err = reg_update(i2c_dev, PDS_REG, (PDS_PORT2 | PDS_PORT3), 1);
206+
#endif
202207
if (err < 0) {
203208
pr_err(HUB_TAG "PDS update fail err = %d\n", err);
204209
goto exit;

0 commit comments

Comments
 (0)