[RESEND][RFC PATCH] regulator: introduce boot protection flag

2016-06-02 Thread WEN Pingbo
a boot_protection flag in regulator constraints. And regulator core will postpone all operations until all consumers have taked their place. The boot_protection flag only work before late_initicall. And as other constraints liked, you can specify this flag in a board file, or in dts file. Signed-off-by: WEN

[RESEND][RFC PATCH] regulator: introduce boot protection flag

2016-06-02 Thread WEN Pingbo
a boot_protection flag in regulator constraints. And regulator core will postpone all operations until all consumers have taked their place. The boot_protection flag only work before late_initicall. And as other constraints liked, you can specify this flag in a board file, or in dts file. Signed-off-by: WEN

[RFC PATCH] regulator: introduce boot protection flag

2016-05-09 Thread WEN Pingbo
a boot_protection flag in regulator constraints. And regulator core will postpone all operations until all consumers have taked their place. The boot_protection flag only work before late_initicall. And as other constraints liked, you can specify this flag in a board file, or in dts file. Signed-off-by: WEN

[RFC PATCH] regulator: introduce boot protection flag

2016-05-09 Thread WEN Pingbo
a boot_protection flag in regulator constraints. And regulator core will postpone all operations until all consumers have taked their place. The boot_protection flag only work before late_initicall. And as other constraints liked, you can specify this flag in a board file, or in dts file. Signed-off-by: WEN

[RFC PATCH 2/2] regulator: add boot protection flag

2016-04-23 Thread WEN Pingbo
. ] Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/regulator/core.c | 24 +--- drivers/regulator/of_regulator.c | 29 + include/linux/regulator/machine.h | 2 ++ 3 files changed, 52 insertions(+), 3 deletions(-) diff

[RFC PATCH 2/2] regulator: add boot protection flag

2016-04-23 Thread WEN Pingbo
. ] Signed-off-by: WEN Pingbo --- drivers/regulator/core.c | 24 +--- drivers/regulator/of_regulator.c | 29 + include/linux/regulator/machine.h | 2 ++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b

[RFC PATCH 1/2] regulator: refactor valid_ops_mask checking code

2016-04-23 Thread WEN Pingbo
To make the code more compat and centralized, this patch add a unified function - regulator_ops_is_valid. So we can add some extra checking code easily later. Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/regulator/core.c | 88 -

[RFC PATCH 1/2] regulator: refactor valid_ops_mask checking code

2016-04-23 Thread WEN Pingbo
To make the code more compat and centralized, this patch add a unified function - regulator_ops_is_valid. So we can add some extra checking code easily later. Signed-off-by: WEN Pingbo --- drivers/regulator/core.c | 88 1 file changed, 29

[PATCH 2/3] input: evdev: add new ioctl EVIOCSIFTYPE / EVIOCGIFTYPE

2015-11-27 Thread WEN Pingbo
to new interface. And since all events are stored as input_value in evdev, there are no need to flush evdev_client's buffer if we change clk_type and if_type. Signed-off-by: WEN Pingbo --- drivers/input/evdev.c | 39 +++ include/uapi/linux/input.h | 10

[PATCH 1/3] input: evdev: introduce new evdev interface

2015-11-27 Thread WEN Pingbo
converted input_event to input_value in evdev entirely, and move all time-related operations to input_event_to/from_user(). Signed-off-by: WEN Pingbo --- drivers/input/evdev.c| 78 --- drivers/input/input-compat.c | 148 --- drivers

[PATCH 3/3] uinput: convert input_event to input_value

2015-11-27 Thread WEN Pingbo
This patch depends on 'add new evdev interface'. We should not use input_event in kernel any more. Convert it in uinput, and adapt to new api changes. Signed-off-by: WEN Pingbo --- drivers/input/misc/uinput.c | 23 +++ include/linux/uinput.h | 2 +- 2 files changed

[PATCH 0/3] introduce new evdev interface type

2015-11-27 Thread WEN Pingbo
interface type. I have run this test in my Dragonboard 410c, by this command: $ evtest -l -r -c -n 40 No problem found, all events are received normally. [1]: previous patches - https://www.spinics.net/lists/y2038/msg00959.html [2]: evtest source code - https://github.com/wengpingbo/evtest WEN

[PATCH 0/3] introduce new evdev interface type

2015-11-27 Thread WEN Pingbo
interface type. I have run this test in my Dragonboard 410c, by this command: $ evtest -l -r -c -n 40 No problem found, all events are received normally. [1]: previous patches - https://www.spinics.net/lists/y2038/msg00959.html [2]: evtest source code - https://github.com/wengpingbo/evtest WEN

[PATCH 1/3] input: evdev: introduce new evdev interface

2015-11-27 Thread WEN Pingbo
converted input_event to input_value in evdev entirely, and move all time-related operations to input_event_to/from_user(). Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/evdev.c| 78 --- drivers/input/input-compat.c

