Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "iio: hid-sensor-als: Add light chromaticity support"
From: Srinivas Pandruvada @ 2023-12-17 20:07 UTC (permalink / raw)
  To: jikos, jic23, lars, Basavaraj.Natikar
  Cc: linux-input, linux-iio, linux-kernel, Srinivas Pandruvada,
	Thomas Weißschuh, stable
In-Reply-To: <20231217200703.719876-1-srinivas.pandruvada@linux.intel.com>

This reverts commit ee3710f39f9d0ae5137a866138d005fe1ad18132.

This commit assumes that every HID descriptor for ALS sensor has
presence of usage id ID HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X and
HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y. When the above usage ids are
absent,  driver probe fails. This breaks ALS sensor functionality on
many platforms.

Till we have a good solution, revert this commit.

Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: stable@vger.kernel.org
---
 drivers/iio/light/hid-sensor-als.c | 63 ------------------------------
 include/linux/hid-sensor-ids.h     |  3 --
 2 files changed, 66 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index f17304b54468..d44b3f30ae4a 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -17,8 +17,6 @@ enum {
 	CHANNEL_SCAN_INDEX_INTENSITY,
 	CHANNEL_SCAN_INDEX_ILLUM,
 	CHANNEL_SCAN_INDEX_COLOR_TEMP,
-	CHANNEL_SCAN_INDEX_CHROMATICITY_X,
-	CHANNEL_SCAN_INDEX_CHROMATICITY_Y,
 	CHANNEL_SCAN_INDEX_MAX
 };
 
@@ -78,30 +76,6 @@ static const struct iio_chan_spec als_channels[] = {
 		BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
 		.scan_index = CHANNEL_SCAN_INDEX_COLOR_TEMP,
 	},
-	{
-		.type = IIO_CHROMATICITY,
-		.modified = 1,
-		.channel2 = IIO_MOD_X,
-		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
-		BIT(IIO_CHAN_INFO_SCALE) |
-		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
-		BIT(IIO_CHAN_INFO_HYSTERESIS) |
-		BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
-		.scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X,
-	},
-	{
-		.type = IIO_CHROMATICITY,
-		.modified = 1,
-		.channel2 = IIO_MOD_Y,
-		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
-		BIT(IIO_CHAN_INFO_SCALE) |
-		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
-		BIT(IIO_CHAN_INFO_HYSTERESIS) |
-		BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
-		.scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_Y,
-	},
 	IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
 };
 
@@ -145,16 +119,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
 			min = als_state->als[chan->scan_index].logical_minimum;
 			address = HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE;
 			break;
-		case  CHANNEL_SCAN_INDEX_CHROMATICITY_X:
-			report_id = als_state->als[chan->scan_index].report_id;
-			min = als_state->als[chan->scan_index].logical_minimum;
-			address = HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X;
-			break;
-		case  CHANNEL_SCAN_INDEX_CHROMATICITY_Y:
-			report_id = als_state->als[chan->scan_index].report_id;
-			min = als_state->als[chan->scan_index].logical_minimum;
-			address = HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y;
-			break;
 		default:
 			report_id = -1;
 			break;
@@ -279,14 +243,6 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
 		als_state->scan.illum[CHANNEL_SCAN_INDEX_COLOR_TEMP] = sample_data;
 		ret = 0;
 		break;
-	case HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X:
-		als_state->scan.illum[CHANNEL_SCAN_INDEX_CHROMATICITY_X] = sample_data;
-		ret = 0;
-		break;
-	case HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y:
-		als_state->scan.illum[CHANNEL_SCAN_INDEX_CHROMATICITY_Y] = sample_data;
-		ret = 0;
-		break;
 	case HID_USAGE_SENSOR_TIME_TIMESTAMP:
 		als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes,
 								    *(s64 *)raw_data);
