summaryrefslogtreecommitdiff
path: root/bsp/rockchip/dm/soc/io-domain.c
blob: 061ef32e606d26b6725f1bd381836606c3eddabc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-11-21     GuEe-GUI     first version
 */

#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>

#define DBG_TAG "soc.rockchip.io-domain"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>

#define MAX_SUPPLIES    16

/*
 * The max voltage for 1.8V and 3.3V come from the Rockchip datasheet under
 * "Recommended Operating Conditions" for "Digital GPIO".   When the typical
 * is 3.3V the max is 3.6V.  When the typical is 1.8V the max is 1.98V.
 *
 * They are used like this:
 * - If the voltage on a rail is above the "1.8" voltage (1.98V) we'll tell the
 *   SoC we're at 3.3.
 * - If the voltage on a rail is above the "3.3" voltage (3.6V) we'll consider
 *   that to be an error.
 */
#define MAX_VOLTAGE_1_8 1980000
#define MAX_VOLTAGE_3_3 3600000

struct rockchip_iodomain;

struct rockchip_iodomain_supply
{
    struct rockchip_iodomain *domain;
    struct rt_regulator *reg;
    struct rt_regulator_notifier notifier;
    int idx;
};

struct rockchip_iodomain_soc_data
{
    int grf_offset;
    const char *supply_names[MAX_SUPPLIES];
    void (*init)(struct rockchip_iodomain *domain);
    rt_err_t (*write)(struct rockchip_iodomain_supply *supply, int uvolt);
};

struct rockchip_iodomain
{
    struct rt_device *dev;
    struct rt_syscon *grf;
    const struct rockchip_iodomain_soc_data *soc_data;
    struct rockchip_iodomain_supply supplies[MAX_SUPPLIES];

    rt_err_t (*write)(struct rockchip_iodomain_supply *supply, int uvolt);
};

#define PX30_IO_VSEL                    0x180
#define PX30_IO_VSEL_VCCIO6_SRC         RT_BIT(0)
#define PX30_IO_VSEL_VCCIO6_SUPPLY_NUM  1

static void px30_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no VCCIO6 supply we should leave things alone */
    if (!domain->supplies[PX30_IO_VSEL_VCCIO6_SUPPLY_NUM].reg)
    {
        return;
    }

    /* set vccio6 iodomain to also use this framework instead of a special gpio. */
    val = PX30_IO_VSEL_VCCIO6_SRC | (PX30_IO_VSEL_VCCIO6_SRC << 16);

    if (rt_syscon_write(domain->grf, PX30_IO_VSEL, val) < 0)
    {
        LOG_W("Couldn't update %s ctrl", "vccio6");
    }
}

static const struct rockchip_iodomain_soc_data soc_data_px30 =
{
    .grf_offset = 0x180,
    .supply_names =
    {
        [1] =
        "vccio6",
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio4",
        "vccio5",
        "vccio-oscgpi",
    },
    .init = px30_iodomain_init,
};

static const struct rockchip_iodomain_soc_data soc_data_px30_pmu =
{
    .grf_offset = 0x100,
    .supply_names =
    {
        [14] =
        "pmuio1",
        "pmuio2",
    },
};

/*
 * On the rk3188 the io-domains are handled by a shared register with the lower
 * 8 bits being still being continuing drive-strength settings.
 */
static const struct rockchip_iodomain_soc_data soc_data_rk3188 =
{
    .grf_offset = 0x104,
    .supply_names =
    {
        [8] =
        "ap0",
        "ap1",
        "cif",
        "flash",
        "vccio0",
        "vccio1",
        "lcdc0",
        "lcdc1",
    },
};

static const struct rockchip_iodomain_soc_data soc_data_rk3228 =
{
    .grf_offset = 0x418,
    .supply_names =
    {
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio4",
    },
};

#define RK3288_SOC_CON2             0x24c
#define RK3288_SOC_CON2_FLASH0      RT_BIT(7)
#define RK3288_SOC_FLASH_SUPPLY_NUM 2

