Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel: sw43408: Switch to devm_regulator_bulk_get_const

Switch to devm_regulator_bulk_get_const() to stop setting the supplies
list in probe(), and move the regulator_bulk_data struct in static const.

Cosmetic: adjust comment for regulator from 1.88V to 1.8 V.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251214-pixel-3-v7-6-b1c0cf6f224d@ixit.cz

authored by

David Heidelberg and committed by
Neil Armstrong
ed2b818a cbc1e99a

+14 -12
+14 -12
drivers/gpu/drm/panel/panel-lg-sw43408.c
··· 20 20 #include <drm/display/drm_dsc.h> 21 21 #include <drm/display/drm_dsc_helper.h> 22 22 23 - #define NUM_SUPPLIES 2 23 + static const struct regulator_bulk_data sw43408_supplies[] = { 24 + { .supply = "vddi", /* 1.8 V */ 25 + .init_load_uA = 62000 }, 26 + { .supply = "vpnl", /* 3.0 V */ 27 + .init_load_uA = 857000 }, 28 + }; 24 29 25 30 struct sw43408_panel { 26 31 struct drm_panel base; 27 32 struct mipi_dsi_device *link; 28 33 29 - struct regulator_bulk_data supplies[NUM_SUPPLIES]; 34 + struct regulator_bulk_data *supplies; 30 35 31 36 struct gpio_desc *reset_gpio; 32 37 ··· 57 52 58 53 gpiod_set_value(sw43408->reset_gpio, 1); 59 54 60 - ret = regulator_bulk_disable(ARRAY_SIZE(sw43408->supplies), sw43408->supplies); 55 + ret = regulator_bulk_disable(ARRAY_SIZE(sw43408_supplies), sw43408->supplies); 61 56 62 57 return ret ? : ctx.accum_err; 63 58 } ··· 139 134 struct sw43408_panel *ctx = to_panel_info(panel); 140 135 int ret; 141 136 142 - ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); 137 + ret = regulator_bulk_enable(ARRAY_SIZE(sw43408_supplies), ctx->supplies); 143 138 if (ret < 0) 144 139 return ret; 145 140 ··· 155 150 156 151 poweroff: 157 152 gpiod_set_value(ctx->reset_gpio, 1); 158 - regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); 153 + regulator_bulk_disable(ARRAY_SIZE(sw43408_supplies), ctx->supplies); 159 154 return ret; 160 155 } 161 156 ··· 235 230 struct device *dev = &ctx->link->dev; 236 231 int ret; 237 232 238 - ctx->supplies[0].supply = "vddi"; /* 1.88 V */ 239 - ctx->supplies[0].init_load_uA = 62000; 240 - ctx->supplies[1].supply = "vpnl"; /* 3.0 V */ 241 - ctx->supplies[1].init_load_uA = 857000; 242 - 243 - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), 244 - ctx->supplies); 233 + ret = devm_regulator_bulk_get_const(dev, 234 + ARRAY_SIZE(sw43408_supplies), 235 + sw43408_supplies, 236 + &ctx->supplies); 245 237 if (ret < 0) 246 238 return ret; 247 239