aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinaro CI <ci_notify@linaro.org>2021-01-05 16:55:05 +0000
committerLinaro CI <ci_notify@linaro.org>2021-01-05 16:55:05 +0000
commitb1584c38523bc88ae39cbcb93efab005ddc12c96 (patch)
tree75cc1e7607543b6b2abab302bed3b2a14be3a78c
parent7fc9a59e6630080fd08aa3ed1c4f1b1beb03cce4 (diff)
parent521f9aea698fa7d1d6bcc28188222f9abd8e2c77 (diff)
Merge remote-tracking branch 'sdm845-dp/tracking-qcomlt-sdm845-dp' into integration-linux-qcomlt
-rw-r--r--arch/arm64/boot/dts/qcom/sdm845-db845c.dts7
-rw-r--r--arch/arm64/boot/dts/qcom/sdm845.dtsi104
-rw-r--r--drivers/phy/qualcomm/phy-qcom-qmp.c12
-rw-r--r--drivers/usb/typec/mux/Kconfig7
-rw-r--r--drivers/usb/typec/mux/Makefile1
-rw-r--r--drivers/usb/typec/mux/gpio_aux_switch.c91
6 files changed, 212 insertions, 10 deletions
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 7cc236575ee2..e3cea9ffb19b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -487,6 +487,13 @@
status = "okay";
};
+&msm_dp {
+ status = "okay";
+ data-lanes = <0 1>;
+ vdda-1p2-supply = <&vreg_l26a_1p2>;
+ vdda-0p9-supply = <&vreg_l1a_0p875>;
+};
+
&mss_pil {
status = "okay";
firmware-name = "qcom/sdm845/mba.mbn", "qcom/sdm845/modem.mbn";
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index bcf888381f14..9313111e1816 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -3670,10 +3670,10 @@
};
usb_1_qmpphy: phy@88e9000 {
- compatible = "qcom,sdm845-qmp-usb3-phy";
+ compatible = "qcom,sdm845-qmp-usb3-dp-phy";
reg = <0 0x088e9000 0 0x18c>,
- <0 0x088e8000 0 0x10>;
- reg-names = "reg-base", "dp_com";
+ <0 0x088e8000 0 0x38>,
+ <0 0x088ea000 0 0x40>;
status = "disabled";
#clock-cells = <1>;
#address-cells = <2>;
@@ -3686,11 +3686,11 @@
<&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>;
clock-names = "aux", "cfg_ahb", "ref", "com_aux";
- resets = <&gcc GCC_USB3_DP_PHY_PRIM_BCR>,
- <&gcc GCC_USB3_PHY_PRIM_BCR>;
+ resets = <&gcc GCC_USB3_PHY_PRIM_BCR>,
+ <&gcc GCC_USB3_DP_PHY_PRIM_BCR>;
reset-names = "phy", "common";
- usb_1_ssphy: lanes@88e9200 {
+ usb_1_ssphy: usb3-phy@88e9200 {
reg = <0 0x088e9200 0 0x128>,
<0 0x088e9400 0 0x200>,
<0 0x088e9c00 0 0x218>,
@@ -3702,6 +3702,16 @@
clock-names = "pipe0";
clock-output-names = "usb3_phy_pipe_clk_src";
};
+
+ dp_phy: dp-phy@88ea200 {
+ reg = <0 0x088ea200 0 0x200>,
+ <0 0x088ea400 0 0x200>,
+ <0 0x088eaa00 0 0x200>,
+ <0 0x088ea600 0 0x200>,
+ <0 0x088ea800 0 0x200>;
+ #clock-cells = <1>;
+ #phy-cells = <0>;
+ };
};
usb_2_qmpphy: phy@88eb000 {
@@ -4057,13 +4067,20 @@
port@0 {
reg = <0>;
- dpu_intf1_out: endpoint {
- remote-endpoint = <&dsi0_in>;
+ dpu_intf0_out: endpoint {
+ remote-endpoint = <&dp_in>;
};
};
port@1 {
reg = <1>;
+ dpu_intf1_out: endpoint {
+ remote-endpoint = <&dsi0_in>;
+ };
+ };
+
+ port@2 {
+ reg = <2>;
dpu_intf2_out: endpoint {
remote-endpoint = <&dsi1_in>;
};
@@ -4095,6 +4112,73 @@
};
};
+ msm_dp: displayport-controller@ae90000 {
+ status = "disabled";
+ compatible = "qcom,sc7180-dp";
+
+ reg = <0 0x0ae90000 0 0x1400>;
+
+ interrupt-parent = <&mdss>;
+ interrupts = <12>;
+
+ clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+ <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+ <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+ <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>;
+ clock-names = "core_iface", "core_aux", "ctrl_link",
+ "ctrl_link_iface", "stream_pixel";
+ #clock-cells = <1>;
+ assigned-clocks = <&dispcc DISP_CC_MDSS_DP_LINK_CLK_SRC>,
+ <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+ assigned-clock-parents = <&dp_phy 0>, <&dp_phy 1>;
+ phys = <&dp_phy>;
+ phy-names = "dp";
+
+ operating-points-v2 = <&dp_opp_table>;
+ power-domains = <&rpmhpd SDM845_CX>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ dp_in: endpoint {
+ remote-endpoint = <&dpu_intf0_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dp_out: endpoint { };
+ };
+ };
+
+ dp_opp_table: dp-opp-table {
+ compatible = "operating-points-v2";
+
+ opp-162000000 {
+ opp-hz = /bits/ 64 <162000000>;
+ required-opps = <&rpmhpd_opp_low_svs>;
+ };
+
+ opp-270000000 {
+ opp-hz = /bits/ 64 <270000000>;
+ required-opps = <&rpmhpd_opp_svs>;
+ };
+
+ opp-540000000 {
+ opp-hz = /bits/ 64 <540000000>;
+ required-opps = <&rpmhpd_opp_svs_l1>;
+ };
+
+ opp-810000000 {
+ opp-hz = /bits/ 64 <810000000>;
+ required-opps = <&rpmhpd_opp_nom>;
+ };
+ };
+ };
+
dsi0: dsi@ae94000 {
compatible = "qcom,mdss-dsi-ctrl";
reg = <0 0x0ae94000 0 0x400>;
@@ -4371,8 +4455,8 @@
<&dsi0_phy 1>,
<&dsi1_phy 0>,
<&dsi1_phy 1>,
- <0>,
- <0>;
+ <&dp_phy 0>,
+ <&dp_phy 1>;
clock-names = "bi_tcxo",
"gcc_disp_gpll0_clk_src",
"gcc_disp_gpll0_div_clk_src",
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
index 0939a9e9d448..504f65cb3547 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -2579,6 +2579,11 @@ static const struct qmp_phy_combo_cfg sc7180_usb3dpphy_cfg = {
.dp_cfg = &sc7180_dpphy_cfg,
};
+static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {
+ .usb_cfg = &qmp_v3_usb3phy_cfg,
+ .dp_cfg = &sc7180_dpphy_cfg,
+};
+
static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = {
.type = PHY_TYPE_USB3,
.nlanes = 1,
@@ -4141,6 +4146,9 @@ static const struct of_device_id qcom_qmp_phy_of_match_table[] = {
.compatible = "qcom,sdm845-qmp-usb3-uni-phy",
.data = &qmp_v3_usb3_uniphy_cfg,
}, {
+ .compatible = "qcom,sdm845-qmp-usb3-dp-phy",
+ /* It's a combo phy */
+ }, {
.compatible = "qcom,sdm845-qmp-ufs-phy",
.data = &sdm845_ufsphy_cfg,
}, {
@@ -4183,6 +4191,10 @@ static const struct of_device_id qcom_qmp_combo_phy_of_match_table[] = {
.compatible = "qcom,sc7180-qmp-usb3-dp-phy",
.data = &sc7180_usb3dpphy_cfg,
},
+ {
+ .compatible = "qcom,sdm845-qmp-usb3-dp-phy",
+ .data = &sdm845_usb3dpphy_cfg,
+ },
{ }
};
diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig
index edead555835e..087981d59f9f 100644
--- a/drivers/usb/typec/mux/Kconfig
+++ b/drivers/usb/typec/mux/Kconfig
@@ -19,4 +19,11 @@ config TYPEC_MUX_INTEL_PMC
control the USB role switch and also the multiplexer/demultiplexer
switches used with USB Type-C Alternate Modes.
+config TYPEC_MUX_GPIO
+ tristate "GPIO DP aux switch"
+ depends on I2C
+ help
+ Driver for GPIO-controlled DP aux switch, to flip DP aux lanes
+ when orientation changes.
+
endmenu
diff --git a/drivers/usb/typec/mux/Makefile b/drivers/usb/typec/mux/Makefile
index 280a6f553115..4aeebe4df61f 100644
--- a/drivers/usb/typec/mux/Makefile
+++ b/drivers/usb/typec/mux/Makefile
@@ -2,3 +2,4 @@
obj-$(CONFIG_TYPEC_MUX_PI3USB30532) += pi3usb30532.o
obj-$(CONFIG_TYPEC_MUX_INTEL_PMC) += intel_pmc_mux.o
+obj-$(CONFIG_TYPEC_MUX_GPIO) += gpio_aux_switch.o
diff --git a/drivers/usb/typec/mux/gpio_aux_switch.c b/drivers/usb/typec/mux/gpio_aux_switch.c
new file mode 100644
index 000000000000..6236b2a0b702
--- /dev/null
+++ b/drivers/usb/typec/mux/gpio_aux_switch.c
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Driver for GPIO controlled aux switch
+ *
+ * Copyright (C) 2020 The Linux Foundation
+ */
+
+#include <linux/gpio.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/usb/typec_dp.h>
+#include <linux/usb/typec_mux.h>
+#include <linux/usb/pd.h>
+
+struct gpio_aux_switch {
+ struct typec_mux *typec_mux;
+ struct gpio_desc *gpio_en, *gpio_cc;
+};
+
+static int gpio_typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state)
+{
+ struct gpio_aux_switch *gas = typec_mux_get_drvdata(mux);
+ bool enable = false, reverse = false;
+
+ if (!state->alt)
+ return 0;
+
+ if (typec_altmode_get_orientation(state->alt) == TYPEC_ORIENTATION_REVERSE)
+ reverse = true;
+
+ if (state->alt->svid == USB_TYPEC_DP_SID && state->alt->active)
+ enable = true;
+
+ gpiod_set_value(gas->gpio_en, !enable);
+ gpiod_set_value(gas->gpio_cc, reverse);
+
+ return 0;
+}
+
+static int gpio_aux_switch_probe(struct platform_device *pdev)
+{
+ struct typec_mux_desc mux_desc = { };
+ struct device *dev = &pdev->dev;
+ struct gpio_aux_switch *gas;
+
+ gas = devm_kzalloc(dev, sizeof(*gas), GFP_KERNEL);
+ if (!gas)
+ return -ENOMEM;
+
+ gas->gpio_en = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
+ gas->gpio_cc = devm_gpiod_get(dev, "cc", GPIOD_OUT_LOW);
+
+ mux_desc.fwnode = dev->fwnode;
+ mux_desc.drvdata = gas;
+ mux_desc.set = gpio_typec_mux_set;
+ gas->typec_mux = typec_mux_register(dev, &mux_desc);
+ if (IS_ERR(gas->typec_mux))
+ return PTR_ERR(gas->typec_mux);
+
+ platform_set_drvdata(pdev, gas);
+
+ return 0;
+}
+
+static int gpio_aux_switch_remove(struct platform_device *pdev)
+{
+ struct gpio_aux_switch *gas = platform_get_drvdata(pdev);
+
+ typec_mux_unregister(gas->typec_mux);
+
+ return 0;
+}
+
+static const struct of_device_id gpio_aux_switch_dt_match[] = {
+ { .compatible = "gpio-aux-switch" },
+ { }
+};
+
+static struct platform_driver gpio_aux_switch_driver = {
+ .driver = {
+ .name = "gpio-aux-switch",
+ .of_match_table = gpio_aux_switch_dt_match,
+ },
+ .probe = gpio_aux_switch_probe,
+ .remove = gpio_aux_switch_remove,
+};
+
+module_platform_driver(gpio_aux_switch_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("GPIO AUX Switch driver");