summaryrefslogtreecommitdiff
path: root/drivers/usb/isp1760/isp1760-udc.h
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2021-05-13 11:47:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-21 21:05:31 +0300
commit1da9e1c06873350c99ba49a052f92de85f2c69f2 (patch)
treec5b957e7fadeab2b9fed6c291ea4e958fa9420c4 /drivers/usb/isp1760/isp1760-udc.h
parentabfabc8ae3bd625f57fa35d25f2435bb6465a3b1 (diff)
downloadlinux-1da9e1c06873350c99ba49a052f92de85f2c69f2.tar.xz
usb: isp1760: move to regmap for register access
Rework access to registers and memory to use regmap framework. No change in current feature or way of work is intended with this change. This will allow to reuse this driver with other IP of this family, for example isp1763, with little changes and effort. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Link: https://lore.kernel.org/r/20210513084717.2487366-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/isp1760/isp1760-udc.h')
-rw-r--r--drivers/usb/isp1760/isp1760-udc.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/isp1760/isp1760-udc.h b/drivers/usb/isp1760/isp1760-udc.h
index d2df650d54e9..a49096c0ac8e 100644
--- a/drivers/usb/isp1760/isp1760-udc.h
+++ b/drivers/usb/isp1760/isp1760-udc.h
@@ -17,6 +17,8 @@
#include <linux/timer.h>
#include <linux/usb/gadget.h>
+#include "isp1760-regs.h"
+
struct isp1760_device;
struct isp1760_udc;
@@ -48,7 +50,7 @@ struct isp1760_ep {
* struct isp1760_udc - UDC state information
* irq: IRQ number
* irqname: IRQ name (as passed to request_irq)
- * regs: Base address of the UDC registers
+ * regs: regmap for UDC registers
* driver: Gadget driver
* gadget: Gadget device
* lock: Protects driver, vbus_timer, ep, ep0_*, DC_EPINDEX register
@@ -59,12 +61,13 @@ struct isp1760_ep {
* connected: Tracks gadget driver bus connection state
*/
struct isp1760_udc {
-#ifdef CONFIG_USB_ISP1761_UDC
struct isp1760_device *isp;
int irq;
char *irqname;
- void __iomem *regs;
+
+ struct regmap *regs;
+ struct regmap_field *fields[DC_FIELD_MAX];
struct usb_gadget_driver *driver;
struct usb_gadget gadget;
@@ -81,7 +84,6 @@ struct isp1760_udc {
bool connected;
unsigned int devstatus;
-#endif
};
#ifdef CONFIG_USB_ISP1761_UDC