Skip to content

Commit 6d6ce40

Browse files
tmlindkishon
authored andcommitted
phy: cpcap-usb: Add CPCAP PMIC USB support
Some Motorola phones like droid 4 use a custom CPCAP PMIC that has a multiplexing USB PHY. This USB PHY can operate at least in four modes using pin multiplexing and two control GPIOS: - Pass through companion PHY for the SoC USB PHY - ULPI PHY for the SoC - Pass through USB for the modem - UART debug console for the SoC This patch adds support for droid 4 USB PHY and debug UART modes, support for other modes can be added later on as needed. Both peripheral and host mode are working for the USB. The host mode depends on the cpcap-charger driver for VBUS. VBUS and ID pin detection are done using cpcap-adc IIO ADC driver. Cc: devicetree@vger.kernel.org Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Tested-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
1 parent 4a3449d commit 6d6ce40

6 files changed

Lines changed: 732 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Motorola CPCAP PMIC USB PHY binding
2+
3+
Required properties:
4+
compatible: Shall be either "motorola,cpcap-usb-phy" or
5+
"motorola,mapphone-cpcap-usb-phy"
6+
#phy-cells: Shall be 0
7+
interrupts: CPCAP PMIC interrupts used by the USB PHY
8+
interrupt-names: Interrupt names
9+
io-channels: IIO ADC channels used by the USB PHY
10+
io-channel-names: IIO ADC channel names
11+
vusb-supply: Regulator for the PHY
12+
13+
Optional properties:
14+
pinctrl: Optional alternate pin modes for the PHY
15+
pinctrl-names: Names for optional pin modes
16+
mode-gpios: Optional GPIOs for configuring alternate modes
17+
18+
Example:
19+
cpcap_usb2_phy: phy {
20+
compatible = "motorola,mapphone-cpcap-usb-phy";
21+
pinctrl-0 = <&usb_gpio_mux_sel1 &usb_gpio_mux_sel2>;
22+
pinctrl-1 = <&usb_ulpi_pins>;
23+
pinctrl-2 = <&usb_utmi_pins>;
24+
pinctrl-3 = <&uart3_pins>;
25+
pinctrl-names = "default", "ulpi", "utmi", "uart";
26+
#phy-cells = <0>;
27+
interrupts-extended = <
28+
&cpcap 15 0 &cpcap 14 0 &cpcap 28 0 &cpcap 19 0
29+
&cpcap 18 0 &cpcap 17 0 &cpcap 16 0 &cpcap 49 0
30+
&cpcap 48 1
31+
>;
32+
interrupt-names =
33+
"id_ground", "id_float", "se0conn", "vbusvld",
34+
"sessvld", "sessend", "se1", "dm", "dp";
35+
mode-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH
36+
&gpio1 0 GPIO_ACTIVE_HIGH>;
37+
io-channels = <&cpcap_adc 2>, <&cpcap_adc 7>;
38+
io-channel-names = "vbus", "id";
39+
vusb-supply = <&vusb>;
40+
};

‎drivers/phy/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ source "drivers/phy/amlogic/Kconfig"
5353
source "drivers/phy/broadcom/Kconfig"
5454
source "drivers/phy/hisilicon/Kconfig"
5555
source "drivers/phy/marvell/Kconfig"
56+
source "drivers/phy/motorola/Kconfig"
5657
source "drivers/phy/qualcomm/Kconfig"
5758
source "drivers/phy/renesas/Kconfig"
5859
source "drivers/phy/rockchip/Kconfig"

‎drivers/phy/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
1616
obj-y += broadcom/ \
1717
hisilicon/ \
1818
marvell/ \
19+
motorola/ \
1920
qualcomm/ \
2021
samsung/ \
2122
st/ \

‎drivers/phy/motorola/Kconfig‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Phy drivers for Motorola devices
3+
#
4+
config PHY_CPCAP_USB
5+
tristate "CPCAP PMIC USB PHY driver"
6+
depends on USB_SUPPORT && IIO
7+
select GENERIC_PHY
8+
select USB_PHY
9+
help
10+
Enable this for USB to work on Motorola phones and tablets
11+
such as Droid 4.

‎drivers/phy/motorola/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Makefile for the phy drivers.
3+
#
4+
5+
obj-$(CONFIG_PHY_CPCAP_USB) += phy-cpcap-usb.o

0 commit comments

Comments
 (0)