[PATCH] media: cx24117: remove dead code in always 'false' if statement

2013-11-19 Thread Andi Shyti
At this point of the execution in the function cx24117_attach() demod cannot be '0'. In that case the function returns earlier with an error value ('NULL'). Remove the if statement. This error has been reported by scan.coverity.com Signed-off-by: Andi Shyti a...@etezian.org --- drivers/media

Re: [RFC 7/7] [media] rc: add support for IR LEDs driven through SPI

2016-07-21 Thread Andi Shyti
Hi Sean, > > > > + ret = regulator_enable(idata->regulator); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + mutex_lock(>mutex); > > > > + idata->xfer.len = n; > > > > + idata->xfer.tx_buf = buffer; > > > > + mutex_unlock(>mutex); > >

Re: [RFC 5/7] [media] ir-lirc-codec: do not handle any buffer for raw transmitters

2016-07-20 Thread Andi Shyti
Hi Sean, > > Raw transmitters receive the data which need to be sent to > > receivers from userspace as stream of bits, they don't require > > any handling from the lirc framework. > > No drivers of type RC_DRIVER_IR_RAW_TX should handle tx just like any > other device, so data should be

Re: [RFC 3/7] [media] rc-core: add support for IR raw transmitters

2016-07-20 Thread Andi Shyti
Hi Sean, > > + if (dev->driver_type == RC_DRIVER_IR_RAW || > > + dev->driver_type == RC_DRIVER_IR_RAW_TX) { > > Here the if is wrong. It should be > "if (dev->driver_type != RC_DRIVER_IR_RAW_TX)". Note that as result > the decoder thread is not started, so patch 4

Re: [RFC 1/7] [media] rc-main: assign driver type during allocation

2016-07-20 Thread Andi Shyti
Hi Sean, > > The driver type can be assigned immediately when an RC device > > requests to the framework to allocate the device. > > > > This is an 'enum rc_driver_type' data type and specifies whether > > the device is a raw receiver or scancode receiver. The type will > > be given as parameter

Re: [RFC 7/7] [media] rc: add support for IR LEDs driven through SPI

2016-07-20 Thread Andi Shyti
Hi Sean, > > + int ret; > > + struct ir_spi_data *idata = (struct ir_spi_data *) dev->priv; > > No cast needed. yes, thanks. > > + ret = regulator_enable(idata->regulator); > > + if (ret) > > + return ret; > > + > > + mutex_lock(>mutex); > > + idata->xfer.len = n; > > +

[RFC 6/7] Documentation: bindings: add documentation for ir-spi device driver

2016-07-19 Thread Andi Shyti
Document the ir-spi driver's binding which is a IR led driven through the SPI line. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- Documentation/devicetree/bindings/media/spi-ir.txt | 20 1 file changed, 20 insertions(+) create mode 100644 Documentation/devi

[RFC 3/7] [media] rc-core: add support for IR raw transmitters

2016-07-19 Thread Andi Shyti
to be registered as raw devices. Suggested-by: Sean Young <s...@mess.org> Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 35 +++ include/media/rc-core.h| 1 + 2 files changed, 24 insertions(+), 12 deletions(-)

[RFC 0/7] Add support for IR transmitters

2016-07-19 Thread Andi Shyti
by abusing on the driver type check. The last rfc-patch adds support for an IR transmitter driven by the MOSI line of an SPI controller, it's the case of the Samsung TM2(e) board which support is going to come soon. Please let me know if there is anything to improve. Thanks, Andi Andi Shyti (7): [medi

[RFC 2/7] [media] rc-main: split setup and unregister functions

2016-07-19 Thread Andi Shyti
Move the input device allocation, map and protocol handling to different functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 140 + 1 file changed, 77 insertions(+), 63 deletions(-) diff --git a/drivers

[RFC 7/7] [media] rc: add support for IR LEDs driven through SPI

2016-07-19 Thread Andi Shyti
; 0 || n != BUF_LEN) ret = -1; close(fd); Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/Kconfig | 9 drivers/media/rc/Makefile | 1 + drivers/media/rc/ir-spi.c | 133 ++ 3 files changed, 143 i

[RFC 5/7] [media] ir-lirc-codec: do not handle any buffer for raw transmitters

2016-07-19 Thread Andi Shyti
Raw transmitters receive the data which need to be sent to receivers from userspace as stream of bits, they don't require any handling from the lirc framework. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/ir-lirc-codec.c | 30 +++---

