[PATCH] kdb: use ktime_get_seconds() instead of ktime_get_ts()

2018-01-25 Thread Baolin Wang
use the ktime_get_seconds() to get the monotonic time without a lock, moreover we can remove the 'struct timespec', which is not y2038 safe. Signed-off-by: Baolin Wang --- kernel/debug/kdb/kdb_main.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel

[RESEND PATCH] rtc: Fix overflow when converting time64_t to rtc_time

2018-01-25 Thread Baolin Wang
If we convert one large time values to rtc_time, in the original formula 'days * 86400' can be overflowed in 'unsigned int' type to make the formula get one incorrect remain seconds value. Thus we can use div_s64_rem() function to avoid this situation. Signed-off-by: Baolin Wa

Re: [PATCH v7 2/2] mfd: syscon: Add hardware spinlock support

2018-01-11 Thread Baolin Wang
Hi Arnd, On 2 January 2018 at 23:36, Lee Jones wrote: > Arnd, > >> Some system control registers need hardware spinlock to synchronize >> between the multiple subsystems, so we should add hardware spinlock >> support for syscon. >> >> Signed-off-by: B

[PATCH 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-01-30 Thread Baolin Wang
The Spreadtrum SC9860 platform GPIO controller contains 16 groups and each group contains 16 GPIOs. Each GPIO can set input/output and has the interrupt capability. Signed-off-by: Baolin Wang --- drivers/gpio/Kconfig |7 ++ drivers/gpio/Makefile|1 + drivers/gpio/gpio-sprd.c

[PATCH 1/2] dt-bindings: gpio: Add Spreadtrum GPIO controller documentation

2018-01-30 Thread Baolin Wang
This patch adds the device tree bindings for the Spreadtrum GPIO controller. The gpios will be supported by the GPIO generic library. Signed-off-by: Baolin Wang --- .../devicetree/bindings/gpio/gpio-sprd.txt | 28 1 file changed, 28 insertions(+) create mode

Re: [PATCH 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-01-30 Thread Baolin Wang
Hi Andy, On 31 January 2018 at 00:48, Andy Shevchenko wrote: > On Tue, Jan 30, 2018 at 2:07 PM, Baolin Wang wrote: >> The Spreadtrum SC9860 platform GPIO controller contains 16 groups and >> each group contains 16 GPIOs. Each GPIO can set input/output and has >> the

[PATCH v2 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-01-31 Thread Baolin Wang
The Spreadtrum SC9860 platform GPIO controller contains 16 groups and each group contains 16 GPIOs. Each GPIO can set input/output and has the interrupt capability. Signed-off-by: Baolin Wang Reviewed-by: Andy Shevchenko --- Changes since v1: - Change 'bool' to 'tristate'.

[PATCH v2 1/2] dt-bindings: gpio: Add Spreadtrum GPIO controller documentation

2018-01-31 Thread Baolin Wang
This patch adds the device tree bindings for the Spreadtrum GPIO controller. The gpios will be supported by the GPIO generic library. Signed-off-by: Baolin Wang --- Changes since v1: - No updates. --- .../devicetree/bindings/gpio/gpio-sprd.txt | 28 1 file

Re: [PATCH 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-01-31 Thread Baolin Wang
On 31 January 2018 at 22:23, Andy Shevchenko wrote: > On Wed, Jan 31, 2018 at 4:01 AM, Baolin Wang wrote: >> On 31 January 2018 at 00:48, Andy Shevchenko >> wrote: >>> On Tue, Jan 30, 2018 at 2:07 PM, Baolin Wang wrote: >>>> The Spreadtrum SC9860 platfor

Re: [PATCH 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-02-01 Thread Baolin Wang
Hi Markus, On 1 February 2018 at 20:17, Marcus Folkesson wrote: > Hi Baolin, > > On Tue, Jan 30, 2018 at 08:07:43PM +0800, Baolin Wang wrote: >> The Spreadtrum SC9860 platform GPIO controller contains 16 groups and >> each group contains 16 GPIOs. Each GPIO can set input/

Re: [PATCH 2/2] gpio: Add GPIO driver for Spreadtrum SC9860 platform

2018-02-01 Thread Baolin Wang
On 1 February 2018 at 20:22, Marcus Folkesson wrote: > On Thu, Feb 01, 2018 at 11:08:46AM +0800, Baolin Wang wrote: >> On 31 January 2018 at 22:23, Andy Shevchenko >> wrote: >> > On Wed, Jan 31, 2018 at 4:01 AM, Baolin Wang >> > wrote: >> >>

Re: [PATCH v7 2/2] mfd: syscon: Add hardware spinlock support

2018-01-23 Thread Baolin Wang
Hi Lee, On 22 January 2018 at 21:43, Lee Jones wrote: > On Thu, 11 Jan 2018, Lee Jones wrote: >> On Mon, 25 Dec 2017, Baolin Wang wrote: >> >> > Some system control registers need hardware spinlock to synchronize >> > between the multiple subsystems, s

Re: [PATCH] rtc: Fix overflow when converting time64_t to rtc_time

2018-01-07 Thread Baolin Wang
Hi Alexandre, On 25 December 2017 at 19:10, Baolin Wang wrote: > If we convert one large time values to rtc_time, in the original formula > 'days * 86400' can be overflowed in 'unsigned int' type to make the formula > get one incorrect remain seconds value

[PATCH 1/3] rtc: Use time64_t to save range_max of RTC

2018-01-07 Thread Baolin Wang
We need use rtc->range_max to valid if the time values are valid, and the time values are saved by time64_t type. So change the rtc->range_max to time64_t type for comparison correctly. Signed-off-by: Baolin Wang --- include/linux/rtc.h |2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 3/3] rtc: Add one offset seconds to expand RTC range

2018-01-07 Thread Baolin Wang
RTC hardware could get interpreted as times from 2070 to 2099, but the interpretation of dates between 2000 and 2069 would not change. Signed-off-by: Baolin Wang --- drivers/rtc/class.c | 70 +++ drivers/rtc/interface.c |

[PATCH 2/3] rtc: Factor out the RTC range validation into rtc_valid_range()

2018-01-07 Thread Baolin Wang
The RTC range validation code can be factored into rtc_valid_range() function to avoid duplicate code. Signed-off-by: Baolin Wang --- drivers/rtc/interface.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/rtc/interface.c b/drivers

Re: [PATCH] kdb: use ktime_get_seconds() instead of ktime_get_ts()

2018-01-26 Thread Baolin Wang
On 26 January 2018 at 22:00, Daniel Thompson wrote: > On Fri, Jan 26, 2018 at 10:21:58AM +0100, Arnd Bergmann wrote: >> On Fri, Jan 26, 2018 at 4:03 AM, Baolin Wang wrote: >> > The kdb code will print the monotonic time by ktime_get_ts(), but >> > the ktime_get_

Re: [PATCH] kdb: use ktime_get_seconds() instead of ktime_get_ts()

2018-01-28 Thread Baolin Wang
On 27 January 2018 at 00:01, Arnd Bergmann wrote: > On Fri, Jan 26, 2018 at 3:20 PM, Baolin Wang wrote: >> On 26 January 2018 at 22:00, Daniel Thompson >> wrote: >>> On Fri, Jan 26, 2018 at 10:21:58AM +0100, Arnd Bergmann wrote: >>>> On Fri, Jan 26, 2018

[PATCH v2] kdb: use ktime_get_mono_fast_ns() instead of ktime_get_ts()

2018-01-28 Thread Baolin Wang
monotonic time, which is NMI safe access to clock monotonic. Moreover we can remove the 'struct timespec', which is not y2038 safe. Signed-off-by: Baolin Wang --- Changes since v1: - Use ktime_get_mono_fast_ns() instead of ktime_get_seconds(). --- kernel/debug/kdb/kdb_main.c |6

Re: [PATCH] power: reset: Add Spreadtrum SC27xx PMIC power off support

2018-01-29 Thread Baolin Wang
Hi Sebastian, On 15 January 2018 at 15:58, Baolin Wang wrote: > On Spreadtrum platform, we need power off system through external SC27xx > series PMICs including the SC2720, SC2721, SC2723, SC2730 and SC2731 chips. > Thus this patch adds SC27xx series PMICs power-off support. > >

[PATCH 1/3] clocksource: Skip to check the override clocksource if override name is empty

2018-01-16 Thread Baolin Wang
Some platforms will not set the override clocksource name to select, so we can skip to check the override clocksource when selecting one clocksource. Signed-off-by: Baolin Wang --- kernel/time/clocksource.c |4 1 file changed, 4 insertions(+) diff --git a/kernel/time/clocksource.c b

[PATCH 2/3] clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes

2018-01-16 Thread Baolin Wang
Convert DEVICE_ATTR to DEVICE_ATTR_RW/RO/WO to make attributes' definition more clear. Signed-off-by: Baolin Wang --- kernel/time/clocksource.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/kernel/time/clocksource.c b/k

[PATCH 3/3] clocksource: Use ATTRIBUTE_GROUPS macro

2018-01-16 Thread Baolin Wang
Convert to use ATTRIBUTE_GROUPS to define one attribute group pointed by 'groups' of the device, which can avoid issuing device_create_file() many times. Signed-off-by: Baolin Wang --- kernel/time/clocksource.c | 21 ++--- 1 file changed, 10 insertions(+), 11

[PATCH 2/2] clocksource: sprd: Add one persistent timer for Spreadtrum SC9860 platform

2018-01-09 Thread Baolin Wang
On Spreadtrum SC9860 platform, we need one persistent timer to calculate the suspend time to compensate the OS time. This patch registers one Spreadtrum AON timer as persistent timer, which runs at 32bit and periodic mode. Signed-off-by: Baolin Wang --- drivers/clocksource/Kconfig |1

[PATCH 1/2] clocksource: Add persistent timer support

2018-01-09 Thread Baolin Wang
for timer drivers to register one persistent timer and implements the read_persistent_clock64() to compensate the OS time. Signed-off-by: Baolin Wang --- drivers/clocksource/Kconfig|3 + drivers/clocksource/Makefile |1 + drivers/clocksource/persistent-timer.c | 142

Re: [PATCH 1/2] clocksource: Add persistent timer support

2018-01-09 Thread Baolin Wang
On 9 January 2018 at 19:16, Arnd Bergmann wrote: > On Tue, Jan 9, 2018 at 10:09 AM, Baolin Wang wrote: >> On some platforms (such as Spreadtrum sc9860 platform), they need one >> persistent timer to calculate the suspended time and compensate it >> for the OS time. >&

[PATCH] power: reset: Add Spreadtrum SC27xx PMIC power off support

2018-01-14 Thread Baolin Wang
On Spreadtrum platform, we need power off system through external SC27xx series PMICs including the SC2720, SC2721, SC2723, SC2730 and SC2731 chips. Thus this patch adds SC27xx series PMICs power-off support. Signed-off-by: Baolin Wang --- drivers/power/reset/Kconfig |9

Re: [PATCH v3 3/3] gpio: Add Spreadtrum PMIC EIC driver support

2018-03-27 Thread Baolin Wang
On 5 March 2018 at 23:46, Andy Shevchenko wrote: > On Mon, Mar 5, 2018 at 4:56 AM, Baolin Wang wrote: >> The Spreadtrum PMIC EIC controller contains only one bank of debounce EIC, >> and this bank contains 16 EICs. Each EIC can only be used as input mode, >> as well as su

[PATCH 1/2] hwspinlock: Convert to use 'switch' statement

2018-04-07 Thread Baolin Wang
We have different hwspinlock modes to select, thus it will be more readable to handle different modes with using 'switch' statement instead of 'if' statement. Signed-off-by: Baolin Wang --- drivers/hwspinlock/hwspinlock_core.c | 33 -

[PATCH 2/2] hwspinlock: Introduce one new mode for hwspinlock

2018-04-07 Thread Baolin Wang
should force user to protect the hardware lock with mutex or spinlock to avoid dead-lock. Signed-off-by: Baolin Wang --- drivers/hwspinlock/hwspinlock_core.c | 34 include/linux/hwspinlock.h | 58 ++ 2 files changed, 85 insertions

Re: [PATCH 1/5] dmaengine: sprd: Define the DMA transfer step type

2018-04-11 Thread Baolin Wang
Hi Vinod, On 11 April 2018 at 17:24, Vinod Koul wrote: > On Tue, Apr 10, 2018 at 03:46:03PM +0800, Baolin Wang wrote: >> From: Eric Long >> >> Define the DMA transfer step type to make code more readable. >> >> Signed-off-by: Eric Long >> Signed-off-by: B

Re: [PATCH 5/5] dmaengine: sprd: Add 'device_config' and 'device_prep_slave_sg' interfaces

2018-04-11 Thread Baolin Wang
Hi Vinod, On 11 April 2018 at 17:40, Vinod Koul wrote: > On Tue, Apr 10, 2018 at 03:46:07PM +0800, Baolin Wang wrote: >> This patch adds the 'device_config' and 'device_prep_slave_sg' interfaces >> for users to configure DMA. >> >> Signed-off-by:

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-11 Thread Baolin Wang
Hi Vinod, On 11 April 2018 at 17:36, Vinod Koul wrote: > On Tue, Apr 10, 2018 at 03:46:06PM +0800, Baolin Wang wrote: > >> +/* >> + * struct sprd_dma_config - DMA configuration structure >> + * @config: dma slave channel config >> + * @fragment_len: specif

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-12 Thread Baolin Wang
Hi Vinod, On 12 April 2018 at 17:37, Vinod Koul wrote: > On Wed, Apr 11, 2018 at 08:13:28PM +0800, Baolin Wang wrote: >> Hi Vinod, >> >> On 11 April 2018 at 17:36, Vinod Koul wrote: >> > On Tue, Apr 10, 2018 at 03:46:06PM +0800, Baolin Wang wrote: >> > >

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-12 Thread Baolin Wang
On 12 April 2018 at 19:30, Baolin Wang wrote: > Hi Vinod, > > On 12 April 2018 at 17:37, Vinod Koul wrote: >> On Wed, Apr 11, 2018 at 08:13:28PM +0800, Baolin Wang wrote: >>> Hi Vinod, >>> >>> On 11 April 2018 at 17:36, Vinod Koul wrote: >>>

[PATCH] timekeeping: Remove __current_kernel_time()

2018-04-12 Thread Baolin Wang
s obsolete interface. Signed-off-by: Baolin Wang --- include/linux/timekeeping32.h |3 --- kernel/time/timekeeping.c |7 --- 2 files changed, 10 deletions(-) diff --git a/include/linux/timekeeping32.h b/include/linux/timekeeping32.h index af4114d..3616b4b 100644 --- a/include/l

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-12 Thread Baolin Wang
On 13 April 2018 at 11:39, Vinod Koul wrote: > On Thu, Apr 12, 2018 at 07:30:01PM +0800, Baolin Wang wrote: > >> >> > what does block and transaction len refer to here >> >> >> >> Our DMA has 3 transfer mode: transaction transfer, block transfer

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-12 Thread Baolin Wang
On 13 April 2018 at 11:43, Vinod Koul wrote: > On Thu, Apr 12, 2018 at 07:36:34PM +0800, Baolin Wang wrote: >> >>> >> +/* >> >>> >> + * struct sprd_dma_config - DMA configuration structure >> >>> >> + * @config: dma slave channel

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-12 Thread Baolin Wang
On 13 April 2018 at 14:36, Vinod Koul wrote: > On Fri, Apr 13, 2018 at 02:17:34PM +0800, Baolin Wang wrote: > >> > Agreed, users only care about grabbing a channel, setting a descriptor and >> > submitting that. >> > >> > I think you need to go back and

Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-13 Thread Baolin Wang
On 13 April 2018 at 18:11, Vinod Koul wrote: > On Fri, Apr 13, 2018 at 02:41:48PM +0800, Baolin Wang wrote: >> On 13 April 2018 at 14:36, Vinod Koul wrote: >> > On Fri, Apr 13, 2018 at 02:17:34PM +0800, Baolin Wang wrote: >> > >> >> > Agreed, users onl

[PATCH 2/2] spi: sprd: Add the support of restarting the system

2018-03-19 Thread Baolin Wang
. Signed-off-by: Baolin Wang --- drivers/spi/spi-sprd-adi.c | 112 1 file changed, 112 insertions(+) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index b89b09d..6fc50cf 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi

[PATCH 1/2] spi: sprd: Simplify the transfer function

2018-03-19 Thread Baolin Wang
We can move the hardware spinlock protection into the ADI read/write functions to simplify the sprd_adi_transfer_one() function. Moreover this optimization can also help to access PMIC without considering the hardware spinlock using sprd_adi_read/write() functions. Signed-off-by: Baolin Wang

[PATCH 1/2] ACPI / PM: Use register_reboot_notifier() instead of pm_power_off_prepare

2018-03-21 Thread Baolin Wang
We can register one notifier through register_reboot_notifier() function to prepare to power off the system, then we can remove the 'pm_power_off_prepare' hook in following patch. Signed-off-by: Baolin Wang --- Note: Please help to review carefully, since I have no platform to

[PATCH 2/2] kernel / reboot: Remove the pm_power_off_prepare hook

2018-03-21 Thread Baolin Wang
There are no users will prepare to power off system by 'pm_power_off_prepare' hook, thus we can remove it now. Signed-off-by: Baolin Wang --- include/linux/pm.h |1 - kernel/reboot.c|8 2 files changed, 9 deletions(-) diff --git a/include/linux/pm.h b/include/

Re: [PATCH 1/2] ACPI / PM: Use register_reboot_notifier() instead of pm_power_off_prepare

2018-03-21 Thread Baolin Wang
Hi Pavel, On 21 March 2018 at 22:04, Pavel Machek wrote: > On Wed 2018-03-21 19:30:16, Baolin Wang wrote: >> We can register one notifier through register_reboot_notifier() function to >> prepare to power off the system, then we can remove the >> 'pm_power_off_pre

[RESEND PATCH] mfd: sprd: Add one syscon cell to access PMIC global registers

2018-03-21 Thread Baolin Wang
There are some global registers in Spreadtrum sc27xx PMICs, which will be accessed by other drivers. So this patch adds one syscon cell to help to access the PMIC's global registers. Signed-off-by: Baolin Wang --- drivers/mfd/sprd-sc27xx-spi.c |3 +++ 1 file changed, 3 insertions(+)

[PATCH 2/2] i2c: sprd: Fix the i2c count issue

2018-04-08 Thread Baolin Wang
We found the I2C controller count register is unreliable sometimes, that will cause I2C to lose data. Thus we can read the data count from 'i2c_dev->count' instead of the I2C controller count register. Signed-off-by: Baolin Wang --- drivers/i2c/busses/i2c-sprd.c |6 ++ 1 fi

[PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called

2018-04-08 Thread Baolin Wang
Add one flag to indicate if the i2c controller has been in suspend state, which can prevent i2c accesses after i2c controller is suspended following system suspend. Signed-off-by: Baolin Wang --- drivers/i2c/busses/i2c-sprd.c | 16 1 file changed, 16 insertions(+) diff --git

[PATCH 5/5] dmaengine: sprd: Add 'device_config' and 'device_prep_slave_sg' interfaces

2018-04-10 Thread Baolin Wang
This patch adds the 'device_config' and 'device_prep_slave_sg' interfaces for users to configure DMA. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 48 1 file changed, 48 insertions(+) diff --git a/drivers/dma/

[PATCH 1/5] dmaengine: sprd: Define the DMA transfer step type

2018-04-10 Thread Baolin Wang
From: Eric Long Define the DMA transfer step type to make code more readable. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers

[PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration

2018-04-10 Thread Baolin Wang
s. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 262 ++ include/linux/dma/sprd-dma.h | 25 2 files changed, 238 insertions(+), 49 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c ind

[PATCH 2/5] dmaengine: sprd: Define the DMA data width type

2018-04-10 Thread Baolin Wang
Define the DMA data width type to make code more readable. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index af9c156..9f44d6f 100644 --- a/drivers/dma

[PATCH 3/5] dmaengine: sprd: Move DMA request mode and interrupt type into head file

2018-04-10 Thread Baolin Wang
From: Eric Long This patch will move the Spreadtrum DMA request mode and interrupt type into one head file for user to configure. And other special SPRD DMA configurations will be added in the following patches. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c

Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called

2018-04-10 Thread Baolin Wang
Hi Grygorii, On 10 April 2018 at 04:56, Grygorii Strashko wrote: > > > On 04/09/2018 01:40 AM, Baolin Wang wrote: >> Add one flag to indicate if the i2c controller has been in suspend state, >> which can prevent i2c accesses after i2c controller is suspended following >&g

Re: [RESEND PATCH 1/3] rtc: Use time64_t to save range_max of RTC

2018-03-07 Thread Baolin Wang
Hi Alexandre, On 8 March 2018 at 06:54, Alexandre Belloni wrote: > Hi, > > On 26/02/2018 at 16:33:56 +0800, Baolin Wang wrote: >> We need use rtc->range_max to valid if the time values are valid, >> and the time values are saved by time64_t type. So change the >> r

Re: [PATCH] spi: sprd: don't mark remove function as __exit

2018-09-26 Thread Baolin Wang
; referenced in section `.data' of drivers/spi/spi-sprd.o: > defined in discarded section `.exit.text' of drivers/spi/spi-sprd.o > > Fixes: e7d973a31c24 ("spi: sprd: Add SPI driver for Spreadtrum SC9860") > Signed-off-by: Arnd Bergmann Thanks Arnd. Acked-by:

Re: [PATCH v2 1/4] power: supply: core: Introduce one property to present the battery internal resistance

2018-09-26 Thread Baolin Wang
On 26 September 2018 at 20:45, Sebastian Reichel wrote: > Hi, > > On Wed, Sep 26, 2018 at 04:30:39PM +0800, Baolin Wang wrote: >> Hi Linus, >> >> On 26 September 2018 at 16:00, Linus Walleij >> wrote: >> > On Wed, Sep 26, 2018 at 4:59 AM Baolin Wang w

Re: [PATCH v2 2/4] power: supply: core: Introduce properties to present the battery OCV table

2018-09-26 Thread Baolin Wang
On 26 September 2018 at 21:51, Sebastian Reichel wrote: > Hi, > > On Wed, Sep 26, 2018 at 10:59:12AM +0800, Baolin Wang wrote: >> Some battery driver will use the open circuit voltage (OCV) value to look >> up the corresponding battery capacity percent in one certain degree

[PATCH v13 2/2] leds: sc27xx: Add pattern_set/clear interfaces for LED controller

2018-09-26 Thread Baolin Wang
This patch implements the 'pattern_set'and 'pattern_clear' interfaces to support SC27XX LED breathing mode. Signed-off-by: Baolin Wang Acked-by: Pavel Machek --- Changes from v12: - None. Changes from v11: - None. Changes from v10: - Add duration alignment functio

[PATCH v13 1/2] leds: core: Introduce LED pattern trigger

2018-09-26 Thread Baolin Wang
can write 'hw_pattern' file to enable the hardware pattern for some LED controllers which can autonomously control brightness over time, according to some preprogrammed hardware patterns. Signed-off-by: Raphael Teysseyre Signed-off-by: Baolin Wang --- Changes from v12: - Add gradual dimming

Re: [PATCH v2 4/4] power: supply: Add Spreadtrum SC27XX fuel gauge unit driver

2018-09-26 Thread Baolin Wang
On 26 September 2018 at 23:30, Sebastian Reichel wrote: > Hi, > > On Wed, Sep 26, 2018 at 10:59:14AM +0800, Baolin Wang wrote: >> This patch adds the Spreadtrum SC27XX serial PMICs fuel gauge support, >> which is used to calculate the battery capacity. >> >> Ori

[PATCH v3 1/4] power: supply: core: Introduce one property to present the battery internal resistance

2018-09-27 Thread Baolin Wang
factory internal resistance for battery information. Signed-off-by: Baolin Wang --- Changes from v2: - Rename the property. - Improve the commit message. Changes from v1: - New patch in v2. --- .../devicetree/bindings/power/supply/battery.txt |2 ++ drivers/power/supply

[PATCH v3 4/4] power: supply: Add Spreadtrum SC27XX fuel gauge unit driver

2018-09-27 Thread Baolin Wang
This patch adds the Spreadtrum SC27XX serial PMICs fuel gauge support, which is used to calculate the battery capacity. Original-by: Yuanjiang Yu Signed-off-by: Baolin Wang Acked-by: Linus Walleij --- Changes from v2: - Use core helper functions to look up OCV capacity table. - Use

[PATCH v3 2/4] power: supply: core: Introduce properties to present the battery OCV capacity table

2018-09-27 Thread Baolin Wang
some helper functions to use the OCV capacity table for users. Suggested-by: Sebastian Reichel Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- Changes from v2: - Use type __be32 to calculate the table length. - Update error messages. - Add some helper functions. Changes from v1

[PATCH v3 3/4] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation

2018-09-27 Thread Baolin Wang
This patch adds the binding documentation for Spreadtrum SC27XX series PMICs fuel gauge unit device, which is used to calculate the battery capacity. Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- Changes from v2: - Add reviewed tag from Linus. Changes from v1: - Renamed GPIO

[PATCH] pinctrl: sprd: Move DT parsing before registering pinctrl device

2018-09-27 Thread Baolin Wang
evice. Signed-off-by: Baolin Wang --- drivers/pinctrl/sprd/pinctrl-sprd.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c index 78c2f54..4537b54 100644 --- a/drivers/pinctrl/sprd/pi

[PATCH 2/7] dmaengine: sprd: Get transfer residue depending on the transfer direction

2018-09-28 Thread Baolin Wang
From: Eric Long Add one field to save the transfer direction for struct sprd_dma_desc, which is used to get correct transfer residue depending on the transfer direction. [Baolin Wang adds one field to present the transfer direction] Signed-off-by: Eric Long Signed-off-by: Baolin Wang

[PATCH 3/7] dmaengine: sprd: Fix the last link-list configuration

2018-09-28 Thread Baolin Wang
-by: Baolin Wang --- drivers/dma/sprd-dma.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 4f3587b..e6a74dc 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -697,7 +697,8 @@ static int

[PATCH 5/7] dmaengine: sprd: Support DMA link-list cyclic callback

2018-09-28 Thread Baolin Wang
From: Eric Long The Spreadtrum DMA link-list mode is always one cyclic transfer, so we should clear the SPRD_DMA_LLIST_END flag for the link-list configuration. Moreover add cyclic callback support for the cyclic transfer. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma

[PATCH 4/7] dmaengine: sprd: Set cur_desc as NULL when free or terminate one dma channel

2018-09-28 Thread Baolin Wang
nel to avoid this issue. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index e6a74dc..1b39661 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd

[PATCH 0/7] Add some fixes and new feature for SPRD DMA

2018-09-28 Thread Baolin Wang
This patchset removes the direction usage from struct dma_slave_config, and add one new field to save the direction. It also fixes some issues for link-list transfer. Moreover this patchset adds new 2-stage transfer support for our DMA. Baolin Wang (1): dmaengine: sprd: Remove direction usage

[PATCH 1/7] dmaengine: sprd: Remove direction usage from struct dma_slave_config

2018-09-28 Thread Baolin Wang
The direction field of struct dma_slave_config was marked deprecated, thus remove the usage. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 38d4e4f..c226dc93 100644 --- a

[PATCH 7/7] dmaengine: sprd: Add me as one of the module authors

2018-09-28 Thread Baolin Wang
From: Eric Long Add me as one of the module authors. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 50d6569..e2f0167 100644 --- a/drivers/dma/sprd

[PATCH 6/7] dmaengine: sprd: Support DMA 2-stage transfer mode

2018-09-28 Thread Baolin Wang
ransaction automatically by hardware signal. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 98 +- include/linux/dma/sprd-dma.h | 62 -- 2 files changed, 156 insertions(+), 4 deletions(-) di

Re: [PATCH 3/5] power: supply: sc27xx: Add fuel gauge low voltage alarm

2018-11-25 Thread Baolin Wang
Hi Pavel, On Mon, 26 Nov 2018 at 05:45, Pavel Machek wrote: > > On Wed 2018-11-14 17:07:06, Baolin Wang wrote: > > From: Yuanjiang Yu > > > > Add low voltage alarm support to make sure the battery capacity > > more accurate in lower voltage stage. > > > &g

Re: [PATCH 5/5] power: supply: sc27xx: Save last battery capacity

2018-11-25 Thread Baolin Wang
ery capacity as the initial > > battery capacity, which can make the battery capacity more accurate. > > > > Signed-off-by: Yuanjiang Yu > > Signed-off-by: Baolin Wang > > --- > > drivers/power/supply/sc27xx_fuel_gauge.c | 143 > >

Re: [RESEND PATCH 0/7] Add some fixes and new feature for SPRD DMA

2018-11-25 Thread Baolin Wang
Hi Vinod, On Tue, 6 Nov 2018 at 13:01, Baolin Wang wrote: > > This patchset removes the direction usage from struct dma_slave_config, > and add one new field to save the direction. It also fixes some issues > for link-list transfer. Moreover this patchset adds new 2-stage transfer &

Re: [PATCH 1/2] clocksource: Demote dbx500 PRCMU clocksource

2018-11-15 Thread Baolin Wang
ere, so let's finalize the work. > > Cc: Baolin Wang > Signed-off-by: Linus Walleij > --- Glad to see new driver uses the suspend clocksource. Reviewed-by: Baolin Wang > drivers/clocksource/clksrc-dbx500-prcmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) &

[PATCH 1/6] power: supply: charger-manager: Remove unused index counting

2018-11-16 Thread Baolin Wang
Remove unused index counting. Signed-off-by: Baolin Wang --- drivers/power/supply/charger-manager.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index faa1a67..a1b420a 100644 --- a/drivers/power/supply

[PATCH 6/6] power: supply: charger-manager: Add new method to start/stop charging

2018-11-16 Thread Baolin Wang
For some chargers (such as Spreadtrum SC2731 charger), they don't use regulators to control charging, instead charging control was implemented in their drivers, so we can add some supports to start or stop charging by POWER_SUPPLY_PROP_STATUS property. Signed-off-by: Baolin Wang --- dr

[PATCH 5/6] power: supply: charger-manager: Remove deprecated extcon APIs

2018-11-16 Thread Baolin Wang
The struct extcon_specific_cable_nb and related APIs are deprecated now, so we should use new method to get one extcon device and register extcon notifier. Signed-off-by: Baolin Wang --- .../bindings/power/supply/charger-manager.txt |6 +-- drivers/power/supply/charger-manager.c

[PATCH 4/6] power: supply: charger-manager: Make code more readable

2018-11-16 Thread Baolin Wang
Make code more readable. Signed-off-by: Baolin Wang --- drivers/power/supply/charger-manager.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index a52bc77..dc0c9a6 100644

[PATCH 2/6] power: supply: charger-manager: Fix some misspelled words

2018-11-16 Thread Baolin Wang
Fix some misspelled words. Signed-off-by: Baolin Wang --- drivers/power/supply/charger-manager.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index a1b420a..bd6c450 100644 --- a

[PATCH 3/6] power: supply: charger-manager: Fix incorrect return value

2018-11-16 Thread Baolin Wang
Fix incorrect return value. Signed-off-by: Baolin Wang --- drivers/power/supply/charger-manager.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index bd6c450..a52bc77 100644 --- a/drivers

[PATCH 3/4] power: supply: sc2731_charger: Avoid repeated charge/discharge

2018-11-12 Thread Baolin Wang
Add info->charging validation to avoid repeated charge or discharge operation. Signed-off-by: Baolin Wang --- drivers/power/supply/sc2731_charger.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/sup

[PATCH 4/4] power: supply: sc2731_charger: Free battery information

2018-11-12 Thread Baolin Wang
Free battery information in case of adding battery OCV tables. Signed-off-by: Baolin Wang --- drivers/power/supply/sc2731_charger.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/supply/sc2731_charger.c index 49b3f0c..335cb85

[PATCH 1/4] power: supply: sc2731_charger: Add one work to charge/discharge

2018-11-12 Thread Baolin Wang
Since the USB notifier context is atomic, we can not start or stop charging in atomic context. Thus this patch adds one work to help to charge or discharge. Signed-off-by: Baolin Wang --- drivers/power/supply/sc2731_charger.c | 30 ++ 1 file changed, 22 insertions

[PATCH 2/4] power: supply: sc2731_charger: Add charger status detection

2018-11-12 Thread Baolin Wang
The USB charger status can be notified before the charger driver registers the USB phy notifier, so we should check the charger status in probe() in case we missed the USB charger notification. Signed-off-by: Baolin Wang --- drivers/power/supply/sc2731_charger.c | 20 1

Re: [PATCH -next] power/supply: fix sc27xx_fuel_gauge build errors

2018-11-12 Thread Baolin Wang
_channel_get' > > Signed-off-by: Randy Dunlap > Cc: Sebastian Reichel > Cc: linux...@vger.kernel.org > --- Thanks for fixing this issue. Acked-by: Baolin Wang > drivers/power/supply/Kconfig |1 + > 1 file changed, 1 insertion(+) > > --- linux-next-20181112.orig/

[PATCH 0/5] Add new features for SC27XX fuel gauge driver

2018-11-14 Thread Baolin Wang
used as the initial battery capacity if system is not first power-on. Baolin Wang (2): dt-bindings: power: supply: Add nvmem properties to calibrate FGU power: supply: sc27xx: Add fuel gauge calibration Yuanjiang Yu (3): power: supply: sc27xx: Add fuel gauge low voltage alarm power: supply

[PATCH 1/5] dt-bindings: power: supply: Add nvmem properties to calibrate FGU

2018-11-14 Thread Baolin Wang
Add nvmem properties to calibrate FGU from eFuse controller. Signed-off-by: Baolin Wang --- .../devicetree/bindings/power/supply/sc27xx-fg.txt |4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt b/Documentation/devicetree

[PATCH 5/5] power: supply: sc27xx: Save last battery capacity

2018-11-14 Thread Baolin Wang
. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang --- drivers/power/supply/sc27xx_fuel_gauge.c | 143 +- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c index

[PATCH 2/5] power: supply: sc27xx: Add fuel gauge calibration

2018-11-14 Thread Baolin Wang
This patch adds support to read calibration values from the eFuse controller to calibrate the ADC values corresponding to current and voltage, which can make the current and voltage data more accurate. Signed-off-by: Baolin Wang --- drivers/power/supply/sc27xx_fuel_gauge.c | 62

[PATCH 3/5] power: supply: sc27xx: Add fuel gauge low voltage alarm

2018-11-14 Thread Baolin Wang
From: Yuanjiang Yu Add low voltage alarm support to make sure the battery capacity more accurate in lower voltage stage. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang --- drivers/power/supply/sc27xx_fuel_gauge.c | 171 +- 1 file changed, 170 insertions

[PATCH 4/5] power: supply: sc27xx: Add suspend/resume interfaces

2018-11-14 Thread Baolin Wang
From: Yuanjiang Yu Add fuel gauge platform suspend and resume interfaces. In suspend state, we should enable the low voltage and coulomb counter threshold interrupts to wake up system to calibrate the battery capacity in lower voltage stage. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin

Re: [PATCH 5/6] power: supply: charger-manager: Remove deprecated extcon APIs

2018-12-04 Thread Baolin Wang
Hi Rob, On Wed, 5 Dec 2018 at 05:52, Rob Herring wrote: > > On Fri, Nov 16, 2018 at 07:01:12PM +0800, Baolin Wang wrote: > > The struct extcon_specific_cable_nb and related APIs are deprecated now, > > so we should use new method to get one extcon device and register e

Re: [PATCH 0/5] Add new features for SC27XX fuel gauge driver

2018-12-05 Thread Baolin Wang
Hi Sebastian, On Thu, 6 Dec 2018 at 08:10, Sebastian Reichel wrote: > > Hi, > > On Wed, Nov 14, 2018 at 05:07:03PM +0800, Baolin Wang wrote: > > This patch set adds some new features for SC27XX fuel gauge driver. > > > > 1. Read calibration data from eFuse device

[PATCH v2] power: supply: sc27xx: Save last battery capacity

2018-12-05 Thread Baolin Wang
. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang --- Changes from v1: - Simplify the logics for sc27xx_fgu_set_property() and sc27xx_fgu_property_is_writeable(). --- drivers/power/supply/sc27xx_fuel_gauge.c | 135 +- 1 file changed, 134 insertions(+), 1

Re: [PATCH 5/6] power: supply: charger-manager: Remove deprecated extcon APIs

2018-12-05 Thread Baolin Wang
Hi Sebastian, On Thu, 6 Dec 2018 at 04:34, Sebastian Reichel wrote: > > Hi, > > On Wed, Dec 05, 2018 at 10:57:12AM +0800, Baolin Wang wrote: > > Hi Rob, > > On Wed, 5 Dec 2018 at 05:52, Rob Herring wrote: > > > > > > On Fri, Nov 16, 2018 at 07:01:

Re: [PATCH 02/24] leds: core: Add support for composing LED class device names

2018-11-08 Thread Baolin Wang
Hi Jacek, On 9 November 2018 at 04:47, Jacek Anaszewski wrote: > Hi Baolin, > > Thanks for the review. > > On 11/07/2018 08:20 AM, Baolin Wang wrote: >> Hi Jacek, >> >> On 7 November 2018 at 06:07, Jacek Anaszewski >> wrote: >>> Add public led_c

<    1   2   3   4   5   6   7   8   9   10   >