diff mbox series

[v2,5/6] regulator: mcp16502: add support for ramp delay

Message ID 1605085578-6783-6-git-send-email-claudiu.beznea@microchip.com (mailing list archive)
State New, archived
Headers show
Series regulator: mcp16502: add support for ramp delay | expand

Commit Message

Claudiu Beznea Nov. 11, 2020, 9:06 a.m. UTC
MCP16502 have configurable ramp delay support (via DVSR bits in
regulators' CFG register).

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/regulator/mcp16502.c | 89 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 87 insertions(+), 2 deletions(-)

Comments

kernel test robot Nov. 13, 2020, 7:41 a.m. UTC | #1
Hi Claudiu,

I love your patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[also build test ERROR on linus/master linux/master v5.10-rc3 next-20201112]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Claudiu-Beznea/regulator-mcp16502-add-support-for-ramp-delay/20201111-170928
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: nios2-randconfig-r034-20201111 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/d97d6b70286fa3a28e744a55da1b7eb6a026cee3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Claudiu-Beznea/regulator-mcp16502-add-support-for-ramp-delay/20201111-170928
        git checkout d97d6b70286fa3a28e744a55da1b7eb6a026cee3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:20,
                    from ./arch/nios2/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from include/asm-generic/current.h:5,
                    from ./arch/nios2/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/gpio/driver.h:5,
                    from include/asm-generic/gpio.h:11,
                    from include/linux/gpio.h:62,
                    from drivers/regulator/mcp16502.c:11:
   drivers/regulator/mcp16502.c: In function 'mcp16502_set_voltage_time_sel':
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:287:38: note: in definition of macro '__abs_choose_expr'
     287 |  __builtin_types_compatible_p(typeof(x),   signed type) || \
         |                                      ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:287:38: note: in definition of macro '__abs_choose_expr'
     287 |  __builtin_types_compatible_p(typeof(x),   signed type) || \
         |                                      ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:288:38: note: in definition of macro '__abs_choose_expr'
     288 |  __builtin_types_compatible_p(typeof(x), unsigned type),  \
         |                                      ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:288:38: note: in definition of macro '__abs_choose_expr'
     288 |  __builtin_types_compatible_p(typeof(x), unsigned type),  \
         |                                      ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:24: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                        ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:24: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                        ^
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> drivers/regulator/mcp16502.c:295:54: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |                                                      ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   drivers/regulator/mcp16502.c:296:47: error: 'const struct linear_range' has no member named 'uV_step'; did you mean 'step'?
     296 |          old_sel * rdev->desc->linear_ranges->uV_step);
         |                                               ^~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