[RFC 1/7] [media] rc-main: assign driver type during allocation

2016-07-19 Thread Andi Shyti
. Suggested-by: Sean Young <s...@mess.org> Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 4 +++- include/media/rc-core.h| 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-

[RFC 4/7] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters

2016-07-19 Thread Andi Shyti
Raw IR transmitters do not need any thread listening for occurring events. Check the driver type before running the thread. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-ir-raw.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff

Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI

2016-07-05 Thread Andi Shyti
Hi Rob, > > The ir-spi is a simple device driver which supports the > > connection between an IR LED and the MOSI line of an SPI device. > > Please split the binding from the driver. OK! > > +Device tree bindings for IR LED connected through SPI bus which is used as > > +remote controller. >

[PATCH v3 13/15] [media] lirc_dev: extremely trivial comment style fix

2016-07-06 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index ac00433..c78fe2b 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/me

[PATCH v3 06/15] [media] lirc_dev: do not use goto to create loops

2016-07-06 Thread Andi Shyti
... use "do .. while" instead. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index b11d026..cfa6031 1006

[PATCH v3 07/15] [media] lirc_dev: simplify if statement in lirc_add_to_buf

2016-07-06 Thread Andi Shyti
The whole function is inside an 'if' statement ("if (ir->d.add_to_buf)"). Check the opposite of that statement at the beginning and exit, this way we can have one level less of indentation. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media

[PATCH v3 11/15] [media] lirc_dev: fix variable constant comparisons

2016-07-06 Thread Andi Shyti
the constant on the right side of the test Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 09bdd69..c2b32e0

[PATCH v3 09/15] [media] lirc_dev: merge three if statements in only one

2016-07-06 Thread Andi Shyti
The three if statements check the same thing, merge them in only one statement. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH v3 05/15] [media] lirc_dev: simplify goto paths

2016-07-06 Thread Andi Shyti
The code can be rearranged so that some goto paths can be removed Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/d

[PATCH v3 12/15] [media] lirc_dev: fix error return value

2016-07-06 Thread Andi Shyti
If ioctl is called, it cannot be a case of invalid system call number (ENOSYS), that is a ENOTTY case which means that the device doesn't support that specific ioctl command. Replace ENOSYS with EPERM. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev

[PATCH v3 14/15] [media] lirc_dev: fix potential segfault

2016-07-06 Thread Andi Shyti
, the system segfaults. Check the pointer value before calling the above functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH v3 08/15] [media] lirc_dev: remove double if ... else statement

2016-07-06 Thread Andi Shyti
There are two if ... else which check the same thing in different part of the code, they can be merged in a single check. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/d

[PATCH v3 04/15] [media] lirc_dev: replace printk with pr_* or dev_*

2016-07-06 Thread Andi Shyti
This patch mutes also all the checkpatch warnings related to printk. Reword all the printouts so that the string doesn't need to be split, which fixes the following checkpatch warning: WARNING: quoted string split across lines Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- d

[PATCH v3 00/15] lirc_dev fixes and beautification

2016-07-06 Thread Andi Shyti
, Andi Andi Shyti (15): [media] lirc_dev: place buffer allocation on separate function [media] lirc_dev: allow bufferless driver registration [media] lirc_dev: remove unnecessary debug prints [media] lirc_dev: replace printk with pr_* or dev_* [media] lirc_dev: simplify goto paths

[PATCH v3 15/15] [media] lirc_dev: use LIRC_CAN_REC() define to check if the device can receive

2016-07-06 Thread Andi Shyti
The LIRC_CAN_REC() returns a boolean "flag & LIRC_CAN_REC_MASK" to check whether the device can receive data. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/m

[PATCH v3 02/15] [media] lirc_dev: allow bufferless driver registration

2016-07-06 Thread Andi Shyti
Transmitters don't necessarily need to have a FIFO managed buffer for their transfers. When registering the driver, before allocating the buffer, check whether the device is a transmitter or receiver. Allocate the buffer only for receivers. Signed-off-by: Andi Shyti <andi.sh...@samsung.

[PATCH v3 03/15] [media] lirc_dev: remove unnecessary debug prints

2016-07-06 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 25 - 1 file changed, 25 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 154e553..9f20f94 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/d

[PATCH v3 01/15] [media] lirc_dev: place buffer allocation on separate function

