Skip to content

Commit 88e6e4d

Browse files
committed
drm/panel: visionox-rm69299: switch to devm_regulator_bulk_get_const()
Switch to devm_regulator_bulk_get_const() to move the supply data to const. Reviewed-by: Jessica Zhang <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c161a2b commit 88e6e4d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

drivers/gpu/drm/panel/panel-visionox-rm69299.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ struct visionox_rm69299_panel_desc {
2424

2525
struct visionox_rm69299 {
2626
struct drm_panel panel;
27-
struct regulator_bulk_data supplies[2];
27+
struct regulator_bulk_data *supplies;
2828
struct gpio_desc *reset_gpio;
2929
struct mipi_dsi_device *dsi;
3030
const struct visionox_rm69299_panel_desc *desc;
3131
};
3232

33+
static const struct regulator_bulk_data visionox_rm69299_supplies[] = {
34+
{ .supply = "vdda", .init_load_uA = 32000 },
35+
{ .supply = "vdd3p3", .init_load_uA = 13200 },
36+
};
37+
3338
static const u8 visionox_rm69299_1080x2248_60hz_init_seq[][2] = {
3439
{ 0xfe, 0x00 }, { 0xc2, 0x08 }, { 0x35, 0x00 }, { 0x51, 0xff },
3540
};
@@ -43,7 +48,8 @@ static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
4348
{
4449
int ret;
4550

46-
ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
51+
ret = regulator_bulk_enable(ARRAY_SIZE(visionox_rm69299_supplies),
52+
ctx->supplies);
4753
if (ret < 0)
4854
return ret;
4955

@@ -66,7 +72,8 @@ static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
6672
{
6773
gpiod_set_value(ctx->reset_gpio, 0);
6874

69-
return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
75+
return regulator_bulk_disable(ARRAY_SIZE(visionox_rm69299_supplies),
76+
ctx->supplies);
7077
}
7178

7279
static int visionox_rm69299_unprepare(struct drm_panel *panel)
@@ -174,12 +181,8 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
174181

175182
ctx->dsi = dsi;
176183

177-
ctx->supplies[0].supply = "vdda";
178-
ctx->supplies[0].init_load_uA = 32000;
179-
ctx->supplies[1].supply = "vdd3p3";
180-
ctx->supplies[1].init_load_uA = 13200;
181-
182-
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies);
184+
ret = devm_regulator_bulk_get_const(dev, ARRAY_SIZE(visionox_rm69299_supplies),
185+
visionox_rm69299_supplies, &ctx->supplies);
183186
if (ret < 0)
184187
return ret;
185188

0 commit comments

Comments
 (0)