[PATCH v1 16/22] drm/bridge: parade-ps8622: Backlight update
kernel test robot
lkp at intel.com
Sun Aug 2 14:05:01 UTC 2020
Hi Sam,
I love your patch! Yet something to improve:
[auto build test ERROR on backlight/for-backlight-next]
[also build test ERROR on next-20200731]
[cannot apply to drm-intel/for-linux-next drm-tip/drm-tip linus/master drm/drm-next v5.8-rc7]
[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/Sam-Ravnborg/backlight-add-init-macros-and-accessors/20200802-190940
base: for-backlight-next
config: x86_64-randconfig-a011-20200802 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 25af353b0e74907d5d50c8616b885bd1f73a68b3)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/bridge/parade-ps8622.c:337:48: error: implicit declaration of function 'blacklight_get_brightness' [-Werror,-Wimplicit-function-declaration]
return ps8622_set(ps8622->client, 0x01, 0xa7, blacklight_get_brightness(bl));
^
drivers/gpu/drm/bridge/parade-ps8622.c:337:48: note: did you mean 'backlight_get_brightness'?
include/linux/backlight.h:469:19: note: 'backlight_get_brightness' declared here
static inline int backlight_get_brightness(const struct backlight_device *bd)
^
>> drivers/gpu/drm/bridge/parade-ps8622.c:519:2: error: must use 'struct' tag to refer to type 'backlight_device'
backlight_device *bl;
^
struct
>> drivers/gpu/drm/bridge/parade-ps8622.c:521:52: error: use of undeclared identifier 'dev'
bl = devm_backlight_device_register(dev, dev_name(dev), dev,
^
drivers/gpu/drm/bridge/parade-ps8622.c:521:38: error: use of undeclared identifier 'dev'
bl = devm_backlight_device_register(dev, dev_name(dev), dev,
^
drivers/gpu/drm/bridge/parade-ps8622.c:521:58: error: use of undeclared identifier 'dev'
bl = devm_backlight_device_register(dev, dev_name(dev), dev,
^
5 errors generated.
vim +/blacklight_get_brightness +337 drivers/gpu/drm/bridge/parade-ps8622.c
329
330 static int ps8622_backlight_update(struct backlight_device *bl)
331 {
332 struct ps8622_bridge *ps8622 = dev_get_drvdata(&bl->dev);
333
334 if (!ps8622->enabled)
335 return -EINVAL;
336
> 337 return ps8622_set(ps8622->client, 0x01, 0xa7, blacklight_get_brightness(bl));
338 }
339
340 static const struct backlight_ops ps8622_backlight_ops = {
341 .update_status = ps8622_backlight_update,
342 };
343
344 static void ps8622_pre_enable(struct drm_bridge *bridge)
345 {
346 struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
347 int ret;
348
349 if (ps8622->enabled)
350 return;
351
352 gpiod_set_value(ps8622->gpio_rst, 0);
353
354 if (ps8622->v12) {
355 ret = regulator_enable(ps8622->v12);
356 if (ret)
357 DRM_ERROR("fails to enable ps8622->v12");
358 }
359
360 if (drm_panel_prepare(ps8622->panel)) {
361 DRM_ERROR("failed to prepare panel\n");
362 return;
363 }
364
365 gpiod_set_value(ps8622->gpio_slp, 1);
366
367 /*
368 * T1 is the range of time that it takes for the power to rise after we
369 * enable the lcd/ps8622 fet. T2 is the range of time in which the
370 * data sheet specifies we should deassert the reset pin.
371 *
372 * If it takes T1.max for the power to rise, we need to wait atleast
373 * T2.min before deasserting the reset pin. If it takes T1.min for the
374 * power to rise, we need to wait at most T2.max before deasserting the
375 * reset pin.
376 */
377 usleep_range(PS8622_RST_HIGH_T2_MIN_US + PS8622_POWER_RISE_T1_MAX_US,
378 PS8622_RST_HIGH_T2_MAX_US + PS8622_POWER_RISE_T1_MIN_US);
379
380 gpiod_set_value(ps8622->gpio_rst, 1);
381
382 /* wait 20ms after RST high */
383 usleep_range(20000, 30000);
384
385 ret = ps8622_send_config(ps8622);
386 if (ret) {
387 DRM_ERROR("Failed to send config to bridge (%d)\n", ret);
388 return;
389 }
390
391 ps8622->enabled = true;
392 }
393
394 static void ps8622_enable(struct drm_bridge *bridge)
395 {
396 struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
397
398 if (drm_panel_enable(ps8622->panel)) {
399 DRM_ERROR("failed to enable panel\n");
400 return;
401 }
402 }
403
404 static void ps8622_disable(struct drm_bridge *bridge)
405 {
406 struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
407
408 if (drm_panel_disable(ps8622->panel)) {
409 DRM_ERROR("failed to disable panel\n");
410 return;
411 }
412 msleep(PS8622_PWMO_END_T12_MS);
413 }
414
415 static void ps8622_post_disable(struct drm_bridge *bridge)
416 {
417 struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
418
419 if (!ps8622->enabled)
420 return;
421
422 ps8622->enabled = false;
423
424 /*
425 * This doesn't matter if the regulators are turned off, but something
426 * else might keep them on. In that case, we want to assert the slp gpio
427 * to lower power.
428 */
429 gpiod_set_value(ps8622->gpio_slp, 0);
430
431 if (drm_panel_unprepare(ps8622->panel)) {
432 DRM_ERROR("failed to unprepare panel\n");
433 return;
434 }
435
436 if (ps8622->v12)
437 regulator_disable(ps8622->v12);
438
439 /*
440 * Sleep for at least the amount of time that it takes the power rail to
441 * fall to prevent asserting the rst gpio from doing anything.
442 */
443 usleep_range(PS8622_POWER_FALL_T16_MAX_US,
444 2 * PS8622_POWER_FALL_T16_MAX_US);
445 gpiod_set_value(ps8622->gpio_rst, 0);
446
447 msleep(PS8622_POWER_OFF_T17_MS);
448 }
449
450 static int ps8622_get_modes(struct drm_connector *connector)
451 {
452 struct ps8622_bridge *ps8622;
453
454 ps8622 = connector_to_ps8622(connector);
455
456 return drm_panel_get_modes(ps8622->panel, connector);
457 }
458
459 static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = {
460 .get_modes = ps8622_get_modes,
461 };
462
463 static const struct drm_connector_funcs ps8622_connector_funcs = {
464 .fill_modes = drm_helper_probe_single_connector_modes,
465 .destroy = drm_connector_cleanup,
466 .reset = drm_atomic_helper_connector_reset,
467 .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
468 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
469 };
470
471 static int ps8622_attach(struct drm_bridge *bridge,
472 enum drm_bridge_attach_flags flags)
473 {
474 struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
475 int ret;
476
477 if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
478 DRM_ERROR("Fix bridge driver to make connector optional!");
479 return -EINVAL;
480 }
481
482 if (!bridge->encoder) {
483 DRM_ERROR("Parent encoder object not found");
484 return -ENODEV;
485 }
486
487 ps8622->connector.polled = DRM_CONNECTOR_POLL_HPD;
488 ret = drm_connector_init(bridge->dev, &ps8622->connector,
489 &ps8622_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
490 if (ret) {
491 DRM_ERROR("Failed to initialize connector with drm\n");
492 return ret;
493 }
494 drm_connector_helper_add(&ps8622->connector,
495 &ps8622_connector_helper_funcs);
496 drm_connector_register(&ps8622->connector);
497 drm_connector_attach_encoder(&ps8622->connector,
498 bridge->encoder);
499
500 if (ps8622->panel)
501 drm_panel_attach(ps8622->panel, &ps8622->connector);
502
503 drm_helper_hpd_irq_event(ps8622->connector.dev);
504
505 return ret;
506 }
507
508 static const struct drm_bridge_funcs ps8622_bridge_funcs = {
509 .pre_enable = ps8622_pre_enable,
510 .enable = ps8622_enable,
511 .disable = ps8622_disable,
512 .post_disable = ps8622_post_disable,
513 .attach = ps8622_attach,
514 };
515
516 static int ps8622_register_blacklight(struct ps8622_bridge *ps8622)
517 {
518 DECLARE_BACKLIGHT_INIT_RAW(props, PS8622_MAX_BRIGHTNESS, PS8622_MAX_BRIGHTNESS);
> 519 backlight_device *bl;
520
> 521 bl = devm_backlight_device_register(dev, dev_name(dev), dev,
522 ps8622, &ps8622_backlight_ops, &props);
523 if (IS_ERR(bl)) {
524 DRM_ERROR("failed to register backlight\n");
525 return PTR_ERR(bl);
526 }
527
528 ps8622->bl = bl;
529 return 0;
530 }
531
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 38729 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200802/6f3e5921/attachment-0001.gz>
More information about the dri-devel
mailing list