[PATCH v7 1/5] iio: vcnl4000: Fix i2c swapped word reading.

2020-05-03 Thread Mathieu Othacehe
The bytes returned by the i2c reading need to be swapped unconditionally. Otherwise, on be16 platforms, an incorrect value will be returned. Fixes: 62a1efb9f868 ("iio: add vcnl4000 combined ALS and proximity sensor") Signed-off-by: Mathieu Othacehe --- drivers/iio/light/vcnl4000.c | 6

[PATCH v7 5/5] iio: vcnl4000: Add buffer support for VCNL4010/20.

2020-05-03 Thread Mathieu Othacehe
for now, and the sample frequencies of ambient light data are very low, do add buffer support for them. Signed-off-by: Mathieu Othacehe --- drivers/iio/light/Kconfig| 2 + drivers/iio/light/vcnl4000.c | 161 ++- 2 files changed, 161 insertions(+), 2 deletions

[PATCH v7 0/5] iio: vcnl: Add interrupts support for VCNL4010/20.

2020-05-03 Thread Mathieu Othacehe
enable and predisable functions respect the common form. * Do not set the trigger by default. * Remove the devm_iio_triggered_buffer_setup top half. Mathieu Othacehe (5): iio: vcnl4000: Fix i2c swapped word reading. iio: vcnl4000: Factorize data reading and writing. iio: vcnl4000: Add event support fo

[PATCH v7 3/5] iio: vcnl4000: Add event support for VCNL4010/20.

2020-05-03 Thread Mathieu Othacehe
The VCNL4010 and VCNL4020 chips are able to raise interrupts on proximity threshold events. Add support for threshold rising and falling events for those two chips. Signed-off-by: Mathieu Othacehe --- drivers/iio/light/vcnl4000.c | 454 ++- 1 file changed, 392

[PATCH v7 4/5] iio: vcnl4000: Add sampling frequency support for VCNL4010/20.

2020-05-03 Thread Mathieu Othacehe
Add sampling frequency support for proximity data on VCNL4010 and VCNL4020 chips. Signed-off-by: Mathieu Othacehe --- drivers/iio/light/vcnl4000.c | 118 ++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio

Re: [PATCH v6 5/5] iio: vcnl4000: Add buffer support for VCNL4010/20.

2020-05-03 Thread Mathieu Othacehe
Hi Jonathan, > One odd bit of code structure. If you didn't need to respin to fix > patch 1's missing sign off I'd just fix it, but pleased tidy it up for v7. Ok, fixed that in v7! Thanks, Mathieu

[PATCH v7 2/5] iio: vcnl4000: Factorize data reading and writing.

2020-05-03 Thread Mathieu Othacehe
Factorize data reading in vcnl4000_measure into a vcnl4000_read_data function. Also add a vcnl4000_write_data function. Signed-off-by: Mathieu Othacehe --- drivers/iio/light/vcnl4000.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/iio

Re: [PATCH v3 3/3] pwm: hibvt: Add hi3559v100 support

2019-02-22 Thread Mathieu Othacehe
Hi Uwe, > The patch looks fine now. (If you have to do another round: > s/again/twice/ in the commit log and s/once more/twice/ in the comment > below.) Ok. > > I wonder if this behaviour is a bug or a feature of the hardware. Is > this additional enable needed to apply changes to both period an

[PATCH v2] iio: trigger: Print an error if there is no available irq

2019-02-20 Thread Mathieu Othacehe
If there are more trigger consumers than CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will silently fail. Add an error message to inform the user that CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded. Signed-off-by: Mathieu Othacehe --- drivers/iio/industrialio

[PATCH v3 1/3] pwm: hibvt: Use individual struct per of-data.

2019-02-19 Thread Mathieu Othacehe
Split pwm-soc array in one struct per soc and point to the corresponding on in of-data. Signed-off-by: Mathieu Othacehe --- drivers/pwm/pwm-hibvt.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c index

[PATCH v3 3/3] pwm: hibvt: Add hi3559v100 support

