All of lore.kernel.org
 help / color / mirror / Atom feed
* [lee-backlight:for-backlight-next 8/8] drivers/video/backlight/mp3309c.c:134:9: error: call to undeclared function 'pwm_apply_might_sleep'; ISO C99 and later do not support implicit function declarations
@ 2023-12-22 19:37 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-22 19:37 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: llvm, oe-kbuild-all, Lee Jones

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
head:   f7baa9ccef93ba1c36a8ecf58c2f4e86fb3181b9
commit: f7baa9ccef93ba1c36a8ecf58c2f4e86fb3181b9 [8/8] backlight: mp3309c: Rename  pwm_apply_state() to pwm_apply_might_sleep()
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231223/202312230335.JEXfYvyo-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231223/202312230335.JEXfYvyo-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312230335.JEXfYvyo-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/video/backlight/mp3309c.c:134:9: error: call to undeclared function 'pwm_apply_might_sleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   ret = pwm_apply_might_sleep(chip->pwmd, &pwmstate);
                         ^
   drivers/video/backlight/mp3309c.c:134:9: note: did you mean 'regmap_might_sleep'?
   include/linux/regmap.h:1276:6: note: 'regmap_might_sleep' declared here
   bool regmap_might_sleep(struct regmap *map);
        ^
   drivers/video/backlight/mp3309c.c:396:9: error: call to undeclared function 'pwm_apply_might_sleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   ret = pwm_apply_might_sleep(chip->pwmd, &pwmstate);
                         ^
   2 errors generated.


vim +/pwm_apply_might_sleep +134 drivers/video/backlight/mp3309c.c

   116	
   117	static int mp3309c_bl_update_status(struct backlight_device *bl)
   118	{
   119		struct mp3309c_chip *chip = bl_get_data(bl);
   120		int brightness = backlight_get_brightness(bl);
   121		struct pwm_state pwmstate;
   122		unsigned int analog_val, bits_val;
   123		int i, ret;
   124	
   125		if (chip->pdata->dimming_mode == DIMMING_PWM) {
   126			/*
   127			 * PWM control mode
   128			 */
   129			pwm_get_state(chip->pwmd, &pwmstate);
   130			pwm_set_relative_duty_cycle(&pwmstate,
   131						    chip->pdata->levels[brightness],
   132						    chip->pdata->levels[chip->pdata->max_brightness]);
   133			pwmstate.enabled = true;
 > 134			ret = pwm_apply_might_sleep(chip->pwmd, &pwmstate);
   135			if (ret)
   136				return ret;
   137	
   138			switch (chip->pdata->status) {
   139			case FIRST_POWER_ON:
   140			case BACKLIGHT_OFF:
   141				/*
   142				 * After 20ms of low pwm signal level, the chip turns
   143				 * off automatically. In this case, before enabling the
   144				 * chip again, we must wait about 10ms for pwm signal to
   145				 * stabilize.
   146				 */
   147				if (brightness > 0) {
   148					msleep(10);
   149					mp3309c_enable_device(chip);
   150					chip->pdata->status = BACKLIGHT_ON;
   151				} else {
   152					chip->pdata->status = BACKLIGHT_OFF;
   153				}
   154				break;
   155			case BACKLIGHT_ON:
   156				if (brightness == 0)
   157					chip->pdata->status = BACKLIGHT_OFF;
   158				break;
   159			}
   160		} else {
   161			/*
   162			 * Analog (by I2C command) control mode
   163			 *
   164			 * The first time, before setting brightness, we must enable the
   165			 * device
   166			 */
   167			if (chip->pdata->status == FIRST_POWER_ON)
   168				mp3309c_enable_device(chip);
   169	
   170			/*
   171			 * Dimming mode I2C command (fixed dimming range 0..31)
   172			 *
   173			 * The 5 bits of the dimming analog value D4..D0 is allocated
   174			 * in the I2C register #0, in the following way:
   175			 *
   176			 *     +--+--+--+--+--+--+--+--+
   177			 *     |EN|D0|D1|D2|D3|D4|XX|XX|
   178			 *     +--+--+--+--+--+--+--+--+
   179			 */
   180			analog_val = brightness;
   181			bits_val = 0;
   182			for (i = 0; i <= 5; i++)
   183				bits_val += ((analog_val >> i) & 0x01) << (6 - i);
   184			ret = regmap_update_bits(chip->regmap, REG_I2C_0,
   185						 ANALOG_I2C_REG_MASK, bits_val);
   186			if (ret)
   187				return ret;
   188	
   189			if (brightness > 0)
   190				chip->pdata->status = BACKLIGHT_ON;
   191			else
   192				chip->pdata->status = BACKLIGHT_OFF;
   193		}
   194	
   195		return 0;
   196	}
   197	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-22 19:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-22 19:37 [lee-backlight:for-backlight-next 8/8] drivers/video/backlight/mp3309c.c:134:9: error: call to undeclared function 'pwm_apply_might_sleep'; ISO C99 and later do not support implicit function declarations kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.