[PATCH 3/3] uinput: convert input_event to input_value

2015-11-27 Thread WEN Pingbo
This patch depends on 'add new evdev interface'. We should not use input_event in kernel any more. Convert it in uinput, and adapt to new api changes. Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/misc/uinput.c | 23 +++ include/linux/uinput.h

[PATCH 2/3] input: evdev: add new ioctl EVIOCSIFTYPE / EVIOCGIFTYPE

2015-11-27 Thread WEN Pingbo
to new interface. And since all events are stored as input_value in evdev, there are no need to flush evdev_client's buffer if we change clk_type and if_type. Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/evdev.c | 39 +++ includ

[PATCH V4] hp_sdc: convert struct timeval to ktime_t

2015-10-23 Thread WEN Pingbo
struct timeval is not y2038 safe, convert it to ktime_t, and there is no need to handle sec and usec separately And since hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo --- Version 2: Using ktime_t instead of struct timespec64 Version 3

[PATCH V3 2/2] hil_mlc: convert timeval to jiffies

2015-10-23 Thread WEN Pingbo
als instart + intimeout So, all we need to do is that making sure expires is a future timestamp before passed it to mod_timer Signed-off-by: WEN Pingbo --- Version 2: Using ktime_t to fix y2038 problem Version 3: Convert it to jiffies drivers/input/serio/hil_mlc.c|

[PATCH V3 1/2] hil_mlc: convert timeval to time64_t

2015-10-23 Thread WEN Pingbo
Since mlc->lcv_t is only interested in seconds, directly using time64_t here Signed-off-by: WEN Pingbo --- Version 2: Convert timeval to ktime_t Version 3: Convert it to time64_t, since it's a better choice drivers/input/serio/hil_mlc.c | 8 +++- include/linux/hil_ml

[PATCH V3] hp_sdc: convert struct timeval to ktime_t

2015-10-23 Thread WEN Pingbo
1. struct timeval is not y2038 safe, convert it to ktime_t, and there is no need to handle sec and usec separately 2. hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo --- Version 2: Using ktime_t instead of struct timespec64 Version 3

[PATCH V2] hil_mlc: convert timeval to ktime_t

2015-10-23 Thread WEN Pingbo
all time. In addition, the original driver try to covert usec to jiffies manually in hilse_donode(). This is not a universal and safe way, using nsecs_to_jiffies() to fix that. Signed-off-by: WEN Pingbo --- drivers/input/serio/hil_mlc.c| 28 +--- drivers/input/se

[PATCH V2] hp_sdc: fixed y2038 problem

2015-10-23 Thread WEN Pingbo
1. Converting timeval to ktime_t, and there is no need to handle sec and usec separately 2. hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo --- drivers/input/serio/hp_sdc.c | 16 ++-- include/linux/hp_sdc.h | 6 +++--- 2 files

[PATCH V2] hp_sdc: fixed y2038 problem

2015-10-23 Thread WEN Pingbo
1. Converting timeval to ktime_t, and there is no need to handle sec and usec separately 2. hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/serio/hp_sdc.c | 16 ++-- include/linux/hp

[PATCH V3] hp_sdc: convert struct timeval to ktime_t

2015-10-23 Thread WEN Pingbo
1. struct timeval is not y2038 safe, convert it to ktime_t, and there is no need to handle sec and usec separately 2. hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- Version 2: Using ktime_t instead of

[PATCH V2] hil_mlc: convert timeval to ktime_t

2015-10-23 Thread WEN Pingbo
all time. In addition, the original driver try to covert usec to jiffies manually in hilse_donode(). This is not a universal and safe way, using nsecs_to_jiffies() to fix that. Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/serio/hil_mlc.

[PATCH V4] hp_sdc: convert struct timeval to ktime_t

2015-10-23 Thread WEN Pingbo
struct timeval is not y2038 safe, convert it to ktime_t, and there is no need to handle sec and usec separately And since hp_sdc.rtv is only used for time diff, monotonic time is better here Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- Version 2: Using ktime_t instead of

[PATCH V3 1/2] hil_mlc: convert timeval to time64_t

2015-10-23 Thread WEN Pingbo
Since mlc->lcv_t is only interested in seconds, directly using time64_t here Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- Version 2: Convert timeval to ktime_t Version 3: Convert it to time64_t, since it's a better choice drivers/input/serio/hil_

[PATCH V3 2/2] hil_mlc: convert timeval to jiffies

2015-10-23 Thread WEN Pingbo
als instart + intimeout So, all we need to do is that making sure expires is a future timestamp before passed it to mod_timer Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- Version 2: Using ktime_t to fix y2038 problem Version 3: Convert it to jiffies drivers/in

[PATCH] hil_mlc: convert timeval to timespec64