2019-02-19 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. They require a special quirk: pwm has to be enabled again to force duty_cycle refresh. Signed-off-by: Mathieu Othacehe --- drivers/pwm/pwm-hibvt.c | 27 ++- 1 file changed, 26 insertions(+), 1

[PATCH v3 2/3] dt-bindings: pwm: hibvt: Add hi3559v100 support

2019-02-19 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. Reviewed-by: Rob Herring Signed-off-by: Mathieu Othacehe --- Documentation/devicetree/bindings/pwm/pwm-hibvt.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-hibvt.txt

[PATCH] .mailmap: Add Mathieu Othacehe

2019-02-13 Thread Mathieu Othacehe
Some contributions appears as Mathieu Othacehe and other as Mathieu OTHACEHE. Signed-off-by: Mathieu Othacehe --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index ea98fcc197e4..37e1847c7988 100644 --- a/.mailmap +++ b/.mailmap @@ -123,6 +123,7 @@ Mark Brown

[PATCH v2 2/3] dt-bindings: pwm: hibvt: Add hi3559v100 support

2019-02-13 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. Signed-off-by: Mathieu Othacehe --- Documentation/devicetree/bindings/pwm/pwm-hibvt.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-hibvt.txt b/Documentation

[PATCH v2 3/3] pwm: hibvt: Add hi3559v100 support

2019-02-13 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. They require a special quirk: pwm has to be enabled again to force duty_cycle refresh. Signed-off-by: Mathieu Othacehe --- drivers/pwm/pwm-hibvt.c | 28 +++- 1 file changed, 27 insertions(+), 1

[PATCH v2 1/3] pwm: hibvt: Use individual struct per of-data.

2019-02-13 Thread Mathieu Othacehe
Split pwm-soc array in one struct per soc and point to the corresponding on in of-data. Signed-off-by: Mathieu Othacehe --- drivers/pwm/pwm-hibvt.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c index

[PATCH] iio: trigger: Print an error if there is no available irq

2019-02-13 Thread Mathieu Othacehe
If there are more trigger consumers than CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will silently fail. Add an error message to inform the user that CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded. Signed-off-by: Mathieu Othacehe --- drivers/iio/industrialio

[PATCH 1/2] dt-bindings: pwm: hibvt: Add hi3559v100 support

2019-02-12 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. Signed-off-by: Mathieu Othacehe --- Documentation/devicetree/bindings/pwm/pwm-hibvt.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-hibvt.txt b/Documentation

[PATCH 2/2] pwm: hibvt: Add hi3559v100 support

2019-02-12 Thread Mathieu Othacehe
Add support for hi3559v100-shub-pwm and hisilicon,hi3559v100-pwm platforms. They require a special quirk: pwm has to be enabled again to force duty_cycle refresh. Signed-off-by: Mathieu Othacehe --- drivers/pwm/pwm-hibvt.c | 26 +++--- 1 file changed, 23 insertions(+), 3

Re: [GIT PULL] kbuild changes for v4.9-rc1

2016-10-17 Thread Mathieu OTHACEHE
> +#include > +#include Included twice. > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include No for __sw_hweight32 and __sw_hweight64 ?

Re: [GIT PULL] kbuild changes for v4.9-rc1

2016-10-16 Thread Mathieu OTHACEHE
Hi, >> Reverting 784d5699eddc ("x86: move exports to actual definitions") fixes >> it for me. This is with GCC 6.2.1, binutils 2.27, attached config. I've had the same problem. Reverting your binutils from 2.27 to 2.26, will also fix it. It seems ld 2.27 is not merging weak symbols from .o files

Re: [lkp] [x86] 784d5699ed: kmsg.ip_tables:no_symbol_version_for_copy_from_user

2016-10-14 Thread Mathieu OTHACEHE
Hi Michal, Sorry for late reply. My toolchain in arch linux gcc version 6.2.1 20160830. I used defconfig (x86_64), with CONFIG_MODVERSIONS=y. I'm understanding better what's happening here. Running: nm arch/x86/lib/clear_page_64.o gives, T clear_page 0050 T clear_pa

Re: [lkp] [x86] 784d5699ed: kmsg.ip_tables:no_symbol_version_for_copy_from_user

