Skip to content

Commit 1a76b63

Browse files
Xu Yanggregkh
authored andcommitted
usb: chipidea: imx: add imx_usbmisc_pullup() hook
It's used to do other pullup related operations if needs. Signed-off-by: Xu Yang <[email protected]> Acked-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 78c7655 commit 1a76b63

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

drivers/usb/chipidea/ci_hdrc_imx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
3737
int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
3838
int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup);
3939
int imx_usbmisc_resume(struct imx_usbmisc_data *data, bool wakeup);
40+
int imx_usbmisc_pullup(struct imx_usbmisc_data *data, bool on);
4041

4142
#endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */

drivers/usb/chipidea/usbmisc_imx.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ struct usbmisc_ops {
170170
int (*charger_detection)(struct imx_usbmisc_data *data);
171171
/* It's called when system resume from usb power lost */
172172
int (*power_lost_check)(struct imx_usbmisc_data *data);
173+
/* It's called when device controller changed pullup status */
174+
void (*pullup)(struct imx_usbmisc_data *data, bool on);
175+
/* It's called during suspend/resume to save power */
173176
void (*vbus_comparator_on)(struct imx_usbmisc_data *data, bool on);
174177
};
175178

@@ -1225,6 +1228,21 @@ int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect)
12251228
}
12261229
EXPORT_SYMBOL_GPL(imx_usbmisc_charger_detection);
12271230

1231+
int imx_usbmisc_pullup(struct imx_usbmisc_data *data, bool on)
1232+
{
1233+
struct imx_usbmisc *usbmisc;
1234+
1235+
if (!data)
1236+
return 0;
1237+
1238+
usbmisc = dev_get_drvdata(data->dev);
1239+
if (usbmisc->ops->pullup)
1240+
usbmisc->ops->pullup(data, on);
1241+
1242+
return 0;
1243+
}
1244+
EXPORT_SYMBOL_GPL(imx_usbmisc_pullup);
1245+
12281246
int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup)
12291247
{
12301248
struct imx_usbmisc *usbmisc;

0 commit comments

Comments
 (0)