diff mbox series

[RFC,10/14] i2c: qcom-cci: add msm8974 compatible

Message ID 20220522162802.208275-11-luca@z3ntu.xyz (mailing list archive)
State Not Applicable
Headers show
Series CAMSS support for MSM8974 | expand

Commit Message

Luca Weiss May 22, 2022, 4:27 p.m. UTC
From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

MSM8974 CCI is the same as MSM8916 except it has two masters.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
To note, the cci_v1_5_data variable name is just a bit arbitrary and
isn't meant to reflect IP version "1.5". I'd be happy to change the
variable name to something else.

 drivers/i2c/busses/i2c-qcom-cci.c | 35 +++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Comments

Wolfram Sang June 14, 2022, 8:20 p.m. UTC | #1
On Sun, May 22, 2022 at 06:27:58PM +0200, Luca Weiss wrote:
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> 
> MSM8974 CCI is the same as MSM8916 except it has two masters.
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> To note, the cci_v1_5_data variable name is just a bit arbitrary and
> isn't meant to reflect IP version "1.5". I'd be happy to change the
> variable name to something else.

Loic, Robert: I know this series is marked RFC, but the I2C patches
adding a new SoC to the driver are maybe interesting already?
Loic Poulain June 15, 2022, 5:11 p.m. UTC | #2
On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> MSM8974 CCI is the same as MSM8916 except it has two masters.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

> ---
> To note, the cci_v1_5_data variable name is just a bit arbitrary and
> isn't meant to reflect IP version "1.5". I'd be happy to change the
> variable name to something else.
>
>  drivers/i2c/busses/i2c-qcom-cci.c | 35 +++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index 5c7cc862f08f..a68f17eb9dd0 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -725,6 +725,40 @@ static const struct cci_data cci_v1_data = {
>         },
>  };
>
> +static const struct cci_data cci_v1_5_data = {
> +       .num_masters = 2,
> +       .queue_size = { 64, 16 },
> +       .quirks = {
> +               .max_write_len = 10,
> +               .max_read_len = 12,
> +       },
> +       .cci_clk_rate =  19200000,
> +       .params[I2C_MODE_STANDARD] = {
> +               .thigh = 78,
> +               .tlow = 114,
> +               .tsu_sto = 28,
> +               .tsu_sta = 28,
> +               .thd_dat = 10,
> +               .thd_sta = 77,
> +               .tbuf = 118,
> +               .scl_stretch_en = 0,
> +               .trdhld = 6,
> +               .tsp = 1
> +       },
> +       .params[I2C_MODE_FAST] = {
> +               .thigh = 20,
> +               .tlow = 28,
> +               .tsu_sto = 21,
> +               .tsu_sta = 21,
> +               .thd_dat = 13,
> +               .thd_sta = 18,
> +               .tbuf = 32,
> +               .scl_stretch_en = 0,
> +               .trdhld = 6,
> +               .tsp = 3
> +       },
> +};
> +
>  static const struct cci_data cci_v2_data = {
>         .num_masters = 2,
>         .queue_size = { 64, 16 },
> @@ -773,6 +807,7 @@ static const struct cci_data cci_v2_data = {
>
>  static const struct of_device_id cci_dt_match[] = {
>         { .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
> +       { .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data},
>         { .compatible = "qcom,msm8996-cci", .data = &cci_v2_data},
>         { .compatible = "qcom,sdm845-cci", .data = &cci_v2_data},
>         { .compatible = "qcom,sm8250-cci", .data = &cci_v2_data},
> --
> 2.36.0
>
Loic Poulain June 15, 2022, 5:13 p.m. UTC | #3
On Tue, 14 Jun 2022 at 22:20, Wolfram Sang <wsa@kernel.org> wrote:
>
> On Sun, May 22, 2022 at 06:27:58PM +0200, Luca Weiss wrote:
> > From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> >
> > MSM8974 CCI is the same as MSM8916 except it has two masters.
> >
> > Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > To note, the cci_v1_5_data variable name is just a bit arbitrary and
> > isn't meant to reflect IP version "1.5". I'd be happy to change the
> > variable name to something else.
>
> Loic, Robert: I know this series is marked RFC, but the I2C patches
> adding a new SoC to the driver are maybe interesting already?

Yes I agree, no objection to get them.

Regards,
Loic
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 5c7cc862f08f..a68f17eb9dd0 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -725,6 +725,40 @@  static const struct cci_data cci_v1_data = {
 	},
 };
 
+static const struct cci_data cci_v1_5_data = {
+	.num_masters = 2,
+	.queue_size = { 64, 16 },
+	.quirks = {
+		.max_write_len = 10,
+		.max_read_len = 12,
+	},
+	.cci_clk_rate =  19200000,
+	.params[I2C_MODE_STANDARD] = {
+		.thigh = 78,
+		.tlow = 114,
+		.tsu_sto = 28,
+		.tsu_sta = 28,
+		.thd_dat = 10,
+		.thd_sta = 77,
+		.tbuf = 118,
+		.scl_stretch_en = 0,
+		.trdhld = 6,
+		.tsp = 1
+	},
+	.params[I2C_MODE_FAST] = {
+		.thigh = 20,
+		.tlow = 28,
+		.tsu_sto = 21,
+		.tsu_sta = 21,
+		.thd_dat = 13,
+		.thd_sta = 18,
+		.tbuf = 32,
+		.scl_stretch_en = 0,
+		.trdhld = 6,
+		.tsp = 3
+	},
+};
+
 static const struct cci_data cci_v2_data = {
 	.num_masters = 2,
 	.queue_size = { 64, 16 },
@@ -773,6 +807,7 @@  static const struct cci_data cci_v2_data = {
 
 static const struct of_device_id cci_dt_match[] = {
 	{ .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
+	{ .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data},
 	{ .compatible = "qcom,msm8996-cci", .data = &cci_v2_data},
 	{ .compatible = "qcom,sdm845-cci", .data = &cci_v2_data},
 	{ .compatible = "qcom,sm8250-cci", .data = &cci_v2_data},