* [PATCH 10/26] OMAPDSS: implement display sysfs without dss bus
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-1-git-send-email-tomi.valkeinen@ti.com>
We aim to remove the custom omapdss bus totally, as it's quite a strange
construct and won't be compatible with common display framework. One
problem on the road is that we have sysfs files for each display, and
they depend on the omapdss bus.
This patch creates the display sysfs files independent of the omapdss
bus. This gives us backwards compatibility without using the omapdss bus
for the sysfs files.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/apply.c | 15 ++--
drivers/video/omap2/dss/core.c | 28 -------
drivers/video/omap2/dss/display-sysfs.c | 125 ++++++++++++++++++-------------
drivers/video/omap2/dss/dss.h | 6 +-
4 files changed, 79 insertions(+), 95 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index a4b356a..44f94b8 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1569,7 +1569,6 @@ static DEFINE_MUTEX(compat_init_lock);
int omapdss_compat_init(void)
{
struct platform_device *pdev = dss_get_core_pdev();
- struct omap_dss_device *dssdev = NULL;
int i, r;
mutex_lock(&compat_init_lock);
@@ -1615,12 +1614,9 @@ int omapdss_compat_init(void)
if (r)
goto err_mgr_ops;
- for_each_dss_dev(dssdev) {
- r = display_init_sysfs(pdev, dssdev);
- /* XXX uninit sysfs files on error */
- if (r)
- goto err_disp_sysfs;
- }
+ r = display_init_sysfs(pdev);
+ if (r)
+ goto err_disp_sysfs;
dispc_runtime_get();
@@ -1637,6 +1633,7 @@ out:
err_init_irq:
dispc_runtime_put();
+ display_uninit_sysfs(pdev);
err_disp_sysfs:
dss_uninstall_mgr_ops();
@@ -1656,7 +1653,6 @@ EXPORT_SYMBOL(omapdss_compat_init);
void omapdss_compat_uninit(void)
{
struct platform_device *pdev = dss_get_core_pdev();
- struct omap_dss_device *dssdev = NULL;
mutex_lock(&compat_init_lock);
@@ -1665,8 +1661,7 @@ void omapdss_compat_uninit(void)
dss_dispc_uninitialize_irq();
- for_each_dss_dev(dssdev)
- display_uninit_sysfs(pdev, dssdev);
+ display_uninit_sysfs(pdev);
dss_uninstall_mgr_ops();
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5bdd442..054e980 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -287,37 +287,9 @@ static int dss_bus_match(struct device *dev, struct device_driver *driver)
return strcmp(dssdev->driver_name, driver->name) = 0;
}
-static ssize_t device_name_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct omap_dss_device *dssdev = to_dss_device(dev);
- return snprintf(buf, PAGE_SIZE, "%s\n",
- dssdev->name ?
- dssdev->name : "");
-}
-
-static struct device_attribute default_dev_attrs[] = {
- __ATTR(name, S_IRUGO, device_name_show, NULL),
- __ATTR_NULL,
-};
-
-static ssize_t driver_name_show(struct device_driver *drv, char *buf)
-{
- struct omap_dss_driver *dssdrv = to_dss_driver(drv);
- return snprintf(buf, PAGE_SIZE, "%s\n",
- dssdrv->driver.name ?
- dssdrv->driver.name : "");
-}
-static struct driver_attribute default_drv_attrs[] = {
- __ATTR(name, S_IRUGO, driver_name_show, NULL),
- __ATTR_NULL,
-};
-
static struct bus_type dss_bus_type = {
.name = "omapdss",
.match = dss_bus_match,
- .dev_attrs = default_dev_attrs,
- .drv_attrs = default_drv_attrs,
};
static void dss_bus_release(struct device *dev)
diff --git a/drivers/video/omap2/dss/display-sysfs.c b/drivers/video/omap2/dss/display-sysfs.c
index 18211a9..537921b 100644
--- a/drivers/video/omap2/dss/display-sysfs.c
+++ b/drivers/video/omap2/dss/display-sysfs.c
@@ -22,17 +22,40 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/jiffies.h>
#include <linux/platform_device.h>
+#include <linux/sysfs.h>
#include <video/omapdss.h>
#include "dss.h"
-#include "dss_features.h"
+
+static struct omap_dss_device *to_dss_device_sysfs(struct device *dev)
+{
+ struct omap_dss_device *dssdev = NULL;
+
+ for_each_dss_dev(dssdev) {
+ if (&dssdev->dev = dev) {
+ omap_dss_put_device(dssdev);
+ return dssdev;
+ }
+ }
+
+ return NULL;
+}
+
+static ssize_t display_name_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
+
+ return snprintf(buf, PAGE_SIZE, "%s\n",
+ dssdev->name ?
+ dssdev->name : "");
+}
static ssize_t display_enabled_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
bool enabled = dssdev->state != OMAP_DSS_DISPLAY_DISABLED;
return snprintf(buf, PAGE_SIZE, "%d\n", enabled);
@@ -42,7 +65,7 @@ static ssize_t display_enabled_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int r;
bool enabled;
@@ -66,7 +89,7 @@ static ssize_t display_enabled_store(struct device *dev,
static ssize_t display_tear_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
return snprintf(buf, PAGE_SIZE, "%d\n",
dssdev->driver->get_te ?
dssdev->driver->get_te(dssdev) : 0);
@@ -75,7 +98,7 @@ static ssize_t display_tear_show(struct device *dev,
static ssize_t display_tear_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int r;
bool te;
@@ -96,7 +119,7 @@ static ssize_t display_tear_store(struct device *dev,
static ssize_t display_timings_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
struct omap_video_timings t;
if (!dssdev->driver->get_timings)
@@ -113,7 +136,7 @@ static ssize_t display_timings_show(struct device *dev,
static ssize_t display_timings_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
struct omap_video_timings t = dssdev->panel.timings;
int r, found;
@@ -152,7 +175,7 @@ static ssize_t display_timings_store(struct device *dev,
static ssize_t display_rotate_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int rotate;
if (!dssdev->driver->get_rotate)
return -ENOENT;
@@ -163,7 +186,7 @@ static ssize_t display_rotate_show(struct device *dev,
static ssize_t display_rotate_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int rot, r;
if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
@@ -183,7 +206,7 @@ static ssize_t display_rotate_store(struct device *dev,
static ssize_t display_mirror_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int mirror;
if (!dssdev->driver->get_mirror)
return -ENOENT;
@@ -194,7 +217,7 @@ static ssize_t display_mirror_show(struct device *dev,
static ssize_t display_mirror_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
int r;
bool mirror;
@@ -215,7 +238,7 @@ static ssize_t display_mirror_store(struct device *dev,
static ssize_t display_wss_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
unsigned int wss;
if (!dssdev->driver->get_wss)
@@ -229,7 +252,7 @@ static ssize_t display_wss_show(struct device *dev,
static ssize_t display_wss_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_dss_device *dssdev = to_dss_device_sysfs(dev);
u32 wss;
int r;
@@ -250,6 +273,7 @@ static ssize_t display_wss_store(struct device *dev,
return size;
}
+static DEVICE_ATTR(name, S_IRUGO, display_name_show, NULL);
static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
display_enabled_show, display_enabled_store);
static DEVICE_ATTR(tear_elim, S_IRUGO|S_IWUSR,
@@ -263,59 +287,54 @@ static DEVICE_ATTR(mirror, S_IRUGO|S_IWUSR,
static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
display_wss_show, display_wss_store);
-static struct device_attribute *display_sysfs_attrs[] = {
- &dev_attr_enabled,
- &dev_attr_tear_elim,
- &dev_attr_timings,
- &dev_attr_rotate,
- &dev_attr_mirror,
- &dev_attr_wss,
+static const struct attribute *display_sysfs_attrs[] = {
+ &dev_attr_name.attr,
+ &dev_attr_enabled.attr,
+ &dev_attr_tear_elim.attr,
+ &dev_attr_timings.attr,
+ &dev_attr_rotate.attr,
+ &dev_attr_mirror.attr,
+ &dev_attr_wss.attr,
NULL
};
-int display_init_sysfs(struct platform_device *pdev,
- struct omap_dss_device *dssdev)
+int display_init_sysfs(struct platform_device *pdev)
{
- struct device_attribute *attr;
- int i, r;
+ struct omap_dss_device *dssdev = NULL;
+ int r;
- /* create device sysfs files */
- i = 0;
- while ((attr = display_sysfs_attrs[i++]) != NULL) {
- r = device_create_file(&dssdev->dev, attr);
- if (r) {
- for (i = i - 2; i >= 0; i--) {
- attr = display_sysfs_attrs[i];
- device_remove_file(&dssdev->dev, attr);
- }
+ for_each_dss_dev(dssdev) {
+ struct kobject *kobj = &dssdev->dev.kobj;
- DSSERR("failed to create sysfs file\n");
- return r;
+ r = sysfs_create_files(kobj, display_sysfs_attrs);
+ if (r) {
+ DSSERR("failed to create sysfs files\n");
+ goto err;
}
- }
- /* create display? sysfs links */
- r = sysfs_create_link(&pdev->dev.kobj, &dssdev->dev.kobj,
- dev_name(&dssdev->dev));
- if (r) {
- while ((attr = display_sysfs_attrs[i++]) != NULL)
- device_remove_file(&dssdev->dev, attr);
+ r = sysfs_create_link(&pdev->dev.kobj, kobj, dssdev->alias);
+ if (r) {
+ sysfs_remove_files(kobj, display_sysfs_attrs);
- DSSERR("failed to create sysfs display link\n");
- return r;
+ DSSERR("failed to create sysfs display link\n");
+ goto err;
+ }
}
return 0;
+
+err:
+ display_uninit_sysfs(pdev);
+
+ return r;
}
-void display_uninit_sysfs(struct platform_device *pdev,
- struct omap_dss_device *dssdev)
+void display_uninit_sysfs(struct platform_device *pdev)
{
- struct device_attribute *attr;
- int i = 0;
+ struct omap_dss_device *dssdev = NULL;
- sysfs_remove_link(&pdev->dev.kobj, dev_name(&dssdev->dev));
-
- while ((attr = display_sysfs_attrs[i++]) != NULL)
- device_remove_file(&dssdev->dev, attr);
+ for_each_dss_dev(dssdev) {
+ sysfs_remove_link(&pdev->dev.kobj, dssdev->alias);
+ sysfs_remove_files(&dssdev->dev.kobj, display_sysfs_attrs);
+ }
}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 5252423..d603a40 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -188,10 +188,8 @@ int dss_suspend_all_devices(void);
int dss_resume_all_devices(void);
void dss_disable_all_devices(void);
-int display_init_sysfs(struct platform_device *pdev,
- struct omap_dss_device *dssdev);
-void display_uninit_sysfs(struct platform_device *pdev,
- struct omap_dss_device *dssdev);
+int display_init_sysfs(struct platform_device *pdev);
+void display_uninit_sysfs(struct platform_device *pdev);
/* manager */
int dss_init_overlay_managers(struct platform_device *pdev);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 09/26] OMAPDSS: don't use dss bus in suspend/resume
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-1-git-send-email-tomi.valkeinen@ti.com>
We have support functions to suspend and resume all the displays that
are used with system suspend. These functions use the dss bus to iterate
the display devices.
As we aim to remove the custom dss bus totally, this patch removes the
explicit use of dss bus from these functions. Instead the
for_each_dss_dev() macro is used to go through the devices.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/display.c | 77 ++++++++++++++-----------------------
1 file changed, 28 insertions(+), 49 deletions(-)
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 50792bf..85e1cd3 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -76,74 +76,53 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev,
}
EXPORT_SYMBOL(omapdss_default_get_timings);
-static int dss_suspend_device(struct device *dev, void *data)
-{
- struct omap_dss_device *dssdev = to_dss_device(dev);
-
- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
- dssdev->activate_after_resume = false;
- return 0;
- }
-
- dssdev->driver->disable(dssdev);
-
- dssdev->activate_after_resume = true;
-
- return 0;
-}
-
int dss_suspend_all_devices(void)
{
- int r;
- struct bus_type *bus = dss_get_bus();
-
- r = bus_for_each_dev(bus, NULL, NULL, dss_suspend_device);
- if (r) {
- /* resume all displays that were suspended */
- dss_resume_all_devices();
- return r;
- }
-
- return 0;
-}
+ struct omap_dss_device *dssdev = NULL;
-static int dss_resume_device(struct device *dev, void *data)
-{
- int r;
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ for_each_dss_dev(dssdev) {
+ if (!dssdev->driver)
+ continue;
- if (dssdev->activate_after_resume) {
- r = dssdev->driver->enable(dssdev);
- if (r)
- return r;
+ if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE) {
+ dssdev->driver->disable(dssdev);
+ dssdev->activate_after_resume = true;
+ } else {
+ dssdev->activate_after_resume = false;
+ }
}
- dssdev->activate_after_resume = false;
-
return 0;
}
int dss_resume_all_devices(void)
{
- struct bus_type *bus = dss_get_bus();
-
- return bus_for_each_dev(bus, NULL, NULL, dss_resume_device);
-}
+ struct omap_dss_device *dssdev = NULL;
-static int dss_disable_device(struct device *dev, void *data)
-{
- struct omap_dss_device *dssdev = to_dss_device(dev);
+ for_each_dss_dev(dssdev) {
+ if (!dssdev->driver)
+ continue;
- if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)
- dssdev->driver->disable(dssdev);
+ if (dssdev->activate_after_resume) {
+ dssdev->driver->enable(dssdev);
+ dssdev->activate_after_resume = false;
+ }
+ }
return 0;
}
void dss_disable_all_devices(void)
{
- struct bus_type *bus = dss_get_bus();
- bus_for_each_dev(bus, NULL, NULL, dss_disable_device);
+ struct omap_dss_device *dssdev = NULL;
+
+ for_each_dss_dev(dssdev) {
+ if (!dssdev->driver)
+ continue;
+
+ if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE)
+ dssdev->driver->disable(dssdev);
+ }
}
static LIST_HEAD(panel_list);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 08/26] OMAPDSS: use the panel list in omap_dss_get_next_device
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-1-git-send-email-tomi.valkeinen@ti.com>
omap_dss_get_next_device() uses the dss bus to iterate over the
displays. This patch changes omap_dss_get_next_device() to use the new
panel list instead.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/display.c | 63 +++++++++++++++++++++++++++----------
1 file changed, 46 insertions(+), 17 deletions(-)
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index e785694..50792bf 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -189,27 +189,51 @@ void omap_dss_put_device(struct omap_dss_device *dssdev)
}
EXPORT_SYMBOL(omap_dss_put_device);
-/* ref count of the found device is incremented. ref count
- * of from-device is decremented. */
+/*
+ * ref count of the found device is incremented.
+ * ref count of from-device is decremented.
+ */
struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)
{
- struct device *dev;
- struct device *dev_start = NULL;
- struct omap_dss_device *dssdev = NULL;
+ struct list_head *l;
+ struct omap_dss_device *dssdev;
+
+ mutex_lock(&panel_list_mutex);
+
+ if (list_empty(&panel_list)) {
+ dssdev = NULL;
+ goto out;
+ }
- int match(struct device *dev, void *data)
- {
- return 1;
+ if (from = NULL) {
+ dssdev = list_first_entry(&panel_list, struct omap_dss_device,
+ panel_list);
+ omap_dss_get_device(dssdev);
+ goto out;
}
- if (from)
- dev_start = &from->dev;
- dev = bus_find_device(dss_get_bus(), dev_start, NULL, match);
- if (dev)
- dssdev = to_dss_device(dev);
- if (from)
- put_device(&from->dev);
+ omap_dss_put_device(from);
+
+ list_for_each(l, &panel_list) {
+ dssdev = list_entry(l, struct omap_dss_device, panel_list);
+ if (dssdev = from) {
+ if (list_is_last(l, &panel_list)) {
+ dssdev = NULL;
+ goto out;
+ }
+
+ dssdev = list_entry(l->next, struct omap_dss_device,
+ panel_list);
+ omap_dss_get_device(dssdev);
+ goto out;
+ }
+ }
+
+ WARN(1, "'from' dssdev not found\n");
+ dssdev = NULL;
+out:
+ mutex_unlock(&panel_list_mutex);
return dssdev;
}
EXPORT_SYMBOL(omap_dss_get_next_device);
@@ -219,12 +243,17 @@ struct omap_dss_device *omap_dss_find_device(void *data,
{
struct omap_dss_device *dssdev = NULL;
+ mutex_lock(&panel_list_mutex);
+
while ((dssdev = omap_dss_get_next_device(dssdev)) != NULL) {
if (match(dssdev, data))
- return dssdev;
+ goto out;
}
- return NULL;
+ dssdev = NULL;
+out:
+ mutex_unlock(&panel_list_mutex);
+ return dssdev;
}
EXPORT_SYMBOL(omap_dss_find_device);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 07/26] OMAPDSS: add panel list
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-1-git-send-email-tomi.valkeinen@ti.com>
We currently use the omapdss bus (which contains all the available
displays) to iterate the displays. As the omapdss bus is on its way out,
this needs to be changed.
Instead of using the dss bus to iterate displays, this patch adds our
own list of displays which we manage. The panels on the dss bus are
automatically added to this new list.
An "alias" field is also added to omap_dss_device. This field is
set to "display%d", the same way as omap_dss_device's dev name is set.
This alias is later used to keep backward compatibility, when the
embedded dev is no longer used.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/core.c | 2 ++
drivers/video/omap2/dss/display.c | 30 ++++++++++++++++++++++++++++++
drivers/video/omap2/dss/dss.h | 3 +++
include/video/omapdss.h | 5 +++++
4 files changed, 40 insertions(+)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index a9bab9f..5bdd442 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -428,6 +428,7 @@ struct omap_dss_device *dss_alloc_and_init_device(struct device *parent)
int dss_add_device(struct omap_dss_device *dssdev)
{
+ dss_add_panel(dssdev);
return device_add(&dssdev->dev);
}
@@ -439,6 +440,7 @@ void dss_put_device(struct omap_dss_device *dssdev)
void dss_unregister_device(struct omap_dss_device *dssdev)
{
device_unregister(&dssdev->dev);
+ dss_remove_panel(dssdev);
}
static int dss_unregister_dss_dev(struct device *dev, void *data)
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 0aa8ad8..e785694 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -146,6 +146,36 @@ void dss_disable_all_devices(void)
bus_for_each_dev(bus, NULL, NULL, dss_disable_device);
}
+static LIST_HEAD(panel_list);
+static DEFINE_MUTEX(panel_list_mutex);
+static int disp_num_counter;
+
+int dss_add_panel(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_driver *drv = dssdev->driver;
+
+ snprintf(dssdev->alias, sizeof(dssdev->alias),
+ "display%d", disp_num_counter++);
+
+ if (drv && drv->get_resolution = NULL)
+ drv->get_resolution = omapdss_default_get_resolution;
+ if (drv && drv->get_recommended_bpp = NULL)
+ drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
+ if (drv && drv->get_timings = NULL)
+ drv->get_timings = omapdss_default_get_timings;
+
+ mutex_lock(&panel_list_mutex);
+ list_add_tail(&dssdev->panel_list, &panel_list);
+ mutex_unlock(&panel_list_mutex);
+ return 0;
+}
+
+void dss_remove_panel(struct omap_dss_device *dssdev)
+{
+ mutex_lock(&panel_list_mutex);
+ list_del(&dssdev->panel_list);
+ mutex_unlock(&panel_list_mutex);
+}
void omap_dss_get_device(struct omap_dss_device *dssdev)
{
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index faaf358..5252423 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -489,4 +489,7 @@ static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr)
}
#endif
+int dss_add_panel(struct omap_dss_device *dssdev);
+void dss_remove_panel(struct omap_dss_device *dssdev);
+
#endif
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 7fe6144..ab4ea37 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -596,6 +596,11 @@ struct omap_dss_output {
struct omap_dss_device {
struct device dev;
+ struct list_head panel_list;
+
+ /* alias in the form of "display%d" */
+ char alias[16];
+
enum omap_display_type type;
/* obsolete, to be removed */
--
1.7.10.4
^ permalink raw reply related
* [PATCH 06/26] OMAPDSS: SDI: fix regulators
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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 0155c7e..607244a 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 __init 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;
@@ -359,6 +368,8 @@ static void __exit sdi_uninit_output(struct platform_device *pdev)
static int __init omap_sdi_probe(struct platform_device *pdev)
{
+ sdi.pdev = pdev;
+
sdi_init_output(pdev);
if (pdev->dev.platform_data)
@@ -373,6 +384,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.7.10.4
^ permalink raw reply related
* [PATCH 05/26] OMAPDSS: DPI: fix regulators
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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 ad67a9c..08342d1 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 __init 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;
@@ -698,6 +706,8 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
static int __init omap_dpi_probe(struct platform_device *pdev)
{
+ dpi.pdev = pdev;
+
mutex_init(&dpi.lock);
dpi_init_output(pdev);
@@ -714,6 +724,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.7.10.4
^ permalink raw reply related
* [PATCH 04/26] OMAPDSS: fix dss_get_ctx_loss_count for DT
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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, change 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 fdd32e8..62db201 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.7.10.4
^ permalink raw reply related
* [PATCH 03/26] OMAPDSS: add omap_dss_find_output_by_node()
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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.7.10.4
^ permalink raw reply related
* [PATCH 02/26] OMAPDSS: add omap_dss_find_output()
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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.7.10.4
^ permalink raw reply related
* [PATCH 01/26] OMAPDSS: only probe pdata if there's one
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen
In-Reply-To: <1364304836-18134-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 | 3 ++-
drivers/video/omap2/dss/dsi.c | 3 ++-
drivers/video/omap2/dss/hdmi.c | 3 ++-
drivers/video/omap2/dss/rfbi.c | 3 ++-
drivers/video/omap2/dss/sdi.c | 3 ++-
drivers/video/omap2/dss/venc.c | 3 ++-
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index abe1a4e2..ad67a9c 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -702,7 +702,8 @@ static int __init omap_dpi_probe(struct platform_device *pdev)
dpi_init_output(pdev);
- dpi_probe_pdata(pdev);
+ if (pdev->dev.platform_data)
+ dpi_probe_pdata(pdev);
return 0;
}
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 8db29bf..ddb8bf6 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5573,7 +5573,8 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
dsi_init_output(dsidev);
- dsi_probe_pdata(dsidev);
+ if (dsidev->dev.platform_data)
+ dsi_probe_pdata(dsidev);
dsi_runtime_put(dsidev);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a6f9538..4b32dd3 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1102,7 +1102,8 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
- hdmi_probe_pdata(pdev);
+ if (pdev->dev.platform_data)
+ hdmi_probe_pdata(pdev);
return 0;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 1a691bb..946c415 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1091,7 +1091,8 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev)
rfbi_init_output(pdev);
- rfbi_probe_pdata(pdev);
+ if (pdev->dev.platform_data)
+ rfbi_probe_pdata(pdev);
return 0;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index e6baee2..0155c7e 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -361,7 +361,8 @@ static int __init omap_sdi_probe(struct platform_device *pdev)
{
sdi_init_output(pdev);
- sdi_probe_pdata(pdev);
+ if (pdev->dev.platform_data)
+ sdi_probe_pdata(pdev);
return 0;
}
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 5cb983e..f5e8a5b 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -879,7 +879,8 @@ static int __init omap_venchw_probe(struct platform_device *pdev)
venc_init_output(pdev);
- venc_probe_pdata(pdev);
+ if (pdev->dev.platform_data)
+ venc_probe_pdata(pdev);
return 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 00/26] DSS device model change
From: Tomi Valkeinen @ 2013-03-26 13:33 UTC (permalink / raw)
To: linux-omap, linux-fbdev, Archit Taneja; +Cc: Tomi Valkeinen, Tony Lindgren
Hi,
To make it possible to add DT support to DSS, and later use the Common Display
Framework, we need to change the DSS device model. We currently have a custom
dss bus, and omap_dss_devices on that bus, and the aim is to get rid of that
bus.
The panel devices will be converted occording to the control bus of the panel.
For many panels this means that the panel device will become a platform_device.
For some, it means the panel devices become i2c or spi devices.
This series takes the first step toward that goal. This series:
* Converts DPI, HDMI and DSI outputs to work with new style panels
* Converts TFP410, Taal and generic-dpi panels to new model
* Converts Panda, 4430SDP and Overo boards to use the new panels
The non-converted outputs and panels still work, so they can be converted in
stages.
Note about board files: I only convert a few board files here for example. I
have a branch with board file changes for all the affected board files. I did
not include them as they are more or less identical. If this series looks good,
I will create an independent branch for the arch/arm stuff, so it can be pulled
separately.
This series can also be found from:
git://gitorious.org/linux-omap-dss2/linux.git work/dss-dev-model-review
Tomi
Tomi Valkeinen (26):
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
OMAPDSS: SDI: fix regulators
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: DPI: new panel registration
OMAPDSS: DSI: new panel registration
OMAPDSS: HDMI: new panel registration
OMAPDSS: TFP410 platform_data changes
OMAPDSS: TFP410: convert to platform device
OMAPDSS: generic-dpi-panel platform_data changes
OMAPDSS: panel-generic-dpi: convert to platform device
OMAPDSS: HDMI: convert to platform device
OMAPDSS: Taal platform_data changes
OMAPDSS: Taal: convert to platform device
ARM: OMAP: Panda: use new TFP410 platform driver
ARM: OMAP: Panda & SDP: use new HDMI driver
ARM: OMAP: 4430SDP: use new Taal driver
ARM: OMAP: Overo: use new TFP410 platform driver
ARM: OMAP: Overo: use new generic-dpi-panel platform driver
arch/arm/mach-omap2/board-overo.c | 95 +++----
arch/arm/mach-omap2/dss-common.c | 96 +++----
drivers/video/omap2/displays/panel-generic-dpi.c | 141 +++++++----
drivers/video/omap2/displays/panel-taal.c | 294 +++++++++++++---------
drivers/video/omap2/displays/panel-tfp410.c | 205 +++++++++------
drivers/video/omap2/dss/apply.c | 15 +-
drivers/video/omap2/dss/core.c | 32 +--
drivers/video/omap2/dss/display-sysfs.c | 126 ++++++----
drivers/video/omap2/dss/display.c | 166 +++++++-----
drivers/video/omap2/dss/dpi.c | 59 ++++-
drivers/video/omap2/dss/dsi.c | 58 ++++-
drivers/video/omap2/dss/dss.c | 3 +-
drivers/video/omap2/dss/dss.h | 11 +-
drivers/video/omap2/dss/hdmi.c | 44 +++-
drivers/video/omap2/dss/hdmi_panel.c | 48 +++-
drivers/video/omap2/dss/output.c | 26 ++
drivers/video/omap2/dss/rfbi.c | 3 +-
drivers/video/omap2/dss/sdi.c | 23 +-
drivers/video/omap2/dss/venc.c | 3 +-
include/video/omap-panel-generic-dpi.h | 3 +
include/video/omap-panel-nokia-dsi.h | 1 +
include/video/omap-panel-tfp410.h | 5 +
include/video/omapdss.h | 16 ++
23 files changed, 940 insertions(+), 533 deletions(-)
--
1.7.10.4
^ permalink raw reply
* Re: [PATCH v2] fbdev: sh_mobile_lcdc: fixup B side hsync adjust settings
From: Simon Horman @ 2013-03-26 13:19 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <87txoqmo3p.wl%kuninori.morimoto.gx@renesas.com>
On Mon, Mar 25, 2013 at 12:33:52AM -0700, Kuninori Morimoto wrote:
>
> Hi Laurent, Simon,
>
> > > > On Monday 04 March 2013 21:07:10 Kuninori Morimoto wrote:
> > > > > The lcdc B side horizon output is shifted
> > > > > if sh_mobile_lcdc_pan() was called.
> > > > > This patch fixup this issue.
> > > > > It is tested on R8A7740 Armadillo800eva HDMI output.
> > > > > Special thanks to Fukushima-san, and Sano-san
> > > > >
> > > > > Reported-by: Osamu Fukushima <osamu.fukushima.wr@renesas.com>
> > > > > Signed-off-by: Hideyuki Sano <hideyuki.sano.dn@renesas.com>
> > > > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > > >
> > > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >
> > > Laurent, can you handle getting this merged?
> > > If not, please let me know who to prod.
> >
> > We have no fbdev maintainer anymore. Can this be pushed through your tree ?
>
> Could you please teach me current status of this patch ?
Sorry, I have been a bit slow and haven't applied it yet.
I plan to do so shortly.
^ permalink raw reply
* Re: Submitting fbdev tree patches
From: Tony Prisk @ 2013-03-26 6:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <25978865.106801364189231752.JavaMail.weblogic@epv6ml06>
On Mon, 2013-03-25 at 05:27 +0000, Jingoo Han wrote:
> On Monday, March 25, 2013 2:11 PM, Tony Prisk wrote:
> >
> > Is anyone taking patches for fbdev at the moment?
> >
> > I sent in some patches for 3.9 but didn't hear back - checking the lists
> > it doesn't appear Florian has posted much since the end of Oct 2012.
>
> CC'ed Tomi Valkeinen, Andrew Morton
>
>
> Hi Tony Prisk,
>
> Tomy Valkeien will take care of fbdev fixes for 3.9.
> (http://www.spinics.net/lists/linux-fbdev/msg10243.html)
>
> How about sending a pull request to Tomy?
>
> Best regards,
> Jingoo Han
>
> >
> > Regards
> > Tony Prisk
> >
These are not fixes but new features/changes for 3.10 - I don't want to
create too much work for someone. Any idea when Florian will be back on
board?
Regards
Ton
^ permalink raw reply
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Jingoo Han @ 2013-03-25 23:39 UTC (permalink / raw)
To: 'Mark Brown'
Cc: 'Andrew Morton', 'Guennadi Liakhovetski',
linux-kernel, 'Magnus Damm', 'Simon Horman',
devicetree-discuss, 'Samuel Ortiz',
'Richard Purdie', linux-fbdev,
'Guennadi Liakhovetski', 'Jingoo Han'
In-Reply-To: <20130325101442.GJ18316@opensource.wolfsonmicro.com>
On Monday, March 25, 2013 7:15 PM, Mark Brown wrote:
>
> On Mon, Mar 25, 2013 at 02:12:21PM +0900, Jingoo Han wrote:
> > On Saturday, March 23, 2013 1:16 AM, Guennadi Liakhovetski wrote:
>
> > But, there is a typo in comment.
> > > + * At least one su2-auto-curr* must be specified iff
> > s/iff/if
>
> Are you sure that's a typo? "Iff" is a bit of mathematical jargon
> which means "if and only if" that's fairly often used in a computing
> context.
Oh, it's my mistake.
'xor' is used; thus, it is not a typo.
Thank you for your comment.
Best regards,
Jingoo Han
^ permalink raw reply
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Ryan Mallon @ 2013-03-25 23:09 UTC (permalink / raw)
To: Andrew Morton
Cc: Guennadi Liakhovetski, linux-kernel, Mark Brown, Magnus Damm,
Simon Horman, devicetree-discuss, Samuel Ortiz, Richard Purdie,
linux-fbdev, Guennadi Liakhovetski
In-Reply-To: <20130325154046.82d9337f25cec12b9fa03625@linux-foundation.org>
On 26/03/13 09:40, Andrew Morton wrote:
> On Fri, 22 Mar 2013 17:15:49 +0100 Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>
>> Add support for configuring AS3711 backlight driver from DT.
>>
>> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
>> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>> ---
>> drivers/video/backlight/as3711_bl.c | 118 ++++++++++++++++++++++++++++++++++-
>> 1 files changed, 117 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c
>> index 41d52fe..123887c 100644
>> --- a/drivers/video/backlight/as3711_bl.c
>> +++ b/drivers/video/backlight/as3711_bl.c
>> @@ -258,6 +258,109 @@ static int as3711_bl_register(struct platform_device *pdev,
>> return 0;
>> }
>>
>> +static int as3711_backlight_parse_dt(struct device *dev)
>> +{
>> + struct as3711_bl_pdata *pdata = dev_get_platdata(dev);
>> + struct device_node *bl >> + of_find_node_by_name(dev->parent->of_node, "backlight"), *fb;
>> + int ret;
>
> It's tidier to do
>
> struct device_node *bl;
>
> bl = of_find_node_by_name(dev->parent->of_node, "backlight"), *fb;
>
> and avoid the 80-col trickery.
The other reason being that it now becomes much more apparent that *fb
is not an argument to of_find_node_by_name(), but a second variable of
type struct device_node :-).
~Ryan
^ permalink raw reply
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Andrew Morton @ 2013-03-25 22:40 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: linux-kernel, Mark Brown, Magnus Damm, Simon Horman,
devicetree-discuss, Samuel Ortiz, Richard Purdie, linux-fbdev,
Guennadi Liakhovetski
In-Reply-To: <1363968949-12151-4-git-send-email-g.liakhovetski@gmx.de>
On Fri, 22 Mar 2013 17:15:49 +0100 Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Add support for configuring AS3711 backlight driver from DT.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/video/backlight/as3711_bl.c | 118 ++++++++++++++++++++++++++++++++++-
> 1 files changed, 117 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c
> index 41d52fe..123887c 100644
> --- a/drivers/video/backlight/as3711_bl.c
> +++ b/drivers/video/backlight/as3711_bl.c
> @@ -258,6 +258,109 @@ static int as3711_bl_register(struct platform_device *pdev,
> return 0;
> }
>
> +static int as3711_backlight_parse_dt(struct device *dev)
> +{
> + struct as3711_bl_pdata *pdata = dev_get_platdata(dev);
> + struct device_node *bl > + of_find_node_by_name(dev->parent->of_node, "backlight"), *fb;
> + int ret;
It's tidier to do
struct device_node *bl;
bl = of_find_node_by_name(dev->parent->of_node, "backlight"), *fb;
and avoid the 80-col trickery.
> + if (!bl) {
> + dev_dbg(dev, "backlight node not found\n");
> + return -ENODEV;
> + }
> +
> + fb = of_parse_phandle(bl, "su1-dev", 0);
> + if (fb) {
> + pdata->su1_fb = fb->full_name;
> +
> + ret = of_property_read_u32(bl, "su1-max-uA", &pdata->su1_max_uA);
> + if (pdata->su1_max_uA <= 0)
> + ret = -EINVAL;
> + if (ret < 0)
> + return ret;
> + }
> +
> + fb = of_parse_phandle(bl, "su2-dev", 0);
> + if (fb) {
> + int count = 0;
> +
> + pdata->su2_fb = fb->full_name;
> +
> + ret = of_property_read_u32(bl, "su2-max-uA", &pdata->su2_max_uA);
> + if (pdata->su2_max_uA <= 0)
> + ret = -EINVAL;
> + if (ret < 0)
> + return ret;
> +
> + if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_VOLTAGE;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR1;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR2;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR3;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
> + count++;
> + }
> + if (count != 1)
> + return -EINVAL;
This looks odd. If the firmware provides both su2-feedback-voltage and
su2-feedback-curr1, we fail? Firmware developers are notoriously
flakey - can the code be more defensive here?
> + count = 0;
> + if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_LX_SD4;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO2;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO3;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO4;
> + count++;
> + }
> + if (count != 1)
> + return -EINVAL;
> +
> + count = 0;
> + if (of_find_property(bl, "su2-auto-curr1", NULL)) {
> + pdata->su2_auto_curr1 = true;
> + count++;
> + }
> + if (of_find_property(bl, "su2-auto-curr2", NULL)) {
> + pdata->su2_auto_curr2 = true;
> + count++;
> + }
> + if (of_find_property(bl, "su2-auto-curr3", NULL)) {
> + pdata->su2_auto_curr3 = true;
> + count++;
> + }
> +
> + /*
> + * At least one su2-auto-curr* must be specified iff
> + * AS3711_SU2_CURR_AUTO is used
> + */
> + if (!count ^ (pdata->su2_feedback != AS3711_SU2_CURR_AUTO))
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
>
> ...
>
^ permalink raw reply
* [PATCH] MIPS: remove obsolete Kconfig macros
From: Paul Bolle @ 2013-03-25 21:27 UTC (permalink / raw)
To: Ralf Baechle, Florian Tobias Schandinat
Cc: linux-mips, linux-fbdev, linux-kernel
The support for PB1100, PB1500, and PB1550 got merged into the code for
DB1000 and DB1550 code in v3.7. When that was done the three related
Kconfig symbols were dropped. But not all related Kconfig macros were
removed. Do so now.
Note that the PB1100 code in the Au1100 LCD driver is removed entirely
and not converted to use its current Kconfig macro. That is done because
the macros it uses (PB1100_G_CONTROL, PB1100_G_CONTROL_BL, and
PB1100_G_CONTROL_VDD) are never defined. Actually only one of these was
ever defined (PB1100_G_CONTROL) but that define was removed in v2.6.34.
So, as far as I can tell, this code could have never compiled.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
None of this is tested.
arch/mips/alchemy/Platform | 22 ++--------------------
drivers/video/au1100fb.c | 22 ++++------------------
2 files changed, 6 insertions(+), 38 deletions(-)
diff --git a/arch/mips/alchemy/Platform b/arch/mips/alchemy/Platform
index fa1bdd1..b3afcdd 100644
--- a/arch/mips/alchemy/Platform
+++ b/arch/mips/alchemy/Platform
@@ -5,32 +5,14 @@ platform-$(CONFIG_MIPS_ALCHEMY) += alchemy/common/
#
-# AMD Alchemy Pb1100 eval board
-#
-platform-$(CONFIG_MIPS_PB1100) += alchemy/devboards/
-load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000
-
-#
-# AMD Alchemy Pb1500 eval board
-#
-platform-$(CONFIG_MIPS_PB1500) += alchemy/devboards/
-load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000
-
-#
-# AMD Alchemy Pb1550 eval board
-#
-platform-$(CONFIG_MIPS_PB1550) += alchemy/devboards/
-load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000
-
-#
-# AMD Alchemy Db1000/Db1500/Db1100 eval boards
+# AMD Alchemy Db1000/Db1500/Pb1500/Db1100/Pb1100 eval boards
#
platform-$(CONFIG_MIPS_DB1000) += alchemy/devboards/
cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000
#
-# AMD Alchemy Db1200/Pb1200/Db1550/Db1300 eval boards
+# AMD Alchemy Db1200/Pb1200/Db1550/Pb1550/Db1300 eval boards
#
platform-$(CONFIG_MIPS_DB1235) += alchemy/devboards/
cflags-$(CONFIG_MIPS_DB1235) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index ddabaa8..700cac0 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -111,30 +111,16 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
switch (blank_mode) {
case VESA_NO_BLANKING:
- /* Turn on panel */
- fbdev->regs->lcd_control |= LCD_CONTROL_GO;
-#ifdef CONFIG_MIPS_PB1100
- if (fbdev->panel_idx = 1) {
- au_writew(au_readw(PB1100_G_CONTROL)
- | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
- PB1100_G_CONTROL);
- }
-#endif
+ /* Turn on panel */
+ fbdev->regs->lcd_control |= LCD_CONTROL_GO;
au_sync();
break;
case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case VESA_POWERDOWN:
- /* Turn off panel */
- fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
-#ifdef CONFIG_MIPS_PB1100
- if (fbdev->panel_idx = 1) {
- au_writew(au_readw(PB1100_G_CONTROL)
- & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
- PB1100_G_CONTROL);
- }
-#endif
+ /* Turn off panel */
+ fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
au_sync();
break;
default:
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Guennadi Liakhovetski @ 2013-03-25 10:52 UTC (permalink / raw)
To: Mark Brown
Cc: Jingoo Han, 'Andrew Morton', linux-kernel,
'Magnus Damm', 'Simon Horman', devicetree-discuss,
'Samuel Ortiz', 'Richard Purdie', linux-fbdev
In-Reply-To: <20130325101442.GJ18316@opensource.wolfsonmicro.com>
On Mon, 25 Mar 2013, Mark Brown wrote:
> On Mon, Mar 25, 2013 at 02:12:21PM +0900, Jingoo Han wrote:
> > On Saturday, March 23, 2013 1:16 AM, Guennadi Liakhovetski wrote:
>
> > But, there is a typo in comment.
> > > + * At least one su2-auto-curr* must be specified iff
> > s/iff/if
>
> Are you sure that's a typo? "Iff" is a bit of mathematical jargon
> which means "if and only if" that's fairly often used in a computing
> context.
Thanks, Mark, that's exactly what I was trying to say there :)
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Mark Brown @ 2013-03-25 10:14 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA, 'Samuel Ortiz',
'Guennadi Liakhovetski',
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, 'Magnus Damm',
linux-kernel-u79uwXL29TY76Z2rM5mHXA, 'Simon Horman',
'Richard Purdie', 'Andrew Morton',
'Guennadi Liakhovetski'
In-Reply-To: <00da01ce2917$54856ce0$fd9046a0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
On Mon, Mar 25, 2013 at 02:12:21PM +0900, Jingoo Han wrote:
> On Saturday, March 23, 2013 1:16 AM, Guennadi Liakhovetski wrote:
> But, there is a typo in comment.
> > + * At least one su2-auto-curr* must be specified iff
> s/iff/if
Are you sure that's a typo? "Iff" is a bit of mathematical jargon
which means "if and only if" that's fairly often used in a computing
context.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe()
From: Michael Hennerich @ 2013-03-25 8:41 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <CAPgLHd-wxGVKjMpWPDeKqWM+Va6dLnu_spwyb=QUybxjOo=AWA@mail.gmail.com>
On 03/22/2013 12:30 PM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/video/backlight/adp8860_bl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
> index 6bb7f36..75b10f8 100644
> --- a/drivers/video/backlight/adp8860_bl.c
> +++ b/drivers/video/backlight/adp8860_bl.c
> @@ -249,12 +249,14 @@ static int adp8860_led_probe(struct i2c_client *client)
> if (led_dat->id > 7 || led_dat->id < 1) {
> dev_err(&client->dev, "Invalid LED ID %d\n",
> led_dat->id);
> + ret = -EINVAL;
> goto err;
> }
>
> if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) {
> dev_err(&client->dev, "LED %d used by Backlight\n",
> led_dat->id);
> + ret = -EBUSY;
> goto err;
> }
>
>
>
>
--
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
^ permalink raw reply
* Re: [PATCH v2] fbdev: sh_mobile_lcdc: fixup B side hsync adjust settings
From: Kuninori Morimoto @ 2013-03-25 7:33 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <87txoqmo3p.wl%kuninori.morimoto.gx@renesas.com>
Hi Laurent, Simon,
> > > On Monday 04 March 2013 21:07:10 Kuninori Morimoto wrote:
> > > > The lcdc B side horizon output is shifted
> > > > if sh_mobile_lcdc_pan() was called.
> > > > This patch fixup this issue.
> > > > It is tested on R8A7740 Armadillo800eva HDMI output.
> > > > Special thanks to Fukushima-san, and Sano-san
> > > >
> > > > Reported-by: Osamu Fukushima <osamu.fukushima.wr@renesas.com>
> > > > Signed-off-by: Hideyuki Sano <hideyuki.sano.dn@renesas.com>
> > > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > >
> > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Laurent, can you handle getting this merged?
> > If not, please let me know who to prod.
>
> We have no fbdev maintainer anymore. Can this be pushed through your tree ?
Could you please teach me current status of this patch ?
Best regards
---
Kuninori Morimoto
^ permalink raw reply
* Re: Submitting fbdev tree patches
From: Jingoo Han @ 2013-03-25 5:27 UTC (permalink / raw)
To: Tony Prisk
Cc: linux-fbdev@vger.kernel.org, FlorianSchandinat@gmx.de,
linux-kernel@vger.kernel.org, Arm Kernel Mailing List,
tomi.valkeinen, akpm@linux-foundation.org, Jingoo Han
In-Reply-To: <1364188287.25442.4.camel@gitbox>
T24gTW9uZGF5LCBNYXJjaCAyNSwgMjAxMyAyOjExIFBNLCBUb255IFByaXNrIHdyb3RlOg0KPiAN
Cj4gSXMgYW55b25lIHRha2luZyBwYXRjaGVzIGZvciBmYmRldiBhdCB0aGUgbW9tZW50Pw0KPiAN
Cj4gSSBzZW50IGluIHNvbWUgcGF0Y2hlcyBmb3IgMy45IGJ1dCBkaWRuJ3QgaGVhciBiYWNrIC0g
Y2hlY2tpbmcgdGhlIGxpc3RzDQo+IGl0IGRvZXNuJ3QgYXBwZWFyIEZsb3JpYW4gaGFzIHBvc3Rl
ZCBtdWNoIHNpbmNlIHRoZSBlbmQgb2YgT2N0IDIwMTIuDQoNCkNDJ2VkIFRvbWkgVmFsa2VpbmVu
LCBBbmRyZXcgTW9ydG9uDQoNCg0KSGkgVG9ueSBQcmlzaywNCg0KVG9teSBWYWxrZWllbiB3aWxs
IHRha2UgY2FyZSBvZiBmYmRldiBmaXhlcyBmb3IgMy45Lg0KKGh0dHA6Ly93d3cuc3Bpbmljcy5u
ZXQvbGlzdHMvbGludXgtZmJkZXYvbXNnMTAyNDMuaHRtbCkNCg0KSG93IGFib3V0IHNlbmRpbmcg
YSBwdWxsIHJlcXVlc3QgdG8gVG9teT8NCg0KQmVzdCByZWdhcmRzLA0KSmluZ29vIEhhbg0KDQo+
IA0KPiBSZWdhcmRzDQo+IFRvbnkgUHJpc2sNCj4gDQo+IC0tDQo+IFRvIHVuc3Vic2NyaWJlIGZy
b20gdGhpcyBsaXN0OiBzZW5kIHRoZSBsaW5lICJ1bnN1YnNjcmliZSBsaW51eC1mYmRldiIgaW4N
Cj4gdGhlIGJvZHkgb2YgYSBtZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcNCj4g
TW9yZSBtYWpvcmRvbW8gaW5mbyBhdCAgaHR0cDovL3ZnZXIua2VybmVsLm9yZy9tYWpvcmRvbW8t
aW5mby5odG1sDQo
^ permalink raw reply
* Re: [PATCH v3 3/3] backlight: as3711: add OF support
From: Jingoo Han @ 2013-03-25 5:12 UTC (permalink / raw)
To: 'Andrew Morton', 'Guennadi Liakhovetski'
Cc: linux-kernel, 'Mark Brown', 'Magnus Damm',
'Simon Horman', devicetree-discuss,
'Samuel Ortiz', 'Richard Purdie', linux-fbdev,
'Guennadi Liakhovetski', 'Jingoo Han'
In-Reply-To: <1363968949-12151-4-git-send-email-g.liakhovetski@gmx.de>
On Saturday, March 23, 2013 1:16 AM, Guennadi Liakhovetski wrote:
>
> Add support for configuring AS3711 backlight driver from DT.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
But, there is a typo in comment.
> + * At least one su2-auto-curr* must be specified iff
s/iff/if
Best regards.
Jingoo Han
> ---
> drivers/video/backlight/as3711_bl.c | 118 ++++++++++++++++++++++++++++++++++-
> 1 files changed, 117 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c
> index 41d52fe..123887c 100644
> --- a/drivers/video/backlight/as3711_bl.c
> +++ b/drivers/video/backlight/as3711_bl.c
> @@ -258,6 +258,109 @@ static int as3711_bl_register(struct platform_device *pdev,
> return 0;
> }
>
> +static int as3711_backlight_parse_dt(struct device *dev)
> +{
> + struct as3711_bl_pdata *pdata = dev_get_platdata(dev);
> + struct device_node *bl > + of_find_node_by_name(dev->parent->of_node, "backlight"), *fb;
> + int ret;
> +
> + if (!bl) {
> + dev_dbg(dev, "backlight node not found\n");
> + return -ENODEV;
> + }
> +
> + fb = of_parse_phandle(bl, "su1-dev", 0);
> + if (fb) {
> + pdata->su1_fb = fb->full_name;
> +
> + ret = of_property_read_u32(bl, "su1-max-uA", &pdata->su1_max_uA);
> + if (pdata->su1_max_uA <= 0)
> + ret = -EINVAL;
> + if (ret < 0)
> + return ret;
> + }
> +
> + fb = of_parse_phandle(bl, "su2-dev", 0);
> + if (fb) {
> + int count = 0;
> +
> + pdata->su2_fb = fb->full_name;
> +
> + ret = of_property_read_u32(bl, "su2-max-uA", &pdata->su2_max_uA);
> + if (pdata->su2_max_uA <= 0)
> + ret = -EINVAL;
> + if (ret < 0)
> + return ret;
> +
> + if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_VOLTAGE;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR1;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR2;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR3;
> + count++;
> + }
> + if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
> + pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
> + count++;
> + }
> + if (count != 1)
> + return -EINVAL;
> +
> + count = 0;
> + if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_LX_SD4;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO2;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO3;
> + count++;
> + }
> + if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
> + pdata->su2_fbprot = AS3711_SU2_GPIO4;
> + count++;
> + }
> + if (count != 1)
> + return -EINVAL;
> +
> + count = 0;
> + if (of_find_property(bl, "su2-auto-curr1", NULL)) {
> + pdata->su2_auto_curr1 = true;
> + count++;
> + }
> + if (of_find_property(bl, "su2-auto-curr2", NULL)) {
> + pdata->su2_auto_curr2 = true;
> + count++;
> + }
> + if (of_find_property(bl, "su2-auto-curr3", NULL)) {
> + pdata->su2_auto_curr3 = true;
> + count++;
> + }
> +
> + /*
> + * At least one su2-auto-curr* must be specified iff
> + * AS3711_SU2_CURR_AUTO is used
> + */
> + if (!count ^ (pdata->su2_feedback != AS3711_SU2_CURR_AUTO))
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
> static int as3711_backlight_probe(struct platform_device *pdev)
> {
> struct as3711_bl_pdata *pdata = dev_get_platdata(&pdev->dev);
> @@ -267,11 +370,24 @@ static int as3711_backlight_probe(struct platform_device *pdev)
> unsigned int max_brightness;
> int ret;
>
> - if (!pdata || (!pdata->su1_fb && !pdata->su2_fb)) {
> + if (!pdata) {
> dev_err(&pdev->dev, "No platform data, exiting...\n");
> return -ENODEV;
> }
>
> + if (pdev->dev.parent->of_node) {
> + ret = as3711_backlight_parse_dt(&pdev->dev);
> + if (ret < 0) {
> + dev_err(&pdev->dev, "DT parsing failed: %d\n", ret);
> + return ret;
> + }
> + }
> +
> + if (!pdata->su1_fb && !pdata->su2_fb) {
> + dev_err(&pdev->dev, "No framebuffer specified\n");
> + return -EINVAL;
> + }
> +
> /*
> * Due to possible hardware damage I chose to block all modes,
> * unsupported on my hardware. Anyone, wishing to use any of those modes
> --
> 1.7.2.5
>
> --
> 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
* Submitting fbdev tree patches
From: Tony Prisk @ 2013-03-25 5:11 UTC (permalink / raw)
To: linux-arm-kernel
Is anyone taking patches for fbdev at the moment?
I sent in some patches for 3.9 but didn't hear back - checking the lists
it doesn't appear Florian has posted much since the end of Oct 2012.
Regards
Tony Prisk
^ permalink raw reply
* Re: [PATCH -next] backlight: adp8870: fix error return code in adp8870_led_probe()
From: Jingoo Han @ 2013-03-25 4:31 UTC (permalink / raw)
To: 'Wei Yongjun'
Cc: 'Andrew Morton', linux-kernel, rpurdie, FlorianSchandinat,
yongjun_wei, linux-fbdev, 'Jingoo Han'
In-Reply-To: <CAPgLHd_V1M9DaO-XfrVh5k7on7cYRiLONQiu+SGrQM81MT5+Qg@mail.gmail.com>
On Friday, March 22, 2013 8:31 PM, Wei Yongjun wrote:
>
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
CC'ed Andrdew Morton, linux-kernel@vger.kernel.org
Acked-by: Jingoo Han <jg1.han@samsung.com>
> ---
> drivers/video/backlight/adp8870_bl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
> index 302c800..759bf23 100644
> --- a/drivers/video/backlight/adp8870_bl.c
> +++ b/drivers/video/backlight/adp8870_bl.c
> @@ -274,12 +274,14 @@ static int adp8870_led_probe(struct i2c_client *client)
> if (led_dat->id > 7 || led_dat->id < 1) {
> dev_err(&client->dev, "Invalid LED ID %d\n",
> led_dat->id);
> + ret = -EINVAL;
> goto err;
> }
>
> if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) {
> dev_err(&client->dev, "LED %d used by Backlight\n",
> led_dat->id);
> + ret = -EBUSY;
> goto err;
> }
>
>
>
> --
> 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
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