2016-07-06 Thread Andi Shyti
During the driver registration, move the buffer allocation on a separate function. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 57 +++-- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/drivers

[PATCH v3 10/15] [media] lirc_dev: remove compat_ioctl assignment

2016-07-06 Thread Andi Shyti
There is no need to check for CONFIG_COMPAT and consequently assign the compat_ioctl. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 7

[PATCH v2 04/15] [media] lirc_dev: replace printk with pr_* or dev_*

2016-07-01 Thread Andi Shyti
This patch mutes also all the checkpatch warnings related to printk. Reword all the printouts so that the string doesn't need to be split, which fixes the following checkpatch warning: WARNING: quoted string split across lines Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- d

[PATCH v2 02/15] [media] lirc_dev: allow bufferless driver registration

2016-07-01 Thread Andi Shyti
Some drivers don't necessarily need to have a FIFO managed buffer for their transfers. Drivers now should call lirc_register_bufferless_driver in order to handle the buffer themselves. The function works exaclty like lirc_register_driver except of the buffer allocation. Signed-off-by: Andi Shyti

[PATCH v2 03/15] [media] lirc_dev: remove unnecessary debug prints

2016-07-01 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 25 - 1 file changed, 25 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index fa562a3..ee997ab 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/d

[PATCH v2 05/15] [media] lirc_dev: simplify goto paths

2016-07-01 Thread Andi Shyti
The code can be rearranged so that some goto paths can be removed Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/d

[PATCH v2 13/15] [media] lirc_dev: extremely trivial comment style fix

2016-07-01 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 99d1f98..4b3efcf 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/me

[PATCH v2 06/15] [media] lirc_dev: do not use goto to create loops

2016-07-01 Thread Andi Shyti
... use "do .. while" instead. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 0d988c9..da1777c 1006

[PATCH v2 00/15] lirc_dev fixes and beautification

2016-07-01 Thread Andi Shyti
nks, Andi Andi Shyti (15): [media] lirc_dev: place buffer allocation on separate function [media] lirc_dev: allow bufferless driver registration [media] lirc_dev: remove unnecessary debug prints [media] lirc_dev: replace printk with pr_* or dev_* [media] lirc_dev: simplify goto paths [me

[PATCH v2 01/15] [media] lirc_dev: place buffer allocation on separate function

2016-07-01 Thread Andi Shyti
During the driver registration, move the buffer allocation on a separate function. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 57 +++-- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/drivers

[PATCH v2 14/15] [media] lirc_dev: fix potential segfault

2016-07-01 Thread Andi Shyti
, the system segfaults. Check the pointer value before calling the above functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH v2 15/15] [media] include: lirc: add LIRC_GET_LENGTH command

2016-07-01 Thread Andi Shyti
Added the get length command to allow userspace users to check on the data length. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- include/uapi/linux/lirc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/lirc.h b/include/uapi/linux/lirc.h index 4b3ab29..8

[PATCH v2 10/15] [media] lirc_dev: remove CONFIG_COMPAT precompiler check

2016-07-01 Thread Andi Shyti
There is no need to check in precompilation whether the ioctl is compat or unlocked, depending on the configuration it will be called the correct one. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/d

[PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI

2016-07-01 Thread Andi Shyti
close(fd); The driver supports multi task access, but all the processes which hold the driver should use the same length and frequency parameters. Change-Id: I323d7dd4a56d6dcf48f2c695293822eb04bdb85f Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- Documentatio

[PATCH v2 09/15] [media] lirc_dev: merge three if statements in only one

2016-07-01 Thread Andi Shyti
The three if statements check the same thing, merge them in only one statement. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH v2 07/15] [media] lirc_dev: simplify if statement in lirc_add_to_buf

2016-07-01 Thread Andi Shyti
The whole function is inside an 'if' statement ("if (ir->d.add_to_buf)"). Check the opposite of that statement at the beginning and exit, this way we can have one level less of indentation. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media

[PATCH v2 08/15] [media] lirc_dev: remove double if ... else statement

2016-07-01 Thread Andi Shyti
There are two if ... else which check the same thing in different part of the code, they can be merged in a single check. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/d

[PATCH v2 12/15] [media] lirc_dev: fix error return value

2016-07-01 Thread Andi Shyti
If ioctl is called, it cannot be a case of invalid system call number (ENOSYS), that is an operation not permitted (EPERM). Replace ENOSYS with EPERM. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 8 1 file changed, 4 insertions(+), 4 del