static void rk3288_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no flash supply we should leave things alone */
    if (!domain->supplies[RK3288_SOC_FLASH_SUPPLY_NUM].reg)
    {
        return;
    }

    /* set flash0 iodomain to also use this framework instead of a special gpio. */
    val = RK3288_SOC_CON2_FLASH0 | (RK3288_SOC_CON2_FLASH0 << 16);

    if (rt_syscon_write(domain->grf, RK3288_SOC_CON2, val) < 0)
    {
        LOG_W("Couldn't update %s ctrl", "flash0");
    }
}

static const struct rockchip_iodomain_soc_data soc_data_rk3288 =
{
    .grf_offset = 0x380,
    .supply_names =
    {
        "lcdc",     /* LCDC_VDD */
        "dvp",      /* DVPIO_VDD */
        "flash0",   /* FLASH0_VDD (emmc) */
        "flash1",   /* FLASH1_VDD (sdio1) */
        "wifi",     /* APIO3_VDD  (sdio0) */
        "bb",       /* APIO5_VDD */
        "audio",    /* APIO4_VDD */
        "sdcard",   /* SDMMC0_VDD (sdmmc) */
        "gpio30",   /* APIO1_VDD */
        "gpio1830", /* APIO2_VDD */
    },
    .init = rk3288_iodomain_init,
};

#define RK3308_SOC_CON0                 0x300
#define RK3308_SOC_CON0_VCCIO3          RT_BIT(8)
#define RK3308_SOC_VCCIO3_SUPPLY_NUM    3

static void rk3308_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no vccio3 supply we should leave things alone */
    if (!domain->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);

    if (rt_syscon_write(domain->grf, RK3308_SOC_CON0, val) < 0)
    {
        LOG_W("Couldn't update %s ctrl", "vccio3");
    }
}

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,
};

#define RK3328_SOC_CON4                 0x410
#define RK3328_SOC_CON4_VCCIO2          RT_BIT(7)
#define RK3328_SOC_VCCIO2_SUPPLY_NUM    1

static void rk3328_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no vccio2 supply we should leave things alone */
    if (!domain->supplies[RK3328_SOC_VCCIO2_SUPPLY_NUM].reg)
    {
        return;
    }

    /* set vccio2 iodomain to also use this framework instead of a special gpio. */
    val = RK3328_SOC_CON4_VCCIO2 | (RK3328_SOC_CON4_VCCIO2 << 16);

    if (rt_syscon_write(domain->grf, RK3328_SOC_CON4, val) < 0)
    {
        LOG_W("Couldn't update %s ctrl", "vccio2 vsel");
    }
}

static const struct rockchip_iodomain_soc_data soc_data_rk3328 =
{
    .grf_offset = 0x410,
    .supply_names =
    {
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio4",
        "vccio5",
        "vccio6",
        "pmuio",
    },
    .init = rk3328_iodomain_init,
};

#define RK3368_SOC_CON15            0x43c
#define RK3368_SOC_CON15_FLASH0     RT_BIT(14)
#define RK3368_SOC_FLASH_SUPPLY_NUM 2

static void rk3368_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no flash supply we should leave things alone */
    if (!domain->supplies[RK3368_SOC_FLASH_SUPPLY_NUM].reg)
    {
        return;
    }

    /* set flash0 iodomain to also use this framework instead of a special gpio. */
    val = RK3368_SOC_CON15_FLASH0 | (RK3368_SOC_CON15_FLASH0 << 16);

    if (rt_syscon_write(domain->grf, RK3368_SOC_CON15, val) < 0)
    {
        LOG_W("Couldn't update %s ctrl", "flash0");
    }
}

static const struct rockchip_iodomain_soc_data soc_data_rk3368 =
{
    .grf_offset = 0x900,
    .supply_names =
    {
        RT_NULL,    /* Reserved */
        "dvp",      /* DVPIO_VDD */
        "flash0",   /* FLASH0_VDD (emmc) */
        "wifi",     /* APIO2_VDD (sdio0) */
        RT_NULL,
        "audio",    /* APIO3_VDD */
        "sdcard",   /* SDMMC0_VDD (sdmmc) */
        "gpio30",   /* APIO1_VDD */
        "gpio1830", /* APIO4_VDD (gpujtag) */
    },
    .init = rk3368_iodomain_init,
};

