i2c: meson8b: add i2c surpport

PD#154260: i2c: meson8b: add i2c surpport
PD#157452: i2c: meson8b: add i2c surpport

1. add i2c surpport.
2. update gx/axg/txlx dts.
3. setup i2c b pinctrl for all platforms of axg.

Change-Id: I7fe41b7f42c741cb70cce1c4b7dd57d288deafa7
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
This commit is contained in:
Jian Hu
2017-12-23 14:23:45 +08:00
committed by Bo Yang
parent ed9d4cf21d
commit ce1681b1ae
19 changed files with 126 additions and 121 deletions

View File

@@ -2,9 +2,10 @@ Amlogic Meson I2C controller
Required properties:
- compatible: must be "amlogic,meson6-i2c"
or "amlogic,meson-gxbb-i2c"
or "amlogic,meson-gx-i2c"
or "amlogic,meson-axg-i2c"
or "amlogic,meson-txlx-i2c"
or "amlogic,meson8b-i2c"
- reg: physical address and length of the device registers
- interrupts: a single interrupt specifier
- clocks: clock for the device

View File

@@ -14,7 +14,7 @@
* more details.
*
*/
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/meson8b-clkc.h>
#include <dt-bindings/gpio/meson8b-gpio.h>
#include <dt-bindings/reset/amlogic,meson8b-reset.h>
@@ -67,80 +67,15 @@
};
};
i2c_ao: i2c@c8100500{ /*I2C-AO*/
compatible = "amlogic, meson-i2c";
dev_name = "i2c-AO";
status = "disabled";
reg = <0xc8100500 0x1d>;
device_id = <0>;
pinctrl-names="default";
pinctrl-0=<&ao_i2c_master>;
#address-cells = <1>;
#size-cells = <0>;
use_pio = <0>;
master_i2c_speed = <100000>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
i2c_a: i2c@c1108500{ /*I2C-A*/
compatible = "amlogic, meson-i2c";
dev_name = "i2c-A";
status = "disabled";
reg = <0xc1108500 0x20>;
device_id = <1>;
pinctrl-names="default";
pinctrl-0=<&a_i2c_master>;
#address-cells = <1>;
#size-cells = <0>;
use_pio = <0>;
master_i2c_speed = <300000>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
i2c_b: i2c@c11087c0{ /*I2C-B*/
compatible = "amlogic, meson-i2c";
dev_name = "i2c-B";
status = "disabled";
reg = <0xc11087c0 0x20>;
device_id = <2>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
#address-cells = <1>;
#size-cells = <0>;
use_pio = <0>;
master_i2c_speed = <300000>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
i2c_c: i2c@c11087e0{ /*I2C-C*/
compatible = "amlogic, meson-i2c";
dev_name = "i2c-C";
status = "disabled";
reg = <0xc11087e0 0x20>;
device_id = <3>;
pinctrl-names="default";
pinctrl-0=<&c_i2c_master>;
#address-cells = <1>;
#size-cells = <0>;
use_pio = <0>;
master_i2c_speed = <300000>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
i2c_d: i2c@c1108d20{ /*I2C-D*/
compatible = "amlogic, meson-i2c";
dev_name = "i2c-D";
status = "disabled";
reg = <0xc1108d20 0x20>;
device_id = <4>;
pinctrl-names="default";
pinctrl-0=<&d_i2c_master>;
#address-cells = <1>;
#size-cells = <0>;
use_pio = <0>;
master_i2c_speed = <300000>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
i2c_AO: i2c@0100 {
compatible = "amlogic,meson8b-i2c";
status = "disabled";
reg = <0xc8100500 0x20>;
interrupts = <GIC_SPI 124 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
soc {
@@ -357,6 +292,58 @@
status = "disabled";
};
/*i2c-A*/
i2c0: i2c@8500 {
compatible = "amlogic,meson8b-i2c";
status = "disabled";
reg = <0xc1108500 0x20>;
interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 47 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
/*i2c-B*/
i2c1: i2c@87c0 {
compatible = "amlogic,meson8b-i2c";
status = "disabled";
reg = <0xc11087c0 0x20>;
interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 48 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
/*i2c-C*/
i2c2: i2c@87e0 {
compatible = "amlogic,meson8b-i2c";
status = "disabled";
reg = <0xc11087e0 0x20>;
interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 49 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
/*i2c-D*/
i2c3: i2c@8d20 {
compatible = "amlogic,meson8b-i2c";
status = "disabled";
reg = <0xc1108d20 0x20>;
interrupts = <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clkc CLKID_CLK81>;
clock-names = "clk_i2c";
};
pinctrl_cbus: pinctrl@c1109880 {
compatible = "amlogic,meson8b-cbus-pinctrl";
#address-cells = <1>;

View File

@@ -605,11 +605,15 @@
pinctrl-0 = <&uart_b0_pins>;
pinctrl-names = "default";
};
&i2c_a {
&i2c0 {
status = "ok";
pinctrl-names="default";
pinctrl-0=<&a_i2c_master>;
};
&i2c_ao {
&i2c_AO {
status = "ok";
pinctrl-names="default";
pinctrl-0=<&ao_i2c_master>;
};
&pinctrl_cbus {
sdhc_emmc_clk_cmd_pins:sdhc_emmc_clk_cmd_pins {

View File

@@ -608,9 +608,9 @@
pinctrl-0 = <&uart_ao_a_pins>;
pinctrl-names = "default";
};
&i2c_a {
&i2c0 {
status = "ok";
};
&i2c_ao {
&i2c_AO {
status = "ok";
};

View File

@@ -495,10 +495,10 @@
pinctrl-0 = <&uart_b0_pins>;
pinctrl-names = "default";
};
&i2c_a {
&i2c0 {
status = "ok";
};
&i2c_ao {
&i2c_AO {
status = "ok";
};

View File

@@ -708,8 +708,8 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@30 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -702,8 +702,8 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@30 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -882,8 +882,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@32 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -882,8 +882,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@32 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -883,8 +883,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@32 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -884,8 +884,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@32 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -709,8 +709,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@30 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -707,8 +707,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@30 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -709,8 +709,9 @@
/* for spk board */
&i2c1 {
status = "okay";
//pinctrl-names="default";
//pinctrl-0=<&b_i2c_master>;
pinctrl-names="default";
pinctrl-0=<&b_i2c_master>;
tlv320adc3101_32: tlv320adc3101_32@30 {
compatible = "ti,tlv320adc3101";
#sound-dai-cells = <0>;

View File

@@ -345,7 +345,7 @@
/*i2c-A*/
i2c0: i2c@1f000 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-axg-i2c";
status = "disabled";
reg = <0x0 0x1f000 0x0 0x20>;
interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
@@ -358,7 +358,7 @@
/*i2c-B*/
i2c1: i2c@1e000 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-axg-i2c";
status = "disabled";
reg = <0x0 0x1e000 0x0 0x20>;
interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>,
@@ -371,7 +371,7 @@
/*i2c-C*/
i2c2: i2c@1d000 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-axg-i2c";
status = "disabled";
reg = <0x0 0x1d000 0x0 0x20>;
interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>,
@@ -414,7 +414,7 @@
};
i2c_AO: i2c@5000 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-axg-i2c";
status = "disabled";
reg = <0x0 0x05000 0x0 0x20>;
interrupts = <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>;

View File

@@ -428,7 +428,7 @@
/*i2c-A*/
i2c0: i2c@8500 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x8500 0x0 0x20>;
interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
@@ -441,7 +441,7 @@
/*i2c-B*/
i2c1: i2c@87c0 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x87c0 0x0 0x20>;
interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>,
@@ -454,7 +454,7 @@
/*i2c-C*/
i2c2: i2c@87e0 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x87e0 0x0 0x20>;
interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>,
@@ -467,7 +467,7 @@
/*i2c-D*/
i2c3: i2c@8d20 {
compatible = "amlogic,meson-axg-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x8d20 0x0 0x20>;
interrupts = <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>,
@@ -490,10 +490,10 @@
reg=<0x0 0x0220 0x0 0x4>;
};
i2c_AO: i2c@0100 {
compatible = "amlogic,meson-txlx-i2c";
i2c_AO: i2c@0500 {
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x0100 0x0 0x20>;
reg = <0x0 0x0500 0x0 0x20>;
interrupts = <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -511,7 +511,7 @@
/*i2c-A*/
i2c0: i2c@8500 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x8500 0x0 0x20>;
interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
@@ -524,7 +524,7 @@
/*i2c-B*/
i2c1: i2c@87c0 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x87c0 0x0 0x20>;
interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>,
@@ -537,7 +537,7 @@
/*i2c-C*/
i2c2: i2c@87e0 {
compatible = "amlogic,meson-txlx-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x87e0 0x0 0x20>;
interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>,
@@ -550,7 +550,7 @@
/*i2c-D*/
i2c3: i2c@8d20 {
compatible = "amlogic,meson-axg-i2c";
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x8d20 0x0 0x20>;
interrupts = <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>,
@@ -573,10 +573,10 @@
reg=<0x0 0x0220 0x0 0x4>;
};
i2c_AO: i2c@0100 {
compatible = "amlogic,meson-txlx-i2c";
i2c_AO: i2c@0500 {
compatible = "amlogic,meson-gx-i2c";
status = "disabled";
reg = <0x0 0x0100 0x0 0x20>;
reg = <0x0 0x0500 0x0 0x20>;
interrupts = <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>;
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -600,7 +600,7 @@
};
i2c3: i2c@1c000 {
compatible = "amlogic,meson-axg-i2c";
compatible = "amlogic,meson-txlx-i2c";
status = "disabled";
reg = <0x0 0x1c000 0x0 0x20>;
interrupts = <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>,

View File

@@ -507,7 +507,12 @@ static const struct meson_i2c_data i2c_meson6_data = {
.delay_ajust = 15,
};
static const struct meson_i2c_data i2c_gxbb_data = {
static const struct meson_i2c_data i2c_meson8b_data = {
.div_factor = 4,
.delay_ajust = 15,
};
static const struct meson_i2c_data i2c_gx_data = {
.div_factor = 4,
.delay_ajust = 15,
};
@@ -524,7 +529,8 @@ static const struct meson_i2c_data i2c_txlx_data = {
static const struct of_device_id meson_i2c_match[] = {
{ .compatible = "amlogic,meson6-i2c", .data = &i2c_meson6_data },
{ .compatible = "amlogic,meson-gxbb-i2c", .data = &i2c_gxbb_data },
{ .compatible = "amlogic,meson8b-i2c", .data = &i2c_meson8b_data },
{ .compatible = "amlogic,meson-gx-i2c", .data = &i2c_gx_data },
{ .compatible = "amlogic,meson-axg-i2c", .data = &i2c_axg_data },
{ .compatible = "amlogic,meson-txlx-i2c", .data = &i2c_txlx_data },
{},