da8xx USB PHY (was da8xx USB clocks)
Subsystems (6)
v5 cover da8xx USB PHY (was da8xx USB clocks)
v5 changes:
Functionally, nothing has really changed. Just some cleanups based on feedback.
* Renamed "usbphy" to "usb_phy" or "usb-phy" as appropriate
* License header matches MODULE_LICENSE in new phy driver
David Lechner (7):
mfd: da8xx-cfgchip: New header file for CFGCHIP registers.
dt-bindings: Add bindings for phy-da8xx-usb
phy: Add set_mode callback
phy: da8xx-usb: new driver for DA8xx SoC USB PHY
usb: ohci-da8xx: Remove code that references mach
usb: musb: da8xx: Use devm in probe
usb: musb: da8xx: Remove mach code
.../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++ drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-core.c | 15 ++ drivers/phy/phy-da8xx-usb.c | 244 +++++++++++++++++++++ drivers/usb/host/Kconfig | 1 + drivers/usb/host/ohci-da8xx.c | 102 +++++---- drivers/usb/musb/Kconfig | 2 +- drivers/usb/musb/da8xx.c | 154 +++++-------- include/linux/mfd/da8xx-cfgchip.h | 153 +++++++++++++ include/linux/phy/phy.h | 17 ++ include/linux/platform_data/usb-davinci.h | 22 -- 12 files changed, 592 insertions(+), 169 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt create mode 100644 drivers/phy/phy-da8xx-usb.c create mode 100644 include/linux/mfd/da8xx-cfgchip.h
Signature · 1 line
2.7.4
PATCH v5 1/7 mfd: da8xx-cfgchip: New header file for CFGCHIP registers.
We will be using a generic syscon device for the TI DA8XX SoC CFGCHIPx retisters. This will be used by a number of planned drivers including a new USB PHY driver and common clock framework drivers.
The same defines are removed from the platform_data header file since they are now redundant and they didn't really belong there anyway.
--- include/linux/mfd/da8xx-cfgchip.h | 153 ++++++++++++++++++++++++++++++ include/linux/platform_data/usb-davinci.h | 22 ----- 2 files changed, 153 insertions(+), 22 deletions(-) create mode 100644 include/linux/mfd/da8xx-cfgchip.h
include/linux/mfd/da8xx-cfgchip.h new file +153 -0
@@ -0,0 +1,153 @@ +/* +* TI DaVinci DA8xx CHIPCFGx registers for syscon consumers. +* +* Copyright (C) 2016 David Lechner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef __LINUX_MFD_DA8XX_CFGCHIP_H +#define __LINUX_MFD_DA8XX_CFGCHIP_H + +#include <linux/bitops.h> + +/* register offset (32-bit registers) */ +#define CFGCHIP (n) ((n) * 4) + +/* CFGCHIP0 (PLL0/EDMA3_0) register bits */ +#define CFGCHIP0_PLL_MASTER_LOCK BIT(4) +#define CFGCHIP0_EDMA30TC1DBS (n) ((n) << 2) +#define CFGCHIP0_EDMA30TC1DBS_MASK CFGCHIP0_EDMA30TC1DBS(0x3) +#define CFGCHIP0_EDMA30TC1DBS_16 CFGCHIP0_EDMA30TC1DBS(0x0) +#define CFGCHIP0_EDMA30TC1DBS_32 CFGCHIP0_EDMA30TC1DBS(0x1) +#define CFGCHIP0_EDMA30TC1DBS_64 CFGCHIP0_EDMA30TC1DBS(0x2) +#define CFGCHIP0_EDMA30TC0DBS (n) ((n) << 0) +#define CFGCHIP0_EDMA30TC0DBS_MASK CFGCHIP0_EDMA30TC0DBS(0x3) +#define CFGCHIP0_EDMA30TC0DBS_16 CFGCHIP0_EDMA30TC0DBS(0x0) +#define CFGCHIP0_EDMA30TC0DBS_32 CFGCHIP0_EDMA30TC0DBS(0x1) +#define CFGCHIP0_EDMA30TC0DBS_64 CFGCHIP0_EDMA30TC0DBS(0x2) + +/* CFGCHIP1 (eCAP/HPI/EDMA3_1/eHRPWM TBCLK/McASP0 AMUTEIN) register bits */ +#define CFGCHIP1_CAP2SRC (n) ((n) << 27) +#define CFGCHIP1_CAP2SRC_MASK CFGCHIP1_CAP2SRC(0x1f) +#define CFGCHIP1_CAP2SRC_ECAP_PIN CFGCHIP1_CAP2SRC(0x0) +#define CFGCHIP1_CAP2SRC_MCASP0_TX CFGCHIP1_CAP2SRC(0x1) +#define CFGCHIP1_CAP2SRC_MCASP0_RX CFGCHIP1_CAP2SRC(0x2) +#define CFGCHIP1_CAP2SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP2SRC(0x7) +#define CFGCHIP1_CAP2SRC_EMAC_C0_RX CFGCHIP1_CAP2SRC(0x8) +#define CFGCHIP1_CAP2SRC_EMAC_C0_TX CFGCHIP1_CAP2SRC(0x9) +#define CFGCHIP1_CAP2SRC_EMAC_C0_MISC CFGCHIP1_CAP2SRC(0xa) +#define CFGCHIP1_CAP2SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xb) +#define CFGCHIP1_CAP2SRC_EMAC_C1_RX CFGCHIP1_CAP2SRC(0xc) +#define CFGCHIP1_CAP2SRC_EMAC_C1_TX CFGCHIP1_CAP2SRC(0xd) +#define CFGCHIP1_CAP2SRC_EMAC_C1_MISC CFGCHIP1_CAP2SRC(0xe) +#define CFGCHIP1_CAP2SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xf) +#define CFGCHIP1_CAP2SRC_EMAC_C2_RX CFGCHIP1_CAP2SRC(0x10) +#define CFGCHIP1_CAP2SRC_EMAC_C2_TX CFGCHIP1_CAP2SRC(0x11) +#define CFGCHIP1_CAP2SRC_EMAC_C2_MISC CFGCHIP1_CAP2SRC(0x12) +#define CFGCHIP1_CAP1SRC (n) ((n) << 22) +#define CFGCHIP1_CAP1SRC_MASK CFGCHIP1_CAP1SRC(0x1f) +#define CFGCHIP1_CAP1SRC_ECAP_PIN CFGCHIP1_CAP1SRC(0x0) +#define CFGCHIP1_CAP1SRC_MCASP0_TX CFGCHIP1_CAP1SRC(0x1) +#define CFGCHIP1_CAP1SRC_MCASP0_RX CFGCHIP1_CAP1SRC(0x2) +#define CFGCHIP1_CAP1SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP1SRC(0x7) +#define CFGCHIP1_CAP1SRC_EMAC_C0_RX CFGCHIP1_CAP1SRC(0x8) +#define CFGCHIP1_CAP1SRC_EMAC_C0_TX CFGCHIP1_CAP1SRC(0x9) +#define CFGCHIP1_CAP1SRC_EMAC_C0_MISC CFGCHIP1_CAP1SRC(0xa) +#define CFGCHIP1_CAP1SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xb) +#define CFGCHIP1_CAP1SRC_EMAC_C1_RX CFGCHIP1_CAP1SRC(0xc) +#define CFGCHIP1_CAP1SRC_EMAC_C1_TX CFGCHIP1_CAP1SRC(0xd) +#define CFGCHIP1_CAP1SRC_EMAC_C1_MISC CFGCHIP1_CAP1SRC(0xe) +#define CFGCHIP1_CAP1SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xf) +#define CFGCHIP1_CAP1SRC_EMAC_C2_RX CFGCHIP1_CAP1SRC(0x10) +#define CFGCHIP1_CAP1SRC_EMAC_C2_TX CFGCHIP1_CAP1SRC(0x11) +#define CFGCHIP1_CAP1SRC_EMAC_C2_MISC CFGCHIP1_CAP1SRC(0x12) +#define CFGCHIP1_CAP0SRC (n) ((n) << 17) +#define CFGCHIP1_CAP0SRC_MASK CFGCHIP1_CAP0SRC(0x1f) +#define CFGCHIP1_CAP0SRC_ECAP_PIN CFGCHIP1_CAP0SRC(0x0) +#define CFGCHIP1_CAP0SRC_MCASP0_TX CFGCHIP1_CAP0SRC(0x1) +#define CFGCHIP1_CAP0SRC_MCASP0_RX CFGCHIP1_CAP0SRC(0x2) +#define CFGCHIP1_CAP0SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP0SRC(0x7) +#define CFGCHIP1_CAP0SRC_EMAC_C0_RX CFGCHIP1_CAP0SRC(0x8) +#define CFGCHIP1_CAP0SRC_EMAC_C0_TX CFGCHIP1_CAP0SRC(0x9) +#define CFGCHIP1_CAP0SRC_EMAC_C0_MISC CFGCHIP1_CAP0SRC(0xa) +#define CFGCHIP1_CAP0SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xb) +#define CFGCHIP1_CAP0SRC_EMAC_C1_RX CFGCHIP1_CAP0SRC(0xc) +#define CFGCHIP1_CAP0SRC_EMAC_C1_TX CFGCHIP1_CAP0SRC(0xd) +#define CFGCHIP1_CAP0SRC_EMAC_C1_MISC CFGCHIP1_CAP0SRC(0xe) +#define CFGCHIP1_CAP0SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xf) +#define CFGCHIP1_CAP0SRC_EMAC_C2_RX CFGCHIP1_CAP0SRC(0x10) +#define CFGCHIP1_CAP0SRC_EMAC_C2_TX CFGCHIP1_CAP0SRC(0x11) +#define CFGCHIP1_CAP0SRC_EMAC_C2_MISC CFGCHIP1_CAP0SRC(0x12) +#define CFGCHIP1_HPIBYTEAD BIT(16) +#define CFGCHIP1_HPIENA BIT(15) +#define CFGCHIP0_EDMA31TC0DBS (n) ((n) << 13) +#define CFGCHIP0_EDMA31TC0DBS_MASK CFGCHIP0_EDMA31TC0DBS(0x3) +#define CFGCHIP0_EDMA31TC0DBS_16 CFGCHIP0_EDMA31TC0DBS(0x0) +#define CFGCHIP0_EDMA31TC0DBS_32 CFGCHIP0_EDMA31TC0DBS(0x1) +#define CFGCHIP0_EDMA31TC0DBS_64 CFGCHIP0_EDMA31TC0DBS(0x2) +#define CFGCHIP1_TBCLKSYNC BIT(12) +#define CFGCHIP1_AMUTESEL0 (n) ((n) << 0) +#define CFGCHIP1_AMUTESEL0_MASK CFGCHIP1_AMUTESEL0(0xf) +#define CFGCHIP1_AMUTESEL0_LOW CFGCHIP1_AMUTESEL0(0x0) +#define CFGCHIP1_AMUTESEL0_BANK_0 CFGCHIP1_AMUTESEL0(0x1) +#define CFGCHIP1_AMUTESEL0_BANK_1 CFGCHIP1_AMUTESEL0(0x2) +#define CFGCHIP1_AMUTESEL0_BANK_2 CFGCHIP1_AMUTESEL0(0x3) +#define CFGCHIP1_AMUTESEL0_BANK_3 CFGCHIP1_AMUTESEL0(0x4) +#define CFGCHIP1_AMUTESEL0_BANK_4 CFGCHIP1_AMUTESEL0(0x5) +#define CFGCHIP1_AMUTESEL0_BANK_5 CFGCHIP1_AMUTESEL0(0x6) +#define CFGCHIP1_AMUTESEL0_BANK_6 CFGCHIP1_AMUTESEL0(0x7) +#define CFGCHIP1_AMUTESEL0_BANK_7 CFGCHIP1_AMUTESEL0(0x8) + +/* CFGCHIP2 (USB PHY) register bits */ +#define CFGCHIP2_PHYCLKGD BIT(17) +#define CFGCHIP2_VBUSSENSE BIT(16) +#define CFGCHIP2_RESET BIT(15) +#define CFGCHIP2_OTGMODE (n) ((n) << 13) +#define CFGCHIP2_OTGMODE_MASK CFGCHIP2_OTGMODE(0x3) +#define CFGCHIP2_OTGMODE_NO_OVERRIDE CFGCHIP2_OTGMODE(0x0) +#define CFGCHIP2_OTGMODE_FORCE_HOST CFGCHIP2_OTGMODE(0x1) +#define CFGCHIP2_OTGMODE_FORCE_DEVICE CFGCHIP2_OTGMODE(0x2) +#define CFGCHIP2_OTGMODE_FORCE_HOST_VBUS_LOW CFGCHIP2_OTGMODE(0x3) +#define CFGCHIP2_USB1PHYCLKMUX BIT(12) +#define CFGCHIP2_USB2PHYCLKMUX BIT(11) +#define CFGCHIP2_PHYPWRDN BIT(10) +#define CFGCHIP2_OTGPWRDN BIT(9) +#define CFGCHIP2_DATPOL BIT(8) +#define CFGCHIP2_USB1SUSPENDM BIT(7) +#define CFGCHIP2_PHY_PLLON BIT(6) +#define CFGCHIP2_SESENDEN BIT(5) +#define CFGCHIP2_VBDTCTEN BIT(4) +#define CFGCHIP2_REFFREQ (n) ((n) << 0) +#define CFGCHIP2_REFFREQ_MASK CFGCHIP2_REFFREQ(0xf) +#define CFGCHIP2_REFFREQ_12MHZ CFGCHIP2_REFFREQ(0x1) +#define CFGCHIP2_REFFREQ_24MHZ CFGCHIP2_REFFREQ(0x2) +#define CFGCHIP2_REFFREQ_48MHZ CFGCHIP2_REFFREQ(0x3) +#define CFGCHIP2_REFFREQ_19_2MHZ CFGCHIP2_REFFREQ(0x4) +#define CFGCHIP2_REFFREQ_38_4MHZ CFGCHIP2_REFFREQ(0x5) +#define CFGCHIP2_REFFREQ_13MHZ CFGCHIP2_REFFREQ(0x6) +#define CFGCHIP2_REFFREQ_26MHZ CFGCHIP2_REFFREQ(0x7) +#define CFGCHIP2_REFFREQ_20MHZ CFGCHIP2_REFFREQ(0x8) +#define CFGCHIP2_REFFREQ_40MHZ CFGCHIP2_REFFREQ(0x9) + +/* CFGCHIP3 (EMAC/uPP/PLL1/ASYNC3/PRU/DIV4.5/EMIFA) register bits */ +#define CFGCHIP3_RMII_SEL BIT(8) +#define CFGCHIP3_UPP_TX_CLKSRC BIT(6) +#define CFGCHIP3_PLL1_MASTER_LOCK BIT(5) +#define CFGCHIP3_ASYNC3_CLKSRC BIT(4) +#define CFGCHIP3_PRUEVTSEL BIT(3) +#define CFGCHIP3_DIV45PENA BIT(2) +#define CFGCHIP3_EMA_CLKSRC BIT(1) + +/* CFGCHIP4 (McASP0 AMUNTEIN) register bits */ +#define CFGCHIP4_AMUTECLR0 BIT(0) + +#endif /* __LINUX_MFD_DA8XX_CFGCHIP_H */
include/linux/platform_data/usb-davinci.h +0 -22
@@ -11,28 +11,6 @@#ifndef __ASM_ARCH_USB_H#define __ASM_ARCH_USB_H -/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ -#define CFGCHIP2_PHYCLKGD (1 << 17) -#define CFGCHIP2_VBUSSENSE (1 << 16) -#define CFGCHIP2_RESET (1 << 15) -#define CFGCHIP2_OTGMODE (3 << 13) -#define CFGCHIP2_NO_OVERRIDE (0 << 13) -#define CFGCHIP2_FORCE_HOST (1 << 13) -#define CFGCHIP2_FORCE_DEVICE (2 << 13) -#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13) -#define CFGCHIP2_USB1PHYCLKMUX (1 << 12) -#define CFGCHIP2_USB2PHYCLKMUX (1 << 11) -#define CFGCHIP2_PHYPWRDN (1 << 10) -#define CFGCHIP2_OTGPWRDN (1 << 9) -#define CFGCHIP2_DATPOL (1 << 8) -#define CFGCHIP2_USB1SUSPENDM (1 << 7) -#define CFGCHIP2_PHY_PLLON (1 << 6)/* override PLL suspend */ -#define CFGCHIP2_SESENDEN (1 << 5)/* Vsess_end comparator */ -#define CFGCHIP2_VBDTCTEN (1 << 4)/* Vbus comparator */ -#define CFGCHIP2_REFFREQ (0xf << 0) -#define CFGCHIP2_REFFREQ_12MHZ (1 << 0) -#define CFGCHIP2_REFFREQ_24MHZ (2 << 0) -#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)struct da8xx_ohci_root_hub ;
Signature · 1 line
2.7.4
Re: [PATCH v5 1/7] mfd: da8xx-cfgchip: New header file for CFGCHIP registers.
Hi,
Quoted 4 lines · David Lechner
We will be using a generic syscon device for the TI DA8XX SoC CFGCHIPx retisters. This will be used by a number of planned drivers including a new USB PHY driver and common clock framework drivers.
Quoted 8 lines
The same defines are removed from the
platform_dataheader file since they are now redundant and they didn't really belong there anyway.Signed-off-by David Lechner <[email protected]>Acked-by Lee Jones <[email protected]>--- include/linux/mfd/da8xx-cfgchip.h | 153 ++++++++++++++++++++++++++++++ include/linux/platform_data/usb-davinci.h | 22 -----
This patch as well is required for da8xx-usb phy since it uses da8xx-cfgchip.h. But I can't merge this as is since this removes macros in da8xx-cfgchip referenced in ohci-da8xx.c. So for now I'll split this patch and take only the part that adds da8xx-cfgchip.h. The part that removes macros from usb-davinci.h can go along with the USB patch series.
Thanks
Kishon
Quoted 196 lines
2 files changed, 153 insertions(+), 22 deletions(-) create mode 100644 include/linux/mfd/da8xx-cfgchip.hinclude/linux/mfd/da8xx-cfgchip.h new file +153
-0@@ -0,0 +1,153 @@ +/* +* TI DaVinci DA8xx CHIPCFGx registers for syscon consumers. +* +* Copyright (C) 2016 David Lechner <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef __LINUX_MFD_DA8XX_CFGCHIP_H +#define __LINUX_MFD_DA8XX_CFGCHIP_H + +#include <linux/bitops.h> + +/* register offset (32-bit registers) */ +#define CFGCHIP (n) ((n) * 4) + +/* CFGCHIP0 (PLL0/EDMA3_0) register bits */ +#define CFGCHIP0_PLL_MASTER_LOCK BIT(4) +#define CFGCHIP0_EDMA30TC1DBS (n) ((n) << 2) +#define CFGCHIP0_EDMA30TC1DBS_MASK CFGCHIP0_EDMA30TC1DBS(0x3) +#define CFGCHIP0_EDMA30TC1DBS_16 CFGCHIP0_EDMA30TC1DBS(0x0) +#define CFGCHIP0_EDMA30TC1DBS_32 CFGCHIP0_EDMA30TC1DBS(0x1) +#define CFGCHIP0_EDMA30TC1DBS_64 CFGCHIP0_EDMA30TC1DBS(0x2) +#define CFGCHIP0_EDMA30TC0DBS (n) ((n) << 0) +#define CFGCHIP0_EDMA30TC0DBS_MASK CFGCHIP0_EDMA30TC0DBS(0x3) +#define CFGCHIP0_EDMA30TC0DBS_16 CFGCHIP0_EDMA30TC0DBS(0x0) +#define CFGCHIP0_EDMA30TC0DBS_32 CFGCHIP0_EDMA30TC0DBS(0x1) +#define CFGCHIP0_EDMA30TC0DBS_64 CFGCHIP0_EDMA30TC0DBS(0x2) + +/* CFGCHIP1 (eCAP/HPI/EDMA3_1/eHRPWM TBCLK/McASP0 AMUTEIN) register bits */ +#define CFGCHIP1_CAP2SRC (n) ((n) << 27) +#define CFGCHIP1_CAP2SRC_MASK CFGCHIP1_CAP2SRC(0x1f) +#define CFGCHIP1_CAP2SRC_ECAP_PIN CFGCHIP1_CAP2SRC(0x0) +#define CFGCHIP1_CAP2SRC_MCASP0_TX CFGCHIP1_CAP2SRC(0x1) +#define CFGCHIP1_CAP2SRC_MCASP0_RX CFGCHIP1_CAP2SRC(0x2) +#define CFGCHIP1_CAP2SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP2SRC(0x7) +#define CFGCHIP1_CAP2SRC_EMAC_C0_RX CFGCHIP1_CAP2SRC(0x8) +#define CFGCHIP1_CAP2SRC_EMAC_C0_TX CFGCHIP1_CAP2SRC(0x9) +#define CFGCHIP1_CAP2SRC_EMAC_C0_MISC CFGCHIP1_CAP2SRC(0xa) +#define CFGCHIP1_CAP2SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xb) +#define CFGCHIP1_CAP2SRC_EMAC_C1_RX CFGCHIP1_CAP2SRC(0xc) +#define CFGCHIP1_CAP2SRC_EMAC_C1_TX CFGCHIP1_CAP2SRC(0xd) +#define CFGCHIP1_CAP2SRC_EMAC_C1_MISC CFGCHIP1_CAP2SRC(0xe) +#define CFGCHIP1_CAP2SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xf) +#define CFGCHIP1_CAP2SRC_EMAC_C2_RX CFGCHIP1_CAP2SRC(0x10) +#define CFGCHIP1_CAP2SRC_EMAC_C2_TX CFGCHIP1_CAP2SRC(0x11) +#define CFGCHIP1_CAP2SRC_EMAC_C2_MISC CFGCHIP1_CAP2SRC(0x12) +#define CFGCHIP1_CAP1SRC (n) ((n) << 22) +#define CFGCHIP1_CAP1SRC_MASK CFGCHIP1_CAP1SRC(0x1f) +#define CFGCHIP1_CAP1SRC_ECAP_PIN CFGCHIP1_CAP1SRC(0x0) +#define CFGCHIP1_CAP1SRC_MCASP0_TX CFGCHIP1_CAP1SRC(0x1) +#define CFGCHIP1_CAP1SRC_MCASP0_RX CFGCHIP1_CAP1SRC(0x2) +#define CFGCHIP1_CAP1SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP1SRC(0x7) +#define CFGCHIP1_CAP1SRC_EMAC_C0_RX CFGCHIP1_CAP1SRC(0x8) +#define CFGCHIP1_CAP1SRC_EMAC_C0_TX CFGCHIP1_CAP1SRC(0x9) +#define CFGCHIP1_CAP1SRC_EMAC_C0_MISC CFGCHIP1_CAP1SRC(0xa) +#define CFGCHIP1_CAP1SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xb) +#define CFGCHIP1_CAP1SRC_EMAC_C1_RX CFGCHIP1_CAP1SRC(0xc) +#define CFGCHIP1_CAP1SRC_EMAC_C1_TX CFGCHIP1_CAP1SRC(0xd) +#define CFGCHIP1_CAP1SRC_EMAC_C1_MISC CFGCHIP1_CAP1SRC(0xe) +#define CFGCHIP1_CAP1SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xf) +#define CFGCHIP1_CAP1SRC_EMAC_C2_RX CFGCHIP1_CAP1SRC(0x10) +#define CFGCHIP1_CAP1SRC_EMAC_C2_TX CFGCHIP1_CAP1SRC(0x11) +#define CFGCHIP1_CAP1SRC_EMAC_C2_MISC CFGCHIP1_CAP1SRC(0x12) +#define CFGCHIP1_CAP0SRC (n) ((n) << 17) +#define CFGCHIP1_CAP0SRC_MASK CFGCHIP1_CAP0SRC(0x1f) +#define CFGCHIP1_CAP0SRC_ECAP_PIN CFGCHIP1_CAP0SRC(0x0) +#define CFGCHIP1_CAP0SRC_MCASP0_TX CFGCHIP1_CAP0SRC(0x1) +#define CFGCHIP1_CAP0SRC_MCASP0_RX CFGCHIP1_CAP0SRC(0x2) +#define CFGCHIP1_CAP0SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP0SRC(0x7) +#define CFGCHIP1_CAP0SRC_EMAC_C0_RX CFGCHIP1_CAP0SRC(0x8) +#define CFGCHIP1_CAP0SRC_EMAC_C0_TX CFGCHIP1_CAP0SRC(0x9) +#define CFGCHIP1_CAP0SRC_EMAC_C0_MISC CFGCHIP1_CAP0SRC(0xa) +#define CFGCHIP1_CAP0SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xb) +#define CFGCHIP1_CAP0SRC_EMAC_C1_RX CFGCHIP1_CAP0SRC(0xc) +#define CFGCHIP1_CAP0SRC_EMAC_C1_TX CFGCHIP1_CAP0SRC(0xd) +#define CFGCHIP1_CAP0SRC_EMAC_C1_MISC CFGCHIP1_CAP0SRC(0xe) +#define CFGCHIP1_CAP0SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xf) +#define CFGCHIP1_CAP0SRC_EMAC_C2_RX CFGCHIP1_CAP0SRC(0x10) +#define CFGCHIP1_CAP0SRC_EMAC_C2_TX CFGCHIP1_CAP0SRC(0x11) +#define CFGCHIP1_CAP0SRC_EMAC_C2_MISC CFGCHIP1_CAP0SRC(0x12) +#define CFGCHIP1_HPIBYTEAD BIT(16) +#define CFGCHIP1_HPIENA BIT(15) +#define CFGCHIP0_EDMA31TC0DBS (n) ((n) << 13) +#define CFGCHIP0_EDMA31TC0DBS_MASK CFGCHIP0_EDMA31TC0DBS(0x3) +#define CFGCHIP0_EDMA31TC0DBS_16 CFGCHIP0_EDMA31TC0DBS(0x0) +#define CFGCHIP0_EDMA31TC0DBS_32 CFGCHIP0_EDMA31TC0DBS(0x1) +#define CFGCHIP0_EDMA31TC0DBS_64 CFGCHIP0_EDMA31TC0DBS(0x2) +#define CFGCHIP1_TBCLKSYNC BIT(12) +#define CFGCHIP1_AMUTESEL0 (n) ((n) << 0) +#define CFGCHIP1_AMUTESEL0_MASK CFGCHIP1_AMUTESEL0(0xf) +#define CFGCHIP1_AMUTESEL0_LOW CFGCHIP1_AMUTESEL0(0x0) +#define CFGCHIP1_AMUTESEL0_BANK_0 CFGCHIP1_AMUTESEL0(0x1) +#define CFGCHIP1_AMUTESEL0_BANK_1 CFGCHIP1_AMUTESEL0(0x2) +#define CFGCHIP1_AMUTESEL0_BANK_2 CFGCHIP1_AMUTESEL0(0x3) +#define CFGCHIP1_AMUTESEL0_BANK_3 CFGCHIP1_AMUTESEL0(0x4) +#define CFGCHIP1_AMUTESEL0_BANK_4 CFGCHIP1_AMUTESEL0(0x5) +#define CFGCHIP1_AMUTESEL0_BANK_5 CFGCHIP1_AMUTESEL0(0x6) +#define CFGCHIP1_AMUTESEL0_BANK_6 CFGCHIP1_AMUTESEL0(0x7) +#define CFGCHIP1_AMUTESEL0_BANK_7 CFGCHIP1_AMUTESEL0(0x8) + +/* CFGCHIP2 (USB PHY) register bits */ +#define CFGCHIP2_PHYCLKGD BIT(17) +#define CFGCHIP2_VBUSSENSE BIT(16) +#define CFGCHIP2_RESET BIT(15) +#define CFGCHIP2_OTGMODE (n) ((n) << 13) +#define CFGCHIP2_OTGMODE_MASK CFGCHIP2_OTGMODE(0x3) +#define CFGCHIP2_OTGMODE_NO_OVERRIDE CFGCHIP2_OTGMODE(0x0) +#define CFGCHIP2_OTGMODE_FORCE_HOST CFGCHIP2_OTGMODE(0x1) +#define CFGCHIP2_OTGMODE_FORCE_DEVICE CFGCHIP2_OTGMODE(0x2) +#define CFGCHIP2_OTGMODE_FORCE_HOST_VBUS_LOW CFGCHIP2_OTGMODE(0x3) +#define CFGCHIP2_USB1PHYCLKMUX BIT(12) +#define CFGCHIP2_USB2PHYCLKMUX BIT(11) +#define CFGCHIP2_PHYPWRDN BIT(10) +#define CFGCHIP2_OTGPWRDN BIT(9) +#define CFGCHIP2_DATPOL BIT(8) +#define CFGCHIP2_USB1SUSPENDM BIT(7) +#define CFGCHIP2_PHY_PLLON BIT(6) +#define CFGCHIP2_SESENDEN BIT(5) +#define CFGCHIP2_VBDTCTEN BIT(4) +#define CFGCHIP2_REFFREQ (n) ((n) << 0) +#define CFGCHIP2_REFFREQ_MASK CFGCHIP2_REFFREQ(0xf) +#define CFGCHIP2_REFFREQ_12MHZ CFGCHIP2_REFFREQ(0x1) +#define CFGCHIP2_REFFREQ_24MHZ CFGCHIP2_REFFREQ(0x2) +#define CFGCHIP2_REFFREQ_48MHZ CFGCHIP2_REFFREQ(0x3) +#define CFGCHIP2_REFFREQ_19_2MHZ CFGCHIP2_REFFREQ(0x4) +#define CFGCHIP2_REFFREQ_38_4MHZ CFGCHIP2_REFFREQ(0x5) +#define CFGCHIP2_REFFREQ_13MHZ CFGCHIP2_REFFREQ(0x6) +#define CFGCHIP2_REFFREQ_26MHZ CFGCHIP2_REFFREQ(0x7) +#define CFGCHIP2_REFFREQ_20MHZ CFGCHIP2_REFFREQ(0x8) +#define CFGCHIP2_REFFREQ_40MHZ CFGCHIP2_REFFREQ(0x9) + +/* CFGCHIP3 (EMAC/uPP/PLL1/ASYNC3/PRU/DIV4.5/EMIFA) register bits */ +#define CFGCHIP3_RMII_SEL BIT(8) +#define CFGCHIP3_UPP_TX_CLKSRC BIT(6) +#define CFGCHIP3_PLL1_MASTER_LOCK BIT(5) +#define CFGCHIP3_ASYNC3_CLKSRC BIT(4) +#define CFGCHIP3_PRUEVTSEL BIT(3) +#define CFGCHIP3_DIV45PENA BIT(2) +#define CFGCHIP3_EMA_CLKSRC BIT(1) + +/* CFGCHIP4 (McASP0 AMUNTEIN) register bits */ +#define CFGCHIP4_AMUTECLR0 BIT(0) + +#endif /* __LINUX_MFD_DA8XX_CFGCHIP_H */ include/linux/platform_data/usb-davinci.h +0
-22@@ -11,28 +11,6 @@#ifndef __ASM_ARCH_USB_H#define __ASM_ARCH_USB_H -/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ -#define CFGCHIP2_PHYCLKGD (1 << 17) -#define CFGCHIP2_VBUSSENSE (1 << 16) -#define CFGCHIP2_RESET (1 << 15) -#define CFGCHIP2_OTGMODE (3 << 13) -#define CFGCHIP2_NO_OVERRIDE (0 << 13) -#define CFGCHIP2_FORCE_HOST (1 << 13) -#define CFGCHIP2_FORCE_DEVICE (2 << 13) -#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13) -#define CFGCHIP2_USB1PHYCLKMUX (1 << 12) -#define CFGCHIP2_USB2PHYCLKMUX (1 << 11) -#define CFGCHIP2_PHYPWRDN (1 << 10) -#define CFGCHIP2_OTGPWRDN (1 << 9) -#define CFGCHIP2_DATPOL (1 << 8) -#define CFGCHIP2_USB1SUSPENDM (1 << 7) -#define CFGCHIP2_PHY_PLLON (1 << 6)/* override PLL suspend */ -#define CFGCHIP2_SESENDEN (1 << 5)/* Vsess_end comparator */ -#define CFGCHIP2_VBDTCTEN (1 << 4)/* Vbus comparator */ -#define CFGCHIP2_REFFREQ (0xf << 0) -#define CFGCHIP2_REFFREQ_12MHZ (1 << 0) -#define CFGCHIP2_REFFREQ_24MHZ (2 << 0) -#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)struct da8xx_ohci_root_hub ;
PATCH v5 2/7 dt-bindings: Add bindings for phy-da8xx-usb
In reply to David LechnerDevice tree binding for new phy-da8xx-usb driver.
--- .../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt new file +40 -0
@@ -0,0 +1,40 @@ +TI DA8xx/OMAP-L1xx/AM18xx USB PHY + +Required properties: + - compatible: must be "ti,da830-usb-phy". + - #phy-cells: must be 1. + +This device controls the PHY for both the USB 1.1 OHCI and USB 2.0 OTG +controllers on DA8xx SoCs. Consumers of this device should use index 0 for +the USB 2.0 phy device and index 1 for the USB 1.1 phy device. + +It also requires a "syscon" node with compatible = "ti,da830-cfgchip", "syscon" +to access the CFGCHIP2 register. + +Example: + + cfgchip: cfgchip@1417c { + compatible = "ti,da830-cfgchip", "syscon"; + reg = <0x1417c 0x14>; + }; + + usb_phy: usb-phy { + compatible = "ti,da830-usb-phy"; + #phy-cells = <1>; + }; + + usb20: usb@200000 { + compatible = "ti,da830-musb"; + reg = <0x200000 0x1000>; + interrupts = <58>; + phys = <&usb_phy 0>; + phy-names = "usb-phy"; + }; + + usb11: usb@225000 { + compatible = "ti,da830-ohci"; + reg = <0x225000 0x1000>; + interrupts = <59>; + phys = <&usb_phy 1>; + phy-names = "usb-phy"; + };
Signature · 1 line
2.7.4
PATCH v5 3/7 phy: Add set_mode callback
In reply to David LechnerThe initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
--- drivers/phy/phy-core.c | 15 +++++++++++++++ include/linux/phy/phy.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+)
drivers/phy/phy-core.c +15 -0
@@ -342,6 +342,21 @@ int phy_power_off(struct phy *phy) }EXPORT_SYMBOL_GPL (phy_power_off); +int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +int ret; + +if (!phy || !phy->ops->set_mode) +return 0 ; + +mutex_lock (&phy->mutex); + ret = phy->ops->set_mode (phy, mode); +mutex_unlock (&phy->mutex); + +return ret; +} +EXPORT_SYMBOL_GPL (phy_set_mode); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy
include/linux/phy/phy.h +17 -0
@@ -22,12 +22,20 @@struct phy ; +enum phy_mode { +PHY_MODE_INVALID , +PHY_MODE_USB_HOST , +PHY_MODE_USB_DEVICE , +PHY_MODE_USB_OTG , +}; +/** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting * @power_on: powering on the phy * @power_off: powering off the phy +* @set_mode: set the mode of the phy * @owner: the module owner containing the ops */ struct phy_ops {
@@ -35,6 +43,7 @@ struct phy_ops {int (*exit)(struct phy *phy);int (*power_on)(struct phy *phy);int (*power_off)(struct phy *phy); +int (*set_mode)(struct phy *phy,enum phy_mode mode);struct module *owner; };
@@ -119,6 +128,7 @@ int phy_init(struct phy *phy);int phy_exit (struct phy *phy);int phy_power_on (struct phy *phy);int phy_power_off (struct phy *phy); +int phy_set_mode (struct phy *phy,enum phy_mode mode);static inline int phy_get_bus_width (struct phy *phy) {return phy->attrs.bus_width;
@@ -224,6 +234,13 @@ static inline int phy_power_off(struct phy *phy)return -ENOSYS ; } +static inline int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +if (!phy) +return 0 ; +return -ENOSYS ; +} +static inline int phy_get_bus_width (struct phy *phy) {return -ENOSYS ;
Signature · 1 line
2.7.4
Re: [PATCH v5 3/7] phy: Add set_mode callback
Hi,
Quoted 9 lines · David Lechner
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
Suggested-by Kishon Vijay Abraham I <[email protected]>Signed-off-by David Lechner <[email protected]>
This patch is required for both phy driver and the usb driver. I can create a immutable branch with only this patch and both me and Bin Liu can merge it in our next branch.
Thanks
Kishon
Quoted 87 lines
--- drivers/phy/phy-core.c | 15 +++++++++++++++ include/linux/phy/phy.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+)drivers/phy/phy-core.c +15
-0@@ -342,6 +342,21 @@ int phy_power_off(struct phy *phy) }EXPORT_SYMBOL_GPL (phy_power_off); +int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +int ret; + +if (!phy || !phy->ops->set_mode) +return 0 ; + +mutex_lock (&phy->mutex); + ret = phy->ops->set_mode (phy, mode); +mutex_unlock (&phy->mutex); + +return ret; +} +EXPORT_SYMBOL_GPL (phy_set_mode); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy include/linux/phy/phy.h +17
-0@@ -22,12 +22,20 @@struct phy ; +enum phy_mode { +PHY_MODE_INVALID , +PHY_MODE_USB_HOST , +PHY_MODE_USB_DEVICE , +PHY_MODE_USB_OTG , +}; +/** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting * @power_on: powering on the phy * @power_off: powering off the phy +* @set_mode: set the mode of the phy * @owner: the module owner containing the ops */ struct phy_ops {@@ -35,6 +43,7 @@ struct phy_ops {int (*exit)(struct phy *phy);int (*power_on)(struct phy *phy);int (*power_off)(struct phy *phy); +int (*set_mode)(struct phy *phy,enum phy_mode mode);struct module *owner; };@@ -119,6 +128,7 @@ int phy_init(struct phy *phy);int phy_exit (struct phy *phy);int phy_power_on (struct phy *phy);int phy_power_off (struct phy *phy); +int phy_set_mode (struct phy *phy,enum phy_mode mode);static inline int phy_get_bus_width (struct phy *phy) {return phy->attrs.bus_width;@@ -224,6 +234,13 @@ static inline int phy_power_off(struct phy *phy)return -ENOSYS ; } +static inline int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +if (!phy) +return 0 ; +return -ENOSYS ; +} +static inline int phy_get_bus_width (struct phy *phy) {return -ENOSYS ;
Re: [PATCH v5 3/7] phy: Add set_mode callback
Quoted 13 lines · Kishon Vijay Abraham I
Hi,
Quoted 9 lines · David Lechner
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
Suggested-by Kishon Vijay Abraham I <[email protected]>Signed-off-by David Lechner <[email protected]>
Quoted 7 lines
This patch is required for both phy driver and the usb driver. I can create a immutable branch with only this patch and both me and Bin Liu can merge it in our next branch.
Thanks
Kishon
I'm new to the kernel merging process, so I am not exactly sure what this means, but I think it sounds like a good thing. :-)
Kishon Vijay Abraham I
AppliedRe: [PATCH v5 3/7] phy: Add set_mode callback
In reply to David LechnerHi,
Quoted 9 lines · David Lechner
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
Suggested-by Kishon Vijay Abraham I <[email protected]>Signed-off-by David Lechner <[email protected]>
I've created a immutable branch for this patch and it can be found here.git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git
tags/phy-set-mode
I've merged this tag to my -next.
Thanks
Kishon
Quoted 87 lines
--- drivers/phy/phy-core.c | 15 +++++++++++++++ include/linux/phy/phy.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+)drivers/phy/phy-core.c +15
-0@@ -342,6 +342,21 @@ int phy_power_off(struct phy *phy) }EXPORT_SYMBOL_GPL (phy_power_off); +int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +int ret; + +if (!phy || !phy->ops->set_mode) +return 0 ; + +mutex_lock (&phy->mutex); + ret = phy->ops->set_mode (phy, mode); +mutex_unlock (&phy->mutex); + +return ret; +} +EXPORT_SYMBOL_GPL (phy_set_mode); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy include/linux/phy/phy.h +17
-0@@ -22,12 +22,20 @@struct phy ; +enum phy_mode { +PHY_MODE_INVALID , +PHY_MODE_USB_HOST , +PHY_MODE_USB_DEVICE , +PHY_MODE_USB_OTG , +}; +/** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting * @power_on: powering on the phy * @power_off: powering off the phy +* @set_mode: set the mode of the phy * @owner: the module owner containing the ops */ struct phy_ops {@@ -35,6 +43,7 @@ struct phy_ops {int (*exit)(struct phy *phy);int (*power_on)(struct phy *phy);int (*power_off)(struct phy *phy); +int (*set_mode)(struct phy *phy,enum phy_mode mode);struct module *owner; };@@ -119,6 +128,7 @@ int phy_init(struct phy *phy);int phy_exit (struct phy *phy);int phy_power_on (struct phy *phy);int phy_power_off (struct phy *phy); +int phy_set_mode (struct phy *phy,enum phy_mode mode);static inline int phy_get_bus_width (struct phy *phy) {return phy->attrs.bus_width;@@ -224,6 +234,13 @@ static inline int phy_power_off(struct phy *phy)return -ENOSYS ; } +static inline int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +if (!phy) +return 0 ; +return -ENOSYS ; +} +static inline int phy_get_bus_width (struct phy *phy) {return -ENOSYS ;
Re: [PATCH v5 3/7] phy: Add set_mode callback
Hi Bin,
Quoted 10 lines · Kishon Vijay Abraham I
Hi,
Quoted 7 lines · David Lechner
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
Quoted 6 lines
Quoted 2 lines
Suggested-by Kishon Vijay Abraham I <[email protected]>Signed-off-by David Lechner <[email protected]>I've created a immutable branch for this patch and it can be found here.
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git
tags/phy-set-mode
There was a build error in the above tag with allyesconfig. So I have created a new tag which includes the fix patch in addition to this patch.
new tag:
tags/phy-set-mode-v2
In the patches you sent to Greg [1], I didn't see this series included. However if you are planning to send another pull request for the next merge window, request you to use the new tag.
Thanks
Kishon
[1] -> http://www.spinics.net/lists/linux-usb/msg142788.html
Quoted 93 lines
I've merged this tag to my -next.
Thanks
KishonQuoted 87 lines
--- drivers/phy/phy-core.c | 15 +++++++++++++++ include/linux/phy/phy.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+)drivers/phy/phy-core.c +15
-0@@ -342,6 +342,21 @@ int phy_power_off(struct phy *phy) }EXPORT_SYMBOL_GPL (phy_power_off); +int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +int ret; + +if (!phy || !phy->ops->set_mode) +return 0 ; + +mutex_lock (&phy->mutex); + ret = phy->ops->set_mode (phy, mode); +mutex_unlock (&phy->mutex); + +return ret; +} +EXPORT_SYMBOL_GPL (phy_set_mode); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy include/linux/phy/phy.h +17
-0@@ -22,12 +22,20 @@struct phy ; +enum phy_mode { +PHY_MODE_INVALID , +PHY_MODE_USB_HOST , +PHY_MODE_USB_DEVICE , +PHY_MODE_USB_OTG , +}; +/** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting * @power_on: powering on the phy * @power_off: powering off the phy +* @set_mode: set the mode of the phy * @owner: the module owner containing the ops */ struct phy_ops {@@ -35,6 +43,7 @@ struct phy_ops {int (*exit)(struct phy *phy);int (*power_on)(struct phy *phy);int (*power_off)(struct phy *phy); +int (*set_mode)(struct phy *phy,enum phy_mode mode);struct module *owner; };@@ -119,6 +128,7 @@ int phy_init(struct phy *phy);int phy_exit (struct phy *phy);int phy_power_on (struct phy *phy);int phy_power_off (struct phy *phy); +int phy_set_mode (struct phy *phy,enum phy_mode mode);static inline int phy_get_bus_width (struct phy *phy) {return phy->attrs.bus_width;@@ -224,6 +234,13 @@ static inline int phy_power_off(struct phy *phy)return -ENOSYS ; } +static inline int phy_set_mode (struct phy *phy,enum phy_mode mode) +{ +if (!phy) +return 0 ; +return -ENOSYS ; +} +static inline int phy_get_bus_width (struct phy *phy) {return -ENOSYS ;
PATCH v5 4/7 phy: da8xx-usb: new driver for DA8xx SoC USB PHY
In reply to David LechnerThis is a new phy driver for the SoC USB controllers on the TI DA8xx family of microcontrollers. The USB 1.1 PHY is just a simple on/off. The USB 2.0 PHY also allows overriding the VBUS and ID pins.
--- drivers/phy/Kconfig | 10 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-da8xx-usb.c | 244 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 drivers/phy/phy-da8xx-usb.c
drivers/phy/Kconfig +10 -0
@@ -35,6 +35,16 @@ config ARMADA375_USBCLUSTER_PHY depends on OF && HAS_IOMEM select GENERIC_PHY +config PHY_DA8XX_USB + tristate "TI DA8xx USB PHY Driver" + depends on ARCH_DAVINCI_DA8XX + select GENERIC_PHY + select MFD_SYSCON + help + Enable this to support the USB PHY on DA8xx SoCs. + + This driver controls both the USB 1.1 PHY and the USB 2.0 PHY. + config PHY_DM816X_USB tristate "TI dm816x USB PHY driver" depends on ARCH_OMAP2PLUS
drivers/phy/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_PHY_BERLIN_USB) += phy-berlin-usb.o obj-$(CONFIG_PHY_BERLIN_SATA) += phy-berlin-sata.o +obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_DM816X_USB) += phy-dm816x-usb.o obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o
drivers/phy/phy-da8xx-usb.c new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH v5 4/7] phy: da8xx-usb: new driver for DA8xx SoC USB PHY
Quoted 5 lines · David Lechner
This is a new phy driver for the SoC USB controllers on the TI DA8xx family of microcontrollers. The USB 1.1 PHY is just a simple on/off. The USB 2.0 PHY also allows overriding the VBUS and ID pins.
Signed-off-by David Lechner <[email protected]>
Thanks,
Sekhar
David Lechner
Reviewed-by Sekhar NoriRe: [PATCH v5 4/7] phy: da8xx-usb: new driver for DA8xx SoC USB PHY
From 2261f0ea15690623dcefd71b8aaaea6089b16468 Mon Sep 17 00:00:00 2001
From: David Lechner <david-nq/r/kbU++upp/[email protected]>
Date: Wed, 16 Mar 2016 14:16:08 -0500
Subject: [PATCH] phy: da8xx-usb: new driver for DA8xx SoC USB PHY
This is a new phy driver for the SoC USB controllers on the TI DA8xx family of microcontrollers. The USB 1.1 PHY is just a simple on/off. The USB 2.0 PHY also allows overriding the VBUS and ID pins.
---
Just one small change here. Changed "syscon.0" to "syscon"
drivers/phy/Kconfig | 10 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-da8xx-usb.c | 244 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 drivers/phy/phy-da8xx-usb.c
drivers/phy/Kconfig +10 -0
@@ -35,6 +35,16 @@ config ARMADA375_USBCLUSTER_PHY depends on OF && HAS_IOMEM select GENERIC_PHY +config PHY_DA8XX_USB + tristate "TI DA8xx USB PHY Driver" + depends on ARCH_DAVINCI_DA8XX + select GENERIC_PHY + select MFD_SYSCON + help + Enable this to support the USB PHY on DA8xx SoCs. + + This driver controls both the USB 1.1 PHY and the USB 2.0 PHY. + config PHY_DM816X_USB tristate "TI dm816x USB PHY driver" depends on ARCH_OMAP2PLUS
drivers/phy/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_PHY_BERLIN_USB) += phy-berlin-usb.o obj-$(CONFIG_PHY_BERLIN_SATA) += phy-berlin-sata.o +obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_DM816X_USB) += phy-dm816x-usb.o obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o
drivers/phy/phy-da8xx-usb.c new file +244 -0
244 lines not on this page · raw message
Signature · 7 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
David Lechner
Reviewed-by Sekhar NoriRe: [PATCH v5 4/7] phy: da8xx-usb: new driver for DA8xx SoC USB PHY
In reply to Sekhar NoriThis is a new phy driver for the SoC USB controllers on the TI DA8xx family of microcontrollers. The USB 1.1 PHY is just a simple on/off. The USB 2.0 PHY also allows overriding the VBUS and ID pins.
---
Just one small change here. Changed "syscon.0" to "syscon"
(Sorry about the duplicate mail. I replied to the incorrect thread previously)
drivers/phy/Kconfig | 10 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-da8xx-usb.c | 244 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 drivers/phy/phy-da8xx-usb.c
drivers/phy/Kconfig +10 -0
@@ -35,6 +35,16 @@ config ARMADA375_USBCLUSTER_PHY depends on OF && HAS_IOMEM select GENERIC_PHY +config PHY_DA8XX_USB + tristate "TI DA8xx USB PHY Driver" + depends on ARCH_DAVINCI_DA8XX + select GENERIC_PHY + select MFD_SYSCON + help + Enable this to support the USB PHY on DA8xx SoCs. + + This driver controls both the USB 1.1 PHY and the USB 2.0 PHY. + config PHY_DM816X_USB tristate "TI dm816x USB PHY driver" depends on ARCH_OMAP2PLUS
drivers/phy/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_PHY_BERLIN_USB) += phy-berlin-usb.o obj-$(CONFIG_PHY_BERLIN_SATA) += phy-berlin-sata.o +obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_DM816X_USB) += phy-dm816x-usb.o obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o
drivers/phy/phy-da8xx-usb.c new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v5 5/7 usb: ohci-da8xx: Remove code that references mach
In reply to David LechnerIncluding mach/* is frowned upon in device drivers, so get rid of it.
This replaces usb20_clk and code that pokes CFGCHIP2 with a proper phy driver.
--- drivers/usb/host/Kconfig | 1 + drivers/usb/host/ohci-da8xx.c | 102 +++++++++++++++++++++++------------------- 2 files changed, 56 insertions(+), 47 deletions(-)
drivers/usb/host/Kconfig +1 -0
@@ -472,6 +472,7 @@ config USB_OHCI_HCD_DAVINCI bool "OHCI support for TI DaVinci DA8xx" depends on ARCH_DAVINCI_DA8XX depends on USB_OHCI_HCD=y + select PHY_DA8XX_USB default y help Enables support for the DaVinci DA8xx integrated OHCI
drivers/usb/host/ohci-da8xx.c +55 -47
174 lines not on this page · raw message
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v5 6/7 usb: musb: da8xx: Use devm in probe
In reply to David LechnerSimplify things a bit by using devm functions where possible.
--- drivers/usb/musb/da8xx.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/usb/musb/da8xx.c +5 -14
@@ -490,20 +490,18 @@ static int da8xx_probe(struct platform_device *pdev)struct da8xx_glue *glue;struct platform_device_info pinfo;struct clk *clk; +int ret; -int ret = -ENOMEM ; - - glue =kzalloc (sizeof (*glue),GFP_KERNEL ); + glue =devm_kzalloc (&pdev->dev,sizeof (*glue),GFP_KERNEL );if (!glue) {dev_err (&pdev->dev,"failed to allocate glue context\n" ); - goto err0; +return -ENOMEM ; } - clk =clk_get (&pdev->dev,"usb20" ); + clk =devm_clk_get (&pdev->dev,"usb20" );if (IS_ERR (clk)) {dev_err (&pdev->dev,"failed to get clock\n" ); - ret =PTR_ERR (clk); - goto err3; +return PTR_ERR (clk); } ret =clk_enable (clk);
@@ -560,12 +558,7 @@ err5:clk_disable (clk); err4: -clk_put (clk); - -err3: -kfree (glue); -err0:return ret; }
@@ -576,8 +569,6 @@ static int da8xx_remove(struct platform_device *pdev)platform_device_unregister (glue->musb);usb_phy_generic_unregister (glue->phy);clk_disable (glue->clk); -clk_put (glue->clk); -kfree (glue);return 0 ; }
Signature · 1 line
2.7.4
PATCH v5 7/7 usb: musb: da8xx: Remove mach code
In reply to David LechnerUse the new phy-da8xx-usb driver to take the place of the mach code that pokes CFGCHIP2 in the da8xx musb glue driver. This unbreaks the driver.
--- drivers/usb/musb/Kconfig | 2 +- drivers/usb/musb/da8xx.c | 135 ++++++++++++++++++----------------------------- 2 files changed, 51 insertions(+), 86 deletions(-)
drivers/usb/musb/Kconfig +1 -1
@@ -82,7 +82,7 @@ config USB_MUSB_DA8XX tristate "DA8xx/OMAP-L1x" depends on ARCH_DAVINCI_DA8XX depends on NOP_USB_XCEIV - depends on BROKEN + select PHY_DA8XX_USB config USB_MUSB_TUSB6010 tristate "TUSB6010"
drivers/usb/musb/da8xx.c +49 -81
221 lines not on this page · raw message
Kishon Vijay Abraham I
AppliedQuoted 6 lines · David Lechner
v5 changes:
Functionally, nothing has really changed. Just some cleanups based on feedback.
* Renamed "usbphy" to "
usb_phy" or "usb-phy" as appropriate
* License header matchesMODULE_LICENSEin new phy driver
applied all the phy patches to -next branch.
Thanks
Kishon
Quoted 27 lines
David Lechner (7):
mfd: da8xx-cfgchip: New header file for CFGCHIP registers.
dt-bindings: Add bindings for phy-da8xx-usb
phy: Addset_modecallback
phy: da8xx-usb: new driver for DA8xx SoC USB PHY
usb: ohci-da8xx: Remove code that references mach
usb: musb: da8xx: Use devm in probe
usb: musb: da8xx: Remove mach code.../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++ drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-core.c | 15 ++ drivers/phy/phy-da8xx-usb.c | 244 +++++++++++++++++++++ drivers/usb/host/Kconfig | 1 + drivers/usb/host/ohci-da8xx.c | 102 +++++---- drivers/usb/musb/Kconfig | 2 +- drivers/usb/musb/da8xx.c | 154 +++++-------- include/linux/mfd/da8xx-cfgchip.h | 153 +++++++++++++ include/linux/phy/phy.h | 17 ++ include/linux/platform_data/usb-davinci.h | 22 -- 12 files changed, 592 insertions(+), 169 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt create mode 100644 drivers/phy/phy-da8xx-usb.c create mode 100644 include/linux/mfd/da8xx-cfgchip.h