{
struct analogix_dp_device *dp = to_dp(connector);
+ if (dp->plat_data->panel)
+ drm_panel_loader_protect(dp->plat_data->panel, on);
if (on)
pm_runtime_get_sync(dp->dev);
else
return 1;
}
+static int panel_simple_loader_protect(struct drm_panel *panel, bool on)
+{
+ struct panel_simple *p = to_panel_simple(panel);
+ int err;
+
+ if (on) {
+ err = regulator_enable(p->supply);
+ if (err < 0) {
+ dev_err(panel->dev, "failed to enable supply: %d\n",
+ err);
+ return err;
+ }
+ } else {
+ regulator_disable(p->supply);
+ }
+
+ return 0;
+}
+
static int panel_simple_disable(struct drm_panel *panel)
{
struct panel_simple *p = to_panel_simple(panel);
}
static const struct drm_panel_funcs panel_simple_funcs = {
+ .loader_protect = panel_simple_loader_protect,
.disable = panel_simple_disable,
.unprepare = panel_simple_unprepare,
.prepare = panel_simple_prepare,
/**
* struct drm_panel_funcs - perform operations on a given panel
+ * @loader_protect: protect loader logo panel's power
* @disable: disable panel (turn off back light, etc.)
* @unprepare: turn off panel
* @prepare: turn on panel and perform set up
* the panel. This is the job of the .unprepare() function.
*/
struct drm_panel_funcs {
+ int (*loader_protect)(struct drm_panel *panel, bool on);
int (*disable)(struct drm_panel *panel);
int (*unprepare)(struct drm_panel *panel);
int (*prepare)(struct drm_panel *panel);
return panel ? -ENOSYS : -EINVAL;
}
+static inline int drm_panel_loader_protect(struct drm_panel *panel, bool on)
+{
+ if (panel && panel->funcs && panel->funcs->loader_protect)
+ return panel->funcs->loader_protect(panel, on);
+
+ return panel ? -ENOSYS : -EINVAL;
+}
+
static inline int drm_panel_prepare(struct drm_panel *panel)
{
if (panel && panel->funcs && panel->funcs->prepare)