aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/musb/musb_dsps.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 09648b4e40c2..b23ad150a165 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -615,6 +615,24 @@ static int dsps_musb_recover(struct musb *musb)
615 return session_restart ? 0 : -EPIPE; 615 return session_restart ? 0 : -EPIPE;
616} 616}
617 617
618/* Similar to am35x, dm81xx support only 32-bit read operation */
619static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
620{
621 void __iomem *fifo = hw_ep->fifo;
622
623 if (len >= 4) {
624 readsl(fifo, dst, len >> 2);
625 dst += len & ~0x03;
626 len &= 0x03;
627 }
628
629 /* Read any remaining 1 to 3 bytes */
630 if (len > 0) {
631 u32 val = musb_readl(fifo, 0);
632 memcpy(dst, &val, len);
633 }
634}
635
618static struct musb_platform_ops dsps_ops = { 636static struct musb_platform_ops dsps_ops = {
619 .quirks = MUSB_INDEXED_EP, 637 .quirks = MUSB_INDEXED_EP,
620 .init = dsps_musb_init, 638 .init = dsps_musb_init,
@@ -761,6 +779,9 @@ static int dsps_probe(struct platform_device *pdev)
761 } 779 }
762 wrp = match->data; 780 wrp = match->data;
763 781
782 if (of_device_is_compatible(pdev->dev.of_node, "ti,musb-dm816"))
783 dsps_ops.read_fifo = dsps_read_fifo32;
784
764 /* allocate glue */ 785 /* allocate glue */
765 glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); 786 glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
766 if (!glue) 787 if (!glue)
@@ -837,7 +858,9 @@ static const struct dsps_musb_wrapper am33xx_driver_data = {
837 858
838static const struct of_device_id musb_dsps_of_match[] = { 859static const struct of_device_id musb_dsps_of_match[] = {
839 { .compatible = "ti,musb-am33xx", 860 { .compatible = "ti,musb-am33xx",
840 .data = (void *) &am33xx_driver_data, }, 861 .data = &am33xx_driver_data, },
862 { .compatible = "ti,musb-dm816",
863 .data = &am33xx_driver_data, },
841 { }, 864 { },
842}; 865};
843MODULE_DEVICE_TABLE(of, musb_dsps_of_match); 866MODULE_DEVICE_TABLE(of, musb_dsps_of_match);