summaryrefslogtreecommitdiff
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>2016-10-25 17:44:20 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-27 15:12:08 +0200
commit7c23baa90db1115fbd2b1aca5e07fae091c8dc28 (patch)
tree248684d39379c5a53323da743711f0bbf8056153 /drivers/staging/most
parent1e80e19ce9c67b2fecce9068ad40d1e778faa58f (diff)
staging: most: hdm-usb: do h/w specific synchronization at configuration time
This patch puts the synchronization procedure trigger for asynchronous channels into the function hdm_configure_channel. Likewise, it removes triggering of hardware specific synchronization for other channel types from the probe function as it is not required. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/hdm-usb/hdm_usb.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
index 1a630e1b9392..db11930f2811 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -695,6 +695,15 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
- conf->buffer_size;
exit:
mdev->conf[channel] = *conf;
+ if (conf->data_type == MOST_CH_ASYNC) {
+ u16 ep = mdev->ep_address[channel];
+ int err = drci_wr_reg(mdev->usb_device,
+ DRCI_REG_BASE + DRCI_COMMAND + ep * 16,
+ 1);
+
+ if (err < 0)
+ dev_warn(dev, "sync for ep%02x failed", ep);
+ }
return 0;
}
@@ -1111,7 +1120,6 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
struct most_channel_capability *tmp_cap;
struct usb_endpoint_descriptor *ep_desc;
int ret = 0;
- int err;
if (!mdev)
goto exit_ENOMEM;
@@ -1187,13 +1195,6 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
tmp_cap++;
init_usb_anchor(&mdev->busy_urbs[i]);
spin_lock_init(&mdev->channel_lock[i]);
- err = drci_wr_reg(usb_dev,
- DRCI_REG_BASE + DRCI_COMMAND +
- ep_desc->bEndpointAddress * 16,
- 1);
- if (err < 0)
- dev_warn(dev, "DCI Sync for EP %02x failed",
- ep_desc->bEndpointAddress);
}
dev_notice(dev, "claimed gadget: Vendor=%4.4x ProdID=%4.4x Bus=%02x Device=%02x\n",
le16_to_cpu(usb_dev->descriptor.idVendor),