[PATCH v2 11/15] [media] lirc_dev: fix variable constant comparisons

2016-07-01 Thread Andi Shyti
the constant on the right side of the test Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 16cca46..689e369

Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI

2016-07-01 Thread Andi Shyti
Hi Sean, > > The ir-spi is a simple device driver which supports the > > connection between an IR LED and the MOSI line of an SPI device. > > > > The driver, indeed, uses the SPI framework to stream the raw data > > provided by userspace through a character device. The chardev is > > handled by

Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI

2016-07-01 Thread Andi Shyti
Hi Sean, > > > Also I don't see what justifies this new interface. This can be > > > implemented in rc-core in less lines of code and it will be entirely > > > compatible with existing user-space. > > > > Also here I'm getting a bit confused. When I started writing > > this, I didn't even know

[PATCH 12/15] lirc_dev: fix error return value

2016-06-29 Thread Andi Shyti
If ioctl is called, it cannot be a case of invalid system call number (ENOSYS), that is an operation not permitted (EPERM). Replace ENOSYS with EPERM. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 8 1 file changed, 4 insertions(+), 4 del

[PATCH 14/15] lirc_dev: fix potential segfault

2016-06-29 Thread Andi Shyti
, the system segfaults. Check the pointer value before calling the above functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH 09/15] lirc_dev: merge three if statements in only one

2016-06-29 Thread Andi Shyti
The three if statements check the same thing, merge them in only one statement. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH 10/15] lirc_dev: remove CONFIG_COMPAT precompiler check

2016-06-29 Thread Andi Shyti
There is no need to check in precompilation whether the ioctl is compat or unlocked, depending on the configuration it will be called the correct one. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/d

[PATCH 15/15] include: lirc: add set length and frequency ioctl options

2016-06-29 Thread Andi Shyti
of the used frequency and length. Add the LIRC_SET_LENGTH, LIRC_GET_FREQUENCY and LIRC_SET_FREQUENCY ioctl commands in order to allow the above mentioned operations. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- include/uapi/linux/lirc.h | 4 1 file changed, 4 insertions(+)

[PATCH 08/15] lirc_dev: remove double if ... else statement

2016-06-29 Thread Andi Shyti
There are two if ... else which check the same thing in different part of the code, they can be merged in a single check. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/d

[PATCH 07/15] lirc_dev: simplify if statement in lirc_add_to_buf

2016-06-29 Thread Andi Shyti
The whole function is inside an 'if' statement ("if (ir->d.add_to_buf)"). Check the opposite of that statement at the beginning and exit, this way we can have one level less of indentation. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media

[PATCH 13/15] lirc_dev: extremely trivial comment style fix

2016-06-29 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 6f3402c..0a3d65d 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/me

[PATCH 00/15] lirc_dev fixes and beautification

2016-06-29 Thread Andi Shyti
them anyway because I was on fire. Patch 14 is a segfault fix, while the last patch adds the possibility to send to ioctl the set frequency, get frequency and set length command. Thanks, Andi Andi Shyti (15): lirc_dev: place buffer allocation on separate function lirc_dev: allow bufferless

[PATCH 06/15] lirc_dev: do not use goto to create loops

2016-06-29 Thread Andi Shyti
... use "do .. while" instead. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 400ab80..cc00b9a 1006

[PATCH 02/15] lirc_dev: allow bufferless driver registration

2016-06-29 Thread Andi Shyti
Some drivers don't necessarily need to have a FIFO managed buffer for their transfers. Drivers now should call lirc_register_bufferless_driver in order to handle the buffer themselves. The function works exaclty like lirc_register_driver except of the buffer allocation. Signed-off-by: Andi Shyti

[PATCH 03/15] lirc_dev: remove unnecessary debug prints

2016-06-29 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 25 - 1 file changed, 25 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index fa562a3..ee997ab 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/d

[PATCH 11/15] lirc_dev: fix variable constant comparisons

2016-06-29 Thread Andi Shyti
the constant on the right side of the test Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index c11cfc0..7e5cb85

[PATCH 01/15] lirc_dev: place buffer allocation on separate function

2016-06-29 Thread Andi Shyti
During the driver registration, move the buffer allocation on a separate function. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 57 +++-- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/drivers

[PATCH 04/15] lirc_dev: replace printk with pr_* or dev_*

