mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
PM / AVS: rockchip-io: add io selectors and supplies for rk3308
This adds the necessary data for handling io voltage domains on the rk3308. As interesting tidbit, the rk3308 contains one iodomain area at grf, Change-Id: Ife72a284a8926d02ef5df7a422d41924494d0300 Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
@@ -36,6 +36,7 @@ Required properties:
|
||||
- "rockchip,rk3188-io-voltage-domain" for rk3188
|
||||
- "rockchip,rk3228-io-voltage-domain" for rk3228
|
||||
- "rockchip,rk3288-io-voltage-domain" for rk3288
|
||||
- "rockchip,rk3308-io-voltage-domain" for rk3308
|
||||
- "rockchip,rk3328-io-voltage-domain" for rk3328
|
||||
- "rockchip,rk3368-io-voltage-domain" for rk3368
|
||||
- "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
#define RK3288_SOC_CON2_FLASH0 BIT(7)
|
||||
#define RK3288_SOC_FLASH_SUPPLY_NUM 2
|
||||
|
||||
#define RK3308_SOC_CON0 0x300
|
||||
#define RK3308_SOC_CON0_VCCIO3 BIT(8)
|
||||
#define RK3308_SOC_VCCIO3_SUPPLY_NUM 3
|
||||
|
||||
#define RK3328_SOC_CON4 0x410
|
||||
#define RK3328_SOC_CON4_VCCIO2 BIT(7)
|
||||
#define RK3328_SOC_VCCIO2_SUPPLY_NUM 1
|
||||
@@ -193,6 +197,25 @@ static void rk3288_iodomain_init(struct rockchip_iodomain *iod)
|
||||
dev_warn(iod->dev, "couldn't update flash0 ctrl\n");
|
||||
}
|
||||
|
||||
static void rk3308_iodomain_init(struct rockchip_iodomain *iod)
|
||||
{
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
/* if no vccio3 supply we should leave things alone */
|
||||
if (!iod->supplies[RK3308_SOC_VCCIO3_SUPPLY_NUM].reg)
|
||||
return;
|
||||
|
||||
/*
|
||||
* set vccio3 iodomain to also use this framework
|
||||
* instead of a special gpio.
|
||||
*/
|
||||
val = RK3308_SOC_CON0_VCCIO3 | (RK3308_SOC_CON0_VCCIO3 << 16);
|
||||
ret = regmap_write(iod->grf, RK3308_SOC_CON0, val);
|
||||
if (ret < 0)
|
||||
dev_warn(iod->dev, "couldn't update vccio3 vsel ctrl\n");
|
||||
}
|
||||
|
||||
static void rk3328_iodomain_init(struct rockchip_iodomain *iod)
|
||||
{
|
||||
int ret;
|
||||
@@ -340,6 +363,19 @@ static const struct rockchip_iodomain_soc_data soc_data_rk3288 = {
|
||||
.init = rk3288_iodomain_init,
|
||||
};
|
||||
|
||||
static const struct rockchip_iodomain_soc_data soc_data_rk3308 = {
|
||||
.grf_offset = 0x300,
|
||||
.supply_names = {
|
||||
"vccio0",
|
||||
"vccio1",
|
||||
"vccio2",
|
||||
"vccio3",
|
||||
"vccio4",
|
||||
"vccio5",
|
||||
},
|
||||
.init = rk3308_iodomain_init,
|
||||
};
|
||||
|
||||
static const struct rockchip_iodomain_soc_data soc_data_rk3328 = {
|
||||
.grf_offset = 0x410,
|
||||
.supply_names = {
|
||||
@@ -460,6 +496,10 @@ static const struct of_device_id rockchip_iodomain_match[] = {
|
||||
.compatible = "rockchip,rk3288-io-voltage-domain",
|
||||
.data = &soc_data_rk3288
|
||||
},
|
||||
{
|
||||
.compatible = "rockchip,rk3308-io-voltage-domain",
|
||||
.data = &soc_data_rk3308
|
||||
},
|
||||
{
|
||||
.compatible = "rockchip,rk3328-io-voltage-domain",
|
||||
.data = &soc_data_rk3328
|
||||
|
||||
Reference in New Issue
Block a user