2015-10-18 Thread WEN Pingbo
Using struct timeval will cause time overflow in 2038, replacing it with a 64bit version. In addition, the origin driver try to covert usec to jiffies manually in hilse_donode(). This is not a universal and safe way, using nsecs_to_jiffies() to fix that. Signed-off-by: WEN Pingbo --- drivers

[PATCH] hp_sdc: fixed y2038 problem

2015-10-18 Thread WEN Pingbo
Two replacements happened in this patch: 1. using timespec64 to prevent time overflow in 2038 2. using ktime_get_ts64 to avoid wall time issues(leap second, etc) Signed-off-by: WEN Pingbo --- drivers/input/serio/hp_sdc.c | 18 +- include/linux/hp_sdc.h | 6

[PATCH] hil_mlc: convert timeval to timespec64

2015-10-18 Thread WEN Pingbo
Using struct timeval will cause time overflow in 2038, replacing it with a 64bit version. In addition, the origin driver try to covert usec to jiffies manually in hilse_donode(). This is not a universal and safe way, using nsecs_to_jiffies() to fix that. Signed-off-by: WEN Pingbo <pin

[PATCH] hp_sdc: fixed y2038 problem

2015-10-18 Thread WEN Pingbo
Two replacements happened in this patch: 1. using timespec64 to prevent time overflow in 2038 2. using ktime_get_ts64 to avoid wall time issues(leap second, etc) Signed-off-by: WEN Pingbo <pingbo@linaro.org> --- drivers/input/serio/hp_sdc.c | 18 +- include

[PATCH V3] dummy_hcd: replace timeval with timespec64

2015-09-17 Thread WEN Pingbo
The millisecond of the last second will be normal if tv_sec is overflowed. But for y2038 consistency and demonstration purpose, and avoiding further risks, we need to remove 'timeval' in this driver, to avoid similair problems. Signed-off-by: Pingbo Wen Reviewed-by: Arnd Bergmann --- V3

[PATCH V3] dummy_hcd: replace timeval with timespec64

2015-09-17 Thread WEN Pingbo
The millisecond of the last second will be normal if tv_sec is overflowed. But for y2038 consistency and demonstration purpose, and avoiding further risks, we need to remove 'timeval' in this driver, to avoid similair problems. Signed-off-by: Pingbo Wen <pingbo@linaro.org> Reviewed-by

[PATCH V2] dummy_hcd: replace timeval with timespec64

2015-09-16 Thread WEN Pingbo
Bergmann Cc: Felipe Balbi Signed-off-by: WEN Pingbo --- drivers/usb/gadget/udc/dummy_hcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 1379ad4..6d1ed35 100644 --- a/drivers/usb/gadget

[PATCH V2] hp_sdc_rtc: fixed y2038 problem in proc_show

2015-09-16 Thread WEN Pingbo
(handshake, match timer, etc), Replacements in those timer are just for consistency. Version 2 Updates: - compiled in m68k gcc cross compiler(4.6.3), no extra warnings - placed s64 type cast in tv.tv_sec, making sure it work properly in both 32bit and 64bit platform. Signed-off-by: WEN Pingbo Cc

[PATCH V2] hp_sdc_rtc: fixed y2038 problem in proc_show

2015-09-16 Thread WEN Pingbo
(handshake, match timer, etc), Replacements in those timer are just for consistency. Version 2 Updates: - compiled in m68k gcc cross compiler(4.6.3), no extra warnings - placed s64 type cast in tv.tv_sec, making sure it work properly in both 32bit and 64bit platform. Signed-off-by: WEN Pingbo

[PATCH V2] dummy_hcd: replace timeval with timespec64

2015-09-16 Thread WEN Pingbo
() with ktime_get_ts64(), to avoid leap second issues. The frame time in USB is always 1ms, no matter what speed, so ktime_get_ts64() have enough resolution to cover this. - using NSEC_PER_MSEC instead of hard code. Signed-off-by: Pingbo Wen <pingbo@linaro.org> Cc: Y20

[PATCH] dummy_hcd: replace timeval with timespec64

2015-09-15 Thread WEN Pingbo
The millisecond of the last second will be normal if tv_sec is overflowed. But for y2038 consistency and demonstration purpose, and avoiding further risks, we still need to fix it here, to avoid similair problems. Signed-off-by: Pingbo Wen Cc: Y2038 Cc: linux-kernel@vger.kernel.org Cc: Arnd

[PATCH] dummy_hcd: replace timeval with timespec64

2015-09-15 Thread WEN Pingbo
The millisecond of the last second will be normal if tv_sec is overflowed. But for y2038 consistency and demonstration purpose, and avoiding further risks, we still need to fix it here, to avoid similair problems. Signed-off-by: Pingbo Wen <pingbo@linaro.org> Cc: Y2038 <y2...@lists.l