diff mbox series

[2/2] i2c: meson: add support for Meson G12A SoC I2C controller

Message ID 1543489197-183181-3-git-send-email-jian.hu@amlogic.com (mailing list archive)
State New, archived
Headers show
Series i2c: meson: add support for Meson G12A SoC i2c controller | expand

Commit Message

Jian Hu Nov. 29, 2018, 10:59 a.m. UTC
Add compatible and data for G12A I2C controller.

Signed-off-by: Jian Hu <jian.hu@amlogic.com>
---
 drivers/i2c/busses/i2c-meson.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Neil Armstrong Nov. 29, 2018, 11:26 a.m. UTC | #1
On 29/11/2018 11:59, Jian Hu wrote:
> Add compatible and data for G12A I2C controller.
> 
> Signed-off-by: Jian Hu <jian.hu@amlogic.com>
> ---
>  drivers/i2c/busses/i2c-meson.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
> index 90f5d04..b86eed7 100644
> --- a/drivers/i2c/busses/i2c-meson.c
> +++ b/drivers/i2c/busses/i2c-meson.c
> @@ -462,10 +462,15 @@ static int meson_i2c_remove(struct platform_device *pdev)
>  	.div_factor = 3,
>  };
>  
> +static const struct meson_i2c_data i2c_g12a_data = {
> +	.div_factor = 3,

Especially if the div_factor is the same as AXG.

If you have some other fixes for G12a in the pipe, you will add the new compatible and meson_i2c_data later,
for the div_factor, simply use the axg struct and compatible.

Neil

> +};
> +
>  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,meson-axg-i2c", .data = &i2c_axg_data },
> +	{ .compatible = "amlogic,meson-g12a-i2c", .data = &i2c_g12a_data },
>  	{},
>  };
>  
>
Jian Hu Nov. 29, 2018, 12:18 p.m. UTC | #2
Hi Neil,

On 2018/11/29 19:26, Neil Armstrong wrote:
> On 29/11/2018 11:59, Jian Hu wrote:
>> Add compatible and data for G12A I2C controller.
>>
>> Signed-off-by: Jian Hu <jian.hu@amlogic.com>
>> ---
>>   drivers/i2c/busses/i2c-meson.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
>> index 90f5d04..b86eed7 100644
>> --- a/drivers/i2c/busses/i2c-meson.c
>> +++ b/drivers/i2c/busses/i2c-meson.c
>> @@ -462,10 +462,15 @@ static int meson_i2c_remove(struct platform_device *pdev)
>>   	.div_factor = 3,
>>   };
>>   
>> +static const struct meson_i2c_data i2c_g12a_data = {
>> +	.div_factor = 3,
> 
> Especially if the div_factor is the same as AXG.
> 
> If you have some other fixes for G12a in the pipe, you will add the new compatible and meson_i2c_data later,
> for the div_factor, simply use the axg struct and compatible.
> 
> Neil
> 
For axg and g12a SoC, the div_factor is the same, and I have confirmed 
that they share the same IP. I prefer g12a uses axg's compatible and 
data if it is reasonable. I will just submit the i2c controller node in 
meson-g12a.dtsi.
>> +};
>> +
>>   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,meson-axg-i2c", .data = &i2c_axg_data },
>> +	{ .compatible = "amlogic,meson-g12a-i2c", .data = &i2c_g12a_data },
>>   	{},
>>   };
>>   
>>
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
index 90f5d04..b86eed7 100644
--- a/drivers/i2c/busses/i2c-meson.c
+++ b/drivers/i2c/busses/i2c-meson.c
@@ -462,10 +462,15 @@  static int meson_i2c_remove(struct platform_device *pdev)
 	.div_factor = 3,
 };
 
+static const struct meson_i2c_data i2c_g12a_data = {
+	.div_factor = 3,
+};
+
 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,meson-axg-i2c", .data = &i2c_axg_data },
+	{ .compatible = "amlogic,meson-g12a-i2c", .data = &i2c_g12a_data },
 	{},
 };