2016-10-09 Thread Mathieu OTHACEHE
Hi, > Do we have any resolution of this? I got the exact same problem if CONFIG_MODVERSIONS is enabled. Here is my understanding. All the symbols exported using assembler macro EXPORT_SYMBOL will need a __crc_ to be defined later on (include/asm-generic/export.h). This is what genksyms should

Re: [PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments

2016-07-27 Thread Mathieu OTHACEHE
Hi, > this makes me think something is wrong with the data structure. > We should have a be32 there, it seems to me. You mean something like : struct ti_write_data_bytes { u8 bAddrType; u8 bDataType; u8 bDataCounter; __be32 wBaseAddr; u8

Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc

2016-07-27 Thread Mathieu OTHACEHE
> in that case, where is the initialisation to 0 you avoid and hence > can remove from the code? Hi, In v1, kzalloc was useful to avoid wFlags initialisation to 0 : https://lkml.org/lkml/2016/5/12/139 In v2 wFlags initialisation has be removed so this patch has no purpose anymore, my bad. Tha

[PATCH v2 00/22] usb: serial: ti_usb_3410_5052: clean driver

2016-07-26 Thread Mathieu OTHACEHE
Hi Johan, Thanks for your review ! Here is the v2 of the serie. I didn't resubmit patches related to the switch to generic implementation (open, close, read and write). I will work on them later when this first batch will be pushed. Thank you, Mathieu Mathieu OTHACEHE (22): usb: s

[PATCH v2 01/22] usb: serial: ti_usb_3410_5052: Do not use __uX types

2016-07-26 Thread Mathieu OTHACEHE
__uX types should only be used for user-space interactions. Signed-off-by: Mathieu OTHACEHE --- Changelog: v2: * Replace cpu_to_be16s calls by cpu_to_be16 * Remove other useless casts drivers/usb/serial/ti_usb_3410_5052.c | 101 +- 1 file changed, 51 insertions

[PATCH v2 05/22] usb: serial: ti_usb_3410_5052: Use C_X macros instead of c_cflag manipulation

2016-07-26 Thread Mathieu OTHACEHE
Use C_X tty.h macros to avoid direct manipulation of termios c_cflag variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH v2 12/22] usb: serial: ti_usb_3410_5052: Remove usb_serial pointer in ti_port

2016-07-26 Thread Mathieu OTHACEHE
There is no need to keep a pointer to usb_serial in ti_port structure. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial

[PATCH v2 07/22] usb: serial: ti_usb_3410_5052: Use macros instead of magic values

2016-07-26 Thread Mathieu OTHACEHE
Use macros to define 3410 and 5052 baud bases. Use macro to define usb download timeout. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b

[PATCH v2 04/22] usb: serial: ti_usb_3410_5052: Remove useless NULL-testing

2016-07-26 Thread Mathieu OTHACEHE
It is useless to check the return of usb_get_serial_port_data. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH v2 11/22] usb: serial: ti_usb_3410_5052: Do not modify interrupt context

2016-07-26 Thread Mathieu OTHACEHE
It is useless to pass a specific context (ti_device) to the interrupt callback. So use the default context (usb_serial_port). Remove useless variables in ti_interrupt_callback. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 58 --- 1

[PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments

2016-07-26 Thread Mathieu OTHACEHE
Remove useless ti_device pointer, and change addr to u32. Change size variable in function from int to size_t. Also fix minor style issue. Signed-off-by: Mathieu OTHACEHE --- Changelog: v2: * Do not delete prototype and move function declaration drivers/usb/serial/ti_usb_3410_5052.c | 20

[PATCH v2 20/22] usb: serial: ti_usb_3410_5052: Set shadow msr before waking up waiters

2016-07-26 Thread Mathieu OTHACEHE
Save msr before testing the delta and waking up any waiters. Also use port directly instead of tport->tp_port. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/ser

[PATCH v2 17/22] usb: serial: ti_usb_3410_5052: Fix firmware downloading

2016-07-26 Thread Mathieu OTHACEHE
to do any padding. This patch also move firmware buffer manipulation to ti_do_download function. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 61 +++ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/drivers/usb/serial/ti_usb_

[PATCH v2 13/22] usb: serial: ti_usb_3410_5052: Change ti_get/set_serial_info function arguments

2016-07-26 Thread Mathieu OTHACEHE
It is sufficient to pass usb_serial_port structure to ti_get_serial_info and ti_set_serial_info. Also use unsigned int instead of unsigned for cwait variable. Signed-off-by: Mathieu OTHACEHE --- Changelog: v2: * Do not remove prototypes and move functions declarations. drivers/usb/serial

[PATCH v2 18/22] usb: serial: ti_usb_3410_5052: Standardize debug and error messages

2016-07-26 Thread Mathieu OTHACEHE
Use the format "error text: error value\n" when possible. Drop redundant function names from error messages. Also move a couple err messages to dbg messages. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 105 -- 1 file c

[PATCH v2 09/22] usb: serial: ti_usb_3410_5052: Remove useless tty_wakeup

2016-07-26 Thread Mathieu OTHACEHE
tty_wakeup is already called when blocked bulk-out transfers complete. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH v2 02/22] usb: serial: ti_usb_3410_5052: Remove useless dev_dbg messages

2016-07-26 Thread Mathieu OTHACEHE
Remove useless or redundant dev_dbg messages. Fix debug-message typos. Signed-off-by: Mathieu OTHACEHE --- Changelog: v2: * Keep some debug messages drivers/usb/serial/ti_usb_3410_5052.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/usb

[PATCH v2 06/22] usb: serial: ti_usb_3410_5052: Remove unused variables

2016-07-26 Thread Mathieu OTHACEHE
Remove variables affected but never read. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 29bb62c..2b7fe89 100644 --- a

[PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc

2016-07-26 Thread Mathieu OTHACEHE
Use kzalloc instead of kmalloc to avoid field initialisation to 0. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH v2 14/22] usb: serial: ti_usb_3410_5052: Do not set shadow mcr in open callback

2016-07-26 Thread Mathieu OTHACEHE
Setting DTR/RTS is handled using dtr_rts in tty_core. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 3a88c2f..b5ea850 100644 --- a

[PATCH v2 22/22] usb: serial: ti_usb_3410_5052: Fix indentation problems

2016-07-26 Thread Mathieu OTHACEHE
Fix some minor indentation problems. Also correct a multi-line comment. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 42 +++ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b

[PATCH v2 19/22] usb: serial: ti_usb_3410_5052: Use variables for vendor and product

2016-07-26 Thread Mathieu OTHACEHE
Use variables for vendor and product in download_firmware to improve readability. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH v2 21/22] usb: serial: ti_usb_3410_5052: Add CMSPAR support

2016-07-26 Thread Mathieu OTHACEHE
Add CMSPAR support in set_termios callback. Move TI_UART_ENABLE_PARITY_CHECKING setting in the upper block to avoid doing it twice. Delete useless TI_UART_ENABLE_PARITY_CHECKING unsetting. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 19 ++- 1 file

[PATCH v2 15/22] usb: serial: ti_usb_3410_5052: Check old_termios parameter in set_termios

2016-07-26 Thread Mathieu OTHACEHE
The old_termios parameter is never used in set_termios callback. Add a check to old_termios to see if we can return right away because there is nothing to change. Also pass NULL for old_termios in open callback because it is the initial call to set_termios. Signed-off-by: Mathieu OTHACEHE

[PATCH v2 16/22] usb: serial: ti_usb_3410_5052: Raise DTR and RTS flags if speed is not null anymore

2016-07-26 Thread Mathieu OTHACEHE
If speed is non null anymore, we can raise DTR and RTS flags in ti_set_termios. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH v2 08/22] usb: serial: ti_usb_3410_5052: Remove in_sync and out_sync functions

2016-07-26 Thread Mathieu OTHACEHE
mmand sending. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 157 +++--- 1 file changed, 88 insertions(+), 69 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index b5f3328..e8515eb 1

[PATCH 02/36] usb: serial: ti_usb_3410_5052: use __packed instead of __attribute__((packed))

