| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-1.0+ |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-1.0+ */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * Renesas USB driver |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * Copyright (C) 2011 Renesas Solutions Corp. |
|---|
| 6 | + * Copyright (C) 2019 Renesas Electronics Corporation |
|---|
| 6 | 7 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
|---|
| 7 | 8 | */ |
|---|
| 8 | 9 | #ifndef RENESAS_USB_DRIVER_H |
|---|
| 9 | 10 | #define RENESAS_USB_DRIVER_H |
|---|
| 10 | 11 | |
|---|
| 12 | +#include <linux/clk.h> |
|---|
| 11 | 13 | #include <linux/extcon.h> |
|---|
| 12 | 14 | #include <linux/platform_device.h> |
|---|
| 15 | +#include <linux/reset.h> |
|---|
| 13 | 16 | #include <linux/usb/renesas_usbhs.h> |
|---|
| 14 | 17 | |
|---|
| 15 | 18 | struct usbhs_priv; |
|---|
| .. | .. |
|---|
| 102 | 105 | |
|---|
| 103 | 106 | /* SYSCFG */ |
|---|
| 104 | 107 | #define SCKE (1 << 10) /* USB Module Clock Enable */ |
|---|
| 108 | +#define CNEN (1 << 8) /* Single-ended receiver operation Enable */ |
|---|
| 105 | 109 | #define HSE (1 << 7) /* High-Speed Operation Enable */ |
|---|
| 106 | 110 | #define DCFM (1 << 6) /* Controller Function Select */ |
|---|
| 107 | 111 | #define DRPD (1 << 5) /* D+ Line/D- Line Resistance Control */ |
|---|
| .. | .. |
|---|
| 250 | 254 | unsigned int irq; |
|---|
| 251 | 255 | unsigned long irqflags; |
|---|
| 252 | 256 | |
|---|
| 253 | | - struct renesas_usbhs_platform_callback pfunc; |
|---|
| 257 | + const struct renesas_usbhs_platform_callback *pfunc; |
|---|
| 254 | 258 | struct renesas_usbhs_driver_param dparam; |
|---|
| 255 | 259 | |
|---|
| 256 | 260 | struct delayed_work notify_hotplug_work; |
|---|
| 257 | 261 | struct platform_device *pdev; |
|---|
| 258 | 262 | |
|---|
| 259 | 263 | struct extcon_dev *edev; |
|---|
| 260 | | - struct notifier_block nb; |
|---|
| 261 | 264 | |
|---|
| 262 | 265 | spinlock_t lock; |
|---|
| 263 | | - |
|---|
| 264 | | - u32 flags; |
|---|
| 265 | 266 | |
|---|
| 266 | 267 | /* |
|---|
| 267 | 268 | * module control |
|---|
| .. | .. |
|---|
| 279 | 280 | struct usbhs_fifo_info fifo_info; |
|---|
| 280 | 281 | |
|---|
| 281 | 282 | struct phy *phy; |
|---|
| 283 | + struct reset_control *rsts; |
|---|
| 284 | + struct clk *clks[2]; |
|---|
| 282 | 285 | }; |
|---|
| 283 | 286 | |
|---|
| 284 | 287 | /* |
|---|
| .. | .. |
|---|
| 290 | 293 | |
|---|
| 291 | 294 | #define usbhs_lock(p, f) spin_lock_irqsave(usbhs_priv_to_lock(p), f) |
|---|
| 292 | 295 | #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); |
|---|
| 293 | 298 | |
|---|
| 294 | 299 | /* |
|---|
| 295 | 300 | * sysconfig |
|---|
| .. | .. |
|---|
| 312 | 317 | void usbhs_bus_send_reset(struct usbhs_priv *priv); |
|---|
| 313 | 318 | int usbhs_bus_get_speed(struct usbhs_priv *priv); |
|---|
| 314 | 319 | int usbhs_vbus_ctrl(struct usbhs_priv *priv, int enable); |
|---|
| 320 | +int usbhsc_schedule_notify_hotplug(struct platform_device *pdev); |
|---|
| 315 | 321 | |
|---|
| 316 | 322 | /* |
|---|
| 317 | 323 | * frame |
|---|