@@ -335,25 +291,6 @@ static int als_parse_report(struct platform_device *pdev,
 		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
 		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
 
-	for (i = 0; i < 2; i++) {
-		int next_scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X + i;
-
-		ret = sensor_hub_input_get_attribute_info(hsdev,
-				HID_INPUT_REPORT, usage_id,
-				HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X + i,
-				&st->als[next_scan_index]);
-		if (ret < 0)
-			return ret;
-
-		als_adjust_channel_bit_mask(channels,
-					CHANNEL_SCAN_INDEX_CHROMATICITY_X + i,
-					st->als[next_scan_index].size);
-
-		dev_dbg(&pdev->dev, "als %x:%x\n",
-			st->als[next_scan_index].index,
-			st->als[next_scan_index].report_id);
-	}
-
 	st->scale_precision = hid_sensor_format_scale(usage_id,
 				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
 				&st->scale_pre_decml, &st->scale_post_decml);
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 6730ee900ee1..8af4fb3e0254 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -22,9 +22,6 @@
 #define HID_USAGE_SENSOR_DATA_LIGHT				0x2004d0
 #define HID_USAGE_SENSOR_LIGHT_ILLUM				0x2004d1
 #define HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE		0x2004d2
-#define HID_USAGE_SENSOR_LIGHT_CHROMATICITY			0x2004d3
-#define HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X			0x2004d4
-#define HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y			0x2004d5
 
 /* PROX (200011) */
 #define HID_USAGE_SENSOR_PROX                                   0x200011
-- 
2.43.0


^ permalink raw reply related

* [PATCH 0/2] Fix regression in ALS
From: Srinivas Pandruvada @ 2023-12-17 20:07 UTC (permalink / raw)
  To: jikos, jic23, lars, Basavaraj.Natikar
  Cc: linux-input, linux-iio, linux-kernel, Srinivas Pandruvada

Addition of color temperature and chromaticity support breaks ALS sensor
on several platforms. Till we have a good solution, revert these commits
for 6.7 cycle.

Srinivas Pandruvada (2):
  Revert "iio: hid-sensor-als: Add light chromaticity support"
  Revert "iio: hid-sensor-als: Add light color temperature support"

 drivers/iio/light/hid-sensor-als.c | 100 +----------------------------
 include/linux/hid-sensor-ids.h     |   4 --
 2 files changed, 2 insertions(+), 102 deletions(-)

-- 
2.43.0


^ permalink raw reply

* Re: [PATCH] iio: light: hid-sensor-als: Avoid failure for chromaticity support
From: srinivas pandruvada @ 2023-12-17 16:14 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: jikos, lars, Basavaraj.Natikar, linux-input, linux-iio,
	linux-kernel, Thomas Weißschuh, stable
In-Reply-To: <20231217143555.1f89ddaa@jic23-huawei>

On Sun, 2023-12-17 at 14:35 +0000, Jonathan Cameron wrote:
> On Fri, 15 Dec 2023 08:01:59 -0800
> Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:
> 
> > With the commit ee3710f39f9d ("iio: hid-sensor-als: Add light
> > chromaticity
> > support"), there is an assumption that the every HID ALS descriptor
> > has
> > support of usage ids for chromaticity support. If they are not
> > present,
> > probe fails for the driver . This breaks ALS functionality on
> > majority of
> > platforms.
> > 
> > It is possible that chromaticity usage ids are not present. When
> > not
> > present, restrict number of IIO channels to not include support for
> > chromaticity and continue.
> > 
> > Fixes: ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity
> > support")
> > Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
> > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223
> > Signed-off-by: Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/iio/light/hid-sensor-als.c | 24 ++++++++++++++++--------
> >  1 file changed, 16 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/iio/light/hid-sensor-als.c
> > b/drivers/iio/light/hid-sensor-als.c
> > index f17304b54468..9941b0b927c7 100644
> > --- a/drivers/iio/light/hid-sensor-als.c
> > +++ b/drivers/iio/light/hid-sensor-als.c
> > @@ -303,11 +303,14 @@ static int als_parse_report(struct
> > platform_device *pdev,
> >                                 struct hid_sensor_hub_device
> > *hsdev,
> >                                 struct iio_chan_spec *channels,
> >                                 unsigned usage_id,
> > -                               struct als_state *st)
> > +                               struct als_state *st,
> > +                               int *max_channels)
> >  {
> >         int ret;
> >         int i;
> >  
> > +       *max_channels = CHANNEL_SCAN_INDEX_MAX;
> > +
> >         for (i = 0; i <= CHANNEL_SCAN_INDEX_ILLUM; ++i) {
> >                 ret = sensor_hub_input_get_attribute_info(hsdev,
> >                                                 HID_INPUT_REPORT,
> > @@ -326,8 +329,12 @@ static int als_parse_report(struct
> > platform_device *pdev,
> >                                 usage_id,
> >                                 HID_USAGE_SENSOR_LIGHT_COLOR_TEMPER
> > ATURE,
> >                                 &st-
> > >als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
> > -       if (ret < 0)
> > -               return ret;
> > +       if (ret < 0) {
> > +               *max_channels = CHANNEL_SCAN_INDEX_ILLUM;
> > +               ret = 0;
> > +               goto skip_color_chromaticity;
> > +       }
> > +
> >         als_adjust_channel_bit_mask(channels,
> > CHANNEL_SCAN_INDEX_COLOR_TEMP,
> >                                 st-
> > >als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
> >  
> > @@ -354,6 +361,7 @@ static int als_parse_report(struct
> > platform_device *pdev,
> >                         st->als[next_scan_index].report_id);
> >         }
> >  
> > +skip_color_chromaticity:
> >         st->scale_precision = hid_sensor_format_scale(usage_id,
> >                                 &st-
> > >als[CHANNEL_SCAN_INDEX_INTENSITY],
> >                                 &st->scale_pre_decml, &st-
> > >scale_post_decml);
> > @@ -364,7 +372,7 @@ static int als_parse_report(struct
> > platform_device *pdev,
> >  /* Function to initialize the processing for usage id */
> >  static int hid_als_probe(struct platform_device *pdev)
> >  {
> > -       int ret = 0;
> > +       int ret = 0, max_channels;
> >         static const char *name = "als";
> >         struct iio_dev *indio_dev;
> >         struct als_state *als_state;
> > @@ -398,15 +406,15 @@ static int hid_als_probe(struct
> > platform_device *pdev)
> >  
> >         ret = als_parse_report(pdev, hsdev,
> >                                (struct iio_chan_spec *)indio_dev-
> > >channels,
> > -                              hsdev->usage,
> > -                              als_state);
> > +                              hsdev->usage, als_state,
> > &max_channels);
> >         if (ret) {
> >                 dev_err(&pdev->dev, "failed to setup
> > attributes\n");
> >                 return ret;
> >         }
> >  
> > -       indio_dev->num_channels =
> > -                               ARRAY_SIZE(als_channels);
> > +       /* +1 to include time stamp */
> > +       indio_dev->num_channels = max_channels + 1;
> 
> In the current array the timestamp channel isn't the next one, so how
> does this work?
> 
> I think we either have to form the channel array dynamically or pick
> between
> one that does have the colour info and one that doesn't for the
> original case.
> 
You are right, let me resubmit.


> Given timing we may just need to revert the broken patch and revisit
> this next
> cycle.
This is better. I will send a revert.

Thanks,
Srinivas


> 
> Jonathan
> 
> 
> > +
> >         indio_dev->info = &als_info;
> >         indio_dev->name = name;
> >         indio_dev->modes = INDIO_DIRECT_MODE;
> 


^ permalink raw reply

* Re: [PATCH] iio: hid-sensor-als: Don't stop probing at non-supported attribute
From: Jonathan Cameron @ 2023-12-17 14:40 UTC (permalink / raw)
  To: Yauhen Kharuzhy
  Cc: linux-input, linux-iio, Srinivas Pandruvada, linux-kernel,
	Jiri Kosina, Basavaraj Natikar
In-Reply-To: <20231216114229.652020-1-jekhor@gmail.com>

On Sat, 16 Dec 2023 13:42:29 +0200
Yauhen Kharuzhy <jekhor@gmail.com> wrote:

> Some ambient light sensors don't support color temperature and
> chromaticity attributes. The driver stops probing if it finds this.
> 
> To support sensors without of color temperature and chromaticity
> attributes, just skip them at probing if they weren't found.
> 
> Tested at Lenovo Yogabook YB1-X91L tablet.
> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
i reviewed this one as as well as Srinivas' as that had issues that need solving.

This one just seems to half paper over the problem  It won't update the channels
etc but the set of channels provided to userspace are still garbage.

So better than before, but not fixing the issue fully.

Jonathan

> ---
>  drivers/iio/light/hid-sensor-als.c | 39 ++++++++++++++++++------------
>  1 file changed, 23 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index f17304b54468..b711bac3bb2b 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -314,8 +314,11 @@ static int als_parse_report(struct platform_device *pdev,
>  						usage_id,
>  						HID_USAGE_SENSOR_LIGHT_ILLUM,
>  						&st->als[i]);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			dev_err(&pdev->dev,
> +				"Failed to setup Illuminance attribute\n");
>  			return ret;
> +		}

Unrelated change. For a fix we should look to keep things minimal.

>  		als_adjust_channel_bit_mask(channels, i, st->als[i].size);
>  
>  		dev_dbg(&pdev->dev, "als %x:%x\n", st->als[i].index,
> @@ -326,14 +329,16 @@ static int als_parse_report(struct platform_device *pdev,
>  				usage_id,
>  				HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
>  				&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
> -	if (ret < 0)
> -		return ret;
> -	als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
> -				st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
> +	if (!ret) {
> +		dev_info(&pdev->dev, "Color temperature is supported\n");

I'd argue we shouldn't print a message on this.
Use the availability of channels after driver is probed to figure this out if
needed. 

> +		als_adjust_channel_bit_mask(channels,
> +			CHANNEL_SCAN_INDEX_COLOR_TEMP,
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
>  
> -	dev_dbg(&pdev->dev, "als %x:%x\n",
> -		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
> -		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
> +		dev_dbg(&pdev->dev, "als %x:%x\n",
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
> +	}
>  
>  	for (i = 0; i < 2; i++) {
>  		int next_scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X + i;
> @@ -342,23 +347,25 @@ static int als_parse_report(struct platform_device *pdev,
>  				HID_INPUT_REPORT, usage_id,
>  				HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X + i,
>  				&st->als[next_scan_index]);
> -		if (ret < 0)
> -			return ret;
> -
> -		als_adjust_channel_bit_mask(channels,
> +		if (!ret) {
> +			dev_info(&pdev->dev,
> +				 "Light chromaticity %c is supported\n",
> +				 i ? 'Y' : 'X');
> +			als_adjust_channel_bit_mask(channels,
>  					CHANNEL_SCAN_INDEX_CHROMATICITY_X + i,
>  					st->als[next_scan_index].size);
>  
> -		dev_dbg(&pdev->dev, "als %x:%x\n",
> -			st->als[next_scan_index].index,
> -			st->als[next_scan_index].report_id);
> +			dev_dbg(&pdev->dev, "als %x:%x\n",
> +				st->als[next_scan_index].index,
> +				st->als[next_scan_index].report_id);
> +		}
>  	}
>  
>  	st->scale_precision = hid_sensor_format_scale(usage_id,
>  				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
>  				&st->scale_pre_decml, &st->scale_post_decml);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  /* Function to initialize the processing for usage id */


^ permalink raw reply

* Re: [PATCH] iio: light: hid-sensor-als: Avoid failure for chromaticity support
From: Jonathan Cameron @ 2023-12-17 14:35 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: jikos, lars, Basavaraj.Natikar, linux-input, linux-iio,
	linux-kernel, Thomas Weißschuh, stable
In-Reply-To: <20231215160159.648963-1-srinivas.pandruvada@linux.intel.com>

On Fri, 15 Dec 2023 08:01:59 -0800
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> With the commit ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity
> support"), there is an assumption that the every HID ALS descriptor has
> support of usage ids for chromaticity support. If they are not present,
> probe fails for the driver . This breaks ALS functionality on majority of
> platforms.
> 
> It is possible that chromaticity usage ids are not present. When not
> present, restrict number of IIO channels to not include support for
> chromaticity and continue.
> 
> Fixes: ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity support")
> Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/iio/light/hid-sensor-als.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index f17304b54468..9941b0b927c7 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -303,11 +303,14 @@ static int als_parse_report(struct platform_device *pdev,
>  				struct hid_sensor_hub_device *hsdev,
>  				struct iio_chan_spec *channels,
>  				unsigned usage_id,
> -				struct als_state *st)
> +				struct als_state *st,
> +				int *max_channels)
>  {
>  	int ret;
>  	int i;
>  
> +	*max_channels = CHANNEL_SCAN_INDEX_MAX;
> +
>  	for (i = 0; i <= CHANNEL_SCAN_INDEX_ILLUM; ++i) {
>  		ret = sensor_hub_input_get_attribute_info(hsdev,
>  						HID_INPUT_REPORT,
> @@ -326,8 +329,12 @@ static int als_parse_report(struct platform_device *pdev,
>  				usage_id,
>  				HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
>  				&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
> -	if (ret < 0)
> -		return ret;
> +	if (ret < 0) {
> +		*max_channels = CHANNEL_SCAN_INDEX_ILLUM;
> +		ret = 0;
> +		goto skip_color_chromaticity;
> +	}
> +
>  	als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
>  				st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
>  
> @@ -354,6 +361,7 @@ static int als_parse_report(struct platform_device *pdev,
>  			st->als[next_scan_index].report_id);
>  	}
>  
> +skip_color_chromaticity:
>  	st->scale_precision = hid_sensor_format_scale(usage_id,
>  				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
>  				&st->scale_pre_decml, &st->scale_post_decml);
> @@ -364,7 +372,7 @@ static int als_parse_report(struct platform_device *pdev,
>  /* Function to initialize the processing for usage id */
>  static int hid_als_probe(struct platform_device *pdev)
>  {
> -	int ret = 0;
> +	int ret = 0, max_channels;
>  	static const char *name = "als";
>  	struct iio_dev *indio_dev;
>  	struct als_state *als_state;
> @@ -398,15 +406,15 @@ static int hid_als_probe(struct platform_device *pdev)
>  
>  	ret = als_parse_report(pdev, hsdev,
>  			       (struct iio_chan_spec *)indio_dev->channels,
> -			       hsdev->usage,
> -			       als_state);
> +			       hsdev->usage, als_state, &max_channels);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to setup attributes\n");
>  		return ret;
>  	}
>  
> -	indio_dev->num_channels =
> -				ARRAY_SIZE(als_channels);
> +	/* +1 to include time stamp */
> +	indio_dev->num_channels = max_channels + 1;

In the current array the timestamp channel isn't the next one, so how does this work?

I think we either have to form the channel array dynamically or pick between
one that does have the colour info and one that doesn't for the original case.

Given timing we may just need to revert the broken patch and revisit this next
cycle.

Jonathan


> +
>  	indio_dev->info = &als_info;
>  	indio_dev->name = name;
>  	indio_dev->modes = INDIO_DIRECT_MODE;


^ permalink raw reply

* Re: [RFC PATCH 3/5] dt-bindings: input: add entry for 88pm88x-onkey
From: Rob Herring @ 2023-12-17 14:24 UTC (permalink / raw)
  To: Karel Balej
  Cc: Conor Dooley, Duje Mihanović, devicetree, linux-kernel,
	phone-devel, Rob Herring, linux-input, Dmitry Torokhov,
	Krzysztof Kozlowski, ~postmarketos/upstreaming, Karel Balej,
	Lee Jones
In-Reply-To: <20231217131838.7569-4-karelb@gimli.ms.mff.cuni.cz>


On Sun, 17 Dec 2023 14:17:01 +0100, Karel Balej wrote:
> From: Karel Balej <balejk@matfyz.cz>
> 
> Marvell 88PM88X PMICs provide onkey functionality. Document it.
> 
> Signed-off-by: Karel Balej <balejk@matfyz.cz>
> ---
>  .../bindings/input/marvell,88pm88x-onkey.yaml | 30 +++++++++++++++++++
>  .../bindings/mfd/marvell,88pm88x.yaml         |  4 +++
>  2 files changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:


doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231217131838.7569-4-karelb@gimli.ms.mff.cuni.cz

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply

* Re: [RFC PATCH 1/5] dt-bindings: mfd: add entry for the Marvell 88PM88X PMICs
From: Rob Herring @ 2023-12-17 14:24 UTC (permalink / raw)
  To: Karel Balej
  Cc: linux-input, Karel Balej, Lee Jones, Krzysztof Kozlowski,
	linux-kernel, devicetree, phone-devel, Rob Herring, Conor Dooley,
	~postmarketos/upstreaming, Dmitry Torokhov, Duje Mihanović
In-Reply-To: <20231217131838.7569-2-karelb@gimli.ms.mff.cuni.cz>


On Sun, 17 Dec 2023 14:16:59 +0100, Karel Balej wrote:
> From: Karel Balej <balejk@matfyz.cz>
> 
> Marvell 88PM880 and 88PM886 are two similar PMICs with mostly matching
> register mapping and subdevices such as onkey, regulators or battery and
> charger. Both seem to come in two revisions which seem to be handled
> slightly differently in some subdevice drivers.
> 
> Signed-off-by: Karel Balej <balejk@matfyz.cz>
> ---
>  .../bindings/mfd/marvell,88pm88x.yaml         | 55 +++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/mfd/marvell,88pm88x.example.dts:30.31-32 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/mfd/marvell,88pm88x.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1424: dt_binding_check] Error 2
make: *** [Makefile:234: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231217131838.7569-2-karelb@gimli.ms.mff.cuni.cz

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply

* [RFC PATCH 0/5] support for Marvell 88PM886 PMIC
From: Karel Balej @ 2023-12-17 13:16 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel

From: Karel Balej <balejk@matfyz.cz>

Hello,

the following implements basic support for Marvell's 88PM886 PMIC which
is found for instance as a component of the samsung,coreprimevelte
smartphone which inspired this and also serves as a testing platform.

The code for the MFD is based primarily on this old series [1] with the
addition of poweroff based on the smartphone's downstream kernel tree
[2]. The onkey driver is based on the latter. I am not in possesion of
the datasheet.

The vendor version of this driver includes support for a similar chip:
88PM880. While that is not included here it was written with it in mind
and it should be quite straighforward to add it.

[1] https://lore.kernel.org/all/1434098601-3498-1-git-send-email-yizhang@marvell.com/
[2] https://github.com/CoderCharmander/g361f-kernel

Thank you and kind regards,
K. B.

Karel Balej (5):
  dt-bindings: mfd: add entry for the Marvell 88PM88X PMICs
  mfd: add 88pm88x driver
  dt-bindings: input: add entry for 88pm88x-onkey
  input: add onkey driver for Marvell 88PM88X PMICs
  MAINTAINERS: add myself for Marvell 88PM88X PMICs

 .../bindings/input/marvell,88pm88x-onkey.yaml |  30 +++
 .../bindings/mfd/marvell,88pm88x.yaml         |  59 ++++++
 MAINTAINERS                                   |   9 +
 drivers/input/misc/88pm88x-onkey.c            | 103 +++++++++
 drivers/input/misc/Kconfig                    |  10 +
 drivers/input/misc/Makefile                   |   1 +
 drivers/mfd/88pm88x.c                         | 199 ++++++++++++++++++
 drivers/mfd/Kconfig                           |  11 +
 drivers/mfd/Makefile                          |   1 +
 include/linux/mfd/88pm88x.h                   |  60 ++++++
 10 files changed, 483 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
 create mode 100644 drivers/input/misc/88pm88x-onkey.c
 create mode 100644 drivers/mfd/88pm88x.c
 create mode 100644 include/linux/mfd/88pm88x.h

-- 
2.43.0


^ permalink raw reply

* [RFC PATCH 5/5] MAINTAINERS: add myself for Marvell 88PM88X PMICs
From: Karel Balej @ 2023-12-17 13:17 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz>

From: Karel Balej <balejk@matfyz.cz>

Add an entry to MAINTAINERS for the Marvell 88PM88X PMICs MFD and onkey
drivers.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index e2c6187a3ac8..eb0171cd2323 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12737,6 +12737,15 @@ F:	drivers/net/dsa/mv88e6xxx/
 F:	include/linux/dsa/mv88e6xxx.h
 F:	include/linux/platform_data/mv88e6xxx.h
 
+MARVELL 88PM88X PMIC MFD DRIVER
+M:	Karel Balej <balejk@matfyz.cz>
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml
+F:	Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
+F:	drivers/input/misc/88pm88x-onkey.c
+F:	drivers/mfd/88pm88x.c
+F:	include/linux/mfd/88pm88x.h
+
 MARVELL ARMADA 3700 PHY DRIVERS
 M:	Miquel Raynal <miquel.raynal@bootlin.com>
 S:	Maintained
-- 
2.43.0


^ permalink raw reply related

* [RFC PATCH 4/5] input: add onkey driver for Marvell 88PM88X PMICs
From: Karel Balej @ 2023-12-17 13:17 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz>

From: Karel Balej <balejk@matfyz.cz>

The Marvell 88PM88X PMICs provide onkey among other things. Add client
driver to handle it. The driver currently only provides a basic support
omitting additional functions found in the vendor version, such as long
onkey and GPIO integration.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---
 drivers/input/misc/88pm88x-onkey.c | 103 +++++++++++++++++++++++++++++
 drivers/input/misc/Kconfig         |  10 +++
 drivers/input/misc/Makefile        |   1 +
 3 files changed, 114 insertions(+)
 create mode 100644 drivers/input/misc/88pm88x-onkey.c

diff --git a/drivers/input/misc/88pm88x-onkey.c b/drivers/input/misc/88pm88x-onkey.c
new file mode 100644
index 000000000000..0d6056a3cab2
--- /dev/null
+++ b/drivers/input/misc/88pm88x-onkey.c
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/kernel.h>
+#include <linux/input.h>
+#include <linux/regmap.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+
+#include <linux/mfd/88pm88x.h>
+
+struct pm88x_onkey {
+	struct input_dev *idev;
+	struct pm88x_chip *chip;
+	int irq;
+};
+
+static irqreturn_t pm88x_onkey_irq_handler(int irq, void *data)
+{
+	struct pm88x_onkey *onkey = data;
+	unsigned int val;
+	int ret = 0;
+
+	ret = regmap_read(onkey->chip->regmaps[PM88X_REGMAP_BASE], PM88X_REG_STATUS1, &val);
+	if (ret) {
+		dev_err(onkey->idev->dev.parent, "Failed to read status: %d\n", ret);
+		return IRQ_NONE;
+	}
+	val &= PM88X_ONKEY_STS1;
+
+	input_report_key(onkey->idev, KEY_POWER, val);
+	input_sync(onkey->idev);
+
+	return IRQ_HANDLED;
+}
+
+static int pm88x_onkey_probe(struct platform_device *pdev)
+{
+	struct pm88x_chip *chip = dev_get_drvdata(pdev->dev.parent);
+	struct pm88x_onkey *onkey;
+	int err;
+
+	onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL);
+	if (!onkey)
+		return -ENOMEM;
+
+	onkey->chip = chip;
+
+	onkey->irq = platform_get_irq(pdev, 0);
+	if (onkey->irq < 0) {
+		dev_err(&pdev->dev, "Failed to get IRQ\n");
+		return -EINVAL;
+	}
+
+	onkey->idev = devm_input_allocate_device(&pdev->dev);
+	if (!onkey->idev) {
+		dev_err(&pdev->dev, "Failed to allocate input device\n");
+		return -ENOMEM;
+	}
+
+	onkey->idev->name = "88pm88x-onkey";
+	onkey->idev->phys = "88pm88x-onkey/input0";
+	onkey->idev->id.bustype = BUS_I2C;
+	onkey->idev->dev.parent = &pdev->dev;
+	onkey->idev->evbit[0] = BIT_MASK(EV_KEY);
+	onkey->idev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER);
+
+	err = devm_request_threaded_irq(&pdev->dev, onkey->irq, NULL, pm88x_onkey_irq_handler,
+			IRQF_ONESHOT | IRQF_NO_SUSPEND, "onkey", onkey);
+	if (err) {
+		dev_err(&pdev->dev, "Failed to request IRQ: %d\n", err);
+		return err;
+	}
+
+	err = input_register_device(onkey->idev);
+	if (err) {
+		dev_err(&pdev->dev, "Failed to register input device: %d\n", err);
+		return err;
+	}
+
+	device_init_wakeup(&pdev->dev, 1);
+
+	return 0;
+}
+
+static const struct of_device_id pm88x_onkey_of_match[] = {
+	{ .compatible = "marvell,88pm88x-onkey", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, pm88x_onkey_of_match);
+
+static struct platform_driver pm88x_onkey_driver = {
+	.driver = {
+		.name = "88pm88x-onkey",
+		.of_match_table = of_match_ptr(pm88x_onkey_of_match),
+	},
+	.probe = pm88x_onkey_probe,
+};
+module_platform_driver(pm88x_onkey_driver);
+
+MODULE_DESCRIPTION("Marvell 88PM88X onkey driver");
+MODULE_AUTHOR("Karel Balej <balejk@matfyz.cz>");
+MODULE_LICENSE("GPL");
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 6ba984d7f0b1..fdfa3e23c3cf 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -33,6 +33,16 @@ config INPUT_88PM80X_ONKEY
 	  To compile this driver as a module, choose M here: the module
 	  will be called 88pm80x_onkey.
 
+config INPUT_88PM88X_ONKEY
+	tristate "Marvell 88PM88X onkey support"
+	depends on MFD_88PM88X
+	help
+	  Support the onkey of Marvell 88PM88X PMICs as an input device
+	  reporting power button status.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called 88pm88x-onkey.
+
 config INPUT_AB8500_PONKEY
 	tristate "AB8500 Pon (PowerOn) Key"
 	depends on AB8500_CORE
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 04296a4abe8e..eab7a364188c 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_INPUT_88PM860X_ONKEY)	+= 88pm860x_onkey.o
 obj-$(CONFIG_INPUT_88PM80X_ONKEY)	+= 88pm80x_onkey.o
+obj-$(CONFIG_INPUT_88PM88X_ONKEY)	+= 88pm88x-onkey.o
 obj-$(CONFIG_INPUT_AB8500_PONKEY)	+= ab8500-ponkey.o
 obj-$(CONFIG_INPUT_AD714X)		+= ad714x.o
 obj-$(CONFIG_INPUT_AD714X_I2C)		+= ad714x-i2c.o
-- 
2.43.0


^ permalink raw reply related

* [RFC PATCH 3/5] dt-bindings: input: add entry for 88pm88x-onkey
From: Karel Balej @ 2023-12-17 13:17 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz>

From: Karel Balej <balejk@matfyz.cz>

Marvell 88PM88X PMICs provide onkey functionality. Document it.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---
 .../bindings/input/marvell,88pm88x-onkey.yaml | 30 +++++++++++++++++++
 .../bindings/mfd/marvell,88pm88x.yaml         |  4 +++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml

diff --git a/Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml b/Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml
new file mode 100644
index 000000000000..aeb7673189f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/marvell,88pm88x-onkey.yaml
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/marvell,88pm88x-onkey.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Onkey driver for Marvell 88PM88X PMICs.
+
+maintainers:
+  - Karel Balej <balejk@matfyz.cz>
+
+description: |
+  This module is part of the 88PM88X MFD device. For more details
+  see Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml.
+
+  The onkey controller is represented as a sub-node of the PMIC node in
+  the device tree.
+
+allOf:
+  - $ref: input.yaml#
+
+properties:
+  compatible:
+    const: marvell,88pm88x-onkey
+
+required:
+  - compatible
+
+additionalProperties: false
+...
diff --git a/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml b/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
index e075729c360f..115b41c9f22c 100644
--- a/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
+++ b/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
@@ -50,6 +50,10 @@ examples:
         interrupt-parent = <&gic>;
         interrupt-controller;
         #interrupt-cells = <1>;
+
+        onkey {
+          compatible = "marvell,88pm88x-onkey";
+        };
       };
     };
 ...
-- 
2.43.0


^ permalink raw reply related

* [RFC PATCH 2/5] mfd: add 88pm88x driver
From: Karel Balej @ 2023-12-17 13:17 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz>

From: Karel Balej <balejk@matfyz.cz>

Marvell 88PM880 and 8PM886 are two similar PMICs with mostly matching
register mapping. They provide various functions such as onkey, battery,
charger and regulators.

Add support for 88PM886 found for instance in the samsung,coreprimevelte
smartphone with which this was tested. Support for 88PM880 is not
implemented here but should be straightforward to add.

Implement only the most basic support omitting the currently unused
registers and I2C subclients which should thus be added with the
respective subdevices. However, add support for the onkey already.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---
 drivers/mfd/88pm88x.c       | 199 ++++++++++++++++++++++++++++++++++++
 drivers/mfd/Kconfig         |  11 ++
 drivers/mfd/Makefile        |   1 +
 include/linux/mfd/88pm88x.h |  60 +++++++++++
 4 files changed, 271 insertions(+)
 create mode 100644 drivers/mfd/88pm88x.c
 create mode 100644 include/linux/mfd/88pm88x.h

diff --git a/drivers/mfd/88pm88x.c b/drivers/mfd/88pm88x.c
new file mode 100644
index 000000000000..5db6c65b667d
--- /dev/null
+++ b/drivers/mfd/88pm88x.c
@@ -0,0 +1,199 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+#include <linux/mfd/core.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
+#include <linux/mfd/88pm88x.h>
+
+/* interrupt status registers */
+#define PM88X_REG_INT_STATUS1			0x05
+
+#define PM88X_REG_INT_ENA_1			0x0a
+#define PM88X_INT_ENA1_ONKEY			BIT(0)
+
+enum pm88x_irq_number {
+	PM88X_IRQ_ONKEY,
+
+	PM88X_MAX_IRQ
+};
+
+static struct regmap_irq pm88x_regmap_irqs[] = {
+	REGMAP_IRQ_REG(PM88X_IRQ_ONKEY, 0, PM88X_INT_ENA1_ONKEY),
+};
+
+static struct regmap_irq_chip pm88x_regmap_irq_chip = {
+	.name = "88pm88x",
+	.irqs = pm88x_regmap_irqs,
+	.num_irqs = ARRAY_SIZE(pm88x_regmap_irqs),
+	.num_regs = 4,
+	.status_base = PM88X_REG_INT_STATUS1,
+	.ack_base = PM88X_REG_INT_STATUS1,
+	.unmask_base = PM88X_REG_INT_ENA_1,
+};
+
+static struct reg_sequence pm886_presets[] = {
+	/* disable watchdog */
+	REG_SEQ0(PM88X_REG_WDOG, 0x01),
+	/* GPIO1: DVC, GPIO0: input */
+	REG_SEQ0(PM88X_REG_GPIO_CTRL1, 0x40),
+	/* GPIO2: input */
+	REG_SEQ0(PM88X_REG_GPIO_CTRL2, 0x00),
+	/* DVC2, DVC1 */
+	REG_SEQ0(PM88X_REG_GPIO_CTRL3, 0x44),
+	/* GPIO5V_1:input, GPIO5V_2: input */
+	REG_SEQ0(PM88X_REG_GPIO_CTRL4, 0x00),
+	/* output 32 kHz from XO */
+	REG_SEQ0(PM88X_REG_AON_CTRL2, 0x2a),
+	/* OSC_FREERUN = 1, to lock FLL */
+	REG_SEQ0(PM88X_REG_BK_OSC_CTRL1, 0x0f),
+	/* XO_LJ = 1, enable low jitter for 32 kHz */
+	REG_SEQ0(PM88X_REG_LOWPOWER2, 0x20),
+	/* OV_VSYS and UV_VSYS1 comparators on VSYS disabled, VSYS_OVER_TH : 5.6V */
+	REG_SEQ0(PM88X_REG_LOWPOWER4, 0xc8),
+	/* set the duty cycle of charger DC/DC to max */
+	REG_SEQ0(PM88X_REG_BK_OSC_CTRL3, 0xc0),
+};
+
+static struct resource onkey_resources[] = {
+	DEFINE_RES_IRQ_NAMED(PM88X_IRQ_ONKEY, "88pm88x-onkey"),
+};
+
+static struct mfd_cell pm88x_devs[] = {
+	{
+		.name = "88pm88x-onkey",
+		.num_resources = ARRAY_SIZE(onkey_resources),
+		.resources = onkey_resources,
+		.id = -1,
+	},
+};
+
+static struct pm88x_data pm886_a1_data = {
+	.whoami = PM886_A1_WHOAMI,
+	.presets = pm886_presets,
+	.num_presets = ARRAY_SIZE(pm886_presets),
+};
+
+static const struct regmap_config pm88x_i2c_regmap = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = 0xfe,
+};
+
+static int pm88x_power_off_handler(struct sys_off_data *data)
+{
+	struct pm88x_chip *chip = data->cb_data;
+	int ret;
+
+	ret = regmap_update_bits(chip->regmaps[PM88X_REGMAP_BASE], PM88X_REG_MISC_CONFIG1,
+			PM88X_SW_PDOWN, PM88X_SW_PDOWN);
+	if (ret) {
+		dev_err(&chip->client->dev, "Failed to power off the device: %d\n", ret);
+		return NOTIFY_BAD;
+	}
+	return NOTIFY_DONE;
+}
+
+static int pm88x_setup_irq(struct pm88x_chip *chip)
+{
+	int ret;
+
+	/* set interrupt clearing mode to clear on write */
+	ret = regmap_update_bits(chip->regmaps[PM88X_REGMAP_BASE], PM88X_REG_MISC_CONFIG2,
+			PM88X_INT_INV | PM88X_INT_CLEAR | PM88X_INT_MASK_MODE,
+			PM88X_INT_WC);
+	if (ret) {
+		dev_err(&chip->client->dev, "Failed to set interrupt clearing mode: %d\n", ret);
+		return ret;
+	}
+
+	ret = devm_regmap_add_irq_chip(&chip->client->dev, chip->regmaps[PM88X_REGMAP_BASE],
+			chip->client->irq, IRQF_ONESHOT, -1, &pm88x_regmap_irq_chip,
+			&chip->irq_data);
+	if (ret) {
+		dev_err(&chip->client->dev, "Failed to request IRQ: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static int pm88x_probe(struct i2c_client *client)
+{
+	struct pm88x_chip *chip;
+	int ret = 0;
+	unsigned int chip_id;
+
+	chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
+	if (!chip)
+		return -ENOMEM;
+
+	chip->client = client;
+	chip->data = device_get_match_data(&client->dev);
+	i2c_set_clientdata(client, chip);
+
+	device_init_wakeup(&client->dev, 1);
+
+	chip->regmaps[PM88X_REGMAP_BASE] = devm_regmap_init_i2c(client, &pm88x_i2c_regmap);
+	if (IS_ERR(chip->regmaps[PM88X_REGMAP_BASE])) {
+		ret = PTR_ERR(chip->regmaps[PM88X_REGMAP_BASE]);
+		dev_err(&client->dev, "Failed to initialize regmap: %d\n", ret);
+		return ret;
+	}
+
+	ret = regmap_read(chip->regmaps[PM88X_REGMAP_BASE], PM88X_REG_ID, &chip_id);
+	if (ret) {
+		dev_err(&client->dev, "Failed to read chip ID: %d\n", ret);
+		return ret;
+	}
+	if (chip->data->whoami != chip_id) {
+		dev_err(&client->dev, "Device reported wrong chip ID: %u\n", chip_id);
+		return -EINVAL;
+	}
+
+	ret = pm88x_setup_irq(chip);
+	if (ret)
+		return ret;
+
+	ret = devm_mfd_add_devices(&client->dev, 0, pm88x_devs, ARRAY_SIZE(pm88x_devs),
+			NULL, 0, regmap_irq_get_domain(chip->irq_data));
+	if (ret) {
+		dev_err(&client->dev, "Failed to add devices: %d\n", ret);
+		return ret;
+	}
+
+	ret = regmap_register_patch(chip->regmaps[PM88X_REGMAP_BASE], chip->data->presets,
+			chip->data->num_presets);
+	if (ret) {
+		dev_err(&client->dev, "Failed to register regmap patch: %d\n", ret);
+		return ret;
+	}
+
+	ret = devm_register_power_off_handler(&client->dev, pm88x_power_off_handler, chip);
+	if (ret) {
+		dev_err(&client->dev, "Failed to register power off handler: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+const struct of_device_id pm88x_of_match[] = {
+	{ .compatible = "marvell,88pm886-a1", .data = &pm886_a1_data },
+	{ },
+};
+
+static struct i2c_driver pm88x_i2c_driver = {
+	.driver = {
+		.name = "88pm88x",
+		.of_match_table = of_match_ptr(pm88x_of_match),
+	},
+	.probe = pm88x_probe,
+};
+module_i2c_driver(pm88x_i2c_driver);
+
+MODULE_DESCRIPTION("Marvell 88PM88X PMIC driver");
+MODULE_AUTHOR("Karel Balej <balejk@matfyz.cz>");
+MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 90ce58fd629e..c593279fd766 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -794,6 +794,17 @@ config MFD_88PM860X
 	  select individual components like voltage regulators, RTC and
 	  battery-charger under the corresponding menus.
 
+config MFD_88PM88X
+	bool "Marvell 88PM886"
+	depends on I2C=y
+	select REGMAP_I2C
+	select REGMAP_IRQ
+	select MFD_CORE
+	help
+	  This enables support for Marvell 88PM886 Power Management IC.
+	  This includes the I2C driver and the core APIs _only_, you have to
+	  select individual components like onkey under the corresponding menus.
+
 config MFD_MAX14577
 	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
 	depends on I2C
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index c66f07edcd0e..14e42b045c92 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -7,6 +7,7 @@
 obj-$(CONFIG_MFD_88PM860X)	+= 88pm860x.o
 obj-$(CONFIG_MFD_88PM800)	+= 88pm800.o 88pm80x.o
 obj-$(CONFIG_MFD_88PM805)	+= 88pm805.o 88pm80x.o
+obj-$(CONFIG_MFD_88PM88X)	+= 88pm88x.o
 obj-$(CONFIG_MFD_ACT8945A)	+= act8945a.o
 obj-$(CONFIG_MFD_SM501)		+= sm501.o
 obj-$(CONFIG_ARCH_BCM2835)	+= bcm2835-pm.o
diff --git a/include/linux/mfd/88pm88x.h b/include/linux/mfd/88pm88x.h
new file mode 100644
index 000000000000..a34c57447827
--- /dev/null
+++ b/include/linux/mfd/88pm88x.h
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __LINUX_MFD_88PM88X_H
+#define __LINUX_MFD_88PM88X_H
+
+#include <linux/mfd/core.h>
+
+#define PM886_A1_WHOAMI		0xa1
+
+#define PM88X_REG_ID			0x00
+
+#define PM88X_REG_STATUS1		0x01
+#define PM88X_ONKEY_STS1		BIT(0)
+
+#define PM88X_REG_MISC_CONFIG1		0x14
+#define PM88X_SW_PDOWN			BIT(5)
+
+#define PM88X_REG_MISC_CONFIG2		0x15
+#define PM88X_INT_INV			BIT(0)
+#define PM88X_INT_CLEAR			BIT(1)
+#define PM88X_INT_RC			0x00
+#define PM88X_INT_WC			BIT(1)
+#define PM88X_INT_MASK_MODE		BIT(2)
+
+#define PM88X_REG_WDOG			0x1d
+
+#define PM88X_REG_LOWPOWER2		0x21
+#define PM88X_REG_LOWPOWER4		0x23
+
+#define PM88X_REG_GPIO_CTRL1		0x30
+
+#define PM88X_REG_GPIO_CTRL2		0x31
+
+#define PM88X_REG_GPIO_CTRL3		0x32
+
+#define PM88X_REG_GPIO_CTRL4		0x33
+
+#define PM88X_REG_BK_OSC_CTRL1		0x50
+#define PM88X_REG_BK_OSC_CTRL3		0x52
+
+#define PM88X_REG_AON_CTRL2		0xe2
+
+enum pm88x_regmap_index {
+	PM88X_REGMAP_BASE,
+
+	PM88X_REGMAP_NR
+};
+
+struct pm88x_data {
+	unsigned int whoami;
+	struct reg_sequence *presets;
+	unsigned int num_presets;
+};
+
+struct pm88x_chip {
+	struct i2c_client *client;
+	struct regmap_irq_chip_data *irq_data;
+	const struct pm88x_data *data;
+	struct regmap *regmaps[PM88X_REGMAP_NR];
+};
+#endif /* __LINUX_MFD_88PM88X_H */
-- 
2.43.0


^ permalink raw reply related

* [RFC PATCH 1/5] dt-bindings: mfd: add entry for the Marvell 88PM88X PMICs
From: Karel Balej @ 2023-12-17 13:16 UTC (permalink / raw)
  To: Karel Balej, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Lee Jones, linux-input, devicetree, linux-kernel
  Cc: Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz>

From: Karel Balej <balejk@matfyz.cz>

Marvell 88PM880 and 88PM886 are two similar PMICs with mostly matching
register mapping and subdevices such as onkey, regulators or battery and
charger. Both seem to come in two revisions which seem to be handled
slightly differently in some subdevice drivers.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---
 .../bindings/mfd/marvell,88pm88x.yaml         | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml

diff --git a/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml b/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
new file mode 100644
index 000000000000..e075729c360f
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/marvell,88pm88x.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/marvell,88pm88x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell 88PM88X PMIC core MFD
+
+maintainers:
+  - Karel Balej <balejk@matfyz.cz>
+
+description: |
+  Marvell 88PM880 and 88PM886 are two similar PMICs providing
+  several functions such as onkey, regulators or battery and
+  charger. Both seem to come in two revisions -- A0 and A1.
+
+properties:
+  compatible:
+    const: marvell,88pm886-a1
+
+  reg:
+    description: I2C device address
+    maxItems: 1
+
+  interrupt-controller: true
+
+  interrupts:
+    maxItems: 1
+
+  "#interrupt-cells":
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      pmic0: 88pm886@30 {
+        compatible = "marvell,88pm886-a1";
+        reg = <0x30>;
+        interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-parent = <&gic>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+      };
+    };
+...
-- 
2.43.0


^ permalink raw reply related

* [syzbot] Monthly input report (Dec 2023)
From: syzbot @ 2023-12-16 23:58 UTC (permalink / raw)
  To: linux-input, linux-kernel, syzkaller-bugs

Hello input maintainers/developers,

This is a 31-day syzbot report for the input subsystem.
All related reports/information can be found at:
https://syzkaller.appspot.com/upstream/s/input

During the period, 0 new issues were detected and 0 were fixed.
In total, 12 issues are still open and 51 have been fixed so far.

Some of the still happening issues:

Ref Crashes Repro Title
<1> 3953    Yes   WARNING in input_mt_init_slots
                  https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5
<2> 944     Yes   WARNING in implement
                  https://syzkaller.appspot.com/bug?extid=38e7237add3712479d65
<3> 322     No    possible deadlock in evdev_pass_values (2)
                  https://syzkaller.appspot.com/bug?extid=13d3cb2a3dc61e6092f5
<4> 138     Yes   WARNING in cm109_urb_irq_callback/usb_submit_urb
                  https://syzkaller.appspot.com/bug?extid=2d6d691af5ab4b7e66df
<5> 67      Yes   INFO: task hung in uhid_char_release
                  https://syzkaller.appspot.com/bug?extid=8fe2d362af0e1cba8735
<6> 38      Yes   WARNING in bcm5974_start_traffic/usb_submit_urb
                  https://syzkaller.appspot.com/bug?extid=348331f63b034f89b622
<7> 2       No    WARNING in cm109_input_open/usb_submit_urb (2)
                  https://syzkaller.appspot.com/bug?extid=2e305789579d76b5c253

---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

To disable reminders for individual bugs, reply with the following command:
#syz set <Ref> no-reminders

To change bug's subsystems, reply with:
#syz set <Ref> subsystems: new-subsystem

You may send multiple commands in a single email message.

^ permalink raw reply

* Re: [PATCH] iio: hid-sensor-als: Don't stop probing at non-supported attribute
From: Yauhen Kharuzhy @ 2023-12-16 12:45 UTC (permalink / raw)
  To: linux-input, linux-iio
  Cc: Srinivas Pandruvada, Jonathan Cameron, linux-kernel, Jiri Kosina,
	Basavaraj Natikar
In-Reply-To: <20231216114229.652020-1-jekhor@gmail.com>

On Sat, Dec 16, 2023 at 01:42:29PM +0200, Yauhen Kharuzhy wrote:
> Some ambient light sensors don't support color temperature and
> chromaticity attributes. The driver stops probing if it finds this.
> 
> To support sensors without of color temperature and chromaticity
> attributes, just skip them at probing if they weren't found.
> 
> Tested at Lenovo Yogabook YB1-X91L tablet.

Hi, It seems that Srinivas Pandruvada has posted another patch fixing
the same issue. So, drop my patch in favor of his one.

> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
>  drivers/iio/light/hid-sensor-als.c | 39 ++++++++++++++++++------------
>  1 file changed, 23 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index f17304b54468..b711bac3bb2b 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -314,8 +314,11 @@ static int als_parse_report(struct platform_device *pdev,
>  						usage_id,
>  						HID_USAGE_SENSOR_LIGHT_ILLUM,
>  						&st->als[i]);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			dev_err(&pdev->dev,
> +				"Failed to setup Illuminance attribute\n");
>  			return ret;
> +		}
>  		als_adjust_channel_bit_mask(channels, i, st->als[i].size);
>  
>  		dev_dbg(&pdev->dev, "als %x:%x\n", st->als[i].index,
> @@ -326,14 +329,16 @@ static int als_parse_report(struct platform_device *pdev,
>  				usage_id,
>  				HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
>  				&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
> -	if (ret < 0)
> -		return ret;
> -	als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
> -				st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
> +	if (!ret) {
> +		dev_info(&pdev->dev, "Color temperature is supported\n");
> +		als_adjust_channel_bit_mask(channels,
> +			CHANNEL_SCAN_INDEX_COLOR_TEMP,
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
>  
> -	dev_dbg(&pdev->dev, "als %x:%x\n",
> -		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
> -		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
> +		dev_dbg(&pdev->dev, "als %x:%x\n",
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
> +			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
> +	}
>  
>  	for (i = 0; i < 2; i++) {
>  		int next_scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X + i;
> @@ -342,23 +347,25 @@ static int als_parse_report(struct platform_device *pdev,
>  				HID_INPUT_REPORT, usage_id,
>  				HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X + i,
>  				&st->als[next_scan_index]);
> -		if (ret < 0)
> -			return ret;
> -
> -		als_adjust_channel_bit_mask(channels,
> +		if (!ret) {
> +			dev_info(&pdev->dev,
> +				 "Light chromaticity %c is supported\n",
> +				 i ? 'Y' : 'X');
> +			als_adjust_channel_bit_mask(channels,
>  					CHANNEL_SCAN_INDEX_CHROMATICITY_X + i,
>  					st->als[next_scan_index].size);
>  
> -		dev_dbg(&pdev->dev, "als %x:%x\n",
> -			st->als[next_scan_index].index,
> -			st->als[next_scan_index].report_id);
> +			dev_dbg(&pdev->dev, "als %x:%x\n",
> +				st->als[next_scan_index].index,
> +				st->als[next_scan_index].report_id);
> +		}
>  	}
>  
>  	st->scale_precision = hid_sensor_format_scale(usage_id,
>  				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
>  				&st->scale_pre_decml, &st->scale_post_decml);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  /* Function to initialize the processing for usage id */
> -- 
> 2.43.0
> 

-- 
Yauhen Kharuzhy

^ permalink raw reply

* [PATCH] iio: hid-sensor-als: Don't stop probing at non-supported attribute
From: Yauhen Kharuzhy @ 2023-12-16 11:42 UTC (permalink / raw)
  To: linux-input, linux-iio
  Cc: Srinivas Pandruvada, Jonathan Cameron, linux-kernel, Jiri Kosina,
	Basavaraj Natikar, Yauhen Kharuzhy

Some ambient light sensors don't support color temperature and
chromaticity attributes. The driver stops probing if it finds this.

To support sensors without of color temperature and chromaticity
attributes, just skip them at probing if they weren't found.

Tested at Lenovo Yogabook YB1-X91L tablet.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 drivers/iio/light/hid-sensor-als.c | 39 ++++++++++++++++++------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index f17304b54468..b711bac3bb2b 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -314,8 +314,11 @@ static int als_parse_report(struct platform_device *pdev,
 						usage_id,
 						HID_USAGE_SENSOR_LIGHT_ILLUM,
 						&st->als[i]);
-		if (ret < 0)
+		if (ret < 0) {
+			dev_err(&pdev->dev,
+				"Failed to setup Illuminance attribute\n");
 			return ret;
+		}
 		als_adjust_channel_bit_mask(channels, i, st->als[i].size);
 
 		dev_dbg(&pdev->dev, "als %x:%x\n", st->als[i].index,
@@ -326,14 +329,16 @@ static int als_parse_report(struct platform_device *pdev,
 				usage_id,
 				HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
 				&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
-	if (ret < 0)
-		return ret;
-	als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
-				st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
+	if (!ret) {
+		dev_info(&pdev->dev, "Color temperature is supported\n");
+		als_adjust_channel_bit_mask(channels,
+			CHANNEL_SCAN_INDEX_COLOR_TEMP,
+			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
 
-	dev_dbg(&pdev->dev, "als %x:%x\n",
-		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
-		st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
+		dev_dbg(&pdev->dev, "als %x:%x\n",
+			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
+			st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
+	}
 
 	for (i = 0; i < 2; i++) {
 		int next_scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X + i;
@@ -342,23 +347,25 @@ static int als_parse_report(struct platform_device *pdev,
 				HID_INPUT_REPORT, usage_id,
 				HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X + i,
 				&st->als[next_scan_index]);
-		if (ret < 0)
-			return ret;
-
-		als_adjust_channel_bit_mask(channels,
+		if (!ret) {
+			dev_info(&pdev->dev,
+				 "Light chromaticity %c is supported\n",
+				 i ? 'Y' : 'X');
+			als_adjust_channel_bit_mask(channels,
 					CHANNEL_SCAN_INDEX_CHROMATICITY_X + i,
 					st->als[next_scan_index].size);
 
-		dev_dbg(&pdev->dev, "als %x:%x\n",
-			st->als[next_scan_index].index,
-			st->als[next_scan_index].report_id);
+			dev_dbg(&pdev->dev, "als %x:%x\n",
+				st->als[next_scan_index].index,
+				st->als[next_scan_index].report_id);
+		}
 	}
 
 	st->scale_precision = hid_sensor_format_scale(usage_id,
 				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
 				&st->scale_pre_decml, &st->scale_post_decml);
 
-	return ret;
+	return 0;
 }
 
 /* Function to initialize the processing for usage id */
-- 
2.43.0


^ permalink raw reply related

* [dtor-input:next] BUILD SUCCESS c67f8a13be4e9ffc862c7f60ec97a799a1547486
From: kernel test robot @ 2023-12-16  7:19 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
branch HEAD: c67f8a13be4e9ffc862c7f60ec97a799a1547486  Input: da9063 - use dev_err_probe()

Warning ids grouped by kconfigs:

gcc_recent_errors
|-- arm64-randconfig-003-20231216
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-soc-amlogic-meson-secure-pwrc.o
|-- csky-allmodconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-pata_ftide010.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
|-- nios2-allmodconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-pata_ftide010.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
|-- powerpc-randconfig-001-20231216
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
|-- riscv-allmodconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-pata_ftide010.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
`-- xtensa-randconfig-002-20231216
    `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
clang_recent_errors
|-- arm64-allmodconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-pata_ftide010.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o
`-- x86_64-allmodconfig
    |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-pata_ftide010.o
    `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-ata-sata_gemini.o

elapsed time: 1460m

configs tested: 187
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                             allnoconfig   gcc  
alpha                            allyesconfig   gcc  
alpha                               defconfig   gcc  
arc                              allmodconfig   gcc  
arc                               allnoconfig   gcc  
arc                              allyesconfig   gcc  
arc                                 defconfig   gcc  
arc                     haps_hs_smp_defconfig   gcc  
arc                     nsimosci_hs_defconfig   gcc  
arc                   randconfig-001-20231216   gcc  
arc                   randconfig-002-20231216   gcc  
arm                              allmodconfig   gcc  
arm                               allnoconfig   gcc  
arm                              allyesconfig   gcc  
arm                         axm55xx_defconfig   gcc  
arm                                 defconfig   clang
arm                        multi_v5_defconfig   clang
arm                        mvebu_v7_defconfig   gcc  
arm                        neponset_defconfig   clang
arm                           omap1_defconfig   clang
arm                       omap2plus_defconfig   gcc  
arm                   randconfig-001-20231216   gcc  
arm                   randconfig-002-20231216   gcc  
arm                   randconfig-003-20231216   gcc  
arm                   randconfig-004-20231216   gcc  
arm64                            allmodconfig   clang
arm64                             allnoconfig   gcc  
arm64                               defconfig   gcc  
arm64                 randconfig-001-20231216   gcc  
arm64                 randconfig-002-20231216   gcc  
arm64                 randconfig-003-20231216   gcc  
arm64                 randconfig-004-20231216   gcc  
csky                             allmodconfig   gcc  
csky                              allnoconfig   gcc  
csky                             allyesconfig   gcc  
csky                                defconfig   gcc  
csky                  randconfig-001-20231216   gcc  
csky                  randconfig-002-20231216   gcc  
hexagon                          allmodconfig   clang
hexagon                           allnoconfig   clang
hexagon                          allyesconfig   clang
hexagon                             defconfig   clang
hexagon               randconfig-001-20231216   clang
hexagon               randconfig-002-20231216   clang
i386                             allmodconfig   clang
i386                              allnoconfig   clang
i386                             allyesconfig   clang
i386         buildonly-randconfig-001-20231215   clang
i386         buildonly-randconfig-002-20231215   clang
i386         buildonly-randconfig-003-20231215   clang
i386         buildonly-randconfig-004-20231215   clang
i386         buildonly-randconfig-005-20231215   clang
i386         buildonly-randconfig-006-20231215   clang
i386                                defconfig   gcc  
i386                  randconfig-001-20231215   clang
i386                  randconfig-002-20231215   clang
i386                  randconfig-003-20231215   clang
i386                  randconfig-004-20231215   clang
i386                  randconfig-005-20231215   clang
i386                  randconfig-006-20231215   clang
i386                  randconfig-011-20231215   gcc  
i386                  randconfig-012-20231215   gcc  
i386                  randconfig-013-20231215   gcc  
i386                  randconfig-014-20231215   gcc  
i386                  randconfig-015-20231215   gcc  
i386                  randconfig-016-20231215   gcc  
loongarch                        allmodconfig   gcc  
loongarch                         allnoconfig   gcc  
loongarch                           defconfig   gcc  
loongarch             randconfig-001-20231216   gcc  
loongarch             randconfig-002-20231216   gcc  
m68k                             allmodconfig   gcc  
m68k                              allnoconfig   gcc  
m68k                             allyesconfig   gcc  
m68k                         apollo_defconfig   gcc  
m68k                                defconfig   gcc  
m68k                        stmark2_defconfig   gcc  
microblaze                       allmodconfig   gcc  
microblaze                        allnoconfig   gcc  
microblaze                       allyesconfig   gcc  
microblaze                          defconfig   gcc  
mips                              allnoconfig   clang
mips                             allyesconfig   gcc  
mips                         bigsur_defconfig   gcc  
mips                           gcw0_defconfig   gcc  
mips                      maltaaprp_defconfig   clang
mips                          rb532_defconfig   gcc  
nios2                            allmodconfig   gcc  
nios2                             allnoconfig   gcc  
nios2                            allyesconfig   gcc  
nios2                               defconfig   gcc  
nios2                 randconfig-001-20231216   gcc  
nios2                 randconfig-002-20231216   gcc  
openrisc                          allnoconfig   gcc  
openrisc                         allyesconfig   gcc  
openrisc                            defconfig   gcc  
parisc                           allmodconfig   gcc  
parisc                            allnoconfig   gcc  
parisc                           allyesconfig   gcc  
parisc                              defconfig   gcc  
parisc                generic-64bit_defconfig   gcc  
parisc                randconfig-001-20231216   gcc  
parisc                randconfig-002-20231216   gcc  
parisc64                            defconfig   gcc  
powerpc                          allmodconfig   clang
powerpc                           allnoconfig   gcc  
powerpc                          allyesconfig   clang
powerpc                    ge_imp3a_defconfig   gcc  
powerpc                       holly_defconfig   gcc  
powerpc                 linkstation_defconfig   gcc  
powerpc                   lite5200b_defconfig   clang
powerpc                 mpc837x_rdb_defconfig   gcc  
powerpc                      pasemi_defconfig   gcc  
powerpc               randconfig-001-20231216   gcc  
powerpc               randconfig-002-20231216   gcc  
powerpc               randconfig-003-20231216   gcc  
powerpc                     redwood_defconfig   gcc  
powerpc                    sam440ep_defconfig   gcc  
powerpc                     sequoia_defconfig   gcc  
powerpc                    socrates_defconfig   gcc  
powerpc                     tqm8560_defconfig   gcc  
powerpc                        warp_defconfig   gcc  
powerpc64             randconfig-001-20231216   gcc  
powerpc64             randconfig-002-20231216   gcc  
powerpc64             randconfig-003-20231216   gcc  
riscv                            allmodconfig   gcc  
riscv                             allnoconfig   clang
riscv                            allyesconfig   gcc  
riscv                               defconfig   gcc  
riscv                 randconfig-001-20231216   gcc  
riscv                 randconfig-002-20231216   gcc  
riscv                          rv32_defconfig   clang
s390                             allmodconfig   gcc  
s390                              allnoconfig   gcc  
s390                             allyesconfig   gcc  
s390                                defconfig   gcc  
s390                  randconfig-001-20231216   clang
s390                  randconfig-002-20231216   clang
sh                               allmodconfig   gcc  
sh                                allnoconfig   gcc  
sh                               allyesconfig   gcc  
sh                        apsh4ad0a_defconfig   gcc  
sh                                  defconfig   gcc  
sh                    randconfig-001-20231216   gcc  
sh                    randconfig-002-20231216   gcc  
sh                          sdk7780_defconfig   gcc  
sh                           se7724_defconfig   gcc  
sh                        sh7757lcr_defconfig   gcc  
sh                        sh7785lcr_defconfig   gcc  
sh                            shmin_defconfig   gcc  
sparc                            allmodconfig   gcc  
sparc64                          allmodconfig   gcc  
sparc64                          allyesconfig   gcc  
sparc64                             defconfig   gcc  
sparc64               randconfig-001-20231216   gcc  
sparc64               randconfig-002-20231216   gcc  
um                               allmodconfig   clang
um                                allnoconfig   clang
um                               allyesconfig   clang
um                                  defconfig   gcc  
um                             i386_defconfig   gcc  
um                    randconfig-001-20231216   gcc  
um                    randconfig-002-20231216   gcc  
um                           x86_64_defconfig   gcc  
x86_64                            allnoconfig   gcc  
x86_64                           allyesconfig   clang
x86_64       buildonly-randconfig-001-20231216   gcc  
x86_64       buildonly-randconfig-002-20231216   gcc  
x86_64       buildonly-randconfig-003-20231216   gcc  
x86_64       buildonly-randconfig-004-20231216   gcc  
x86_64       buildonly-randconfig-005-20231216   gcc  
x86_64       buildonly-randconfig-006-20231216   gcc  
x86_64                              defconfig   gcc  
x86_64                randconfig-001-20231216   clang
x86_64                randconfig-002-20231216   clang
x86_64                randconfig-003-20231216   clang
x86_64                randconfig-004-20231216   clang
x86_64                randconfig-005-20231216   clang
x86_64                randconfig-006-20231216   clang
x86_64                randconfig-011-20231216   gcc  
x86_64                randconfig-012-20231216   gcc  
x86_64                randconfig-013-20231216   gcc  
x86_64                randconfig-014-20231216   gcc  
x86_64                          rhel-8.3-rust   clang
xtensa                            allnoconfig   gcc  
xtensa                randconfig-001-20231216   gcc  
xtensa                randconfig-002-20231216   gcc  

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

^ permalink raw reply

* [linux-next:master] BUILD REGRESSION 17cb8a20bde66a520a2ca7aad1063e1ce7382240
From: kernel test robot @ 2023-12-16  5:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux Memory Management List, amd-gfx, intel-wired-lan, linux-afs,
	linux-arch, linux-arm-kernel, linux-arm-msm, linux-bcachefs,
	linux-csky, linux-hwmon, linux-input, linux-leds, sparclinux

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: 17cb8a20bde66a520a2ca7aad1063e1ce7382240  Add linux-next specific files for 20231215

Error/Warning reports:

https://lore.kernel.org/oe-kbuild-all/202312151816.munFeE4L-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202312151854.4k8dhWf6-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202312160153.ovUEsxo6-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202312160433.Oz8VJHH3-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202312161324.nZN1zCQT-lkp@intel.com

Error/Warning: (recently discovered and may have been fixed)

arch/arm/include/asm/cmpxchg.h:111:(.text+0xf6c): undefined reference to `__bad_xchg'
callback.c:(.rodata.cst4+0x18): undefined reference to `__xchg_called_with_bad_pointer'
callback.c:(.text+0x114): undefined reference to `__xchg_called_with_bad_pointer'
drivers/net/ethernet/intel/ice/ice_base.c:525:16: error: variable 'desc' has initializer but incomplete type
drivers/net/ethernet/intel/ice/ice_base.c:525:28: error: storage size of 'desc' isn't known
drivers/net/ethernet/intel/ice/ice_base.c:525:28: warning: unused variable 'desc' [-Wunused-variable]
fs/bcachefs/btree_iter.c:3090:36: sparse:    struct btree_path *
fs/bcachefs/btree_iter.c:3090:36: sparse:    struct btree_path [noderef] __rcu *
fs/bcachefs/btree_locking.c:309:36: sparse:    struct btree_path *
fs/bcachefs/btree_locking.c:309:36: sparse:    struct btree_path [noderef] __rcu *
include/asm-generic/cmpxchg.h:76:(.text+0x1d0): relocation truncated to fit: R_NIOS2_CALL26 against `__generic_xchg_called_with_bad_pointer'
include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_38' declared with attribute error: Unsupported size for __xchg_relaxed
io.c:(.text+0x6): relocation truncated to fit: R_CKCORE_PCREL_IMM16BY4 against `__jump_table'
m68k-linux-ld: callback.c:(.text+0x228): undefined reference to `__invalid_xchg_size'
mm/ksm.c:344:13: warning: 'set_advisor_defaults' defined but not used [-Wunused-function]
rotate.c:(.rodata.cst4+0x30): undefined reference to `__xchg_called_with_bad_pointer'
scripts/kernel-doc: drivers/spi/spi-pl022.c:397: warning: Excess struct member 'cur_msg' description in 'pl022'
scripts/kernel-doc: drivers/spi/spi-pl022.c:437: warning: Excess function parameter 'command' description in 'internal_cs_control'
scripts/kernel-doc: drivers/spi/spi-pl022.c:437: warning: Function parameter or struct member 'enable' not described in 'internal_cs_control'

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- arc-randconfig-002-20231215
|   |-- drivers-net-ethernet-intel-ice-ice_base.c:error:storage-size-of-desc-isn-t-known
|   |-- drivers-net-ethernet-intel-ice-ice_base.c:error:variable-desc-has-initializer-but-incomplete-type
|   `-- drivers-net-ethernet-intel-ice-ice_base.c:warning:unused-variable-desc
|-- arc-randconfig-r132-20231215
|   |-- drivers-hwmon-max31827.c:sparse:sparse:dubious:x-y
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- arm-buildonly-randconfig-r002-20220918
|   `-- arch-arm-include-asm-cmpxchg.h:(.text):undefined-reference-to-__bad_xchg
|-- arm-lpc18xx_defconfig
|   |-- scripts-kernel-doc:drivers-spi-spi-pl022.c:warning:Excess-function-parameter-command-description-in-internal_cs_control
|   |-- scripts-kernel-doc:drivers-spi-spi-pl022.c:warning:Excess-struct-member-cur_msg-description-in-pl022
|   `-- scripts-kernel-doc:drivers-spi-spi-pl022.c:warning:Function-parameter-or-struct-member-enable-not-described-in-internal_cs_control
|-- csky-randconfig-001-20231215
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|-- csky-randconfig-r016-20220425
|   `-- io.c:(.text):relocation-truncated-to-fit:R_CKCORE_PCREL_IMM16BY4-against-__jump_table
|-- csky-randconfig-r113-20231215
|   |-- arch-csky-kernel-vdso-vgettimeofday.c:sparse:sparse:function-__vdso_clock_gettime-with-external-linkage-has-definition
|   |-- fs-bcachefs-btree_iter.c:sparse:sparse:incompatible-types-in-comparison-expression-(different-address-spaces):
|   |-- fs-bcachefs-btree_iter.c:sparse:struct-btree_path
|   |-- fs-bcachefs-btree_iter.c:sparse:struct-btree_path-noderef-__rcu
|   |-- fs-bcachefs-btree_locking.c:sparse:sparse:incompatible-types-in-comparison-expression-(different-address-spaces):
|   |-- fs-bcachefs-btree_locking.c:sparse:struct-btree_path
|   |-- fs-bcachefs-btree_locking.c:sparse:struct-btree_path-noderef-__rcu
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- i386-randconfig-013-20231215
|   `-- drivers-hid-hid-nintendo.c:error:initializer-element-is-not-constant
|-- loongarch-defconfig
|   `-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|-- loongarch-randconfig-001-20231215
|   `-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|-- loongarch-randconfig-002-20231215
|   `-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|-- m68k-randconfig-r012-20211002
|   `-- m68k-linux-ld:callback.c:(.text):undefined-reference-to-__invalid_xchg_size
|-- microblaze-randconfig-r121-20231215
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- microblaze-randconfig-r122-20231215
|   |-- drivers-soc-qcom-pmic_pdcharger_ulog.c:sparse:sparse:incorrect-type-in-initializer-(different-base-types)-expected-restricted-__le32-usertype-opcode-got-int
|   |-- drivers-soc-qcom-pmic_pdcharger_ulog.c:sparse:sparse:incorrect-type-in-initializer-(different-base-types)-expected-restricted-__le32-usertype-owner-got-int
|   |-- drivers-soc-qcom-pmic_pdcharger_ulog.c:sparse:sparse:incorrect-type-in-initializer-(different-base-types)-expected-restricted-__le32-usertype-type-got-int
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- mips-decstation_64_defconfig
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|-- mips-fuloong2e_defconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-base-regmap-regmap-mmio.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|-- mips-jazz_defconfig
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|   `-- cache.c:(.text):undefined-reference-to-r3k_cache_init
|-- nios2-allyesconfig
|   |-- callback.c:(.text):relocation-truncated-to-fit:R_NIOS2_CALL26-against-__generic_xchg_called_with_bad_pointer
|   `-- rotate.c:(.text):relocation-truncated-to-fit:R_NIOS2_CALL26-against-__generic_xchg_called_with_bad_pointer
|-- nios2-randconfig-r035-20230329
|   `-- include-asm-generic-cmpxchg.h:(.text):relocation-truncated-to-fit:R_NIOS2_CALL26-against-__generic_xchg_called_with_bad_pointer
|-- openrisc-randconfig-r016-20230621
|   `-- mm-ksm.c:warning:set_advisor_defaults-defined-but-not-used
|-- openrisc-randconfig-r111-20231215
|   |-- drivers-hwmon-max31827.c:sparse:sparse:dubious:x-y
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- parisc-randconfig-001-20231215
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|-- parisc-randconfig-r015-20220820
|   |-- callback.c:(.rodata.cst4):undefined-reference-to-__xchg_called_with_bad_pointer
|   `-- rotate.c:(.rodata.cst4):undefined-reference-to-__xchg_called_with_bad_pointer
|-- powerpc-randconfig-c003-20220424
|   `-- include-linux-compiler_types.h:error:call-to-__compiletime_assert_NNN-declared-with-attribute-error:Unsupported-size-for-__xchg_relaxed
|-- s390-randconfig-r133-20231215
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|   |-- drivers-hwmon-max31827.c:sparse:sparse:dubious:x-y
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- sparc-allmodconfig
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   `-- arch-sparc-mm-init_64.c:warning:variable-hv_pgsz_idx-set-but-not-used
|-- sparc-allnoconfig
|   |-- arch-sparc-mm-leon_mm.c:warning:variable-paddrbase-set-but-not-used
|   `-- arch-sparc-mm-srmmu.c:warning:variable-clear-set-but-not-used
|-- sparc-defconfig
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   |-- arch-sparc-mm-leon_mm.c:warning:variable-paddrbase-set-but-not-used
|   `-- arch-sparc-mm-srmmu.c:warning:variable-clear-set-but-not-used
|-- sparc-randconfig-001-20231215
|   |-- (.head.text):relocation-truncated-to-fit:R_SPARC_WDISP22-against-init.text
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   |-- arch-sparc-mm-leon_mm.c:warning:variable-paddrbase-set-but-not-used
|   `-- arch-sparc-mm-srmmu.c:warning:variable-clear-set-but-not-used
|-- sparc-randconfig-002-20231215
|   |-- (.head.text):relocation-truncated-to-fit:R_SPARC_WDISP22-against-init.text
|   |-- arch-sparc-mm-leon_mm.c:warning:variable-paddrbase-set-but-not-used
|   |-- arch-sparc-mm-srmmu.c:warning:variable-clear-set-but-not-used
|   |-- parport_pc.c:(.text):undefined-reference-to-ebus_dma_enable
|   |-- parport_pc.c:(.text):undefined-reference-to-ebus_dma_irq_enable
|   |-- parport_pc.c:(.text):undefined-reference-to-ebus_dma_register
|   |-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_enable
|   |-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_irq_enable
|   |-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_prepare
|   |-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_request
|   |-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_residue
|   `-- sparc-linux-ld:parport_pc.c:(.text):undefined-reference-to-ebus_dma_unregister
|-- sparc64-allmodconfig
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   `-- arch-sparc-mm-init_64.c:warning:variable-hv_pgsz_idx-set-but-not-used
|-- sparc64-allyesconfig
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   `-- arch-sparc-mm-init_64.c:warning:variable-hv_pgsz_idx-set-but-not-used
|-- sparc64-defconfig
|   |-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|   `-- arch-sparc-mm-init_64.c:warning:variable-hv_pgsz_idx-set-but-not-used
|-- sparc64-randconfig-001-20231215
|   `-- arch-sparc-mm-init_64.c:warning:variable-hv_pgsz_idx-set-but-not-used
|-- sparc64-randconfig-002-20231215
|   `-- arch-sparc-mm-init_64.c:warning:variable-pagecv_flag-set-but-not-used
|-- sparc64-randconfig-r062-20231215
|   `-- arch-sparc-kernel-module.c:warning:variable-strtab-set-but-not-used
|-- x86_64-allnoconfig
|   `-- Warning:MAINTAINERS-references-a-file-that-doesn-t-exist:Documentation-devicetree-bindings-display-panel-synaptics-r63353.yaml
|-- x86_64-randconfig-001-20231215
|   `-- drivers-hid-hid-nintendo.c:error:initializer-element-is-not-constant
|-- x86_64-randconfig-r131-20231215
|   |-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|   `-- drivers-hwmon-max31827.c:sparse:sparse:dubious:x-y
`-- xtensa-randconfig-c024-20220216
    `-- callback.c:(.text):undefined-reference-to-__xchg_called_with_bad_pointer
clang_recent_errors
|-- arm-defconfig
|   |-- WARNING:modpost:vmlinux:section-mismatch-in-reference:at91_poweroff_probe-(section:.text)-at91_wakeup_status-(section:.init.text)
|   `-- WARNING:modpost:vmlinux:section-mismatch-in-reference:at91_shdwc_probe-(section:.text)-at91_wakeup_status-(section:.init.text)
|-- arm64-allmodconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- arm64-allyesconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- hexagon-allmodconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- hexagon-allyesconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- i386-allmodconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- i386-buildonly-randconfig-006-20231215
|   |-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-drivers-base-regmap-regmap-mmio.o
|   `-- WARNING:modpost:missing-MODULE_DESCRIPTION()-in-lib-zlib_inflate-zlib_inflate.o
|-- i386-randconfig-063-20231215
|   |-- fs-afs-main.c:sparse:sparse:cast-removes-address-space-__rcu-of-expression
|   |-- fs-afs-main.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-struct-callback_head-head-got-struct-callback_head-noderef-__rcu
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- powerpc-allmodconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- powerpc-allyesconfig
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- riscv-randconfig-r112-20231215
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- s390-randconfig-r123-20231215
|   |-- drivers-hwmon-max31827.c:sparse:sparse:dubious:x-y
|   `-- lib-zstd-compress-zstd_fast.c:sparse:sparse:Using-plain-integer-as-NULL-pointer
|-- x86_64-allmodconfig
|   |-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
|-- x86_64-allyesconfig
|   |-- drivers-gpu-drm-amd-amdgpu-..-display-dc-hwss-dcn35-dcn35_hwseq.c:warning:This-comment-starts-with-but-isn-t-a-kernel-doc-comment.-Refer-Documentation-doc-guide-kernel-doc.rst
|   `-- drivers-leds-leds-max5970.c:warning:variable-num_leds-set-but-not-used
`-- x86_64-randconfig-161-20231215
    |-- lib-zstd-common-bits.h-ZSTD_countLeadingZeros32()-warn:inconsistent-indenting
    |-- lib-zstd-common-bits.h-ZSTD_countTrailingZeros32()-warn:inconsistent-indenting
    |-- lib-zstd-compress-..-common-bits.h-ZSTD_countLeadingZeros32()-warn:inconsistent-indenting
    |-- lib-zstd-compress-..-common-bits.h-ZSTD_countLeadingZeros64()-warn:inconsistent-indenting
    |-- lib-zstd-compress-..-common-bits.h-ZSTD_countTrailingZeros32()-warn:inconsistent-indenting
    |-- lib-zstd-compress-..-common-bits.h-ZSTD_countTrailingZeros64()-warn:inconsistent-indenting
    |-- lib-zstd-decompress-..-common-bits.h-ZSTD_countLeadingZeros32()-warn:inconsistent-indenting
    `-- lib-zstd-decompress-..-common-bits.h-ZSTD_countTrailingZeros64()-warn:inconsistent-indenting

elapsed time: 1467m

configs tested: 166
configs skipped: 2

tested configs:
alpha                             allnoconfig   gcc  
alpha                            allyesconfig   gcc  
alpha                               defconfig   gcc  
arc                              allmodconfig   gcc  
arc                               allnoconfig   gcc  
arc                              allyesconfig   gcc  
arc                                 defconfig   gcc  
arc                            hsdk_defconfig   gcc  
arc                   randconfig-001-20231215   gcc  
arc                   randconfig-002-20231215   gcc  
arm                              allmodconfig   gcc  
arm                               allnoconfig   gcc  
arm                              allyesconfig   gcc  
arm                     am200epdkit_defconfig   clang
arm                                 defconfig   clang
arm                            dove_defconfig   clang
arm                            hisi_defconfig   gcc  
arm                            mmp2_defconfig   clang
arm                          pxa168_defconfig   clang
arm                          pxa3xx_defconfig   gcc  
arm                   randconfig-001-20231215   clang
arm                   randconfig-002-20231215   clang
arm                   randconfig-003-20231215   clang
arm                   randconfig-004-20231215   clang
arm                           stm32_defconfig   gcc  
arm64                            allmodconfig   clang
arm64                             allnoconfig   gcc  
arm64                               defconfig   gcc  
arm64                 randconfig-001-20231215   clang
arm64                 randconfig-002-20231215   clang
arm64                 randconfig-003-20231215   clang
arm64                 randconfig-004-20231215   clang
csky                             allmodconfig   gcc  
csky                              allnoconfig   gcc  
csky                             allyesconfig   gcc  
csky                                defconfig   gcc  
csky                  randconfig-001-20231215   gcc  
csky                  randconfig-002-20231215   gcc  
hexagon                          allmodconfig   clang
hexagon                           allnoconfig   clang
hexagon                          allyesconfig   clang
hexagon                             defconfig   clang
hexagon               randconfig-001-20231215   clang
hexagon               randconfig-002-20231215   clang
i386                             allmodconfig   clang
i386                              allnoconfig   clang
i386                             allyesconfig   clang
i386         buildonly-randconfig-001-20231215   clang
i386         buildonly-randconfig-002-20231215   clang
i386         buildonly-randconfig-003-20231215   clang
i386         buildonly-randconfig-004-20231215   clang
i386         buildonly-randconfig-005-20231215   clang
i386         buildonly-randconfig-006-20231215   clang
i386                                defconfig   gcc  
i386                  randconfig-001-20231215   clang
i386                  randconfig-002-20231215   clang
i386                  randconfig-003-20231215   clang
i386                  randconfig-004-20231215   clang
i386                  randconfig-005-20231215   clang
i386                  randconfig-006-20231215   clang
i386                  randconfig-011-20231215   gcc  
i386                  randconfig-012-20231215   gcc  
i386                  randconfig-013-20231215   gcc  
i386                  randconfig-014-20231215   gcc  
i386                  randconfig-015-20231215   gcc  
i386                  randconfig-016-20231215   gcc  
loongarch                        allmodconfig   gcc  
loongarch                         allnoconfig   gcc  
loongarch                           defconfig   gcc  
loongarch             randconfig-001-20231215   gcc  
loongarch             randconfig-002-20231215   gcc  
m68k                             allmodconfig   gcc  
m68k                              allnoconfig   gcc  
m68k                             allyesconfig   gcc  
m68k                          atari_defconfig   gcc  
m68k                                defconfig   gcc  
microblaze                       allmodconfig   gcc  
microblaze                        allnoconfig   gcc  
microblaze                       allyesconfig   gcc  
microblaze                          defconfig   gcc  
mips                              allnoconfig   clang
mips                             allyesconfig   gcc  
mips                  decstation_64_defconfig   gcc  
mips                      fuloong2e_defconfig   gcc  
mips                           jazz_defconfig   gcc  
mips                      malta_kvm_defconfig   clang
nios2                            allmodconfig   gcc  
nios2                             allnoconfig   gcc  
nios2                            allyesconfig   gcc  
nios2                               defconfig   gcc  
nios2                 randconfig-001-20231215   gcc  
nios2                 randconfig-002-20231215   gcc  
openrisc                          allnoconfig   gcc  
openrisc                         allyesconfig   gcc  
openrisc                            defconfig   gcc  
openrisc                  or1klitex_defconfig   gcc  
parisc                           allmodconfig   gcc  
parisc                            allnoconfig   gcc  
parisc                           allyesconfig   gcc  
parisc                              defconfig   gcc  
parisc                randconfig-001-20231215   gcc  
parisc                randconfig-002-20231215   gcc  
parisc64                            defconfig   gcc  
powerpc                          allmodconfig   clang
powerpc                           allnoconfig   gcc  
powerpc                          allyesconfig   clang
powerpc                  mpc885_ads_defconfig   clang
powerpc               randconfig-001-20231215   clang
powerpc               randconfig-002-20231215   clang
powerpc               randconfig-003-20231215   clang
powerpc64             randconfig-001-20231215   clang
powerpc64             randconfig-002-20231215   clang
powerpc64             randconfig-003-20231215   clang
riscv                            allmodconfig   gcc  
riscv                             allnoconfig   clang
riscv                            allyesconfig   gcc  
riscv                               defconfig   gcc  
riscv                 randconfig-001-20231215   clang
riscv                 randconfig-002-20231215   clang
riscv                          rv32_defconfig   clang
s390                             allmodconfig   gcc  
s390                              allnoconfig   gcc  
s390                             allyesconfig   gcc  
s390                                defconfig   gcc  
s390                  randconfig-001-20231215   gcc  
s390                  randconfig-002-20231215   gcc  
sh                               allmodconfig   gcc  
sh                                allnoconfig   gcc  
sh                               allyesconfig   gcc  
sh                                  defconfig   gcc  
sh                         ecovec24_defconfig   gcc  
sh                          lboxre2_defconfig   gcc  
sh                    randconfig-001-20231215   gcc  
sh                    randconfig-002-20231215   gcc  
sh                           se7721_defconfig   gcc  
sh                           se7750_defconfig   gcc  
sh                            shmin_defconfig   gcc  
sparc                            allmodconfig   gcc  
sparc64                          allmodconfig   gcc  
sparc64                          allyesconfig   gcc  
sparc64                             defconfig   gcc  
sparc64               randconfig-001-20231215   gcc  
sparc64               randconfig-002-20231215   gcc  
um                               allmodconfig   clang
um                                allnoconfig   clang
um                               allyesconfig   clang
um                                  defconfig   gcc  
um                             i386_defconfig   gcc  
um                    randconfig-001-20231215   clang
um                    randconfig-002-20231215   clang
um                           x86_64_defconfig   gcc  
x86_64                            allnoconfig   gcc  
x86_64                           allyesconfig   clang
x86_64       buildonly-randconfig-001-20231215   clang
x86_64       buildonly-randconfig-003-20231215   clang
x86_64       buildonly-randconfig-005-20231215   clang
x86_64                              defconfig   gcc  
x86_64                randconfig-001-20231215   gcc  
x86_64                randconfig-003-20231215   gcc  
x86_64                randconfig-004-20231215   gcc  
x86_64                randconfig-005-20231215   gcc  
x86_64                randconfig-006-20231215   gcc  
x86_64                          rhel-8.3-rust   clang
xtensa                            allnoconfig   gcc  
xtensa                randconfig-001-20231215   gcc  
xtensa                randconfig-002-20231215   gcc  

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

^ permalink raw reply

* Re: [PATCH v2 0/9] Support light color temperature and chromaticity
From: srinivas pandruvada @ 2023-12-15 17:33 UTC (permalink / raw)
  To: Linux regressions mailing list, Jonathan Cameron,
	Thomas Weißschuh
  Cc: Basavaraj Natikar, jikos, benjamin.tissoires, lars, linux-input,
	linux-iio
In-Reply-To: <d3d6fe7a-d6e1-4ea6-a8f6-2430731691b2@leemhuis.info>

On Fri, 2023-12-15 at 11:04 +0100, Linux regression tracking (Thorsten
Leemhuis) wrote:
> Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting
> for once, to make this easily accessible to everyone.
> 
> Thomas, Jonathan, was any progress made to resolve below regression?

A patch is posted
https://patchwork.kernel.org/project/linux-iio/patch/20231215160159.648963-1-srinivas.pandruvada@linux.intel.com/

Thanks,
Srinivas

> 
> Side note: vormally I would not prod you at this time of the cycle,
> but
> with the festive season coming up I thought it would be wise to ask a
> bit earlier for a status update.
> 
> Ciao, Thorsten
> 
> On 10.12.23 12:07, Jonathan Cameron wrote:
> > On Thu, 7 Dec 2023 00:39:28 +0100
> > Thomas Weißschuh <thomas@t-8ch.de> wrote:
> > > On 2023-09-19 13:40:45+0530, Basavaraj Natikar wrote:
> > > > This series adds support for light color temperature and
> > > > chromaticity.
> > [...]
> > > > Basavaraj Natikar (9):
> > > >   iio: hid-sensor-als: Use channel index to support more hub
> > > > attributes
> > > >   iio: Add channel type light color temperature
> > > >   iio: hid-sensor-als: Add light color temperature support
> > > >   HID: amd_sfh: Add support for light color temperature
> > > >   HID: amd_sfh: Add support for SFH1.1 light color temperature
> > > >   iio: Add channel type for chromaticity
> > > >   iio: hid-sensor-als: Add light chromaticity support
> > > >   HID: amd_sfh: Add light chromaticity support
> > > >   HID: amd_sfh: Add light chromaticity for SFH1.1  
> > > 
> > > This series is breaking probing of hid-sensor-als on Framework 13
> > > AMD
> > > laptops [0].
> > > The problem is that the patches require hid-sensors-als sensors
> > > to also
> > > report chromaticity and color temparature which they don't.
> > Gah.  Missed that in review.  Sorry about that and thanks for
> > digging into
> > this.
> > > 
> > > When I remove the 'if (ret < 0) return ret;' checks in
> > > als_parse_report() probing works and the illuminance/intensity
> > > channels
> > > that show up behave as expected.
> > > Unfortunately this still leaves behind a bunch of unusable
> > > channels.
> > > A nice fix would be to have something like sysfs/hwmon
> > > .is_visible()
> > > callback but that's not supported by IIO.
> > 
> > It's tricky to do because there is no simple association between
> > what is registered as channels and the resulting attribute.  We
> > could probably
> > make it work, but not a simple thing to do.
> > 
> > > 
> > > One aproach would be to detect the usable channels in
> > > als_parse_report()
> > > and then adapt the indio_dev->channels based on that information.
> > > 
> > > [0] https://bugzilla.kernel.org/show_bug.cgi?id=218223
> > 
> > Agreed that adapting the channels is the way to go.
> > Easiest option probably to set the relevant masks to 0 if the
> > chromacity and
> > temp channels aren't there + set their scan index values to -1.
> > That 'should' suppress any attributes being created.
> > Having a gap in scan indexes is common anyway so any userspace
> > should cope
> > with the timestamp being after a gap.
> > 
> > Alternatives would be to rebuild the chan_spec array to not have
> > the entries,
> > or pass in and fill in two copies of the array, picking the
> > relevant one only
> > on discovering if the temp and chromacity channels are present.
> > 
> > Jonathan
> > 
> > > 
> > > #regzbot introduced: 5f05285df691b1e82108eead7165feae238c95ef
> > > #regzbot monitor:
> > > https://bugzilla.kernel.org/show_bug.cgi?id=218223
> > > 
> > 
> > 
> > 


^ permalink raw reply

* [PATCH] Input: SoC button array: add mapping for airplane mode button
From: Werner Sembach @ 2023-12-15 17:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Christoffer Sandberg, Werner Sembach, linux-input, linux-kernel

From: Christoffer Sandberg <cs@tuxedo.de>

This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3.

While it is physically a key it behaves more like a switch, sending a key
down on first press and a key up on 2nd press. Therefor the switch event is
used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless
Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since
neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array
this not to standard behaviour is not put behind a quirk for the moment.

Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
---
 drivers/input/misc/soc_button_array.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index 08bcee3d6bcca..f6d060377d189 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
 		info->name = "power";
 		info->event_code = KEY_POWER;
 		info->wakeup = true;
+	} else if (upage == 0x01 && usage == 0xc6) {
+		info->name = "airplane mode switch";
+		info->event_type = EV_SW;
+		info->event_code = SW_RFKILL_ALL;
+		info->active_low = false;
 	} else if (upage == 0x01 && usage == 0xca) {
 		info->name = "rotation lock switch";
 		info->event_type = EV_SW;
-- 
2.34.1


^ permalink raw reply related

* Re: [PATCH] iio: light: hid-sensor-als: Avoid failure for chromaticity support
From: Thomas Weißschuh @ 2023-12-15 16:20 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: jikos, jic23, lars, Basavaraj.Natikar, linux-input, linux-iio,
	linux-kernel, stable
In-Reply-To: <20231215160159.648963-1-srinivas.pandruvada@linux.intel.com>

On 2023-12-15 08:01:59-0800, Srinivas Pandruvada wrote:
> With the commit ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity
> support"), there is an assumption that the every HID ALS descriptor has
> support of usage ids for chromaticity support. If they are not present,
> probe fails for the driver . This breaks ALS functionality on majority of
> platforms.
> 
> It is possible that chromaticity usage ids are not present. When not
> present, restrict number of IIO channels to not include support for
> chromaticity and continue.
> 
> Fixes: ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity support")
> Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/iio/light/hid-sensor-als.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)

Thanks!

Tested-by: Thomas Weißschuh <linux@weissschuh.net> # on Framework 13 AMD

^ permalink raw reply

* [PATCH v7] Fix freeze in lm8333 i2c keyboard driver
From: Tomas Mudrunka @ 2023-12-15 15:56 UTC (permalink / raw)
  To: jeff; +Cc: dmitry.torokhov, linux-input, linux-kernel, tomas.mudrunka
In-Reply-To: <ZXpnbifDOQ/eF5jb@nixie71>

LM8333 uses gpio interrupt line which is active-low.
When interrupt is set to FALLING edge and button is pressed
before driver loads, driver will miss the edge and never respond.
To fix this we should handle ONESHOT LOW interrupt rather than edge.

Rather than hardcoding this, we simply remove the override from
driver by calling request_threaded_irq() without specifying trigger.
This will keep interrupt trigger configuration as per devicetree. eg.:

	lm8333@51 {
		compatible = "ti,lm8333";
		interrupt-parent = <&gpio1>;
		interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
		...
	}

Signed-off-by: Tomas Mudrunka <tomas.mudrunka@gmail.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
---
 drivers/input/keyboard/lm8333.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index 7457c3220..c5770ebb2 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -179,7 +179,7 @@ static int lm8333_probe(struct i2c_client *client)
 	}
 
 	err = request_threaded_irq(client->irq, NULL, lm8333_irq_thread,
-				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+				   IRQF_ONESHOT,
 				   "lm8333", lm8333);
 	if (err)
 		goto free_mem;
-- 
2.40.0

^ permalink raw reply related

* [PATCH] iio: light: hid-sensor-als: Avoid failure for chromaticity support
From: Srinivas Pandruvada @ 2023-12-15 16:01 UTC (permalink / raw)
  To: jikos, jic23, lars, Basavaraj.Natikar
  Cc: linux-input, linux-iio, linux-kernel, Srinivas Pandruvada,
	Thomas Weißschuh, stable

With the commit ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity
support"), there is an assumption that the every HID ALS descriptor has
support of usage ids for chromaticity support. If they are not present,
probe fails for the driver . This breaks ALS functionality on majority of
platforms.

It is possible that chromaticity usage ids are not present. When not
present, restrict number of IIO channels to not include support for
chromaticity and continue.

Fixes: ee3710f39f9d ("iio: hid-sensor-als: Add light chromaticity support")
Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: stable@vger.kernel.org
---
 drivers/iio/light/hid-sensor-als.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index f17304b54468..9941b0b927c7 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -303,11 +303,14 @@ static int als_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
 				unsigned usage_id,
-				struct als_state *st)
+				struct als_state *st,
+				int *max_channels)
 {
 	int ret;
 	int i;
 
+	*max_channels = CHANNEL_SCAN_INDEX_MAX;
+
 	for (i = 0; i <= CHANNEL_SCAN_INDEX_ILLUM; ++i) {
 		ret = sensor_hub_input_get_attribute_info(hsdev,
 						HID_INPUT_REPORT,
@@ -326,8 +329,12 @@ static int als_parse_report(struct platform_device *pdev,
 				usage_id,
 				HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
 				&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
-	if (ret < 0)
-		return ret;
+	if (ret < 0) {
+		*max_channels = CHANNEL_SCAN_INDEX_ILLUM;
+		ret = 0;
+		goto skip_color_chromaticity;
+	}
+
 	als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
 				st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
 
@@ -354,6 +361,7 @@ static int als_parse_report(struct platform_device *pdev,
 			st->als[next_scan_index].report_id);
 	}
 
+skip_color_chromaticity:
 	st->scale_precision = hid_sensor_format_scale(usage_id,
 				&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
 				&st->scale_pre_decml, &st->scale_post_decml);
@@ -364,7 +372,7 @@ static int als_parse_report(struct platform_device *pdev,
 /* Function to initialize the processing for usage id */
 static int hid_als_probe(struct platform_device *pdev)
 {
-	int ret = 0;
+	int ret = 0, max_channels;
 	static const char *name = "als";
 	struct iio_dev *indio_dev;
 	struct als_state *als_state;
@@ -398,15 +406,15 @@ static int hid_als_probe(struct platform_device *pdev)
 
 	ret = als_parse_report(pdev, hsdev,
 			       (struct iio_chan_spec *)indio_dev->channels,
-			       hsdev->usage,
-			       als_state);
+			       hsdev->usage, als_state, &max_channels);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to setup attributes\n");
 		return ret;
 	}
 
-	indio_dev->num_channels =
-				ARRAY_SIZE(als_channels);
+	/* +1 to include time stamp */
+	indio_dev->num_channels = max_channels + 1;
+
 	indio_dev->info = &als_info;
 	indio_dev->name = name;
 	indio_dev->modes = INDIO_DIRECT_MODE;
-- 
2.25.1


^ permalink raw reply related

* Re: [RFC] dt-bindings: input: Clarify that abs_min must be less than abs_max
From: Artur Rojek @ 2023-12-15 11:19 UTC (permalink / raw)
  To: Chris Morgan
  Cc: linux-input, devicetree, conor+dt, krzysztof.kozlowski+dt,
	robh+dt, dmitry.torokhov, Chris Morgan, Paul Cercueil
In-Reply-To: <20231215024022.122022-1-macroalpha82@gmail.com>

On 2023-12-15 03:40, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> uinput refuses to work with abs devices where the min value is greater
> than the max value. uinput_validate_absinfo() returns -EINVAL if this
> is the case and prevents using uinput on such a device. Since uinput
> has worked this way since at least kernel 2.6 (or prior) I presume that
> this is the correct way of doing things, and that this documentation
> needs to be clarified that min must always be less than max.
> 
> uinput is used in my use case to bind together adc-joystick devices
> with gpio-keys devices to create a single unified gamepad for
> userspace.
> 
> Note that there are several boards that will need to be corrected,
> all but a few of them I maintain. Submitting as an RFC for now to get
> comments from the input team and the original author in case there is
> something I am missing.
> 
> Fixes: 7956b0d4694f ("dt-bindings: input: Add docs for ADC driven 
> joystick")
> 
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>  Documentation/devicetree/bindings/input/adc-joystick.yaml | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/adc-joystick.yaml
> b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> index 6c244d66f8ce..8f5cdd5ef190 100644
> --- a/Documentation/devicetree/bindings/input/adc-joystick.yaml
> +++ b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> @@ -73,8 +73,9 @@ patternProperties:
>          description: >
>            Minimum and maximum values produced by the axis.
>            For an ABS_X axis this will be the left-most and right-most
> -          inclination of the joystick. If min > max, it is left to 
> userspace to
> -          treat the axis as inverted.
> +          inclination of the joystick. The axis must always be 
> expressed as
> +          min < max, if the axis is inverted it is left to userspace 
> to handle
> +          the inversion.

Hi Chris,

Device Tree is supposed to depict the actual state of the hardware.
I worded the adc-joytick's adc-range property specifically, so that it
covers a case of GCW Zero hardware [1], which has a joystick,  where the
ABS_X axis reports increasing values for the left-wards inclination of
the joystick, and decreasing values for the right-wards inclination. You
are saying that there are even more boards that need to be corrected -
those are all situations, where DT depicts the actual behavior of the
hardware.
What you are trying to do is change hardware description, because of how
a driver in an OS works. You should instead fix behavior of said driver,
even if nobody stumbled upon that issue since 2.6 :) We fixed libSDL [2]
for the same reason.

Cheers,
Artur

PS. cc'd Paul to the conversation.

[1] 
https://github.com/OpenDingux/linux/blob/jz-6.1/arch/mips/boot/dts/ingenic/gcw0.dts#L273C12-L273C12
[2] https://github.com/libsdl-org/SDL-1.2/commit/46806790ad043

>            This property is interpreted as two signed 32 bit values.
> 
>        abs-fuzz:


^ permalink raw reply

* Re: [PATCH v2 0/9] Support light color temperature and chromaticity
From: Linux regression tracking (Thorsten Leemhuis) @ 2023-12-15 10:04 UTC (permalink / raw)
  To: Jonathan Cameron, Thomas Weißschuh
  Cc: Basavaraj Natikar, jikos, benjamin.tissoires, lars,
	srinivas.pandruvada, linux-input, linux-iio, regressions
In-Reply-To: <20231210110735.52f8dc53@jic23-huawei>

Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting
for once, to make this easily accessible to everyone.

Thomas, Jonathan, was any progress made to resolve below regression?

Side note: vormally I would not prod you at this time of the cycle, but
with the festive season coming up I thought it would be wise to ask a
bit earlier for a status update.

Ciao, Thorsten

On 10.12.23 12:07, Jonathan Cameron wrote:
> On Thu, 7 Dec 2023 00:39:28 +0100
> Thomas Weißschuh <thomas@t-8ch.de> wrote:
>> On 2023-09-19 13:40:45+0530, Basavaraj Natikar wrote:
>>> This series adds support for light color temperature and chromaticity.
>[...]
>>> Basavaraj Natikar (9):
>>>   iio: hid-sensor-als: Use channel index to support more hub attributes
>>>   iio: Add channel type light color temperature
>>>   iio: hid-sensor-als: Add light color temperature support
>>>   HID: amd_sfh: Add support for light color temperature
>>>   HID: amd_sfh: Add support for SFH1.1 light color temperature
>>>   iio: Add channel type for chromaticity
>>>   iio: hid-sensor-als: Add light chromaticity support
>>>   HID: amd_sfh: Add light chromaticity support
>>>   HID: amd_sfh: Add light chromaticity for SFH1.1  
>>
>> This series is breaking probing of hid-sensor-als on Framework 13 AMD
>> laptops [0].
>> The problem is that the patches require hid-sensors-als sensors to also
>> report chromaticity and color temparature which they don't.
> Gah.  Missed that in review.  Sorry about that and thanks for digging into
> this.
>>
>> When I remove the 'if (ret < 0) return ret;' checks in
>> als_parse_report() probing works and the illuminance/intensity channels
>> that show up behave as expected.
>> Unfortunately this still leaves behind a bunch of unusable channels.
>> A nice fix would be to have something like sysfs/hwmon .is_visible()
>> callback but that's not supported by IIO.
> 
> It's tricky to do because there is no simple association between
> what is registered as channels and the resulting attribute.  We could probably
> make it work, but not a simple thing to do.
> 
>>
>> One aproach would be to detect the usable channels in als_parse_report()
>> and then adapt the indio_dev->channels based on that information.
>>
>> [0] https://bugzilla.kernel.org/show_bug.cgi?id=218223
> 
> Agreed that adapting the channels is the way to go.
> Easiest option probably to set the relevant masks to 0 if the chromacity and
> temp channels aren't there + set their scan index values to -1.
> That 'should' suppress any attributes being created.
> Having a gap in scan indexes is common anyway so any userspace should cope
> with the timestamp being after a gap.
> 
> Alternatives would be to rebuild the chan_spec array to not have the entries,
> or pass in and fill in two copies of the array, picking the relevant one only
> on discovering if the temp and chromacity channels are present.
> 
> Jonathan
> 
>>
>> #regzbot introduced: 5f05285df691b1e82108eead7165feae238c95ef
>> #regzbot monitor: https://bugzilla.kernel.org/show_bug.cgi?id=218223
>>
> 
> 
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox