Skip to content

Commit e72838d

Browse files
pcercueigregkh
authored andcommitted
usb: musb: jz4740: Add support for the JZ4770
Add support for probing the jz4740-musb driver on the JZ4770 SoC. The USB IP in the JZ4770 works the same Inventra IP as for the JZ4740, but it features more endpoints, and officially supports OTG. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Bin Liu <b-liu@ti.com> Link: https://lore.kernel.org/r/20200316211136.2274-7-b-liu@ti.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c12aa5b commit e72838d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

drivers/usb/musb/jz4740.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,33 @@ static const struct musb_hdrc_platform_data jz4740_musb_pdata = {
163163
.platform_ops = &jz4740_musb_ops,
164164
};
165165

166+
static struct musb_fifo_cfg jz4770_musb_fifo_cfg[] = {
167+
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
168+
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
169+
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
170+
{ .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, },
171+
{ .hw_ep_num = 3, .style = FIFO_TX, .maxpacket = 512, },
172+
{ .hw_ep_num = 3, .style = FIFO_RX, .maxpacket = 512, },
173+
{ .hw_ep_num = 4, .style = FIFO_TX, .maxpacket = 512, },
174+
{ .hw_ep_num = 4, .style = FIFO_RX, .maxpacket = 512, },
175+
{ .hw_ep_num = 5, .style = FIFO_TX, .maxpacket = 512, },
176+
{ .hw_ep_num = 5, .style = FIFO_RX, .maxpacket = 512, },
177+
};
178+
179+
static struct musb_hdrc_config jz4770_musb_config = {
180+
.multipoint = 1,
181+
.num_eps = 11,
182+
.ram_bits = 11,
183+
.fifo_cfg = jz4770_musb_fifo_cfg,
184+
.fifo_cfg_size = ARRAY_SIZE(jz4770_musb_fifo_cfg),
185+
};
186+
187+
static const struct musb_hdrc_platform_data jz4770_musb_pdata = {
188+
.mode = MUSB_PERIPHERAL, /* TODO: support OTG */
189+
.config = &jz4770_musb_config,
190+
.platform_ops = &jz4740_musb_ops,
191+
};
192+
166193
static int jz4740_probe(struct platform_device *pdev)
167194
{
168195
struct device *dev = &pdev->dev;
@@ -250,6 +277,7 @@ static int jz4740_remove(struct platform_device *pdev)
250277

251278
static const struct of_device_id jz4740_musb_of_match[] = {
252279
{ .compatible = "ingenic,jz4740-musb", .data = &jz4740_musb_pdata },
280+
{ .compatible = "ingenic,jz4770-musb", .data = &jz4770_musb_pdata },
253281
{ /* sentinel */ },
254282
};
255283
MODULE_DEVICE_TABLE(of, jz4740_musb_of_match);

0 commit comments

Comments
 (0)