[PATCH 3/4] backlight: ktz8866: improve current sinks setting

kernel test robot lkp at intel.com
Tue Apr 8 03:45:07 UTC 2025


Hi Pengyu,

kernel test robot noticed the following build errors:

[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on lee-leds/for-leds-next lee-backlight/for-backlight-fixes linus/master v6.15-rc1 next-20250407]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Pengyu-Luo/dt-bindings-backlight-kinetic-ktz8866-add-ktz8866-slave-compatible/20250407-175635
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link:    https://lore.kernel.org/r/20250407095119.588920-4-mitltlatltl%40gmail.com
patch subject: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
config: riscv-randconfig-002-20250408 (https://download.01.org/0day-ci/archive/20250408/202504081109.E7PjHxpa-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250408/202504081109.E7PjHxpa-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504081109.E7PjHxpa-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/video/backlight/ktz8866.c:73:32: error: incompatible pointer types passing 'unsigned int **' to parameter of type 'unsigned int *'; remove & [-Werror,-Wincompatible-pointer-types]
      73 |         regmap_read(ktz->regmap, reg, &val);
         |                                       ^~~~
   include/linux/regmap.h:1297:69: note: passing argument to parameter 'val' here
    1297 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
         |                                                                     ^
>> drivers/video/backlight/ktz8866.c:132:13: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
     132 |                 if (!(val && CURRENT_SINKS_MASK))
         |                           ^  ~~~~~~~~~~~~~~~~~~
   drivers/video/backlight/ktz8866.c:132:13: note: use '&' for a bitwise operation
     132 |                 if (!(val && CURRENT_SINKS_MASK))
         |                           ^~
         |                           &
   drivers/video/backlight/ktz8866.c:132:13: note: remove constant to silence this warning
     132 |                 if (!(val && CURRENT_SINKS_MASK))
         |                           ^~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +73 drivers/video/backlight/ktz8866.c

    69	
    70	static inline void ktz8866_read(struct ktz8866 *ktz, unsigned int reg,
    71					unsigned int *val)
    72	{
  > 73		regmap_read(ktz->regmap, reg, &val);
    74	}
    75	
    76	static void ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
    77				  unsigned int val)
    78	{
    79		regmap_write(ktz->regmap, reg, val);
    80	
    81		if (ktz->slave)
    82			regmap_write(ktz->slave->regmap, reg, val);
    83	}
    84	
    85	static void ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
    86					unsigned int mask, unsigned int val)
    87	{
    88		regmap_update_bits(ktz->regmap, reg, mask, val);
    89	
    90		if (ktz->slave)
    91			regmap_update_bits(ktz->slave->regmap, reg, mask, val);
    92	}
    93	
    94	static int ktz8866_backlight_update_status(struct backlight_device *backlight_dev)
    95	{
    96		struct ktz8866 *ktz = bl_get_data(backlight_dev);
    97		unsigned int brightness = backlight_get_brightness(backlight_dev);
    98	
    99		if (!ktz->led_on && brightness > 0) {
   100			ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, BL_EN_BIT);
   101			ktz->led_on = true;
   102		} else if (brightness == 0) {
   103			ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, 0);
   104			ktz->led_on = false;
   105		}
   106	
   107		/* Set brightness */
   108		ktz8866_write(ktz, BL_BRT_LSB, brightness & 0x7);
   109		ktz8866_write(ktz, BL_BRT_MSB, (brightness >> 3) & 0xFF);
   110	
   111		return 0;
   112	}
   113	
   114	static const struct backlight_ops ktz8866_backlight_ops = {
   115		.options = BL_CORE_SUSPENDRESUME,
   116		.update_status = ktz8866_backlight_update_status,
   117	};
   118	
   119	static void ktz8866_init(struct ktz8866 *ktz)
   120	{
   121		unsigned int val = 0;
   122	
   123		if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) {
   124			ktz8866_write(ktz, BL_EN, BIT(val) - 1);
   125		} else {
   126			/*
   127			 * Enable all 6 current sinks if the number of current
   128			 * sinks isn't specified and the bootloader didn't set
   129			 * the value.
   130			 */
   131			ktz8866_read(ktz, BL_EN, &val);
 > 132			if (!(val && CURRENT_SINKS_MASK))
   133				ktz8866_write(ktz, BL_EN, CURRENT_SINKS_MASK);
   134		}
   135	
   136		if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) {
   137			if (val <= 128)
   138				ktz8866_write(ktz, BL_CFG2, BIT(7) | (ilog2(val) << 3) | PWM_HYST);
   139			else
   140				ktz8866_write(ktz, BL_CFG2, BIT(7) | ((5 + val / 64) << 3) | PWM_HYST);
   141		}
   142	
   143		if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) {
   144			if (val == 0)
   145				ktz8866_write(ktz, BL_DIMMING, 0);
   146			else {
   147				unsigned int ramp_off_time = ilog2(val) + 1;
   148				unsigned int ramp_on_time = ramp_off_time << 4;
   149				ktz8866_write(ktz, BL_DIMMING, ramp_on_time | ramp_off_time);
   150			}
   151		}
   152	
   153		if (of_property_read_bool(ktz->client->dev.of_node, "kinetic,enable-lcd-bias"))
   154			ktz8866_write(ktz, LCD_BIAS_CFG1, LCD_BIAS_EN);
   155	}
   156	

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


More information about the dri-devel mailing list