2016-05-12 Thread Mathieu OTHACEHE
__packed is preferred over __attribute__((packed)) for portability. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial

[PATCH 03/36] usb: serial: ti_usb_3410_5052: Remove ti_usb_3410_5052.h

2016-05-12 Thread Mathieu OTHACEHE
The definitions in ti_usb_3410_5052.h are only used in ti_usb_3410_5052.c. The content of the header is copied in ti_usb_3410_5052.c. Also correct a typo in macro TI_PIPE_MODE_CONTINOUS. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 237

[PATCH 05/36] usb: serial: ti_usb_3410_5052: Remove unused data structures

2016-05-12 Thread Mathieu OTHACEHE
ti_read_data_request, ti_read_data_bytes and ti_interrupt are unused. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 21 - 1 file changed, 21 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052

[PATCH 06/36] usb: serial: ti_usb_3410_5052: Do not use __uX types

2016-05-12 Thread Mathieu OTHACEHE
__uX types should only be used for user-space interactions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 66 ++- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 04/36] usb: serial: ti_usb_3410_5052: Use inline functions rather than macro

2016-05-12 Thread Mathieu OTHACEHE
Inline functions are preferable to macros resembling functions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial

[PATCH 00/36] usb: serial: ti_usb_3410_5052: clean driver

2016-05-12 Thread Mathieu OTHACEHE
Hi, The now reverted mxu11x0 turned out to be a copy of ti_usb_3410_5052 driver. This aim of this serie is to apply all of the cleanups we did in mxu11x0 to ti_usb_3410_5052. Thank you, Mathieu Mathieu OTHACEHE (36): usb: serial: ti_usb_3410_5052: Remove useless comments usb: serial

[PATCH 07/36] usb: serial: ti_usb_3410_5052: Remove closing_wait module parameter

2016-05-12 Thread Mathieu OTHACEHE
Closing wait delay is configurable per device using TIOCSSERIAL. Also initialise tty_port closing_wait in port_probe with default value. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a

[PATCH 14/36] usb: serial: ti_usb_3410_5052: Use macros instead of magic values

2016-05-12 Thread Mathieu OTHACEHE
Use macros to define 3410 and 5052 baud bases and remove useless casting. Use macro to define usb download timeout. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/usb

[PATCH 08/36] usb: serial: ti_usb_3410_5052: Remove useless dev_dbg messages

2016-05-12 Thread Mathieu OTHACEHE
Remove useless or redundant dev_dbg messages. Fix debug-message typos. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 11/36] usb: serial: ti_usb_3410_5052: Use C_X macros instead of c_cflag manipulation

2016-05-12 Thread Mathieu OTHACEHE
Use C_X tty.h macros to avoid direct manipulation of termios c_cflag variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 12/36] usb: serial: ti_usb_3410_5052: Use generic read/write callbacks

2016-05-12 Thread Mathieu OTHACEHE
Remove read_bulk_callback, write_bulk_callback, write, write_room, chars_in_buffer, throttle and unthrottle callbacks who uselessly reimplements generic functions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 315 -- 1 file changed

[PATCH 13/36] usb: serial: ti_usb_3410_5052: Remove unused variables

2016-05-12 Thread Mathieu OTHACEHE
Remove variables affected but never read. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 58df42d..00ae52e 100644 --- a

[PATCH 16/36] usb: serial: ti_usb_3410_5052: Use bulk_out_size in TIOCGSERIAL

2016-05-12 Thread Mathieu OTHACEHE
Use bulk_out_size instead of recalculate it with kfifo_size Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index eb4df1e

[PATCH 18/36] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments

2016-05-12 Thread Mathieu OTHACEHE
Remove useless ti_device pointer, and change addr to u32. Move function upper to avoid function prototyping. Also change size variable in function from int to size_t. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 76 --- 1 file

[PATCH 10/36] usb: serial: ti_usb_3410_5052: Remove useless NULL-testing

2016-05-12 Thread Mathieu OTHACEHE
It is useless to check the return of usb_get_serial_port_data. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 09/36] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc

2016-05-12 Thread Mathieu OTHACEHE
Use kzalloc instead of kmalloc to avoid field initialisation to 0. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c

