mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
spisg: compatible with BCON [1/1]
PD#SWPL-233581 Problem: same board-level configuration needs to be compatible with different screens. Same will use spi, and some will use BCON. The SPI and BTON pins are mutually exclusive. Solution: spi group1 don't configure the default pin. Verify: T6W/T6X Change-Id: Idfa4181ce08d8558c0aa6922ec47804602bbcbb5 Signed-off-by: Feng Chen <feng.chen@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
83aa23b6d6
commit
72ea9efdae
@@ -1047,7 +1047,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "disabled";/* disabled as default */
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_z>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1063,7 +1063,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1060,7 +1060,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1070,7 +1070,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1072,7 +1072,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1098,7 +1098,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1095,7 +1095,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1104,7 +1104,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1106,7 +1106,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1072,7 +1072,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1074,7 +1074,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1073,7 +1073,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1105,7 +1105,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1106,7 +1106,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1107,7 +1107,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1105,7 +1105,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -919,7 +919,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -918,7 +918,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -918,7 +918,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -920,7 +920,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -921,7 +921,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -920,7 +920,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -921,7 +921,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -921,7 +921,7 @@
|
||||
|
||||
&spicc1 { //for UWB/LocalDimm
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "spi_pinmux"; //Compatible with BCON
|
||||
pinctrl-0 = <&spicc1_pins_h>;
|
||||
};
|
||||
|
||||
|
||||
@@ -212,6 +212,8 @@ struct spicc_device {
|
||||
struct spi_controller *controller;
|
||||
struct platform_device *pdev;
|
||||
void __iomem *base;
|
||||
struct pinctrl *pinctrl;
|
||||
struct pinctrl_state *spi_pinmux;
|
||||
struct clk *sys_clk;
|
||||
struct clk *spi_clk;
|
||||
struct clk *sclk;
|
||||
@@ -1053,10 +1055,21 @@ static int meson_spicc_setup(struct spi_device *spi)
|
||||
#ifdef MESON_SPICC_HW_IF
|
||||
struct spicc_device *spicc;
|
||||
struct spicc_controller_data *cdata;
|
||||
int ret = 0;
|
||||
|
||||
spicc = spi_controller_get_devdata(spi->controller);
|
||||
cdata = (struct spicc_controller_data *)spi->controller_data;
|
||||
if (cdata) {
|
||||
spicc->spi_pinmux = pinctrl_lookup_state(spicc->pinctrl, "spi_pinmux");
|
||||
if (IS_ERR_OR_NULL(spicc->spi_pinmux)) {
|
||||
dev_warn(&spicc->pdev->dev, "no spi_pinmux pinctrl(Maybe not error)\n");
|
||||
} else {
|
||||
ret = pinctrl_select_state(spicc->pinctrl, spicc->spi_pinmux);
|
||||
if (ret) {
|
||||
dev_err(&spicc->pdev->dev, "failed to activate spi_pinmux pinctrl state\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
cdata->controller_version = CONTROLLER_SPISG;
|
||||
cdata->controller_capabilities = CAP_DMA_TRIG_VSYNC |
|
||||
CAP_DMA_TRIG_PWM_VS | CAP_TRIG_DELAY;
|
||||
@@ -1552,6 +1565,12 @@ static int meson_spicc_probe(struct platform_device *pdev)
|
||||
dev_info(&pdev->dev, "trig resource %ps\n", spicc->trig_reg);
|
||||
}
|
||||
|
||||
spicc->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
if (IS_ERR_OR_NULL(spicc->pinctrl)) {
|
||||
dev_err(&pdev->dev, "get pinctrl fail\n");
|
||||
return PTR_ERR(spicc->pinctrl);
|
||||
}
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
|
||||
Reference in New Issue
Block a user