|
39 | 39 | #define RK3288_SOC_CON2_FLASH0 BIT(7) |
40 | 40 | #define RK3288_SOC_FLASH_SUPPLY_NUM 2 |
41 | 41 |
|
| 42 | +#define RK3308_SOC_CON0 0x300 |
| 43 | +#define RK3308_SOC_CON0_VCCIO3 BIT(8) |
| 44 | +#define RK3308_SOC_VCCIO3_SUPPLY_NUM 3 |
| 45 | + |
42 | 46 | #define RK3328_SOC_CON4 0x410 |
43 | 47 | #define RK3328_SOC_CON4_VCCIO2 BIT(7) |
44 | 48 | #define RK3328_SOC_VCCIO2_SUPPLY_NUM 1 |
@@ -229,6 +233,25 @@ static void rk3288_iodomain_init(struct rockchip_iodomain *iod) |
229 | 233 | dev_warn(iod->dev, "couldn't update flash0 ctrl\n"); |
230 | 234 | } |
231 | 235 |
|
| 236 | +static void rk3308_iodomain_init(struct rockchip_iodomain *iod) |
| 237 | +{ |
| 238 | + int ret; |
| 239 | + u32 val; |
| 240 | + |
| 241 | + /* if no vccio3 supply we should leave things alone */ |
| 242 | + if (!iod->supplies[RK3308_SOC_VCCIO3_SUPPLY_NUM].reg) |
| 243 | + return; |
| 244 | + |
| 245 | + /* |
| 246 | + * set vccio3 iodomain to also use this framework |
| 247 | + * instead of a special gpio. |
| 248 | + */ |
| 249 | + val = RK3308_SOC_CON0_VCCIO3 | (RK3308_SOC_CON0_VCCIO3 << 16); |
| 250 | + ret = regmap_write(iod->grf, RK3308_SOC_CON0, val); |
| 251 | + if (ret < 0) |
| 252 | + dev_warn(iod->dev, "couldn't update vccio3 vsel ctrl\n"); |
| 253 | +} |
| 254 | + |
232 | 255 | static void rk3328_iodomain_init(struct rockchip_iodomain *iod) |
233 | 256 | { |
234 | 257 | int ret; |
@@ -376,6 +399,19 @@ static const struct rockchip_iodomain_soc_data soc_data_rk3288 = { |
376 | 399 | .init = rk3288_iodomain_init, |
377 | 400 | }; |
378 | 401 |
|
| 402 | +static const struct rockchip_iodomain_soc_data soc_data_rk3308 = { |
| 403 | + .grf_offset = 0x300, |
| 404 | + .supply_names = { |
| 405 | + "vccio0", |
| 406 | + "vccio1", |
| 407 | + "vccio2", |
| 408 | + "vccio3", |
| 409 | + "vccio4", |
| 410 | + "vccio5", |
| 411 | + }, |
| 412 | + .init = rk3308_iodomain_init, |
| 413 | +}; |
| 414 | + |
379 | 415 | static const struct rockchip_iodomain_soc_data soc_data_rk3328 = { |
380 | 416 | .grf_offset = 0x410, |
381 | 417 | .supply_names = { |
@@ -528,6 +564,10 @@ static const struct of_device_id rockchip_iodomain_match[] = { |
528 | 564 | .compatible = "rockchip,rk3288-io-voltage-domain", |
529 | 565 | .data = &soc_data_rk3288 |
530 | 566 | }, |
| 567 | + { |
| 568 | + .compatible = "rockchip,rk3308-io-voltage-domain", |
| 569 | + .data = &soc_data_rk3308 |
| 570 | + }, |
531 | 571 | { |
532 | 572 | .compatible = "rockchip,rk3328-io-voltage-domain", |
533 | 573 | .data = &soc_data_rk3328 |
|
0 commit comments