[PATCH 20/36] usb: serial: ti_usb_3410_5052: Remove usb_serial pointer in ti_port

2016-05-12 Thread Mathieu OTHACEHE
There is no need to keep a pointer to usb_serial in ti_port structure. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial

[PATCH 15/36] usb: serial: ti_usb_3410_5052: Remove in_sync and out_sync functions

2016-05-12 Thread Mathieu OTHACEHE
mmand sending. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 156 +++--- 1 file changed, 88 insertions(+), 68 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 91ea1b5..eb4df1e 1

[PATCH 19/36] usb: serial: ti_usb_3410_5052: Do not modify interrupt context

2016-05-12 Thread Mathieu OTHACEHE
It is useless to pass a specific context (ti_device) to the interrupt callback. So use the default context (usb_serial_port). Remove useless variables in ti_interrupt_callback. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 55

[PATCH 21/36] usb: serial: ti_usb_3410_5052: Use generic close function

2016-05-12 Thread Mathieu OTHACEHE
Use usb_serial_generic_close in close callback. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH 23/36] usb: serial: ti_usb_3410_5052: Do not set shadow mcr in open callback

2016-05-12 Thread Mathieu OTHACEHE
Setting DTR/RTS is handled using dtr_rts in tty_core. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 2a993a2..d8bed30 100644 --- a

[PATCH 22/36] usb: serial: ti_usb_3410_5052: Change ti_get/set_serial_info function arguments

2016-05-12 Thread Mathieu OTHACEHE
It is sufficient to pass usb_serial_port structure to ti_get_serial_info and ti_set_serial_info. Also move functions above ioctl to avoid function prototyping and use unsigned int instead of unsigned for cwait variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c

[PATCH 31/36] usb: serial: ti_usb_3410_5052: Use a mutex to protect shadow mcr

2016-05-12 Thread Mathieu OTHACEHE
Only shadow msr is accessed from interrupt context. So use the ti_port spinlock to protect only shadow msr. Add a mutex in ti_port to protect mcr from concurrent access. Also move shadow mcr setting out of ti_set_mcr function. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial

[PATCH 30/36] usb: serial: ti_usb_3410_5052: Remove backpointer in ti_port

2016-05-12 Thread Mathieu OTHACEHE
In ti_port structure, remove useless tp_tdev backpointer. Also remove pointer to usb_serial_port. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 44 --- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/usb

[PATCH 32/36] usb: serial: ti_usb_3410_5052: Remove prefixes from private structures

2016-05-12 Thread Mathieu OTHACEHE
Remove prefixes from ti_port and ti_device structures. Also change type of is_3410 from int to bool. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 114 +- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/drivers/usb

[PATCH 27/36] usb: serial: ti_usb_3410_5052: Standardize debug and error messages

2016-05-12 Thread Mathieu OTHACEHE
Use the format "error text: error value\n" when possible. Drop redundant function names from error messages. Also move a couple err messages to dbg messages. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 83 +-- 1 file c

[PATCH 26/36] usb: serial: ti_usb_3410_5052: Fix firmware downloading

2016-05-12 Thread Mathieu OTHACEHE
to do any padding. This patch also move firmware buffer manipulation to ti_do_download function. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 62 +++ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/drivers/usb/serial/ti_usb_

[PATCH 28/36] usb: serial: ti_usb_3410_5052: Use variables for vendor and product

2016-05-12 Thread Mathieu OTHACEHE
Use variables for vendor and product in download_firmware to improve readability. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 29/36] usb: serial: ti_usb_3410_5052: Set shadow msr before waking up waiters

2016-05-12 Thread Mathieu OTHACEHE
Save msr before testing the delta and waking up any waiters. Also use port directly instead of tport->tp_port. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/ser

[PATCH 35/36] usb: serial: ti_usb_3410_5052: Remove function prototypes

2016-05-12 Thread Mathieu OTHACEHE
Declare functions in a the right order to avoid prototyping. There is no functional change here. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 1112 - 1 file changed, 544 insertions(+), 568 deletions(-) diff --git a/drivers/usb