2016-06-29 Thread Andi Shyti
This patch mutes also all the checkpatch warnings related to printk. Reword all the printouts so that the string doesn't need to be split, which fixes the following checkpatch warning: WARNING: quoted string split across lines Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- d

[PATCH 05/15] lirc_dev: simplify goto paths

2016-06-29 Thread Andi Shyti
The code can be rearranged so that some goto paths can be removed Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/lirc_dev.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/d

Re: [PATCH 15/15] include: lirc: add set length and frequency ioctl options

2016-06-29 Thread Andi Shyti
Hi Sean, > > For that we need to have more control on the device frequency to > > set (which is a new concept fro LIRC) and we also need to provide > > to userspace, as feedback, the values of the used frequency and > > length. > > Please can you elaborate on what exactly you mean by frequency

[PATCH v2 6/7] Documentation: bindings: add documentation for ir-spi device driver

2016-09-01 Thread Andi Shyti
Document the ir-spi driver's binding which is a IR led driven through the SPI line. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- Documentation/devicetree/bindings/media/spi-ir.txt | 26 ++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devi

[PATCH v2 4/7] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters

2016-09-01 Thread Andi Shyti
Raw IR transmitters do not need any thread listening for occurring events. Check the driver type before running the thread. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-ir-raw.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff

[PATCH v2 7/7] [media] rc: add support for IR LEDs driven through SPI

2016-09-01 Thread Andi Shyti
val = 60; ret = ioctl(fd, LIRC_SET_SEND_DUTY_CYCLE, ); if (ret < 0) return -1; n = write(fd, buffer, BUF_LEN); if (n < 0 || n != BUF_LEN) ret = -1; close(fd); Signed-off-by: Andi Shyti <andi.sh...@samsung.c

[PATCH v2 1/7] [media] rc-main: assign driver type during allocation

2016-09-01 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/hid/hid-picolcd_cir.c | 3 +-- drivers/media/common/siano/smsir.c | 3 +-- drivers/media/i2c/ir-kbd-i2c.c | 2 +- drivers/media/pci/bt8xx/bttv-input.c| 2 +- drivers/media/pci/cx2

[PATCH v2 5/7] [media] ir-lirc-codec: don't wait any transmitting time for tx only devices

2016-09-01 Thread Andi Shyti
Transmitters do not need to wait until the data has been sent (and of course received). Return before waiting. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/ir-lirc-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/i

[PATCH v2 3/7] [media] rc-core: add support for IR raw transmitters

2016-09-01 Thread Andi Shyti
to be registered as raw devices. Suggested-by: Sean Young <s...@mess.org> Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 39 +++ include/media/rc-core.h| 9 ++--- 2 files changed, 29 insertions(+),

[PATCH v2 0/7] Add support for IR transmitters

2016-09-01 Thread Andi Shyti
it to a bit stream. Thanks, Andi Andi Shyti (7): [media] rc-main: assign driver type during allocation [media] rc-main: split setup and unregister functions [media] rc-core: add support for IR raw transmitters [media] rc-ir-raw: do not generate any receiving thread for raw

[PATCH v2 2/7] [media] rc-main: split setup and unregister functions

2016-09-01 Thread Andi Shyti
Move the input device allocation, map and protocol handling to different functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 144 + 1 file changed, 81 insertions(+), 63 deletions(-) diff --git a/drivers

Re: [PATCH v2 1/7] [media] rc-main: assign driver type during allocation

2016-09-01 Thread Andi Shyti
Hi Sean, > > ir = kzalloc(sizeof(*ir), GFP_KERNEL); > > - dev = rc_allocate_device(); > > + dev = rc_allocate_device(RC_DRIVER_IR_RAW); > > if (!ir || !dev) > > goto err_out_free; > > > > If ir->sampling = 0 then it should be RC_DRIVER_SCANCODE. > > > > @@ -481,7

Re: [PATCH v2 6/7] Documentation: bindings: add documentation for ir-spi device driver

2016-09-01 Thread Andi Shyti
Hi Rob, > > Document the ir-spi driver's binding which is a IR led driven > > through the SPI line. > > > > Signed-off-by: Andi Shyti <andi.sh...@samsung.com> > > --- > > Documentation/devicetree/bindings/media/spi-ir.txt | 26 > > +

Re: [PATCH v2 7/7] [media] rc: add support for IR LEDs driven through SPI

2016-09-01 Thread Andi Shyti
> Thanks Andi, this is looking great! Thanks Sean! With your reviews the whole thing looks much better now :) I agree with all your points here, I will fix them. Can I add your reviewd-by? Thanks, Andi -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a

[RFC] Documentation: media, leds: move IR LED remote controllers from media to LED

2016-11-10 Thread Andi Shyti
Hi, this is purely a request for comments after a discussion had with Rob and Jacek [*] about where to place the ir leds binding. Rob wants the binding to be under led, while Jacek wants it in media... "Ubi maior minor cessat": it goes to LED and they can be organized in a subdirectory. Standing

Re: [PATCH v3 5/6] Documentation: bindings: add documentation for ir-spi device driver

2016-11-10 Thread Andi Shyti
Hi Jacek, > > > > > Only DT bindings of LED class drivers should be placed in > > > > > Documentation/devicetree/bindings/leds. Please move it to the > > > > > media bindings. > > > > > > > > that's where I placed it first, but Rob asked me to put it in the > > > > LED directory and Cc the LED

Re: [RFC] Documentation: media, leds: move IR LED remote controllers from media to LED

2016-11-22 Thread Andi Shyti
Hi Mauro, > > this is purely a request for comments after a discussion had with > > Rob and Jacek [*] about where to place the ir leds binding. Rob wants > > the binding to be under led, while Jacek wants it in media... > > "Ubi maior minor cessat": it goes to LED and they can be organized > > in

Re: [PATCH v2 5/7] [media] ir-lirc-codec: don't wait any transmitting time for tx only devices

2016-11-01 Thread Andi Shyti
Hi Sean, > Andi, it would be good to know what the use-case for the original change is. the use case is the ir-spi itself which doesn't need the lirc to perform any waiting on its behalf. To me it just doesn't look right to simulate a fake transmission period and wait unnecessary time. Of

[PATCH v3 2/6] [media] rc-main: split setup and unregister functions

2016-11-02 Thread Andi Shyti
Move the input device allocation, map and protocol handling to different functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 143 + 1 file changed, 81 insertions(+), 62 deletions(-) diff --git a/drivers

[PATCH v3 4/6] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters

2016-11-02 Thread Andi Shyti
Raw IR transmitters do not need any thread listening for occurring events. Check the driver type before running the thread. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-ir-raw.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff

[PATCH v3 5/6] Documentation: bindings: add documentation for ir-spi device driver

2016-11-02 Thread Andi Shyti
Document the ir-spi driver's binding which is a IR led driven through the SPI line. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- .../devicetree/bindings/leds/spi-ir-led.txt| 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devi

[PATCH v3 1/6] [media] rc-main: assign driver type during allocation

2016-11-02 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/hid/hid-picolcd_cir.c | 3 +-- drivers/media/common/siano/smsir.c | 3 +-- drivers/media/i2c/ir-kbd-i2c.c | 2 +- drivers/media/pci/bt8xx/bttv-input.c| 2 +- drivers/media/pci/cx2

[PATCH v3 6/6] [media] rc: add support for IR LEDs driven through SPI

2016-11-02 Thread Andi Shyti
val = 60; ret = ioctl(fd, LIRC_SET_SEND_DUTY_CYCLE, ); if (ret < 0) return -1; n = write(fd, buffer, BUF_LEN); if (n < 0 || n != BUF_LEN) ret = -1; close(fd); Signed-off-by: Andi Shyti <andi.sh...@samsung.com>

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

2016-11-02 Thread Andi Shyti
the comments from Sean added also Sean's review. Andi Shyti (6): [media] rc-main: assign driver type during allocation [media] rc-main: split setup and unregister functions [media] rc-core: add support for IR raw transmitters [media] rc-ir-raw: do not generate any receiving thread

[PATCH v3 3/6] [media] rc-core: add support for IR raw transmitters

2016-11-02 Thread Andi Shyti
to be registered as raw devices. Suggested-by: Sean Young <s...@mess.org> Signed-off-by: Andi Shyti <andi.sh...@samsung.com> --- drivers/media/rc/rc-main.c | 42 +- include/media/rc-core.h| 9 ++--- 2 files changed, 31 insertions(+),

Re: [PATCH] [media] lirc: introduce LIRC_SET_TRANSMITTER_WAIT ioctl

2016-10-28 Thread Andi Shyti
Hi Sean, > ret *= sizeof(unsigned int); > > - /* > - * The lircd gap calculation expects the write function to > - * wait for the actual IR signal to be transmitted before > - * returning. > - */ > - towait = ktime_us_delta(ktime_add_us(start, duration),

Re: [PATCH v2 5/7] [media] ir-lirc-codec: don't wait any transmitting time for tx only devices

2016-10-27 Thread Andi Shyti
Hi Sean, it's been a while :) I was going through your review fixing what needs to be fixed, but... > > @@ -153,7 +153,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, > > const char __user *buf, > > } > > > > ret = dev->tx_ir(dev, txbuf, count); > > - if (ret < 0) > > +

Re: [PATCH] [media] lirc: introduce LIRC_SET_TRANSMITTER_WAIT ioctl

2016-10-31 Thread Andi Shyti
Hi Sean. > > > ret *= sizeof(unsigned int); > > > > > > - /* > > > - * The lircd gap calculation expects the write function to > > > - * wait for the actual IR signal to be transmitted before > > > - * returning. > > > - */ > > > - towait = ktime_us_delta(ktime_add_us(start, duration),

Re: [PATCH v3 5/6] Documentation: bindings: add documentation for ir-spi device driver

2016-11-03 Thread Andi Shyti
Hi Jacek, > Only DT bindings of LED class drivers should be placed in > Documentation/devicetree/bindings/leds. Please move it to the > media bindings. that's where I placed it first, but Rob asked me to put it in the LED directory and Cc the LED mailining list. That's the discussion of the

Re: [PATCH v3 5/6] Documentation: bindings: add documentation for ir-spi device driver

2016-11-03 Thread Andi Shyti
Hi Jacek, > > > Only DT bindings of LED class drivers should be placed in > > > Documentation/devicetree/bindings/leds. Please move it to the > > > media bindings. > > > > that's where I placed it first, but Rob asked me to put it in the > > LED directory and Cc the LED mailining list. > > > >

Re: [PATCH v2 5/7] [media] ir-lirc-codec: don't wait any transmitting time for tx only devices

2016-11-01 Thread Andi Shyti
Hi Sean, > > > Andi, it would be good to know what the use-case for the original change > > > is. > > > > the use case is the ir-spi itself which doesn't need the lirc to > > perform any waiting on its behalf. > > Here is the crux of the problem: in the ir-spi case no wait will actually >

[PATCH v4 0/6] Add support for IR transmitters

2016-12-14 Thread Andi Shyti
leds/irled/spi-ir-led.txt patch 6: uses the new devm_* allocation and registration rc functions [*] https://www.spinics.net/lists/linux-leds/msg07062.html https://www.spinics.net/lists/linux-leds/msg07164.html https://www.spinics.net/lists/linux-leds/msg07167.html Andi Shyti

[PATCH v4 1/6] [media] rc-main: assign driver type during allocation

2016-12-14 Thread Andi Shyti
Signed-off-by: Andi Shyti <andi.sh...@samsung.com> Reviewed-by: Sean Young <s...@mess.org> --- drivers/hid/hid-picolcd_cir.c | 3 +-- drivers/media/cec/cec-core.c| 3 +-- drivers/media/common/siano/smsir.c | 3 +-- drivers/media/i2c/ir-kbd-i2c.c

[PATCH v4 4/6] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters

2016-12-14 Thread Andi Shyti
Raw IR transmitters do not need any thread listening for occurring events. Check the driver type before running the thread. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> Reviewed-by: Sean Young <s...@mess.org> --- drivers/media/rc/rc-ir-raw.c | 17 - 1 file

[PATCH v4 2/6] [media] rc-main: split setup and unregister functions

2016-12-14 Thread Andi Shyti
Move the input device allocation, map and protocol handling to different functions. Signed-off-by: Andi Shyti <andi.sh...@samsung.com> Reviewed-by: Sean Young <s...@mess.org> --- drivers/media/rc/rc-main.c | 143 + 1 file changed, 81 inser

[PATCH v4 6/6] [media] rc: add support for IR LEDs driven through SPI

2016-12-14 Thread Andi Shyti
val = 60; ret = ioctl(fd, LIRC_SET_SEND_DUTY_CYCLE, ); if (ret < 0) return -1; n = write(fd, buffer, BUF_LEN); if (n < 0 || n != BUF_LEN) ret = -1; close(fd); Signed-off-by: Andi Shyti <andi.sh...@samsung.com>

  1   2   >