* [PATCH 14/32] OMAPDSS: DSI: cleanup regulator init
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Separate the regulator initialization code to its own function, removing
duplicate code.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 82 ++++++++++++++++---------------------------
1 file changed, 31 insertions(+), 51 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index bdddd0d..37ca980 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1114,6 +1114,30 @@ void dsi_runtime_put(struct platform_device *dsidev)
WARN_ON(r < 0 && r != -ENOSYS);
}
+static int dsi_regulator_init(struct platform_device *dsidev)
+{
+ struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
+ struct regulator *vdds_dsi;
+
+ if (dsi->vdds_dsi_reg != NULL)
+ return 0;
+
+ vdds_dsi = regulator_get(&dsi->pdev->dev, "vdds_dsi");
+
+ /* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
+ if (IS_ERR(vdds_dsi))
+ vdds_dsi = regulator_get(&dsi->pdev->dev, "VCXIO");
+
+ if (IS_ERR(vdds_dsi)) {
+ DSSERR("can't get VDDS_DSI regulator\n");
+ return PTR_ERR(vdds_dsi);
+ }
+
+ dsi->vdds_dsi_reg = vdds_dsi;
+
+ return 0;
+}
+
/* source clock for DSI PLL. this could also be PCLKFREE */
static inline void dsi_enable_pll_clock(struct platform_device *dsidev,
bool enable)
@@ -1592,22 +1616,9 @@ int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
*/
enable_hsclk = enable_hsdiv = true;
- if (dsi->vdds_dsi_reg = NULL) {
- struct regulator *vdds_dsi;
-
- vdds_dsi = regulator_get(&dsi->pdev->dev, "vdds_dsi");
-
- /* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
- if (IS_ERR(vdds_dsi))
- vdds_dsi = regulator_get(&dsi->pdev->dev, "VCXIO");
-
- if (IS_ERR(vdds_dsi)) {
- DSSERR("can't get VDDS_DSI regulator\n");
- return PTR_ERR(vdds_dsi);
- }
-
- dsi->vdds_dsi_reg = vdds_dsi;
- }
+ r = dsi_regulator_init(dsidev);
+ if (r)
+ return r;
dsi_enable_pll_clock(dsidev, 1);
/*
@@ -5225,34 +5236,6 @@ static enum omap_channel dsi_get_channel(int module_id)
}
}
-static int dsi_init_display(struct omap_dss_device *dssdev)
-{
- struct platform_device *dsidev - dsi_get_dsidev_from_id(dssdev->phy.dsi.module);
- struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-
- DSSDBG("DSI init\n");
-
- if (dsi->vdds_dsi_reg = NULL) {
- struct regulator *vdds_dsi;
-
- vdds_dsi = regulator_get(&dsi->pdev->dev, "vdds_dsi");
-
- /* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
- if (IS_ERR(vdds_dsi))
- vdds_dsi = regulator_get(&dsi->pdev->dev, "VCXIO");
-
- if (IS_ERR(vdds_dsi)) {
- DSSERR("can't get VDDS_DSI regulator\n");
- return PTR_ERR(vdds_dsi);
- }
-
- dsi->vdds_dsi_reg = vdds_dsi;
- }
-
- return 0;
-}
-
int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -5410,19 +5393,16 @@ static int dsi_probe_pdata(struct platform_device *dsidev)
if (!plat_dssdev)
return 0;
+ r = dsi_regulator_init(dsidev);
+ if (r)
+ return r;
+
dssdev = dss_alloc_and_init_device(&dsidev->dev);
if (!dssdev)
return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev);
- r = dsi_init_display(dssdev);
- if (r) {
- DSSERR("device %s init failed: %d\n", dssdev->name, r);
- dss_put_device(dssdev);
- return r;
- }
-
r = omapdss_output_set_device(&dsi->output, dssdev);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
--
1.8.1.2
^ permalink raw reply related
* [PATCH 13/32] OMAPDSS: CORE: use devm_regulator_get
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Use devm_regulator_get() instead of regulator_get() to simplify code.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/core.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 4bd8f79..f64d0ac 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -80,7 +80,7 @@ struct regulator *dss_get_vdds_dsi(void)
if (core.vdds_dsi_reg != NULL)
return core.vdds_dsi_reg;
- reg = regulator_get(&core.pdev->dev, "vdds_dsi");
+ reg = devm_regulator_get(&core.pdev->dev, "vdds_dsi");
if (!IS_ERR(reg))
core.vdds_dsi_reg = reg;
@@ -94,7 +94,7 @@ struct regulator *dss_get_vdds_sdi(void)
if (core.vdds_sdi_reg != NULL)
return core.vdds_sdi_reg;
- reg = regulator_get(&core.pdev->dev, "vdds_sdi");
+ reg = devm_regulator_get(&core.pdev->dev, "vdds_sdi");
if (!IS_ERR(reg))
core.vdds_sdi_reg = reg;
@@ -654,16 +654,6 @@ static int __init omap_dss_init(void)
static void __exit omap_dss_exit(void)
{
- if (core.vdds_dsi_reg != NULL) {
- regulator_put(core.vdds_dsi_reg);
- core.vdds_dsi_reg = NULL;
- }
-
- if (core.vdds_sdi_reg != NULL) {
- regulator_put(core.vdds_sdi_reg);
- core.vdds_sdi_reg = NULL;
- }
-
omap_dss_unregister_drivers();
omap_dss_bus_unregister();
--
1.8.1.2
^ permalink raw reply related
* [PATCH 12/32] OMAPDSS: Implement display (dis)connect support
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
We currently have two steps in panel initialization and startup: probing
and enabling. After the panel has been probed, it's ready and can be
configured and later enabled.
This model is not enough with more complex display pipelines, where we
may have, for example, two panels, of which only one can be used at a
time, connected to the same video output.
To support that kind of scenarios, we need to add new step to the
initialization: connect.
This patch adds support for connecting and disconnecting panels. After
probe, but before connect, no panel ops should be called. When the
connect is called, a proper video pipeline is established, and the panel
is ready for use. If some part in the video pipeline is already
connected (by some other panel), the connect call fails.
One key difference with the old style setup is that connect() handles
also connecting to the overlay manager. This means that the omapfb (or
omapdrm) no longer needs to figure out which overlay manager to use, but
it can just call connect() on the panel, and the proper overlay manager
is connected by omapdss.
This also allows us to add back the support for dynamic switching
between two exclusive panels. However, the current panel device model is
not changed to support this, as the new device model is implemented in
the following patches and the old model will be removed. The new device
model supports dynamic switching.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/omapdrm/omap_crtc.c | 24 +++++++++++++++++
drivers/gpu/drm/omapdrm/omap_drv.c | 12 ++++++++-
drivers/video/omap2/dss/apply.c | 14 ++++++++++
drivers/video/omap2/dss/core.c | 44 +++++++++++++++++++++++++++++++
drivers/video/omap2/dss/display-sysfs.c | 28 +++++++++++---------
drivers/video/omap2/dss/manager-sysfs.c | 45 ++++++++++++++++++++------------
drivers/video/omap2/dss/output.c | 14 ++++++++++
drivers/video/omap2/omapfb/omapfb-main.c | 25 ++++++++++--------
include/video/omapdss.h | 23 ++++++++++++++++
9 files changed, 188 insertions(+), 41 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 02075bf..b2ab2f5 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -94,6 +94,28 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
static struct omap_crtc *omap_crtcs[8];
/* we can probably ignore these until we support command-mode panels: */
+static int omap_crtc_connect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ if (mgr->output)
+ return -EINVAL;
+
+ if ((mgr->supported_outputs & dst->id) = 0)
+ return -EINVAL;
+
+ dst->manager = mgr;
+ mgr->output = dst;
+
+ return 0;
+}
+
+static void omap_crtc_disconnect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ mgr->output->manager = NULL;
+ mgr->output = NULL;
+}
+
static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
{
}
@@ -138,6 +160,8 @@ static void omap_crtc_unregister_framedone_handler(
}
static const struct dss_mgr_ops mgr_ops = {
+ .connect = omap_crtc_connect,
+ .disconnect = omap_crtc_disconnect,
.start_update = omap_crtc_start_update,
.enable = omap_crtc_enable,
.disable = omap_crtc_disable,
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index f8947f9..58bd259 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -97,6 +97,7 @@ static int omap_modeset_init(struct drm_device *dev)
int num_mgrs = dss_feat_get_num_mgrs();
int num_crtcs;
int i, id = 0;
+ int r;
omap_crtc_pre_init();
@@ -118,6 +119,7 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_connector *connector;
struct drm_encoder *encoder;
enum omap_channel channel;
+ struct omap_overlay_manager *mgr;
if (!dssdev->driver) {
dev_warn(dev->dev, "%s has no driver.. skipping it\n",
@@ -133,6 +135,13 @@ static int omap_modeset_init(struct drm_device *dev)
continue;
}
+ r = dssdev->driver->connect(dssdev);
+ if (r) {
+ dev_err(dev->dev, "could not connect display: %s\n",
+ dssdev->name);
+ continue;
+ }
+
encoder = omap_encoder_init(dev, dssdev);
if (!encoder) {
@@ -174,8 +183,9 @@ static int omap_modeset_init(struct drm_device *dev)
* other possible channels to which the encoder can connect are
* not considered.
*/
- channel = dssdev->output->dispc_channel;
+ mgr = omapdss_find_mgr_from_display(dssdev);
+ channel = mgr->id;
/*
* if this channel hasn't already been taken by a previously
* allocated crtc, we create a new crtc for it
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index c844071..dbd3c2f 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -790,6 +790,18 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr)
}
}
+static int dss_mgr_connect_compat(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ return mgr->set_output(mgr, dst);
+}
+
+static void dss_mgr_disconnect_compat(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ mgr->unset_output(mgr);
+}
+
static void dss_mgr_start_update_compat(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -1552,6 +1564,8 @@ static void dss_mgr_unregister_framedone_handler_compat(struct omap_overlay_mana
}
static const struct dss_mgr_ops apply_mgr_ops = {
+ .connect = dss_mgr_connect_compat,
+ .disconnect = dss_mgr_disconnect_compat,
.start_update = dss_mgr_start_update_compat,
.enable = dss_mgr_enable_compat,
.disable = dss_mgr_disable_compat,
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 502ec1b..4bd8f79 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -371,6 +371,46 @@ static int dss_driver_remove(struct device *dev)
return 0;
}
+static int omapdss_default_connect(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_output *out;
+ struct omap_overlay_manager *mgr;
+ int r;
+
+ out = dssdev->output;
+
+ if (out = NULL)
+ return -ENODEV;
+
+ mgr = omap_dss_get_overlay_manager(out->dispc_channel);
+ if (!mgr)
+ return -ENODEV;
+
+ r = dss_mgr_connect(mgr, out);
+ if (r)
+ return r;
+
+ return 0;
+}
+
+static void omapdss_default_disconnect(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_output *out;
+ struct omap_overlay_manager *mgr;
+
+ out = dssdev->output;
+
+ if (out = NULL)
+ return;
+
+ mgr = out->manager;
+
+ if (mgr = NULL)
+ return;
+
+ dss_mgr_disconnect(mgr, out);
+}
+
int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
{
dssdriver->driver.bus = &dss_bus_type;
@@ -384,6 +424,10 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
omapdss_default_get_recommended_bpp;
if (dssdriver->get_timings = NULL)
dssdriver->get_timings = omapdss_default_get_timings;
+ if (dssdriver->connect = NULL)
+ dssdriver->connect = omapdss_default_connect;
+ if (dssdriver->disconnect = NULL)
+ dssdriver->disconnect = omapdss_default_disconnect;
return driver_register(&dssdriver->driver);
}
diff --git a/drivers/video/omap2/dss/display-sysfs.c b/drivers/video/omap2/dss/display-sysfs.c
index 18211a9..81d5dc6 100644
--- a/drivers/video/omap2/dss/display-sysfs.c
+++ b/drivers/video/omap2/dss/display-sysfs.c
@@ -33,9 +33,9 @@ static ssize_t display_enabled_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct omap_dss_device *dssdev = to_dss_device(dev);
- bool enabled = dssdev->state != OMAP_DSS_DISPLAY_DISABLED;
- return snprintf(buf, PAGE_SIZE, "%d\n", enabled);
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+ omapdss_device_is_enabled(dssdev));
}
static ssize_t display_enabled_store(struct device *dev,
@@ -44,20 +44,24 @@ static ssize_t display_enabled_store(struct device *dev,
{
struct omap_dss_device *dssdev = to_dss_device(dev);
int r;
- bool enabled;
+ bool enable;
- r = strtobool(buf, &enabled);
+ r = strtobool(buf, &enable);
if (r)
return r;
- if (enabled != (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)) {
- if (enabled) {
- r = dssdev->driver->enable(dssdev);
- if (r)
- return r;
- } else {
- dssdev->driver->disable(dssdev);
- }
+ if (enable = omapdss_device_is_enabled(dssdev))
+ return size;
+
+ if (omapdss_device_is_connected(dssdev) = false)
+ return -ENODEV;
+
+ if (enable) {
+ r = dssdev->driver->enable(dssdev);
+ if (r)
+ return r;
+ } else {
+ dssdev->driver->disable(dssdev);
}
return size;
diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c
index 72784b3..de7e7b5 100644
--- a/drivers/video/omap2/dss/manager-sysfs.c
+++ b/drivers/video/omap2/dss/manager-sysfs.c
@@ -50,6 +50,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
int r = 0;
size_t len = size;
struct omap_dss_device *dssdev = NULL;
+ struct omap_dss_device *old_dssdev;
int match(struct omap_dss_device *dssdev, void *data)
{
@@ -66,34 +67,44 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
if (len > 0 && dssdev = NULL)
return -EINVAL;
- if (dssdev)
+ if (dssdev) {
DSSDBG("display %s found\n", dssdev->name);
- if (mgr->output) {
- r = mgr->unset_output(mgr);
- if (r) {
- DSSERR("failed to unset current output\n");
+ if (omapdss_device_is_connected(dssdev)) {
+ DSSERR("new display is already connected\n");
+ r = -EINVAL;
+ goto put_device;
+ }
+
+ if (omapdss_device_is_enabled(dssdev)) {
+ DSSERR("new display is not disabled\n");
+ r = -EINVAL;
goto put_device;
}
}
- if (dssdev) {
- struct omap_dss_output *out;
+ old_dssdev = mgr->get_device(mgr);
+ if (old_dssdev) {
+ if (omapdss_device_is_enabled(old_dssdev)) {
+ DSSERR("old display is not disabled\n");
+ r = -EINVAL;
+ goto put_device;
+ }
- out = omapdss_find_output_from_display(dssdev);
+ old_dssdev->driver->disconnect(old_dssdev);
+ }
- /*
- * a registered device should have an output connected to it
- * already
- */
- if (!out) {
- DSSERR("device has no output connected to it\n");
+ if (dssdev) {
+ r = dssdev->driver->connect(dssdev);
+ if (r) {
+ DSSERR("failed to connect new device\n");
goto put_device;
}
- r = mgr->set_output(mgr, out);
- if (r) {
- DSSERR("failed to set manager output\n");
+ old_dssdev = mgr->get_device(mgr);
+ if (old_dssdev != dssdev) {
+ DSSERR("failed to connect device to this manager\n");
+ dssdev->driver->disconnect(dssdev);
goto put_device;
}
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index ab2c0f0..a53b08b 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -179,6 +179,20 @@ void dss_uninstall_mgr_ops(void)
}
EXPORT_SYMBOL(dss_uninstall_mgr_ops);
+int dss_mgr_connect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ return dss_mgr_ops->connect(mgr, dst);
+}
+EXPORT_SYMBOL(dss_mgr_connect);
+
+void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst)
+{
+ dss_mgr_ops->disconnect(mgr, dst);
+}
+EXPORT_SYMBOL(dss_mgr_disconnect);
+
void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings)
{
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index dd972c5..eacbafa 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1853,6 +1853,8 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)
dssdev->driver->disable(dssdev);
+ dssdev->driver->disconnect(dssdev);
+
omap_dss_put_device(dssdev);
}
@@ -2363,22 +2365,23 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
int i, r;
struct omap_overlay_manager *mgr;
+ r = def_dssdev->driver->connect(def_dssdev);
+ if (r) {
+ dev_err(fbdev->dev, "failed to connect default display\n");
+ return r;
+ }
+
for (i = 0; i < fbdev->num_displays; ++i) {
struct omap_dss_device *dssdev = fbdev->displays[i].dssdev;
- struct omap_dss_output *out;
- out = omapdss_find_output_from_display(dssdev);
- if (!out)
+ if (dssdev = def_dssdev)
continue;
- mgr = omap_dss_get_overlay_manager(out->dispc_channel);
- if (!mgr)
- continue;
-
- if (mgr->output)
- mgr->unset_output(mgr);
-
- mgr->set_output(mgr, out);
+ /*
+ * We don't care if the connect succeeds or not. We just want to
+ * connect as many displays as possible.
+ */
+ dssdev->driver->connect(dssdev);
}
mgr = omapdss_find_mgr_from_display(def_dssdev);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 68b2345..f747266 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -689,6 +689,9 @@ struct omap_dss_driver {
int (*probe)(struct omap_dss_device *);
void (*remove)(struct omap_dss_device *);
+ int (*connect)(struct omap_dss_device *dssdev);
+ void (*disconnect)(struct omap_dss_device *dssdev);
+
int (*enable)(struct omap_dss_device *display);
void (*disable)(struct omap_dss_device *display);
int (*run_test)(struct omap_dss_device *display, int test);
@@ -888,6 +891,11 @@ int omapdss_compat_init(void);
void omapdss_compat_uninit(void);
struct dss_mgr_ops {
+ int (*connect)(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst);
+ void (*disconnect)(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst);
+
void (*start_update)(struct omap_overlay_manager *mgr);
int (*enable)(struct omap_overlay_manager *mgr);
void (*disable)(struct omap_overlay_manager *mgr);
@@ -904,6 +912,10 @@ struct dss_mgr_ops {
int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
void dss_uninstall_mgr_ops(void);
+int dss_mgr_connect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst);
+void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
+ struct omap_dss_output *dst);
void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings);
void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
@@ -915,4 +927,15 @@ int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data);
void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data);
+
+static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
+{
+ return dssdev->output;
+}
+
+static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
+{
+ return dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+}
+
#endif
--
1.8.1.2
^ permalink raw reply related
* [PATCH 11/32] OMAPDRM: fix overlay manager handling
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Currently omapdrm creates crtcs, which map directly to DSS overlay
managers, only on demand at init time. This would make it difficult to
manage connecting the display entities in the future, as the code cannot
just search for a suitable overlay manager.
We cannot fix this the sane way, which would be to create crtcs for each
overlay manager, because we need an overlay for each crtc. With limited
number of overlays, that's not possible.
So the solution for now is to detach the overlay manager from the crtc.
crtcs are still created on demand at init time, but all overlay managers
are always initialized by the omapdss.
This way we can create and connect whole display pipelines from the
overlay manager to the display, regardless of which crtcs omapdrm would
create.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/omapdrm/omap_crtc.c | 22 +++++++++++++++-------
drivers/gpu/drm/omapdrm/omap_drv.c | 2 ++
drivers/gpu/drm/omapdrm/omap_drv.h | 1 +
drivers/video/omap2/dss/apply.c | 3 ---
drivers/video/omap2/dss/dispc.c | 4 ++++
5 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 79b200a..02075bf 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -40,7 +40,7 @@ struct omap_crtc {
* mgr->id.) Eventually this will be replaced w/ something
* more common-panel-framework-y
*/
- struct omap_overlay_manager mgr;
+ struct omap_overlay_manager *mgr;
struct omap_video_timings timings;
bool enabled;
@@ -90,6 +90,9 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
* job of sequencing the setup of the video pipe in the proper order
*/
+/* ovl-mgr-id -> crtc */
+static struct omap_crtc *omap_crtcs[8];
+
/* we can probably ignore these until we support command-mode panels: */
static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
{
@@ -107,7 +110,7 @@ static void omap_crtc_disable(struct omap_overlay_manager *mgr)
static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings)
{
- struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
+ struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
DBG("%s", omap_crtc->name);
omap_crtc->timings = *timings;
omap_crtc->full_update = true;
@@ -116,7 +119,7 @@ static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
const struct dss_lcd_mgr_config *config)
{
- struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
+ struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
DBG("%s", omap_crtc->name);
dispc_mgr_set_lcd_config(omap_crtc->channel, config);
}
@@ -569,7 +572,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
} else {
if (encoder) {
omap_encoder_set_enabled(encoder, false);
- omap_encoder_update(encoder, &omap_crtc->mgr,
+ omap_encoder_update(encoder, omap_crtc->mgr,
&omap_crtc->timings);
omap_encoder_set_enabled(encoder, true);
omap_crtc->full_update = false;
@@ -595,6 +598,11 @@ static const char *channel_names[] = {
[OMAP_DSS_CHANNEL_LCD2] = "lcd2",
};
+void omap_crtc_pre_init(void)
+{
+ dss_install_mgr_ops(&mgr_ops);
+}
+
/* initialize crtc */
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, enum omap_channel channel, int id)
@@ -635,9 +643,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
omap_irq_register(dev, &omap_crtc->error_irq);
/* temporary: */
- omap_crtc->mgr.id = channel;
-
- dss_install_mgr_ops(&mgr_ops);
+ omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
/* TODO: fix hard-coded setup.. add properties! */
info = &omap_crtc->info;
@@ -651,6 +657,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
omap_plane_install_properties(omap_crtc->plane, &crtc->base);
+ omap_crtcs[channel] = omap_crtc;
+
return crtc;
fail:
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 691e760..f8947f9 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -98,6 +98,8 @@ static int omap_modeset_init(struct drm_device *dev)
int num_crtcs;
int i, id = 0;
+ omap_crtc_pre_init();
+
drm_mode_config_init(dev);
omap_drm_irq_install(dev);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 215a20d..14f17da 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -157,6 +157,7 @@ const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
int omap_crtc_apply(struct drm_crtc *crtc,
struct omap_drm_apply *apply);
+void omap_crtc_pre_init(void);
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, enum omap_channel channel, int id);
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 74d1d00..c844071 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1577,7 +1577,6 @@ int omapdss_compat_init(void)
apply_init_priv();
- dss_init_overlay_managers();
dss_init_overlay_managers_sysfs(pdev);
dss_init_overlays(pdev);
@@ -1642,7 +1641,6 @@ err_disp_sysfs:
err_mgr_ops:
dss_uninit_overlay_managers_sysfs(pdev);
- dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
compat_refcnt--;
@@ -1671,7 +1669,6 @@ void omapdss_compat_uninit(void)
dss_uninstall_mgr_ops();
dss_uninit_overlay_managers_sysfs(pdev);
- dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
out:
mutex_unlock(&compat_init_lock);
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b33b016..83d7bb9 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3710,6 +3710,8 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
dispc_runtime_put();
+ dss_init_overlay_managers();
+
dss_debugfs_create_file("dispc", dispc_dump_regs);
return 0;
@@ -3723,6 +3725,8 @@ static int __exit omap_dispchw_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
+ dss_uninit_overlay_managers();
+
return 0;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH 10/32] OMAPDSS: split overlay manager creation
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Split the function that creates overlay manager structs into two: one
that creates just the structs, and one that creates the sysfs files for
the manager.
This will help us use the overlay manager structs with omapdrm in the
following patches, while still leaving the sysfs files out.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/apply.c | 9 ++++++---
drivers/video/omap2/dss/dss.h | 6 ++++--
drivers/video/omap2/dss/manager-sysfs.c | 2 ++
drivers/video/omap2/dss/manager.c | 29 ++++++++++++++++++++++-------
4 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index b84bd99..74d1d00 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1577,7 +1577,8 @@ int omapdss_compat_init(void)
apply_init_priv();
- dss_init_overlay_managers(pdev);
+ dss_init_overlay_managers();
+ dss_init_overlay_managers_sysfs(pdev);
dss_init_overlays(pdev);
for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
@@ -1640,7 +1641,8 @@ err_disp_sysfs:
dss_uninstall_mgr_ops();
err_mgr_ops:
- dss_uninit_overlay_managers(pdev);
+ dss_uninit_overlay_managers_sysfs(pdev);
+ dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
compat_refcnt--;
@@ -1668,7 +1670,8 @@ void omapdss_compat_uninit(void)
dss_uninstall_mgr_ops();
- dss_uninit_overlay_managers(pdev);
+ dss_uninit_overlay_managers_sysfs(pdev);
+ dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
out:
mutex_unlock(&compat_init_lock);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 8475893..7964d3b 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -194,8 +194,10 @@ void display_uninit_sysfs(struct platform_device *pdev,
struct omap_dss_device *dssdev);
/* manager */
-int dss_init_overlay_managers(struct platform_device *pdev);
-void dss_uninit_overlay_managers(struct platform_device *pdev);
+int dss_init_overlay_managers(void);
+void dss_uninit_overlay_managers(void);
+int dss_init_overlay_managers_sysfs(struct platform_device *pdev);
+void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info);
int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c
index 5104681..72784b3 100644
--- a/drivers/video/omap2/dss/manager-sysfs.c
+++ b/drivers/video/omap2/dss/manager-sysfs.c
@@ -511,4 +511,6 @@ void dss_manager_kobj_uninit(struct omap_overlay_manager *mgr)
{
kobject_del(&mgr->kobj);
kobject_put(&mgr->kobj);
+
+ memset(&mgr->kobj, 0, sizeof(mgr->kobj));
}
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 2551eaa..1aac9b4 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -36,9 +36,9 @@
static int num_managers;
static struct omap_overlay_manager *managers;
-int dss_init_overlay_managers(struct platform_device *pdev)
+int dss_init_overlay_managers(void)
{
- int i, r;
+ int i;
num_managers = dss_feat_get_num_mgrs();
@@ -76,6 +76,17 @@ int dss_init_overlay_managers(struct platform_device *pdev)
dss_feat_get_supported_outputs(mgr->id);
INIT_LIST_HEAD(&mgr->overlays);
+ }
+
+ return 0;
+}
+
+int dss_init_overlay_managers_sysfs(struct platform_device *pdev)
+{
+ int i, r;
+
+ for (i = 0; i < num_managers; ++i) {
+ struct omap_overlay_manager *mgr = &managers[i];
r = dss_manager_kobj_init(mgr, pdev);
if (r)
@@ -85,18 +96,22 @@ int dss_init_overlay_managers(struct platform_device *pdev)
return 0;
}
-void dss_uninit_overlay_managers(struct platform_device *pdev)
+void dss_uninit_overlay_managers(void)
+{
+ kfree(managers);
+ managers = NULL;
+ num_managers = 0;
+}
+
+void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev)
{
int i;
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
+
dss_manager_kobj_uninit(mgr);
}
-
- kfree(managers);
- managers = NULL;
- num_managers = 0;
}
int omap_dss_get_num_overlay_managers(void)
--
1.8.1.2
^ permalink raw reply related
* [PATCH 09/32] OMAPDSS: add helpers to get mgr or output from display
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Add two helper functions that can be used to find either the DSS output
or the overlay manager that is connected to the given display.
This hides how the output and the manager are actually connected, making
it easier to change the connections in the future.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/omapdrm/omap_drv.c | 5 ++++-
drivers/video/omap2/dss/manager-sysfs.c | 4 +++-
drivers/video/omap2/dss/output.c | 19 +++++++++++++++++++
drivers/video/omap2/omapfb/omapfb-ioctl.c | 9 +++++++--
drivers/video/omap2/omapfb/omapfb-main.c | 16 +++++++---------
include/video/omapdss.h | 3 +++
6 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 9c53c25..691e760 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -247,6 +247,9 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_encoder *encoder = priv->encoders[i];
struct omap_dss_device *dssdev omap_encoder_get_dssdev(encoder);
+ struct omap_dss_output *output;
+
+ output = omapdss_find_output_from_display(dssdev);
/* figure out which crtc's we can connect the encoder to: */
encoder->possible_crtcs = 0;
@@ -259,7 +262,7 @@ static int omap_modeset_init(struct drm_device *dev)
supported_outputs dss_feat_get_supported_outputs(crtc_channel);
- if (supported_outputs & dssdev->output->id)
+ if (supported_outputs & output->id)
encoder->possible_crtcs |= (1 << id);
}
}
diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c
index 9a2fb59..5104681 100644
--- a/drivers/video/omap2/dss/manager-sysfs.c
+++ b/drivers/video/omap2/dss/manager-sysfs.c
@@ -78,7 +78,9 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
}
if (dssdev) {
- struct omap_dss_output *out = dssdev->output;
+ struct omap_dss_output *out;
+
+ out = omapdss_find_output_from_display(dssdev);
/*
* a registered device should have an output connected to it
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index 4d01001..ab2c0f0 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -141,6 +141,25 @@ struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node)
}
EXPORT_SYMBOL(omap_dss_find_output_by_node);
+struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
+{
+ return dssdev->output;
+}
+EXPORT_SYMBOL(omapdss_find_output_from_display);
+
+struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_output *out;
+
+ out = omapdss_find_output_from_display(dssdev);
+
+ if (out = NULL)
+ return NULL;
+
+ return out->manager;
+}
+EXPORT_SYMBOL(omapdss_find_mgr_from_display);
+
static const struct dss_mgr_ops *dss_mgr_ops;
int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index d30b45d..146b6f5 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -770,12 +770,17 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
case OMAPFB_WAITFORVSYNC:
DBG("ioctl WAITFORVSYNC\n");
- if (!display || !display->output || !display->output->manager) {
+
+ if (!display) {
r = -EINVAL;
break;
}
- mgr = display->output->manager;
+ mgr = omapdss_find_mgr_from_display(display);
+ if (!mgr) {
+ r = -EINVAL;
+ break;
+ }
r = mgr->wait_for_vsync(mgr);
break;
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index c84bb8a..dd972c5 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2363,18 +2363,16 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
int i, r;
struct omap_overlay_manager *mgr;
- if (!def_dssdev->output) {
- dev_err(fbdev->dev, "no output for the default display\n");
- return -EINVAL;
- }
-
for (i = 0; i < fbdev->num_displays; ++i) {
struct omap_dss_device *dssdev = fbdev->displays[i].dssdev;
- struct omap_dss_output *out = dssdev->output;
+ struct omap_dss_output *out;
- mgr = omap_dss_get_overlay_manager(out->dispc_channel);
+ out = omapdss_find_output_from_display(dssdev);
+ if (!out)
+ continue;
- if (!mgr || !out)
+ mgr = omap_dss_get_overlay_manager(out->dispc_channel);
+ if (!mgr)
continue;
if (mgr->output)
@@ -2383,7 +2381,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
mgr->set_output(mgr, out);
}
- mgr = def_dssdev->output->manager;
+ mgr = omapdss_find_mgr_from_display(def_dssdev);
if (!mgr) {
dev_err(fbdev->dev, "no ovl manager for the default display\n");
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 7fe6144..68b2345 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -785,6 +785,9 @@ int omapdss_output_set_device(struct omap_dss_output *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_output *out);
+struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
+struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev);
+
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 08/32] OMAPDSS: clean up dss_[ovl|mgr]_get_device()
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Minor cleanup for the dss_[ovl|mgr]_get_device() functions to make them
more readable.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/apply.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index a4b356a..b84bd99 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -420,16 +420,14 @@ static void wait_pending_extra_info_updates(void)
DSSWARN("timeout in wait_pending_extra_info_updates\n");
}
-static inline struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl)
+static struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
{
- return ovl->manager ?
- (ovl->manager->output ? ovl->manager->output->device : NULL) :
- NULL;
+ return mgr->output ? mgr->output->device : NULL;
}
-static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
+static struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl)
{
- return mgr->output ? mgr->output->device : NULL;
+ return ovl->manager ? dss_mgr_get_device(ovl->manager) : NULL;
}
static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
--
1.8.1.2
^ permalink raw reply related
* [PATCH 07/32] OMAPDSS: SDI: fix regulators for DT
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
SDI requires a regulator to operate. This regulator is, for some reason,
currently attached to the virtual omapdss device, instead of the SDI
device. This does not work for DT, as the regulator mappings need to be
described in the DT data, and the virtual omapdss device is not present
there.
Fix the issue by acquiring the regulator in the SDI device. To retain
compatibility with the current board files, the old method of getting
the regulator is kept. The old method can be removed when the board
files have been changed to pass the regulator to SDI.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/sdi.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 6277c05..2e3afb8 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -31,8 +31,11 @@
#include "dss.h"
static struct {
+ struct platform_device *pdev;
+
bool update_enabled;
struct regulator *vdds_sdi_reg;
+ bool vdds_sdi_from_core;
struct dss_lcd_mgr_config mgr_config;
struct omap_video_timings timings;
@@ -258,8 +261,14 @@ static int sdi_init_display(struct omap_dss_device *dssdev)
vdds_sdi = dss_get_vdds_sdi();
if (IS_ERR(vdds_sdi)) {
- DSSERR("can't get VDDS_SDI regulator\n");
- return PTR_ERR(vdds_sdi);
+ vdds_sdi = regulator_get(&sdi.pdev->dev, "vdds_sdi");
+ if (IS_ERR(vdds_sdi)) {
+ DSSERR("can't get VDDS_SDI regulator\n");
+ return PTR_ERR(vdds_sdi);
+ }
+ sdi.vdds_sdi_from_core = false;
+ } else {
+ sdi.vdds_sdi_from_core = true;
}
sdi.vdds_sdi_reg = vdds_sdi;
@@ -363,6 +372,8 @@ static int omap_sdi_probe(struct platform_device *pdev)
{
int r;
+ sdi.pdev = pdev;
+
sdi_init_output(pdev);
if (pdev->dev.platform_data) {
@@ -384,6 +395,11 @@ static int __exit omap_sdi_remove(struct platform_device *pdev)
sdi_uninit_output(pdev);
+ if (sdi.vdds_sdi_reg != NULL && sdi.vdds_sdi_from_core = false) {
+ regulator_put(sdi.vdds_sdi_reg);
+ sdi.vdds_sdi_reg = NULL;
+ }
+
return 0;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH 06/32] OMAPDSS: DPI: fix regulators for DT
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
On some platforms DPI requires a regulator to be enabled to power up the
output pins. This regulator is, for some reason, currently attached to
the virtual omapdss device, instead of the DPI device. This does not
work for DT, as the regulator mappings need to be described in the DT
data, and the virtual omapdss device is not present there.
Fix the issue by acquiring the regulator in the DPI device. To retain
compatibility with the current board files, the old method of getting
the regulator is kept. The old method can be removed when the board
files have been changed to pass the regulator to DPI.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dpi.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index ef8fca2..43f6b26 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -37,7 +37,10 @@
#include "dss_features.h"
static struct {
+ struct platform_device *pdev;
+
struct regulator *vdds_dsi_reg;
+ bool vdds_dsi_from_core;
struct platform_device *dsidev;
struct mutex lock;
@@ -583,10 +586,15 @@ static int dpi_init_display(struct omap_dss_device *dssdev)
struct regulator *vdds_dsi;
vdds_dsi = dss_get_vdds_dsi();
-
if (IS_ERR(vdds_dsi)) {
- DSSERR("can't get VDDS_DSI regulator\n");
- return PTR_ERR(vdds_dsi);
+ vdds_dsi = regulator_get(&dpi.pdev->dev, "vdds_dsi");
+ if (IS_ERR(vdds_dsi)) {
+ DSSERR("can't get VDDS_DSI regulator\n");
+ return PTR_ERR(vdds_dsi);
+ }
+ dpi.vdds_dsi_from_core = false;
+ } else {
+ dpi.vdds_dsi_from_core = true;
}
dpi.vdds_dsi_reg = vdds_dsi;
@@ -702,6 +710,8 @@ static int omap_dpi_probe(struct platform_device *pdev)
{
int r;
+ dpi.pdev = pdev;
+
mutex_init(&dpi.lock);
dpi_init_output(pdev);
@@ -725,6 +735,11 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
dpi_uninit_output(pdev);
+ if (dpi.vdds_dsi_reg != NULL && dpi.vdds_dsi_from_core = false) {
+ regulator_put(dpi.vdds_dsi_reg);
+ dpi.vdds_dsi_reg = NULL;
+ }
+
return 0;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH 05/32] OMAPDSS: fix dss_get_ctx_loss_count for DT
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
When using DT, dss device does not have platform data. However,
dss_get_ctx_loss_count() uses dss device's platform data to find the
get_ctx_loss_count function pointer.
To fix this, dss_get_ctx_loss_count() needs to be changed to get the
platform data from the omapdss device, which is a "virtual" device and
always has platform data.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 94f66f9..bd01608 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -157,7 +157,8 @@ static void dss_restore_context(void)
int dss_get_ctx_loss_count(void)
{
- struct omap_dss_board_info *board_data = dss.pdev->dev.platform_data;
+ struct platform_device *core_pdev = dss_get_core_pdev();
+ struct omap_dss_board_info *board_data = core_pdev->dev.platform_data;
int cnt;
if (!board_data->get_context_loss_count)
--
1.8.1.2
^ permalink raw reply related
* [PATCH 04/32] OMAPDSS: add omap_dss_find_output_by_node()
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Add a support function to find a DSS output by given DT node. This is
used in later patches to link the panels to DSS outputs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/output.c | 13 +++++++++++++
include/video/omapdss.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index 3274628..4d01001 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -128,6 +128,19 @@ struct omap_dss_output *omap_dss_find_output(const char *name)
}
EXPORT_SYMBOL(omap_dss_find_output);
+struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node)
+{
+ struct omap_dss_output *out;
+
+ list_for_each_entry(out, &output_list, list) {
+ if (out->pdev->dev.of_node = node)
+ return out;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(omap_dss_find_output_by_node);
+
static const struct dss_mgr_ops *dss_mgr_ops;
int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index aad47a2..7fe6144 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -780,6 +780,7 @@ struct omap_overlay *omap_dss_get_overlay(int num);
struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
struct omap_dss_output *omap_dss_find_output(const char *name);
+struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node);
int omapdss_output_set_device(struct omap_dss_output *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_output *out);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 03/32] OMAPDSS: add omap_dss_find_output()
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
Add a support function to find a DSS output by given name. This is used
in later patches to link the panels to DSS outputs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/output.c | 13 +++++++++++++
include/video/omapdss.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index 5214df6..3274628 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -115,6 +115,19 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
}
EXPORT_SYMBOL(omap_dss_get_output);
+struct omap_dss_output *omap_dss_find_output(const char *name)
+{
+ struct omap_dss_output *out;
+
+ list_for_each_entry(out, &output_list, list) {
+ if (strcmp(out->name, name) = 0)
+ return out;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(omap_dss_find_output);
+
static const struct dss_mgr_ops *dss_mgr_ops;
int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index d5f1fff..aad47a2 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -779,6 +779,7 @@ int omap_dss_get_num_overlays(void);
struct omap_overlay *omap_dss_get_overlay(int num);
struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
+struct omap_dss_output *omap_dss_find_output(const char *name);
int omapdss_output_set_device(struct omap_dss_output *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_output *out);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 02/32] OMAPDSS: only probe pdata if there's one
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
omapdss output drivers always read the platform data. This crashes when
there's no platform data when using DT.
Add a check to read the platform data only if it exists.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dpi.c | 12 ++++++++----
drivers/video/omap2/dss/dsi.c | 13 +++++++------
drivers/video/omap2/dss/hdmi.c | 16 ++++++++++------
drivers/video/omap2/dss/rfbi.c | 11 ++++++-----
drivers/video/omap2/dss/sdi.c | 12 ++++++++----
drivers/video/omap2/dss/venc.c | 13 +++++++------
6 files changed, 46 insertions(+), 31 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 757b57f..ef8fca2 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -706,13 +706,17 @@ static int omap_dpi_probe(struct platform_device *pdev)
dpi_init_output(pdev);
- r = dpi_probe_pdata(pdev);
- if (r) {
- dpi_uninit_output(pdev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = dpi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ dpi_uninit_output(pdev);
+ return r;
}
static int __exit omap_dpi_remove(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index a73dedc..bdddd0d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5563,12 +5563,10 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
dsi_init_output(dsidev);
- r = dsi_probe_pdata(dsidev);
- if (r) {
- dsi_runtime_put(dsidev);
- dsi_uninit_output(dsidev);
- pm_runtime_disable(&dsidev->dev);
- return r;
+ if (dsidev->dev.platform_data) {
+ r = dsi_probe_pdata(dsidev);
+ if (r)
+ goto err_probe;
}
dsi_runtime_put(dsidev);
@@ -5586,6 +5584,9 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
#endif
return 0;
+err_probe:
+ dsi_runtime_put(dsidev);
+ dsi_uninit_output(dsidev);
err_runtime_get:
pm_runtime_disable(&dsidev->dev);
return r;
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 17f4d55..99f4ab5 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1098,15 +1098,19 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
- r = hdmi_probe_pdata(pdev);
- if (r) {
- hdmi_panel_exit();
- hdmi_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = hdmi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ hdmi_panel_exit();
+ hdmi_uninit_output(pdev);
+ pm_runtime_disable(&pdev->dev);
+ return r;
}
static int __exit hdmi_remove_child(struct device *dev, void *data)
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 1a17dd1..1ff221e 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1093,15 +1093,16 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_init_output(pdev);
- r = rfbi_probe_pdata(pdev);
- if (r) {
- rfbi_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = rfbi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+err_probe:
+ rfbi_uninit_output(pdev);
err_runtime_get:
pm_runtime_disable(&pdev->dev);
return r;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 0bcd302..6277c05 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -365,13 +365,17 @@ static int omap_sdi_probe(struct platform_device *pdev)
sdi_init_output(pdev);
- r = sdi_probe_pdata(pdev);
- if (r) {
- sdi_uninit_output(pdev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = sdi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ sdi_uninit_output(pdev);
+ return r;
}
static int __exit omap_sdi_remove(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 74fdb3e..7b2e3ae 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -866,16 +866,17 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_init_output(pdev);
- r = venc_probe_pdata(pdev);
- if (r) {
- venc_panel_exit();
- venc_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = venc_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+err_probe:
+ venc_panel_exit();
+ venc_uninit_output(pdev);
err_panel_init:
err_runtime_get:
pm_runtime_disable(&pdev->dev);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 01/32] OMAPDSS: add pdata->default_display_name
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com>
We can currently set the default display (i.e. the initial display) in
the omapdss platform data by using a pointer to the default
omap_dss_device. Internally omapdss uses the device's name to resolve
the default display.
As it's difficult to get the omap_dss_device pointer in the future,
after we've changed the omapdss device model, this patch adds a new way
to define the default display, by using the name of the display.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/core.c | 2 ++
include/video/omapdss.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 60cc6fe..502ec1b 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -235,6 +235,8 @@ static int __init omap_dss_probe(struct platform_device *pdev)
if (def_disp_name)
core.default_display_name = def_disp_name;
+ else if (pdata->default_display_name)
+ core.default_display_name = pdata->default_display_name;
else if (pdata->default_device)
core.default_display_name = pdata->default_device->name;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 62ca9a7..d5f1fff 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -365,6 +365,7 @@ struct omap_dss_board_info {
int num_devices;
struct omap_dss_device **devices;
struct omap_dss_device *default_device;
+ const char *default_display_name;
int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
int (*set_min_bus_tput)(struct device *dev, unsigned long r);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 00/32] OMAPDSS: dss-dev-model "base" (Part 1/2)
From: Tomi Valkeinen @ 2013-05-30 9:34 UTC (permalink / raw)
To: linux-fbdev, linux-omap, Archit Taneja; +Cc: Tomi Valkeinen
Hi,
Here's are the first sets of patches targeting towards enabling DT for DSS and
changing the DSS device model to be more versatile. The exact division of the
sets of patches is still a bit open, and some splitting up for arch/driver
changes is needed, but most likely there will be at least the following major
sets, each based on the former one:
- base, containing cleanups and changes that do not yet really bring bigger new
features
- dev-model, implements the new DSS device model, including new panel drivers
- dt, adds DSS DT support (not at all ready yet, although works for a few boards)
The patches can be found from the following branches:
git://gitorious.org/linux-omap-dss2/linux.git work/dss-dev-model-base
git://gitorious.org/linux-omap-dss2/linux.git work/dss-dev-model
git://gitorious.org/linux-omap-dss2/linux.git work/dss-dev-model-dt
The set you are looking at is the "base" set.
The "base" set shouldn't change anything from the user's point of view. It
contains patches that do not make much sense until "dev-model" and "dt" are
merged, but those patches should not cause any problems either. Most likely the
"base" set is quite stable, I don't expect any changes to it.
Tomi
Tomi Valkeinen (32):
OMAPDSS: add pdata->default_display_name
OMAPDSS: only probe pdata if there's one
OMAPDSS: add omap_dss_find_output()
OMAPDSS: add omap_dss_find_output_by_node()
OMAPDSS: fix dss_get_ctx_loss_count for DT
OMAPDSS: DPI: fix regulators for DT
OMAPDSS: SDI: fix regulators for DT
OMAPDSS: clean up dss_[ovl|mgr]_get_device()
OMAPDSS: add helpers to get mgr or output from display
OMAPDSS: split overlay manager creation
OMAPDRM: fix overlay manager handling
OMAPDSS: Implement display (dis)connect support
OMAPDSS: CORE: use devm_regulator_get
OMAPDSS: DSI: cleanup regulator init
OMAPDSS: DPI: cleanup pll & regulator init
OMAPDSS: HDMI: add hdmi_init_regulator
OMAPDSS: SDI: clean up regulator init
OMAPDSS: VENC: clean up regulator init
OMAPDSS: add videomode conversion support
OMAPDSS: remove dssdev uses in trivial cases
OMAPDSS: add panel list
OMAPDSS: use the panel list in omap_dss_get_next_device
OMAPDSS: don't use dss bus in suspend/resume
OMAPDSS: implement display sysfs without dss bus
OMAPDSS: Add panel dev pointer to dssdev
OMAPDSS: remove omap_dss_start/stop_device()
OMAPDSS: combine omap_dss_output into omap_dss_device
OMAPDSS: omapdss.h: add owner field to omap_dss_device
OMAPDSS: add module_get/put to omap_dss_get/put_device()
OMAPDSS: add THIS_MODULE owner to DSS outputs
OMAPDSS: output: increase refcount in find_output funcs
OMAPFB: use EPROBE_DEFER if default display is not present
drivers/gpu/drm/omapdrm/omap_crtc.c | 46 +++-
drivers/gpu/drm/omapdrm/omap_drv.c | 21 +-
drivers/gpu/drm/omapdrm/omap_drv.h | 1 +
drivers/video/omap2/displays/panel-acx565akm.c | 16 +-
drivers/video/omap2/displays/panel-generic-dpi.c | 26 +--
.../omap2/displays/panel-lgphilips-lb035q02.c | 10 +-
drivers/video/omap2/displays/panel-n8x0.c | 30 +--
.../omap2/displays/panel-nec-nl8048hl11-01b.c | 4 +-
drivers/video/omap2/displays/panel-picodlp.c | 32 +--
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 10 +-
drivers/video/omap2/displays/panel-taal.c | 164 +++++++-------
drivers/video/omap2/displays/panel-tfp410.c | 32 +--
.../video/omap2/displays/panel-tpo-td043mtea1.c | 36 +--
drivers/video/omap2/dss/Kconfig | 1 +
drivers/video/omap2/dss/apply.c | 47 ++--
drivers/video/omap2/dss/core.c | 108 +++++----
drivers/video/omap2/dss/dispc.c | 4 +
drivers/video/omap2/dss/display-sysfs.c | 154 +++++++------
drivers/video/omap2/dss/display.c | 246 ++++++++++++++-------
drivers/video/omap2/dss/dpi.c | 140 ++++++------
drivers/video/omap2/dss/dsi.c | 124 ++++-------
drivers/video/omap2/dss/dss.c | 3 +-
drivers/video/omap2/dss/dss.h | 16 +-
drivers/video/omap2/dss/hdmi.c | 87 ++++----
drivers/video/omap2/dss/manager-sysfs.c | 47 ++--
drivers/video/omap2/dss/manager.c | 29 ++-
drivers/video/omap2/dss/output.c | 78 ++++++-
drivers/video/omap2/dss/rfbi.c | 39 ++--
drivers/video/omap2/dss/sdi.c | 78 ++++---
drivers/video/omap2/dss/venc.c | 74 +++----
drivers/video/omap2/dss/venc_panel.c | 16 +-
drivers/video/omap2/omapfb/omapfb-ioctl.c | 9 +-
drivers/video/omap2/omapfb/omapfb-main.c | 27 +--
include/video/omapdss.h | 103 ++++++---
34 files changed, 1088 insertions(+), 770 deletions(-)
--
1.8.1.2
^ permalink raw reply
* [PATCH] backlight: Turn backlight on/off when necessary
From: Liu Ying @ 2013-05-30 8:13 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-fbdev, linux-kernel, liu.y.victor, Liu Ying
We don't have to turn backlight on/off everytime a blanking
or unblanking event comes because the backlight status may have
already been what we want. Another thought is that one backlight
device may be shared by multiple framebuffers. We don't hope that
blanking one of the framebuffers would turn the backlight off for
all the other framebuffers, since they are likely active to show
display content. This patch adds logic to record each framebuffer's
backlight status to determine the backlight device use count and
whether the backlight should be turned on or off.
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
---
drivers/video/backlight/backlight.c | 23 +++++++++++++++++------
include/linux/backlight.h | 6 ++++++
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index c74e7aa..97ea2b8 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -31,13 +31,14 @@ static const char *const backlight_types[] = {
defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
/* This callback gets called when something important happens inside a
* framebuffer driver. We're looking if that important event is blanking,
- * and if it is, we're switching backlight power as well ...
+ * and if it is and necessary, we're switching backlight power as well ...
*/
static int fb_notifier_callback(struct notifier_block *self,
unsigned long event, void *data)
{
struct backlight_device *bd;
struct fb_event *evdata = data;
+ int node = evdata->info->node;
/* If we aren't interested in this event, skip it immediately ... */
if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK)
@@ -49,11 +50,21 @@ static int fb_notifier_callback(struct notifier_block *self,
if (!bd->ops->check_fb ||
bd->ops->check_fb(bd, evdata->info)) {
bd->props.fb_blank = *(int *)evdata->data;
- if (bd->props.fb_blank = FB_BLANK_UNBLANK)
- bd->props.state &= ~BL_CORE_FBBLANK;
- else
- bd->props.state |= BL_CORE_FBBLANK;
- backlight_update_status(bd);
+ if (bd->props.fb_blank = FB_BLANK_UNBLANK &&
+ !bd->fb_bl_on[node]) {
+ bd->fb_bl_on[node] = true;
+ if (!bd->use_count++) {
+ bd->props.state &= ~BL_CORE_FBBLANK;
+ backlight_update_status(bd);
+ }
+ } else if (bd->props.fb_blank != FB_BLANK_UNBLANK &&
+ bd->fb_bl_on[node]) {
+ bd->fb_bl_on[node] = false;
+ if (!(--bd->use_count)) {
+ bd->props.state |= BL_CORE_FBBLANK;
+ backlight_update_status(bd);
+ }
+ }
}
mutex_unlock(&bd->ops_lock);
return 0;
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index da9a082..5de71a0 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -9,6 +9,7 @@
#define _LINUX_BACKLIGHT_H
#include <linux/device.h>
+#include <linux/fb.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
@@ -101,6 +102,11 @@ struct backlight_device {
struct notifier_block fb_notif;
struct device dev;
+
+ /* Multiple framebuffers may share one backlight device */
+ bool fb_bl_on[FB_MAX];
+
+ int use_count;
};
static inline void backlight_update_status(struct backlight_device *bd)
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops
From: Lars-Peter Clausen @ 2013-05-30 7:52 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: Jingoo Han, 'Michael Hennerich',
'Rafael J. Wysocki', 'Tomi Valkeinen',
linux-fbdev, linux-pm
In-Reply-To: <20130530071413.GC19468@game.jcrosoft.org>
On 05/30/2013 09:14 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:32 Thu 30 May , Jingoo Han wrote:
>> On Thursday, May 30, 2013 4:20 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 16:24 Wed 29 May , Michael Hennerich wrote:
>>>> On 05/29/2013 02:17 PM, Lars-Peter Clausen wrote:
>>>>> Use dev_pm_ops instead of the legacy suspend/resume callbacks.
>>>>>
>>>>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>>>> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
>>>>> ---
>>>>> drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++--------
>>>>> 1 file changed, 14 insertions(+), 8 deletions(-)
>>>>>
>>>>> diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
>>>>> index 29d8c04..6084c17 100644
>>>>> --- a/drivers/video/bfin-lq035q1-fb.c
>>>>> +++ b/drivers/video/bfin-lq035q1-fb.c
>>>>> @@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
>>>>> return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
>>>>> }
>>>>> -#ifdef CONFIG_PM
>>>>> -static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state)
>>>>> +#ifdef CONFIG_PM_SLEEP
>>>>> +static int lq035q1_spidev_suspend(struct device *dev)
>>>>> {
>>>>> + struct spi_device *spi = to_spi_device(dev);
>>>>> +
>>>>> return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
>>>>> }
>>>>> -static int lq035q1_spidev_resume(struct spi_device *spi)
>>>>> +static int lq035q1_spidev_resume(struct device *dev)
>>>>> {
>>>>> - int ret;
>>>>> + struct spi_device *spi = to_spi_device(dev);
>>>>> struct spi_control *ctl = spi_get_drvdata(spi);
>>>>> + int ret;
>>>>> ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
>>>>> if (ret)
>>>>> @@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
>>>>> return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
>>>>> }
>>>>> +
>>>>> +static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
>>>>> + lq035q1_spidev_resume);
>>>>> +#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
>>>>> +
>>>>> #else
>>>>> -# define lq035q1_spidev_suspend NULL
>>>>> -# define lq035q1_spidev_resume NULL
>>>>> +#define LQ035Q1_SPIDEV_PM_OPS NULL
>>>>> #endif
>>> we really need to ahve a macro like for DT of_match_ptr to drop the #else
>>
>> Hi Jean-Christophe PLAGNIOL-VILLARD,
>>
>> I submitted the following patch. :)
>> (https://patchwork.kernel.org/patch/2502971/)
>>
>> --- a/include/linux/pm.h
>> +++ b/include/linux/pm.h
>> @@ -55,8 +55,10 @@ struct device;
>>
>> #ifdef CONFIG_PM
>> extern const char power_group_name[]; /* = "power" */
>> +#define pm_ops_ptr(_ptr) (_ptr)
>> #else
>> #define power_group_name NULL
>> +#define pm_ops_ptr(_ptr) NULL
>> #endif
>>
>>
>> This patch was accepted by Rafael Wysocki, and will be merged to v3.11-rc1.
>>
> Lars-Peter please update with and
Since the code depends on CONFIG_PM_SLEEP and not CONFIG_PM I don't think
the macro will work.
- Lars
^ permalink raw reply
* Re: [PATCH 1/8] video: atmel_lcdfb: fix platform data struct
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-30 7:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACQ1gAj_m_aWaq5J41SY8EPwOH5-3zYPsf2WJCunvVnBCyq00Q@mail.gmail.com>
On 08:39 Thu 30 May , Richard Genoud wrote:
> 2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> > On 19:44 Wed 29 May , Richard Genoud wrote:
> >> 2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> >> > On 16:36 Wed 29 May , Richard Genoud wrote:
> >> >> 2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> >> >> > Today we mix pdata and drivers data in the struct atmel_lcdfb_info
> >> >> > Fix it and introduce a new struct atmel_lcdfb_pdata for platform data only
> >> >> >
> >> >> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> >> > Cc: linux-fbdev@vger.kernel.org
> >> >> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> >> >> > Cc: Andrew Morton <akpm@linux-foundation.org>
> >> >> > Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> >> >> > ---
> >> >> > arch/arm/mach-at91/at91sam9261_devices.c | 6 +-
> >> >> > arch/arm/mach-at91/at91sam9263_devices.c | 6 +-
> >> >> > arch/arm/mach-at91/at91sam9g45_devices.c | 6 +-
> >> >> > arch/arm/mach-at91/at91sam9rl_devices.c | 6 +-
> >> >> > arch/arm/mach-at91/board-sam9261ek.c | 6 +-
> >> >> > arch/arm/mach-at91/board-sam9263ek.c | 4 +-
> >> >> > arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +-
> >> >> > arch/arm/mach-at91/board-sam9rlek.c | 4 +-
> >> >> > arch/arm/mach-at91/board.h | 4 +-
> >> >> > arch/avr32/boards/atngw100/evklcd10x.c | 6 +-
> >> >> > arch/avr32/boards/atngw100/mrmt.c | 4 +-
> >> >> > arch/avr32/boards/atstk1000/atstk1000.h | 2 +-
> >> >> > arch/avr32/boards/atstk1000/setup.c | 2 +-
> >> >> > arch/avr32/boards/favr-32/setup.c | 2 +-
> >> >> > arch/avr32/boards/hammerhead/setup.c | 2 +-
> >> >> > arch/avr32/boards/merisc/display.c | 2 +-
> >> >> > arch/avr32/boards/mimc200/setup.c | 4 +-
> >> >> > arch/avr32/mach-at32ap/at32ap700x.c | 8 +--
> >> >> > arch/avr32/mach-at32ap/include/mach/board.h | 4 +-
> >> >> > drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++----------
> >> >> > include/video/atmel_lcdc.h | 24 +------
> >> >> > 21 files changed, 109 insertions(+), 101 deletions(-)
> >> >> >
> >> >> [snip]
> >> >> > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> >> >> > index c1a2914..98733cd4 100644
> >> >> > --- a/drivers/video/atmel_lcdfb.c
> >> >> > +++ b/drivers/video/atmel_lcdfb.c
> >> >> > @@ -20,12 +20,45 @@
> >> >> > #include <linux/gfp.h>
> >> >> > #include <linux/module.h>
> >> >> > #include <linux/platform_data/atmel.h>
> >> >> > +#include <video/of_display_timing.h>
> >> >> >
> >> >> > #include <mach/cpu.h>
> >> >> > #include <asm/gpio.h>
> >> >> >
> >> >> > #include <video/atmel_lcdc.h>
> >> >> >
> >> >> > +struct atmel_lcdfb_config {
> >> >> > + bool have_alt_pixclock;
> >> >> > + bool have_hozval;
> >> >> > + bool have_intensity_bit;
> >> >> > +};
> >> >> > +
> >> >> > + /* LCD Controller info data structure, stored in device platform_data */
> >> >> > +struct atmel_lcdfb_info {
> >> >> > + spinlock_t lock;
> >> >> > + struct fb_info *info;
> >> >> > + void __iomem *mmio;
> >> >> > + int irq_base;
> >> >> > + struct work_struct task;
> >> >> > +
> >> >> > + unsigned int smem_len;
> >> >> > + struct platform_device *pdev;
> >> >> > + struct clk *bus_clk;
> >> >> > + struct clk *lcdc_clk;
> >> >> > +
> >> >> > + struct backlight_device *backlight;
> >> >> > + u8 bl_power;
> >> >> > + bool lcdcon_pol_negative;
> >> >> I think lcdcon_pol_negative should be part of pdata, because it really
> >> >> depends on how the PWM is wired on the board.
> >> >>
> >> >
> >> > maybe but no one mainline use it on any pdata for non-dt boars
> >> > so I did not want to expose it
> >> Well, at least, I'm using it :)
> >> (and I guess that Andreas is using it also, otherwise he wouldn't have
> >> introduce it !)
> >
> > yes but pdata is for non-dt boards, for dt you can keep it in struct
> > atmel_lcdfb_info and add a property
> >
> > if non-dt boards want it my answer is I do not care switch to DT
>
> ok (I use a full DT board based on sam9g35)
>
> so I'll add something like
> sinfo->lcdcon_pol_negative = of_property_read_bool(display_np,
> "atmel,lcdcon-pwm-pulse-low");
> in /atmel_lcdfb.c
>
> But I thought the goal of this patch was to separate driver data from
> platform specific data, and IMHO, lcdcon_pol_negative is a specificity
> of the platform.
You are right but as non one mainline use it as pdata I choose to drop it
and only keep it on the driver as we can still use it for DT
It's a way to force peopoe to switch to DT
Best Regards,
J.
>
> Best regards,
> Richard.
^ permalink raw reply
* Re: [RFC] Add co-maintainer for fbdev
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-30 7:21 UTC (permalink / raw)
To: Andrew Morton
Cc: Jingoo Han, 'Arnd Bergmann',
'Florian Tobias Schandinat', 'Olof Johansson',
linux-fbdev, 'Linus Torvalds', linux-kernel,
'Tomi Valkeinen'
In-Reply-To: <20130529135346.43ebe4c4565d90cec195e38e@linux-foundation.org>
On 13:53 Wed 29 May , Andrew Morton wrote:
> On Wed, 29 May 2013 10:32:08 +0900 Jingoo Han <jg1.han@samsung.com> wrote:
>
> > On Wednesday, May 29, 2013 6:20 AM, Arnd Bergmann wrote:
> > > On Monday 27 May 2013, Florian Tobias Schandinat wrote:
> > > > >> On Fri, May 24, 2013 at 8:38 AM, Jean-Christophe PLAGNIOL-VILLARD
> > > > >> <plagnioj@jcrosoft.com> wrote:
> > > > >>> Hi Florian,
> > > > >>>
> > > > >>> As you seems very busy I'd like to propose the help you to handle the
> > > > >>> fbdev subsystem to easier the rich of the fbdev patch to Linus
> > > > >>>
> > > > >>> As I'm working on fbdev on at91 and others and already Co-Maintain the
> > > > >>> at91 mach on ARM
> > > > >>>
> > > > >>> And if you are not willing to continue I could take over
> > > >
> > > > Yeah, it would be great if you could help, at the moment I get barely
> > > > any sleep, let alone that I could keep up with the majority of mail I
> > > > get. I'll let you decide whether you want to be sole maintainer or not.
> > >
> > > For any bigger subsystems, it's good practice to have two maintainers,
> > > even if one of them does all the work. I think it makes sense to have
> > > Jean-Christophe as the primary maintainer and owner of the git tree,
> > > but it may also be good to have you or Tomi listed as a second maintainer
> > > for times when Jean-Christophe isn't available.
> >
> > Hi Arnd,
> >
> > I agree with Arnd's opinion.
> > It looks good to have Florian or Tomi listed as a second maintainer.
>
> Someone send a patch!
Olof notice on IRC
It was me I use git-send-email but the From was scrued and my name disapear
in the From
I resend it
Can I have you ack on it?
Best Regards,
J.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-30 7:14 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Michael Hennerich', 'Rafael J. Wysocki',
'Lars-Peter Clausen', 'Tomi Valkeinen',
linux-fbdev, linux-pm
In-Reply-To: <001801ce5ccd$2dd30be0$897923a0$@samsung.com>
On 09:32 Thu 30 May , Jingoo Han wrote:
> On Thursday, May 30, 2013 4:20 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 16:24 Wed 29 May , Michael Hennerich wrote:
> > > On 05/29/2013 02:17 PM, Lars-Peter Clausen wrote:
> > > >Use dev_pm_ops instead of the legacy suspend/resume callbacks.
> > > >
> > > >Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> > > Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> > > >---
> > > > drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++--------
> > > > 1 file changed, 14 insertions(+), 8 deletions(-)
> > > >
> > > >diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> > > >index 29d8c04..6084c17 100644
> > > >--- a/drivers/video/bfin-lq035q1-fb.c
> > > >+++ b/drivers/video/bfin-lq035q1-fb.c
> > > >@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
> > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > > }
> > > >-#ifdef CONFIG_PM
> > > >-static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state)
> > > >+#ifdef CONFIG_PM_SLEEP
> > > >+static int lq035q1_spidev_suspend(struct device *dev)
> > > > {
> > > >+ struct spi_device *spi = to_spi_device(dev);
> > > >+
> > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > > }
> > > >-static int lq035q1_spidev_resume(struct spi_device *spi)
> > > >+static int lq035q1_spidev_resume(struct device *dev)
> > > > {
> > > >- int ret;
> > > >+ struct spi_device *spi = to_spi_device(dev);
> > > > struct spi_control *ctl = spi_get_drvdata(spi);
> > > >+ int ret;
> > > > ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
> > > > if (ret)
> > > >@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
> > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
> > > > }
> > > >+
> > > >+static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
> > > >+ lq035q1_spidev_resume);
> > > >+#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
> > > >+
> > > > #else
> > > >-# define lq035q1_spidev_suspend NULL
> > > >-# define lq035q1_spidev_resume NULL
> > > >+#define LQ035Q1_SPIDEV_PM_OPS NULL
> > > > #endif
> > we really need to ahve a macro like for DT of_match_ptr to drop the #else
>
> Hi Jean-Christophe PLAGNIOL-VILLARD,
>
> I submitted the following patch. :)
> (https://patchwork.kernel.org/patch/2502971/)
>
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -55,8 +55,10 @@ struct device;
>
> #ifdef CONFIG_PM
> extern const char power_group_name[]; /* = "power" */
> +#define pm_ops_ptr(_ptr) (_ptr)
> #else
> #define power_group_name NULL
> +#define pm_ops_ptr(_ptr) NULL
> #endif
>
>
> This patch was accepted by Rafael Wysocki, and will be merged to v3.11-rc1.
>
Lars-Peter please update with and
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Rafael can you take this one via pm tree
Best Regards,
J.
>
> Best regards,
> Jingoo Han
>
> >
> > I known it's related to this patch but someone should do it
> >
> > Rafael what do you think
> >
> > Best Regards,
> > J.
> > > > /* Power down all displays on reboot, poweroff or halt */
> > > >@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
> > > > info->spidrv.probe = lq035q1_spidev_probe;
> > > > info->spidrv.remove = lq035q1_spidev_remove;
> > > > info->spidrv.shutdown = lq035q1_spidev_shutdown;
> > > >- info->spidrv.suspend = lq035q1_spidev_suspend;
> > > >- info->spidrv.resume = lq035q1_spidev_resume;
> > > >+ info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
> > > > ret = spi_register_driver(&info->spidrv);
> > > > if (ret < 0) {
> > >
> > >
> > > --
> > > Greetings,
> > > Michael
> > >
> > > --
> > > Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> > > Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> > > Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> > > Margaret Seif
> > >
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH 1/8] video: atmel_lcdfb: fix platform data struct
From: Richard Genoud @ 2013-05-30 6:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130529193220.GB19468@game.jcrosoft.org>
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> On 19:44 Wed 29 May , Richard Genoud wrote:
>> 2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
>> > On 16:36 Wed 29 May , Richard Genoud wrote:
>> >> 2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
>> >> > Today we mix pdata and drivers data in the struct atmel_lcdfb_info
>> >> > Fix it and introduce a new struct atmel_lcdfb_pdata for platform data only
>> >> >
>> >> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> >> > Cc: linux-fbdev@vger.kernel.org
>> >> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
>> >> > Cc: Andrew Morton <akpm@linux-foundation.org>
>> >> > Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
>> >> > ---
>> >> > arch/arm/mach-at91/at91sam9261_devices.c | 6 +-
>> >> > arch/arm/mach-at91/at91sam9263_devices.c | 6 +-
>> >> > arch/arm/mach-at91/at91sam9g45_devices.c | 6 +-
>> >> > arch/arm/mach-at91/at91sam9rl_devices.c | 6 +-
>> >> > arch/arm/mach-at91/board-sam9261ek.c | 6 +-
>> >> > arch/arm/mach-at91/board-sam9263ek.c | 4 +-
>> >> > arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +-
>> >> > arch/arm/mach-at91/board-sam9rlek.c | 4 +-
>> >> > arch/arm/mach-at91/board.h | 4 +-
>> >> > arch/avr32/boards/atngw100/evklcd10x.c | 6 +-
>> >> > arch/avr32/boards/atngw100/mrmt.c | 4 +-
>> >> > arch/avr32/boards/atstk1000/atstk1000.h | 2 +-
>> >> > arch/avr32/boards/atstk1000/setup.c | 2 +-
>> >> > arch/avr32/boards/favr-32/setup.c | 2 +-
>> >> > arch/avr32/boards/hammerhead/setup.c | 2 +-
>> >> > arch/avr32/boards/merisc/display.c | 2 +-
>> >> > arch/avr32/boards/mimc200/setup.c | 4 +-
>> >> > arch/avr32/mach-at32ap/at32ap700x.c | 8 +--
>> >> > arch/avr32/mach-at32ap/include/mach/board.h | 4 +-
>> >> > drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++----------
>> >> > include/video/atmel_lcdc.h | 24 +------
>> >> > 21 files changed, 109 insertions(+), 101 deletions(-)
>> >> >
>> >> [snip]
>> >> > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
>> >> > index c1a2914..98733cd4 100644
>> >> > --- a/drivers/video/atmel_lcdfb.c
>> >> > +++ b/drivers/video/atmel_lcdfb.c
>> >> > @@ -20,12 +20,45 @@
>> >> > #include <linux/gfp.h>
>> >> > #include <linux/module.h>
>> >> > #include <linux/platform_data/atmel.h>
>> >> > +#include <video/of_display_timing.h>
>> >> >
>> >> > #include <mach/cpu.h>
>> >> > #include <asm/gpio.h>
>> >> >
>> >> > #include <video/atmel_lcdc.h>
>> >> >
>> >> > +struct atmel_lcdfb_config {
>> >> > + bool have_alt_pixclock;
>> >> > + bool have_hozval;
>> >> > + bool have_intensity_bit;
>> >> > +};
>> >> > +
>> >> > + /* LCD Controller info data structure, stored in device platform_data */
>> >> > +struct atmel_lcdfb_info {
>> >> > + spinlock_t lock;
>> >> > + struct fb_info *info;
>> >> > + void __iomem *mmio;
>> >> > + int irq_base;
>> >> > + struct work_struct task;
>> >> > +
>> >> > + unsigned int smem_len;
>> >> > + struct platform_device *pdev;
>> >> > + struct clk *bus_clk;
>> >> > + struct clk *lcdc_clk;
>> >> > +
>> >> > + struct backlight_device *backlight;
>> >> > + u8 bl_power;
>> >> > + bool lcdcon_pol_negative;
>> >> I think lcdcon_pol_negative should be part of pdata, because it really
>> >> depends on how the PWM is wired on the board.
>> >>
>> >
>> > maybe but no one mainline use it on any pdata for non-dt boars
>> > so I did not want to expose it
>> Well, at least, I'm using it :)
>> (and I guess that Andreas is using it also, otherwise he wouldn't have
>> introduce it !)
>
> yes but pdata is for non-dt boards, for dt you can keep it in struct
> atmel_lcdfb_info and add a property
>
> if non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
so I'll add something like
sinfo->lcdcon_pol_negative = of_property_read_bool(display_np,
"atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.c
But I thought the goal of this patch was to separate driver data from
platform specific data, and IMHO, lcdcon_pol_negative is a specificity
of the platform.
Best regards,
Richard.
^ permalink raw reply
* Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops
From: Jingoo Han @ 2013-05-30 0:32 UTC (permalink / raw)
To: 'Jean-Christophe PLAGNIOL-VILLARD',
'Michael Hennerich', 'Rafael J. Wysocki'
Cc: 'Lars-Peter Clausen', 'Tomi Valkeinen',
linux-fbdev, linux-pm, Jingoo Han
In-Reply-To: <20130529192013.GA19468@game.jcrosoft.org>
On Thursday, May 30, 2013 4:20 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 16:24 Wed 29 May , Michael Hennerich wrote:
> > On 05/29/2013 02:17 PM, Lars-Peter Clausen wrote:
> > >Use dev_pm_ops instead of the legacy suspend/resume callbacks.
> > >
> > >Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> > Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> > >---
> > > drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++--------
> > > 1 file changed, 14 insertions(+), 8 deletions(-)
> > >
> > >diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> > >index 29d8c04..6084c17 100644
> > >--- a/drivers/video/bfin-lq035q1-fb.c
> > >+++ b/drivers/video/bfin-lq035q1-fb.c
> > >@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > }
> > >-#ifdef CONFIG_PM
> > >-static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state)
> > >+#ifdef CONFIG_PM_SLEEP
> > >+static int lq035q1_spidev_suspend(struct device *dev)
> > > {
> > >+ struct spi_device *spi = to_spi_device(dev);
> > >+
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > }
> > >-static int lq035q1_spidev_resume(struct spi_device *spi)
> > >+static int lq035q1_spidev_resume(struct device *dev)
> > > {
> > >- int ret;
> > >+ struct spi_device *spi = to_spi_device(dev);
> > > struct spi_control *ctl = spi_get_drvdata(spi);
> > >+ int ret;
> > > ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
> > > if (ret)
> > >@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
> > > }
> > >+
> > >+static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
> > >+ lq035q1_spidev_resume);
> > >+#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
> > >+
> > > #else
> > >-# define lq035q1_spidev_suspend NULL
> > >-# define lq035q1_spidev_resume NULL
> > >+#define LQ035Q1_SPIDEV_PM_OPS NULL
> > > #endif
> we really need to ahve a macro like for DT of_match_ptr to drop the #else
Hi Jean-Christophe PLAGNIOL-VILLARD,
I submitted the following patch. :)
(https://patchwork.kernel.org/patch/2502971/)
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -55,8 +55,10 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+#define pm_ops_ptr(_ptr) (_ptr)
#else
#define power_group_name NULL
+#define pm_ops_ptr(_ptr) NULL
#endif
This patch was accepted by Rafael Wysocki, and will be merged to v3.11-rc1.
Best regards,
Jingoo Han
>
> I known it's related to this patch but someone should do it
>
> Rafael what do you think
>
> Best Regards,
> J.
> > > /* Power down all displays on reboot, poweroff or halt */
> > >@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
> > > info->spidrv.probe = lq035q1_spidev_probe;
> > > info->spidrv.remove = lq035q1_spidev_remove;
> > > info->spidrv.shutdown = lq035q1_spidev_shutdown;
> > >- info->spidrv.suspend = lq035q1_spidev_suspend;
> > >- info->spidrv.resume = lq035q1_spidev_resume;
> > >+ info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
> > > ret = spi_register_driver(&info->spidrv);
> > > if (ret < 0) {
> >
> >
> > --
> > Greetings,
> > Michael
> >
> > --
> > Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
> > Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> > Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
> > Margaret Seif
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops
From: Rafael J. Wysocki @ 2013-05-29 21:36 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: Michael Hennerich, Lars-Peter Clausen, Tomi Valkeinen,
linux-fbdev, linux-pm
In-Reply-To: <20130529192013.GA19468@game.jcrosoft.org>
On Wednesday, May 29, 2013 09:20:13 PM Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 16:24 Wed 29 May , Michael Hennerich wrote:
> > On 05/29/2013 02:17 PM, Lars-Peter Clausen wrote:
> > >Use dev_pm_ops instead of the legacy suspend/resume callbacks.
> > >
> > >Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> > Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> > >---
> > > drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++--------
> > > 1 file changed, 14 insertions(+), 8 deletions(-)
> > >
> > >diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> > >index 29d8c04..6084c17 100644
> > >--- a/drivers/video/bfin-lq035q1-fb.c
> > >+++ b/drivers/video/bfin-lq035q1-fb.c
> > >@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > }
> > >-#ifdef CONFIG_PM
> > >-static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state)
> > >+#ifdef CONFIG_PM_SLEEP
> > >+static int lq035q1_spidev_suspend(struct device *dev)
> > > {
> > >+ struct spi_device *spi = to_spi_device(dev);
> > >+
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
> > > }
> > >-static int lq035q1_spidev_resume(struct spi_device *spi)
> > >+static int lq035q1_spidev_resume(struct device *dev)
> > > {
> > >- int ret;
> > >+ struct spi_device *spi = to_spi_device(dev);
> > > struct spi_control *ctl = spi_get_drvdata(spi);
> > >+ int ret;
> > > ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
> > > if (ret)
> > >@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
> > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
> > > }
> > >+
> > >+static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
> > >+ lq035q1_spidev_resume);
> > >+#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
> > >+
> > > #else
> > >-# define lq035q1_spidev_suspend NULL
> > >-# define lq035q1_spidev_resume NULL
> > >+#define LQ035Q1_SPIDEV_PM_OPS NULL
> > > #endif
> we really need to ahve a macro like for DT of_match_ptr to drop the #else
>
> I known it's related to this patch but someone should do it
>
> Rafael what do you think
There's a patch adding something like that in the linux-next branch of my tree
(if I understand correctly what you mean).
Thanks,
Rafael
> > > /* Power down all displays on reboot, poweroff or halt */
> > >@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
> > > info->spidrv.probe = lq035q1_spidev_probe;
> > > info->spidrv.remove = lq035q1_spidev_remove;
> > > info->spidrv.shutdown = lq035q1_spidev_shutdown;
> > >- info->spidrv.suspend = lq035q1_spidev_suspend;
> > >- info->spidrv.resume = lq035q1_spidev_resume;
> > >+ info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
> > > ret = spi_register_driver(&info->spidrv);
> > > if (ret < 0) {
> >
> >
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply
* Re: [RFC] Add co-maintainer for fbdev
From: Andrew Morton @ 2013-05-29 20:53 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Arnd Bergmann', 'Florian Tobias Schandinat',
'Olof Johansson',
'Jean-Christophe PLAGNIOL-VILLARD', linux-fbdev,
'Linus Torvalds', linux-kernel, 'Tomi Valkeinen'
In-Reply-To: <002301ce5c0c$5552b650$fff822f0$@samsung.com>
On Wed, 29 May 2013 10:32:08 +0900 Jingoo Han <jg1.han@samsung.com> wrote:
> On Wednesday, May 29, 2013 6:20 AM, Arnd Bergmann wrote:
> > On Monday 27 May 2013, Florian Tobias Schandinat wrote:
> > > >> On Fri, May 24, 2013 at 8:38 AM, Jean-Christophe PLAGNIOL-VILLARD
> > > >> <plagnioj@jcrosoft.com> wrote:
> > > >>> Hi Florian,
> > > >>>
> > > >>> As you seems very busy I'd like to propose the help you to handle the
> > > >>> fbdev subsystem to easier the rich of the fbdev patch to Linus
> > > >>>
> > > >>> As I'm working on fbdev on at91 and others and already Co-Maintain the
> > > >>> at91 mach on ARM
> > > >>>
> > > >>> And if you are not willing to continue I could take over
> > >
> > > Yeah, it would be great if you could help, at the moment I get barely
> > > any sleep, let alone that I could keep up with the majority of mail I
> > > get. I'll let you decide whether you want to be sole maintainer or not.
> >
> > For any bigger subsystems, it's good practice to have two maintainers,
> > even if one of them does all the work. I think it makes sense to have
> > Jean-Christophe as the primary maintainer and owner of the git tree,
> > but it may also be good to have you or Tomi listed as a second maintainer
> > for times when Jean-Christophe isn't available.
>
> Hi Arnd,
>
> I agree with Arnd's opinion.
> It looks good to have Florian or Tomi listed as a second maintainer.
Someone send a patch!
^ permalink raw reply
* Re: [PATCH 1/8] video: atmel_lcdfb: fix platform data struct
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-29 19:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACQ1gAhhsMw1-Znd8BC=A0rJBrB4pphCtH9v9qOQR+j2dY3vCw@mail.gmail.com>
On 19:44 Wed 29 May , Richard Genoud wrote:
> 2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> > On 16:36 Wed 29 May , Richard Genoud wrote:
> >> 2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
> >> > Today we mix pdata and drivers data in the struct atmel_lcdfb_info
> >> > Fix it and introduce a new struct atmel_lcdfb_pdata for platform data only
> >> >
> >> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> > Cc: linux-fbdev@vger.kernel.org
> >> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> >> > Cc: Andrew Morton <akpm@linux-foundation.org>
> >> > Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> >> > ---
> >> > arch/arm/mach-at91/at91sam9261_devices.c | 6 +-
> >> > arch/arm/mach-at91/at91sam9263_devices.c | 6 +-
> >> > arch/arm/mach-at91/at91sam9g45_devices.c | 6 +-
> >> > arch/arm/mach-at91/at91sam9rl_devices.c | 6 +-
> >> > arch/arm/mach-at91/board-sam9261ek.c | 6 +-
> >> > arch/arm/mach-at91/board-sam9263ek.c | 4 +-
> >> > arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +-
> >> > arch/arm/mach-at91/board-sam9rlek.c | 4 +-
> >> > arch/arm/mach-at91/board.h | 4 +-
> >> > arch/avr32/boards/atngw100/evklcd10x.c | 6 +-
> >> > arch/avr32/boards/atngw100/mrmt.c | 4 +-
> >> > arch/avr32/boards/atstk1000/atstk1000.h | 2 +-
> >> > arch/avr32/boards/atstk1000/setup.c | 2 +-
> >> > arch/avr32/boards/favr-32/setup.c | 2 +-
> >> > arch/avr32/boards/hammerhead/setup.c | 2 +-
> >> > arch/avr32/boards/merisc/display.c | 2 +-
> >> > arch/avr32/boards/mimc200/setup.c | 4 +-
> >> > arch/avr32/mach-at32ap/at32ap700x.c | 8 +--
> >> > arch/avr32/mach-at32ap/include/mach/board.h | 4 +-
> >> > drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++----------
> >> > include/video/atmel_lcdc.h | 24 +------
> >> > 21 files changed, 109 insertions(+), 101 deletions(-)
> >> >
> >> [snip]
> >> > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> >> > index c1a2914..98733cd4 100644
> >> > --- a/drivers/video/atmel_lcdfb.c
> >> > +++ b/drivers/video/atmel_lcdfb.c
> >> > @@ -20,12 +20,45 @@
> >> > #include <linux/gfp.h>
> >> > #include <linux/module.h>
> >> > #include <linux/platform_data/atmel.h>
> >> > +#include <video/of_display_timing.h>
> >> >
> >> > #include <mach/cpu.h>
> >> > #include <asm/gpio.h>
> >> >
> >> > #include <video/atmel_lcdc.h>
> >> >
> >> > +struct atmel_lcdfb_config {
> >> > + bool have_alt_pixclock;
> >> > + bool have_hozval;
> >> > + bool have_intensity_bit;
> >> > +};
> >> > +
> >> > + /* LCD Controller info data structure, stored in device platform_data */
> >> > +struct atmel_lcdfb_info {
> >> > + spinlock_t lock;
> >> > + struct fb_info *info;
> >> > + void __iomem *mmio;
> >> > + int irq_base;
> >> > + struct work_struct task;
> >> > +
> >> > + unsigned int smem_len;
> >> > + struct platform_device *pdev;
> >> > + struct clk *bus_clk;
> >> > + struct clk *lcdc_clk;
> >> > +
> >> > + struct backlight_device *backlight;
> >> > + u8 bl_power;
> >> > + bool lcdcon_pol_negative;
> >> I think lcdcon_pol_negative should be part of pdata, because it really
> >> depends on how the PWM is wired on the board.
> >>
> >
> > maybe but no one mainline use it on any pdata for non-dt boars
> > so I did not want to expose it
> Well, at least, I'm using it :)
> (and I guess that Andreas is using it also, otherwise he wouldn't have
> introduce it !)
yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_info and add a property
if non-dt boards want it my answer is I do not care switch to DT
Best Regards,
J.
>
>
> Best regards,
> Richard.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox