Icera Bruce modem is using tegra_ehci2_device on t124 Ardbeg with HSIC
phy, so enable USB2 UHSIC PHY wakeup source so that remote wakeup can
work in LP0.
Also add a generic function tegra_set_wake_source() in wakeups-t12x.c,
which can be used to modify tegra_wake_event_irq table from board files.
Bug
1333745
Change-Id: Ia58998fc71c0575d87fc65b00a7bd6e7cd49a3f7
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: http://git-master/r/254199
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
switch (modem_id) {
case TEGRA_BB_BRUCE:
- if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
+ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
+ /* Set specific USB wake source for Ardbeg */
+ if (board_info.board_id == BOARD_E1780)
+ tegra_set_wake_source(42, INT_USB2);
platform_device_register(&icera_bruce_device);
+ }
break;
case TEGRA_BB_HSIC_HUB: /* HSIC hub */
if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
tegra_ehci2_device.dev.platform_data =
&tegra_ehci2_hsic_smsc_hub_pdata;
+ /* Set specific USB wake source for Ardbeg */
+ if (board_info.board_id == BOARD_E1780)
+ tegra_set_wake_source(42, INT_USB2);
platform_device_register(&tegra_ehci2_device);
}
break;
int tegra_gpio_to_wake(int gpio);
void tegra_irq_to_wake(int irq, int *wak_list, int *wak_size);
int tegra_wake_to_irq(int wake);
+int tegra_set_wake_source(int wake, int wake_int);
int tegra_disable_wake_source(int wake);
#else
static inline int tegra_pm_irq_set_wake_type(int wake, int flow_type)
*wak_size = 0;
return;
}
+static inline int tegra_set_wake_source(int wake, int wake_int)
+{
+ return 0;
+}
static inline int tegra_disable_wake_source(int wake)
{
return 0;
return ret;
}
-int tegra_disable_wake_source(int wake)
+int tegra_set_wake_source(int wake, int irq)
{
+ if (wake < 0)
+ return -EINVAL;
+
if (wake >= ARRAY_SIZE(tegra_wake_event_irq))
return -EINVAL;
- tegra_wake_event_irq[wake] = -EINVAL;
+ tegra_wake_event_irq[wake] = irq;
return 0;
}
+
+int tegra_disable_wake_source(int wake)
+{
+ return tegra_set_wake_source(wake, -EINVAL);
+}