[PATCH] rc: ir-raw: change type of available_protocols to atomic64_t

2016-09-27 Thread Heiner Kallweit
Changing available_protocols to atomic64_t allows to get rid of the mutex protecting access to the variable. This helps to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-ir-raw.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a

[PATCH 1/2] rc: core: add managed versions of rc_allocate_device and rc_register_device

2016-09-30 Thread Heiner Kallweit
rc_register_device and normal version of rc_allocate_device. In addition devm_rc_allocate_device sets rc->dev.parent as having a reference to the parent device might be useful for future extensions. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-main.c |

[PATCH 2/2] rc: nuvoton: use managed versions of rc_allocate_device and rc_register_device

2016-09-30 Thread Heiner Kallweit
Simplify the remove function and the error path in the probe function by using the managed versions of rc_allocate_device and rc_register_device. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 50 +- 1 file changed, 20 insertions

[PATCH] media: rc: core: simplify DEFINE_IR_RAW_EVENT

2015-12-30 Thread Heiner Kallweit
ff-by: Heiner Kallweit --- include/media/rc-core.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/media/rc-core.h b/include/media/rc-core.h index f649470..91c6633 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -226,13 +226,7 @@ s

[PATCH 01/16] media: rc: nuvoton-cir: use request_muxed_region for accessing EFM registers

2015-12-30 Thread Heiner Kallweit
The two EFM ioports are accessed by drivers for other parts of the Nuvoton Super-IO chips too. Therefore access to these ioports needs to be protected by using request_muxed_region (like it's implemented e.g. in hwmon/nct6775 already). Signed-off-by: Heiner Kallweit --- drivers/media/rc/nu

[PATCH 00/16] media: rc: nuvoton-cir: series with improvements and fixes

2015-12-30 Thread Heiner Kallweit
Heiner Kallweit (16): media: rc: nuvoton-cir: use request_muxed_region for accessing EFM registers media: rc: nuvoton-cir: simplify nvt_select_logical_ dev media: rc: nuvoton-cir: simplify nvt_cir_tx_inactive media: rc: nuvoton-cir: factor out logical device disabling media: rc: nuvoton

[PATCH 05/16] media: rc: nuvoton-cir: factor out logical device enabling

2015-12-30 Thread Heiner Kallweit
Factor out enabling of a logical device. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index ceb6b95..8ed8011 100644

[PATCH 09/16] media: rc: nuvoton-cir: use IR_DEFAULT_TIMEOUT and consider SAMPLE_PERIOD

2015-12-30 Thread Heiner Kallweit
Switch to using the recently introduced IR default timeout value (IR_DEFAULT_TIMEOUT) and consider the value of SAMPLE_PERIOD when calculating the limit count register value. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 02/16] media: rc: nuvoton-cir: simplify nvt_select_logical_ dev

2015-12-30 Thread Heiner Kallweit
Use nvt_cr_write to simplify nvt_select_logical_ dev. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 62c82c5..2539d4f 100644 --- a

[PATCH 06/16] media: rc: nuvoton-cir: fix clearing wake fifo

2015-12-30 Thread Heiner Kallweit
t. If needed the caller of nvt_clear_cir_wake_fifo has to take care of locking. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 8e

[PATCH 03/16] media: rc: nuvoton-cir: simplify nvt_cir_tx_inactive

2015-12-30 Thread Heiner Kallweit
Simplify nvt_cir_tx_inactive. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 2539d4f..f661eff 100644 --- a/drivers/media/rc/nuvoton

[PATCH 04/16] media: rc: nuvoton-cir: factor out logical device disabling

2015-12-30 Thread Heiner Kallweit
Factor out disabling of a logical device. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index f661eff..ceb6b95 100644

[PATCH 08/16] media: rc: nuvoton-cir: remove unneeded EFM operation in nvt_cir_isr

2015-12-30 Thread Heiner Kallweit
Selecting the logical device in the interrupt handler is not needed as no configuration register is accessed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c

[PATCH 12/16] media: rc: nuvoton-cir: remove unneeded call to nvt_set_cir_iren

2015-12-30 Thread Heiner Kallweit
Calling nvt_set_cir_iren separately is not needed as this is done by nvt_cir_regs_init. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index e01fdc8..252804d