static const struct rockchip_iodomain_soc_data soc_data_rk3368_pmu =
{
    .grf_offset = 0x100,
    .supply_names =
    {
        [4] =
        "pmu",      /* PMU IO domain*/
        "vop",      /* LCDC IO domain*/
    },
};

static const struct rockchip_iodomain_soc_data soc_data_rk3399 =
{
    .grf_offset = 0xe640,
    .supply_names =
    {
        "bt656",    /* APIO2_VDD */
        "audio",    /* APIO5_VDD */
        "sdmmc",    /* SDMMC0_VDD */
        "gpio1830", /* APIO4_VDD */
    },
};

#define RK3399_PMUGRF_CON0              0x180
#define RK3399_PMUGRF_CON0_VSEL         RT_BIT(8)
#define RK3399_PMUGRF_VSEL_SUPPLY_NUM   9

static void rk3399_pmu_iodomain_init(struct rockchip_iodomain *domain)
{
    rt_uint32_t val;

    /* if no pmu io supply we should leave things alone */
    if (!domain->supplies[RK3399_PMUGRF_VSEL_SUPPLY_NUM].reg)
    {
        return;
    }

    /* set pmu io iodomain to also use this framework instead of a special gpio. */
    val = RK3399_PMUGRF_CON0_VSEL | (RK3399_PMUGRF_CON0_VSEL << 16);

    if (rt_syscon_write(domain->grf, RK3399_PMUGRF_CON0, val) < 0)
    {
        LOG_W("couldn't update %s ctrl", "pmu io iodomain");
    }
}

static const struct rockchip_iodomain_soc_data soc_data_rk3399_pmu =
{
    .grf_offset = 0x180,
    .supply_names =
    {
        [9] =
        "pmu1830",  /* PMUIO2_VDD */
    },
    .init = rk3399_pmu_iodomain_init,
};

#define RK3568_PMU_GRF_IO_VSEL0 0x0140
#define RK3568_PMU_GRF_IO_VSEL1 0x0144
#define RK3568_PMU_GRF_IO_VSEL2 0x0148

static rt_err_t rk3568_iodomain_write(struct rockchip_iodomain_supply *supply, int uvolt)
{
    rt_uint32_t bit, is_3v3 = uvolt > MAX_VOLTAGE_1_8, val0, val1;
    struct rockchip_iodomain *domain = supply->domain;

    switch (supply->idx)
    {
    case 0: /* pmuio1 */
        break;

    case 1: /* pmuio2 */
        bit = supply->idx;
        val0 = RT_BIT(16 + bit) | (is_3v3 ? 0 : RT_BIT(bit));
        bit = supply->idx + 4;
        val1 = RT_BIT(16 + bit) | (is_3v3 ? RT_BIT(bit) : 0);

        rt_syscon_write(domain->grf, RK3568_PMU_GRF_IO_VSEL2, val0);
        rt_syscon_write(domain->grf, RK3568_PMU_GRF_IO_VSEL2, val1);
        break;

    case 3: /* vccio2 */
        break;

    case 2: /* vccio1 */
    case 4: /* vccio3 */
    case 5: /* vccio4 */
    case 6: /* vccio5 */
    case 7: /* vccio6 */
    case 8: /* vccio7 */
        bit = supply->idx - 1;
        val0 = RT_BIT(16 + bit) | (is_3v3 ? 0 : RT_BIT(bit));
        val1 = RT_BIT(16 + bit) | (is_3v3 ? RT_BIT(bit) : 0);

        rt_syscon_write(domain->grf, RK3568_PMU_GRF_IO_VSEL0, val0);
        rt_syscon_write(domain->grf, RK3568_PMU_GRF_IO_VSEL1, val1);
        break;

    default:
        return -RT_EINVAL;
    }

    return 0;
}

static const struct rockchip_iodomain_soc_data soc_data_rk3568_pmu =
{
    .grf_offset = 0x140,
    .supply_names =
    {
        "pmuio1",
        "pmuio2",
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio4",
        "vccio5",
        "vccio6",
        "vccio7",
    },
    .write = rk3568_iodomain_write,
};

