forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/usb/renesas_usbhs/common.h
....@@ -1,15 +1,18 @@
1
-// SPDX-License-Identifier: GPL-1.0+
1
+/* SPDX-License-Identifier: GPL-1.0+ */
22 /*
33 * Renesas USB driver
44 *
55 * Copyright (C) 2011 Renesas Solutions Corp.
6
+ * Copyright (C) 2019 Renesas Electronics Corporation
67 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
78 */
89 #ifndef RENESAS_USB_DRIVER_H
910 #define RENESAS_USB_DRIVER_H
1011
12
+#include <linux/clk.h>
1113 #include <linux/extcon.h>
1214 #include <linux/platform_device.h>
15
+#include <linux/reset.h>
1316 #include <linux/usb/renesas_usbhs.h>
1417
1518 struct usbhs_priv;
....@@ -102,6 +105,7 @@
102105
103106 /* SYSCFG */
104107 #define SCKE (1 << 10) /* USB Module Clock Enable */
108
+#define CNEN (1 << 8) /* Single-ended receiver operation Enable */
105109 #define HSE (1 << 7) /* High-Speed Operation Enable */
106110 #define DCFM (1 << 6) /* Controller Function Select */
107111 #define DRPD (1 << 5) /* D+ Line/D- Line Resistance Control */
....@@ -250,18 +254,15 @@
250254 unsigned int irq;
251255 unsigned long irqflags;
252256
253
- struct renesas_usbhs_platform_callback pfunc;
257
+ const struct renesas_usbhs_platform_callback *pfunc;
254258 struct renesas_usbhs_driver_param dparam;
255259
256260 struct delayed_work notify_hotplug_work;
257261 struct platform_device *pdev;
258262
259263 struct extcon_dev *edev;
260
- struct notifier_block nb;
261264
262265 spinlock_t lock;
263
-
264
- u32 flags;
265266
266267 /*
267268 * module control
....@@ -279,6 +280,8 @@
279280 struct usbhs_fifo_info fifo_info;
280281
281282 struct phy *phy;
283
+ struct reset_control *rsts;
284
+ struct clk *clks[2];
282285 };
283286
284287 /*
....@@ -290,6 +293,8 @@
290293
291294 #define usbhs_lock(p, f) spin_lock_irqsave(usbhs_priv_to_lock(p), f)
292295 #define usbhs_unlock(p, f) spin_unlock_irqrestore(usbhs_priv_to_lock(p), f)
296
+
297
+int usbhs_get_id_as_gadget(struct platform_device *pdev);
293298
294299 /*
295300 * sysconfig
....@@ -312,6 +317,7 @@
312317 void usbhs_bus_send_reset(struct usbhs_priv *priv);
313318 int usbhs_bus_get_speed(struct usbhs_priv *priv);
314319 int usbhs_vbus_ctrl(struct usbhs_priv *priv, int enable);
320
+int usbhsc_schedule_notify_hotplug(struct platform_device *pdev);
315321
316322 /*
317323 * frame