@@ -19,7 +19,13 @@ struct visionox_vtdr6130 {
19
19
struct drm_panel panel ;
20
20
struct mipi_dsi_device * dsi ;
21
21
struct gpio_desc * reset_gpio ;
22
- struct regulator_bulk_data supplies [3 ];
22
+ struct regulator_bulk_data * supplies ;
23
+ };
24
+
25
+ static const struct regulator_bulk_data visionox_vtdr6130_supplies [] = {
26
+ { .supply = "vddio" },
27
+ { .supply = "vci" },
28
+ { .supply = "vdd" },
23
29
};
24
30
25
31
static inline struct visionox_vtdr6130 * to_visionox_vtdr6130 (struct drm_panel * panel )
@@ -139,7 +145,7 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
139
145
struct visionox_vtdr6130 * ctx = to_visionox_vtdr6130 (panel );
140
146
int ret ;
141
147
142
- ret = regulator_bulk_enable (ARRAY_SIZE (ctx -> supplies ),
148
+ ret = regulator_bulk_enable (ARRAY_SIZE (visionox_vtdr6130_supplies ),
143
149
ctx -> supplies );
144
150
if (ret < 0 )
145
151
return ret ;
@@ -149,7 +155,8 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
149
155
ret = visionox_vtdr6130_on (ctx );
150
156
if (ret < 0 ) {
151
157
gpiod_set_value_cansleep (ctx -> reset_gpio , 1 );
152
- regulator_bulk_disable (ARRAY_SIZE (ctx -> supplies ), ctx -> supplies );
158
+ regulator_bulk_disable (ARRAY_SIZE (visionox_vtdr6130_supplies ),
159
+ ctx -> supplies );
153
160
return ret ;
154
161
}
155
162
@@ -164,7 +171,8 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
164
171
165
172
gpiod_set_value_cansleep (ctx -> reset_gpio , 1 );
166
173
167
- regulator_bulk_disable (ARRAY_SIZE (ctx -> supplies ), ctx -> supplies );
174
+ regulator_bulk_disable (ARRAY_SIZE (visionox_vtdr6130_supplies ),
175
+ ctx -> supplies );
168
176
169
177
return 0 ;
170
178
}
@@ -244,12 +252,10 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
244
252
if (!ctx )
245
253
return - ENOMEM ;
246
254
247
- ctx -> supplies [0 ].supply = "vddio" ;
248
- ctx -> supplies [1 ].supply = "vci" ;
249
- ctx -> supplies [2 ].supply = "vdd" ;
250
-
251
- ret = devm_regulator_bulk_get (& dsi -> dev , ARRAY_SIZE (ctx -> supplies ),
252
- ctx -> supplies );
255
+ ret = devm_regulator_bulk_get_const (& dsi -> dev ,
256
+ ARRAY_SIZE (visionox_vtdr6130_supplies ),
257
+ visionox_vtdr6130_supplies ,
258
+ & ctx -> supplies );
253
259
if (ret < 0 )
254
260
return ret ;
255
261
0 commit comments