[PATCH 33/36] usb: serial: ti_usb_3410_5052: Add CMSPAR support

2016-05-12 Thread Mathieu OTHACEHE
Add CMSPAR support in set_termios callback. Move TI_UART_ENABLE_PARITY_CHECKING setting in the upper block to avoid doing it twice. Delete useless TI_UART_ENABLE_PARITY_CHECKING unsetting. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 19 ++- 1 file

[PATCH 24/36] usb: serial: ti_usb_3410_5052: Use usb_serial_generic_open

2016-05-12 Thread Mathieu OTHACEHE
Use usb_serial_generic_open in open callback to start read urb. Also remove useless usb_device pointer. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/usb/serial

[PATCH 25/36] usb: serial: ti_usb_3410_5052: Check old_termios parameter in set_termios

2016-05-12 Thread Mathieu OTHACEHE
callback because it is the initial call to set_termios. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH 36/36] usb: serial: ti_usb_3410_5052: Add myself as an author

2016-05-12 Thread Mathieu OTHACEHE
Add myself in the copyright section and as an author of the driver. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c

[PATCH 17/36] usb: serial: ti_usb_3410_5052: Remove useless tty_wakeup

2016-05-12 Thread Mathieu OTHACEHE
The generic driver doesn't call tty_wakeup in usb_serial_generic_msr_changed so this tty_wakeup seems useless. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/dr

[PATCH 34/36] usb: serial: ti_usb_3410_5052: Fix indentation problems

2016-05-12 Thread Mathieu OTHACEHE
Fix some minor indentation problems. Also correct a multi-line comment. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers

[PATCH 01/36] usb: serial: ti_usb_3410_5052: Remove useless comments

2016-05-12 Thread Mathieu OTHACEHE
Remove lines commenting the obvious. Remove vi related comment. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial

[PATCH v2] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support

2016-05-10 Thread Mathieu OTHACEHE
Hub with Isolation. These devices are based on TI 3410 chip. Signed-off-by: Mathieu OTHACEHE --- Hi, Here is the second version of the patch. Thank you, Mathieu Changelog: v2: * Add a rs485_only flag to device structure. * Try to load moxa firmware without fallback. drivers/usb/serial

Re: [PATCH] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support

2016-05-03 Thread Mathieu OTHACEHE
> No, I was trying to say that the we should not attempt to load a > firmware on the "ti_usb-v%04x-p%04x.fw" format before loading the moxa > firmware. For MTS devices (mts_*.fw) and for devices using generic firmware (ti_3410.fw and ti_5052.fw), ti_usb-v%04x-p%04x.fw loading is already failing.

[PATCH] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support

2016-05-02 Thread Mathieu OTHACEHE
Hi Johan, Thanks for your review. > Looks like this code could use a few vid/pid temporaries. > I'm not sure it makes sense to try to load a "ti_usb-v110a-p1150.fw" > firmware before requesting the moxa firmware. Avoids a confusing: > usb 1-2.2: Direct firmware load for ti_usb-v110a-p1150.fw fa

Re: [PATCH v3] tty: serial: 8250: add MOXA Smartio MUE boards support

2016-03-19 Thread Mathieu OTHACEHE
Hi, Sorry about late reply. No I haven't planned to do it soon. Your board is supported by mxser driver (drivers/tty/mxser.c). I think it would be nice to move everything from mxser.c to 8250_moxa.c. The problem is mxser supports ISA and PCI boards and I don't have the hardware to test it. Ma

[PATCH] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support

2016-03-02 Thread Mathieu OTHACEHE
Hub with Isolation. These devices are based on TI 3410 chip. Signed-off-by: Mathieu OTHACEHE --- Hi, This patch add support for MOXA UPORT 11x0 devices to ti_usb_3410_5052. The informations are extracted from the now reverted mxu11x0 driver. There is a delicate point in the attach callback

Re: [PATCH v2 1/4] USB: mxu11x0: fix memory leak on usb_serial private data