static const struct rockchip_iodomain_soc_data soc_data_rv1108 =
{
    .grf_offset = 0x404,
    .supply_names =
    {
        [11] =
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio5",
        "vccio6",
    },
};

static const struct rockchip_iodomain_soc_data soc_data_rv1108_pmu =
{
    .grf_offset = 0x104,
    .supply_names =
    {
        "pmu",
    },
};

static const struct rockchip_iodomain_soc_data soc_data_rv1126_pmu =
{
    .grf_offset = 0x140,
    .supply_names =
    {
        [1] =
        "vccio1",
        "vccio2",
        "vccio3",
        "vccio4",
        "vccio5",
        "vccio6",
        "vccio7",
        "pmuio0",
        "pmuio1",
    },
};

static rt_err_t rockchip_iodomain_write(struct rockchip_iodomain_supply *supply, int uvolt)
{
    rt_err_t err;
    rt_uint32_t val;
    struct rockchip_iodomain *domain = supply->domain;

    /* set value bit */
    val = (uvolt > MAX_VOLTAGE_1_8) ? 0 : 1;
    val <<= supply->idx;
    /* apply hiword-mask */
    val |= (RT_BIT(supply->idx) << 16);

    if ((err = rt_syscon_write(domain->grf, domain->soc_data->grf_offset, val)))
    {
        LOG_E("Couldn't write to GRF");
    }

    return err;
}

static rt_err_t rockchip_iodomain_notify(struct rt_regulator_notifier *notifier,
        rt_ubase_t msg, void *data)
{
    int uvolt = 0;
    rt_err_t err;
    struct rockchip_iodomain_supply *supply;

    supply = rt_container_of(notifier, struct rockchip_iodomain_supply, notifier);

    if (msg == RT_REGULATOR_MSG_VOLTAGE_CHANGE)
    {
        union rt_regulator_notifier_args *args = data;

        uvolt = rt_max(args->old_uvolt, args->max_uvolt);
    }
    else if (msg == RT_REGULATOR_MSG_VOLTAGE_CHANGE_ERR)
    {
        uvolt = (int)(rt_base_t)data;
    }

    if (uvolt > MAX_VOLTAGE_3_3)
    {
        LOG_E("Voltage too high: %d", uvolt);

        if (msg == RT_REGULATOR_MSG_VOLTAGE_CHANGE)
        {
            return -RT_EIO;
        }
    }

    err = supply->domain->write(supply, uvolt);

    if (err && msg == RT_REGULATOR_MSG_VOLTAGE_CHANGE)
    {
        return -RT_EIO;
    }

    LOG_D("Setting to %d done", uvolt);

    return err;
}

