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

usb: gadget: s3c-hsotg: get phy bus width from phy subsystem

Adds support for querying the phy bus width from the generic phy
subsystem. Configure UTMI bus width in GUSBCFG based on this value.

Signed-off-by: Matt Porter <mporter@linaro.org>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Matt Porter and committed by
Felipe Balbi
f7e504c7 74084844

+14 -1
+13 -1
drivers/usb/gadget/s3c-hsotg.c
··· 146 146 * @regs: The memory area mapped for accessing registers. 147 147 * @irq: The IRQ number we are using 148 148 * @supplies: Definition of USB power supplies 149 + * @phyif: PHY interface width 149 150 * @dedicated_fifos: Set if the hardware has dedicated IN-EP fifos. 150 151 * @num_of_eps: Number of available EPs (excluding EP0) 151 152 * @debug_root: root directrory for debugfs. ··· 175 174 176 175 struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsotg_supply_names)]; 177 176 177 + u32 phyif; 178 178 unsigned int dedicated_fifos:1; 179 179 unsigned char num_of_eps; 180 180 ··· 2290 2288 */ 2291 2289 2292 2290 /* set the PLL on, remove the HNP/SRP and set the PHY */ 2293 - writel(GUSBCFG_PHYIf16 | GUSBCFG_TOutCal(7) | 2291 + writel(hsotg->phyif | GUSBCFG_TOutCal(7) | 2294 2292 (0x5 << 10), hsotg->regs + GUSBCFG); 2295 2293 2296 2294 s3c_hsotg_init_fifo(hsotg); ··· 3647 3645 dev_err(hsotg->dev, "failed to enable supplies: %d\n", ret); 3648 3646 goto err_supplies; 3649 3647 } 3648 + 3649 + /* Set default UTMI width */ 3650 + hsotg->phyif = GUSBCFG_PHYIf16; 3651 + 3652 + /* 3653 + * If using the generic PHY framework, check if the PHY bus 3654 + * width is 8-bit and set the phyif appropriately. 3655 + */ 3656 + if (hsotg->phy && (phy_get_bus_width(phy) == 8)) 3657 + hsotg->phyif = GUSBCFG_PHYIf8; 3650 3658 3651 3659 if (hsotg->phy) 3652 3660 phy_init(hsotg->phy);
+1
drivers/usb/gadget/s3c-hsotg.h
··· 55 55 #define GUSBCFG_HNPCap (1 << 9) 56 56 #define GUSBCFG_SRPCap (1 << 8) 57 57 #define GUSBCFG_PHYIf16 (1 << 3) 58 + #define GUSBCFG_PHYIf8 (0 << 3) 58 59 #define GUSBCFG_TOutCal_MASK (0x7 << 0) 59 60 #define GUSBCFG_TOutCal_SHIFT (0) 60 61 #define GUSBCFG_TOutCal_LIMIT (0x7)