* [PATCH resend 2] Input: gpio-keys - convert to dev_err_probe()
From: Geert Uytterhoeven @ 2023-07-17 13:27 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Geert Uytterhoeven
Use the dev_err_probe() helper, instead of open-coding the same
operation.
While at it, invert the error checking logic to simplify code flow.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/input/keyboard/gpio_keys.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 20250b072a7a01c5..7e8342ef7a79b17f 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -523,18 +523,15 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
NULL, GPIOD_IN, desc);
if (IS_ERR(bdata->gpiod)) {
error = PTR_ERR(bdata->gpiod);
- if (error == -ENOENT) {
- /*
- * GPIO is optional, we may be dealing with
- * purely interrupt-driven setup.
- */
- bdata->gpiod = NULL;
- } else {
- if (error != -EPROBE_DEFER)
- dev_err(dev, "failed to get gpio: %d\n",
- error);
- return error;
- }
+ if (error != -ENOENT)
+ return dev_err_probe(dev, error,
+ "failed to get gpio\n");
+
+ /*
+ * GPIO is optional, we may be dealing with
+ * purely interrupt-driven setup.
+ */
+ bdata->gpiod = NULL;
}
} else if (gpio_is_valid(button->gpio)) {
/*
--
2.34.1
^ permalink raw reply related
* [PATCH v2 2/2] Input: exc3000 - Drop enum eeti_dev_id and split exc3000_info[]
From: Biju Das @ 2023-07-17 13:17 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Biju Das, Andreas Helbech Kleist, Uwe Kleine-König,
Geert Uytterhoeven, Mike Looijmans, linux-input,
Prabhakar Mahadev Lad, linux-renesas-soc
In-Reply-To: <20230717131756.240645-1-biju.das.jz@bp.renesas.com>
Drop enum eeti_dev_id and split the array exc3000_info[] as individual
variables, and make lines shorter by referring to e.g. &exc3000_info
instead of &exc3000_info[EETI_EXC3000].
Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
* New patch.
---
drivers/input/touchscreen/exc3000.c | 42 +++++++++++++----------------
1 file changed, 18 insertions(+), 24 deletions(-)
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 8b65b4e2aa50..b124a64f8164 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -47,25 +47,19 @@ struct eeti_dev_info {
int max_xy;
};
-enum eeti_dev_id {
- EETI_EXC3000,
- EETI_EXC80H60,
- EETI_EXC80H84,
+static const struct eeti_dev_info exc3000_info = {
+ .name = "EETI EXC3000 Touch Screen",
+ .max_xy = SZ_4K - 1
};
-static struct eeti_dev_info exc3000_info[] = {
- [EETI_EXC3000] = {
- .name = "EETI EXC3000 Touch Screen",
- .max_xy = SZ_4K - 1,
- },
- [EETI_EXC80H60] = {
- .name = "EETI EXC80H60 Touch Screen",
- .max_xy = SZ_16K - 1,
- },
- [EETI_EXC80H84] = {
- .name = "EETI EXC80H84 Touch Screen",
- .max_xy = SZ_16K - 1,
- },
+static const struct eeti_dev_info exc80h60_info = {
+ .name = "EETI EXC80H60 Touch Screen",
+ .max_xy = SZ_16K - 1
+};
+
+static const struct eeti_dev_info exc80h84_info = {
+ .name = "EETI EXC80H84 Touch Screen",
+ .max_xy = SZ_16K - 1
};
struct exc3000_data {
@@ -441,18 +435,18 @@ static int exc3000_probe(struct i2c_client *client)
}
static const struct i2c_device_id exc3000_id[] = {
- { "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
- { "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
- { "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
+ { "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info },
+ { "exc80h60", .driver_data = (kernel_ulong_t)&exc80h60_info },
+ { "exc80h84", .driver_data = (kernel_ulong_t)&exc80h84_info },
{ }
};
MODULE_DEVICE_TABLE(i2c, exc3000_id);
#ifdef CONFIG_OF
static const struct of_device_id exc3000_of_match[] = {
- { .compatible = "eeti,exc3000", .data = &exc3000_info[EETI_EXC3000] },
- { .compatible = "eeti,exc80h60", .data = &exc3000_info[EETI_EXC80H60] },
- { .compatible = "eeti,exc80h84", .data = &exc3000_info[EETI_EXC80H84] },
+ { .compatible = "eeti,exc3000", .data = &exc3000_info },
+ { .compatible = "eeti,exc80h60", .data = &exc80h60_info },
+ { .compatible = "eeti,exc80h84", .data = &exc80h84_info },
{ }
};
MODULE_DEVICE_TABLE(of, exc3000_of_match);
@@ -460,7 +454,7 @@ MODULE_DEVICE_TABLE(of, exc3000_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id exc3000_acpi_match[] = {
- { "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
+ { "EGA00001", .driver_data = (kernel_ulong_t)&exc80h60_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match);
--
2.25.1
^ permalink raw reply related
* [PATCH v2 1/2] Input: exc3000 - Simplify probe()
From: Biju Das @ 2023-07-17 13:17 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Biju Das, Mike Looijmans, Andreas Helbech Kleist,
Geert Uytterhoeven, Uwe Kleine-König, linux-input,
Prabhakar Mahadev Lad, linux-renesas-soc
In-Reply-To: <20230717131756.240645-1-biju.das.jz@bp.renesas.com>
The exc3000_id.driver_data could store a pointer to the info,
like for ACPI/DT-based matching, making I2C, ACPI and DT-based
matching more similar.
After that, we can simplify the probe() by replacing device_get_
match_data() and i2c_match_id() by i2c_get_match_data() as we have
similar I2C, ACPI and DT-based matching table.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v1->v2:
* Added Rb tag from Geert.
---
drivers/input/touchscreen/exc3000.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 4c0d99aae9e0..8b65b4e2aa50 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -42,8 +42,6 @@
#define EXC3000_RESET_MS 10
#define EXC3000_READY_MS 100
-static const struct i2c_device_id exc3000_id[];
-
struct eeti_dev_info {
const char *name;
int max_xy;
@@ -347,12 +345,10 @@ static int exc3000_probe(struct i2c_client *client)
return -ENOMEM;
data->client = client;
- data->info = device_get_match_data(&client->dev);
- if (!data->info) {
- enum eeti_dev_id eeti_dev_id =
- i2c_match_id(exc3000_id, client)->driver_data;
- data->info = &exc3000_info[eeti_dev_id];
- }
+ data->info = i2c_get_match_data(client);
+ if (!data->info)
+ return -ENODEV;
+
timer_setup(&data->timer, exc3000_timer, 0);
init_completion(&data->wait_event);
mutex_init(&data->query_lock);
@@ -445,9 +441,9 @@ static int exc3000_probe(struct i2c_client *client)
}
static const struct i2c_device_id exc3000_id[] = {
- { "exc3000", EETI_EXC3000 },
- { "exc80h60", EETI_EXC80H60 },
- { "exc80h84", EETI_EXC80H84 },
+ { "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
+ { "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
+ { "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
{ }
};
MODULE_DEVICE_TABLE(i2c, exc3000_id);
--
2.25.1
^ permalink raw reply related
* [PATCH v2 0/2] exc3000 driver enhancements
From: Biju Das @ 2023-07-17 13:17 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Biju Das, Andreas Helbech Kleist, Uwe Kleine-König,
Geert Uytterhoeven, Mike Looijmans, linux-input,
Prabhakar Mahadev Lad, linux-renesas-soc
This patch series is based on the code improvement work done for
rtc-isl1208 driver and is just compile tested.
Biju Das (2):
Input: exc3000 - Simplify probe()
Input: exc3000 - Drop enum eeti_dev_id and split exc3000_info[]
v1->v2:
* Added Rb tag from Geert for patch#1
* Added patch#2 for dropping enum eeti_dev_id and split the array
exc3000_info[] as individual variables, and make lines shorter by
referring to e.g. &exc3000_info instead of &exc3000_info[EETI_EXC3000].
drivers/input/touchscreen/exc3000.c | 54 ++++++++++++-----------------
1 file changed, 22 insertions(+), 32 deletions(-)
--
2.25.1
^ permalink raw reply
* Re: [PATCH] HID: hyperv: avoid struct memcpy overrun warning
From: Arnd Bergmann @ 2023-07-17 10:44 UTC (permalink / raw)
To: Andy Shevchenko, Arnd Bergmann
Cc: Jiri Kosina, Benjamin Tissoires, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Paulo Miguel Almeida, Michael Kelley (LINUX),
Dawei Li, Yang Yingliang, Thomas Weißschuh, linux-hyperv,
linux-input, linux-kernel
In-Reply-To: <ZLULjoePQaF+nSk2@smile.fi.intel.com>
On Mon, Jul 17, 2023, at 11:36, Andy Shevchenko wrote:
> On Wed, Jul 05, 2023 at 04:02:24PM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> A previous patch addressed the fortified memcpy warning for most
>> builds, but I still see this one with gcc-9:
>
> JFYI: as of today I have run Linux Next with `make W=1 allmodconfig` on x86_64
> and it seems there are still tons of similar issues which break the build.
It's a bit more complex:
- yes, there are lots of warnings for memcpy() read overflow when you
build allmodconfig kernels with W=1. I have patches for all of these and
plan to submit them over time.
- This particular one is a memcpy /write/ overflow, i.e. the
destination type overflows with the length according to gcc's
understanding of the structures. This warning is enabled even
without W=1, though it may only show up in certain configurations
or compiler versions.
Arnd
^ permalink raw reply
* Re: [PATCH] HID: hyperv: avoid struct memcpy overrun warning
From: Andy Shevchenko @ 2023-07-17 9:36 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jiri Kosina, Benjamin Tissoires, Arnd Bergmann, K. Y. Srinivasan,
Haiyang Zhang, Wei Liu, Dexuan Cui, Paulo Miguel Almeida,
Michael Kelley, Dawei Li, Yang Yingliang, Thomas Weißschuh,
linux-hyperv, linux-input, linux-kernel
In-Reply-To: <20230705140242.844167-1-arnd@kernel.org>
On Wed, Jul 05, 2023 at 04:02:24PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> A previous patch addressed the fortified memcpy warning for most
> builds, but I still see this one with gcc-9:
JFYI: as of today I have run Linux Next with `make W=1 allmodconfig` on x86_64
and it seems there are still tons of similar issues which break the build.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* RE: [PATCH] Input: exc3000 - Simplify probe()
From: Biju Das @ 2023-07-17 9:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Dmitry Torokhov, Andreas Helbech Kleist, Uwe Kleine-König,
Mike Looijmans, linux-input@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org
In-Reply-To: <CAMuHMdUSxVxuiwtbHR8OP35Hjsq34=FPfjBccVVoYQUzO6FK9Q@mail.gmail.com>
Hi Geert,
Thanks for the feedback.
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Monday, July 17, 2023 10:13 AM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>; Andreas Helbech Kleist
> <andreaskleist@gmail.com>; Uwe Kleine-König <u.kleine-
> koenig@pengutronix.de>; Mike Looijmans <mike.looijmans@topic.nl>; linux-
> input@vger.kernel.org; Geert Uytterhoeven <geert+renesas@glider.be>;
> Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; linux-
> renesas-soc@vger.kernel.org
> Subject: Re: [PATCH] Input: exc3000 - Simplify probe()
>
> Hi Biju,
>
> On Sun, Jul 16, 2023 at 8:25 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > The exc3000_id.driver_data could store a pointer to the info, like for
> > ACPI/DT-based matching, making I2C, ACPI and DT-based matching more
> > similar.
> >
> > After that, we can simplify the probe() by replacing of_device_get_
> > match_data() and i2c_match_id() by i2c_get_match_data() as we have
> > similar I2C, ACPI and DT-based matching table.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Thanks for your patch!
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> A suggestion for improvement (which can be a separate patch, as it would
> touch exc3000_of_match[]) below.
OK. exc3000_acpi_match[] as well.
>
> > ---
> > drivers/input/touchscreen/exc3000.c | 18 +++++++-----------
> > 1 file changed, 7 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/exc3000.c
> > b/drivers/input/touchscreen/exc3000.c
> > index 4c0d99aae9e0..8b65b4e2aa50 100644
> > --- a/drivers/input/touchscreen/exc3000.c
> > +++ b/drivers/input/touchscreen/exc3000.c
> > @@ -445,9 +441,9 @@ static int exc3000_probe(struct i2c_client
> > *client) }
> >
> > static const struct i2c_device_id exc3000_id[] = {
> > - { "exc3000", EETI_EXC3000 },
> > - { "exc80h60", EETI_EXC80H60 },
> > - { "exc80h84", EETI_EXC80H84 },
> > + { "exc3000", .driver_data =
> (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
> > + { "exc80h60", .driver_data =
> (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
> > + { "exc80h84", .driver_data =
> > + (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
>
> As after this the eeti_dev_id values are used only for hardcoded
> indexing inside the exc3000_info array, you can get rid of them by
> splitting the array in individual variables, shortening the lines above
> (and in exc3000_of_match[] below) in the process.
OK, will send a separate patch for splitting the array in individual variables for all match tables (OF/ACPI/I2C)
Cheers,
Biju
>
> > { }
> > };
> > MODULE_DEVICE_TABLE(i2c, exc3000_id);
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-
> m68k.org
>
> In personal conversations with technical people, I call myself a hacker.
> But when I'm talking to journalists I just say "programmer" or something
> like that.
> -- Linus Torvalds
^ permalink raw reply
* Re: [PATCH] Input: exc3000 - Simplify probe()
From: Geert Uytterhoeven @ 2023-07-17 9:13 UTC (permalink / raw)
To: Biju Das
Cc: Dmitry Torokhov, Andreas Helbech Kleist, Uwe Kleine-König,
Mike Looijmans, linux-input, Geert Uytterhoeven,
Prabhakar Mahadev Lad, linux-renesas-soc
In-Reply-To: <20230716182455.216335-1-biju.das.jz@bp.renesas.com>
Hi Biju,
On Sun, Jul 16, 2023 at 8:25 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> The exc3000_id.driver_data could store a pointer to the info,
> like for ACPI/DT-based matching, making I2C, ACPI and DT-based
> matching more similar.
>
> After that, we can simplify the probe() by replacing of_device_get_
> match_data() and i2c_match_id() by i2c_get_match_data() as we have
> similar I2C, ACPI and DT-based matching table.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Thanks for your patch!
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
A suggestion for improvement (which can be a separate patch, as it would
touch exc3000_of_match[]) below.
> ---
> drivers/input/touchscreen/exc3000.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
> index 4c0d99aae9e0..8b65b4e2aa50 100644
> --- a/drivers/input/touchscreen/exc3000.c
> +++ b/drivers/input/touchscreen/exc3000.c
> @@ -445,9 +441,9 @@ static int exc3000_probe(struct i2c_client *client)
> }
>
> static const struct i2c_device_id exc3000_id[] = {
> - { "exc3000", EETI_EXC3000 },
> - { "exc80h60", EETI_EXC80H60 },
> - { "exc80h84", EETI_EXC80H84 },
> + { "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
> + { "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
> + { "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
As after this the eeti_dev_id values are used only for hardcoded
indexing inside the exc3000_info array, you can get rid of them by
splitting the array in individual variables, shortening the lines above
(and in exc3000_of_match[] below) in the process.
> { }
> };
> MODULE_DEVICE_TABLE(i2c, exc3000_id);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH v1 1/2] dt-bindings: input: qcom,pm8xxx-vib: add more PMIC support
From: Fenglin Wu @ 2023-07-17 6:25 UTC (permalink / raw)
To: linux-arm-msm, linux-kernel, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
linux-input, devicetree
Cc: quic_collinsd, quic_subbaram, quic_fenglinw, quic_kamalw, jestar
In-Reply-To: <20230717062547.2086869-1-quic_fenglinw@quicinc.com>
Add support for vibrator module inside Qualcomm PMI632, PM7250B, PM7325B
and PM7550BA PMICs.
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
---
Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.yaml b/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.yaml
index c8832cd0d7da..642408e2b35f 100644
--- a/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.yaml
+++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.yaml
@@ -15,6 +15,10 @@ properties:
- qcom,pm8058-vib
- qcom,pm8916-vib
- qcom,pm8921-vib
+ - qcom,pmi632-vib
+ - qcom,pm7250b-vib
+ - qcom,pm7325b-vib
+ - qcom,pm7550ba-vib
reg:
maxItems: 1
--
2.25.1
^ permalink raw reply related
* [PATCH v1 2/2] Input: pm8xxx-vib - Add support for more PMICs
From: Fenglin Wu @ 2023-07-17 6:25 UTC (permalink / raw)
To: linux-arm-msm, linux-kernel, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Dmitry Torokhov, linux-input
Cc: quic_collinsd, quic_subbaram, quic_fenglinw, quic_kamalw, jestar
In-Reply-To: <20230717062547.2086869-1-quic_fenglinw@quicinc.com>
Add support for vibrator module inside PMI632, PM7250B, PM7325B and
PM7550BA. It is very similar to vibrator inside PM8xxx but just the
drive amplitude is controlled through 2 bytes registers.
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
---
drivers/input/misc/pm8xxx-vibrator.c | 49 ++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c
index 04cb87efd799..c8185514e711 100644
--- a/drivers/input/misc/pm8xxx-vibrator.c
+++ b/drivers/input/misc/pm8xxx-vibrator.c
@@ -25,6 +25,9 @@ struct pm8xxx_regs {
unsigned int drv_addr;
unsigned int drv_mask;
unsigned int drv_shift;
+ unsigned int drv_addr2;
+ unsigned int drv_mask2;
+ unsigned int drv_shift2;
unsigned int drv_en_manual_mask;
};
@@ -44,6 +47,42 @@ static struct pm8xxx_regs pm8916_regs = {
.drv_en_manual_mask = 0,
};
+static struct pm8xxx_regs pmi632_regs = {
+ .enable_addr = 0x5746,
+ .enable_mask = BIT(7),
+ .drv_addr = 0x5740,
+ .drv_mask = 0xff,
+ .drv_shift = 0,
+ .drv_addr2 = 0x5741,
+ .drv_mask2 = 0x0f,
+ .drv_shift2 = 8,
+ .drv_en_manual_mask = 0,
+};
+
+static struct pm8xxx_regs pm7250b_regs = {
+ .enable_addr = 0x5346,
+ .enable_mask = BIT(7),
+ .drv_addr = 0x5340,
+ .drv_mask = 0xff,
+ .drv_shift = 0,
+ .drv_addr2 = 0x5341,
+ .drv_mask2 = 0x0f,
+ .drv_shift2 = 8,
+ .drv_en_manual_mask = 0,
+};
+
+static struct pm8xxx_regs pm7325b_regs = {
+ .enable_addr = 0xdf46,
+ .enable_mask = BIT(7),
+ .drv_addr = 0xdf40,
+ .drv_mask = 0xff,
+ .drv_shift = 0,
+ .drv_addr2 = 0xdf41,
+ .drv_mask2 = 0x0f,
+ .drv_shift2 = 8,
+ .drv_en_manual_mask = 0,
+};
+
/**
* struct pm8xxx_vib - structure to hold vibrator data
* @vib_input_dev: input device supporting force feedback
@@ -87,6 +126,12 @@ static int pm8xxx_vib_set(struct pm8xxx_vib *vib, bool on)
return rc;
vib->reg_vib_drv = val;
+ if (regs->drv_addr2 != 0 && on) {
+ val = (vib->level << regs->drv_shift2) & regs->drv_mask2;
+ rc = regmap_write(vib->regmap, regs->drv_addr2, val);
+ if (rc < 0)
+ return rc;
+ }
if (regs->enable_mask)
rc = regmap_update_bits(vib->regmap, regs->enable_addr,
@@ -242,6 +287,10 @@ static const struct of_device_id pm8xxx_vib_id_table[] = {
{ .compatible = "qcom,pm8058-vib", .data = &pm8058_regs },
{ .compatible = "qcom,pm8921-vib", .data = &pm8058_regs },
{ .compatible = "qcom,pm8916-vib", .data = &pm8916_regs },
+ { .compatible = "qcom,pmi632-vib", .data = &pmi632_regs },
+ { .compatible = "qcom,pm7250b-vib", .data = &pm7250b_regs },
+ { .compatible = "qcom,pm7325b-vib", .data = &pm7325b_regs },
+ { .compatible = "qcom,pm7550ba-vib", .data = &pm7325b_regs },
{ }
};
MODULE_DEVICE_TABLE(of, pm8xxx_vib_id_table);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH v2 2/2] HID: logitech-hidpp: Add support for the Pro X Superlight
From: Bastien Nocera @ 2023-07-17 0:24 UTC (permalink / raw)
To: Mavroudis Chatzilazaridis, jikos; +Cc: linux-input, benjamin.tissoires, lains
In-Reply-To: <20230716182320.85483-2-mavchatz@protonmail.com>
On Sun, 2023-07-16 at 18:23 +0000, Mavroudis Chatzilazaridis wrote:
> This patch adds support for the Pro X Superlight over wired USB.
> The device now reports the status of its battery.
>
> Co-developed-by: Filipe Laíns <lains@riseup.net>
> Signed-off-by: Filipe Laíns <lains@riseup.net>
> Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
> ---
> V1 -> V2: Addressed review comment for commit message
>
> drivers/hid/hid-logitech-hidpp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-
> logitech-hidpp.c
> index 129b01be488d..34fc4f7b254a 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -4620,6 +4620,8 @@ static const struct hid_device_id
> hidpp_devices[] = {
> .driver_data = HIDPP_QUIRK_CLASS_G920 |
> HIDPP_QUIRK_FORCE_OUTPUT_REPORTS },
> { /* Logitech G Pro Gaming Mouse over USB */
> HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC088) },
> + { /* Logitech G Pro X Superlight Gaming Mouse over USB */
> + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC094) },
>
> { /* G935 Gaming Headset */
> HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0x0a87),
> --
> 2.34.1
>
>
^ permalink raw reply
* Re: [PATCH v2] HID: Add introduction about HID for non-kernel programmers
From: Peter Hutterer @ 2023-07-17 0:15 UTC (permalink / raw)
To: Marco Morandini
Cc: Jiri Kosina, Benjamin Tissoires, linux-input, Jonathan Corbet,
linux-doc
In-Reply-To: <2c2a03ac-cd11-7893-4b89-b88845e0f189@polimi.it>
On Thu, Jul 13, 2023 at 04:36:18PM +0200, Marco Morandini wrote:
>
> The current version is with a unique code block, and renders like this
>
> https://home.aero.polimi.it/morandini/Downloads/Screenshot_20230712_185907.png
>
> With a unique code block but a newline in between the report and the
> explanation I get
>
> https://home.aero.polimi.it/morandini/Downloads/Screenshot_20230712_190335.png
>
> that I find somewhat more dispersive.
>
> If I interpose multiple code blocks and explanations (as text) unfortunately
> spynx add a colon at the end of every paragraph, as if the text was the explanation of the
> code block below, and not above:
>
> https://home.aero.polimi.it/morandini/Downloads/Screenshot_20230712_190656.png
>
> I've not understood how to get rid of that colon, and I would prefer to leave the
> explanation _after_ the corresponding code block, and not move it before.
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#literal-blocks
This suggests that if you write it as "what follows is a button ::"
(i.e. space before ::) that should render it without a colon.
[...]
> >> +This Report Descriptor tells us that the mouse input will be
> >> +transmitted using four bytes: the first one for the buttons (three
> >> +bits used, five for padding), the last three for the mouse X, Y and
> >> +wheel changes, respectively.
> >
> > I wonder if here we should mention something like:
> > "This particular device only has one HID report so it may (and does)
> > omit the Report ID. Devices that can send multiple different HID reports
> > must send the Report ID as the first byte of each report."
>
> The problem is that, with the current document structure,
> Report IDs are introduced later, in section
> "Collections, Report IDs and Evdev events".
> There we have the sentence "A device with only one supporteHID report
> (like the mouse example above) may omit the report ID."
>
> Before that section the reader does not know what
> a Report ID is.
>
> Thus, I could add the sentence you are suggesting, but
> changing it into something like
>
> This particular device only has one HID report so it may (and does)
> omit the Report ID (see Section "Collections, Report IDs and Evdev events").
> Devices that can send multiple different HID reports
> must send the Report ID as the first byte of each report.
>
> I don't know whether we are clarifying of confusing the matter,
> and I propose to leave things as they are now.
sure, that's fine
Cheers,
Peter
^ permalink raw reply
* Re: [PATCH v4] HID: hid-google-stadiaff: add support for Stadia force feedback
From: Rahul Rameshbabu @ 2023-07-16 22:11 UTC (permalink / raw)
To: Fabio Baltieri; +Cc: Benjamin Tissoires, Jiri Kosina, linux-input, linux-kernel
In-Reply-To: <20230716204834.2879106-1-fabiobaltieri@chromium.org>
On Sun, 16 Jul, 2023 20:48:34 +0000 Fabio Baltieri <fabiobaltieri@chromium.org> wrote:
> Add a hid-google-stadiaff module to support rumble based force feedback
> on the Google Stadia controller. This works using the HID output
> endpoint exposed on both the USB and BLE interface.
>
> Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
> ---
>
> Hi, this adds rumble support to the stadia controller using the input
> interface. Up to now this has only been implemented at application level
> using hidraw:
>
> https://source.chromium.org/chromium/chromium/src/+/main:device/gamepad/hid_haptic_gamepad.cc
>
> Tested with fftest, works both over USB and BLE.
>
> Changes from v3:
> - fixed an unintended use of dev_err instead of hid_err
> - fixed the driver name reference in the commit message
> - rebased so the change in hid-ids.h applies cleanly
>
> Changes from v2:
> - check stadiaff_init value at probe time and fail the probe if init
> fails
>
> Changes from v1:
> - renamed the module to hid-google-stadiaff.c
> - added locking for passing the state to the worker code
> - added a module removed check to prevent the work from rescheduling
>
> drivers/hid/Kconfig | 7 ++
> drivers/hid/Makefile | 1 +
> drivers/hid/hid-google-stadiaff.c | 158 ++++++++++++++++++++++++++++++
> drivers/hid/hid-ids.h | 1 +
> 4 files changed, 167 insertions(+)
> create mode 100644 drivers/hid/hid-google-stadiaff.c
>
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index e11c1c803676..545e81c8f359 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -412,6 +412,13 @@ config HID_GOOGLE_HAMMER
> help
> Say Y here if you have a Google Hammer device.
>
> +config HID_GOOGLE_STADIA_FF
> + tristate "Google Stadia force feedback"
> + select INPUT_FF_MEMLESS
> + help
> + Say Y here if you want to enable force feedback support for the Google
> + Stadia controller.
> +
> config HID_VIVALDI
> tristate "Vivaldi Keyboard"
> select HID_VIVALDI_COMMON
> diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> index 7a9e160158f7..8a06d0f840bc 100644
> --- a/drivers/hid/Makefile
> +++ b/drivers/hid/Makefile
> @@ -55,6 +55,7 @@ obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
> obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
> obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
> obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
> +obj-$(CONFIG_HID_GOOGLE_STADIA_FF) += hid-google-stadiaff.o
> obj-$(CONFIG_HID_VIVALDI) += hid-vivaldi.o
> obj-$(CONFIG_HID_GT683R) += hid-gt683r.o
> obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
> diff --git a/drivers/hid/hid-google-stadiaff.c b/drivers/hid/hid-google-stadiaff.c
> new file mode 100644
> index 000000000000..3731575562ab
> --- /dev/null
> +++ b/drivers/hid/hid-google-stadiaff.c
> @@ -0,0 +1,158 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Stadia controller rumble support.
> + *
> + * Copyright 2023 Google LLC
> + */
> +
> +#include <linux/hid.h>
> +#include <linux/input.h>
> +#include <linux/slab.h>
> +#include <linux/module.h>
> +
> +#include "hid-ids.h"
> +
> +#define STADIA_FF_REPORT_ID 5
> +
> +struct stadiaff_device {
> + struct hid_device *hid;
> + struct hid_report *report;
> + spinlock_t lock;
> + bool removed;
> + uint16_t strong_magnitude;
> + uint16_t weak_magnitude;
> + struct work_struct work;
> +};
> +
> +static void stadiaff_work(struct work_struct *work)
> +{
> + struct stadiaff_device *stadiaff =
> + container_of(work, struct stadiaff_device, work);
> + struct hid_field *rumble_field = stadiaff->report->field[0];
> + unsigned long flags;
> +
> + spin_lock_irqsave(&stadiaff->lock, flags);
> + rumble_field->value[0] = stadiaff->strong_magnitude;
> + rumble_field->value[1] = stadiaff->weak_magnitude;
> + spin_unlock_irqrestore(&stadiaff->lock, flags);
> +
> + hid_hw_request(stadiaff->hid, stadiaff->report, HID_REQ_SET_REPORT);
> +}
> +
> +static int stadiaff_play(struct input_dev *dev, void *data,
> + struct ff_effect *effect)
> +{
> + struct hid_device *hid = input_get_drvdata(dev);
> + struct stadiaff_device *stadiaff = hid_get_drvdata(hid);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&stadiaff->lock, flags);
> + if (!stadiaff->removed) {
> + stadiaff->strong_magnitude = effect->u.rumble.strong_magnitude;
> + stadiaff->weak_magnitude = effect->u.rumble.weak_magnitude;
> + schedule_work(&stadiaff->work);
> + }
> + spin_unlock_irqrestore(&stadiaff->lock, flags);
> +
> + return 0;
> +}
> +
> +static int stadiaff_init(struct hid_device *hid)
> +{
> + struct stadiaff_device *stadiaff;
> + struct hid_report *report;
> + struct hid_input *hidinput;
> + struct input_dev *dev;
> + int error;
> +
> + if (list_empty(&hid->inputs)) {
> + hid_err(hid, "no inputs found\n");
> + return -ENODEV;
> + }
> + hidinput = list_entry(hid->inputs.next, struct hid_input, list);
> + dev = hidinput->input;
> +
> + report = hid_validate_values(hid, HID_OUTPUT_REPORT,
> + STADIA_FF_REPORT_ID, 0, 2);
> + if (!report)
> + return -ENODEV;
> +
> + stadiaff = devm_kzalloc(&hid->dev, sizeof(struct stadiaff_device),
> + GFP_KERNEL);
> + if (!stadiaff)
> + return -ENOMEM;
> +
> + hid_set_drvdata(hid, stadiaff);
> +
> + input_set_capability(dev, EV_FF, FF_RUMBLE);
> +
> + error = input_ff_create_memless(dev, NULL, stadiaff_play);
> + if (error)
> + return error;
> +
> + stadiaff->removed = false;
> + stadiaff->hid = hid;
> + stadiaff->report = report;
> + INIT_WORK(&stadiaff->work, stadiaff_work);
> + spin_lock_init(&stadiaff->lock);
> +
> + hid_info(hid, "Force Feedback for Google Stadia controller\n");
> +
> + return 0;
> +}
> +
> +static int stadia_probe(struct hid_device *hdev, const struct hid_device_id *id)
> +{
> + int ret;
> +
> + ret = hid_parse(hdev);
> + if (ret) {
> + hid_err(hdev, "parse failed\n");
> + return ret;
> + }
> +
> + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
> + if (ret) {
> + hid_err(hdev, "hw start failed\n");
> + return ret;
> + }
> +
> + ret = stadiaff_init(hdev);
> + if (ret) {
> + hid_err(hdev, "force feedback init failed\n");
> + hid_hw_stop(hdev);
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static void stadia_remove(struct hid_device *hid)
> +{
> + struct stadiaff_device *stadiaff = hid_get_drvdata(hid);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&stadiaff->lock, flags);
> + stadiaff->removed = true;
> + spin_unlock_irqrestore(&stadiaff->lock, flags);
> +
> + cancel_work_sync(&stadiaff->work);
> + hid_hw_stop(hid);
> +}
> +
> +static const struct hid_device_id stadia_devices[] = {
> + { HID_USB_DEVICE(USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STADIA) },
> + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STADIA) },
> + { }
> +};
> +MODULE_DEVICE_TABLE(hid, stadia_devices);
> +
> +static struct hid_driver stadia_driver = {
> + .name = "stadia",
> + .id_table = stadia_devices,
> + .probe = stadia_probe,
> + .remove = stadia_remove,
> +};
> +module_hid_driver(stadia_driver);
> +
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 8a310f8ff20f..42c43d309f98 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -531,6 +531,7 @@
> #define USB_DEVICE_ID_GOOGLE_DON 0x5050
> #define USB_DEVICE_ID_GOOGLE_EEL 0x5057
> #define USB_DEVICE_ID_GOOGLE_JEWEL 0x5061
> +#define USB_DEVICE_ID_GOOGLE_STADIA 0x9400
>
> #define USB_VENDOR_ID_GOTOP 0x08f2
> #define USB_DEVICE_ID_SUPER_Q2 0x007f
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
^ permalink raw reply
* [PATCH v4] HID: hid-google-stadiaff: add support for Stadia force feedback
From: Fabio Baltieri @ 2023-07-16 20:48 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, Rahul Rameshbabu, linux-input, linux-kernel,
Fabio Baltieri
Add a hid-google-stadiaff module to support rumble based force feedback
on the Google Stadia controller. This works using the HID output
endpoint exposed on both the USB and BLE interface.
Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
---
Hi, this adds rumble support to the stadia controller using the input
interface. Up to now this has only been implemented at application level
using hidraw:
https://source.chromium.org/chromium/chromium/src/+/main:device/gamepad/hid_haptic_gamepad.cc
Tested with fftest, works both over USB and BLE.
Changes from v3:
- fixed an unintended use of dev_err instead of hid_err
- fixed the driver name reference in the commit message
- rebased so the change in hid-ids.h applies cleanly
Changes from v2:
- check stadiaff_init value at probe time and fail the probe if init
fails
Changes from v1:
- renamed the module to hid-google-stadiaff.c
- added locking for passing the state to the worker code
- added a module removed check to prevent the work from rescheduling
drivers/hid/Kconfig | 7 ++
drivers/hid/Makefile | 1 +
drivers/hid/hid-google-stadiaff.c | 158 ++++++++++++++++++++++++++++++
drivers/hid/hid-ids.h | 1 +
4 files changed, 167 insertions(+)
create mode 100644 drivers/hid/hid-google-stadiaff.c
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index e11c1c803676..545e81c8f359 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -412,6 +412,13 @@ config HID_GOOGLE_HAMMER
help
Say Y here if you have a Google Hammer device.
+config HID_GOOGLE_STADIA_FF
+ tristate "Google Stadia force feedback"
+ select INPUT_FF_MEMLESS
+ help
+ Say Y here if you want to enable force feedback support for the Google
+ Stadia controller.
+
config HID_VIVALDI
tristate "Vivaldi Keyboard"
select HID_VIVALDI_COMMON
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 7a9e160158f7..8a06d0f840bc 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
+obj-$(CONFIG_HID_GOOGLE_STADIA_FF) += hid-google-stadiaff.o
obj-$(CONFIG_HID_VIVALDI) += hid-vivaldi.o
obj-$(CONFIG_HID_GT683R) += hid-gt683r.o
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
diff --git a/drivers/hid/hid-google-stadiaff.c b/drivers/hid/hid-google-stadiaff.c
new file mode 100644
index 000000000000..3731575562ab
--- /dev/null
+++ b/drivers/hid/hid-google-stadiaff.c
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Stadia controller rumble support.
+ *
+ * Copyright 2023 Google LLC
+ */
+
+#include <linux/hid.h>
+#include <linux/input.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+#define STADIA_FF_REPORT_ID 5
+
+struct stadiaff_device {
+ struct hid_device *hid;
+ struct hid_report *report;
+ spinlock_t lock;
+ bool removed;
+ uint16_t strong_magnitude;
+ uint16_t weak_magnitude;
+ struct work_struct work;
+};
+
+static void stadiaff_work(struct work_struct *work)
+{
+ struct stadiaff_device *stadiaff =
+ container_of(work, struct stadiaff_device, work);
+ struct hid_field *rumble_field = stadiaff->report->field[0];
+ unsigned long flags;
+
+ spin_lock_irqsave(&stadiaff->lock, flags);
+ rumble_field->value[0] = stadiaff->strong_magnitude;
+ rumble_field->value[1] = stadiaff->weak_magnitude;
+ spin_unlock_irqrestore(&stadiaff->lock, flags);
+
+ hid_hw_request(stadiaff->hid, stadiaff->report, HID_REQ_SET_REPORT);
+}
+
+static int stadiaff_play(struct input_dev *dev, void *data,
+ struct ff_effect *effect)
+{
+ struct hid_device *hid = input_get_drvdata(dev);
+ struct stadiaff_device *stadiaff = hid_get_drvdata(hid);
+ unsigned long flags;
+
+ spin_lock_irqsave(&stadiaff->lock, flags);
+ if (!stadiaff->removed) {
+ stadiaff->strong_magnitude = effect->u.rumble.strong_magnitude;
+ stadiaff->weak_magnitude = effect->u.rumble.weak_magnitude;
+ schedule_work(&stadiaff->work);
+ }
+ spin_unlock_irqrestore(&stadiaff->lock, flags);
+
+ return 0;
+}
+
+static int stadiaff_init(struct hid_device *hid)
+{
+ struct stadiaff_device *stadiaff;
+ struct hid_report *report;
+ struct hid_input *hidinput;
+ struct input_dev *dev;
+ int error;
+
+ if (list_empty(&hid->inputs)) {
+ hid_err(hid, "no inputs found\n");
+ return -ENODEV;
+ }
+ hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+ dev = hidinput->input;
+
+ report = hid_validate_values(hid, HID_OUTPUT_REPORT,
+ STADIA_FF_REPORT_ID, 0, 2);
+ if (!report)
+ return -ENODEV;
+
+ stadiaff = devm_kzalloc(&hid->dev, sizeof(struct stadiaff_device),
+ GFP_KERNEL);
+ if (!stadiaff)
+ return -ENOMEM;
+
+ hid_set_drvdata(hid, stadiaff);
+
+ input_set_capability(dev, EV_FF, FF_RUMBLE);
+
+ error = input_ff_create_memless(dev, NULL, stadiaff_play);
+ if (error)
+ return error;
+
+ stadiaff->removed = false;
+ stadiaff->hid = hid;
+ stadiaff->report = report;
+ INIT_WORK(&stadiaff->work, stadiaff_work);
+ spin_lock_init(&stadiaff->lock);
+
+ hid_info(hid, "Force Feedback for Google Stadia controller\n");
+
+ return 0;
+}
+
+static int stadia_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+ int ret;
+
+ ret = hid_parse(hdev);
+ if (ret) {
+ hid_err(hdev, "parse failed\n");
+ return ret;
+ }
+
+ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
+ if (ret) {
+ hid_err(hdev, "hw start failed\n");
+ return ret;
+ }
+
+ ret = stadiaff_init(hdev);
+ if (ret) {
+ hid_err(hdev, "force feedback init failed\n");
+ hid_hw_stop(hdev);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void stadia_remove(struct hid_device *hid)
+{
+ struct stadiaff_device *stadiaff = hid_get_drvdata(hid);
+ unsigned long flags;
+
+ spin_lock_irqsave(&stadiaff->lock, flags);
+ stadiaff->removed = true;
+ spin_unlock_irqrestore(&stadiaff->lock, flags);
+
+ cancel_work_sync(&stadiaff->work);
+ hid_hw_stop(hid);
+}
+
+static const struct hid_device_id stadia_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STADIA) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STADIA) },
+ { }
+};
+MODULE_DEVICE_TABLE(hid, stadia_devices);
+
+static struct hid_driver stadia_driver = {
+ .name = "stadia",
+ .id_table = stadia_devices,
+ .probe = stadia_probe,
+ .remove = stadia_remove,
+};
+module_hid_driver(stadia_driver);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 8a310f8ff20f..42c43d309f98 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -531,6 +531,7 @@
#define USB_DEVICE_ID_GOOGLE_DON 0x5050
#define USB_DEVICE_ID_GOOGLE_EEL 0x5057
#define USB_DEVICE_ID_GOOGLE_JEWEL 0x5061
+#define USB_DEVICE_ID_GOOGLE_STADIA 0x9400
#define USB_VENDOR_ID_GOTOP 0x08f2
#define USB_DEVICE_ID_SUPER_Q2 0x007f
--
2.41.0.455.g037347b96a-goog
^ permalink raw reply related
* Re: [PATCH v3] HID: hid-google-stadiaff: add support for Stadia force feedback
From: Rahul Rameshbabu @ 2023-07-16 18:47 UTC (permalink / raw)
To: Fabio Baltieri; +Cc: Benjamin Tissoires, Jiri Kosina, linux-input, linux-kernel
In-Reply-To: <ZLQ5XMobES0r6Fel@google.com>
On Sun, 16 Jul, 2023 18:39:24 +0000 Fabio Baltieri <fabiobaltieri@chromium.org> wrote:
> Hi Rahul,
>
> On Fri, Jul 14, 2023 at 02:13:34PM -0700, Rahul Rameshbabu wrote:
>> On Sun, 09 Jul, 2023 21:44:10 +0000 Fabio Baltieri <fabiobaltieri@chromium.org> wrote:
>> > Add a hid-stadiaff module to support rumble based force feedback on the
>> > Google Stadia controller. This works using the HID output endpoint
>> > exposed on both the USB and BLE interface.
>> >
>> > Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
>> > ---
>> > +static int stadia_probe(struct hid_device *hdev, const struct hid_device_id *id)
>> > +{
>> > + int ret;
>> > +
>> > + ret = hid_parse(hdev);
>> > + if (ret) {
>> > + hid_err(hdev, "parse failed\n");
>> > + return ret;
>> > + }
>> > +
>> > + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
>> > + if (ret) {
>> > + hid_err(hdev, "hw start failed\n");
>> > + return ret;
>> > + }
>> > +
>> > + ret = stadiaff_init(hdev);
>> > + if (ret) {
>> > + dev_err(&hdev->dev, "force feedback init failed\n");
>>
>> Error handling looks good to me now. Is there any particular reason you
>> use dev_err here instead of hid_err here?
>
> Not really, copied from another hid driver and did not realize the
> inconsistency. I'll fix that up and send a v4.
>
> Thanks again for spotting this!
No worries. Btw, in your commit message body, you might want to change
hid-stadiaff to hid-google-stadiaff as well for your v4 submission.
Thanks,
-- Rahul Rameshbabu
^ permalink raw reply
* Re: [PATCH v3] HID: hid-google-stadiaff: add support for Stadia force feedback
From: Fabio Baltieri @ 2023-07-16 18:39 UTC (permalink / raw)
To: Rahul Rameshbabu
Cc: Benjamin Tissoires, Jiri Kosina, linux-input, linux-kernel
In-Reply-To: <878rbidwn5.fsf@nvidia.com>
Hi Rahul,
On Fri, Jul 14, 2023 at 02:13:34PM -0700, Rahul Rameshbabu wrote:
> On Sun, 09 Jul, 2023 21:44:10 +0000 Fabio Baltieri <fabiobaltieri@chromium.org> wrote:
> > Add a hid-stadiaff module to support rumble based force feedback on the
> > Google Stadia controller. This works using the HID output endpoint
> > exposed on both the USB and BLE interface.
> >
> > Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
> > ---
> > +static int stadia_probe(struct hid_device *hdev, const struct hid_device_id *id)
> > +{
> > + int ret;
> > +
> > + ret = hid_parse(hdev);
> > + if (ret) {
> > + hid_err(hdev, "parse failed\n");
> > + return ret;
> > + }
> > +
> > + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
> > + if (ret) {
> > + hid_err(hdev, "hw start failed\n");
> > + return ret;
> > + }
> > +
> > + ret = stadiaff_init(hdev);
> > + if (ret) {
> > + dev_err(&hdev->dev, "force feedback init failed\n");
>
> Error handling looks good to me now. Is there any particular reason you
> use dev_err here instead of hid_err here?
Not really, copied from another hid driver and did not realize the
inconsistency. I'll fix that up and send a v4.
Thanks again for spotting this!
Fabio
^ permalink raw reply
* [PATCH] Input: exc3000 - Simplify probe()
From: Biju Das @ 2023-07-16 18:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Biju Das, Andreas Helbech Kleist, Uwe Kleine-König,
Mike Looijmans, linux-input, Geert Uytterhoeven,
Prabhakar Mahadev Lad, linux-renesas-soc
The exc3000_id.driver_data could store a pointer to the info,
like for ACPI/DT-based matching, making I2C, ACPI and DT-based
matching more similar.
After that, we can simplify the probe() by replacing of_device_get_
match_data() and i2c_match_id() by i2c_get_match_data() as we have
similar I2C, ACPI and DT-based matching table.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/input/touchscreen/exc3000.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 4c0d99aae9e0..8b65b4e2aa50 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -42,8 +42,6 @@
#define EXC3000_RESET_MS 10
#define EXC3000_READY_MS 100
-static const struct i2c_device_id exc3000_id[];
-
struct eeti_dev_info {
const char *name;
int max_xy;
@@ -347,12 +345,10 @@ static int exc3000_probe(struct i2c_client *client)
return -ENOMEM;
data->client = client;
- data->info = device_get_match_data(&client->dev);
- if (!data->info) {
- enum eeti_dev_id eeti_dev_id =
- i2c_match_id(exc3000_id, client)->driver_data;
- data->info = &exc3000_info[eeti_dev_id];
- }
+ data->info = i2c_get_match_data(client);
+ if (!data->info)
+ return -ENODEV;
+
timer_setup(&data->timer, exc3000_timer, 0);
init_completion(&data->wait_event);
mutex_init(&data->query_lock);
@@ -445,9 +441,9 @@ static int exc3000_probe(struct i2c_client *client)
}
static const struct i2c_device_id exc3000_id[] = {
- { "exc3000", EETI_EXC3000 },
- { "exc80h60", EETI_EXC80H60 },
- { "exc80h84", EETI_EXC80H84 },
+ { "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
+ { "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
+ { "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
{ }
};
MODULE_DEVICE_TABLE(i2c, exc3000_id);
--
2.25.1
^ permalink raw reply related
* [PATCH v2 1/2] HID: logitech-dj: Add support for a new lightspeed receiver iteration
From: Mavroudis Chatzilazaridis @ 2023-07-16 18:23 UTC (permalink / raw)
To: jikos
Cc: linux-input, benjamin.tissoires, lains, hadess,
Mavroudis Chatzilazaridis
The lightspeed receiver for the Pro X Superlight uses 13 byte mouse reports
without a report id. The workaround for such cases has been adjusted to
handle these larger packets.
The device now reports the status of its battery in wireless mode and
libratbag now recognizes the device and it can be configured with Piper.
https://github.com/libratbag/libratbag/pull/1122
Co-developed-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
---
V1 -> V2: Addressed review comment for commit message
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-logitech-dj.c | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 8a310f8ff20f..7ac7debe98f1 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -866,6 +866,7 @@
#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2 0xc534
#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1 0xc539
#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_1 0xc53f
+#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_2 0xc547
#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY 0xc53a
#define USB_DEVICE_ID_SPACETRAVELLER 0xc623
#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 62180414efcc..fef67da0de53 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1692,11 +1692,12 @@ static int logi_dj_raw_event(struct hid_device *hdev,
}
/*
* Mouse-only receivers send unnumbered mouse data. The 27 MHz
- * receiver uses 6 byte packets, the nano receiver 8 bytes.
+ * receiver uses 6 byte packets, the nano receiver 8 bytes,
+ * the lightspeed receiver (Pro X Superlight) 13 bytes.
*/
if (djrcv_dev->unnumbered_application == HID_GD_MOUSE &&
- size <= 8) {
- u8 mouse_report[9];
+ size <= 13){
+ u8 mouse_report[14];
/* Prepend report id */
mouse_report[0] = REPORT_TYPE_MOUSE;
@@ -1980,6 +1981,10 @@ static const struct hid_device_id logi_dj_receivers[] = {
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_1),
.driver_data = recvr_type_gaming_hidpp},
+ { /* Logitech lightspeed receiver (0xc547) */
+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
+ USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_2),
+ .driver_data = recvr_type_gaming_hidpp},
{ /* Logitech 27 MHz HID++ 1.0 receiver (0xc513) */
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),
--
2.34.1
^ permalink raw reply related
* [PATCH v2 2/2] HID: logitech-hidpp: Add support for the Pro X Superlight
From: Mavroudis Chatzilazaridis @ 2023-07-16 18:23 UTC (permalink / raw)
To: jikos
Cc: linux-input, benjamin.tissoires, lains, hadess,
Mavroudis Chatzilazaridis
In-Reply-To: <20230716182320.85483-1-mavchatz@protonmail.com>
This patch adds support for the Pro X Superlight over wired USB.
The device now reports the status of its battery.
Co-developed-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
---
V1 -> V2: Addressed review comment for commit message
drivers/hid/hid-logitech-hidpp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 129b01be488d..34fc4f7b254a 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4620,6 +4620,8 @@ static const struct hid_device_id hidpp_devices[] = {
.driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS },
{ /* Logitech G Pro Gaming Mouse over USB */
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC088) },
+ { /* Logitech G Pro X Superlight Gaming Mouse over USB */
+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC094) },
{ /* G935 Gaming Headset */
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0x0a87),
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v4 12/18] staging: Remove flag FBINFO_FLAG_DEFAULT from fbdev drivers
From: Greg Kroah-Hartman @ 2023-07-16 5:39 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: deller, javierm, geert, dan.carpenter, linux-sh, dri-devel,
linux-kernel, amd-gfx, linux-input, linux-media, linux-fbdev,
linux-staging, linux-arm-kernel, linux-geode, linux-hyperv,
linux-omap, linuxppc-dev, kvm, Sam Ravnborg, Sudip Mukherjee,
Teddy Wang
In-Reply-To: <20230715185343.7193-13-tzimmermann@suse.de>
On Sat, Jul 15, 2023 at 08:51:54PM +0200, Thomas Zimmermann wrote:
> The flag FBINFO_FLAG_DEFAULT is 0 and has no effect, as struct
> fbinfo.flags has been allocated to zero by framebuffer_alloc(). So do
> not set it.
>
> Flags should signal differences from the default values. After cleaning
> up all occurrences of FBINFO_DEFAULT, the token will be removed.
>
> v2:
> * fix commit message (Miguel)
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply
* Re: [PATCH] HID: hiddev: Modify Format
From: Greg KH @ 2023-07-16 5:39 UTC (permalink / raw)
To: wuyonggang001
Cc: jikos, benjamin.tissoires, linux-usb, linux-input, linux-kernel
In-Reply-To: <755134062a3e4f74ef781cb8593b0f1e@208suo.com>
On Sun, Jul 16, 2023 at 12:11:11PM +0800, wuyonggang001@208suo.com wrote:
> Fix the following checkpatch error(s):
>
> ERROR: "inode * inode" should be "inode *inode"
> ERROR: "file * file" should be "file *file"
>
> Signed-off-by: Libing Zhang <zhanglibing@cdjrlc.com>
> ---
> drivers/hid/usbhid/hiddev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
> index 59cf3ddfdf78..581dc33197d0 100644
> --- a/drivers/hid/usbhid/hiddev.c
> +++ b/drivers/hid/usbhid/hiddev.c
> @@ -213,7 +213,7 @@ static int hiddev_fasync(int fd, struct file *file, int
> on)
> /*
> * release file op
> */
> -static int hiddev_release(struct inode * inode, struct file * file)
> +static int hiddev_release(struct inode *inode, struct file *file)
> {
> struct hiddev_list *list = file->private_data;
> unsigned long flags;
This patch is corrupted and can not be applied.
Please try working on drivers/staging/* files instead first, to give you
a chance to figure out how to do kernel development, before attempting
checkpatch changes on subsystems that might not want them.
good luck!
greg k-h
^ permalink raw reply
* [PATCH] HID: hiddev: Modify Format
From: wuyonggang001 @ 2023-07-16 4:11 UTC (permalink / raw)
To: jikos, benjamin.tissoires; +Cc: linux-usb, linux-input, linux-kernel
In-Reply-To: <20230716040716.25980-1-zhanglibing@cdjrlc.com>
Fix the following checkpatch error(s):
ERROR: "inode * inode" should be "inode *inode"
ERROR: "file * file" should be "file *file"
Signed-off-by: Libing Zhang <zhanglibing@cdjrlc.com>
---
drivers/hid/usbhid/hiddev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 59cf3ddfdf78..581dc33197d0 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -213,7 +213,7 @@ static int hiddev_fasync(int fd, struct file *file,
int on)
/*
* release file op
*/
-static int hiddev_release(struct inode * inode, struct file * file)
+static int hiddev_release(struct inode *inode, struct file *file)
{
struct hiddev_list *list = file->private_data;
unsigned long flags;
^ permalink raw reply related
* [PATCH v4 09/18] auxdisplay: Remove flag FBINFO_FLAG_DEFAULT from fbdev drivers
From: Thomas Zimmermann @ 2023-07-15 18:51 UTC (permalink / raw)
To: deller, javierm, geert, dan.carpenter
Cc: linux-sh, dri-devel, linux-kernel, amd-gfx, linux-input,
linux-media, linux-fbdev, linux-staging, linux-arm-kernel,
linux-geode, linux-hyperv, linux-omap, linuxppc-dev, kvm,
Thomas Zimmermann, Sam Ravnborg, Miguel Ojeda,
Robin van der Gracht
In-Reply-To: <20230715185343.7193-1-tzimmermann@suse.de>
The flag FBINFO_FLAG_DEFAULT is 0 and has no effect, as struct
fbinfo.flags has been allocated to zero by framebuffer_alloc(). So do
not set it.
Flags should signal differences from the default values. After cleaning
up all occurrences of FBINFO_DEFAULT, the token will be removed.
v2:
* fix commit message (Miguel)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Robin van der Gracht <robin@protonic.nl>
---
drivers/auxdisplay/cfag12864bfb.c | 1 -
drivers/auxdisplay/ht16k33.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index c2cab7e2b126..729845bcc803 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -79,7 +79,6 @@ static int cfag12864bfb_probe(struct platform_device *device)
info->var = cfag12864bfb_var;
info->pseudo_palette = NULL;
info->par = NULL;
- info->flags = FBINFO_FLAG_DEFAULT;
if (register_framebuffer(info) < 0)
goto fballoced;
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index edaf92b7ea77..df3f37651e45 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -646,7 +646,6 @@ static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *priv,
fbdev->info->var = ht16k33_fb_var;
fbdev->info->bl_dev = bl;
fbdev->info->pseudo_palette = NULL;
- fbdev->info->flags = FBINFO_FLAG_DEFAULT;
fbdev->info->par = priv;
err = register_framebuffer(fbdev->info);
--
2.41.0
^ permalink raw reply related
* [PATCH v4 08/18] sh: mach-sh7763rdp: Assign FB_MODE_IS_UNKNOWN to struct fb_videomode.flag
From: Thomas Zimmermann @ 2023-07-15 18:51 UTC (permalink / raw)
To: deller, javierm, geert, dan.carpenter
Cc: linux-sh, dri-devel, linux-kernel, amd-gfx, linux-input,
linux-media, linux-fbdev, linux-staging, linux-arm-kernel,
linux-geode, linux-hyperv, linux-omap, linuxppc-dev, kvm,
Thomas Zimmermann, Sam Ravnborg, John Paul Adrian Glaubitz,
Yoshinori Sato, Rich Felker
In-Reply-To: <20230715185343.7193-1-tzimmermann@suse.de>
Assign FB_MODE_IS_UNKNOWN to sh7763fb_videomode.flag instead of
FBINFO_FLAG_DEFAULT. Both are 0, so the stored value does not change.
FBINFO_FLAG_DEFAULT is a flag for a framebuffer in struct fb_info.
Flags for videomodes are prefixed with FB_MODE_.
v3:
* include board name in commit message (Adrian)
v2:
* assign FB_MODE_IS_UNKNOWN (Adrian)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
arch/sh/boards/mach-sh7763rdp/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index 97e715e4e9b3..e25193001ea0 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -119,7 +119,7 @@ static struct fb_videomode sh7763fb_videomode = {
.vsync_len = 1,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
- .flag = FBINFO_FLAG_DEFAULT,
+ .flag = FB_MODE_IS_UNKNOWN,
};
static struct sh7760fb_platdata sh7763fb_def_pdata = {
--
2.41.0
^ permalink raw reply related
* [PATCH v4 13/18] fbdev: Remove FBINFO_FLAG_DEFAULT from kzalloc()'ed structs
From: Thomas Zimmermann @ 2023-07-15 18:51 UTC (permalink / raw)
To: deller, javierm, geert, dan.carpenter
Cc: linux-sh, dri-devel, linux-kernel, amd-gfx, linux-input,
linux-media, linux-fbdev, linux-staging, linux-arm-kernel,
linux-geode, linux-hyperv, linux-omap, linuxppc-dev, kvm,
Thomas Zimmermann, Sam Ravnborg
In-Reply-To: <20230715185343.7193-1-tzimmermann@suse.de>
The flag FBINFO_FLAG_DEFAULT is 0 and has no effect, as struct
fbinfo.flags has been allocated to zero by kzalloc(). So do not
set it.
Flags should signal differences from the default values. After cleaning
up all occurrences of FBINFO_DEFAULT, the token will be removed.
v4:
* clarify commit message (Geert, Dan)
v2:
* fix commit message (Miguel)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Helge Deller <deller@gmx.de>
---
drivers/video/fbdev/amba-clcd.c | 1 -
drivers/video/fbdev/matrox/matroxfb_crtc2.c | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index e45338227be6..24d89e6fb780 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -461,7 +461,6 @@ static int clcdfb_register(struct clcd_fb *fb)
}
fb->fb.fbops = &clcdfb_ops;
- fb->fb.flags = FBINFO_FLAG_DEFAULT;
fb->fb.pseudo_palette = fb->cmap;
strncpy(fb->fb.fix.id, clcd_name, sizeof(fb->fb.fix.id));
diff --git a/drivers/video/fbdev/matrox/matroxfb_crtc2.c b/drivers/video/fbdev/matrox/matroxfb_crtc2.c
index 7655afa3fd50..372197c124de 100644
--- a/drivers/video/fbdev/matrox/matroxfb_crtc2.c
+++ b/drivers/video/fbdev/matrox/matroxfb_crtc2.c
@@ -603,9 +603,8 @@ static int matroxfb_dh_regit(const struct matrox_fb_info *minfo,
void* oldcrtc2;
m2info->fbcon.fbops = &matroxfb_dh_ops;
- m2info->fbcon.flags = FBINFO_FLAG_DEFAULT;
- m2info->fbcon.flags |= FBINFO_HWACCEL_XPAN |
- FBINFO_HWACCEL_YPAN;
+ m2info->fbcon.flags = FBINFO_HWACCEL_XPAN |
+ FBINFO_HWACCEL_YPAN;
m2info->fbcon.pseudo_palette = m2info->cmap;
fb_alloc_cmap(&m2info->fbcon.cmap, 256, 1);
--
2.41.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox