From 0a51d4a592e3501fa10186775eacc4d1bc99bfbe Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 8 Feb 2023 18:31:08 +0800 Subject: [PATCH] soc: rockchip: io-domain: Sync with upstream Change-Id: I3aa990729e988f08f384a10606cc2cf26d091b8a Signed-off-by: Tao Huang --- drivers/soc/rockchip/io-domain.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-domain.c index ae8ed0f3cfd0..f5ec81667ef3 100644 --- a/drivers/soc/rockchip/io-domain.c +++ b/drivers/soc/rockchip/io-domain.c @@ -68,15 +68,6 @@ struct rockchip_iodomain; -/** - * @supplies: voltage settings matching the register bits. - */ -struct rockchip_iodomain_soc_data { - int grf_offset; - const char *supply_names[MAX_SUPPLIES]; - void (*init)(struct rockchip_iodomain *iod); -}; - struct rockchip_iodomain_supply { struct rockchip_iodomain *iod; struct regulator *reg; @@ -84,6 +75,13 @@ struct rockchip_iodomain_supply { int idx; }; +struct rockchip_iodomain_soc_data { + int grf_offset; + const char *supply_names[MAX_SUPPLIES]; + void (*init)(struct rockchip_iodomain *iod); + int (*write)(struct rockchip_iodomain_supply *supply, int uV); +}; + struct rockchip_iodomain { struct device *dev; struct regmap *grf; @@ -92,8 +90,7 @@ struct rockchip_iodomain { int (*write)(struct rockchip_iodomain_supply *supply, int uV); }; -static int rk3568_pmu_iodomain_write(struct rockchip_iodomain_supply *supply, - int uV) +static int rk3568_iodomain_write(struct rockchip_iodomain_supply *supply, int uV) { struct rockchip_iodomain *iod = supply->iod; u32 is_3v3 = uV > MAX_VOLTAGE_1_8; @@ -504,6 +501,7 @@ static const struct rockchip_iodomain_soc_data soc_data_rk3568_pmu = { "vccio6", "vccio7", }, + .write = rk3568_iodomain_write, }; static const struct rockchip_iodomain_soc_data soc_data_rv1108 = { @@ -788,8 +786,8 @@ static int rockchip_iodomain_probe(struct platform_device *pdev) match = of_match_node(rockchip_iodomain_match, np); iod->soc_data = match->data; - if (IS_ENABLED(CONFIG_CPU_RK3568) && match->data == &soc_data_rk3568_pmu) - iod->write = rk3568_pmu_iodomain_write; + if (iod->soc_data->write) + iod->write = iod->soc_data->write; else iod->write = rockchip_iodomain_write;