[PATCH 11/16] media: rc: nuvoton-cir: improve logical device handling

2015-12-30 Thread Heiner Kallweit
Only enable the logical devices after the registers have been initialized. The call to nvt_enable_logical_dev in nvt_resume is not needed as this is done implicitely by nvt_cir_regs_init now. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 21 - 1 file

[PATCH 10/16] media: rc: nuvoton-cir: improve nvt_hw_detect

2015-12-30 Thread Heiner Kallweit
Check for the case that no Nuvoton chip is found on either EFM port. Also move the position of nvt_efm_disable to reduce the time the EFM ports are locked. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 17 + drivers/media/rc/nuvoton-cir.h | 3 ++- 2 files

[PATCH 15/16] media: rc: nuvoton-cir: fix interrupt handling

2015-12-30 Thread Heiner Kallweit
. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index c3294fb..c0bee1e 100644 --- a/drivers/media/rc/nuvoton

[PATCH 16/16] media: rc: nuvoton-cir: improve locking in both interrupt handlers

2015-12-30 Thread Heiner Kallweit
Extend the locking to protect more critical actions like register accesses in the interrupt handlers. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b

[PATCH 13/16] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wake

2015-12-30 Thread Heiner Kallweit
Add locking to nvt_enable_wake calls. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 252804d..c3294fb 100644 --- a

[PATCH 14/16] media: rc: nuvoton-cir: fix wakeup interrupt bits

2015-12-30 Thread Heiner Kallweit
Most likely a copy & paste error. The wakeup interrupt supports less triggering events. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h i

[PATCH 07/16] media: rc: nuvoton-cir: fix setting ioport base address