2016-02-28 Thread Mathieu OTHACEHE
On Sun, Feb 28, 2016 at 01:20:16PM +0100, Johan Hovold wrote: > On Sat, Jan 30, 2016 at 06:40:30PM +0100, Mathieu OTHACEHE wrote: > > On Mon, Jan 25, 2016 at 01:01:59PM +0100, Johan Hovold wrote: > > > On Mon, Jan 04, 2016 at 07:49:36PM +0100, Mathieu OTHACEHE wrote: > >

[PATCH v3] tty: serial: 8250: add MOXA Smartio MUE boards support

2016-02-24 Thread Mathieu OTHACEHE
available on MOXA website. I was able to test it on a CP-168EL-A on PC. Signed-off-by: Mathieu OTHACEHE --- Hi, Here is v3 of the patch, it fixes problems pointed out by last Andy review. Thanks, Mathieu Changelog: V3: * Add supported boards to 8250_pci blacklist * Use MOXA_DEVICE macro to simplify

[PATCH v2] tty: serial: 8250: add MOXA Smartio MUE boards support

2016-02-20 Thread Mathieu OTHACEHE
available on MOXA website. I was able to test it on a CP-168EL-A on PC. Signed-off-by: Mathieu OTHACEHE --- Hi, Here is v2 of the driver, I moved driver code from 8250_pci.c to 8250_moxa.c as suggested by Andy. I also fixed other problems pointed out by Jiri and Andy. Thanks, Mathieu Changelog: V2

[PATCH] serial: 8250_pci: add MOXA Smartio MUE boards support

2016-02-12 Thread Mathieu OTHACEHE
- CP-118E-A: 8 ports RS422/485 PCIE card - CP-138E-A: 8 ports RS422/485 PCIE card - CP-134EL-A: 4 ports RS422/485 PCIE card - CP-116E-A (A): 8 ports RS232/422/485 PCIE card - CP-116E-A (B): 8 ports RS232/422/485 PCIE card Signed-off-by: Mathieu OTHACEHE --- Hi, This patch add support for MOXA

Re: [PATCH] tty: add Moxa Smartio MUE serial driver

2016-02-09 Thread Mathieu OTHACEHE
> I'm sorry, but it looks like 8250 based driver if I'm not mistaken. In > which case why not to use 8250_core.c / 8250_port.c and entire 8250/ > infrastructure? Well, the vendor is providing two drivers for his serial pci cards : mxser and mxupcie. The mxser driver has been cleaned up and integr

[PATCH v2 2/4] USB: serial: fix returnvar.cocci warnings

2016-02-04 Thread Mathieu OTHACEHE
Remove unneeded variables when "0" can be returned. Generated by: scripts/coccinelle/misc/returnvar.cocci Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/cyberjack.c | 3 +-- drivers/usb/serial/garmin_gps.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH v2 3/4] USB: serial: fix boolinit.cocci warnings

2016-02-04 Thread Mathieu OTHACEHE
Bool initializations should use true and false. Bool tests don't need comparisons. Also, use IS_ENABLED instead of ifdef. Generated by: scripts/coccinelle/misc/boolinit.cocci Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/iuu_phoenix.c | 4 ++-- drivers/usb/serial/mos7840.c

[PATCH v2 4/4] USB: serial: fix semicolon.cocci warnings

2016-02-04 Thread Mathieu OTHACEHE
Remove unneeded semicolons. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/keyspan.c| 2 +- drivers/usb/serial/kl5kusb105.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/serial/keyspan.c b

[PATCH v2 1/4] USB: serial: fix compare_const_fl.cocci warnings

2016-02-04 Thread Mathieu OTHACEHE
Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Signed-off-by: Mathieu OTHACEHE --- Move constants to the right improve readability in my opinion. But it's a matter of taste, and nothing is specified in CodingStyle. driver

[PATCH v2 0/4] USB: serial: Fix coccinelle warnings

2016-02-04 Thread Mathieu OTHACEHE
This series of patches fixes all coccinelle warnings in USB serial subsystem. V2: * Squash patches per type of issues reported by coccinelle Mathieu OTHACEHE (4): USB: serial: fix compare_const_fl.cocci warnings USB: serial: fix returnvar.cocci warnings USB: serial: fix boolinit.cocci

  1   2   >