static rt_err_t rockchip_iodomain_probe(struct rt_platform_device *pdev)
{
    rt_err_t err = RT_EOK;
    struct rt_ofw_node *np, *grf_np;
    struct rockchip_iodomain *domain = rt_calloc(1, sizeof(*domain));

    if (!domain)
    {
        return -RT_ENOMEM;
    }

    domain->dev = &pdev->parent;
    domain->soc_data = pdev->id->data;
    domain->write = domain->soc_data->write ? : rockchip_iodomain_write;

    np = pdev->parent.ofw_node;

    if ((grf_np = rt_ofw_get_parent(np)))
    {
        domain->grf = rt_syscon_find_by_ofw_node(grf_np);
        rt_ofw_node_put(grf_np);
    }
    else
    {
        domain->grf = rt_syscon_find_by_ofw_phandle(np, "rockchip,grf");
    }

    if (!domain->grf)
    {
        err = -RT_EIO;

        goto _fail;
    }

    for (int i = 0; i < MAX_SUPPLIES; ++i)
    {
        int uvolt;
        struct rt_regulator *reg;
        struct rockchip_iodomain_supply *supply;
        const char *supply_name = domain->soc_data->supply_names[i];

        if (!supply_name)
        {
            continue;
        }

        supply = &domain->supplies[i];
        reg = rt_regulator_get(domain->dev, supply_name);

        if (rt_is_err(reg))
        {
            err = rt_ptr_err(reg);
            goto _fail;
        }

        if (!reg)
        {
            char prop_name[64];
            rt_phandle phandle;

            rt_snprintf(prop_name, sizeof(prop_name), "%s-supply", supply_name);
            if (!rt_ofw_prop_read_u32(np, prop_name, &phandle))
            {
                /* The referenced provider is registered later (for example,
                 * an I2C PMIC). Keep this device unbound so it can be retried. */
                err = -RT_EBUSY;
                goto _fail;
            }

            continue;
        }

        uvolt = rt_regulator_get_voltage(reg);

        if (uvolt < 0)
        {
            /* Maybe is a switch */
            if (uvolt == -RT_ENOSYS)
            {
                rt_regulator_put(reg);
                continue;
            }

            LOG_E("Can't determine voltage: %s", supply_name);

            err = uvolt;
            goto _fail;
        }

        if (uvolt > MAX_VOLTAGE_3_3)
        {
            LOG_E("Voltage too high: %d", uvolt);

            err = -RT_EIO;
            goto _fail;
        }

        supply->idx = i;
        supply->domain = domain;
        supply->reg = reg;
        supply->notifier.callback = rockchip_iodomain_notify;

        if (domain->write(supply, uvolt))
        {
            rt_regulator_put(supply->reg);
            supply->reg = RT_NULL;

            goto _fail;
        }

        if ((err = rt_regulator_notifier_register(supply->reg, &supply->notifier)))
        {
            rt_regulator_put(supply->reg);
            supply->reg = RT_NULL;

            goto _fail;
        }
    }

    if (domain->soc_data->init)
    {
        domain->soc_data->init(domain);
    }

    return RT_EOK;

_fail:
    for (int i = MAX_SUPPLIES - 1; i >= 0; --i)
    {
        struct rockchip_iodomain_supply *supply = &domain->supplies[i];

        if (!rt_is_err_or_null(supply->reg))
        {
            rt_regulator_notifier_unregister(supply->reg, &supply->notifier);
            rt_regulator_put(supply->reg);
        }
    }

    rt_free(domain);

    return err;
}

static const struct rt_ofw_node_id rockchip_iodomain_ofw_ids[] =
{
    { .compatible = "rockchip,px30-io-voltage-domain", .data = &soc_data_px30 },
    { .compatible = "rockchip,px30-pmu-io-voltage-domain", .data = &soc_data_px30_pmu },
    { .compatible = "rockchip,rk3188-io-voltage-domain", .data = &soc_data_rk3188 },
    { .compatible = "rockchip,rk3228-io-voltage-domain", .data = &soc_data_rk3228 },
    { .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 },
    { .compatible = "rockchip,rk3368-io-voltage-domain", .data = &soc_data_rk3368 },
    { .compatible = "rockchip,rk3368-pmu-io-voltage-domain", .data = &soc_data_rk3368_pmu },
    { .compatible = "rockchip,rk3399-io-voltage-domain", .data = &soc_data_rk3399 },
    { .compatible = "rockchip,rk3399-pmu-io-voltage-domain", .data = &soc_data_rk3399_pmu },
    { .compatible = "rockchip,rk3568-pmu-io-voltage-domain", .data = &soc_data_rk3568_pmu },
    { .compatible = "rockchip,rv1108-io-voltage-domain", .data = &soc_data_rv1108 },
    { .compatible = "rockchip,rv1108-pmu-io-voltage-domain", .data = &soc_data_rv1108_pmu },
    { .compatible = "rockchip,rv1126-pmu-io-voltage-domain", .data = &soc_data_rv1126_pmu },
    { /* sentinel */ }
};

static struct rt_platform_driver rockchip_iodomain_driver =
{
    .name = "rockchip-iodomain",
    .ids = rockchip_iodomain_ofw_ids,

    .probe = rockchip_iodomain_probe,
};

static int rockchip_iodomain_register(void)
{
    rt_platform_driver_register(&rockchip_iodomain_driver);

    return 0;
}
/* PMIC-backed regulators are registered at INIT_DEVICE (level 3). */
INIT_EXPORT(rockchip_iodomain_register, "3.9");