linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REVIEW PATCH 0/5] img-ir: Some fixes
@ 2014-11-17 12:17 James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH FOR v3.18 1/5] img-ir/hw: Always read data to clear buffer James Hogan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: James Hogan

Here are a few fixes for the img-ir RC driver.

Patch 1 is the important one. I've tagged it for stable.

The other 4 are minor fixes/improvements that don't need backporting to
stable.

Dylan Rajaratnam (1):
  img-ir/hw: Always read data to clear buffer

James Hogan (4):
  img-ir/hw: Drop [un]register_decoder declarations
  img-ir: Depend on METAG or MIPS or COMPILE_TEST
  img-ir: Don't set driver's module owner
  MAINTAINERS: Add myself as img-ir maintainer

 MAINTAINERS                           | 5 +++++
 drivers/media/rc/img-ir/Kconfig       | 1 +
 drivers/media/rc/img-ir/img-ir-core.c | 1 -
 drivers/media/rc/img-ir/img-ir-hw.c   | 6 ++++--
 drivers/media/rc/img-ir/img-ir-hw.h   | 3 ---
 5 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.0.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [REVIEW PATCH FOR v3.18 1/5] img-ir/hw: Always read data to clear buffer
  2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
@ 2014-11-17 12:17 ` James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 2/5] img-ir/hw: Drop [un]register_decoder declarations James Hogan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Dylan Rajaratnam, James Hogan, stable

From: Dylan Rajaratnam <dylan.rajaratnam@imgtec.com>

A problem was found on Polaris where if the unit it booted via the power
button on the infrared remote then the next button press on the remote
would return the key code used to power on the unit.

The sequence is:
 - The polaris powered off but with the powerdown controller (PDC) block
   still powered.
 - Press power key on remote, IR block receives the key.
 - Kernel starts, IR code is in IMG_IR_DATA_x but neither IMG_IR_RXDVAL
   or IMG_IR_RXDVALD2 are set.
 - Wait any amount of time.
 - Press any key.
 - IMG_IR_RXDVAL or IMG_IR_RXDVALD2 is set but IMG_IR_DATA_x is
   unchanged since the powerup key data was never read.

This is worked around by always reading the IMG_IR_DATA_x in
img_ir_set_decoder(), rather than only when the IMG_IR_RXDVAL or
IMG_IR_RXDVALD2 bit is set.

Signed-off-by: Dylan Rajaratnam <dylan.rajaratnam@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
Cc: <stable@vger.kernel.org> # v3.15+
---
 drivers/media/rc/img-ir/img-ir-hw.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c
index ec49f94425fc..9db065344b41 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.c
+++ b/drivers/media/rc/img-ir/img-ir-hw.c
@@ -541,10 +541,12 @@ static void img_ir_set_decoder(struct img_ir_priv *priv,
 	if (ir_status & (IMG_IR_RXDVAL | IMG_IR_RXDVALD2)) {
 		ir_status &= ~(IMG_IR_RXDVAL | IMG_IR_RXDVALD2);
 		img_ir_write(priv, IMG_IR_STATUS, ir_status);
-		img_ir_read(priv, IMG_IR_DATA_LW);
-		img_ir_read(priv, IMG_IR_DATA_UP);
 	}
 
+	/* always read data to clear buffer if IR wakes the device */
+	img_ir_read(priv, IMG_IR_DATA_LW);
+	img_ir_read(priv, IMG_IR_DATA_UP);
+
 	/* stop the end timer and switch back to normal mode */
 	del_timer_sync(&hw->end_timer);
 	hw->mode = IMG_IR_M_NORMAL;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [REVIEW PATCH 2/5] img-ir/hw: Drop [un]register_decoder declarations
  2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH FOR v3.18 1/5] img-ir/hw: Always read data to clear buffer James Hogan
@ 2014-11-17 12:17 ` James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 3/5] img-ir: Depend on METAG or MIPS or COMPILE_TEST James Hogan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: James Hogan

The img_ir_register_decoder() and img_ir_unregister_decoder() functions
were dropped prior to the img-ir driver being applied to simplify the
protocol decoder setup. However the declarations of these functions in
img-ir-hw.h were still included. Delete them since they're completely
unused.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
---
 drivers/media/rc/img-ir/img-ir-hw.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/rc/img-ir/img-ir-hw.h b/drivers/media/rc/img-ir/img-ir-hw.h
index 8fcc16c32c5b..a8c6a8d40206 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.h
+++ b/drivers/media/rc/img-ir/img-ir-hw.h
@@ -186,9 +186,6 @@ struct img_ir_reg_timings {
 	struct img_ir_timing_regvals	rtimings;
 };
 
-int img_ir_register_decoder(struct img_ir_decoder *dec);
-void img_ir_unregister_decoder(struct img_ir_decoder *dec);
-
 struct img_ir_priv;
 
 #ifdef CONFIG_IR_IMG_HW
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [REVIEW PATCH 3/5] img-ir: Depend on METAG or MIPS or COMPILE_TEST
  2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH FOR v3.18 1/5] img-ir/hw: Always read data to clear buffer James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 2/5] img-ir/hw: Drop [un]register_decoder declarations James Hogan
@ 2014-11-17 12:17 ` James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 4/5] img-ir: Don't set driver's module owner James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 5/5] MAINTAINERS: Add myself as img-ir maintainer James Hogan
  4 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: James Hogan

The ImgTec Infrared decoder block which img-ir drives is only used in
IMGWorks SoCs so far, such as the TZ1090 (Meta based) and the upcoming
Pistachio (MIPS based). Therefore make the driver depend on METAG (for
TZ1090) or MIPS (for Pistachio) or COMPILE_TEST (so that it is included
in x86 allmodconfig builds), to avoid cluttering the Kconfig menu with
drivers for hardware that isn't yet available on other platforms.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
---
 drivers/media/rc/img-ir/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/img-ir/Kconfig b/drivers/media/rc/img-ir/Kconfig
index 03ba9fc170fb..580715c7fc5e 100644
--- a/drivers/media/rc/img-ir/Kconfig
+++ b/drivers/media/rc/img-ir/Kconfig
@@ -1,6 +1,7 @@
 config IR_IMG
 	tristate "ImgTec IR Decoder"
 	depends on RC_CORE
+	depends on METAG || MIPS || COMPILE_TEST
 	select IR_IMG_HW if !IR_IMG_RAW
 	help
 	   Say Y or M here if you want to use the ImgTec infrared decoder
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [REVIEW PATCH 4/5] img-ir: Don't set driver's module owner
  2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
                   ` (2 preceding siblings ...)
  2014-11-17 12:17 ` [REVIEW PATCH 3/5] img-ir: Depend on METAG or MIPS or COMPILE_TEST James Hogan
@ 2014-11-17 12:17 ` James Hogan
  2014-11-17 12:17 ` [REVIEW PATCH 5/5] MAINTAINERS: Add myself as img-ir maintainer James Hogan
  4 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: James Hogan

Don't bother setting .owner = THIS_MODULE, since it's already handled by
the platform_driver_register macro.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
---
 drivers/media/rc/img-ir/img-ir-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/rc/img-ir/img-ir-core.c b/drivers/media/rc/img-ir/img-ir-core.c
index a0cac2f09109..77c78de4f5bf 100644
--- a/drivers/media/rc/img-ir/img-ir-core.c
+++ b/drivers/media/rc/img-ir/img-ir-core.c
@@ -166,7 +166,6 @@ MODULE_DEVICE_TABLE(of, img_ir_match);
 static struct platform_driver img_ir_driver = {
 	.driver = {
 		.name = "img-ir",
-		.owner	= THIS_MODULE,
 		.of_match_table	= img_ir_match,
 		.pm = &img_ir_pmops,
 	},
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [REVIEW PATCH 5/5] MAINTAINERS: Add myself as img-ir maintainer
  2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
                   ` (3 preceding siblings ...)
  2014-11-17 12:17 ` [REVIEW PATCH 4/5] img-ir: Don't set driver's module owner James Hogan
@ 2014-11-17 12:17 ` James Hogan
  4 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2014-11-17 12:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: James Hogan

Add myself as the maintainer for the Imagination Technologies Infrared
Decoder driver.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
---
 MAINTAINERS | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ea4d0058fd1b..814cf15448ad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4757,6 +4757,11 @@ L:	linux-security-module@vger.kernel.org
 S:	Supported
 F:	security/integrity/ima/
 
+IMGTEC IR DECODER DRIVER
+M:	James Hogan <james.hogan@imgtec.com>
+S:	Maintained
+F:	drivers/media/rc/img-ir/
+
 IMS TWINTURBO FRAMEBUFFER DRIVER
 L:	linux-fbdev@vger.kernel.org
 S:	Orphan
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-17 12:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 12:17 [REVIEW PATCH 0/5] img-ir: Some fixes James Hogan
2014-11-17 12:17 ` [REVIEW PATCH FOR v3.18 1/5] img-ir/hw: Always read data to clear buffer James Hogan
2014-11-17 12:17 ` [REVIEW PATCH 2/5] img-ir/hw: Drop [un]register_decoder declarations James Hogan
2014-11-17 12:17 ` [REVIEW PATCH 3/5] img-ir: Depend on METAG or MIPS or COMPILE_TEST James Hogan
2014-11-17 12:17 ` [REVIEW PATCH 4/5] img-ir: Don't set driver's module owner James Hogan
2014-11-17 12:17 ` [REVIEW PATCH 5/5] MAINTAINERS: Add myself as img-ir maintainer James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).