From: kernel test robot <lkp@intel.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Lee Jones <lee@kernel.org>
Subject: [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
Date: Sat, 23 Dec 2023 03:37:57 +0800 [thread overview]
Message-ID: <202312230335.JEXfYvyo-lkp@intel.com> (raw)
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
reply other threads:[~2023-12-22 19:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202312230335.JEXfYvyo-lkp@intel.com \
--to=lkp@intel.com \
--cc=lee@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.