2015-12-30 Thread Heiner Kallweit
evice. And the change should be generic enough to not break the driver for other chips (however due to lack of appropriate hardware I wasn't able to test this). Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 22 ++ 1 file changed, 18 insertions(+), 4

Re: [git:media_tree/master] [media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs

2016-03-03 Thread Heiner Kallweit
eup > sequence via sysfs > Author: Heiner Kallweit > Date:Mon Feb 8 17:25:59 2016 -0200 > > This patch adds a binary attribute /sys/class/rc/rc?/wakeup_data which > allows to read / write the wakeup sequence. > When working on another module I was reminded not to f

Re: [git:media_tree/master] [media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs

2016-03-03 Thread Heiner Kallweit
Am 03.03.2016 um 19:52 schrieb Mauro Carvalho Chehab: > Em Thu, 03 Mar 2016 19:18:17 +0100 > Heiner Kallweit escreveu: > >> Am 03.03.2016 um 12:28 schrieb Mauro Carvalho Chehab: >>> This is an automatic generated email to let you know that the following >>> p

Re: [git:media_tree/master] [media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs

2016-03-03 Thread Heiner Kallweit
Am 03.03.2016 um 21:56 schrieb Mauro Carvalho Chehab: > Em Thu, 03 Mar 2016 20:22:35 +0100 > Heiner Kallweit escreveu: > >> Am 03.03.2016 um 19:52 schrieb Mauro Carvalho Chehab: >>> Em Thu, 03 Mar 2016 19:18:17 +0100 >>> Heiner Kallweit escreveu: >>>

[PATCH] media: rc: nuvoton: switch attribute wakeup_data to text

2016-03-04 Thread Heiner Kallweit
the setting of SAMPLE_PERIOD in the driver. In addition document the new sysfs attribute in Documentation/ABI/testing/sysfs-class-rc-nuvoton. Signed-off-by: Heiner Kallweit --- Documentation/ABI/testing/sysfs-class-rc-nuvoton | 15 + drivers/media/rc/nuvoton-cir.c | 85

media: rc: make raw event fifo size a module parameter

2016-03-18 Thread Heiner Kallweit
also depend on system performance. Therefore make the fifo size a module parameter with the current value of 512 being the default. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-core-priv.h | 2 +- drivers/media/rc/rc-ir-raw.c| 20 +--- 2 files changed, 18 insertions

Re: [PATCH] media: rc: reduce size of struct ir_raw_event

2016-03-18 Thread Heiner Kallweit
Am 16.03.2016 um 23:28 schrieb Sean Young: > On Wed, Mar 16, 2016 at 10:18:38PM +0100, Heiner Kallweit wrote: >> struct ir_raw_event currently has a size of 12 bytes on most (all?) >> architectures. This can be reduced to 8 bytes whilst maintaining >> full backwards compati

[PATCH v2] media: rc: reduce size of struct ir_raw_event

2016-03-18 Thread Heiner Kallweit
ir_raw_event with a single 64 bit operation. Successfully tested with the Nuvoton driver and successfully compile-tested with the ene_ir driver (as it uses the carrier / duty_cycle elements). Signed-off-by: Heiner Kallweit --- v2: - don't change type of bit field members --- include/med

[PATCH v2] media: rc: remove unneeded mutex in rc_register_device

2016-03-19 Thread Heiner Kallweit
Access to dev->initialized is atomic and dev->initialized isn't accessed in any other code protected by this mutex. Therefore we don't need to get the mutex here. Signed-off-by: Heiner Kallweit --- v2: - corrected commit message --- drivers/media/rc/rc-main.c | 2 -- 1 file chan

Re: [PATCH] media: rc: reduce size of struct ir_raw_event

2016-03-19 Thread Heiner Kallweit
Am 17.03.2016 um 11:53 schrieb Sean Young: > On Thu, Mar 17, 2016 at 07:40:59AM +0100, Heiner Kallweit wrote: >> Am 16.03.2016 um 23:28 schrieb Sean Young: >>> On Wed, Mar 16, 2016 at 10:18:38PM +0100, Heiner Kallweit wrote: >>>> + u8 pulse:1; &

[PATCH] media: rc: remove unneeded mutex in rc_register_device

2016-03-19 Thread Heiner Kallweit
Access to dev->initialized is atomic, therefore we don't have to protect it with a mutex. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 4e9bbe7..68541b

[PATCH] media: rc: reduce size of struct ir_raw_event

2016-03-19 Thread Heiner Kallweit
ir_raw_event with a single 64 bit operation. Successfully tested with the Nuvoton driver and successfully compile-tested with the ene_ir driver (as it uses the carrier / duty_cycle elements). Signed-off-by: Heiner Kallweit --- include/media/rc-core.h | 26 -- 1 file

Re: [PATCH] media: rc: remove unneeded mutex in rc_register_device

2016-03-20 Thread Heiner Kallweit
Am 16.03.2016 um 20:33 schrieb Vladimir Zapolskiy: > On 16.03.2016 20:53, Heiner Kallweit wrote: >> Access to dev->initialized is atomic, therefore we don't have to >> protect it with a mutex. > > Mutexes are used to split the code to mutually exclusive execution b

[PATCH] media: rc: nuvoton: remove rudimentary transmit functionality

2017-07-15 Thread Heiner Kallweit
his driver. To facilitate maintenance of the driver I'd propose to remove the rudimentary transmit support. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 114 ++--- drivers/media/rc/nuvoton-cir.h | 24 - 2 files changed,

Re: [PATCH] media: rc: refactor raw handler kthread

2016-12-26 Thread Heiner Kallweit
Am 02.08.2016 um 07:44 schrieb Heiner Kallweit: > I think we can get rid of the spinlock protecting the kthread from being > interrupted by a wakeup in certain parts. > Even with the current implementation of the kthread the only lost wakeup > scenario could happen if the wakeup occurs

[PATCH] media: rc: nuvoton: fix deadlock in nvt_write_wakeup_codes

2017-02-12 Thread Heiner Kallweit
2c [ 432.485980] x86_64_start_kernel+0x178/0x18b [ 432.488222] start_cpu+0x14/0x14 [ 432.490453] ? start_cpu+0x14/0x14 Fixes: 97c129747af5 "[media] rc: nuvoton-cir: Add support wakeup via sysfs filter callback" Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-c

[PATCH 0/5] media: rc: meson-ir: series with smaller improvements

2017-04-10 Thread Heiner Kallweit
This series includes smaller improvements for the meson-ir driver. Tested on a Odroid C2. Heiner Kallweit (5): media: rc: meson-ir: remove irq from struct meson_ir media: rc: meson-ir: make use of the bitfield macros media: rc: meson-ir: switch to managed rc device allocation / registration

[PATCH 3/5] media: rc: meson-ir: switch to managed rc device allocation / registration

2017-04-10 Thread Heiner Kallweit
Switch to the managed versions of rc_allocate_device/rc_register_device, thus simplifying the code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/meson-ir.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media

[PATCH 2/5] media: rc: meson-ir: make use of the bitfield macros

2017-04-10 Thread Heiner Kallweit
Make use of the bitfield macros thus partially hiding the complexity of dealing with bitfields. The patch also includes a minor fix to REG0_RATE_MASK, so far it was set to bit 0..10, but according to the spec it's bit 0..11. Signed-off-by: Heiner Kallweit --- drivers/media/rc/meson-ir.c

[PATCH 1/5] media: rc: meson-ir: remove irq from struct meson_ir

2017-04-10 Thread Heiner Kallweit
The irq number is used in the probe function only, therefore just use a local variable. Signed-off-by: Heiner Kallweit --- drivers/media/rc/meson-ir.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c index

[PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler

2017-04-10 Thread Heiner Kallweit
We don't need the memory barriers here and an interrupt handler should be as fast as possible. Therefore switch to readl_relaxed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/meson-ir.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/meson

[PATCH 5/5] media: rc: meson-ir: change irq name to to of node name

2017-04-10 Thread Heiner Kallweit
Switch the interrupt description to the default which is the of node name. This is more in line with the interrupt descriptions in other meson drivers. Signed-off-by: Heiner Kallweit --- drivers/media/rc/meson-ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH v2 0/5] media: rc: meson-ir: series with smaller improvements

2017-04-12 Thread Heiner Kallweit
This series includes smaller improvements for the meson-ir driver. Tested on a Odroid C2. v2: - minor change to patch 2 - added Reviewed-by to patch 2, 3, 4 Heiner Kallweit (5): media: rc: meson-ir: remove irq from struct meson_ir media: rc: meson-ir: make use of the bitfield macros media

[PATCH v2 1/5] media: rc: meson-ir: remove irq from struct meson_ir

2017-04-12 Thread Heiner Kallweit
The irq number is used in the probe function only, therefore just use a local variable. Signed-off-by: Heiner Kallweit --- v2: - no changes --- drivers/media/rc/meson-ir.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media

[PATCH v2 3/5] media: rc: meson-ir: switch to managed rc device allocation / registration

2017-04-12 Thread Heiner Kallweit
Switch to the managed versions of rc_allocate_device/rc_register_device, thus simplifying the code. Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong --- v2: - added R-b --- drivers/media/rc/meson-ir.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff

[PATCH v2 5/5] media: rc: meson-ir: change irq name to to of node name

2017-04-12 Thread Heiner Kallweit
Switch the interrupt description to the default which is the of node name. This is more in line with the interrupt descriptions in other meson drivers. Signed-off-by: Heiner Kallweit --- v2: - no changes --- drivers/media/rc/meson-ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 2/5] media: rc: meson-ir: make use of the bitfield macros

2017-04-12 Thread Heiner Kallweit
Make use of the bitfield macros thus partially hiding the complexity of dealing with bitfields. The patch also includes a minor fix to REG0_RATE_MASK, so far it was set to bit 0..10, but according to the spec it's bit 0..11. Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong -

[PATCH v2 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler

2017-04-12 Thread Heiner Kallweit
We don't need the memory barriers here and an interrupt handler should be as fast as possible. Therefore switch to readl_relaxed. Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong --- v2: - added R-b --- drivers/media/rc/meson-ir.c | 7 --- 1 file changed, 4 insertions(

[PATCH] media: rc: make fifo size for raw events configurable via rc_dev

2016-05-18 Thread Heiner Kallweit
raw_fifo_size to struct rc_dev to allow configuring the fifo size. If not set the current default MAX_IR_EVENT_SIZE is used. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-core-priv.h | 2 +- drivers/media/rc/rc-ir-raw.c| 11 +-- include/media/rc-core.h | 2 ++ 3 files

[PATCH] media: rc: nuvoton: decrease size of raw event fifo

2016-05-18 Thread Heiner Kallweit
This chip has a 32 byte HW FIFO only. Therefore the default fifo size of 512 raw events is not needed and can be significantly decreased. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/rc/nuvoton-cir.c b

[PATCH v2 2/2] media: rc: nuvoton: decrease size of raw event fifo

2016-05-19 Thread Heiner Kallweit
This chip has a 32 byte HW FIFO only. Therefore the default fifo size of 512 raw events is not needed and can be significantly decreased. Signed-off-by: Heiner Kallweit --- v2: - make patch part of a series --- drivers/media/rc/nuvoton-cir.c | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH v2 1/2] media: rc: make fifo size for raw events configurable via rc_dev

2016-05-19 Thread Heiner Kallweit
raw_fifo_size to struct rc_dev to allow configuring the fifo size. If not set the current default MAX_IR_EVENT_SIZE is used. Signed-off-by: Heiner Kallweit --- v2: - access dev->raw_fifo_size only after check for !dev --- drivers/media/rc/rc-core-priv.h | 2 +- drivers/media/rc/rc-ir-raw.c|

[PATCH] media: rc: nuvoton: fix rx fifo overrun handling

2016-05-22 Thread Heiner Kallweit
To detect a rx fifo overrun it's checked whether the number of elements in the chip fifo exceeds the fifo size. This check can never return true and is wrong. Instead we should generate an interrupt if the fifo overruns. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c

[PATCH 0/9] media: rc: nuvoton: several clean-ups / removal of dead code

2016-06-23 Thread Heiner Kallweit
This patch set for the nuvoton-cir driver includes several clean-ups and removes dead code. Heiner Kallweit (9): media: rc: nuvoton: remove interrupt handling for wakeup media: rc: nuvoton: clean up initialization of wakeup registers media: rc: nuvoton: remove wake states media: rc

[PATCH 8/9] media: rc: nuvoton: remove unneeded check in nvt_get_rx_ir_data

2016-06-23 Thread Heiner Kallweit
If the logical device is disabled then it can not generate interrupts. Therefore this check is not needed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c

[PATCH 5/9] media: rc: nuvoton: remove unneeded code in nvt_process_rx_ir_data

2016-06-23 Thread Heiner Kallweit
The definition of rawir includes the initialization already. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 1d99f10..9d9717d 100644 --- a/drivers/media

[PATCH 4/9] media: rc: nuvoton: simplify a few functions

2016-06-23 Thread Heiner Kallweit
Simplify a few functions. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index c405c83..1d99f10 100644 --- a/drivers/media/rc

[PATCH 6/9] media: rc: nuvoton: remove study states

2016-06-23 Thread Heiner Kallweit
Study states have never been used and are not needed. Remove them. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 11 +-- drivers/media/rc/nuvoton-cir.h | 13 - 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c

[PATCH 7/9] media: rc: nuvoton: simplify interrupt handling code

2016-06-23 Thread Heiner Kallweit
Simplify interupt handling code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 5ce0238..180f589 100644 --- a/drivers/media/rc

[PATCH 3/9] media: rc: nuvoton: remove wake states

2016-06-23 Thread Heiner Kallweit
Wake states have never been in use and now that we can set the wakeup sequence via sysfs there's in general no need for them. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 1 - drivers/media/rc/nuvoton-cir.h | 7 --- 2 files changed, 8 deletions(-) diff --

[PATCH 2/9] media: rc: nuvoton: clean up initialization of wakeup registers

2016-06-23 Thread Heiner Kallweit
The registers defining wakeup sequence handling are set when the wakeup sequence is set via sysfs. There's no need to initialize them otherwise. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 25 +++-- 1 file changed, 3 insertions(+), 22 dele

[PATCH 9/9] media: rc: nuvoton: remove two unused elements in struct nvt_dev

2016-06-23 Thread Heiner Kallweit
These two fields are not used and can be removed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h index 65324ef..acf735f 100644 --- a/drivers/media/rc/nuvoton

[PATCH 1/9] media: rc: nuvoton: remove interrupt handling for wakeup

2016-06-23 Thread Heiner Kallweit
ff-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 58 ++ drivers/media/rc/nuvoton-cir.h | 1 - 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 4a8f79c..b32f3bf 1

Re: [PATCH] media: rc: nuvoton: decrease size of raw event fifo

2016-07-04 Thread Heiner Kallweit
Am 04.07.2016 um 22:13 schrieb Sean Young: > On Wed, May 18, 2016 at 10:29:41PM +0200, Heiner Kallweit wrote: >> This chip has a 32 byte HW FIFO only. Therefore the default fifo size >> of 512 raw events is not needed and can be significantly decreased. >> >> Sig

Re: IR remote stopped working in kernels 4.5 and 4.6

2016-07-04 Thread Heiner Kallweit
Am 04.07.2016 um 22:36 schrieb James Bottomley: > This looks to be a problem with the rc subsystem. The IR controller in > question is part of a cx8800 atsc card. In the 4.4 kernel, where it > works, this is what ir-keytable says: > > Found /sys/class/rc/rc0/ (/dev/input/event12) with: > Dr

Re: IR remote stopped working in kernels 4.5 and 4.6

2016-07-04 Thread Heiner Kallweit
Am 04.07.2016 um 23:18 schrieb James Bottomley: > On Mon, 2016-07-04 at 23:08 +0200, Heiner Kallweit wrote: >> Am 04.07.2016 um 22:36 schrieb James Bottomley: >>> This looks to be a problem with the rc subsystem. The IR >>> controller in question is part of a c

Re: [PATCH] media: rc: nuvoton: decrease size of raw event fifo

2016-07-04 Thread Heiner Kallweit
Am 04.07.2016 um 23:06 schrieb Sean Young: > On Mon, Jul 04, 2016 at 10:51:50PM +0200, Heiner Kallweit wrote: >> Am 04.07.2016 um 22:13 schrieb Sean Young: >>> On Wed, May 18, 2016 at 10:29:41PM +0200, Heiner Kallweit wrote: >>>> This chip has a 32 byte HW FIFO on

Re: [PATCH] media: rc: nuvoton: decrease size of raw event fifo

2016-07-05 Thread Heiner Kallweit
Am 05.07.2016 um 11:17 schrieb Sean Young: > On Tue, Jul 05, 2016 at 08:05:16AM +0200, Heiner Kallweit wrote: >> Am 04.07.2016 um 23:06 schrieb Sean Young: >>> On Mon, Jul 04, 2016 at 10:51:50PM +0200, Heiner Kallweit wrote: >>>> Am 04.07.2016 um 22:13 schrieb Se

Re: Recent nuvoton-cir changes introduce a hang with nct6775

2016-07-06 Thread Heiner Kallweit
Am 06.07.2016 um 08:51 schrieb Antti Seppälä: > Hello. > > I recently updated my kernel to a newer version but couldn't boot it > because it hangs. > > It turns out that your patch[1] to nuvoton-cir has really bad > side-effects when it interacts with nct6775 module. It could be that > one of the

[PATCH] rc: nuvoton: fix hang if chip is configured for alternative EFM IO address

2016-07-06 Thread Heiner Kallweit
after the nuvoton-cir driver. This was reported for the nct6775 hwmon driver. Fix this by properly releasing the region after probing CR_EFIR. This regression was introduced with kernel 4.6 so cc it to stable. Reported-by: Antti Seppälä Signed-off-by: Heiner Kallweit Tested-by: Antti Seppälä Cc

[PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close

2016-10-25 Thread Heiner Kallweit
unctions can be removed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 3df3bd9..37fce7b 100644 --- a/drivers/media/rc/nuvo

[PATCH 2/5] media: rc: nuvoton: eliminate member pdev from struct nvt_dev

2016-10-25 Thread Heiner Kallweit
Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 27 ++- drivers/media/rc/nuvoton-cir.h | 1 - 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 37fce7b..a583066 100644

[PATCH 4/5] media: rc: nuvoton: rename spinlock nvt_lock

2016-10-25 Thread Heiner Kallweit
Spinlock nvt_lock is a member of struct nvt_dev and there's no need to prefix it with nvt_. So remove this prefix. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 40 drivers/media/rc/nuvoton-cir.h | 2 +- 2 files change

[PATCH 3/5] media: rc: nuvoton: eliminate nvt->tx.lock

2016-10-25 Thread Heiner Kallweit
Using a separate spinlock to protect access to substruct tx of struct nvt_dev doesn't provide any actual benefit. We can use spinlock nvt_lock to protect all access to struct nvt_dev and get rid of nvt->tx.lock. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-ci

[PATCH 5/5] media: rc: nuvoton: replace usage of spin_lock_irqsave in ISR

2016-10-25 Thread Heiner Kallweit
Kernel takes care that interrupts from one source are serialized. So there's no need to use spinlock_irq_save. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/dr

Re: [PATCH v3 0/6] Add support for IR transmitters

2016-11-02 Thread Heiner Kallweit
Am 02.11.2016 um 11:40 schrieb Andi Shyti: > Hi, > > The main goal is to add support in the rc framework for IR > transmitters, which currently is only supported by lirc but that > is not the preferred way. > > The last patch adds support for an IR transmitter driven by > the MOSI line of an SPI

[PATCH] media: rc: fix deadlock when module ir_lirc_codec is removed

2016-07-31 Thread Heiner Kallweit
] [] mutex_lock_nested+0x5f/0x360 [] ? ir_raw_handler_unregister+0x77/0xd0 [rc_core] [] ? trace_hardirqs_on_caller+0xee/0x1b0 [] ir_raw_handler_unregister+0x77/0xd0 [rc_core] [] ir_lirc_codec_exit+0x10/0x12 [ir_lirc_codec] [] SyS_delete_module+0x168/0x220 [] entry_SYSCALL_64_fastpath+0x18/0xa8 Signed-off

[PATCH] media: rc: nuvoton: ignore spurious interrupt when logical device is being disabled

2016-07-31 Thread Heiner Kallweit
mistakenly interpreted as being set. Fix this by ignoring interrupts when interrupt source and status register reads return 0xff. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers

[PATCH] media: rc: refactor raw handler kthread

2016-08-01 Thread Heiner Kallweit
ggers processing after writing the content of a hw fifo to the kfifo. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-core-priv.h | 2 -- drivers/media/rc/rc-ir-raw.c| 46 +++-- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/drivers/

[PATCH 3/3] media: rc: nuvoton: simplify nvt_get_rx_ir_data a little

2016-08-01 Thread Heiner Kallweit
Simplify the code a little. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index fc462f6..04fedaa 100644 --- a/drivers/media/rc/nuvoton

[PATCH 2/3] media: rc: nuvoton: remove unneeded call to ir_raw_event_handle

2016-08-01 Thread Heiner Kallweit
fy the code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index e4158a9..fc462f6 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/d

[PATCH 1/3] media: rc: nuvoton: remove usage of b_idx in nvt_get_rx_ir_data

2016-08-01 Thread Heiner Kallweit
b_idx. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 0c69536..e4158a9 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/dr

[PATCH] media: rc: ir-sharp-decoder: add support for Denon variant of the protocol

2015-10-29 Thread Heiner Kallweit
Denon also uses the Sharp protocol, however with different check bits. It would have been also possible to add this as a separate protocol but this may not be worth the effort. Successfully tested with a Denon RC-1002 remote control. Signed-off-by: Heiner Kallweit --- drivers/media/rc/Kconfig

[PATCH 1/9] media: rc: nuvoton-cir: remove unneeded IRQ_RETVAL usage

2015-10-29 Thread Heiner Kallweit
Using IRQ_RETVAL is unneeded here. IRQ_NONE / IRQ_HANDLED can be returned directly. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c

[PATCH 3/9] media: rc: nuvoton-cir: switch resource handling to devm functions

2015-10-29 Thread Heiner Kallweit
Switch to managed resource handling using the devm_ functions. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 36 +++- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton

[PATCH 2/9] media: rc: nuvoton-cir: remove unneeded lock

2015-10-29 Thread Heiner Kallweit
chip_major / chip_minor are accessed sequentially in probe only. Therefore no lock is needed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 3d9a4cf

[PATCH 4/9] media: rc: nuvoton-cir: improve chip detection

2015-10-29 Thread Heiner Kallweit
are masked) Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 81 +- drivers/media/rc/nuvoton-cir.h | 24 - 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-ci

[PATCH 5/9] media: rc: nuvoton-cir: make nvt_hw_detect void

2015-10-29 Thread Heiner Kallweit
nvt_hw_detect always returns 0, therefore make it return void. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index c5c238b..df4b9cb

[PATCH 6/9] media: rc: nuvoton-cir: add support for the NCT6779D

2015-10-29 Thread Heiner Kallweit
Add support for the NCT6779D. It's found e.g. on the Zotac CI321 mini-pc and I successfully tested it on this device. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 1 + drivers/media/rc/nuvoton-cir.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --

[PATCH 8/9] media: rc: nuvoton-cir: replace nvt_pr with dev_ functions

2015-10-29 Thread Heiner Kallweit
Replace nvt_pr with the respective dev_ functions thus slightly simplifying the code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 15 --- drivers/media/rc/nuvoton-cir.h | 3 --- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/media/rc

[PATCH 7/9] media: rc: nuvoton-cir: simplify debug code

2015-10-29 Thread Heiner Kallweit
Instead of explicitely checking debug use nvt_dbg like in other parts of the driver thus simplifying the code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers

[PATCH 9/9] media: rc: nuvoton-cir: switch chip detection message to info level

2015-10-29 Thread Heiner Kallweit
Switch the info about the detected chip type from debug to info level as it might be useful not only for debugging purposes. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c

[PATCH] media: rc-core: simplify logging in rc_register_device

2015-10-29 Thread Heiner Kallweit
Simplify the logging. I had some doubts about using the elvis operator as it's GNU extension. However GNU extensions are explicitely allowed and this operator is used at several places in the kernel code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-main.c | 6 ++ 1 file ch

[PATCH 7/8] media: rc: improve RC_BIT_ constant definition

2015-11-16 Thread Heiner Kallweit
The RC_BIT_ constants are used in 64-bit bitmaps. In case of > 32 RC_BIT_ constants the current code will fail on 32-bit systems. Therefore define the RC_BIT_ constants as unsigned long long. Signed-off-by: Heiner Kallweit --- include/media/rc-map.h |

[PATCH 3/8] media: rc: constify struct proto_names

2015-11-16 Thread Heiner Kallweit
Declare struct proto_names and its member name as const. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index cede8bc..f2d5c50 100644 --- a/drivers

[PATCH 6/8] media: rc: treat lirc like any other protocol

2015-11-16 Thread Heiner Kallweit
Introduce a protocol bit for lirc and treat it like any other protocol. This allows to get rid of all the lirc-specific code. Signed-off-by: Heiner Kallweit --- drivers/media/rc/ir-lirc-codec.c | 2 +- drivers/media/rc/rc-core-priv.h | 16 ++-- drivers/media/rc/rc-ir-raw.c

[PATCH 5/8] media: rc: move check whether a protocol is enabled to the core

2015-11-16 Thread Heiner Kallweit
Checking whether a protocol is enabled and calling the related decoder functions should be done by the rc core, not the protocol handlers. Properly handle lirc considering that no protocol bit is set for lirc. Signed-off-by: Heiner Kallweit --- drivers/media/rc/ir-jvc-decoder.c | 3

[PATCH 4/8] media: rc: load decoder modules on-demand

2015-11-16 Thread Heiner Kallweit
Remove code for unconditional decoder module loading (except lirc). Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-core-priv.h | 64 - drivers/media/rc/rc-ir-raw.c| 10 --- 2 files changed, 74 deletions(-) diff --git a/drivers/media/rc/rc

[PATCH 1/8] media: rc: fix decoder module unloading

2015-11-16 Thread Heiner Kallweit
Currently, if a decoder module is unloadad, the respective protocol is still shown as enabled (if it was enabled before). Fix this by resetting the respective protocol bits if a decoder module is unloaded. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-ir-raw.c | 17 ++--- 1

[PATCH 8/8] media: rc: define RC_BIT_ALL as ~0

2015-11-16 Thread Heiner Kallweit
impact if bits for not (yet) defined protocols are set. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-main.c | 1 - include/media/rc-map.h | 10 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index

  1   2   >