Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: renesas_usbhs: Add support for RZ/A2

The RZ/A2 is similar to the R-Car Gen3 with some small differences.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chris Brandt and committed by
Greg Kroah-Hartman
b69dce63 f7560669

+90 -1
+1 -1
drivers/usb/renesas_usbhs/Makefile
··· 5 5 6 6 obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs.o 7 7 8 - renesas_usbhs-y := common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o 8 + renesas_usbhs-y := common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o rza2.o 9 9 10 10 ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),) 11 11 renesas_usbhs-y += mod_host.o
+15
drivers/usb/renesas_usbhs/common.c
··· 571 571 } 572 572 }; 573 573 574 + static const struct usbhs_of_data rza2_data = { 575 + .platform_callback = &usbhs_rza2_ops, 576 + .param = { 577 + .type = USBHS_TYPE_RZA2, 578 + .has_cnen = 1, 579 + .cfifo_byte_addr = 1, 580 + .pipe_configs = usbhsc_new_pipe, 581 + .pipe_size = ARRAY_SIZE(usbhsc_new_pipe), 582 + } 583 + }; 584 + 574 585 /* 575 586 * platform functions 576 587 */ ··· 629 618 { 630 619 .compatible = "renesas,rza1-usbhs", 631 620 .data = &rza1_data, 621 + }, 622 + { 623 + .compatible = "renesas,rza2-usbhs", 624 + .data = &rza2_data, 632 625 }, 633 626 { }, 634 627 };
+1
drivers/usb/renesas_usbhs/rza.h
··· 2 2 #include "common.h" 3 3 4 4 extern const struct renesas_usbhs_platform_callback usbhs_rza1_ops; 5 + extern const struct renesas_usbhs_platform_callback usbhs_rza2_ops;
+72
drivers/usb/renesas_usbhs/rza2.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Renesas USB driver RZ/A2 initialization and power control 4 + * 5 + * Copyright (C) 2019 Chris Brandt 6 + * Copyright (C) 2019 Renesas Electronics Corporation 7 + */ 8 + 9 + #include <linux/delay.h> 10 + #include <linux/io.h> 11 + #include <linux/of_device.h> 12 + #include <linux/phy/phy.h> 13 + #include "common.h" 14 + #include "rza.h" 15 + 16 + static int usbhs_rza2_hardware_init(struct platform_device *pdev) 17 + { 18 + struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); 19 + struct phy *phy = phy_get(&pdev->dev, "usb"); 20 + 21 + if (IS_ERR(phy)) 22 + return PTR_ERR(phy); 23 + 24 + priv->phy = phy; 25 + return 0; 26 + } 27 + 28 + static int usbhs_rza2_hardware_exit(struct platform_device *pdev) 29 + { 30 + struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); 31 + 32 + phy_put(priv->phy); 33 + priv->phy = NULL; 34 + 35 + return 0; 36 + } 37 + 38 + static int usbhs_rza2_power_ctrl(struct platform_device *pdev, 39 + void __iomem *base, int enable) 40 + { 41 + struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); 42 + int retval = 0; 43 + 44 + if (!priv->phy) 45 + return -ENODEV; 46 + 47 + if (enable) { 48 + retval = phy_init(priv->phy); 49 + usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM); 50 + udelay(100); /* Wait for PLL to become stable */ 51 + if (!retval) 52 + retval = phy_power_on(priv->phy); 53 + } else { 54 + usbhs_bset(priv, SUSPMODE, SUSPM, 0); 55 + phy_power_off(priv->phy); 56 + phy_exit(priv->phy); 57 + } 58 + 59 + return retval; 60 + } 61 + 62 + static int usbhs_rza2_get_id(struct platform_device *pdev) 63 + { 64 + return USBHS_GADGET; 65 + } 66 + 67 + const struct renesas_usbhs_platform_callback usbhs_rza2_ops = { 68 + .hardware_init = usbhs_rza2_hardware_init, 69 + .hardware_exit = usbhs_rza2_hardware_exit, 70 + .power_ctrl = usbhs_rza2_power_ctrl, 71 + .get_id = usbhs_rza2_get_id, 72 + };
+1
include/linux/usb/renesas_usbhs.h
··· 199 199 #define USBHS_TYPE_RCAR_GEN3 2 200 200 #define USBHS_TYPE_RCAR_GEN3_WITH_PLL 3 201 201 #define USBHS_TYPE_RZA1 4 202 + #define USBHS_TYPE_RZA2 5 202 203 203 204 /* 204 205 * option: