platform/x86: int3472: Add board data for Intel nvl
Subsystems (5)
PATCH v2 1/2 platform/x86: int3472: Add board data for Intel nvl
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int347_ov13b_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_core_consumer_supplies), + .consumer_supplies = int347_ov13b_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_ana_consumer_supplies), + .consumer_supplies = int347_ov13b_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vcm_consumer_supplies), + .consumer_supplies = int347_ov13b_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vsio_consumer_supplies), + .consumer_supplies = int347_ov13b_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux1_consumer_supplies), + .consumer_supplies = int347_ov13b_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux2_consumer_supplies), + .consumer_supplies = int347_ov13b_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"s_resetn" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:07" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
PATCH v2 2/2 media: i2c: ov13b10: Support tps68470 regulator and gpio
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in power_on()
--- drivers/media/i2c/ov13b10.c | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
drivers/media/i2c/ov13b10.c +35 -3
@@ -709,6 +709,10 @@ struct ov13b10 {struct clk *img_clk;struct regulator *avdd; +struct regulator *vio; +struct regulator *core; +struct gpio_desc *enable; +struct gpio_desc *reset;/* V4L2 Controls */
@@ -1475,12 +1479,19 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)unsigned long freq;int ret; - ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"s_resetn" ,GPIOD_OUT_LOW ); +else + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->reset),"failed to get reset gpio\n" ); - ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,"tps68470-clk" ); +else + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );
@@ -1490,8 +1501,11 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, -EINVAL ,"external clock %lu is not supported\n" , freq); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"ana" ); +else + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );if (IS_ERR (ov13b->avdd)) { ret =PTR_ERR (ov13b->avdd); ov13b->avdd =NULL ;
@@ -1499,6 +1513,24 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, ret,"failed to get avdd regulator\n" ); } +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )){ + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dovdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" ); + } + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dvdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" ); + } + }return 0 ; }
Signature · 1 line
2.43.0
Re: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Arun,
Thank you for your patch.
Quoted 13 lines · Arun T
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in
power_on()Signed-off-by Arun T <[email protected]>--- drivers/media/i2c/ov13b10.c | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)drivers/media/i2c/ov13b10.c +0
-0
drivers/media/i2c/ov13b10.c struct ov13b10 { · line 714
Quoted 6 lines
drivers/media/i2c/ov13b10.c +3
-0@@ -709,6 +709,10 @@ struct ov13b10 {struct clk *img_clk;struct regulator *avdd; +struct regulator *vio; +struct regulator *core; +struct gpio_desc *enable;
This new enable gpio does not seem to get used in the patch at all ?
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1485
Quoted 13 lines
drivers/media/i2c/ov13b10.c +5
-1+struct gpio_desc *reset;/* V4L2 Controls */ @@ -1475,12 +1479,19 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)unsigned long freq;int ret; - ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"s_resetn" ,GPIOD_OUT_LOW ); +else + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );
Nack, you're adding a lookup in patch 1/2, simply use "reset" there instead of "s_resetn" and then you don't need this.
More importantly board/platform specific info like this must NOT be present in sensor drivers.
All uses of "if (strstr(dev_name(ov13b->dev), "OVTI13B1:01"))" in this patch MUST be dropped.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1494
Quoted 10 lines
drivers/media/i2c/ov13b10.c +5
-1if (IS_ERR (ov13b->reset))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->reset),"failed to get reset gpio\n" ); - ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,"tps68470-clk" ); +else + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +
Same here, the old code with the NULL name arg will work fine since there should be only 1 clk provider.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1507
Quoted 11 lines
drivers/media/i2c/ov13b10.c +4
-0if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );@@ -1490,8 +1501,11 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, -EINVAL ,"external clock %lu is not supported\n" , freq); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"ana" ); +else + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );
Again you're providing the map information in patch 1/2 just call it avdd!
Quoted 17 lines
drivers/media/i2c/ov13b10.c +8
-1- ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );if (IS_ERR (ov13b->avdd)) { ret =PTR_ERR (ov13b->avdd); ov13b->avdd =NULL ;@@ -1499,6 +1513,24 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, ret,"failed to get avdd regulator\n" ); } +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )){ + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dovdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" );
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1533
Quoted 10 lines
drivers/media/i2c/ov13b10.c +10
-0+ } + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dvdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" ); + } + }
You're using ov13b->avdd to store the other 2 regulators too that cannot be right...
Also for adding multiple regulators you should use the bulk regulator API, see e.g. :
And there is no need for the if (strstr(dev_name(ov13b->dev), "OVTI13B1:01")){ here, the regulator core will provide dummy regulators on boards where there are no regulators defined for dovdd and dvdd.
Regards,
Hans
T, Arun
NAKRE: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Johannes,
Thanks for reviewing below Patches.
I have updated with your review comments and pushed Patches. Please review those patches and merge it .
-
Regards,
Arun T
-----Original Message-----
From: [email protected] <[email protected]>
Sent: 02 February 2026 08:42 PM
To: T, Arun <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Arun,
Thank you for your patch.
Quoted 14 lines · Arun T
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in
power_on()Signed-off-by Arun T <[email protected]>--- drivers/media/i2c/ov13b10.c | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)drivers/media/i2c/ov13b10.c +0
-0
drivers/media/i2c/ov13b10.c struct ov13b10 { · line 714
Quoted 6 lines
drivers/media/i2c/ov13b10.c +3
-0@@ -709,6 +709,10 @@ struct ov13b10 {struct clk *img_clk;struct regulator *avdd; +struct regulator *vio; +struct regulator *core; +struct gpio_desc *enable;
This new enable gpio does not seem to get used in the patch at all ?
Quoted 5 lines
drivers/media/i2c/ov13b10.c +1
-0+struct gpio_desc *reset;/* V4L2 Controls */
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1486
Quoted 9 lines
drivers/media/i2c/ov13b10.c +5
-1@@ -1475,12 +1479,19 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)unsigned long freq;int ret; - ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"s_resetn" ,GPIOD_OUT_LOW ); +else + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" , +GPIOD_OUT_LOW );
Nack, you're adding a lookup in patch 1/2, simply use "reset" there instead of "s_resetn" and then you don't need this.
More importantly board/platform specific info like this must NOT be present in sensor drivers.
All uses of "if (strstr(dev_name(ov13b->dev), "OVTI13B1:01"))" in this patch MUST be dropped.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1494
Quoted 10 lines
drivers/media/i2c/ov13b10.c +5
-1if (IS_ERR (ov13b->reset))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->reset),"failed to get reset gpio\n" ); - ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,"tps68470-clk" ); +else + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +
Same here, the old code with the NULL name arg will work fine since there should be only 1 clk provider.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1507
Quoted 11 lines
drivers/media/i2c/ov13b10.c +0
-0if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk), "failed to get imaging clock\n"); @@ -1490,8 +1501,11 @@static int
ov13b10_get_pm_resources(struct ov13b10 *ov13b)drivers/media/i2c/ov13b10.c +4
-0return dev_err_probe (ov13b->dev, -EINVAL ,"external clock %lu is not supported\n" , freq); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"ana" ); +else + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );
Again you're providing the map information in patch 1/2 just call it avdd!
Quoted 17 lines
drivers/media/i2c/ov13b10.c +8
-1- ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );if (IS_ERR (ov13b->avdd)) { ret =PTR_ERR (ov13b->avdd); ov13b->avdd =NULL ;@@ -1499,6 +1513,24 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, ret,"failed to get avdd regulator\n" ); } +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )){ + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dovdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" );
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1533
Quoted 10 lines
drivers/media/i2c/ov13b10.c +10
-0+ } + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dvdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" ); + } + }
You're using ov13b->avdd to store the other 2 regulators too that cannot be right...
Also for adding multiple regulators you should use the bulk regulator API, see e.g. :
And there is no need for the if (strstr(dev_name(ov13b->dev), "OVTI13B1:01")){ here, the regulator core will provide dummy regulators on boards where there are no regulators defined for dovdd and dvdd.
Regards,
Hans
T, Arun
NAKRE: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Johannes,
I have updated your review comments and pushed to mailing list. Can you please review and push patches to upstream.
-
Regards,
Arun T
-----Original Message-----
From: T, Arun
Sent: 17 February 2026 11:42 AM
To: '[email protected]' <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Johannes,
Thanks for reviewing below Patches.
I have updated with your review comments and pushed Patches. Please review those patches and merge it .
-
Regards,
Arun T
-----Original Message-----
From: [email protected] <[email protected]>
Sent: 02 February 2026 08:42 PM
To: T, Arun <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Arun,
Thank you for your patch.
Quoted 14 lines · Arun T
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in
power_on()Signed-off-by Arun T <[email protected]>--- drivers/media/i2c/ov13b10.c | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)drivers/media/i2c/ov13b10.c +0
-0
drivers/media/i2c/ov13b10.c struct ov13b10 { · line 714
Quoted 6 lines
drivers/media/i2c/ov13b10.c +3
-0@@ -709,6 +709,10 @@ struct ov13b10 {struct clk *img_clk;struct regulator *avdd; +struct regulator *vio; +struct regulator *core; +struct gpio_desc *enable;
This new enable gpio does not seem to get used in the patch at all ?
Quoted 5 lines
drivers/media/i2c/ov13b10.c +1
-0+struct gpio_desc *reset;/* V4L2 Controls */
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1486
Quoted 9 lines
drivers/media/i2c/ov13b10.c +5
-1@@ -1475,12 +1479,19 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)unsigned long freq;int ret; - ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"s_resetn" ,GPIOD_OUT_LOW ); +else + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" , +GPIOD_OUT_LOW );
Nack, you're adding a lookup in patch 1/2, simply use "reset" there instead of "s_resetn" and then you don't need this.
More importantly board/platform specific info like this must NOT be present in sensor drivers.
All uses of "if (strstr(dev_name(ov13b->dev), "OVTI13B1:01"))" in this patch MUST be dropped.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1494
Quoted 10 lines
drivers/media/i2c/ov13b10.c +5
-1if (IS_ERR (ov13b->reset))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->reset),"failed to get reset gpio\n" ); - ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,"tps68470-clk" ); +else + ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +
Same here, the old code with the NULL name arg will work fine since there should be only 1 clk provider.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1507
Quoted 11 lines
drivers/media/i2c/ov13b10.c +0
-0if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk), "failed to get imaging clock\n"); @@ -1490,8 +1501,11 @@static int
ov13b10_get_pm_resources(struct ov13b10 *ov13b)drivers/media/i2c/ov13b10.c +4
-0return dev_err_probe (ov13b->dev, -EINVAL ,"external clock %lu is not supported\n" , freq); +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )) + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"ana" ); +else + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );
Again you're providing the map information in patch 1/2 just call it avdd!
Quoted 17 lines
drivers/media/i2c/ov13b10.c +8
-1- ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" );if (IS_ERR (ov13b->avdd)) { ret =PTR_ERR (ov13b->avdd); ov13b->avdd =NULL ;@@ -1499,6 +1513,24 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)return dev_err_probe (ov13b->dev, ret,"failed to get avdd regulator\n" ); } +if (strstr (dev_name (ov13b->dev),"OVTI13B1:01" )){ + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dovdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" );
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1533
Quoted 10 lines
drivers/media/i2c/ov13b10.c +10
-0+ } + ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"dvdd" ); +if (IS_ERR (ov13b->avdd)) { + ret =PTR_ERR (ov13b->avdd); + ov13b->avdd =NULL ; +if (ret != -ENODEV ) +return dev_err_probe (ov13b->dev, ret, +"failed to get avdd regulator\n" ); + } + }
You're using ov13b->avdd to store the other 2 regulators too that cannot be right...
Also for adding multiple regulators you should use the bulk regulator API, see e.g. :
And there is no need for the if (strstr(dev_name(ov13b->dev), "OVTI13B1:01")){ here, the regulator core will provide dummy regulators on boards where there are no regulators defined for dovdd and dvdd.
Regards,
Hans
PATCH v2 1/2 platform/x86: int3472: Add board data for Intel nvl
In reply to Arun TThe Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int347_ov13b_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("avdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_core_consumer_supplies), + .consumer_supplies = int347_ov13b_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_ana_consumer_supplies), + .consumer_supplies = int347_ov13b_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vcm_consumer_supplies), + .consumer_supplies = int347_ov13b_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vsio_consumer_supplies), + .consumer_supplies = int347_ov13b_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux1_consumer_supplies), + .consumer_supplies = int347_ov13b_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux2_consumer_supplies), + .consumer_supplies = int347_ov13b_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:07" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
PATCH v2 2/2 media: i2c: ov13b10: Support tps68470 regulator and gpio
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in power_on
--- drivers/media/i2c/ov13b10.c | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-)
drivers/media/i2c/ov13b10.c +26 -21
@@ -11,6 +11,7 @@#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fwnode.h> +#include <linux/regulator/consumer.h> #define OV13B10_REG_VALUE_08BIT 1#define OV13B10_REG_VALUE_16BIT 2
@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +}; + +struct ov13b10 {struct device *dev;
@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */
@@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);
@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
@@ -1473,7 +1478,7 @@ static void ov13b10_free_controls(struct ov13b10 *ov13b)static int ov13b10_get_pm_resources (struct ov13b10 *ov13b) {unsigned long freq; -int ret; +int ret, i; ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))
@@ -1481,6 +1486,7 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) "failed to get reset gpio\n"); ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );
@@ -1491,15 +1497,14 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd); - ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev,ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies); +if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 1 line
2.43.0
PATCH v2 1/2 platform/x86: int3472: Add board data for Intel nvl
In reply to Arun TThe Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int347_ov13b_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_core_consumer_supplies), + .consumer_supplies = int347_ov13b_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_ana_consumer_supplies), + .consumer_supplies = int347_ov13b_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vcm_consumer_supplies), + .consumer_supplies = int347_ov13b_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_vsio_consumer_supplies), + .consumer_supplies = int347_ov13b_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux1_consumer_supplies), + .consumer_supplies = int347_ov13b_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int347_ov13b_aux2_consumer_supplies), + .consumer_supplies = int347_ov13b_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:07" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
PATCH v2 2/2 media: i2c: ov13b10: Support tps68470 regulator and gpio
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in power_on
--- drivers/media/i2c/ov13b10.c | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-)
drivers/media/i2c/ov13b10.c +26 -21
@@ -11,6 +11,7 @@#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fwnode.h> +#include <linux/regulator/consumer.h> #define OV13B10_REG_VALUE_08BIT 1#define OV13B10_REG_VALUE_16BIT 2
@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +}; + +struct ov13b10 {struct device *dev;
@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */
@@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);
@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
@@ -1473,7 +1478,7 @@ static void ov13b10_free_controls(struct ov13b10 *ov13b)static int ov13b10_get_pm_resources (struct ov13b10 *ov13b) {unsigned long freq; -int ret; +int ret, i; ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))
@@ -1481,6 +1486,7 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) "failed to get reset gpio\n"); ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );
@@ -1491,15 +1497,14 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd); - ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev,ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies); +if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 1 line
2.43.0
PATCH v2 1/2 platform/x86: int3472: Add board data for Intel nvl
In reply to Arun TThe Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
PATCH v2 2/2 media: i2c: ov13b10: Support tps68470 regulator and gpio
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in power_on
--- drivers/media/i2c/ov13b10.c | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-)
drivers/media/i2c/ov13b10.c +26 -21
@@ -11,6 +11,7 @@#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fwnode.h> +#include <linux/regulator/consumer.h> #define OV13B10_REG_VALUE_08BIT 1#define OV13B10_REG_VALUE_16BIT 2
@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +}; + +struct ov13b10 {struct device *dev;
@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */
@@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);
@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
@@ -1473,7 +1478,7 @@ static void ov13b10_free_controls(struct ov13b10 *ov13b)static int ov13b10_get_pm_resources (struct ov13b10 *ov13b) {unsigned long freq; -int ret; +int ret, i; ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))
@@ -1481,6 +1486,7 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) "failed to get reset gpio\n"); ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );
@@ -1491,15 +1497,14 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd); - ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev,ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies); +if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 1 line
2.43.0
Hi Arun,
Quoting Arun T (2026-02-26 01:12:28)
Quoted 6 lines
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
Signed-off-by Arun T <[email protected]>
I can see that you are sending multiple patch sets to the same thread without increasing the version number.
This makes it unclear for the maintainers which version is current or what is expected.
Please resend as a clean thread with an increased version number and a changelog for each patch or a cover letter to explain the updates.
--
Kieran
Quoted 203 lines
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +150
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };Signature · 1 line
2.43.0
v2 cover Add TPS68470 power supply support for ov13b10 sensor
In reply to Arun TThis patch series adds power supply management support for the OV13B10 camera sensor when used with TPS68470 PMIC, commonly used on Intel-based camera platforms.
The OV13B10 sensor requires three power supplies (DOVDD, AVDD, DVDD) which are provided by the TPS68470 PMIC. This series implements proper regulator framework integration to manage these power supplies during sensor power on/off sequences.
Changes in v2:
- Added power supply names array for the three required regulators
- Implement regulator handling with devm_regulator_bulk_get()
- Add regulator_bulk_enable() and regulator_bulk_disable() for sensor power on/off sequence
Arun T (2):
platform/x86: int3472: Add board data for Intel nvl
media: i2c: ov13b10: Support tps68470 regulator and gpio
drivers/media/i2c/ov13b10.c | 47 +++--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 2 files changed, 176 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0
PATCH v2 1/2 platform/x86: int3472: Add board data for Intel nvl
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
Hi Arun,
Thanks for the update. Please avoid using --in-reply-to argument for git send-email when sending a new version of the patchset on the next time.
Could you cc me to my @linux.intel.com address on the next time?
Also cc other maintainers, see what
$ scripts/get_maintainer.pl drivers/platform/x86/intel/int3472/
prints.
Quoted 4 lines · Arun T
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
This can be rewrapped and fits to three lines; also see Documentation/process/submitting-patches.rst . Most editors can do that without too much manual work.
Quoted 31 lines
Signed-off-by Arun T <[email protected]>--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +17
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ),
drivers/platform/x86/intel/int3472/tps68470_board_data.c static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { · line 172
Quoted 10 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +10
-0+ REGULATOR_SUPPLY("vddd", "i2c-OVTI13B1:00"), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +};
That's a lot of regulators. The sensor driver appears to use only three, even after the second patch.
Is there a VCM there, for instance?
Quoted 5 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +1
-0+static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
drivers/platform/x86/intel/int3472/tps68470_board_data.c static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = · line 256
Quoted 9 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +6
-0@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true,
Setting always_on to true shouldn't be necessary here.
Quoted 147 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +116
-0+ }, + .num_consumer_supplies = ARRAY_SIZE(int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 3 lines
Kind regards, Sakari Ailus
Hi,
Quoted 59 lines · Sakari Ailus
Hi Arun,
Thanks for the update. Please avoid using --in-reply-to argument for git send-email when sending a new version of the patchset on the next time.
Could you cc me to my @linux.intel.com address on the next time?
Also cc other maintainers, see what
$ scripts/get_maintainer.pl drivers/platform/x86/intel/int3472/prints.
Quoted 4 lines · Arun T
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
This can be rewrapped and fits to three lines; also see
Documentation/process/submitting-patches.rst. Most editors can do that without too much manual work.Quoted 36 lines
Signed-off-by Arun T <[email protected]>--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +22
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ),
Quoted 8 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { · line 172
Quoted 5 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +5
-0+}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +};That's a lot of regulators. The sensor driver appears to use only three, even after the second patch.
Also the names still do not match up with the sensor driver, the sensor driver (after patch 2/2) has:
"dovdd", /* Digital I/O power */ "avdd", /* Analog power */ "dvdd", /* Digital core power */
Where as above there is no "avdd" only "vdda" and "ana" which are both candidates to actually be "avdd" I guess you want to change the "ana" one but please double check.
Note all other regulator_consumer_supply maps except for the 3 actually used by the sensor-driver are *wrong* and should be dropped.
Even if there is a VCM, then the second part of the mapping to "i2c-OVTI13B1:00" is wrong. The "i2c-OVTI13B1:00" consumer will only consume "dovdd", "avdd" and "dvdd" supplies so for that consumer there should only be those 3 maps.
Regards,
Hans
Quoted 168 lines
Is there a VCM there, for instance?
Quoted 5 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +1
-0+static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,drivers/platform/x86/intel/int3472/tps68470_board_data.c static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = · line 256
Quoted 9 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +6
-0@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true,Setting
always_onto true shouldn't be necessary here.Quoted 147 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +116
-0+ }, + .num_consumer_supplies = ARRAY_SIZE(int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Hi Hans,
We are using CRD G3 card + ov13b10 (UF and WF), which is supported by Discrete and TPS68470 power solutions. WF camera is powered by Discrete and UF camera is powered by TPS68470 PMIC.
Discrete solution provides regulator name as "avdd".
TPS68470 provides multiple regulators like "ana". Vdd, dovdd, etc.
As per your comment We have tried below experiments and shared output below:
Experiment 1:
-Add avdd name as a regulator name.
static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = {
REGULATOR_SUPPLY("avdd", "i2c-OVTI13B1:00"),
};+++ b/drivers/media/i2c/ov13b10.c
@@ -704,7 +704,6 @@ static const char * const ov13b10_supply_names[] = {
"dovdd", /* Digital I/O power */
"avdd", /* Analog power */
"dvdd", /* Digital core power */};
Error logs:
[ 0.732156] tps68470-regulator tps68470-regulator: Failed to set supply avdd [ 0.739297] tps68470-regulator tps68470-regulator: error -EBUSY: registering ANA regulator [ 0.747663] tps68470-regulator tps68470-regulator: probe with driver tps68470-regulator failed with error -16 [ 3.621085] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 1-0010 nlanes is 2 port is 1
Result:
Only WF camera sensor is working, which gets the avdd regulator from the discrete solution. UF camera gets failed to bind due conflict regulator names.
Experiment 2:
Add ana as a regulator name:
static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = {
REGULATOR_SUPPLY("ana", "i2c-OVTI13B1:00"),
};+++ b/drivers/media/i2c/ov13b10.c
@@ -703,8 +703,7 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = {
static const char * const ov13b10_supply_names[] = {
"dovdd", /* Digital I/O power */
"avdd", /* Analog power */
"ana", /* Digital core power */
};
Result:
[ 3.060209] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 0-0010 nlanes is 2 port is 2 [ 3.060421] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 1-0010 nlanes is 2 port is 1
both sensor regulators are enumerated properly.
VCM also working fine for UF and WF sensors.
I think we can go with the supply names below, please confirm, shall we go with this change.
static const char * const ov13b10_supply_names[] = {
"dovdd", /* Digital I/O power */
"avdd", /* Analog power */
"ana", /* Digital core power */
};
Regards,
Arun T
-----Original Message-----
From: [email protected] <[email protected]>
Sent: 04 March 2026 02:59 PM
To: Sakari Ailus <[email protected]>; T, Arun <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 1/2] platform/x86: int3472: Add board data for Intel nvl
Hi,
Quoted 53 lines · Sakari Ailus
Hi Arun,
Thanks for the update. Please avoid using --in-reply-to argument for git send-email when sending a new version of the patchset on the next time.
Could you cc me to my @linux.intel.com address on the next time?
Also cc other maintainers, see what
$ scripts/get_maintainer.pl drivers/platform/x86/intel/int3472/prints.
Quoted 4 lines · Arun T
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP.
The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.This can be rewrapped and fits to three lines; also see
Documentation/process/submitting-patches.rst. Most editors can do that without too much manual work.Quoted 30 lines
Signed-off-by Arun T <[email protected]>--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +16
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), }; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), }; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), }; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), }; +
Quoted 8 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = {
Quoted 5 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +5
-0+static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), }; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), };That's a lot of regulators. The sensor driver appears to use only three, even after the second patch.
Also the names still do not match up with the sensor driver, the sensor driver (after patch 2/2) has:
"dovdd", /* Digital I/O power */ "avdd", /* Analog power */ "dvdd", /* Digital core power */
Where as above there is no "avdd" only "vdda" and "ana" which are both candidates to actually be "avdd" I guess you want to change the "ana" one but please double check.
Note all other regulator_consumer_supply maps except for the 3 actually used by the sensor-driver are *wrong* and should be dropped.
Even if there is a VCM, then the second part of the mapping to "i2c-OVTI13B1:00" is wrong. The "i2c-OVTI13B1:00" consumer will only consume "dovdd", "avdd" and "dvdd" supplies so for that consumer there should only be those 3 maps.
Regards,
Hans
Quoted 161 lines
Is there a VCM there, for instance?
drivers/platform/x86/intel/int3472/tps68470_board_data.c static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = · line 255
Quoted 13 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +7
-0+static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true,Setting
always_onto true shouldn't be necessary here.Quoted 141 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +111
-0+ }, + .num_consumer_supplies = ARRAY_SIZE(int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, }; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, };static const +struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, }; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO +*/ static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, }; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, }; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, }; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata, @@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Hi,
Quoted 24 lines · Arun
Hi Hans,
We are using CRD G3 card + ov13b10 (UF and WF), which is supported by Discrete and TPS68470 power solutions. WF camera is powered by Discrete and UF camera is powered by TPS68470 PMIC.
Discrete solution provides regulator name as "avdd".
TPS68470 provides multiple regulators like "ana". Vdd, dovdd, etc.As per your comment We have tried below experiments and shared output below:
Experiment 1:
-Add avdd name as a regulator name.static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { REGULATOR_SUPPLY("avdd", "i2c-OVTI13B1:00"), };+++
b/drivers/media/i2c/ov13b10.c(quoted diff) +0
-0@@ -704,7 +704,6 @@ static const char * const ov13b10_supply_names[] = { "dovdd", /* Digital I/O power */ "avdd", /* Analog power */ "dvdd", /* Digital core power */ };Error logs:
Quoted 8 lines
[ 0.732156] tps68470-regulator tps68470-regulator: Failed to set supply avdd [ 0.739297] tps68470-regulator tps68470-regulator: error -EBUSY: registering ANA regulator [ 0.747663] tps68470-regulator tps68470-regulator: probe with driver tps68470-regulator failed with error -16 [ 3.621085] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 1-0010 nlanes is 2 port is 1Result:
Only WF camera sensor is working, which gets the avdd regulator from the discrete solution. UF camera gets failed to bind due conflict regulator names.
If you have 2 OVTI13B1 cameras then they will have 2 different device names, you can see these by doing:
ls /sys/bus/i2c/devices
They will likely be:
"i2c-OVTI13B1:00"
"i2c-OVTI13B1:01"
and since you're getting an error that the discrete INT3472 device has already registered the "avdd" supply for the "i2c-OVTI13B1:00" sensor, that means that the tps68470 is likely supplying the "i2c-OVTI13B1:01" sensor and not the "i2c-OVTI13B1:00" so you need to have the regulator_consumer_supply maps point to "i2c-OVTI13B1:01" .
If you boot with "intel_skl_int3472_discrete.dyndbg intel_skl_int3472_common.dyndbg" add to your kernel commandline then the int3472 code will add
some debug messages to dmesg which let you know which
sensor is mapped to which INT3472:0x device.
Regards,
Hans
Hi Hans,
Thank you for the suggestion. You were correct - the i2c devices are different for each sensor. I added the proper i2c device name in REGULATOR_SUPPLY(), and now both sensors power up correctly with this change. I've updated the changes in the V4 patch set and submitted it for review
-
Regards,
Arun T
-----Original Message-----
From: [email protected] <[email protected]>
Sent: 06 March 2026 02:53 PM
To: T, Arun <[email protected]>; Sakari Ailus <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 1/2] platform/x86: int3472: Add board data for Intel nvl
Hi,
Quoted 23 lines · Arun
Hi Hans,
We are using CRD G3 card + ov13b10 (UF and WF), which is supported by Discrete and TPS68470 power solutions. WF camera is powered by Discrete and UF camera is powered by TPS68470 PMIC.
Discrete solution provides regulator name as "avdd".
TPS68470 provides multiple regulators like "ana". Vdd, dovdd, etc.As per your comment We have tried below experiments and shared output below:
Experiment 1:
-Add avdd name as a regulator name.static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { REGULATOR_SUPPLY("avdd", "i2c-OVTI13B1:00"), };+++
b/drivers/media/i2c/ov13b10.c(quoted diff) +0
-0@@ -704,7 +704,6 @@ static const char * const ov13b10_supply_names[] = { "dovdd", /* Digital I/O power */ "avdd", /* Analog power */ "dvdd", /* Digital core power */ };Error logs:
Quoted 8 lines
[ 0.732156] tps68470-regulator tps68470-regulator: Failed to set supply avdd [ 0.739297] tps68470-regulator tps68470-regulator: error -EBUSY: registering ANA regulator [ 0.747663] tps68470-regulator tps68470-regulator: probe with driver tps68470-regulator failed with error -16 [ 3.621085] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 1-0010 nlanes is 2 port is 1Result:
Only WF camera sensor is working, which gets the avdd regulator from the discrete solution. UF camera gets failed to bind due conflict regulator names.
If you have 2 OVTI13B1 cameras then they will have 2 different device names, you can see these by doing:
ls /sys/bus/i2c/devices
They will likely be:
"i2c-OVTI13B1:00"
"i2c-OVTI13B1:01"
and since you're getting an error that the discrete INT3472 device has already registered the "avdd" supply for the "i2c-OVTI13B1:00"
sensor, that means that the tps68470 is likely supplying the "i2c-OVTI13B1:01" sensor and not the "i2c-OVTI13B1:00" so you need to have the regulator_consumer_supply maps point to "i2c-OVTI13B1:01" .
If you boot with "intel_skl_int3472_discrete.dyndbg intel_skl_int3472_common.dyndbg"
add to your kernel commandline then the int3472 code will add some debug messages to dmesg which let you know which sensor is mapped to which INT3472:0x device.
Regards,
Hans
Hi All,
There has been no reply to these patches for quite some time. Could you please provide any feedback, comments, or suggestions on these patches -
Regards,
Arun T
-----Original Message-----
From: T, Arun
Sent: 12 March 2026 03:17 PM
To: [email protected]; Sakari Ailus <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v2 1/2] platform/x86: int3472: Add board data for Intel nvl
Hi Hans,
Thank you for the suggestion. You were correct - the i2c devices are different for each sensor. I added the proper i2c device name in REGULATOR_SUPPLY(), and now both sensors power up correctly with this change. I've updated the changes in the V4 patch set and submitted it for review
-
Regards,
Arun T
-----Original Message-----
From: [email protected] <[email protected]>
Sent: 06 March 2026 02:53 PM
To: T, Arun <[email protected]>; Sakari Ailus <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 1/2] platform/x86: int3472: Add board data for Intel nvl
Hi,
Quoted 23 lines · Arun
Hi Hans,
We are using CRD G3 card + ov13b10 (UF and WF), which is supported by Discrete and TPS68470 power solutions. WF camera is powered by Discrete and UF camera is powered by TPS68470 PMIC.
Discrete solution provides regulator name as "avdd".
TPS68470 provides multiple regulators like "ana". Vdd, dovdd, etc.As per your comment We have tried below experiments and shared output below:
Experiment 1:
-Add avdd name as a regulator name.static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { REGULATOR_SUPPLY("avdd", "i2c-OVTI13B1:00"), };+++
b/drivers/media/i2c/ov13b10.c(quoted diff) +0
-0@@ -704,7 +704,6 @@ static const char * const ov13b10_supply_names[] = { "dovdd", /* Digital I/O power */ "avdd", /* Analog power */ "dvdd", /* Digital core power */ };Error logs:
Quoted 8 lines
[ 0.732156] tps68470-regulator tps68470-regulator: Failed to set supply avdd [ 0.739297] tps68470-regulator tps68470-regulator: error -EBUSY: registering ANA regulator [ 0.747663] tps68470-regulator tps68470-regulator: probe with driver tps68470-regulator failed with error -16 [ 3.621085] intel_ipu7_isys.isys intel_ipu7.isys.40: bind ov13b10 1-0010 nlanes is 2 port is 1Result:
Only WF camera sensor is working, which gets the avdd regulator from the discrete solution. UF camera gets failed to bind due conflict regulator names.
If you have 2 OVTI13B1 cameras then they will have 2 different device names, you can see these by doing:
ls /sys/bus/i2c/devices
They will likely be:
"i2c-OVTI13B1:00"
"i2c-OVTI13B1:01"
and since you're getting an error that the discrete INT3472 device has already registered the "avdd" supply for the "i2c-OVTI13B1:00"
sensor, that means that the tps68470 is likely supplying the "i2c-OVTI13B1:01" sensor and not the "i2c-OVTI13B1:00" so you need to have the regulator_consumer_supply maps point to "i2c-OVTI13B1:01" .
If you boot with "intel_skl_int3472_discrete.dyndbg intel_skl_int3472_common.dyndbg"
add to your kernel commandline then the int3472 code will add some debug messages to dmesg which let you know which sensor is mapped to which INT3472:0x device.
Regards,
Hans
PATCH v2 2/2 media: i2c: ov13b10: Support tps68470 regulator and gpio
In reply to Arun TOv13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in power_on
--- drivers/media/i2c/ov13b10.c | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-)
drivers/media/i2c/ov13b10.c +26 -21
@@ -11,6 +11,7 @@#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fwnode.h> +#include <linux/regulator/consumer.h> #define OV13B10_REG_VALUE_08BIT 1#define OV13B10_REG_VALUE_16BIT 2
@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +}; + +struct ov13b10 {struct device *dev;
@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */
@@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);
@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
@@ -1473,7 +1478,7 @@ static void ov13b10_free_controls(struct ov13b10 *ov13b)static int ov13b10_get_pm_resources (struct ov13b10 *ov13b) {unsigned long freq; -int ret; +int ret, i; ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))
@@ -1481,6 +1486,7 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) "failed to get reset gpio\n"); ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );
@@ -1491,15 +1497,14 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd); - ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev,ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies); +if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 1 line
2.43.0
Re: [PATCH v2 2/2] media: i2c: ov13b10: Support tps68470 regulator and gpio
Hi Arun,
Quoted 2 lines · Arun T
Ov13b10 sensor get clock and regulator from TPS68470 PMIC. Added tps68470 regulator/gpio names in
power_on
Sentences end in a period. Also rewrap this one.
Quoted 11 lines
Signed-off-by Arun T <[email protected]>--- drivers/media/i2c/ov13b10.c | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-)drivers/media/i2c/ov13b10.c +0
-0
drivers/media/i2c/ov13b10.c line 14
Quoted 4 lines
drivers/media/i2c/ov13b10.c +1
-0@@ -11,6 +11,7 @@#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fwnode.h> +#include <linux/regulator/consumer.h>
Please arrange alphabetically.
drivers/media/i2c/ov13b10.c static const struct ov13b10_mode supported_2_lanes_modes[] = { · line 708
Quoted 13 lines
drivers/media/i2c/ov13b10.c +6
-0#define OV13B10_REG_VALUE_08BIT 1#define OV13B10_REG_VALUE_16BIT 2@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +}; +
Extra newline.
Quoted 47 lines
drivers/media/i2c/ov13b10.c +10
-12+struct ov13b10 {struct device *dev;@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */ @@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
drivers/media/i2c/ov13b10.c static void ov13b10_free_controls(struct ov13b10 *ov13b) · line 1481
Quoted 5 lines
drivers/media/i2c/ov13b10.c +1
-1@@ -1473,7 +1478,7 @@ static void ov13b10_free_controls(struct ov13b10 *ov13b)static int ov13b10_get_pm_resources (struct ov13b10 *ov13b) {unsigned long freq; -int ret; +int ret, i;
unsigned int, please, and you can declare this just for the loop.
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1489
Quoted 8 lines
drivers/media/i2c/ov13b10.c +1
-0ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))@@ -1481,6 +1486,7 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) "failed to get reset gpio\n"); ov13b->img_clk =devm_v4l2_sensor_clk_get (ov13b->dev,NULL ); +
Unrelated change (and no, I wouldn't do it).
Quoted 10 lines
drivers/media/i2c/ov13b10.c +0
-3if (IS_ERR (ov13b->img_clk))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->img_clk),"failed to get imaging clock\n" );@@ -1491,15 +1497,14 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd);
drivers/media/i2c/ov13b10.c static int ov13b10_get_pm_resources(struct ov13b10 *ov13b) · line 1504
Quoted 10 lines
drivers/media/i2c/ov13b10.c +4
-5- ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev,ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies);
Indentation.
While at it, could you run
$ ./scripts/checkpatch.pl --strict --max-line-length=80
on this?
Quoted 6 lines
drivers/media/i2c/ov13b10.c +3
-0+if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 3 lines
Regards, Sakari Ailus
v3 cover Add TPS68470 power supply support for ov13b10 sensor
In reply to Arun TThis patch series adds power supply management support for the OV13B10 camera sensor when used with TPS68470 PMIC, commonly used on Intel-based camera platforms.
The OV13B10 sensor requires three power supplies (DOVDD, AVDD, DVDD) which are provided by the TPS68470 PMIC. This series implements proper regulator framework integration to manage these power supplies during sensor power on/off sequences.
Changes in v3:
- Fixed check patch errors as updated by sakari
- Enabled VCM regulator for ov13b10 sensor to enable autofocus to work
Suggested by Sakari:
- Add include header file in alphabetical order
- Remove extra space
- Asked to check vcm instance
Changes in v2:
- Added power supply names array for the three required regulators
- Implement regulator handling with devm_regulator_bulk_get()
- Add regulator_bulk_enable() and regulator_bulk_disable() for sensor power on/off sequence
Suggested by Hans:
- Add multiple regulators you should use the bulk regulator API
- Use use "reset" instead of "s_resetn" for parse gpio name.
- Add diffent regulator power supplies in single array
Arun T (2):
platform/x86: int3472: Add TPS68470 board data for Intel nvl
media: i2c: ov13b10: support tps68470 regulator and gpio
drivers/media/i2c/ov13b10.c | 48 +++--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 2 files changed, 177 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0
PATCH v3 1/2 platform/x86: int3472: Add TPS68470 board data for Intel nvl
The Intel NVL platform uses IPU8 is powered by a TPS68470 PMIC,requiring board data to configure the GPIOs and regulators for proper camera sensor operation.
--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/platform/x86/intel/int3472/tps68470_board_data.c +150 -0
@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,
@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,
@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {
@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,
@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {
@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
Signature · 1 line
2.43.0
Re: [PATCH v3 1/2] platform/x86: int3472: Add TPS68470 board data for Intel nvl
Hi,
Quoted 34 lines · Arun T
The Intel NVL platform uses IPU8 is powered by a TPS68470 PMIC,requiring board data to configure the GPIOs and regulators for proper camera sensor operation.
Signed-off-by Arun T <[email protected]>--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +18
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int3472_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ),
drivers/platform/x86/intel/int3472/tps68470_board_data.c static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { · line 173
Quoted 10 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +10
-0+}; + +static struct regulator_consumer_supply int3472_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int3472_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +
I only noticed this v3 after replying to v2. As per my comment on v2:
https://lore.kernel.org/linux-media/[email protected]/
this is still wrong.
Regards,
Hans
Quoted 160 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +122
-0static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { .constraints = { .min_uV =1200000 ,@@ -220,6 +248,82 @@ static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = .consumer_supplies = int3479_aux2_consumer_supplies, }; +static const struct regulator_init_data intel_nvl_tps68470_core_reg_init_data = { + .constraints = { + .min_uV =1200000 , + .max_uV =1200000 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_core_consumer_supplies), + .consumer_supplies = int3472_core_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_ana_consumer_supplies), + .consumer_supplies = int3472_ana_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vcm_consumer_supplies), + .consumer_supplies = int3472_vcm_consumer_supplies, +}; + +/* Ensure the always-on VIO regulator has the same voltage as VSIO */ +static const struct regulator_init_data intel_nvl_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, +}; + +static const struct regulator_init_data intel_nvl_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV = true, + .always_on = true, + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_vsio_consumer_supplies), + .consumer_supplies = int3472_vsio_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV =2815200 , + .max_uV =2815200 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux1_consumer_supplies), + .consumer_supplies = int3472_aux1_consumer_supplies, +}; + +static const struct regulator_init_data intel_nvl_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV =1800600 , + .max_uV =1800600 , + .apply_uV =1 , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =ARRAY_SIZE (int3472_aux2_consumer_supplies), + .consumer_supplies = int3472_aux2_consumer_supplies, +}; +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE ] = &dell_7212_tps68470_core_reg_init_data,@@ -232,6 +336,18 @@ static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = }, }; +static const struct tps68470_regulator_platform_data intel_nvl_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE ] = &intel_nvl_tps68470_core_reg_init_data, + [TPS68470_ANA ] = &intel_nvl_tps68470_ana_reg_init_data, + [TPS68470_VCM ] = &intel_nvl_tps68470_vcm_reg_init_data, + [TPS68470_VIO ] = &intel_nvl_tps68470_vio_reg_init_data, + [TPS68470_VSIO ] = &intel_nvl_tps68470_vsio_reg_init_data, + [TPS68470_AUX1 ] = &intel_nvl_tps68470_aux1_reg_init_data, + [TPS68470_AUX2 ] = &intel_nvl_tps68470_aux2_reg_init_data, + }, +}; +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id ="i2c-INT347A:00" , .table = {@@ -258,6 +374,23 @@ static struct gpiod_lookup_table dell_7212_int3479_gpios = { } }; +static struct gpiod_lookup_table intel_nvl_int347a_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,9 ,"reset" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("tps68470-gpio" ,8 ,"s_idle" ,GPIO_ACTIVE_LOW ), + { } + } +}; + +static struct gpiod_lookup_table intel_nvl_int347e_gpios = { + .dev_id ="i2c-OVTI13B1:01" , + .table = { +GPIO_LOOKUP ("tps68470-gpio" ,7 ,"s_enable" ,GPIO_ACTIVE_LOW ), + { } + } +}; +static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name ="i2c-INT3472:05" , .tps68470_regulator_pdata = &surface_go_tps68470_pdata,@@ -287,6 +420,16 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +static const struct int3472_tps68470_board_data intel_nvl_tps68470_board_data = { + .dev_name ="i2c-INT3472:04" , + .tps68470_regulator_pdata = &intel_nvl_tps68470_pdata, + .n_gpiod_lookups =2 , + .tps68470_gpio_lookup_tables = { + &intel_nvl_int347a_gpios, + &intel_nvl_int347e_gpios, + }, +}; +static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = {@@ -316,6 +459,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Nova Lake Client Platform"), + }, + .driver_data = (void *)&intel_nvl_tps68470_board_data, + }, { } };
PATCH v3 2/2 media: i2c: ov13b10: support tps68470 regulator and gpio
In reply to Arun TThe OV13B10 sensor obtains clock and regulators from the TPS68470 PMIC. Add TPS68470 regulator and GPIO names to the sensor power on
--- drivers/media/i2c/ov13b10.c | 48 +++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 21 deletions(-)
drivers/media/i2c/ov13b10.c +27 -21
@@ -3,6 +3,7 @@#include <linux/acpi.h> #include <linux/clk.h> +#include <linux/regulator/consumer.h> #include <linux/delay.h> #include <linux/gpio/consumer.h> #include <linux/i2c.h>
@@ -699,6 +700,13 @@ static const struct ov13b10_mode supported_2_lanes_modes[] = { }, }; +static const char *const ov13b10_supply_names[] = { +"dovdd" ,/* Digital I/O power */ +"avdd" ,/* Analog power */ +"dvdd" ,/* Digital core power */ +"vdd" ,/* Vcm power */ +}; +struct ov13b10 {struct device *dev;
@@ -708,7 +716,7 @@ struct ov13b10 {struct v4l2_ctrl_handler ctrl_handler;struct clk *img_clk; -struct regulator *avdd; +struct regulator_bulk_data supplies[ARRAY_SIZE (ov13b10_supply_names)];struct gpio_desc *reset;/* V4L2 Controls */
@@ -1194,9 +1202,8 @@ static int ov13b10_power_off(struct device *dev)struct ov13b10 *ov13b10 =to_ov13b10 (sd);gpiod_set_value_cansleep (ov13b10->reset,1 ); - -if (ov13b10->avdd) -regulator_disable (ov13b10->avdd); +regulator_bulk_disable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies);clk_disable_unprepare (ov13b10->img_clk);
@@ -1214,14 +1221,12 @@ static int ov13b10_power_on(struct device *dev)dev_err (dev,"failed to enable imaging clock: %d" , ret);return ret; } - -if (ov13b10->avdd) { - ret =regulator_enable (ov13b10->avdd); -if (ret <0 ) { -dev_err (dev,"failed to enable avdd: %d" , ret); -clk_disable_unprepare (ov13b10->img_clk); -return ret; - } + ret =regulator_bulk_enable (ARRAY_SIZE (ov13b10_supply_names), + ov13b10->supplies); +if (ret <0 ) { +dev_err (dev,"failed to enable regulators\n" ); +clk_disable_unprepare (ov13b10->img_clk); +return ret; }gpiod_set_value_cansleep (ov13b10->reset,0 );
@@ -1475,7 +1480,8 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)unsigned long freq;int ret; - ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" ,GPIOD_OUT_LOW ); + ov13b->reset =devm_gpiod_get_optional (ov13b->dev,"reset" , +GPIOD_OUT_LOW );if (IS_ERR (ov13b->reset))return dev_err_probe (ov13b->dev,PTR_ERR (ov13b->reset),"failed to get reset gpio\n" );
@@ -1491,15 +1497,15 @@ static int ov13b10_get_pm_resources(struct ov13b10 *ov13b)"external clock %lu is not supported\n" , freq); - ov13b->avdd =devm_regulator_get_optional (ov13b->dev,"avdd" ); -if (IS_ERR (ov13b->avdd)) { - ret =PTR_ERR (ov13b->avdd); - ov13b->avdd =NULL ; -if (ret != -ENODEV ) -return dev_err_probe (ov13b->dev, ret, -"failed to get avdd regulator\n" ); - } +for (unsigned int i =0 ; i <ARRAY_SIZE (ov13b10_supply_names); i++) + ov13b->supplies[i].supply = ov13b10_supply_names[i]; + ret =devm_regulator_bulk_get (ov13b->dev, +ARRAY_SIZE (ov13b10_supply_names), + ov13b->supplies); +if (ret) +return dev_err_probe (ov13b->dev, ret, +"failed to get regulators\n" );return 0 ; }
Signature · 1 line
2.43.0
Hi Arun,
Thank you for your patch.
Quoted 36 lines · Arun T
The Intel Nvl O13b10 sensor with the Intel IPU8 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor.
Signed-off-by Arun T <[email protected]>--- .../x86/intel/int3472/tps68470_board_data.c | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+)drivers/platform/x86/intel/int3472/tps68470_board_data.c +18
-0@@ -143,6 +143,34 @@ static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), }; +/* Settings for Intel NVL platform */ + +static struct regulator_consumer_supply int347_ov13b_core_consumer_supplies[] = { +REGULATOR_SUPPLY ("dvdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_ana_consumer_supplies[] = { +REGULATOR_SUPPLY ("ana" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vcm_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdd" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_vsio_consumer_supplies[] = { +REGULATOR_SUPPLY ("dovdd" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vsio" ,"i2c-OVTI13B1:00" ), +REGULATOR_SUPPLY ("vddd" ,"i2c-OVTI13B1:00" ),
drivers/platform/x86/intel/int3472/tps68470_board_data.c static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { · line 173
Quoted 10 lines
drivers/platform/x86/intel/int3472/tps68470_board_data.c +10
-0+}; + +static struct regulator_consumer_supply int347_ov13b_aux1_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdda" ,"i2c-OVTI13B1:00" ), +}; + +static struct regulator_consumer_supply int347_ov13b_aux2_consumer_supplies[] = { +REGULATOR_SUPPLY ("vdddo" ,"i2c-OVTI13B1:00" ), +}; +
You're defining many regulator supplies here, but in your ov13b10 patch you only consume:
"avdd", /* Analog power */
"dovdd", /* Digital I/O power */
"dvdd", /* Digital core power */So you should only define those as supplies here.
Regards,
Hans