* Re: [PATCH] video: hgafb: remove unneeded comparison
From: Tomi Valkeinen @ 2015-01-26 12:43 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Ferenc Bakonyi, Jean-Christophe Plagniol-Villard, linux-nvidia,
linux-fbdev, linux-kernel
In-Reply-To: <1421165699-9033-1-git-send-email-sudipm.mukherjee@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
On 13/01/15 18:14, Sudip Mukherjee wrote:
> var->yoffset is of the type __u32, hence the comparison will always
> be false.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/video/fbdev/hgafb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
> index 5ff9fe2..15d3ccf 100644
> --- a/drivers/video/fbdev/hgafb.c
> +++ b/drivers/video/fbdev/hgafb.c
> @@ -417,8 +417,7 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var,
> struct fb_info *info)
> {
> if (var->vmode & FB_VMODE_YWRAP) {
> - if (var->yoffset < 0 ||
> - var->yoffset >= info->var.yres_virtual ||
> + if (var->yoffset >= info->var.yres_virtual ||
> var->xoffset)
> return -EINVAL;
> } else {
>
Thanks, queued for 3.20.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] video: treat signal like timeout as failure
From: Tomi Valkeinen @ 2015-01-26 12:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1421731430-13207-1-git-send-email-der.herr@hofr.at>
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
Hi,
On 20/01/15 07:23, Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout and cleans up.
>
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
>
> Only the timeout case was being handled, return of 0 in
> wait_for_completion_interruptible_timeout, the signal case (-ERESTARTSYS)
> was treated just like the case of successful completion, which is most
> likely not reasonable.
>
> Note that exynos_mipi_dsi_wr_data/exynos_mipi_dsi_rd_data return values
> are not checked at the call sites in s6e8ax0.c (cmd_read/cmd_write)!
>
> This patch simply treats the signal case the same way as the timeout case,
> by releasing locks and returning 0 - which might not be the right thing to
> do - this needs a review by someone knowing the details of this driver.
The code changes look ok to me, but again you have detailed descriptions
above which are not in the patch description. All the above looks like
something that should be in the patch description.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] video: treat signal like timeout as failure
From: Russell King - ARM Linux @ 2015-01-26 12:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1421731430-13207-1-git-send-email-der.herr@hofr.at>
On Tue, Jan 20, 2015 at 06:23:50AM +0100, Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout and cleans up.
>
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
>
> Only the timeout case was being handled, return of 0 in
> wait_for_completion_interruptible_timeout, the signal case (-ERESTARTSYS)
> was treated just like the case of successful completion, which is most
> likely not reasonable.
>
> Note that exynos_mipi_dsi_wr_data/exynos_mipi_dsi_rd_data return values
> are not checked at the call sites in s6e8ax0.c (cmd_read/cmd_write)!
>
> This patch simply treats the signal case the same way as the timeout case,
> by releasing locks and returning 0 - which might not be the right thing to
> do - this needs a review by someone knowing the details of this driver.
>
> Patch is against 3.19.0-rc5 -next-20150119
>
> Patch was only compile-tested with exynos_defconfig
>
> drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> index 2358a2f..55a7a45 100644
> --- a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> +++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> @@ -157,6 +157,7 @@ int exynos_mipi_dsi_wr_data(struct mipi_dsim_device *dsim, unsigned int data_id,
> const unsigned char *data0, unsigned int data_size)
> {
> unsigned int check_rx_ack = 0;
> + long timeout;
>
> if (dsim->state = DSIM_STATE_ULPS) {
> dev_err(dsim->dev, "state is ULPS.\n");
> @@ -244,9 +245,11 @@ int exynos_mipi_dsi_wr_data(struct mipi_dsim_device *dsim, unsigned int data_id,
> exynos_mipi_dsi_wr_tx_header(dsim, data_id, data_size & 0xff,
> (data_size & 0xff00) >> 8);
>
> - if (!wait_for_completion_interruptible_timeout(&dsim_wr_comp,
> - MIPI_FIFO_TIMEOUT)) {
> - dev_warn(dsim->dev, "command write timeout.\n");
> + timeout = wait_for_completion_interruptible_timeout(
> + &dsim_wr_comp, MIPI_FIFO_TIMEOUT);
> + if (timeout <= 0) {
> + dev_warn(dsim->dev,
> + "command write timed-out/interrupted.\n");
This is really silly. Let's say that the program which results in
this function called is using signals (eg, alarm() with SIGALRM, or
asynchronous IO with SIGIO, etc).
Why should having a SIGALRM raised print a kernel message? If this
happens a lot, it will result in the kernel log being flooded with
these messages.
Signals should not be seen as exceptional conditions. For some programs,
they are merely asynchronous events which are a normal part of the
programs operation (eg, SIGIO, SIGALRM, etc.)
Please, if you are going to handle signals, then handle them properly.
If you're not going to handle them properly, don't use a wait that
caters for them - use wait_for_completion_killable_timeout() which
doesn't finish waiting on a signal unless the signal is going to result
in the death of the program.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* [PATCH] fbdev: fix CVT vertical front and back porch values
From: Tomi Valkeinen @ 2015-01-26 13:10 UTC (permalink / raw)
To: linux-fbdev
CVT v1.1 spec says: "the vertical front porch shall in all cases be
fixed to 3 lines". The code in fbcvt.c instead sets the _back_ porch to
3 (plus margin).
After swapping cvt.v_front_porch and cvt.v_back_porch the resulting
timings were in line with CVT timings in VESA DMT spec.
The bug seems to be more than 9 years old, but I presume it has not been
noticed as usually the video timings come from the EDID or from the
timing tables in fbdev, and probably swapped values for vfp and vbp work
fine for most of the displays.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Ung <davidu@nvidia.com>
Cc: Antonino A. Daplas <adaplas@gmail.com>
---
drivers/video/fbdev/core/fbcvt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcvt.c b/drivers/video/fbdev/core/fbcvt.c
index 7cb715dfc0e1..55d2bd0ce5c0 100644
--- a/drivers/video/fbdev/core/fbcvt.c
+++ b/drivers/video/fbdev/core/fbcvt.c
@@ -369,9 +369,9 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb)
cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin;
cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch +
2 * cvt.h_margin;
- cvt.v_back_porch = 3 + cvt.v_margin;
- cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace -
- cvt.v_back_porch - cvt.vsync;
+ cvt.v_front_porch = 3 + cvt.v_margin;
+ cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace -
+ cvt.v_front_porch - cvt.vsync;
fb_cvt_print_name(&cvt);
fb_cvt_convert_to_mode(&cvt, mode);
--
2.2.2
^ permalink raw reply related
* RE: [PATCH] fbdev: fix CVT vertical front and back porch values
From: David Ung @ 2015-01-26 20:21 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1422277830-5163-1-git-send-email-tomi.valkeinen@ti.com>
> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@ti.com]
> Sent: Monday, January 26, 2015 5:11 AM
> To: linux-fbdev@vger.kernel.org
> Cc: Tomi Valkeinen; David Ung; Antonino A. Daplas
> Subject: [PATCH] fbdev: fix CVT vertical front and back porch values
>
> CVT v1.1 spec says: "the vertical front porch shall in all cases be fixed to 3
> lines". The code in fbcvt.c instead sets the _back_ porch to
> 3 (plus margin).
>
> After swapping cvt.v_front_porch and cvt.v_back_porch the resulting
> timings were in line with CVT timings in VESA DMT spec.
>
> The bug seems to be more than 9 years old, but I presume it has not been
> noticed as usually the video timings come from the EDID or from the timing
> tables in fbdev, and probably swapped values for vfp and vbp work fine for
> most of the displays.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: David Ung <davidu@nvidia.com>
> Cc: Antonino A. Daplas <adaplas@gmail.com>
> ---
> drivers/video/fbdev/core/fbcvt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbcvt.c
> b/drivers/video/fbdev/core/fbcvt.c
> index 7cb715dfc0e1..55d2bd0ce5c0 100644
> --- a/drivers/video/fbdev/core/fbcvt.c
> +++ b/drivers/video/fbdev/core/fbcvt.c
> @@ -369,9 +369,9 @@ int fb_find_mode_cvt(struct fb_videomode *mode,
> int margins, int rb)
> cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin;
> cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch +
> 2 * cvt.h_margin;
> - cvt.v_back_porch = 3 + cvt.v_margin;
> - cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace -
> - cvt.v_back_porch - cvt.vsync;
> + cvt.v_front_porch = 3 + cvt.v_margin;
> + cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace -
> + cvt.v_front_porch - cvt.vsync;
> fb_cvt_print_name(&cvt);
> fb_cvt_convert_to_mode(&cvt, mode);
>
> --
> 2.2.2
lgtm
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply
* [PATCH v3 0/2] fbcon: user-defined cursor blink interval
From: Scot Doyle @ 2015-01-26 20:37 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, linux-fbdev, linux-kernel
Allow users to set fbcon's cursor blink interval. The current interval
of 200 milliseconds is retained as the default. Tested with intelfb.
v2: Use kstrtos16() instead of kstrtoul() and min_t() as suggested by
Geert Uytterhoeven
v3: Add error messages as suggested by Tomi Valkeinen
Scot Doyle (2):
fbcon: store cursor blink interval in fbcon_ops
fbcon: expose cursor blink interval via sysfs
drivers/video/console/fbcon.c | 84 +++++++++++++++++++++++++++++++++++++++++--
drivers/video/console/fbcon.h | 1 +
2 files changed, 83 insertions(+), 2 deletions(-)
--
2.1.4
^ permalink raw reply
* [PATCH v3 1/2] fbcon: store cursor blink interval in fbcon_ops
From: Scot Doyle @ 2015-01-26 20:40 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501262034380.1945@localhost.localdomain>
The fbcon cursor, when set to blink, is hardcoded to toggle display
state five times per second. Move this setting to the driver's fbdev_ops
structure, retaining the default blink interval.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
drivers/video/console/fbcon.c | 5 +++--
drivers/video/console/fbcon.h | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ea43724..7a2030b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -405,7 +405,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
struct fbcon_ops *ops = info->fbcon_par;
queue_work(system_power_efficient_wq, &info->queue);
- mod_timer(&ops->cursor_timer, jiffies + HZ/5);
+ mod_timer(&ops->cursor_timer, jiffies + ops->blink_jiffies);
}
static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -420,7 +420,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
init_timer(&ops->cursor_timer);
ops->cursor_timer.function = cursor_timer_handler;
- ops->cursor_timer.expires = jiffies + HZ / 5;
+ ops->cursor_timer.expires = jiffies + ops->blink_jiffies;
ops->cursor_timer.data = (unsigned long ) info;
add_timer(&ops->cursor_timer);
ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -959,6 +959,7 @@ static const char *fbcon_startup(void)
ops->currcon = -1;
ops->graphics = 1;
ops->cur_rotate = -1;
+ ops->blink_jiffies = msecs_to_jiffies(200);
info->fbcon_par = ops;
p->con_rotate = initial_rotation;
set_blitting_type(vc, info);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..642c4e7 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -70,6 +70,7 @@ struct fbcon_ops {
struct fb_cursor cursor_state;
struct display *p;
int currcon; /* Current VC. */
+ int blink_jiffies;
int cursor_flash;
int cursor_reset;
int blank_state;
--
2.1.4
^ permalink raw reply related
* [PATCH v3 2/2] fbcon: expose cursor blink interval via sysfs
From: Scot Doyle @ 2015-01-26 20:41 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501262034380.1945@localhost.localdomain>
The fbcon cursor, when set to blink, is hardcoded to toggle display state
five times per second. Expose this setting via
/sys/class/graphics/fbcon/cursor_blink_ms
Values written to the interface set the approximate time interval in
milliseconds between cursor toggles, from 1 to 32767. Since the interval
is stored internally as a number of jiffies, the millisecond value read
from the interface may not exactly match the entered value.
An outstanding blink timer is reset after a new value is entered.
If the cursor blink is disabled, either via the 'cursor_blink' boolean
setting or some other mechanism, the 'cursor_blink_ms' setting may still
be modified. The new value will be used if the blink is reactivated.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
drivers/video/console/fbcon.c | 79 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 7a2030b..19620d2 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -3495,11 +3495,90 @@ err:
return count;
}
+static ssize_t show_cursor_blink_ms(struct device *device,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info;
+ struct fbcon_ops *ops;
+ int idx, ms = -1;
+
+ if (fbcon_has_exited) {
+ pr_err("%s: framebuffer console exited", __func__);
+ return 0;
+ }
+
+ console_lock();
+ idx = con2fb_map[fg_console];
+
+ if (idx = -1 || registered_fb[idx] = NULL) {
+ pr_err("%s: no console to framebuffer mapping", __func__);
+ goto err;
+ }
+
+ info = registered_fb[idx];
+
+ if ((ops = info->fbcon_par) = NULL) {
+ pr_err("%s: framebuffer has no device info", __func__);
+ goto err;
+ }
+
+ ms = jiffies_to_msecs(ops->blink_jiffies);
+
+err:
+ console_unlock();
+ return snprintf(buf, PAGE_SIZE, "%d\n", ms);
+}
+
+static ssize_t store_cursor_blink_ms(struct device *device,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct fb_info *info;
+ struct fbcon_ops *ops;
+ int idx;
+ short ms;
+
+ if (fbcon_has_exited) {
+ pr_err("%s: framebuffer console exited", __func__);
+ return count;
+ }
+
+ console_lock();
+ idx = con2fb_map[fg_console];
+
+ if (idx = -1 || registered_fb[idx] = NULL) {
+ pr_err("%s: no console to framebuffer mapping", __func__);
+ goto err;
+ }
+
+ info = registered_fb[idx];
+
+ if ((ops = info->fbcon_par) = NULL) {
+ pr_err("%s: framebuffer has no device info", __func__);
+ goto err;
+ }
+
+ if (!kstrtos16(buf, 0, &ms)) {
+ ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);
+ if (info->queue.func = fb_flashcursor &&
+ ops->flags & FBCON_FLAGS_CURSOR_TIMER) {
+ fbcon_del_cursor_timer(info);
+ fbcon_add_cursor_timer(info);
+ }
+ }
+
+err:
+ console_unlock();
+ return count;
+}
+
static struct device_attribute device_attrs[] = {
__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
store_cursor_blink),
+ __ATTR(cursor_blink_ms, S_IRUGO|S_IWUSR, show_cursor_blink_ms,
+ store_cursor_blink_ms),
};
static int fbcon_init_device(void)
--
2.1.4
^ permalink raw reply related
* Re: [PATCH v3 2/2] fbcon: expose cursor blink interval via sysfs
From: Richard Weinberger @ 2015-01-26 20:54 UTC (permalink / raw)
To: Scot Doyle
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Geert Uytterhoeven, linux-fbdev, LKML
In-Reply-To: <alpine.DEB.2.11.1501262040380.2052@localhost.localdomain>
On Mon, Jan 26, 2015 at 9:41 PM, Scot Doyle <lkml14@scotdoyle.com> wrote:
> The fbcon cursor, when set to blink, is hardcoded to toggle display state
> five times per second. Expose this setting via
> /sys/class/graphics/fbcon/cursor_blink_ms
>
> Values written to the interface set the approximate time interval in
> milliseconds between cursor toggles, from 1 to 32767. Since the interval
> is stored internally as a number of jiffies, the millisecond value read
> from the interface may not exactly match the entered value.
>
> An outstanding blink timer is reset after a new value is entered.
>
> If the cursor blink is disabled, either via the 'cursor_blink' boolean
> setting or some other mechanism, the 'cursor_blink_ms' setting may still
> be modified. The new value will be used if the blink is reactivated.
Out of curiosity, why do you need this new setting?
Your patch describes what it does but does not describe the "why".
--
Thanks,
//richard
^ permalink raw reply
* [PATCH v4 0/2] fbcon: user-defined cursor blink interval
From: Scot Doyle @ 2015-01-26 23:09 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, Richard Weinberger, linux-fbdev, linux-kernel
Since users prefer different fbcon cursor blink intervals, allow the
interval to be set via sysfs. The current interval of 200 milliseconds
is retained as the default. Tested with intelfb.
v2: Use kstrtos16() instead of kstrtoul() and min_t() as suggested by
Geert Uytterhoeven
v3: Add error messages as suggested by Tomi Valkeinen
v4: Add rationale into patch descriptions as suggested by
Richard Weinberger
Scot Doyle (2):
fbcon: store cursor blink interval in fbcon_ops
fbcon: expose cursor blink interval via sysfs
drivers/video/console/fbcon.c | 84 +++++++++++++++++++++++++++++++++++++++++--
drivers/video/console/fbcon.h | 1 +
2 files changed, 83 insertions(+), 2 deletions(-)
--
2.1.4
^ permalink raw reply
* [PATCH v4 1/2] fbcon: store cursor blink interval in fbcon_ops
From: Scot Doyle @ 2015-01-26 23:11 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, Richard Weinberger, linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501262305150.2783@localhost.localdomain>
fbcon toggles cursor display state every 200 milliseconds when blinking.
Since users prefer different toggle intervals, prepare to expose the
interval via sysfs by moving it to fbdev_ops and setting the default
to 200 milliseconds.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
drivers/video/console/fbcon.c | 5 +++--
drivers/video/console/fbcon.h | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ea43724..7a2030b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -405,7 +405,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
struct fbcon_ops *ops = info->fbcon_par;
queue_work(system_power_efficient_wq, &info->queue);
- mod_timer(&ops->cursor_timer, jiffies + HZ/5);
+ mod_timer(&ops->cursor_timer, jiffies + ops->blink_jiffies);
}
static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -420,7 +420,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
init_timer(&ops->cursor_timer);
ops->cursor_timer.function = cursor_timer_handler;
- ops->cursor_timer.expires = jiffies + HZ / 5;
+ ops->cursor_timer.expires = jiffies + ops->blink_jiffies;
ops->cursor_timer.data = (unsigned long ) info;
add_timer(&ops->cursor_timer);
ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -959,6 +959,7 @@ static const char *fbcon_startup(void)
ops->currcon = -1;
ops->graphics = 1;
ops->cur_rotate = -1;
+ ops->blink_jiffies = msecs_to_jiffies(200);
info->fbcon_par = ops;
p->con_rotate = initial_rotation;
set_blitting_type(vc, info);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..642c4e7 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -70,6 +70,7 @@ struct fbcon_ops {
struct fb_cursor cursor_state;
struct display *p;
int currcon; /* Current VC. */
+ int blink_jiffies;
int cursor_flash;
int cursor_reset;
int blank_state;
--
2.1.4
^ permalink raw reply related
* [PATCH v4 2/2] fbcon: expose cursor blink interval via sysfs
From: Scot Doyle @ 2015-01-26 23:14 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, Richard Weinberger, linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501262305150.2783@localhost.localdomain>
fbcon toggles cursor display state every 200 milliseconds when blinking.
Since users prefer different toggle intervals, expose the interval via
/sys/class/graphics/fbcon/cursor_blink_ms so that it may be customized.
Values written to the interface set the approximate time interval in
milliseconds between cursor toggles, from 1 to 32767. Since the interval
is stored internally as a number of jiffies, the millisecond value read
from the interface may not exactly match the entered value.
An outstanding blink timer is reset after a new value is entered.
If the cursor blink is disabled, either via the 'cursor_blink' boolean
setting or some other mechanism, the 'cursor_blink_ms' setting may still
be modified. The new value will be used if the blink is reactivated.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
drivers/video/console/fbcon.c | 79 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 7a2030b..19620d2 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -3495,11 +3495,90 @@ err:
return count;
}
+static ssize_t show_cursor_blink_ms(struct device *device,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info;
+ struct fbcon_ops *ops;
+ int idx, ms = -1;
+
+ if (fbcon_has_exited) {
+ pr_err("%s: framebuffer console exited", __func__);
+ return 0;
+ }
+
+ console_lock();
+ idx = con2fb_map[fg_console];
+
+ if (idx = -1 || registered_fb[idx] = NULL) {
+ pr_err("%s: no console to framebuffer mapping", __func__);
+ goto err;
+ }
+
+ info = registered_fb[idx];
+
+ if ((ops = info->fbcon_par) = NULL) {
+ pr_err("%s: framebuffer has no device info", __func__);
+ goto err;
+ }
+
+ ms = jiffies_to_msecs(ops->blink_jiffies);
+
+err:
+ console_unlock();
+ return snprintf(buf, PAGE_SIZE, "%d\n", ms);
+}
+
+static ssize_t store_cursor_blink_ms(struct device *device,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct fb_info *info;
+ struct fbcon_ops *ops;
+ int idx;
+ short ms;
+
+ if (fbcon_has_exited) {
+ pr_err("%s: framebuffer console exited", __func__);
+ return count;
+ }
+
+ console_lock();
+ idx = con2fb_map[fg_console];
+
+ if (idx = -1 || registered_fb[idx] = NULL) {
+ pr_err("%s: no console to framebuffer mapping", __func__);
+ goto err;
+ }
+
+ info = registered_fb[idx];
+
+ if ((ops = info->fbcon_par) = NULL) {
+ pr_err("%s: framebuffer has no device info", __func__);
+ goto err;
+ }
+
+ if (!kstrtos16(buf, 0, &ms)) {
+ ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);
+ if (info->queue.func = fb_flashcursor &&
+ ops->flags & FBCON_FLAGS_CURSOR_TIMER) {
+ fbcon_del_cursor_timer(info);
+ fbcon_add_cursor_timer(info);
+ }
+ }
+
+err:
+ console_unlock();
+ return count;
+}
+
static struct device_attribute device_attrs[] = {
__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
store_cursor_blink),
+ __ATTR(cursor_blink_ms, S_IRUGO|S_IWUSR, show_cursor_blink_ms,
+ store_cursor_blink_ms),
};
static int fbcon_init_device(void)
--
2.1.4
^ permalink raw reply related
* Re: [PATCH v4 0/2] fbcon: user-defined cursor blink interval
From: Richard Weinberger @ 2015-01-26 23:29 UTC (permalink / raw)
To: Scot Doyle, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Geert Uytterhoeven, Richard Weinberger, linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501262305150.2783@localhost.localdomain>
Am 27.01.2015 um 00:09 schrieb Scot Doyle:
> Since users prefer different fbcon cursor blink intervals, allow the
> interval to be set via sysfs. The current interval of 200 milliseconds
> is retained as the default. Tested with intelfb.
>
> v2: Use kstrtos16() instead of kstrtoul() and min_t() as suggested by
> Geert Uytterhoeven
> v3: Add error messages as suggested by Tomi Valkeinen
> v4: Add rationale into patch descriptions as suggested by
> Richard Weinberger
Hehe, no need to resend immediately a v4, I'm just curios about the use case. :)
Why do users want a different blink interval? What is the use case?
And what are these users? Most people use a fbcon only for a few moments
to fix/restart X11.
Thanks,
//richard
^ permalink raw reply
* Re: [PATCH v4 0/2] fbcon: user-defined cursor blink interval
From: Scot Doyle @ 2015-01-27 1:06 UTC (permalink / raw)
To: Richard Weinberger
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Geert Uytterhoeven, Richard Weinberger, linux-fbdev, linux-kernel
In-Reply-To: <54C6CDDC.5010507@nod.at>
On Tue, 27 Jan 2015, Richard Weinberger wrote:
> Am 27.01.2015 um 00:09 schrieb Scot Doyle:
> > Since users prefer different fbcon cursor blink intervals, allow the
> > interval to be set via sysfs. The current interval of 200 milliseconds
> > is retained as the default. Tested with intelfb.
> >
> > v2: Use kstrtos16() instead of kstrtoul() and min_t() as suggested by
> > Geert Uytterhoeven
> > v3: Add error messages as suggested by Tomi Valkeinen
> > v4: Add rationale into patch descriptions as suggested by
> > Richard Weinberger
>
> Hehe, no need to resend immediately a v4, I'm just curios about the use case. :)
> Why do users want a different blink interval? What is the use case?
> And what are these users? Most people use a fbcon only for a few moments
> to fix/restart X11.
>
> Thanks,
> //richard
Ah, I see! With multiple ncurses windows, some of which contain reversed
characters, a blinking underscore is helpful for locating the cursor.
But, the 200 millisecond interval can be distracting. Another example is
http://unix.stackexchange.com/questions/55423/how-to-change-cursor-shape-color-and-blinkrate-of-linux-console
^ permalink raw reply
* Re: [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo @ 2015-01-27 7:02 UTC (permalink / raw)
To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
matti.vaittinen, broonie, jason, heiko, shawn.guo,
florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1421994515-3070-5-git-send-email-jack.yoo@skyworksinc.com>
On Fri, Jan 23, 2015 at 03:28:33PM +0900, gyungoh@gmail.com wrote:
> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
>
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Bryan Wu <cooloney@gmail.com>
The existing Ack is only for backlight driver.
DT Ack please.
> ---
> Changes v10:
> Nothing
>
> Changes v9:
> Nothing
>
> Changes v8:
> Renamed property names for backlight with vendor prefix
> Modified gpio-enable property to generic property for GPIO
> Made up the example for backlight DT
>
> Changes v7:
> Nothing
>
> Changes v6:
> Nothing
>
> Changes v5:
> Nothing
>
> Changes v4:
> Nothing
>
> Changes v3:
> Nothing
>
> Changes v2:
> Added reg attribute for I2C slave address
>
> .../video/backlight/sky81452-backlight.txt | 29 ++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
>
> diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> new file mode 100644
> index 0000000..8daebf5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> @@ -0,0 +1,29 @@
> +SKY81452-backlight bindings
> +
> +Required properties:
> +- compatible : Must be "skyworks,sky81452-backlight"
> +
> +Optional properties:
> +- name : Name of backlight device. Default is 'lcd-backlight'.
> +- gpios : GPIO to use to EN pin.
> + See Documentation/devicetree/bindings/gpio/gpio.txt
> +- skyworks,en-channels : Enable mask for current sink channel 1 to 6.
> +- skyworks,ignore-pwm : Ignore both PWM input
> +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming.
> +- skyworks,phase-shift : Enable phase shift mode
> +- skyworks,ovp-level : Over-voltage protection level.
> + Should be between 14 or 28V.
> +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V.
> +- skyworks,current-limit : It should be 2300mA or 2750mA.
> +
> +Example:
> +
> + backlight {
> + compatible = "skyworks,sky81452-backlight";
> + name = "pwm-backlight";
> + skyworks,en-channels = <0x3f>;
> + skyworks,ignore-pwm;
> + skyworks,phase-shift;
> + skyworks,ovp-level = <20>;
> + skyworks,current-limit = <2300>;
> + };
> --
> 1.9.1
>
^ permalink raw reply
* [PATCH 00/14] OMAPDSS: Add TI DRA7xx support
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
Hi,
This series adds DSS support for Texas Instrument's DRA7xx SoCs. The DSS on
DRA7xx is very much like OMAP5's DSS. The main differences are in the
integration of the DSS.
There are three main differences to OMAP5:
* DRA7xx has one (DRA72x) or two (DRA74x) video PLLs, which are almost like
OMAP5's DSI PLLs, except integrated slightly differently.
* DRA7xx supports 3 DPI outputs, instead of 1 DPI output.
* need to set various bits in CONTROL module, which is handled via syscon
This series only adds the support to DSS driver. arch/arm/ changes are not yet
finalized. The main issue there is the missing support for DSS_DESHDCP clock,
which probably needs to be handled via regmap.
My plan is to merge the driver side changes first for 3.20, and the arch/arm/
changes for 3.21 (if solutions to the issues have been found). This will also
make the merging easier, as there won't be a merge-window cross dependency
between arm and fbdev trees.
These patches, and the additional arch/arm/ patches needed to get DSS working
on DRA7xx, can be found from:
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git work/dra7-dss
Tomi
Tomi Valkeinen (14):
OMAPDSS: Add enum dss_pll_id
OMAPDSS: PLL: add dss_pll_wait_reset_done()
OMAPDSS: constify port arrays
OMAPDSS: OMAP5: fix digit output's allowed mgrs
OMAPDSS: encoder-tpd12s015: Fix race issue with LS_OE
OMAPDSS: add define for DRA7xx HW version
Doc/DT: Add DT binding doc for DRA7xx DSS
OMAPDSS: DSS: Add DRA7xx base support
OMAPDSS: Add functions for external control of PLL
OMAPDSS: Add Video PLLs for DRA7xx
OMAPDSS: DISPC: Add DRA7xx support
OMAPDSS: DISPC: program dispc polarities to control module
OMAPDSS: HDMI: Add DRA7xx support
OMAPDSS: DPI: DRA7xx support
.../devicetree/bindings/video/ti,dra7-dss.txt | 69 +++++++
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 57 +-----
drivers/video/fbdev/omap2/dss/Makefile | 2 +-
drivers/video/fbdev/omap2/dss/dispc.c | 54 +++++
drivers/video/fbdev/omap2/dss/dpi.c | 26 +++
drivers/video/fbdev/omap2/dss/dsi.c | 1 +
drivers/video/fbdev/omap2/dss/dss.c | 219 ++++++++++++++++++++-
drivers/video/fbdev/omap2/dss/dss.h | 22 +++
drivers/video/fbdev/omap2/dss/dss_features.c | 3 +-
drivers/video/fbdev/omap2/dss/hdmi5.c | 1 +
drivers/video/fbdev/omap2/dss/hdmi_phy.c | 1 +
drivers/video/fbdev/omap2/dss/hdmi_pll.c | 6 +
drivers/video/fbdev/omap2/dss/omapdss-boot-init.c | 1 +
drivers/video/fbdev/omap2/dss/pll.c | 10 +
drivers/video/fbdev/omap2/dss/video-pll.c | 211 ++++++++++++++++++++
include/video/omapdss.h | 1 +
16 files changed, 627 insertions(+), 57 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/ti,dra7-dss.txt
create mode 100644 drivers/video/fbdev/omap2/dss/video-pll.c
--
2.2.2
^ permalink raw reply
* [PATCH 01/14] OMAPDSS: Add enum dss_pll_id
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
In some cases we need global identifiers for the DSS PLLs, for example
when configuring clock muxing on DRA7. For this purpose let's add a
'enum dss_pll_id'.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dsi.c | 1 +
drivers/video/fbdev/omap2/dss/dss.h | 7 +++++++
drivers/video/fbdev/omap2/dss/hdmi_pll.c | 1 +
3 files changed, 9 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index 3e44c580b1f8..5081f6fb1737 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -5238,6 +5238,7 @@ static int dsi_init_pll_data(struct platform_device *dsidev)
}
pll->name = dsi->module_id = 0 ? "dsi0" : "dsi1";
+ pll->id = dsi->module_id = 0 ? DSS_PLL_DSI1 : DSS_PLL_DSI2;
pll->clkin = clk;
pll->base = dsi->pll_base;
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 14fb0c23f4a2..1826ee96265b 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -100,6 +100,12 @@ enum dss_writeback_channel {
DSS_WB_LCD3_MGR = 7,
};
+enum dss_pll_id {
+ DSS_PLL_DSI1,
+ DSS_PLL_DSI2,
+ DSS_PLL_HDMI,
+};
+
struct dss_pll;
#define DSS_PLL_MAX_HSDIVS 4
@@ -150,6 +156,7 @@ struct dss_pll_hw {
struct dss_pll {
const char *name;
+ enum dss_pll_id id;
struct clk *clkin;
struct regulator *regulator;
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_pll.c b/drivers/video/fbdev/omap2/dss/hdmi_pll.c
index ac83ef5cfd7d..b808f7c72d83 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_pll.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_pll.c
@@ -185,6 +185,7 @@ static int dsi_init_pll_data(struct platform_device *pdev, struct hdmi_pll_data
}
pll->name = "hdmi";
+ pll->id = DSS_PLL_HDMI;
pll->base = hpll->base;
pll->clkin = clk;
--
2.2.2
^ permalink raw reply related
* [PATCH 02/14] OMAPDSS: PLL: add dss_pll_wait_reset_done()
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
Add a helper function to wait until the PLL's reset is done.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.h | 1 +
drivers/video/fbdev/omap2/dss/pll.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 1826ee96265b..d6c9c3d3db14 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -453,5 +453,6 @@ int dss_pll_write_config_type_a(struct dss_pll *pll,
const struct dss_pll_clock_info *cinfo);
int dss_pll_write_config_type_b(struct dss_pll *pll,
const struct dss_pll_clock_info *cinfo);
+int dss_pll_wait_reset_done(struct dss_pll *pll);
#endif
diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c
index 335ffac224b9..f974ddcd3b6e 100644
--- a/drivers/video/fbdev/omap2/dss/pll.c
+++ b/drivers/video/fbdev/omap2/dss/pll.c
@@ -222,6 +222,16 @@ static int wait_for_bit_change(void __iomem *reg, int bitnum, int value)
return !value;
}
+int dss_pll_wait_reset_done(struct dss_pll *pll)
+{
+ void __iomem *base = pll->base;
+
+ if (wait_for_bit_change(base + PLL_STATUS, 0, 1) != 1)
+ return -ETIMEDOUT;
+ else
+ return 0;
+}
+
static int dss_wait_hsdiv_ack(struct dss_pll *pll, u32 hsdiv_ack_mask)
{
int t = 100;
--
2.2.2
^ permalink raw reply related
* [PATCH 03/14] OMAPDSS: constify port arrays
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
The port arrays are constant data, so set them as 'const'.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 9987154d50b4..1884c29ef482 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -70,7 +70,7 @@ struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
- enum omap_display_type *ports;
+ const enum omap_display_type *ports;
int num_ports;
int (*dpi_select_source)(int port, enum omap_channel channel);
};
@@ -677,11 +677,11 @@ void dss_debug_dump_clocks(struct seq_file *s)
#endif
-static enum omap_display_type omap2plus_ports[] = {
+static const enum omap_display_type omap2plus_ports[] = {
OMAP_DISPLAY_TYPE_DPI,
};
-static enum omap_display_type omap34xx_ports[] = {
+static const enum omap_display_type omap34xx_ports[] = {
OMAP_DISPLAY_TYPE_DPI,
OMAP_DISPLAY_TYPE_SDI,
};
--
2.2.2
^ permalink raw reply related
* [PATCH 04/14] OMAPDSS: OMAP5: fix digit output's allowed mgrs
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
The OMAP5 HW supports directing DIGIT channel to DPI output, but the
driver doesn't support that. However, we have marked that configuration
as possible in the dss features, so in certain cases the driver tries to
use that configuration, leading to broken display.
Fix the problem by allowing DIGIT channel to go only to HDMI output.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dss_features.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/dss_features.c b/drivers/video/fbdev/omap2/dss/dss_features.c
index 0e3da809473c..0e6f3f54749f 100644
--- a/drivers/video/fbdev/omap2/dss/dss_features.c
+++ b/drivers/video/fbdev/omap2/dss/dss_features.c
@@ -223,7 +223,7 @@ static const enum omap_dss_output_id omap5_dss_supported_outputs[] = {
OMAP_DSS_OUTPUT_DSI1 | OMAP_DSS_OUTPUT_DSI2,
/* OMAP_DSS_CHANNEL_DIGIT */
- OMAP_DSS_OUTPUT_HDMI | OMAP_DSS_OUTPUT_DPI,
+ OMAP_DSS_OUTPUT_HDMI,
/* OMAP_DSS_CHANNEL_LCD2 */
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
--
2.2.2
^ permalink raw reply related
* [PATCH 05/14] OMAPDSS: encoder-tpd12s015: Fix race issue with LS_OE
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
A race issue has been observed with the encoder-tpd12s015 driver, which
leads to errors when trying to read EDID. This has only now been
observed, as OMAP4 and OMAP5 boards used SoC's GPIOs for LS_OE GPIO. On
dra7-evm boards, the LS_OE is behind a i2c controlled GPIO expander,
which increases the time to set the LS_OE.
This patch simplifies the handling of the LS_OE gpio in the driver by
removing the interrupt handling totally. The only time we actually need
to enable LS_OE is when we are reading the EDID, and thus we can just
set and clear the LS_OE gpio inside the read_edid() function.
This also has the additional benefit of very slightly decreasing the
power consumption.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 57 ++++------------------
1 file changed, 10 insertions(+), 47 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index 7f3e11b16c86..990af6baeb0f 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -29,33 +29,10 @@ struct panel_drv_data {
int hpd_gpio;
struct omap_video_timings timings;
-
- struct completion hpd_completion;
};
#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
-static irqreturn_t tpd_hpd_irq_handler(int irq, void *data)
-{
- struct panel_drv_data *ddata = data;
- bool hpd;
-
- hpd = gpio_get_value_cansleep(ddata->hpd_gpio);
-
- dev_dbg(ddata->dssdev.dev, "hpd %d\n", hpd);
-
- if (gpio_is_valid(ddata->ls_oe_gpio)) {
- if (hpd)
- gpio_set_value_cansleep(ddata->ls_oe_gpio, 1);
- else
- gpio_set_value_cansleep(ddata->ls_oe_gpio, 0);
- }
-
- complete_all(&ddata->hpd_completion);
-
- return IRQ_HANDLED;
-}
-
static int tpd_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
@@ -70,23 +47,10 @@ static int tpd_connect(struct omap_dss_device *dssdev,
dst->src = dssdev;
dssdev->dst = dst;
- reinit_completion(&ddata->hpd_completion);
-
gpio_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1);
/* DC-DC converter needs at max 300us to get to 90% of 5V */
udelay(300);
- /*
- * If there's a cable connected, wait for the hpd irq to trigger,
- * which turns on the level shifters.
- */
- if (gpio_get_value_cansleep(ddata->hpd_gpio)) {
- unsigned long to;
- to = wait_for_completion_timeout(&ddata->hpd_completion,
- msecs_to_jiffies(250));
- WARN_ON_ONCE(to = 0);
- }
-
return 0;
}
@@ -179,11 +143,20 @@ static int tpd_read_edid(struct omap_dss_device *dssdev,
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
+ int r;
if (!gpio_get_value_cansleep(ddata->hpd_gpio))
return -ENODEV;
- return in->ops.hdmi->read_edid(in, edid, len);
+ if (gpio_is_valid(ddata->ls_oe_gpio))
+ gpio_set_value_cansleep(ddata->ls_oe_gpio, 1);
+
+ r = in->ops.hdmi->read_edid(in, edid, len);
+
+ if (gpio_is_valid(ddata->ls_oe_gpio))
+ gpio_set_value_cansleep(ddata->ls_oe_gpio, 0);
+
+ return r;
}
static bool tpd_detect(struct omap_dss_device *dssdev)
@@ -309,8 +282,6 @@ static int tpd_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ddata);
- init_completion(&ddata->hpd_completion);
-
if (dev_get_platdata(&pdev->dev)) {
r = tpd_probe_pdata(pdev);
if (r)
@@ -340,13 +311,6 @@ static int tpd_probe(struct platform_device *pdev)
if (r)
goto err_gpio;
- r = devm_request_threaded_irq(&pdev->dev, gpio_to_irq(ddata->hpd_gpio),
- NULL, tpd_hpd_irq_handler,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
- IRQF_ONESHOT, "hpd", ddata);
- if (r)
- goto err_irq;
-
dssdev = &ddata->dssdev;
dssdev->ops.hdmi = &tpd_hdmi_ops;
dssdev->dev = &pdev->dev;
@@ -365,7 +329,6 @@ static int tpd_probe(struct platform_device *pdev)
return 0;
err_reg:
-err_irq:
err_gpio:
omap_dss_put_device(ddata->in);
return r;
--
2.2.2
^ permalink raw reply related
* [PATCH 06/14] OMAPDSS: add define for DRA7xx HW version
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
Add define for DRA7xx DSS version.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
include/video/omapdss.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 6a84498ea513..60de61fea8e3 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -314,6 +314,7 @@ enum omapdss_version {
OMAPDSS_VER_OMAP4, /* All other OMAP4s */
OMAPDSS_VER_OMAP5,
OMAPDSS_VER_AM43xx,
+ OMAPDSS_VER_DRA7xx,
};
/* Board specific data */
--
2.2.2
^ permalink raw reply related
* [PATCH 07/14] Doc/DT: Add DT binding doc for DRA7xx DSS
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen, devicetree
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
Add device tree binding documentation for DRA7xx display subsystem.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree@vger.kernel.org
---
.../devicetree/bindings/video/ti,dra7-dss.txt | 69 ++++++++++++++++++++++
1 file changed, 69 insertions(+)
create mode 100644 Documentation/devicetree/bindings/video/ti,dra7-dss.txt
diff --git a/Documentation/devicetree/bindings/video/ti,dra7-dss.txt b/Documentation/devicetree/bindings/video/ti,dra7-dss.txt
new file mode 100644
index 000000000000..f33a05137b0e
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,dra7-dss.txt
@@ -0,0 +1,69 @@
+Texas Instruments DRA7x Display Subsystem
+====================+
+See Documentation/devicetree/bindings/video/ti,omap-dss.txt for generic
+description about OMAP Display Subsystem bindings.
+
+DSS Core
+--------
+
+Required properties:
+- compatible: "ti,dra7-dss"
+- reg: address and length of the register spaces for 'dss'
+- ti,hwmods: "dss_core"
+- clocks: handle to fclk
+- clock-names: "fck"
+- syscon: phandle to control module core syscon node
+
+Optional properties:
+
+Some DRA7xx SoCs have one dedicated video PLL, some have two. These properties
+can be used to describe the video PLLs:
+
+- reg: address and length of the register spaces for 'pll1_clkctrl',
+ 'pll1', 'pll2_clkctrl', 'pll2'
+- clocks: handle to video1 pll clock and video2 pll clock
+- clock-names: "video1_clk" and "video2_clk"
+
+Required nodes:
+- DISPC
+
+Optional nodes:
+- DSS Submodules: HDMI
+- Video port for DPI output
+
+DPI Endpoint required properties:
+- data-lines: number of lines used
+
+
+DISPC
+-----
+
+Required properties:
+- compatible: "ti,dra7-dispc"
+- reg: address and length of the register space
+- ti,hwmods: "dss_dispc"
+- interrupts: the DISPC interrupt
+- clocks: handle to fclk
+- clock-names: "fck"
+
+HDMI
+----
+
+Required properties:
+- compatible: "ti,dra7-hdmi"
+- reg: addresses and lengths of the register spaces for 'wp', 'pll', 'phy',
+ 'core'
+- reg-names: "wp", "pll", "phy", "core"
+- interrupts: the HDMI interrupt line
+- ti,hwmods: "dss_hdmi"
+- vdda-supply: vdda power supply
+- clocks: handles to fclk and pll clock
+- clock-names: "fck", "sys_clk"
+
+Optional nodes:
+- Video port for HDMI output
+
+HDMI Endpoint optional properties:
+- lanes: list of 8 pin numbers for the HDMI lanes: CLK+, CLK-, D0+, D0-,
+ D1+, D1-, D2+, D2-. (default: 0,1,2,3,4,5,6,7)
--
2.2.2
^ permalink raw reply related
* [PATCH 08/14] OMAPDSS: DSS: Add DRA7xx base support
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
Add base support for DRA7xx to DSS core.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.c | 40 +++++++++++++++++++++++
drivers/video/fbdev/omap2/dss/dss.h | 2 ++
drivers/video/fbdev/omap2/dss/dss_features.c | 1 +
drivers/video/fbdev/omap2/dss/omapdss-boot-init.c | 1 +
4 files changed, 44 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 1884c29ef482..8c79839fbe87 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -605,6 +605,26 @@ static int dss_dpi_select_source_omap5(int port, enum omap_channel channel)
return 0;
}
+static int dss_dpi_select_source_dra7xx(int port, enum omap_channel channel)
+{
+ switch (port) {
+ case 0:
+ return dss_dpi_select_source_omap5(port, channel);
+ case 1:
+ if (channel != OMAP_DSS_CHANNEL_LCD2)
+ return -EINVAL;
+ break;
+ case 2:
+ if (channel != OMAP_DSS_CHANNEL_LCD3)
+ return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
int dss_dpi_select_source(int port, enum omap_channel channel)
{
return dss.feat->dpi_select_source(port, channel);
@@ -686,6 +706,12 @@ static const enum omap_display_type omap34xx_ports[] = {
OMAP_DISPLAY_TYPE_SDI,
};
+static const enum omap_display_type dra7xx_ports[] = {
+ OMAP_DISPLAY_TYPE_DPI,
+ OMAP_DISPLAY_TYPE_DPI,
+ OMAP_DISPLAY_TYPE_DPI,
+};
+
static const struct dss_features omap24xx_dss_feats __initconst = {
/*
* fck div max is really 16, but the divider range has gaps. The range
@@ -744,6 +770,15 @@ static const struct dss_features am43xx_dss_feats __initconst = {
.num_ports = ARRAY_SIZE(omap2plus_ports),
};
+static const struct dss_features dra7xx_dss_feats __initconst = {
+ .fck_div_max = 64,
+ .dss_fck_multiplier = 1,
+ .parent_clk_name = "dpll_per_x2_ck",
+ .dpi_select_source = &dss_dpi_select_source_dra7xx,
+ .ports = dra7xx_ports,
+ .num_ports = ARRAY_SIZE(dra7xx_ports),
+};
+
static int __init dss_init_features(struct platform_device *pdev)
{
const struct dss_features *src;
@@ -784,6 +819,10 @@ static int __init dss_init_features(struct platform_device *pdev)
src = &am43xx_dss_feats;
break;
+ case OMAPDSS_VER_DRA7xx:
+ src = &dra7xx_dss_feats;
+ break;
+
default:
return -ENODEV;
}
@@ -1003,6 +1042,7 @@ static const struct of_device_id dss_of_match[] = {
{ .compatible = "ti,omap3-dss", },
{ .compatible = "ti,omap4-dss", },
{ .compatible = "ti,omap5-dss", },
+ { .compatible = "ti,dra7-dss", },
{},
};
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index d6c9c3d3db14..4bca36a591ca 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -104,6 +104,8 @@ enum dss_pll_id {
DSS_PLL_DSI1,
DSS_PLL_DSI2,
DSS_PLL_HDMI,
+ DSS_PLL_VIDEO1,
+ DSS_PLL_VIDEO2,
};
struct dss_pll;
diff --git a/drivers/video/fbdev/omap2/dss/dss_features.c b/drivers/video/fbdev/omap2/dss/dss_features.c
index 0e6f3f54749f..376270b777f8 100644
--- a/drivers/video/fbdev/omap2/dss/dss_features.c
+++ b/drivers/video/fbdev/omap2/dss/dss_features.c
@@ -943,6 +943,7 @@ void dss_features_init(enum omapdss_version version)
break;
case OMAPDSS_VER_OMAP5:
+ case OMAPDSS_VER_DRA7xx:
omap_current_dss_features = &omap5_dss_features;
break;
diff --git a/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c
index 2f0822ee3ff9..42b87f95267c 100644
--- a/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c
+++ b/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c
@@ -186,6 +186,7 @@ static const struct of_device_id omapdss_of_match[] __initconst = {
{ .compatible = "ti,omap3-dss", },
{ .compatible = "ti,omap4-dss", },
{ .compatible = "ti,omap5-dss", },
+ { .compatible = "ti,dra7-dss", },
{},
};
--
2.2.2
^ permalink raw reply related
* [PATCH 09/14] OMAPDSS: Add functions for external control of PLL
From: Tomi Valkeinen @ 2015-01-27 10:50 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: Tomi Valkeinen
In-Reply-To: <1422355842-11234-1-git-send-email-tomi.valkeinen@ti.com>
Add functions which configure the control module register
CTRL_CORE_DSS_PLL_CONTROL found in DRA7xx SoCs. This register configures
whether the PLL registers are accessed internally by DSS, or externally
using OCP2SCP interface. They also configure muxes which route the PLL
output to a particular LCD overlay manager within DSS.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.c | 115 ++++++++++++++++++++++++++++++++++++
drivers/video/fbdev/omap2/dss/dss.h | 4 ++
2 files changed, 119 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 8c79839fbe87..d75238f2c537 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -34,6 +34,8 @@
#include <linux/pm_runtime.h>
#include <linux/gfp.h>
#include <linux/sizes.h>
+#include <linux/mfd/syscon.h>
+#include <linux/regmap.h>
#include <linux/of.h>
#include <video/omapdss.h>
@@ -78,6 +80,8 @@ struct dss_features {
static struct {
struct platform_device *pdev;
void __iomem *base;
+ struct regmap *syscon_pll_ctrl;
+ u32 syscon_pll_ctrl_offset;
struct clk *parent_clk;
struct clk *dss_clk;
@@ -158,6 +162,99 @@ static void dss_restore_context(void)
#undef SR
#undef RR
+void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable)
+{
+ unsigned shift;
+ unsigned val;
+
+ if (!dss.syscon_pll_ctrl)
+ return;
+
+ val = !enable;
+
+ switch (pll_id) {
+ case DSS_PLL_VIDEO1:
+ shift = 0;
+ break;
+ case DSS_PLL_VIDEO2:
+ shift = 1;
+ break;
+ case DSS_PLL_HDMI:
+ shift = 2;
+ break;
+ default:
+ DSSERR("illegal DSS PLL ID %d\n", pll_id);
+ return;
+ }
+
+ regmap_update_bits(dss.syscon_pll_ctrl, dss.syscon_pll_ctrl_offset,
+ 1 << shift, val << shift);
+}
+
+void dss_ctrl_pll_set_control_mux(enum dss_pll_id pll_id,
+ enum omap_channel channel)
+{
+ unsigned shift, val;
+
+ if (!dss.syscon_pll_ctrl)
+ return;
+
+ switch (channel) {
+ case OMAP_DSS_CHANNEL_LCD:
+ shift = 3;
+
+ switch (pll_id) {
+ case DSS_PLL_VIDEO1:
+ val = 0; break;
+ case DSS_PLL_HDMI:
+ val = 1; break;
+ default:
+ DSSERR("error in PLL mux config for LCD\n");
+ return;
+ }
+
+ break;
+ case OMAP_DSS_CHANNEL_LCD2:
+ shift = 5;
+
+ switch (pll_id) {
+ case DSS_PLL_VIDEO1:
+ val = 0; break;
+ case DSS_PLL_VIDEO2:
+ val = 1; break;
+ case DSS_PLL_HDMI:
+ val = 2; break;
+ default:
+ DSSERR("error in PLL mux config for LCD2\n");
+ return;
+ }
+
+ break;
+ case OMAP_DSS_CHANNEL_LCD3:
+ shift = 7;
+
+ switch (pll_id) {
+ case DSS_PLL_VIDEO1:
+ val = 1; break;
+ case DSS_PLL_VIDEO2:
+ val = 0; break;
+ case DSS_PLL_HDMI:
+ val = 2; break;
+ default:
+ DSSERR("error in PLL mux config for LCD3\n");
+ return;
+ }
+
+ break;
+ default:
+ DSSERR("error in PLL mux config\n");
+ return;
+ }
+
+ regmap_update_bits(dss.syscon_pll_ctrl, dss.syscon_pll_ctrl_offset,
+ 0x3 << shift, val << shift);
+}
+
void dss_sdi_init(int datapairs)
{
u32 l;
@@ -923,6 +1020,7 @@ static void __exit dss_uninit_ports(struct platform_device *pdev)
static int __init omap_dsshw_probe(struct platform_device *pdev)
{
struct resource *dss_mem;
+ struct device_node *np = pdev->dev.of_node;
u32 rev;
int r;
@@ -979,6 +1077,23 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
dss_init_ports(pdev);
+ if (np && of_property_read_bool(np, "syscon-pll-ctrl")) {
+ dss.syscon_pll_ctrl = syscon_regmap_lookup_by_phandle(np,
+ "syscon-pll-ctrl");
+ if (IS_ERR(dss.syscon_pll_ctrl)) {
+ dev_err(&pdev->dev,
+ "failed to get syscon-pll-ctrl regmap\n");
+ return PTR_ERR(dss.syscon_pll_ctrl);
+ }
+
+ if (of_property_read_u32_index(np, "syscon-pll-ctrl", 1,
+ &dss.syscon_pll_ctrl_offset)) {
+ dev_err(&pdev->dev,
+ "failed to get syscon-pll-ctrl offset\n");
+ return -EINVAL;
+ }
+ }
+
rev = dss_read_reg(DSS_REVISION);
printk(KERN_INFO "OMAP DSS rev %d.%d\n",
FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 4bca36a591ca..76a6eb1da090 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -274,6 +274,10 @@ u32 dss_of_port_get_port_number(struct device_node *port);
void dss_debug_dump_clocks(struct seq_file *s);
#endif
+void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable);
+void dss_ctrl_pll_set_control_mux(enum dss_pll_id pll_id,
+ enum omap_channel channel);
+
void dss_sdi_init(int datapairs);
int dss_sdi_enable(void);
void dss_sdi_disable(void);
--
2.2.2
^ permalink raw reply related
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