>> include/linux/kernel.h:281:3: error: first argument to '__builtin_choose_expr' not a constant
     281 |   __builtin_choose_expr(     \
         |   ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   include/linux/kernel.h:286:43: error: first argument to '__builtin_choose_expr' not a constant
     286 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:280:3: note: in expansion of macro '__abs_choose_expr'
     280 |   __abs_choose_expr(x, char,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   include/linux/kernel.h:286:43: error: first argument to '__builtin_choose_expr' not a constant
     286 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:279:3: note: in expansion of macro '__abs_choose_expr'
     279 |   __abs_choose_expr(x, short,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   include/linux/kernel.h:286:43: error: first argument to '__builtin_choose_expr' not a constant
     286 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:278:3: note: in expansion of macro '__abs_choose_expr'
     278 |   __abs_choose_expr(x, int,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   include/linux/kernel.h:286:43: error: first argument to '__builtin_choose_expr' not a constant
     286 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:289:54: note: in definition of macro '__abs_choose_expr'
     289 |  ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                      ^~~~~
   include/linux/kernel.h:277:3: note: in expansion of macro '__abs_choose_expr'
     277 |   __abs_choose_expr(x, long,    \
         |   ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~
   include/linux/kernel.h:286:43: error: first argument to '__builtin_choose_expr' not a constant
     286 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:276:16: note: in expansion of macro '__abs_choose_expr'
     276 | #define abs(x) __abs_choose_expr(x, long long,    \
         |                ^~~~~~~~~~~~~~~~~
   drivers/regulator/mcp16502.c:295:13: note: in expansion of macro 'abs'
     295 |  uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
         |             ^~~

vim +295 drivers/regulator/mcp16502.c

   280	
   281	static int mcp16502_set_voltage_time_sel(struct regulator_dev *rdev,
   282						 unsigned int old_sel,
   283						 unsigned int new_sel)
   284	{
   285		static const u8 us_ramp[] = { 8, 16, 24, 32 };
   286		int id = rdev_get_id(rdev);
   287		unsigned int uV_delta, val;
   288		int ret;
   289	
   290		ret = regmap_read(rdev->regmap, MCP16502_REG_BASE(id, CFG), &val);
   291		if (ret)
   292			return ret;
   293	
   294		val = (val & MCP16502_DVSR) >> 2;
 > 295		uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
   296			       old_sel * rdev->desc->linear_ranges->uV_step);
   297		switch (id) {
   298		case BUCK1:
   299		case LDO1:
   300		case LDO2:
   301			ret = DIV_ROUND_CLOSEST(uV_delta * us_ramp[val],
   302						mcp16502_ramp_b1l12[val]);
   303			break;
   304	
   305		case BUCK2:
   306		case BUCK3:
   307		case BUCK4:
   308			ret = DIV_ROUND_CLOSEST(uV_delta * us_ramp[val],
   309						mcp16502_ramp_b234[val]);
   310			break;
   311	
   312		default:
   313			return -EINVAL;
   314		}
   315	
   316		return ret;
   317	}
   318	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c
index 48eb64bc4018..777d1a6cd1c5 100644
--- a/drivers/regulator/mcp16502.c
+++ b/drivers/regulator/mcp16502.c
@@ -22,8 +22,9 @@ 
 #define VDD_LOW_SEL 0x0D
 #define VDD_HIGH_SEL 0x3F
 
-#define MCP16502_FLT BIT(7)
-#define MCP16502_ENS BIT(0)
+#define MCP16502_FLT		BIT(7)
+#define MCP16502_DVSR		GENMASK(3, 2)
+#define MCP16502_ENS		BIT(0)
 
 /*
  * The PMIC has four sets of registers corresponding to four power modes:
@@ -88,6 +89,12 @@  enum mcp16502_reg {
 	MCP16502_REG_CFG,
 };
 
+/* Ramp delay (uV/us) for buck1, ldo1, ldo2. */
+static const int mcp16502_ramp_b1l12[] = { 6250, 3125, 2083, 1563 };
+
+/* Ramp delay (uV/us) for buck2, buck3, buck4. */
+static const int mcp16502_ramp_b234[] = { 3125, 1563, 1042, 781 };
+
 static unsigned int mcp16502_of_map_mode(unsigned int mode)
 {
 	if (mode == REGULATOR_MODE_NORMAL || mode == REGULATOR_MODE_IDLE)
@@ -271,6 +278,80 @@  static int mcp16502_get_status(struct regulator_dev *rdev)
 	return REGULATOR_STATUS_UNDEFINED;
 }
 
+static int mcp16502_set_voltage_time_sel(struct regulator_dev *rdev,
+					 unsigned int old_sel,
+					 unsigned int new_sel)
+{
+	static const u8 us_ramp[] = { 8, 16, 24, 32 };
+	int id = rdev_get_id(rdev);
+	unsigned int uV_delta, val;
+	int ret;
+
+	ret = regmap_read(rdev->regmap, MCP16502_REG_BASE(id, CFG), &val);
+	if (ret)
+		return ret;
+
+	val = (val & MCP16502_DVSR) >> 2;
+	uV_delta = abs(new_sel * rdev->desc->linear_ranges->uV_step -
+		       old_sel * rdev->desc->linear_ranges->uV_step);
+	switch (id) {
+	case BUCK1:
+	case LDO1:
+	case LDO2:
+		ret = DIV_ROUND_CLOSEST(uV_delta * us_ramp[val],
+					mcp16502_ramp_b1l12[val]);
+		break;
+
+	case BUCK2:
+	case BUCK3:
+	case BUCK4:
+		ret = DIV_ROUND_CLOSEST(uV_delta * us_ramp[val],
+					mcp16502_ramp_b234[val]);
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
+static int mcp16502_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
+{
+	const int *ramp;
+	int id = rdev_get_id(rdev);
+	unsigned int i, size;
+
+	switch (id) {
+	case BUCK1:
+	case LDO1:
+	case LDO2:
+		ramp = mcp16502_ramp_b1l12;
+		size = ARRAY_SIZE(mcp16502_ramp_b1l12);
+		break;
+
+	case BUCK2:
+	case BUCK3:
+	case BUCK4:
+		ramp = mcp16502_ramp_b234;
+		size = ARRAY_SIZE(mcp16502_ramp_b234);
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	for (i = 0; i < size; i++) {
+		if (ramp[i] == ramp_delay)
+			break;
+	}
+	if (i == size)
+		return -EINVAL;
+
+	return regmap_update_bits(rdev->regmap, MCP16502_REG_BASE(id, CFG),
+				  MCP16502_DVSR, (i << 2));
+}
+
 #ifdef CONFIG_SUSPEND
 /*
  * mcp16502_suspend_get_target_reg() - get the reg of the target suspend PMIC
@@ -365,6 +446,8 @@  static const struct regulator_ops mcp16502_buck_ops = {
 	.disable			= regulator_disable_regmap,
 	.is_enabled			= regulator_is_enabled_regmap,
 	.get_status			= mcp16502_get_status,
+	.set_voltage_time_sel		= mcp16502_set_voltage_time_sel,
+	.set_ramp_delay			= mcp16502_set_ramp_delay,
 
 	.set_mode			= mcp16502_set_mode,
 	.get_mode			= mcp16502_get_mode,
@@ -389,6 +472,8 @@  static const struct regulator_ops mcp16502_ldo_ops = {
 	.disable			= regulator_disable_regmap,
 	.is_enabled			= regulator_is_enabled_regmap,
 	.get_status			= mcp16502_get_status,
+	.set_voltage_time_sel		= mcp16502_set_voltage_time_sel,
+	.set_ramp_delay			= mcp16502_set_ramp_delay,
 
 #ifdef CONFIG_SUSPEND
 	.set_suspend_voltage		= mcp16502_set_suspend_voltage,