summaryrefslogtreecommitdiffstats
path: root/drivers/usb/common
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-14 14:37:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-14 14:37:50 -0400
commit81522637485dd6ec9de4279c9714d58f884b6091 (patch)
tree74657b5881c08b1e6a7042482e593897e678afe2 /drivers/usb/common
parent54a2ec67f1db62a763f57b7f8f2e82874f5f358b (diff)
parente6be244a83211f3a9daaf5e29ee97fe0bf1efe5a (diff)
Merge tag 'usb-for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes: usb: patches for v4.9 merge window This time around we have 92 non-merge commits. Most of the changes are in drivers/usb/gadget (40.3%) with drivers/usb/gadget/function being the most active directory (27.2%). As for UDC drivers, only dwc3 (26.5%) and dwc2 (12.7%) have really been active. The most important changes for dwc3 are better support for scatterlist and, again, throughput improvements. While on dwc2 got some minor stability fixes related to soft reset and FIFO usage. Felipe Tonello has done some good work fixing up our f_midi gadget and Tal Shorer has implemented a nice API change for our ULPI bus. Apart from these, we have our usual set of non-critical fixes, spelling fixes, build warning fixes, etc.
Diffstat (limited to 'drivers/usb/common')
-rw-r--r--drivers/usb/common/ulpi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index e04a34e7a341..8b317702d761 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -21,13 +21,13 @@
21 21
22int ulpi_read(struct ulpi *ulpi, u8 addr) 22int ulpi_read(struct ulpi *ulpi, u8 addr)
23{ 23{
24 return ulpi->ops->read(ulpi->ops, addr); 24 return ulpi->ops->read(ulpi->dev.parent, addr);
25} 25}
26EXPORT_SYMBOL_GPL(ulpi_read); 26EXPORT_SYMBOL_GPL(ulpi_read);
27 27
28int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val) 28int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val)
29{ 29{
30 return ulpi->ops->write(ulpi->ops, addr, val); 30 return ulpi->ops->write(ulpi->dev.parent, addr, val);
31} 31}
32EXPORT_SYMBOL_GPL(ulpi_write); 32EXPORT_SYMBOL_GPL(ulpi_write);
33 33
@@ -157,6 +157,8 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
157{ 157{
158 int ret; 158 int ret;
159 159
160 ulpi->dev.parent = dev; /* needed early for ops */
161
160 /* Test the interface */ 162 /* Test the interface */
161 ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa); 163 ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa);
162 if (ret < 0) 164 if (ret < 0)
@@ -175,7 +177,6 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
175 ulpi->id.product = ulpi_read(ulpi, ULPI_PRODUCT_ID_LOW); 177 ulpi->id.product = ulpi_read(ulpi, ULPI_PRODUCT_ID_LOW);
176 ulpi->id.product |= ulpi_read(ulpi, ULPI_PRODUCT_ID_HIGH) << 8; 178 ulpi->id.product |= ulpi_read(ulpi, ULPI_PRODUCT_ID_HIGH) << 8;
177 179
178 ulpi->dev.parent = dev;
179 ulpi->dev.bus = &ulpi_bus; 180 ulpi->dev.bus = &ulpi_bus;
180 ulpi->dev.type = &ulpi_dev_type; 181 ulpi->dev.type = &ulpi_dev_type;
181 dev_set_name(&ulpi->dev, "%s.ulpi", dev_name(dev)); 182 dev_set_name(&ulpi->dev, "%s.ulpi", dev_name(dev));
@@ -202,7 +203,8 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
202 * Allocates and registers a ULPI device and an interface for it. Called from 203 * Allocates and registers a ULPI device and an interface for it. Called from
203 * the USB controller that provides the ULPI interface. 204 * the USB controller that provides the ULPI interface.
204 */ 205 */
205struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi_ops *ops) 206struct ulpi *ulpi_register_interface(struct device *dev,
207 const struct ulpi_ops *ops)
206{ 208{
207 struct ulpi *ulpi; 209 struct ulpi *ulpi;
208 int ret; 210 int ret;
@@ -212,7 +214,6 @@ struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi_ops *ops)
212 return ERR_PTR(-ENOMEM); 214 return ERR_PTR(-ENOMEM);
213 215
214 ulpi->ops = ops; 216 ulpi->ops = ops;
215 ops->dev = dev;
216 217
217 ret = ulpi_register(dev, ulpi); 218 ret = ulpi_register(dev, ulpi);
218 if (ret) { 219 if (ret) {