* [PATCH 0/5] HID: playstation: various DS4 and DualSense fixes
From: Roderick Colenbrander @ 2023-01-06 1:59 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, Roderick Colenbrander
Hi,
This patch set contains a number of small fixes and stability improvements.
The stability patches are most critical as they prevent kernel crashes.
Over the years there have been various buggy devices usually clone devices,
but now apparently some official devices with wiped calibration data.
It is hard to handle all permutations of devices as some have constants,
some have broken constants (e.g. wrong sign of a coefficient). We disable
calibration when we see an invalid 0 denominator. The patch adds the same
logic to both the DualShock4 and DualSense code.
As part of the calibration stability improvements, a thorough review was
performed of the calibration code as it was suspected it was potentially
incorrect. It was found to be only slightly wrong for the handling of the
bias of the gyroscopes. Two patches fix this for both DualShock4 and DualSense.
There is only a marginal impact on practical values as the bias values
tend to be quite small.
Thanks,
Roderick Colenbrander
Sony Interactive Entertainment, LLC
Roderick Colenbrander (5):
HID: playstation: fix DualShock4 unreachable calibration code.
HID: playstation: sanity check DualShock4 calibration data.
HID: playstation: sanity check DualSense calibration data.
HID: playstation: correct DualShock4 gyro bias handling.
HID: playstation: correct DualSense gyro bias handling.
drivers/hid/hid-playstation.c | 104 +++++++++++++++++++++++++++-------
1 file changed, 85 insertions(+), 19 deletions(-)
--
2.38.1
^ permalink raw reply
* Re: [PATCH] HID: sony: Fix division by zero
From: Roderick Colenbrander @ 2023-01-05 23:29 UTC (permalink / raw)
To: Alain Carlucci; +Cc: linux-input, Jiri Kosina, djogorchock
In-Reply-To: <20230105182355.ke4xy2bayxmqdne3@ananas>
Hi Alain,
I'm technically still on vacation, but this issue annoyed me a lot. I
had a look at other internal code and I'm relieved the code is
correct. (Well there is one tiny little issue around calibration,
which I will fix, but in practice only causes a tiny, tiny error).
I don't know why I thought it was wrong. Likely I had worked on a
patched kernel with some logic changed which caused these high values.
In any case I mentioned how the ratio was around 60 on my DS4. It
didn't make sense to me, but it is basically: 2000 / 32768 * 1024
(62.5). The 2000 is the range of the sensor, 32768 max value of 16-bit
signed, 1024 the scaling factor we use in the driver.
So basically:+ for (i = 0; i < ARRAY_SIZE(ds4->gyro_calib_data); i++) {
+ if (ds4->gyro_calib_data[i].sens_denom == 0) {
+ hid_warn(hdev, "Invalid gyro calibration data for axis
(%d), disabling calibration.",
+ ds4->gyro_calib_data[i].abs_code);
+ ds4->gyro_calib_data[i].bias = 0;
+ ds4->gyro_calib_data[i].sens_numer = DS4_GYRO_RANGE;
+ ds4->gyro_calib_data[i].sens_denom = S16_MAX;
+ }
+ }
The same for accelerometer.
I will clean up the patch, add some other patches and send them out shortly.
Thanks,
Roderick
On Thu, Jan 5, 2023 at 10:24 AM Alain Carlucci <alain.carlucci@gmail.com> wrote:
>
> Hi Roderick,
>
> I just tried to see with evtest the values of gyro/accel after
> changing the driver so that follows the suggestion on the dsremap
> website: dividing by two speed_2x:
> speed_2x = (gyro_speed_plus + gyro_speed_minus) >> 1;
>
> The DS4 shows values no higher than 600000 (post-calibration) while
> heavily shaking the joystick. For the record, the calibration is:
>
> gyro_pitch_plus: 8848 gyro_pitch_minus: -8853
> gyro_yaw_plus: 8833 gyro_yaw_minus: -8827
> gyro_roll_plus: 8856 gyro_roll_minus: -8841
> gyro_speed_plus: 540 gyro_speed_minus: 540
> acc_x_plus: 8107 acc_x_minus: -8107
> acc_y_plus: 8259 acc_y_minus: -8259
> acc_z_plus: 8187 acc_z_minus: -8186
>
> This is an example of the output:
>
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 128610
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 95747
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 61321
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 28864
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 874
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -27802
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -54949
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -82064
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -110398
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -138107
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -170345
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -205239
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -242320
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -281525
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -318043
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -356748
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -394453
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -430628
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -465428
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -496105
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -526469
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -551897
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -554865
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -522127
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -450933
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -323041
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -180404
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -44859
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 71006
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 148353
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 202209
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 242757
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 274183
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 298456
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 316106
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 331569
> Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 338942
>
> Thanks,
> Alain
^ permalink raw reply
* Re: [PATCH v2] HID: uclogic: Add support for XP-PEN Artist 22R Pro
From: redstrate @ 2023-01-05 22:08 UTC (permalink / raw)
To: José Expósito
Cc: linux-input, kernel test robot, Dan Carpenter, Jiri Kosina,
Benjamin Tissoires, linux-kernel
In-Reply-To: <Y7cLJpgnP50JzHps@fedora>
> I see this event codes in a test device mock in libinput, but I wonder
> if we could/should use BTN_9 instead of skiping a few IDs here.
>
> Honestly, I don't now what should be the right approach in this case,
> let's see if someone else comments on this topic.
I forgot about BTN_9, that should be an easy change. I already merged changes
upstream in systemd/udev to mark devices with these buttons correctly - so,
sunken cost and all that :-)
> I think that you could use uclogic_params_parse_ugee_v2_desc() and
> change the number of buttons in the template afterwards. It'd avoid
> some code duplication.
Yeah I think that's what I'll do, I was thinking of reusing it and just
overriding parameters if needed.
> There are some XP-Pen PRO devices handled by the other init function.
> Maybe we could rename this function to something more specific to your
> device.
Ah okay, it's pretty specific to this device anyway - so I'll rename the
function so it's clear what it's purpose is. I wasn't sure if future XP-PEN
Pro work was going to reuse this function, but I guess we'll rename it if that
happens!
> You can use "uclogic_ugee_v2_probe_endpoint" here.
Good catch! Will change.
> User-space lacks support for dials, but, with this descriptor, would it
> be possible to differenciate between the 2 dials to, for example,
> assign them different actions? Or would them be exposed as the same
> dial?
>
> I have no idea how would user-space see this, but it'd interesting to
> see how libinput handles it.
Currently userspace sees this as REL_WHEEL and REL_HWHEEL, but like
mentioned libinput currently rejects mouse wheel events from tablet pads.
The fact that they previously worked before these patches is because udev
misclassified the pad device as a mouse. I'm working upstream to expose dials
on tablet pads in libinput (I just got the green light so I'll be working on
that shortly!)
> You can cherry-pick my patch refactoring this variables and send it as
> part of your series. I think that it might help maintainers with the
> merge and it'd also fix the problem reported by the test robot.
Ooh good point, I didn't even consider doing that. Next version will have it
split up into two then.
^ permalink raw reply
* Re: [PATCH] HID: sony: Fix division by zero
From: Alain Carlucci @ 2023-01-05 18:23 UTC (permalink / raw)
To: Roderick Colenbrander; +Cc: linux-input, Jiri Kosina, djogorchock
In-Reply-To: <CAEc3jaD78h1qbWg+QQ40_yv5xc-oGFHAEyEOx2Nh20C-pxwcJg@mail.gmail.com>
Hi Roderick,
I just tried to see with evtest the values of gyro/accel after
changing the driver so that follows the suggestion on the dsremap
website: dividing by two speed_2x:
speed_2x = (gyro_speed_plus + gyro_speed_minus) >> 1;
The DS4 shows values no higher than 600000 (post-calibration) while
heavily shaking the joystick. For the record, the calibration is:
gyro_pitch_plus: 8848 gyro_pitch_minus: -8853
gyro_yaw_plus: 8833 gyro_yaw_minus: -8827
gyro_roll_plus: 8856 gyro_roll_minus: -8841
gyro_speed_plus: 540 gyro_speed_minus: 540
acc_x_plus: 8107 acc_x_minus: -8107
acc_y_plus: 8259 acc_y_minus: -8259
acc_z_plus: 8187 acc_z_minus: -8186
This is an example of the output:
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 128610
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 95747
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 61321
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 28864
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 874
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -27802
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -54949
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -82064
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -110398
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -138107
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -170345
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -205239
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -242320
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -281525
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -318043
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -356748
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -394453
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -430628
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -465428
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -496105
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -526469
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -551897
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -554865
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -522127
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -450933
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -323041
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -180404
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value -44859
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 71006
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 148353
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 202209
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 242757
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 274183
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 298456
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 316106
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 331569
Event: time [...], type 3 (EV_ABS), code 3 (ABS_RX), value 338942
Thanks,
Alain
^ permalink raw reply
* Re: [PATCH v2] HID: uclogic: Add support for XP-PEN Artist 22R Pro
From: José Expósito @ 2023-01-05 17:38 UTC (permalink / raw)
To: Joshua Goins
Cc: linux-input, kernel test robot, Dan Carpenter, Jiri Kosina,
Benjamin Tissoires, linux-kernel
In-Reply-To: <20230102194911.56083-1-josh@redstrate.com>
On Mon, Jan 02, 2023 at 02:49:10PM -0500, Joshua Goins wrote:
> Adds support for the XP-PEN Artist 22R Pro, including stylus, tablet frame
> and pen pressure.
>
> The tablet has 20 buttons, but need to be remapped in order since the
> device reports invalid keycodes. Existing tablet functionality should
> not be inhibited, as BTN0-8 is still used.
>
> New initialization functions are added since the device differs slightly
> from other UGEE v2 devices.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Reported-by: José Expósito <jose.exposito89@gmail.com>
> Signed-off-by: Joshua Goins <josh@redstrate.com>
> ---
> v2 changes:
> - rewrote initialization code to be more concise, and less error-prone, thanks
> Dan Carpenter & José Expósito for pointers!
> - less struct duplication, it now uses compatiable UGEE v2 ones.
> - uclogic_extra_input_mapping is now static, thanks José again!
> - straightened out dial transformation, now there's just the two cases and
> they're decimal.
> - fixed the patch formatting, it should be easier to apply now.
> - rebased onto 6.2-rc2
>
> I kept the new initialization functions seperate, please review and tell me if
> they are better suited being merged into their UGEE v2 counterparts (which would
> involve a lot of branching). I don't have another UGEE v2 tablet to test, so I
> won't be able to test for regressions for those devices myself, so I refrained
> from those changes in this patch.
>
> Original message:
> I did not do the research for this hardware, or the original patch - that work
> has been done by Aren Villanueva. For some reason they decided not to merge
> it. My changes include remapping the stupid amount of tablet frame buttons,
> cleaning up the code to match kernel style, and other small stuff.
>
> The tablet is (almost) fully functional even when uclogic doesn't handle it.
> Without initialization, the tablet has some sort of "basic driverless mode"
> that allows the tablet frame buttons to have some default keys associated with
> them (CTRL-S, CTRL-Z, that kind of stuff), but unfortunately the stylus pen
> semi-works. While pressure sensitivity works, only one stylus button functions
> correctly. Since the initialization process differs for Pro series tablets, the
> new function uclogic_params_init_ugee_xppen_pro had to be introduced. I also
> added USB HID IDs for this tablet too, but it's classified under the UGEE
> vendor ID.
>
> One of the more strange things I had to do is figure out a way to remap the
> buttons since there are 20 of them in total, and of course there are more
> buttons than there are BTN constants defined for us. When running without
> uclogic, it starts at BTN_0, ends at BTN_8 and the tablet starts reporting
> nonsensical keycodes so just leaving it alone isn't an option. I'm testing
> this under a libinput system, which has a list of buttons it considers "tablet
> pad buttons" which are notably BTN_0, BTN_1, so on and some
> gamepad/joystick buttons. So I created a new array called
> uclogic_extra_input_mapping for 20 working inputs.
>
> Another weird feature of this tablet is the second dial, which the original
> patchset introduced a new uclogic_frame param to handle since it seems it
> throws both dials values into one byte. The left wheel is considered EV_WHEEL
> and the other, EV_HWHEEL which seems fine to me. I also added the new param to
> the debug messages too.
>
>
> drivers/hid/hid-ids.h | 1 +
> drivers/hid/hid-uclogic-core.c | 66 +++++++++++-
> drivers/hid/hid-uclogic-params.c | 180 +++++++++++++++++++++++++++++++
> drivers/hid/hid-uclogic-params.h | 5 +
> drivers/hid/hid-uclogic-rdesc.c | 50 +++++++++
> drivers/hid/hid-uclogic-rdesc.h | 9 ++
> 6 files changed, 307 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 82713ef3aaa6..81d04054229a 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -1298,6 +1298,7 @@
> #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L 0x0935
> #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S 0x0909
> #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06 0x0078
> +#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_22R_PRO 0x091b
> #define USB_DEVICE_ID_UGEE_TABLET_G5 0x0074
> #define USB_DEVICE_ID_UGEE_TABLET_EX07S 0x0071
> #define USB_DEVICE_ID_UGEE_TABLET_RAINBOW_CV720 0x0055
> diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
> index 7fa6fe04f1b2..8d92e984f984 100644
> --- a/drivers/hid/hid-uclogic-core.c
> +++ b/drivers/hid/hid-uclogic-core.c
> @@ -81,6 +81,30 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> return rdesc;
> }
>
> +/* Buttons considered valid tablet pad inputs. */
> +static const unsigned int uclogic_extra_input_mapping[] = {
> + BTN_0,
> + BTN_1,
> + BTN_2,
> + BTN_3,
> + BTN_4,
> + BTN_5,
> + BTN_6,
> + BTN_7,
> + BTN_8,
I see this event codes in a test device mock in libinput, but I wonder
if we could/should use BTN_9 instead of skiping a few IDs here.
Honestly, I don't now what should be the right approach in this case,
let's see if someone else comments on this topic.
> + BTN_RIGHT,
> + BTN_MIDDLE,
> + BTN_SIDE,
> + BTN_EXTRA,
> + BTN_FORWARD,
> + BTN_BACK,
> + BTN_B,
> + BTN_A,
> + BTN_BASE,
> + BTN_BASE2,
> + BTN_X
> +};
> +
> static int uclogic_input_mapping(struct hid_device *hdev,
> struct hid_input *hi,
> struct hid_field *field,
> @@ -91,9 +115,27 @@ static int uclogic_input_mapping(struct hid_device *hdev,
> struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
> struct uclogic_params *params = &drvdata->params;
>
> - /* Discard invalid pen usages */
> - if (params->pen.usage_invalid && (field->application == HID_DG_PEN))
> - return -1;
> + if (field->application == HID_GD_KEYPAD) {
> + /*
> + * Remap input buttons to sensible ones that are not invalid.
> + * This only affects previous behavior for devices with more than ten or so buttons.
> + */
> + const int key = (usage->hid & HID_USAGE) - 1;
> +
> + if (key > 0 && key < ARRAY_SIZE(uclogic_extra_input_mapping)) {
> + hid_map_usage(hi,
> + usage,
> + bit,
> + max,
> + EV_KEY,
> + uclogic_extra_input_mapping[key]);
> + return 1;
> + }
> + } else if (field->application == HID_DG_PEN) {
> + /* Discard invalid pen usages */
> + if (params->pen.usage_invalid)
> + return -1;
> + }
>
> /* Let hid-core decide what to do */
> return 0;
> @@ -403,8 +445,22 @@ static int uclogic_raw_event_frame(
>
> /* If need to, and can, transform the bitmap dial reports */
> if (frame->bitmap_dial_byte > 0 && frame->bitmap_dial_byte < size) {
> - if (data[frame->bitmap_dial_byte] == 2)
> + switch (data[frame->bitmap_dial_byte]) {
> + case 2:
> data[frame->bitmap_dial_byte] = -1;
> + break;
> +
> + /* Everything below here is for tablets that shove multiple dials into 1 byte */
> + case 16:
> + data[frame->bitmap_dial_byte] = 0;
> + data[frame->bitmap_second_dial_destination_byte] = 1;
> + break;
> +
> + case 32:
> + data[frame->bitmap_dial_byte] = 0;
> + data[frame->bitmap_second_dial_destination_byte] = -1;
> + break;
> + }
> }
>
> return 0;
> @@ -531,6 +587,8 @@ static const struct hid_device_id uclogic_devices[] = {
> USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S) },
> { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
> USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06) },
> + { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
> + USB_DEVICE_ID_UGEE_XPPEN_TABLET_22R_PRO) },
> { }
> };
> MODULE_DEVICE_TABLE(hid, uclogic_devices);
> diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
> index cd1233d7e253..d53c464a1b15 100644
> --- a/drivers/hid/hid-uclogic-params.c
> +++ b/drivers/hid/hid-uclogic-params.c
> @@ -103,6 +103,8 @@ static void uclogic_params_frame_hid_dbg(
> frame->touch_flip_at);
> hid_dbg(hdev, "\t\t.bitmap_dial_byte = %u\n",
> frame->bitmap_dial_byte);
> + hid_dbg(hdev, "\t\t.bitmap_second_dial_destination_byte = %u\n",
> + frame->bitmap_second_dial_destination_byte);
> }
>
> /**
> @@ -1418,6 +1420,174 @@ static int uclogic_params_ugee_v2_init(struct uclogic_params *params,
> return rc;
> }
>
> +/**
> + * uclogic_params_parse_ugee_xppen_pro_desc - parse the string descriptor
> + * containing pen and frame parameters returned by XP-PEN Pro devices.
> + *
> + * @str_desc: String descriptor, cannot be NULL.
> + * @str_desc_size: Size of the string descriptor.
> + * @desc_params: Output description params list.
> + * @desc_params_size: Size of the output description params list.
> + *
> + * Returns:
> + * Zero, if successful. A negative errno code on error.
> + */
> +static int uclogic_params_parse_ugee_xppen_pro_desc(const __u8 *str_desc,
I think that you could use uclogic_params_parse_ugee_v2_desc() and
change the number of buttons in the template afterwards. It'd avoid
some code duplication.
> + size_t str_desc_size,
> + s32 *desc_params,
> + size_t desc_params_size)
> +{
> + s32 pen_x_lm, pen_y_lm;
> + s32 pen_x_pm, pen_y_pm;
> + s32 pen_pressure_lm;
> + s32 resolution;
> +
> + /* Minimum descriptor length required, maximum seen so far is 14 */
> + const int min_str_desc_size = 12;
> +
> + if (!str_desc || str_desc_size < min_str_desc_size)
> + return -EINVAL;
> +
> + if (desc_params_size != UCLOGIC_RDESC_PH_ID_NUM)
> + return -EINVAL;
> +
> + pen_x_lm = get_unaligned_le16(str_desc + 2);
> + pen_y_lm = get_unaligned_le16(str_desc + 4);
> + pen_pressure_lm = get_unaligned_le16(str_desc + 8);
> +
> + resolution = get_unaligned_le16(str_desc + 10);
> + if (resolution == 0) {
> + pen_x_pm = 0;
> + pen_y_pm = 0;
> + } else {
> + pen_x_pm = pen_x_lm * 1000 / resolution;
> + pen_y_pm = pen_y_lm * 1000 / resolution;
> + }
> +
> + desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_LM] = pen_x_lm;
> + desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_PM] = pen_x_pm;
> + desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM] = pen_y_lm;
> + desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_PM] = pen_y_pm;
> + desc_params[UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM] = pen_pressure_lm;
> +
> + return 0;
> +}
> +
> +/*
> + * uclogic_params_init_ugee_xppen_pro() - Initializes a UGEE XP-Pen Pro tablet device.
> + *
> + * @hdev: The HID device of the tablet interface to initialize and get
> + * parameters from. Cannot be NULL.
> + * @params: Parameters to fill in (to be cleaned with
> + * uclogic_params_cleanup()). Not modified in case of error.
> + * Cannot be NULL.
> + *
> + * Returns:
> + * Zero, if successful. A negative errno code on error.
> + */
> +static int uclogic_params_init_ugee_xppen_pro(struct uclogic_params *params,
There are some XP-Pen PRO devices handled by the other init function.
Maybe we could rename this function to something more specific to your
device.
> + struct hid_device *hdev,
> + const u8 rdesc_frame_arr[],
> + const size_t rdesc_frame_size)
> +{
> + int rc = 0;
> + struct usb_interface *iface;
> + __u8 bInterfaceNumber;
> + const int str_desc_len = 12;
> + u8 *str_desc = NULL;
> + __u8 *rdesc_pen = NULL;
> + s32 desc_params[UCLOGIC_RDESC_PH_ID_NUM];
> + /* The resulting parameters (noop) */
> + struct uclogic_params p = {0, };
> +
> + if (!hdev || !params) {
> + rc = -EINVAL;
> + goto cleanup;
> + }
> +
> + iface = to_usb_interface(hdev->dev.parent);
> + bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber;
> +
> + /* Ignore non-pen interfaces */
> + if (bInterfaceNumber != 2) {
> + uclogic_params_init_invalid(&p);
> + goto output;
> + }
> +
> + /*
> + * Initialize the interface by sending magic data.
> + * This magic data is the same as other UGEE v2 tablets.
> + */
> + rc = uclogic_probe_interface(hdev,
> + uclogic_ugee_v2_probe_arr,
> + uclogic_ugee_v2_probe_size,
> + 0x03);
You can use "uclogic_ugee_v2_probe_endpoint" here.
> + if (rc) {
> + uclogic_params_init_invalid(&p);
> + goto output;
> + }
> +
> + /**
> + * Read the string descriptor containing pen and frame parameters.
> + * These are slightly different than typical UGEE v2 devices.
> + */
> + rc = uclogic_params_get_str_desc(&str_desc, hdev, 100, str_desc_len);
> + if (rc != str_desc_len) {
> + hid_err(hdev, "failed retrieving pen and frame parameters: %d\n", rc);
> + uclogic_params_init_invalid(&p);
> + goto output;
> + }
> +
> + rc = uclogic_params_parse_ugee_xppen_pro_desc(str_desc, str_desc_len,
> + desc_params,
> + ARRAY_SIZE(desc_params));
> + if (rc)
> + goto cleanup;
> +
> + kfree(str_desc);
> + str_desc = NULL;
> +
> + /* Initialize the pen interface */
> + rdesc_pen = uclogic_rdesc_template_apply(
> + uclogic_rdesc_ugee_v2_pen_template_arr,
> + uclogic_rdesc_ugee_v2_pen_template_size,
> + desc_params, ARRAY_SIZE(desc_params));
> + if (!rdesc_pen) {
> + rc = -ENOMEM;
> + goto cleanup;
> + }
> +
> + p.pen.desc_ptr = rdesc_pen;
> + p.pen.desc_size = uclogic_rdesc_ugee_v2_pen_template_size;
> + p.pen.id = 0x02;
> + p.pen.subreport_list[0].value = 0xf0;
> + p.pen.subreport_list[0].id = UCLOGIC_RDESC_V1_FRAME_ID;
> +
> + /* Initialize the frame interface */
> + rc = uclogic_params_frame_init_with_desc(
> + &p.frame_list[0],
> + rdesc_frame_arr,
> + rdesc_frame_size,
> + UCLOGIC_RDESC_V1_FRAME_ID);
> + if (rc < 0) {
> + hid_err(hdev, "initializing frame params failed: %d\n", rc);
> + goto output;
> + }
> +
> + p.frame_list[0].bitmap_dial_byte = 7;
> + p.frame_list[0].bitmap_second_dial_destination_byte = 8;
> +
> +output:
> + /* Output parameters */
> + memcpy(params, &p, sizeof(*params));
> + memset(&p, 0, sizeof(p));
> + rc = 0;
> +cleanup:
> + kfree(str_desc);
> + uclogic_params_cleanup(&p);
> + return rc;
> +}
> +
> /**
> * uclogic_params_init() - initialize a tablet interface and discover its
> * parameters.
> @@ -1728,6 +1898,16 @@ int uclogic_params_init(struct uclogic_params *params,
> uclogic_params_init_invalid(&p);
> }
>
> + break;
> + case VID_PID(USB_VENDOR_ID_UGEE,
> + USB_DEVICE_ID_UGEE_XPPEN_TABLET_22R_PRO):
> + rc = uclogic_params_init_ugee_xppen_pro(&p,
> + hdev,
> + uclogic_rdesc_xppen_artist_22r_pro_frame_arr,
> + uclogic_rdesc_xppen_artist_22r_pro_frame_size);
> + if (rc != 0)
> + goto cleanup;
> +
> break;
> }
>
> diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h
> index a97477c02ff8..6621a75a4b1a 100644
> --- a/drivers/hid/hid-uclogic-params.h
> +++ b/drivers/hid/hid-uclogic-params.h
> @@ -171,6 +171,11 @@ struct uclogic_params_frame {
> * counterclockwise, as opposed to the normal 1 and -1.
> */
> unsigned int bitmap_dial_byte;
> + /*
> + * Destination offset for the second bitmap dial byte, if the tablet
> + * supports a second dial at all.
> + */
> + unsigned int bitmap_second_dial_destination_byte;
> };
>
> /*
> diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
> index fb40775f5f5b..86293ae8c995 100644
> --- a/drivers/hid/hid-uclogic-rdesc.c
> +++ b/drivers/hid/hid-uclogic-rdesc.c
> @@ -859,6 +859,12 @@ const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
> const size_t uclogic_rdesc_v2_frame_dial_size =
> sizeof(uclogic_rdesc_v2_frame_dial_arr);
>
> +const __u8 uclogic_ugee_v2_probe_arr[] = {
> + 0x02, 0xb0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
> +};
> +const size_t uclogic_ugee_v2_probe_size = sizeof(uclogic_ugee_v2_probe_arr);
> +const int uclogic_ugee_v2_probe_endpoint = 0x03;
> +
> /* Fixed report descriptor template for UGEE v2 pen reports */
> const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
> 0x05, 0x0d, /* Usage Page (Digitizers), */
> @@ -1185,6 +1191,50 @@ const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
> const size_t uclogic_rdesc_xppen_deco01_frame_size =
> sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
>
> +/* Fixed report descriptor for XP-Pen Arist 22R Pro frame */
> +const __u8 uclogic_rdesc_xppen_artist_22r_pro_frame_arr[] = {
User-space lacks support for dials, but, with this descriptor, would it
be possible to differenciate between the 2 dials to, for example,
assign them different actions? Or would them be exposed as the same
dial?
I have no idea how would user-space see this, but it'd interesting to
see how libinput handles it.
> + 0x05, 0x01, /* Usage Page (Desktop), */
> + 0x09, 0x07, /* Usage (Keypad), */
> + 0xA1, 0x01, /* Collection (Application), */
> + 0x85, UCLOGIC_RDESC_V1_FRAME_ID,
> + /* Report ID (Virtual report), */
> + 0x05, 0x0D, /* Usage Page (Digitizer), */
> + 0x09, 0x39, /* Usage (Tablet Function Keys), */
> + 0xA0, /* Collection (Physical), */
> + 0x14, /* Logical Minimum (0), */
> + 0x25, 0x01, /* Logical Maximum (1), */
> + 0x75, 0x01, /* Report Size (1), */
> + 0x95, 0x08, /* Report Count (8), */
> + 0x81, 0x01, /* Input (Constant), */
> + 0x05, 0x09, /* Usage Page (Button), */
> + 0x19, 0x01, /* Usage Minimum (01h), */
> + 0x29, 0x14, /* Usage Maximum (14h), */
> + 0x95, 0x14, /* Report Count (20), */
> + 0x81, 0x02, /* Input (Variable), */
> + 0x95, 0x14, /* Report Count (20), */
> + 0x81, 0x01, /* Input (Constant), */
> + 0x05, 0x01, /* Usage Page (Desktop), */
> + 0x09, 0x38, /* Usage (Wheel), */
> + 0x75, 0x08, /* Report Size (8), */
> + 0x95, 0x01, /* Report Count (1), */
> + 0x15, 0xFF, /* Logical Minimum (-1), */
> + 0x25, 0x08, /* Logical Maximum (8), */
> + 0x81, 0x06, /* Input (Variable, Relative), */
> + 0x05, 0x0C, /* Usage Page (Consumer Devices), */
> + 0x0A, 0x38, 0x02, /* Usage (AC PAN), */
> + 0x95, 0x01, /* Report Count (1), */
> + 0x81, 0x06, /* Input (Variable, Relative), */
> + 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
> + 0x75, 0x08, /* Report Size (8), */
> + 0x95, 0x01, /* Report Count (1), */
> + 0x81, 0x02, /* Input (Variable), */
> + 0xC0, /* End Collection */
> + 0xC0, /* End Collection */
> +};
> +
> +const size_t uclogic_rdesc_xppen_artist_22r_pro_frame_size =
> + sizeof(uclogic_rdesc_xppen_artist_22r_pro_frame_arr);
> +
> /**
> * uclogic_rdesc_template_apply() - apply report descriptor parameters to a
> * report descriptor template, creating a report descriptor. Copies the
> diff --git a/drivers/hid/hid-uclogic-rdesc.h b/drivers/hid/hid-uclogic-rdesc.h
> index a1f78c07293f..c3cb2c75dda5 100644
> --- a/drivers/hid/hid-uclogic-rdesc.h
> +++ b/drivers/hid/hid-uclogic-rdesc.h
> @@ -164,6 +164,11 @@ extern const size_t uclogic_rdesc_v2_frame_dial_size;
> /* Report ID for tweaked UGEE v2 battery reports */
> #define UCLOGIC_RDESC_UGEE_V2_BATTERY_ID 0xba
>
> +/* Magic data expected by UGEEv2 devices on probe */
> +extern const __u8 uclogic_ugee_v2_probe_arr[];
> +extern const size_t uclogic_ugee_v2_probe_size;
> +extern const int uclogic_ugee_v2_probe_endpoint;
> +
You can cherry-pick my patch refactoring this variables and send it as
part of your series. I think that it might help maintainers with the
merge and it'd also fix the problem reported by the test robot.
> /* Fixed report descriptor template for UGEE v2 pen reports */
> extern const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[];
> extern const size_t uclogic_rdesc_ugee_v2_pen_template_size;
> @@ -205,4 +210,8 @@ extern const size_t uclogic_rdesc_ugee_g5_frame_size;
> /* Least-significant bit of Ugee G5 frame rotary encoder state */
> #define UCLOGIC_RDESC_UGEE_G5_FRAME_RE_LSB 38
>
> +/* Fixed report descriptor for XP-Pen Arist 22R Pro frame */
> +extern const __u8 uclogic_rdesc_xppen_artist_22r_pro_frame_arr[];
> +extern const size_t uclogic_rdesc_xppen_artist_22r_pro_frame_size;
> +
> #endif /* _HID_UCLOGIC_RDESC_H */
>
> base-commit: 88603b6dc419445847923fcb7fe5080067a30f98
> --
> 2.38.2
>
^ permalink raw reply
* Re: [PATCH v2] drivers/mfd: simple-mfd-i2c: Add generic compatible
From: Lee Jones @ 2023-01-05 14:56 UTC (permalink / raw)
To: Jesse Taube; +Cc: linux-kernel, linux-input, lee.jones
In-Reply-To: <20221202113226.114465-1-Mr.Bossman075@gmail.com>
On Fri, 02 Dec 2022, Jesse Taube wrote:
> Some devices may want to use this driver without having a specific
> compatible string. Add a generic compatible string to allow this.
>
> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
> ---
> drivers/mfd/simple-mfd-i2c.c | 1 +
> 1 file changed, 1 insertion(+)
Sounds like a good idea. I've changed the subject line a little (no
need to say 'drivers') and applied the patch, thanks.
> diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
> index f4c8fc3ee463..0bda0dd9276e 100644
> --- a/drivers/mfd/simple-mfd-i2c.c
> +++ b/drivers/mfd/simple-mfd-i2c.c
> @@ -73,6 +73,7 @@ static const struct simple_mfd_data silergy_sy7636a = {
> };
>
> static const struct of_device_id simple_mfd_i2c_of_match[] = {
> + { .compatible = "simple-mfd-i2c-generic" },
> { .compatible = "kontron,sl28cpld" },
> { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
> {}
> --
> 2.38.1
>
--
Lee Jones [李琼斯]
^ permalink raw reply
* [PATCH 19/27] mfd: remove ucb1400 support
From: Arnd Bergmann @ 2023-01-05 13:46 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Daniel Mack, Haojian Zhuang, linux-arm-kernel, linux-kernel,
Arnd Bergmann, Linus Walleij, Bartosz Golaszewski,
Dmitry Torokhov, Lee Jones, Jaroslav Kysela, Takashi Iwai,
Marek Vasut, linux-gpio, linux-input, alsa-devel
In-Reply-To: <20230105134622.254560-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
The ucb1400 MFD driver and its gpio and touchscreen child
drivers were only used on a few PXA machines that were unused
for a while and are now removed.
Removing these leaves the AC97 support as ALSA specific,
no other drivers are now connected through this interface.
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Lee Jones <lee@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Marek Vasut <marex@denx.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpio/Kconfig | 7 -
drivers/gpio/Makefile | 1 -
drivers/gpio/gpio-ucb1400.c | 85 -----
drivers/input/touchscreen/Kconfig | 16 -
drivers/input/touchscreen/Makefile | 1 -
drivers/input/touchscreen/ucb1400_ts.c | 458 -------------------------
drivers/mfd/Kconfig | 11 -
drivers/mfd/Makefile | 1 -
drivers/mfd/ucb1400_core.c | 158 ---------
include/linux/ucb1400.h | 160 ---------
sound/Kconfig | 1 -
sound/pci/ac97/ac97_codec.c | 1 -
sound/pci/ac97/ac97_patch.c | 40 ---
13 files changed, 940 deletions(-)
delete mode 100644 drivers/gpio/gpio-ucb1400.c
delete mode 100644 drivers/input/touchscreen/ucb1400_ts.c
delete mode 100644 drivers/mfd/ucb1400_core.c
delete mode 100644 include/linux/ucb1400.h
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 0148553790eb..df2dfbb2601e 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1428,13 +1428,6 @@ config GPIO_TWL6040
Say yes here to access the GPO signals of twl6040
audio chip from Texas Instruments.
-config GPIO_UCB1400
- tristate "Philips UCB1400 GPIO"
- depends on UCB1400_CORE
- help
- This enables support for the Philips UCB1400 GPIO pins.
- The UCB1400 is an AC97 audio codec.
-
config GPIO_WHISKEY_COVE
tristate "GPIO support for Whiskey Cove PMIC"
depends on (X86 || COMPILE_TEST) && INTEL_SOC_PMIC_BXTWC
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 59ac21054261..c048ba003367 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -165,7 +165,6 @@ obj-$(CONFIG_GPIO_TS4900) += gpio-ts4900.o
obj-$(CONFIG_GPIO_TS5500) += gpio-ts5500.o
obj-$(CONFIG_GPIO_TWL4030) += gpio-twl4030.o
obj-$(CONFIG_GPIO_TWL6040) += gpio-twl6040.o
-obj-$(CONFIG_GPIO_UCB1400) += gpio-ucb1400.o
obj-$(CONFIG_GPIO_UNIPHIER) += gpio-uniphier.o
obj-$(CONFIG_GPIO_VF610) += gpio-vf610.o
obj-$(CONFIG_GPIO_VIPERBOARD) += gpio-viperboard.o
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c
deleted file mode 100644
index 676adf1f198a..000000000000
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index ca00f55eaf45..1a2049b336a6 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -827,22 +827,6 @@ config TOUCHSCREEN_TI_AM335X_TSC
To compile this driver as a module, choose M here: the
module will be called ti_am335x_tsc.
-config TOUCHSCREEN_UCB1400
- tristate "Philips UCB1400 touchscreen"
- depends on AC97_BUS
- depends on UCB1400_CORE
- help
- This enables support for the Philips UCB1400 touchscreen interface.
- The UCB1400 is an AC97 audio codec. The touchscreen interface
- will be initialized only after the ALSA subsystem has been
- brought up and the UCB1400 detected. You therefore have to
- configure ALSA support as well (either built-in or modular,
- independently of whether this driver is itself built-in or
- modular) for this driver to work.
-
- To compile this driver as a module, choose M here: the
- module will be called ucb1400_ts.
-
config TOUCHSCREEN_PIXCIR
tristate "PIXCIR I2C touchscreens"
depends on I2C
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 7053fede594e..f2fd28cc34a6 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -97,7 +97,6 @@ obj-$(CONFIG_TOUCHSCREEN_TSC2005) += tsc2005.o
tsc2007-y := tsc2007_core.o
tsc2007-$(CONFIG_TOUCHSCREEN_TSC2007_IIO) += tsc2007_iio.o
obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
-obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001) += wacom_w8001.o
obj-$(CONFIG_TOUCHSCREEN_WACOM_I2C) += wacom_i2c.o
obj-$(CONFIG_TOUCHSCREEN_WDT87XX_I2C) += wdt87xx_i2c.o
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
deleted file mode 100644
index dfd3b35590c3..000000000000
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index da57ebf22630..5ea07a65f150 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1071,17 +1071,6 @@ config PCF50633_GPIO
Say yes here if you want to include support GPIO for pins on
the PCF50633 chip.
-config UCB1400_CORE
- tristate "Philips UCB1400 Core driver"
- depends on AC97_BUS
- depends on GPIOLIB
- help
- This enables support for the Philips UCB1400 core functions.
- The UCB1400 is an AC97 audio codec.
-
- To compile this driver as a module, choose M here: the
- module will be called ucb1400_core.
-
config MFD_PM8XXX
tristate "Qualcomm PM8xxx PMIC chips driver"
depends on (ARM || HEXAGON || COMPILE_TEST)
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 9ba9d711c492..4969ea6e24f1 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -127,7 +127,6 @@ obj-$(CONFIG_MCP_UCB1200_TS) += ucb1x00-ts.o
ifeq ($(CONFIG_SA1100_ASSABET),y)
obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o
endif
-obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o
obj-$(CONFIG_PMIC_DA903X) += da903x.o
diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
deleted file mode 100644
index ac1d18039568..000000000000
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
deleted file mode 100644
index 2516082cd3a9..000000000000
diff --git a/sound/Kconfig b/sound/Kconfig
index e56d96d2b11c..0ddfb717b81d 100644
--- a/sound/Kconfig
+++ b/sound/Kconfig
@@ -107,7 +107,6 @@ endif # !UML
endif # SOUND
-# AC97_BUS is used from both sound and ucb1400
config AC97_BUS
tristate
help
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index ff685321f1a1..9afc5906d662 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -152,7 +152,6 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, // only guess --jk
{ 0x4e534331, 0xffffffff, "LM4549", NULL, NULL },
{ 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix
-{ 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL },
{ 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH },
{ 0x53544d02, 0xffffffff, "ST7597", NULL, NULL },
{ 0x54524102, 0xffffffff, "TR28022", NULL, NULL },
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 025c1666c1fc..4b5f33de70d5 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -3937,43 +3937,3 @@ static int patch_lm4550(struct snd_ac97 *ac97)
ac97->res_table = lm4550_restbl;
return 0;
}
-
-/*
- * UCB1400 codec (http://www.semiconductors.philips.com/acrobat_download/datasheets/UCB1400-02.pdf)
- */
-static const struct snd_kcontrol_new snd_ac97_controls_ucb1400[] = {
-/* enable/disable headphone driver which allows direct connection to
- stereo headphone without the use of external DC blocking
- capacitors */
-AC97_SINGLE("Headphone Driver", 0x6a, 6, 1, 0),
-/* Filter used to compensate the DC offset is added in the ADC to remove idle
- tones from the audio band. */
-AC97_SINGLE("DC Filter", 0x6a, 4, 1, 0),
-/* Control smart-low-power mode feature. Allows automatic power down
- of unused blocks in the ADC analog front end and the PLL. */
-AC97_SINGLE("Smart Low Power Mode", 0x6c, 4, 3, 0),
-};
-
-static int patch_ucb1400_specific(struct snd_ac97 * ac97)
-{
- int idx, err;
- for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++) {
- err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97));
- if (err < 0)
- return err;
- }
- return 0;
-}
-
-static const struct snd_ac97_build_ops patch_ucb1400_ops = {
- .build_specific = patch_ucb1400_specific,
-};
-
-static int patch_ucb1400(struct snd_ac97 * ac97)
-{
- ac97->build_ops = &patch_ucb1400_ops;
- /* enable headphone driver and smart low power mode by default */
- snd_ac97_write_cache(ac97, 0x6a, 0x0050);
- snd_ac97_write_cache(ac97, 0x6c, 0x0030);
- return 0;
-}
--
2.39.0
^ permalink raw reply related
* [PATCH 10/27] input: remove pxa930_trkball driver
From: Arnd Bergmann @ 2023-01-05 13:46 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Daniel Mack, Haojian Zhuang, linux-arm-kernel, linux-kernel,
Arnd Bergmann, Dmitry Torokhov, linux-input
In-Reply-To: <20230105134622.254560-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
The pxa930 SoC support is getting removed, and no upstream
board ever provided the trkball device that this driver
relies on.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/mouse/Kconfig | 6 -
drivers/input/mouse/Makefile | 1 -
drivers/input/mouse/pxa930_trkball.c | 250 ------------------
.../platform_data/mouse-pxa930_trkball.h | 11 -
4 files changed, 268 deletions(-)
delete mode 100644 drivers/input/mouse/pxa930_trkball.c
delete mode 100644 include/linux/platform_data/mouse-pxa930_trkball.h
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 63c9cda555c3..32cc4c62a716 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -393,12 +393,6 @@ config MOUSE_GPIO
To compile this driver as a module, choose M here: the
module will be called gpio_mouse.
-config MOUSE_PXA930_TRKBALL
- tristate "PXA930 Trackball mouse"
- depends on CPU_PXA930 || CPU_PXA935
- help
- Say Y here to support PXA930 Trackball mouse.
-
config MOUSE_MAPLE
tristate "Maple mouse (for the Dreamcast)"
depends on MAPLE
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
index e49f08565076..92b3204ce84e 100644
--- a/drivers/input/mouse/Makefile
+++ b/drivers/input/mouse/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o
obj-$(CONFIG_MOUSE_NAVPOINT_PXA27x) += navpoint.o
obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o
obj-$(CONFIG_MOUSE_PS2) += psmouse.o
-obj-$(CONFIG_MOUSE_PXA930_TRKBALL) += pxa930_trkball.o
obj-$(CONFIG_MOUSE_RISCPC) += rpcmouse.o
obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
obj-$(CONFIG_MOUSE_SYNAPTICS_I2C) += synaptics_i2c.o
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c
deleted file mode 100644
index f04ba12dbfa8..000000000000
diff --git a/include/linux/platform_data/mouse-pxa930_trkball.h b/include/linux/platform_data/mouse-pxa930_trkball.h
deleted file mode 100644
index ba0ac7a30d8c..000000000000
--
2.39.0
^ permalink raw reply related
* [PATCH 12/27] input: remove zylonite touchscreen driver
From: Arnd Bergmann @ 2023-01-05 13:46 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Daniel Mack, Haojian Zhuang, linux-arm-kernel, linux-kernel,
Arnd Bergmann, Dmitry Torokhov, Mark Brown, linux-input
In-Reply-To: <20230105134622.254560-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
The PXA zylonite platform was removed, so this driver has no
remaining users.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/touchscreen/Kconfig | 14 --
drivers/input/touchscreen/Makefile | 1 -
drivers/input/touchscreen/zylonite-wm97xx.c | 220 --------------------
3 files changed, 235 deletions(-)
delete mode 100644 drivers/input/touchscreen/zylonite-wm97xx.c
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 5abb45ea1b1b..ca00f55eaf45 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -928,20 +928,6 @@ config TOUCHSCREEN_WM97XX_MAINSTONE
To compile this driver as a module, choose M here: the
module will be called mainstone-wm97xx.
-config TOUCHSCREEN_WM97XX_ZYLONITE
- tristate "Zylonite accelerated touch"
- depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE
- depends on SND_PXA2XX_LIB_AC97
- select TOUCHSCREEN_WM9713
- help
- Say Y here for support for streaming mode with the touchscreen
- on Zylonite systems.
-
- If unsure, say N.
-
- To compile this driver as a module, choose M here: the
- module will be called zylonite-wm97xx.
-
config TOUCHSCREEN_USB_COMPOSITE
tristate "USB Touchscreen Driver"
depends on USB_ARCH_HAS_HCD
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 3bc2a47c489c..7053fede594e 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -107,7 +107,6 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o
obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o
-obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_SX8654) += sx8654.o
obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
obj-$(CONFIG_TOUCHSCREEN_ZET6223) += zet6223.o
diff --git a/drivers/input/touchscreen/zylonite-wm97xx.c b/drivers/input/touchscreen/zylonite-wm97xx.c
deleted file mode 100644
index a70fe4abe520..000000000000
--
2.39.0
^ permalink raw reply related
* [PATCH 11/27] input: remove pxa930_rotary keyboard driver
From: Arnd Bergmann @ 2023-01-05 13:46 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Daniel Mack, Haojian Zhuang, linux-arm-kernel, linux-kernel,
Arnd Bergmann, Dmitry Torokhov, linux-input
In-Reply-To: <20230105134622.254560-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
The pxa930 platform is getting removed and no upstream machine
ever defined a rotary keyboard device.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/keyboard/Kconfig | 9 -
drivers/input/keyboard/Makefile | 1 -
drivers/input/keyboard/pxa930_rotary.c | 195 ------------------
.../platform_data/keyboard-pxa930_rotary.h | 21 --
4 files changed, 226 deletions(-)
delete mode 100644 drivers/input/keyboard/pxa930_rotary.c
delete mode 100644 include/linux/platform_data/keyboard-pxa930_rotary.h
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 5d481847d718..d98650426dc2 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -550,15 +550,6 @@ config KEYBOARD_PXA27x
To compile this driver as a module, choose M here: the
module will be called pxa27x_keypad.
-config KEYBOARD_PXA930_ROTARY
- tristate "PXA930/PXA935 Enhanced Rotary Controller Support"
- depends on CPU_PXA930 || CPU_PXA935
- help
- Enable support for PXA930/PXA935 Enhanced Rotary Controller.
-
- To compile this driver as a module, choose M here: the
- module will be called pxa930_rotary.
-
config KEYBOARD_PMIC8XXX
tristate "Qualcomm PMIC8XXX keypad support"
depends on MFD_PM8XXX
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 5ccfdf5c0222..aecef00c5d09 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -54,7 +54,6 @@ obj-$(CONFIG_KEYBOARD_OPENCORES) += opencores-kbd.o
obj-$(CONFIG_KEYBOARD_PINEPHONE) += pinephone-keyboard.o
obj-$(CONFIG_KEYBOARD_PMIC8XXX) += pmic8xxx-keypad.o
obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o
-obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o
obj-$(CONFIG_KEYBOARD_QT1050) += qt1050.o
obj-$(CONFIG_KEYBOARD_QT1070) += qt1070.o
obj-$(CONFIG_KEYBOARD_QT2160) += qt2160.o
diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c
deleted file mode 100644
index 2fe9dcfe0a6f..000000000000
diff --git a/include/linux/platform_data/keyboard-pxa930_rotary.h b/include/linux/platform_data/keyboard-pxa930_rotary.h
deleted file mode 100644
index 3271aa01cbe8..000000000000
--
2.39.0
^ permalink raw reply related
* [PATCH v2 00/27] ARM: pxa: remove all unused boards&drivers
From: Arnd Bergmann @ 2023-01-05 13:45 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Daniel Mack, Haojian Zhuang, linux-arm-kernel, linux-kernel,
Arnd Bergmann, stern, alexandre.belloni, brgl, damien.lemoal,
dmitry.torokhov, linux, balbi, gregkh, deller, perex, jingoohan1,
lee, kernel, lgirdwood, linus.walleij, marek.vasut, broonie,
mkpetch, miquel.raynal, lost.distance, philipp.zabel, linux, sre,
slapin, s.shtylyov, sudipm.mukherjee, tiwai, ulf.hansson,
vigneshr, viresh.kumar, wsa+renesas, linux-pm, linux-ide,
linux-gpio, linux-input, patches, linux-leds, linux-mmc,
linux-renesas-soc, linux-mtd, linux-rtc, linux-usb, dri-devel,
linux-fbdev, alsa-devel
From: Arnd Bergmann <arnd@arndb.de>
Most of the legacy PXA board files were marked as unused in linux-5.19 and
can get removed in linux-6.3. There is support for pxa250/pxa270/pxa300
using devicetree already, which supports a number of boards, but progress
on converting the remaining ones has stalled over the past few years.
The two boards that are left in the tree for now are the three 'sharpsl'
variants (spitz/akita/borzoi) and the 'gumstix' family of machines.
Both of these are supported by qemu, which can be helpful for completing
the DT conversion.
Only PXA25x and PXA27x are left with full boardfile support, so PXA300
can get a lot simpler while still working with DT, and PXA310/320/93x
can be removed entirely.
A good number of drivers become impossible to select after this, so
each of these also get dropped. I'm including the driver patches in the
series here and can either merge them through the soc tree, or they can
get picked up by the individual subsystem maintainers. Since both the
platform and the drivers get removed, the order should not matter.
Note that the patches here are generated with 'git format-patch -D' and
don't contain the contents of removed files because of the significant
size (the first patch is close to a megabyte).
---
I first attempted to send this series in October, but only the
cover letter made it out at the time, not the patches. Since Robert
discovered a problem with the AC97_BUS_NEW support getting removed, and
I ran into other build issues before resending, it did not make it for
6.2 at all. I'm trying to queue up all the board removal patches now,
so am posting these properly now.
Arnd Bergmann (27):
ARM: pxa: remove unused board files
ARM: pxa: remove irda leftover
ARM: pxa: remove unused pxa3xx-ulpi
ARM: pxa: drop pxa310/pxa320/pxa93x support
ARM: pxa: prune unused device support
power: remove z2_battery driver
power: remove tosa_battery driver
ata: remove palmld pata driver
backlight: remove pxa tosa support
input: remove pxa930_trkball driver
input: remove pxa930_rotary keyboard driver
input: remove zylonite touchscreen driver
pcmcia: remove unused pxa/sa1100 drivers
ASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable
ASoC: pxa: remove unused board support
power: remove pda_power supply driver
rtc: remove v3020 driver
mfd: remove toshiba tmio drivers
mfd: remove ucb1400 support
mtd: remove tmio_nand driver
mmc: remove tmio_mmc driver
fbdev: remove tmiofb driver
fbdev: remove w100fb driver
leds: remove asic3 driver
usb: remove ohci-tmio driver
w1: remove ds1wm driver
mfd: remove htc-pasic3 driver
Documentation/power/power_supply_class.rst | 4 +-
MAINTAINERS | 99 -
arch/arm/configs/cm_x300_defconfig | 163 --
arch/arm/configs/colibri_pxa270_defconfig | 157 --
arch/arm/configs/colibri_pxa300_defconfig | 60 -
arch/arm/configs/corgi_defconfig | 247 ---
arch/arm/configs/eseries_pxa_defconfig | 97 -
arch/arm/configs/ezx_defconfig | 389 ----
arch/arm/configs/h5000_defconfig | 74 -
arch/arm/configs/lpd270_defconfig | 58 -
arch/arm/configs/lubbock_defconfig | 53 -
arch/arm/configs/magician_defconfig | 151 --
arch/arm/configs/mainstone_defconfig | 51 -
arch/arm/configs/palmz72_defconfig | 75 -
arch/arm/configs/pcm027_defconfig | 90 -
arch/arm/configs/pxa255-idp_defconfig | 55 -
arch/arm/configs/pxa_defconfig | 3 -
arch/arm/configs/trizeps4_defconfig | 207 ---
arch/arm/configs/viper_defconfig | 160 --
arch/arm/configs/xcep_defconfig | 90 -
arch/arm/configs/zeus_defconfig | 173 --
arch/arm/mach-pxa/Kconfig | 583 +-----
arch/arm/mach-pxa/Makefile | 60 +-
arch/arm/mach-pxa/balloon3-pcmcia.c | 137 --
arch/arm/mach-pxa/balloon3.c | 821 --------
arch/arm/mach-pxa/balloon3.h | 181 --
arch/arm/mach-pxa/capc7117.c | 159 --
arch/arm/mach-pxa/cm-x300.c | 883 ---------
arch/arm/mach-pxa/colibri-evalboard.c | 138 --
arch/arm/mach-pxa/colibri-pcmcia.c | 165 --
arch/arm/mach-pxa/colibri-pxa270-income.c | 236 ---
arch/arm/mach-pxa/colibri-pxa270.c | 330 ----
arch/arm/mach-pxa/colibri-pxa300.c | 193 --
arch/arm/mach-pxa/colibri-pxa320.c | 264 ---
arch/arm/mach-pxa/colibri-pxa3xx.c | 147 --
arch/arm/mach-pxa/colibri.h | 70 -
arch/arm/mach-pxa/corgi.c | 826 ---------
arch/arm/mach-pxa/corgi.h | 110 --
arch/arm/mach-pxa/corgi_pm.c | 221 ---
arch/arm/mach-pxa/csb701.c | 67 -
arch/arm/mach-pxa/csb726.c | 291 ---
arch/arm/mach-pxa/csb726.h | 24 -
arch/arm/mach-pxa/devices.c | 408 ----
arch/arm/mach-pxa/devices.h | 3 -
arch/arm/mach-pxa/e740-pcmcia.c | 127 --
arch/arm/mach-pxa/eseries-gpio.h | 63 -
arch/arm/mach-pxa/eseries-irq.h | 24 -
arch/arm/mach-pxa/eseries.c | 1001 ----------
arch/arm/mach-pxa/ezx.c | 1254 -------------
arch/arm/mach-pxa/h5000.c | 210 ---
arch/arm/mach-pxa/h5000.h | 109 --
arch/arm/mach-pxa/himalaya.c | 166 --
arch/arm/mach-pxa/hx4700-pcmcia.c | 118 --
arch/arm/mach-pxa/hx4700.c | 942 ----------
arch/arm/mach-pxa/hx4700.h | 129 --
arch/arm/mach-pxa/icontrol.c | 218 ---
arch/arm/mach-pxa/idp.c | 285 ---
arch/arm/mach-pxa/idp.h | 195 --
arch/arm/mach-pxa/littleton.c | 462 -----
arch/arm/mach-pxa/littleton.h | 14 -
arch/arm/mach-pxa/lpd270.c | 518 ------
arch/arm/mach-pxa/lpd270.h | 40 -
arch/arm/mach-pxa/lubbock.c | 649 -------
arch/arm/mach-pxa/lubbock.h | 47 -
arch/arm/mach-pxa/magician.c | 1112 -----------
arch/arm/mach-pxa/magician.h | 125 --
arch/arm/mach-pxa/mainstone.c | 738 --------
arch/arm/mach-pxa/mainstone.h | 140 --
arch/arm/mach-pxa/mfp-pxa25x.h | 33 -
arch/arm/mach-pxa/mfp-pxa2xx.c | 4 -
arch/arm/mach-pxa/mfp-pxa300.h | 52 -
arch/arm/mach-pxa/mfp-pxa320.h | 458 -----
arch/arm/mach-pxa/mfp-pxa930.h | 495 -----
arch/arm/mach-pxa/mioa701.c | 784 --------
arch/arm/mach-pxa/mioa701.h | 76 -
arch/arm/mach-pxa/mioa701_bootresume.S | 38 -
arch/arm/mach-pxa/mp900.c | 101 -
arch/arm/mach-pxa/mxm8x10.c | 477 -----
arch/arm/mach-pxa/mxm8x10.h | 22 -
arch/arm/mach-pxa/palm27x.c | 473 -----
arch/arm/mach-pxa/palm27x.h | 77 -
arch/arm/mach-pxa/palmld-pcmcia.c | 111 --
arch/arm/mach-pxa/palmld.c | 392 ----
arch/arm/mach-pxa/palmld.h | 107 --
arch/arm/mach-pxa/palmt5.c | 234 ---
arch/arm/mach-pxa/palmt5.h | 82 -
arch/arm/mach-pxa/palmtc-pcmcia.c | 162 --
arch/arm/mach-pxa/palmtc.c | 539 ------
arch/arm/mach-pxa/palmtc.h | 84 -
arch/arm/mach-pxa/palmte2.c | 383 ----
arch/arm/mach-pxa/palmte2.h | 64 -
arch/arm/mach-pxa/palmtreo.c | 548 ------
arch/arm/mach-pxa/palmtreo.h | 64 -
arch/arm/mach-pxa/palmtx-pcmcia.c | 111 --
arch/arm/mach-pxa/palmtx.c | 390 ----
arch/arm/mach-pxa/palmtx.h | 110 --
arch/arm/mach-pxa/palmz72.c | 319 ----
arch/arm/mach-pxa/palmz72.h | 80 -
arch/arm/mach-pxa/pcm027.c | 266 ---
arch/arm/mach-pxa/pcm027.h | 73 -
arch/arm/mach-pxa/pcm990-baseboard.c | 408 ----
arch/arm/mach-pxa/pcm990_baseboard.h | 199 --
arch/arm/mach-pxa/pm.c | 2 -
arch/arm/mach-pxa/pm.h | 10 -
arch/arm/mach-pxa/poodle.c | 484 -----
arch/arm/mach-pxa/poodle.h | 92 -
arch/arm/mach-pxa/pxa25x.c | 7 -
arch/arm/mach-pxa/pxa27x.c | 18 +-
arch/arm/mach-pxa/pxa27x.h | 3 -
arch/arm/mach-pxa/pxa2xx.c | 29 -
arch/arm/mach-pxa/pxa300.c | 17 +-
arch/arm/mach-pxa/pxa320.c | 88 -
arch/arm/mach-pxa/pxa320.h | 9 -
arch/arm/mach-pxa/pxa3xx-ulpi.c | 385 ----
arch/arm/mach-pxa/pxa3xx.c | 91 -
arch/arm/mach-pxa/pxa930.c | 217 ---
arch/arm/mach-pxa/pxa930.h | 8 -
arch/arm/mach-pxa/pxa_cplds_irqs.c | 200 --
arch/arm/mach-pxa/regs-u2d.h | 199 --
arch/arm/mach-pxa/regs-uart.h | 146 --
arch/arm/mach-pxa/saar.c | 604 ------
arch/arm/mach-pxa/sharpsl_pm.c | 4 -
arch/arm/mach-pxa/spitz.c | 23 -
arch/arm/mach-pxa/tavorevb.c | 506 -----
arch/arm/mach-pxa/tosa-bt.c | 134 --
arch/arm/mach-pxa/tosa.c | 946 ----------
arch/arm/mach-pxa/tosa.h | 165 --
arch/arm/mach-pxa/tosa_bt.h | 18 -
arch/arm/mach-pxa/trizeps4-pcmcia.c | 200 --
arch/arm/mach-pxa/trizeps4.c | 575 ------
arch/arm/mach-pxa/trizeps4.h | 166 --
arch/arm/mach-pxa/viper-pcmcia.c | 180 --
arch/arm/mach-pxa/viper-pcmcia.h | 12 -
arch/arm/mach-pxa/viper.c | 1034 -----------
arch/arm/mach-pxa/viper.h | 91 -
arch/arm/mach-pxa/vpac270-pcmcia.c | 137 --
arch/arm/mach-pxa/vpac270.c | 736 --------
arch/arm/mach-pxa/vpac270.h | 38 -
arch/arm/mach-pxa/xcep.c | 190 --
arch/arm/mach-pxa/z2.c | 781 --------
arch/arm/mach-pxa/z2.h | 37 -
arch/arm/mach-pxa/zeus.c | 974 ----------
arch/arm/mach-pxa/zeus.h | 82 -
arch/arm/mach-pxa/zylonite.c | 495 -----
arch/arm/mach-pxa/zylonite.h | 45 -
arch/arm/mach-pxa/zylonite_pxa300.c | 281 ---
arch/arm/mach-pxa/zylonite_pxa320.c | 213 ---
arch/arm/mach-tegra/tegra.c | 1 -
drivers/ata/Kconfig | 9 -
drivers/ata/Makefile | 1 -
drivers/ata/pata_palmld.c | 137 --
drivers/clk/pxa/clk-pxa3xx.c | 22 +-
drivers/cpufreq/pxa3xx-cpufreq.c | 21 +-
drivers/gpio/Kconfig | 7 -
drivers/gpio/Makefile | 1 -
drivers/gpio/gpio-ucb1400.c | 85 -
drivers/input/keyboard/Kconfig | 9 -
drivers/input/keyboard/Makefile | 1 -
drivers/input/keyboard/pxa930_rotary.c | 195 --
drivers/input/mouse/Kconfig | 6 -
drivers/input/mouse/Makefile | 1 -
drivers/input/mouse/pxa930_trkball.c | 250 ---
drivers/input/touchscreen/Kconfig | 30 -
drivers/input/touchscreen/Makefile | 2 -
drivers/input/touchscreen/mainstone-wm97xx.c | 10 -
drivers/input/touchscreen/ucb1400_ts.c | 458 -----
drivers/input/touchscreen/zylonite-wm97xx.c | 220 ---
drivers/leds/Kconfig | 11 -
drivers/leds/Makefile | 1 -
drivers/leds/leds-asic3.c | 177 --
drivers/mfd/Kconfig | 58 -
drivers/mfd/Makefile | 7 -
drivers/mfd/asic3.c | 1071 -----------
drivers/mfd/htc-pasic3.c | 210 ---
drivers/mfd/t7l66xb.c | 427 -----
drivers/mfd/tc6387xb.c | 228 ---
drivers/mfd/tc6393xb.c | 907 ---------
drivers/mfd/tmio_core.c | 70 -
drivers/mfd/ucb1400_core.c | 158 --
drivers/mmc/host/Kconfig | 8 -
drivers/mmc/host/Makefile | 1 -
drivers/mmc/host/pxamci.c | 3 +-
drivers/mmc/host/tmio_mmc.c | 227 ---
drivers/mtd/nand/raw/Kconfig | 7 -
drivers/mtd/nand/raw/Makefile | 1 -
drivers/mtd/nand/raw/tmio_nand.c | 533 ------
drivers/pcmcia/Kconfig | 12 +-
drivers/pcmcia/Makefile | 5 -
drivers/pcmcia/pxa2xx_base.c | 14 +-
drivers/pcmcia/pxa2xx_mainstone.c | 122 --
drivers/pcmcia/sa1100_simpad.c | 115 --
drivers/pcmcia/sa1111_badge4.c | 158 --
drivers/pcmcia/sa1111_generic.c | 4 -
drivers/pcmcia/sa1111_lubbock.c | 155 --
drivers/power/supply/Kconfig | 22 -
drivers/power/supply/Makefile | 3 -
drivers/power/supply/ds2760_battery.c | 8 -
drivers/power/supply/pda_power.c | 520 ------
drivers/power/supply/tosa_battery.c | 512 -----
drivers/power/supply/z2_battery.c | 318 ----
drivers/rtc/Kconfig | 9 -
drivers/rtc/Makefile | 1 -
drivers/rtc/rtc-v3020.c | 369 ----
drivers/usb/gadget/udc/pxa25x_udc.c | 62 -
drivers/usb/host/ohci-hcd.c | 18 -
drivers/usb/host/ohci-pxa27x.c | 9 -
drivers/usb/host/ohci-tmio.c | 364 ----
drivers/video/backlight/Kconfig | 14 -
drivers/video/backlight/Makefile | 2 -
drivers/video/backlight/locomolcd.c | 10 -
drivers/video/backlight/tosa_bl.c | 172 --
drivers/video/backlight/tosa_bl.h | 8 -
drivers/video/backlight/tosa_lcd.c | 284 ---
drivers/video/fbdev/Kconfig | 39 -
drivers/video/fbdev/Makefile | 2 -
drivers/video/fbdev/tmiofb.c | 1040 -----------
drivers/video/fbdev/w100fb.c | 1644 -----------------
drivers/video/fbdev/w100fb.h | 924 ---------
drivers/w1/masters/Kconfig | 7 -
drivers/w1/masters/Makefile | 1 -
drivers/w1/masters/ds1wm.c | 675 -------
include/linux/mfd/asic3.h | 313 ----
include/linux/mfd/htc-pasic3.h | 54 -
include/linux/mfd/t7l66xb.h | 29 -
include/linux/mfd/tc6387xb.h | 19 -
include/linux/mfd/tc6393xb.h | 53 -
include/linux/mfd/tmio.h | 5 -
include/linux/pda_power.h | 39 -
include/linux/platform_data/asoc-palm27x.h | 9 -
include/linux/platform_data/asoc-poodle.h | 16 -
include/linux/platform_data/irda-pxaficp.h | 26 -
.../platform_data/keyboard-pxa930_rotary.h | 21 -
include/linux/platform_data/mmp_audio.h | 18 -
.../platform_data/mouse-pxa930_trkball.h | 11 -
include/linux/platform_data/rtc-v3020.h | 41 -
include/linux/platform_data/usb-pxa3xx-ulpi.h | 32 -
include/linux/soc/pxa/cpu.h | 93 +-
include/linux/ucb1400.h | 160 --
include/linux/z2_battery.h | 17 -
include/video/w100fb.h | 147 --
sound/Kconfig | 1 -
sound/pci/ac97/ac97_codec.c | 1 -
sound/pci/ac97/ac97_patch.c | 40 -
sound/soc/pxa/Kconfig | 181 +-
sound/soc/pxa/Makefile | 33 -
sound/soc/pxa/brownstone.c | 133 --
sound/soc/pxa/corgi.c | 332 ----
sound/soc/pxa/e740_wm9705.c | 168 --
sound/soc/pxa/e750_wm9705.c | 147 --
sound/soc/pxa/e800_wm9712.c | 147 --
sound/soc/pxa/em-x270.c | 92 -
sound/soc/pxa/hx4700.c | 207 ---
sound/soc/pxa/magician.c | 366 ----
sound/soc/pxa/mioa701_wm9713.c | 201 --
sound/soc/pxa/mmp-pcm.c | 267 ---
sound/soc/pxa/palm27x.c | 162 --
sound/soc/pxa/poodle.c | 291 ---
sound/soc/pxa/tosa.c | 255 ---
sound/soc/pxa/ttc-dkb.c | 143 --
sound/soc/pxa/z2.c | 218 ---
sound/soc/pxa/zylonite.c | 266 ---
261 files changed, 22 insertions(+), 53872 deletions(-)
delete mode 100644 arch/arm/configs/cm_x300_defconfig
delete mode 100644 arch/arm/configs/colibri_pxa270_defconfig
delete mode 100644 arch/arm/configs/colibri_pxa300_defconfig
delete mode 100644 arch/arm/configs/corgi_defconfig
delete mode 100644 arch/arm/configs/eseries_pxa_defconfig
delete mode 100644 arch/arm/configs/ezx_defconfig
delete mode 100644 arch/arm/configs/h5000_defconfig
delete mode 100644 arch/arm/configs/lpd270_defconfig
delete mode 100644 arch/arm/configs/lubbock_defconfig
delete mode 100644 arch/arm/configs/magician_defconfig
delete mode 100644 arch/arm/configs/mainstone_defconfig
delete mode 100644 arch/arm/configs/palmz72_defconfig
delete mode 100644 arch/arm/configs/pcm027_defconfig
delete mode 100644 arch/arm/configs/pxa255-idp_defconfig
delete mode 100644 arch/arm/configs/trizeps4_defconfig
delete mode 100644 arch/arm/configs/viper_defconfig
delete mode 100644 arch/arm/configs/xcep_defconfig
delete mode 100644 arch/arm/configs/zeus_defconfig
delete mode 100644 arch/arm/mach-pxa/balloon3-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/balloon3.c
delete mode 100644 arch/arm/mach-pxa/balloon3.h
delete mode 100644 arch/arm/mach-pxa/capc7117.c
delete mode 100644 arch/arm/mach-pxa/cm-x300.c
delete mode 100644 arch/arm/mach-pxa/colibri-evalboard.c
delete mode 100644 arch/arm/mach-pxa/colibri-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/colibri-pxa270-income.c
delete mode 100644 arch/arm/mach-pxa/colibri-pxa270.c
delete mode 100644 arch/arm/mach-pxa/colibri-pxa300.c
delete mode 100644 arch/arm/mach-pxa/colibri-pxa320.c
delete mode 100644 arch/arm/mach-pxa/colibri-pxa3xx.c
delete mode 100644 arch/arm/mach-pxa/colibri.h
delete mode 100644 arch/arm/mach-pxa/corgi.c
delete mode 100644 arch/arm/mach-pxa/corgi.h
delete mode 100644 arch/arm/mach-pxa/corgi_pm.c
delete mode 100644 arch/arm/mach-pxa/csb701.c
delete mode 100644 arch/arm/mach-pxa/csb726.c
delete mode 100644 arch/arm/mach-pxa/csb726.h
delete mode 100644 arch/arm/mach-pxa/e740-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/eseries-gpio.h
delete mode 100644 arch/arm/mach-pxa/eseries-irq.h
delete mode 100644 arch/arm/mach-pxa/eseries.c
delete mode 100644 arch/arm/mach-pxa/ezx.c
delete mode 100644 arch/arm/mach-pxa/h5000.c
delete mode 100644 arch/arm/mach-pxa/h5000.h
delete mode 100644 arch/arm/mach-pxa/himalaya.c
delete mode 100644 arch/arm/mach-pxa/hx4700-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/hx4700.c
delete mode 100644 arch/arm/mach-pxa/hx4700.h
delete mode 100644 arch/arm/mach-pxa/icontrol.c
delete mode 100644 arch/arm/mach-pxa/idp.c
delete mode 100644 arch/arm/mach-pxa/idp.h
delete mode 100644 arch/arm/mach-pxa/littleton.c
delete mode 100644 arch/arm/mach-pxa/littleton.h
delete mode 100644 arch/arm/mach-pxa/lpd270.c
delete mode 100644 arch/arm/mach-pxa/lpd270.h
delete mode 100644 arch/arm/mach-pxa/lubbock.c
delete mode 100644 arch/arm/mach-pxa/lubbock.h
delete mode 100644 arch/arm/mach-pxa/magician.c
delete mode 100644 arch/arm/mach-pxa/magician.h
delete mode 100644 arch/arm/mach-pxa/mainstone.c
delete mode 100644 arch/arm/mach-pxa/mainstone.h
delete mode 100644 arch/arm/mach-pxa/mfp-pxa320.h
delete mode 100644 arch/arm/mach-pxa/mfp-pxa930.h
delete mode 100644 arch/arm/mach-pxa/mioa701.c
delete mode 100644 arch/arm/mach-pxa/mioa701.h
delete mode 100644 arch/arm/mach-pxa/mioa701_bootresume.S
delete mode 100644 arch/arm/mach-pxa/mp900.c
delete mode 100644 arch/arm/mach-pxa/mxm8x10.c
delete mode 100644 arch/arm/mach-pxa/mxm8x10.h
delete mode 100644 arch/arm/mach-pxa/palm27x.c
delete mode 100644 arch/arm/mach-pxa/palm27x.h
delete mode 100644 arch/arm/mach-pxa/palmld-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/palmld.c
delete mode 100644 arch/arm/mach-pxa/palmld.h
delete mode 100644 arch/arm/mach-pxa/palmt5.c
delete mode 100644 arch/arm/mach-pxa/palmt5.h
delete mode 100644 arch/arm/mach-pxa/palmtc-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/palmtc.c
delete mode 100644 arch/arm/mach-pxa/palmtc.h
delete mode 100644 arch/arm/mach-pxa/palmte2.c
delete mode 100644 arch/arm/mach-pxa/palmte2.h
delete mode 100644 arch/arm/mach-pxa/palmtreo.c
delete mode 100644 arch/arm/mach-pxa/palmtreo.h
delete mode 100644 arch/arm/mach-pxa/palmtx-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/palmtx.c
delete mode 100644 arch/arm/mach-pxa/palmtx.h
delete mode 100644 arch/arm/mach-pxa/palmz72.c
delete mode 100644 arch/arm/mach-pxa/palmz72.h
delete mode 100644 arch/arm/mach-pxa/pcm027.c
delete mode 100644 arch/arm/mach-pxa/pcm027.h
delete mode 100644 arch/arm/mach-pxa/pcm990-baseboard.c
delete mode 100644 arch/arm/mach-pxa/pcm990_baseboard.h
delete mode 100644 arch/arm/mach-pxa/poodle.c
delete mode 100644 arch/arm/mach-pxa/poodle.h
delete mode 100644 arch/arm/mach-pxa/pxa320.c
delete mode 100644 arch/arm/mach-pxa/pxa320.h
delete mode 100644 arch/arm/mach-pxa/pxa3xx-ulpi.c
delete mode 100644 arch/arm/mach-pxa/pxa930.c
delete mode 100644 arch/arm/mach-pxa/pxa930.h
delete mode 100644 arch/arm/mach-pxa/pxa_cplds_irqs.c
delete mode 100644 arch/arm/mach-pxa/regs-u2d.h
delete mode 100644 arch/arm/mach-pxa/regs-uart.h
delete mode 100644 arch/arm/mach-pxa/saar.c
delete mode 100644 arch/arm/mach-pxa/tavorevb.c
delete mode 100644 arch/arm/mach-pxa/tosa-bt.c
delete mode 100644 arch/arm/mach-pxa/tosa.c
delete mode 100644 arch/arm/mach-pxa/tosa.h
delete mode 100644 arch/arm/mach-pxa/tosa_bt.h
delete mode 100644 arch/arm/mach-pxa/trizeps4-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/trizeps4.c
delete mode 100644 arch/arm/mach-pxa/trizeps4.h
delete mode 100644 arch/arm/mach-pxa/viper-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/viper-pcmcia.h
delete mode 100644 arch/arm/mach-pxa/viper.c
delete mode 100644 arch/arm/mach-pxa/viper.h
delete mode 100644 arch/arm/mach-pxa/vpac270-pcmcia.c
delete mode 100644 arch/arm/mach-pxa/vpac270.c
delete mode 100644 arch/arm/mach-pxa/vpac270.h
delete mode 100644 arch/arm/mach-pxa/xcep.c
delete mode 100644 arch/arm/mach-pxa/z2.c
delete mode 100644 arch/arm/mach-pxa/z2.h
delete mode 100644 arch/arm/mach-pxa/zeus.c
delete mode 100644 arch/arm/mach-pxa/zeus.h
delete mode 100644 arch/arm/mach-pxa/zylonite.c
delete mode 100644 arch/arm/mach-pxa/zylonite.h
delete mode 100644 arch/arm/mach-pxa/zylonite_pxa300.c
delete mode 100644 arch/arm/mach-pxa/zylonite_pxa320.c
delete mode 100644 drivers/ata/pata_palmld.c
delete mode 100644 drivers/gpio/gpio-ucb1400.c
delete mode 100644 drivers/input/keyboard/pxa930_rotary.c
delete mode 100644 drivers/input/mouse/pxa930_trkball.c
delete mode 100644 drivers/input/touchscreen/ucb1400_ts.c
delete mode 100644 drivers/input/touchscreen/zylonite-wm97xx.c
delete mode 100644 drivers/leds/leds-asic3.c
delete mode 100644 drivers/mfd/asic3.c
delete mode 100644 drivers/mfd/htc-pasic3.c
delete mode 100644 drivers/mfd/t7l66xb.c
delete mode 100644 drivers/mfd/tc6387xb.c
delete mode 100644 drivers/mfd/tc6393xb.c
delete mode 100644 drivers/mfd/tmio_core.c
delete mode 100644 drivers/mfd/ucb1400_core.c
delete mode 100644 drivers/mmc/host/tmio_mmc.c
delete mode 100644 drivers/mtd/nand/raw/tmio_nand.c
delete mode 100644 drivers/pcmcia/pxa2xx_mainstone.c
delete mode 100644 drivers/pcmcia/sa1100_simpad.c
delete mode 100644 drivers/pcmcia/sa1111_badge4.c
delete mode 100644 drivers/pcmcia/sa1111_lubbock.c
delete mode 100644 drivers/power/supply/pda_power.c
delete mode 100644 drivers/power/supply/tosa_battery.c
delete mode 100644 drivers/power/supply/z2_battery.c
delete mode 100644 drivers/rtc/rtc-v3020.c
delete mode 100644 drivers/usb/host/ohci-tmio.c
delete mode 100644 drivers/video/backlight/tosa_bl.c
delete mode 100644 drivers/video/backlight/tosa_bl.h
delete mode 100644 drivers/video/backlight/tosa_lcd.c
delete mode 100644 drivers/video/fbdev/tmiofb.c
delete mode 100644 drivers/video/fbdev/w100fb.c
delete mode 100644 drivers/video/fbdev/w100fb.h
delete mode 100644 drivers/w1/masters/ds1wm.c
delete mode 100644 include/linux/mfd/asic3.h
delete mode 100644 include/linux/mfd/htc-pasic3.h
delete mode 100644 include/linux/mfd/t7l66xb.h
delete mode 100644 include/linux/mfd/tc6387xb.h
delete mode 100644 include/linux/mfd/tc6393xb.h
delete mode 100644 include/linux/pda_power.h
delete mode 100644 include/linux/platform_data/asoc-palm27x.h
delete mode 100644 include/linux/platform_data/asoc-poodle.h
delete mode 100644 include/linux/platform_data/irda-pxaficp.h
delete mode 100644 include/linux/platform_data/keyboard-pxa930_rotary.h
delete mode 100644 include/linux/platform_data/mmp_audio.h
delete mode 100644 include/linux/platform_data/mouse-pxa930_trkball.h
delete mode 100644 include/linux/platform_data/rtc-v3020.h
delete mode 100644 include/linux/platform_data/usb-pxa3xx-ulpi.h
delete mode 100644 include/linux/ucb1400.h
delete mode 100644 include/linux/z2_battery.h
delete mode 100644 include/video/w100fb.h
delete mode 100644 sound/soc/pxa/brownstone.c
delete mode 100644 sound/soc/pxa/corgi.c
delete mode 100644 sound/soc/pxa/e740_wm9705.c
delete mode 100644 sound/soc/pxa/e750_wm9705.c
delete mode 100644 sound/soc/pxa/e800_wm9712.c
delete mode 100644 sound/soc/pxa/em-x270.c
delete mode 100644 sound/soc/pxa/hx4700.c
delete mode 100644 sound/soc/pxa/magician.c
delete mode 100644 sound/soc/pxa/mioa701_wm9713.c
delete mode 100644 sound/soc/pxa/mmp-pcm.c
delete mode 100644 sound/soc/pxa/palm27x.c
delete mode 100644 sound/soc/pxa/poodle.c
delete mode 100644 sound/soc/pxa/tosa.c
delete mode 100644 sound/soc/pxa/ttc-dkb.c
delete mode 100644 sound/soc/pxa/z2.c
delete mode 100644 sound/soc/pxa/zylonite.c
--
2.39.0
Cc: stern@rowland.harvard.edu
Cc: alexandre.belloni@bootlin.com
Cc: brgl@bgdev.pl
Cc: damien.lemoal@opensource.wdc.com
Cc: daniel@zonque.org
Cc: dmitry.torokhov@gmail.com
Cc: linux@dominikbrodowski.net
Cc: balbi@kernel.org
Cc: gregkh@linuxfoundation.org
Cc: haojian.zhuang@gmail.com
Cc: deller@gmx.de
Cc: perex@perex.cz
Cc: jingoohan1@gmail.com
Cc: lee@kernel.org
Cc: kernel@wantstofly.org
Cc: lgirdwood@gmail.com
Cc: linus.walleij@linaro.org
Cc: marek.vasut@gmail.com
Cc: broonie@kernel.org
Cc: mkpetch@internode.on.net
Cc: miquel.raynal@bootlin.com
Cc: lost.distance@yahoo.com
Cc: philipp.zabel@gmail.com
Cc: robert.jarzmik@free.fr
Cc: linux@armlinux.org.uk
Cc: sre@kernel.org
Cc: slapin@ossfans.org
Cc: s.shtylyov@omp.ru
Cc: sudipm.mukherjee@gmail.com
Cc: tiwai@suse.com
Cc: ulf.hansson@linaro.org
Cc: vigneshr@ti.com
Cc: viresh.kumar@linaro.org
Cc: wsa+renesas@sang-engineering.com
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-ide@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: patches@opensource.cirrus.com
Cc: linux-leds@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-mtd@lists.infradead.org
Cc: linux-rtc@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: alsa-devel@alsa-project.org
^ permalink raw reply
* Re: [PATCH] HID: sony: Fix division by zero
From: Alain Carlucci @ 2023-01-05 10:44 UTC (permalink / raw)
To: Roderick Colenbrander; +Cc: linux-input, Jiri Kosina, djogorchock
In-Reply-To: <CAEc3jaD78h1qbWg+QQ40_yv5xc-oGFHAEyEOx2Nh20C-pxwcJg@mail.gmail.com>
Hi Roderick,
sorry for the late response, I've been busy in these days. I'll reply
to both emails in this one.
>Thanks for testing. I added a similar patch to my hid-playstation tree
>this morning (hid-sony will go away soon).
Ok perfect! Does hid-sony will continue to support old Dualshock
controllers or they will be all merged into hid-playstation?
>I'm not entirely happy with the patches yet and need to do some
>thinking. The issue is the value range, which is not correct. For the
>accelerometer the numerator and denominator need to be 1 to match the
>proper range. (It just happens that the scaling factors are the way
>they are I think.)
>The uncalibrated gyroscope values are 16-bit signed, but the hardware
>limits are +/- 2000 degree per second. To have enough precision during
>calibration the value range is extended (resolution per axis is set to
>1024, so 1024 corresponds to 1 degree per second).
Can you tell me a bit more about what is the expected calibrated
output for both gyro and accelerometer?
Like unit of measurement (I hope deg/s and m/s^2) and data type?
Is "1024 -> 1dg/s" a mapping used only while calibrating or is the
expected conversion during normal usage?
>When I heavily shake a DS4 in evtest, I can easily reach values like
>15 million or more. However, the maximum value we have set on the
>evdev node to about 2M. In other words there is something wrong. I
>need to look closely at other internal code.
Definitely seems there is an issue.
Can you suggest me a tool to test the gyro/accel using linux?
Thanks,
Alain
^ permalink raw reply
* [Regression] Bug 216885 - HID++ Logitech G903 generates full scroll wheel events with every hi-res tick when attached via USB
From: Thorsten Leemhuis @ 2023-01-05 8:12 UTC (permalink / raw)
To: Bastien Nocera
Cc: David Roth, Benjamin Tissoires, Jiri Kosina,
open list:HID CORE LAYER, regressions@lists.linux.dev, LKML
Hi, this is your Linux kernel regression tracker speaking.
I noticed a regression report in bugzilla.kernel.org. As many (most?)
kernel developer don't keep an eye on it, I decided to forward it by
mail. Quoting from https://bugzilla.kernel.org/show_bug.cgi?id=216885 :
> David Roth 2023-01-04 20:37:22 UTC
>
> Created attachment 303526 [details]
> Libinput record with G903 attached directly to USB
>
> Since
> https://lore.kernel.org/linux-input/20220914132146.6435-1-hadess@hadess.net/T/#u
> my Logitech G903 has gained hi res support. While normally a good
> thing, it seems that in this case it leads to generating one normal
> REL_WHEEL with each REL_WHEEL_HI_RES event instead of just a couple
> of REL_WHEEL_HI_RES, followed by the standard REL_WHEEL once a
> notch/tick is reached. This leads to overly sensitive scrolling and
> makes the wheel basically useless.
>
> Interestingly this only happens when the mouse is connected directly via
> cable (PID:0xC091) and not via the Lightspeed wireless dongle
> (PID:0x4087) where it will lead to correctly applying the times 8
> multiplier and the relevant set of HI_RES and REL_WHEEL event once a
> notch is reached.
>
> I originally thought about patching the module/adding a param to simple
> disable high res support in general, assuming this might be something
> people might want to configure, but seeing that this can be "fixed" that
> way I decided to hold off on the thought.
>
> However it seems like we'd need to trade one set of quirks for another,
> so not sure what the correct approach might be.
>
> I'll attach some libinput debug logs when the issue happens.
See the ticket for more details.
BTW, let me use this mail to also add the report to the list of tracked
regressions to ensure it's doesn't fall through the cracks:
#regzbot introduced: 908d325e1665
https://bugzilla.kernel.org/show_bug.cgi?id=216885
#regzbot title: hid: overly sensitive scrolling with Logitech G903 that
makes the wheel basically useless
#regzbot ignore-activity
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.
^ permalink raw reply
* Re: [PATCH] HID: sony: Fix division by zero
From: Roderick Colenbrander @ 2023-01-04 20:47 UTC (permalink / raw)
To: Alain; +Cc: linux-input, Jiri Kosina, djogorchock
In-Reply-To: <CAEc3jaBz92QRKCs1Ckb0njDNMu4=CHZcUJ=MPif3Mzvw_Xok2w@mail.gmail.com>
Hi Alain,
Just a brief update. I'm still looking at this and I'm not yet sure
what to do. It looks like there is something wrong with the value
ranges of the gyroscope. I need to dig deep in my memory how this code
came around. Some parts of the sensors code were developed and tested
by a team member, who left. For testing he used some internal test 3D
application in which you center some object. There is some validation
there on the values. However, there is just something strange.
The uncalibrated gyroscope values are 16-bit signed, but the hardware
limits are +/- 2000 degree per second. To have enough precision during
calibration the value range is extended (resolution per axis is set to
1024, so 1024 corresponds to 1 degree per second).
When I heavily shake a DS4 in evtest, I can easily reach values like
15 million or more. However, the maximum value we have set on the
evdev node to about 2M. In other words there is something wrong. I
need to look closely at other internal code.
I really hate this as if true, the DS4 unit tests in hid-tools (and
Android) are broken too.
Thanks,
Roderick
On Fri, Dec 30, 2022 at 1:53 PM Roderick Colenbrander
<thunderbird2k@gmail.com> wrote:
>
> Hi Alain,
>
> Thanks for testing. I added a similar patch to my hid-playstation tree
> this morning (hid-sony will go away soon).
>
> I'm not entirely happy with the patches yet and need to do some
> thinking. The issue is the value range, which is not correct. For the
> accelerometer the numerator and denominator need to be 1 to match the
> proper range. (It just happens that the scaling factors are the way
> they are I think.)
>
> The gyroscope is the issue and I'm not entirely sure what the
> numerator needs to be. If I print the coefficients using one of my
> dualshocks, the ratio of numerator to denominator is around 60. And
> then I'm hunted by some comment from someone in the community..
> https://dsremap.readthedocs.io/en/latest/reverse.html#use-calibration
>
> "Note:
> There’s a 2 factor in the Linux driver, i.e. max_speed and min_speed
> are added instead of averaged. Either there’s something I don’t get,
> or the factor is taken care of in the resolution constant, or it’s a
> bug.
> "
>
> I need to do some thinking on whether the current code is right (even
> if it isn't, it can't be changed as it would break software). Then
> what the factor needs to be.
>
> Thanks,
> Roderick
>
> On Fri, Dec 30, 2022 at 10:12 AM Alain <alain.carlucci@gmail.com> wrote:
> >
> > Hi Roderick,
> > Hi Daniel,
> >
> > Thank you for all the suggestions, Roderick.
> > I fixed the typo in your patch, backported to hid-sony and tested both of them.
> > They fix the issue and the DS4 can be used even without calibration data.
> > I cannot test if everything works well with a DualSense because I do not own one.
> >
> > Hi Daniel, I've seen that in the hid-nintendo driver, the calibration denominator is not sanitized if it's zero.
> > If I'm not mistaken, a device that disguises itself as a joycon with denominator zero can crash the kernel
> > when this is used in the mult_frac(). I had this behaviour with the hid-sony driver.
> > You can find attached the patch that should solve the problem.
> >
> > Thanks,
> > Alain
> >
> >
> > Il giorno gio 29 dic 2022 alle ore 21:56 Roderick Colenbrander <thunderbird2k@gmail.com> ha scritto:
> >>
> >> Hi Alain,
> >>
> >> On Thu, Dec 29, 2022 at 11:21 AM Alain Carlucci
> >> <alain.carlucci@gmail.com> wrote:
> >> >
> >> > Hi Roderick,
> >> >
> >> > >Give this patch a try. It is against hid-playstation, which as of 6.2
> >> > >supports DS4. Let me know if it works. You can see the sensors working
> >> > >through evdev on the motion sensors device.
> >> >
> >> > Thank you for the patch, just tried. I think there is a typo in the
> >> > condition of the for-loop that sanitizes the input.
> >> > Instead of `; i < ARRAY_SIZE()` it's written `; ARRAY_SIZE()`,
> >> > which always evaluates to true. The loop then overflows the array and
> >> > crashes the kernel.
> >>
> >> Ooh oops. It was a quick patch I wrote without testing.
> >>
> >> > By the way, the DualSense code has similar calibration code and also
> >> > there the input is not sanitized.
> >> > I think it's quite easy to create a fake DualSense device with
> >> > an Arduino that emulates the protocol up to calib_denom=0, just to
> >> > exploit that and crash every linux machine is plugged in. Or even
> >> > worst, exploit that via bluetooth.
> >>
> >> You are right it probably won't hurt to duplicate the logic there.
> >>
> >> > >If you want to dig deeper, you can play around with
> >> > >dualshock4_get_calibration_data in hid-playstation. The particular
> >> > >report (though not fully documented in the driver) does contain a lot
> >> > >of device info (firmware info, manufacturing dates, various strings).
> >> > >You can probably find the details online. Some data there might be
> >> > >weird or not populated.
> >> >
> >> > Thank you! Just discovered that this strange DS4 (CUH-ZCT2E) replies
> >> > all zeros both to HID request 0x02 (get calibration data) and as the
> >> > BT address (request 0x12, Pairing Info), which explains why BT is not
> >> > working.
> >>
> >> There is definitely something weird with your device. Something must
> >> have gotten wiped somehow.
> >>
> >> > I tried to request version info (0xa3), the response seems the same as
> >> > another fully-working and original CUH-ZCT2E:
> >> > """
> >> > Build Date: Sep 21 2018 04:50:51
> >> > HW Version: 0100.b008
> >> > SW Version: 00000001.a00a
> >> > SW Series: 2010
> >> > Code Size: 0002a000
> >> > """
> >> >
> >> > Anyway, I have seen that request 0xA2 puts the DS4 in an alternate
> >> > boot mode, probably DFU mode, where the device reboots as 054c:0856
> >> > and waits for data, which seems totally undocumented online.
> >> > Do you know anything about this mode?
> >> > It would be amazing to be able to reflash the original firmware,
> >>
> >> Unfortunately I can't disclose any of that information. I can say that
> >> on DS4 it wasn't common to update firmware (as opposed to DualSense)
> >> while out in the wild. Some of these requests and others are probably
> >> used to initiate firmware programming and programming of MAC address,
> >> calibration data and other settings. It is probably quite involved and
> >> hard to get right without bricking your device.
> >>
> >> > Thanks,
> >> > Alain
> >>
> >> Thanks,
> >> Roderick
^ permalink raw reply
* [PATCH v2 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-01-04 13:59 UTC (permalink / raw)
To: jiriv
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-input,
linux-kernel, robh+dt, u.kleine-koenig
In-Reply-To: <20230104135951.930783-1-jiriv@axis.com>
Add basic support for more CAP1xxx sensors.
All models from CAP1xxx family are register-compatible.
Some advanced features are not used and disabled by default.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
---
Changes in v2:
- Fixed if statement.
drivers/input/keyboard/cap11xx.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 79afd0386e3f..eb469ef4075e 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -99,6 +99,9 @@ enum {
CAP1126,
CAP1188,
CAP1206,
+ CAP1203,
+ CAP1293,
+ CAP1298
};
static const struct cap11xx_hw_model cap11xx_devices[] = {
@@ -106,6 +109,9 @@ static const struct cap11xx_hw_model cap11xx_devices[] = {
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
+ [CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true },
+ [CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false },
+ [CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false },
};
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -377,7 +383,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
if (error < 0)
return error;
- dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
+ dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
+ id->name, rev);
node = dev->of_node;
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
@@ -390,7 +397,9 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
- if (id->driver_data != CAP1206) {
+ if ((id->driver_data == CAP1106) ||
+ (id->driver_data == CAP1126) ||
+ (id->driver_data == CAP1188)) {
if (of_property_read_bool(node, "microchip,irq-active-high")) {
error = regmap_update_bits(priv->regmap,
CAP11XX_REG_CONFIG2,
@@ -484,6 +493,9 @@ static const struct of_device_id cap11xx_dt_ids[] = {
{ .compatible = "microchip,cap1126", },
{ .compatible = "microchip,cap1188", },
{ .compatible = "microchip,cap1206", },
+ { .compatible = "microchip,cap1203", },
+ { .compatible = "microchip,cap1293", },
+ { .compatible = "microchip,cap1298", },
{}
};
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
@@ -493,6 +505,9 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
{ "cap1126", CAP1126 },
{ "cap1188", CAP1188 },
{ "cap1206", CAP1206 },
+ { "cap1203", CAP1203 },
+ { "cap1293", CAP1293 },
+ { "cap1298", CAP1298 },
{}
};
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
--
2.25.1
^ permalink raw reply related
* [PATCH v2 1/2] dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-01-04 13:59 UTC (permalink / raw)
To: jiriv
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-input,
linux-kernel, robh+dt, u.kleine-koenig
In-Reply-To: <20230104135951.930783-1-jiriv@axis.com>
Add support for cap1203, cap1293 and cap1298.
Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
---
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
index 67d4d8f86a2d..08ca993b94c4 100644
--- a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
+++ b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
@@ -20,6 +20,9 @@ properties:
- microchip,cap1126
- microchip,cap1188
- microchip,cap1206
+ - microchip,cap1203
+ - microchip,cap1293
+ - microchip,cap1298
reg:
maxItems: 1
--
2.25.1
^ permalink raw reply related
* [PATCH v2 0/2] Input: cap11xx add support for cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-01-04 13:59 UTC (permalink / raw)
To: jiriv
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-input,
linux-kernel, robh+dt, u.kleine-koenig
In-Reply-To: <20230103134105.736346-3-jiriv@axis.com>
PATCH 1 - add compatible string for new models
PATCH 2 - add support for new models into driver
Changes in v2:
- Fixed if statement in PATCH 2.
Jiri Valek - 2N (2):
dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and
cap1298
Input: cap11xx - add support for cap1203, cap1293 and cap1298
.../bindings/input/microchip,cap11xx.yaml | 3 +++
drivers/input/keyboard/cap11xx.c | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
--
2.25.1
^ permalink raw reply
* Re: [PATCH 34/69] Input: auo-pixcir-ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Heiko Stübner @ 2023-01-04 10:33 UTC (permalink / raw)
To: linux-input, Dmitry Torokhov, Jonathan Cameron; +Cc: Jonathan Cameron
In-Reply-To: <20230102181842.718010-35-jic23@kernel.org>
Am Montag, 2. Januar 2023, 19:18:07 CET schrieb Jonathan Cameron:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply
* Re: [PATCH 18/69] Input: pmic8xxx-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Stephen Boyd @ 2023-01-04 1:02 UTC (permalink / raw)
To: Dmitry Torokhov, Jonathan Cameron, linux-input; +Cc: Jonathan Cameron
In-Reply-To: <20230102181842.718010-19-jic23@kernel.org>
Quoting Jonathan Cameron (2023-01-02 10:17:51)
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Stephen Boyd <swboyd@chromium.org>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
^ permalink raw reply
* Re: [PATCH 16/69] Input: pm8941-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Stephen Boyd @ 2023-01-04 1:01 UTC (permalink / raw)
To: Dmitry Torokhov, Jonathan Cameron, linux-input; +Cc: Jonathan Cameron
In-Reply-To: <20230102181842.718010-17-jic23@kernel.org>
Quoting Jonathan Cameron (2023-01-02 10:17:49)
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Stephen Boyd <swboyd@chromium.org>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
^ permalink raw reply
* Re: [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2
From: Linus Walleij @ 2023-01-04 0:01 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-input, Dmitry Torokhov, Jonathan Cameron, Paul Cercueil,
Roy Im, Moritz Fischer, Luca Weiss, Jeff LaBundy,
Krzysztof Kozlowski, Geert Uytterhoeven, Stephen Boyd,
Damien Riegel, Lars-Peter Clausen, Pascal Paillet, Tony Lindgren,
Raul E Rangel, Hans de Goede, Michael Hennerich, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Heiko Stuebner, Zhu Yi,
Mark Jonas, Michael Trimarchi, Dario Binacchi, Daniel Mack,
Jonathan Neuschäfer, Douglas Anderson, Bastien Nocera,
Anthony Kim, Joe Hung, Markuss Broks, Haibo Chen, Sangwon Jee,
Vincent Knecht, Fabio Estevam, John Keeping, Stephen Just,
Benjamin Tissoires, Dario Binacchi, Alistair Francis
In-Reply-To: <20230102181842.718010-1-jic23@kernel.org>
On Mon, Jan 2, 2023 at 7:05 PM Jonathan Cameron <jic23@kernel.org> wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This 2nd set is a continuation from:
> https://lore.kernel.org/all/20221204180841.2211588-1-jic23@kernel.org/
This is nice.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH 51/69] Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Jeff LaBundy @ 2023-01-03 18:15 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron
In-Reply-To: <20230102181842.718010-52-jic23@kernel.org>
On Mon, Jan 02, 2023 at 06:18:24PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
> ---
> drivers/input/touchscreen/iqs5xx.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
> index dc3137a34f35..c73e9c5c0077 100644
> --- a/drivers/input/touchscreen/iqs5xx.c
> +++ b/drivers/input/touchscreen/iqs5xx.c
> @@ -979,7 +979,7 @@ static const struct attribute_group iqs5xx_attr_group = {
> .attrs = iqs5xx_attrs,
> };
>
> -static int __maybe_unused iqs5xx_suspend(struct device *dev)
> +static int iqs5xx_suspend(struct device *dev)
> {
> struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
> struct input_dev *input = iqs5xx->input;
> @@ -998,7 +998,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev)
> return error;
> }
>
> -static int __maybe_unused iqs5xx_resume(struct device *dev)
> +static int iqs5xx_resume(struct device *dev)
> {
> struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
> struct input_dev *input = iqs5xx->input;
> @@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev)
> return error;
> }
>
> -static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
>
> static int iqs5xx_probe(struct i2c_client *client)
> {
> @@ -1090,7 +1090,7 @@ static struct i2c_driver iqs5xx_i2c_driver = {
> .driver = {
> .name = "iqs5xx",
> .of_match_table = iqs5xx_of_match,
> - .pm = &iqs5xx_pm,
> + .pm = pm_sleep_ptr(&iqs5xx_pm),
> },
> .id_table = iqs5xx_id,
> .probe_new = iqs5xx_probe,
> --
> 2.39.0
>
^ permalink raw reply
* Re: [PATCH 09/69] Input: iqs626a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Jeff LaBundy @ 2023-01-03 18:14 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron
In-Reply-To: <20230102181842.718010-10-jic23@kernel.org>
On Mon, Jan 02, 2023 at 06:17:42PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
> ---
> drivers/input/misc/iqs626a.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/misc/iqs626a.c b/drivers/input/misc/iqs626a.c
> index 23b5dd9552dc..4727e6b95e41 100644
> --- a/drivers/input/misc/iqs626a.c
> +++ b/drivers/input/misc/iqs626a.c
> @@ -1712,7 +1712,7 @@ static int iqs626_probe(struct i2c_client *client)
> return error;
> }
>
> -static int __maybe_unused iqs626_suspend(struct device *dev)
> +static int iqs626_suspend(struct device *dev)
> {
> struct iqs626_private *iqs626 = dev_get_drvdata(dev);
> struct i2c_client *client = iqs626->client;
> @@ -1771,7 +1771,7 @@ static int __maybe_unused iqs626_suspend(struct device *dev)
> return error;
> }
>
> -static int __maybe_unused iqs626_resume(struct device *dev)
> +static int iqs626_resume(struct device *dev)
> {
> struct iqs626_private *iqs626 = dev_get_drvdata(dev);
> struct i2c_client *client = iqs626->client;
> @@ -1818,7 +1818,7 @@ static int __maybe_unused iqs626_resume(struct device *dev)
> return error;
> }
>
> -static SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
>
> static const struct of_device_id iqs626_of_match[] = {
> { .compatible = "azoteq,iqs626a" },
> @@ -1830,7 +1830,7 @@ static struct i2c_driver iqs626_i2c_driver = {
> .driver = {
> .name = "iqs626a",
> .of_match_table = iqs626_of_match,
> - .pm = &iqs626_pm,
> + .pm = pm_sleep_ptr(&iqs626_pm),
> },
> .probe_new = iqs626_probe,
> };
> --
> 2.39.0
>
^ permalink raw reply
* Re: [PATCH 08/69] Input: iqs269a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Jeff LaBundy @ 2023-01-03 18:14 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron
In-Reply-To: <20230102181842.718010-9-jic23@kernel.org>
Hi Jonathan,
On Mon, Jan 02, 2023 at 06:17:41PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings. The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Thank you for doing this!
Just a note to Dmitry that this would need to be applied after [1] so
as to avoid a tiny merge conflict.
[1] https://patchwork.kernel.org/patch/13087784/
> ---
> drivers/input/misc/iqs269a.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
> index a348247d3d38..8348d8c85e1d 100644
> --- a/drivers/input/misc/iqs269a.c
> +++ b/drivers/input/misc/iqs269a.c
> @@ -1697,7 +1697,7 @@ static int iqs269_probe(struct i2c_client *client)
> return error;
> }
>
> -static int __maybe_unused iqs269_suspend(struct device *dev)
> +static int iqs269_suspend(struct device *dev)
> {
> struct iqs269_private *iqs269 = dev_get_drvdata(dev);
> struct i2c_client *client = iqs269->client;
> @@ -1756,7 +1756,7 @@ static int __maybe_unused iqs269_suspend(struct device *dev)
> return error;
> }
>
> -static int __maybe_unused iqs269_resume(struct device *dev)
> +static int iqs269_resume(struct device *dev)
> {
> struct iqs269_private *iqs269 = dev_get_drvdata(dev);
> struct i2c_client *client = iqs269->client;
> @@ -1803,7 +1803,7 @@ static int __maybe_unused iqs269_resume(struct device *dev)
> return error;
> }
>
> -static SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
>
> static const struct of_device_id iqs269_of_match[] = {
> { .compatible = "azoteq,iqs269a" },
> @@ -1815,7 +1815,7 @@ static struct i2c_driver iqs269_i2c_driver = {
> .driver = {
> .name = "iqs269a",
> .of_match_table = iqs269_of_match,
> - .pm = &iqs269_pm,
> + .pm = pm_sleep_ptr(&iqs269_pm),
> },
> .probe_new = iqs269_probe,
> };
> --
> 2.39.0
>
Kind regards,
Jeff LaBundy
^ permalink raw reply
* [PATCH v2 5/5] Input: iqs269a - do not poll during ATI
From: Jeff LaBundy @ 2023-01-03 17:59 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, jeff
In-Reply-To: <Y7RsTqhYJOZs11sK@nixie71>
After initial start-up, the driver triggers ATI (calibration) with
the newly loaded register configuration in place. Next, the driver
polls a register field to ensure ATI completed in a timely fashion
and that the device is ready to sense.
However, communicating with the device over I2C while ATI is under-
way may induce noise in the device and cause ATI to fail. As such,
the vendor recommends not to poll the device during ATI.
To solve this problem, let the device naturally signal to the host
that ATI is complete by way of an interrupt. A completion prevents
the device from successfully probing until this happens.
As an added benefit, initial switch states are now reported in the
interrupt handler at the same time ATI status is checked. As such,
duplicate code that reports initial switch states has been removed
from iqs269_input_init().
The former logic that scaled ATI timeout and filter settling delay
is not carried forward with the new implementation, as it produces
overly conservative delays at the lower clock rate.
Rather, a single timeout that covers both clock rates is used. The
filter settling delay does not happen to be necessary and has been
removed as well.
Fixes: 04e49867fad1 ("Input: add support for Azoteq IQS269A")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
Changes in v2:
- Added Reviewed-by
drivers/input/misc/iqs269a.c | 97 +++++++++++++++++-------------------
1 file changed, 46 insertions(+), 51 deletions(-)
diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
index 814d1a898e7f..8b30c911f789 100644
--- a/drivers/input/misc/iqs269a.c
+++ b/drivers/input/misc/iqs269a.c
@@ -9,6 +9,7 @@
* axial sliders presented by the device.
*/
+#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
@@ -144,10 +145,6 @@
#define IQS269_NUM_CH 8
#define IQS269_NUM_SL 2
-#define IQS269_ATI_POLL_SLEEP_US (iqs269->delay_mult * 10000)
-#define IQS269_ATI_POLL_TIMEOUT_US (iqs269->delay_mult * 500000)
-#define IQS269_ATI_STABLE_DELAY_MS (iqs269->delay_mult * 150)
-
#define iqs269_irq_wait() usleep_range(200, 250)
enum iqs269_local_cap_size {
@@ -289,10 +286,10 @@ struct iqs269_private {
struct mutex lock;
struct iqs269_switch_desc switches[ARRAY_SIZE(iqs269_events)];
struct iqs269_sys_reg sys_reg;
+ struct completion ati_done;
struct input_dev *keypad;
struct input_dev *slider[IQS269_NUM_SL];
unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH];
- unsigned int delay_mult;
unsigned int ch_num;
bool hall_enable;
bool ati_current;
@@ -973,13 +970,8 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269)
general = be16_to_cpu(sys_reg->general);
- if (device_property_present(&client->dev, "azoteq,clk-div")) {
+ if (device_property_present(&client->dev, "azoteq,clk-div"))
general |= IQS269_SYS_SETTINGS_CLK_DIV;
- iqs269->delay_mult = 4;
- } else {
- general &= ~IQS269_SYS_SETTINGS_CLK_DIV;
- iqs269->delay_mult = 1;
- }
/*
* Configure the device to automatically switch between normal and low-
@@ -1036,7 +1028,6 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269)
static int iqs269_dev_init(struct iqs269_private *iqs269)
{
- unsigned int val;
int error;
mutex_lock(&iqs269->lock);
@@ -1052,14 +1043,12 @@ static int iqs269_dev_init(struct iqs269_private *iqs269)
if (error)
goto err_mutex;
- error = regmap_read_poll_timeout(iqs269->regmap, IQS269_SYS_FLAGS, val,
- !(val & IQS269_SYS_FLAGS_IN_ATI),
- IQS269_ATI_POLL_SLEEP_US,
- IQS269_ATI_POLL_TIMEOUT_US);
- if (error)
- goto err_mutex;
+ /*
+ * The following delay gives the device time to deassert its RDY output
+ * so as to prevent an interrupt from being serviced prematurely.
+ */
+ usleep_range(2000, 2100);
- msleep(IQS269_ATI_STABLE_DELAY_MS);
iqs269->ati_current = true;
err_mutex:
@@ -1071,10 +1060,8 @@ static int iqs269_dev_init(struct iqs269_private *iqs269)
static int iqs269_input_init(struct iqs269_private *iqs269)
{
struct i2c_client *client = iqs269->client;
- struct iqs269_flags flags;
unsigned int sw_code, keycode;
int error, i, j;
- u8 dir_mask, state;
iqs269->keypad = devm_input_allocate_device(&client->dev);
if (!iqs269->keypad)
@@ -1087,23 +1074,7 @@ static int iqs269_input_init(struct iqs269_private *iqs269)
iqs269->keypad->name = "iqs269a_keypad";
iqs269->keypad->id.bustype = BUS_I2C;
- if (iqs269->hall_enable) {
- error = regmap_raw_read(iqs269->regmap, IQS269_SYS_FLAGS,
- &flags, sizeof(flags));
- if (error) {
- dev_err(&client->dev,
- "Failed to read initial status: %d\n", error);
- return error;
- }
- }
-
for (i = 0; i < ARRAY_SIZE(iqs269_events); i++) {
- dir_mask = flags.states[IQS269_ST_OFFS_DIR];
- if (!iqs269_events[i].dir_up)
- dir_mask = ~dir_mask;
-
- state = flags.states[iqs269_events[i].st_offs] & dir_mask;
-
sw_code = iqs269->switches[i].code;
for (j = 0; j < IQS269_NUM_CH; j++) {
@@ -1116,13 +1087,9 @@ static int iqs269_input_init(struct iqs269_private *iqs269)
switch (j) {
case IQS269_CHx_HALL_ACTIVE:
if (iqs269->hall_enable &&
- iqs269->switches[i].enabled) {
+ iqs269->switches[i].enabled)
input_set_capability(iqs269->keypad,
EV_SW, sw_code);
- input_report_switch(iqs269->keypad,
- sw_code,
- state & BIT(j));
- }
fallthrough;
case IQS269_CHx_HALL_INACTIVE:
@@ -1138,14 +1105,6 @@ static int iqs269_input_init(struct iqs269_private *iqs269)
}
}
- input_sync(iqs269->keypad);
-
- error = input_register_device(iqs269->keypad);
- if (error) {
- dev_err(&client->dev, "Failed to register keypad: %d\n", error);
- return error;
- }
-
for (i = 0; i < IQS269_NUM_SL; i++) {
if (!iqs269->sys_reg.slider_select[i])
continue;
@@ -1205,6 +1164,9 @@ static int iqs269_report(struct iqs269_private *iqs269)
return error;
}
+ if (be16_to_cpu(flags.system) & IQS269_SYS_FLAGS_IN_ATI)
+ return 0;
+
error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x,
sizeof(slider_x));
if (error) {
@@ -1267,6 +1229,12 @@ static int iqs269_report(struct iqs269_private *iqs269)
input_sync(iqs269->keypad);
+ /*
+ * The following completion signals that ATI has finished, any initial
+ * switch states have been reported and the keypad can be registered.
+ */
+ complete_all(&iqs269->ati_done);
+
return 0;
}
@@ -1298,6 +1266,9 @@ static ssize_t counts_show(struct device *dev,
if (!iqs269->ati_current || iqs269->hall_enable)
return -EPERM;
+ if (!completion_done(&iqs269->ati_done))
+ return -EBUSY;
+
/*
* Unsolicited I2C communication prompts the device to assert its RDY
* pin, so disable the interrupt line until the operation is finished
@@ -1554,7 +1525,9 @@ static ssize_t ati_trigger_show(struct device *dev,
{
struct iqs269_private *iqs269 = dev_get_drvdata(dev);
- return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->ati_current);
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ iqs269->ati_current &&
+ completion_done(&iqs269->ati_done));
}
static ssize_t ati_trigger_store(struct device *dev,
@@ -1574,6 +1547,7 @@ static ssize_t ati_trigger_store(struct device *dev,
return count;
disable_irq(client->irq);
+ reinit_completion(&iqs269->ati_done);
error = iqs269_dev_init(iqs269);
@@ -1583,6 +1557,10 @@ static ssize_t ati_trigger_store(struct device *dev,
if (error)
return error;
+ if (!wait_for_completion_timeout(&iqs269->ati_done,
+ msecs_to_jiffies(2000)))
+ return -ETIMEDOUT;
+
return count;
}
@@ -1641,6 +1619,7 @@ static int iqs269_probe(struct i2c_client *client)
}
mutex_init(&iqs269->lock);
+ init_completion(&iqs269->ati_done);
error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info,
sizeof(ver_info));
@@ -1676,6 +1655,22 @@ static int iqs269_probe(struct i2c_client *client)
return error;
}
+ if (!wait_for_completion_timeout(&iqs269->ati_done,
+ msecs_to_jiffies(2000))) {
+ dev_err(&client->dev, "Failed to complete ATI\n");
+ return -ETIMEDOUT;
+ }
+
+ /*
+ * The keypad may include one or more switches and is not registered
+ * until ATI is complete and the initial switch states are read.
+ */
+ error = input_register_device(iqs269->keypad);
+ if (error) {
+ dev_err(&client->dev, "Failed to register keypad: %d\n", error);
+ return error;
+ }
+
error = devm_device_add_group(&client->dev, &iqs269_attr_group);
if (error)
dev_err(&client->dev, "Failed to add attributes: %d\n", error);
--
2.34.1
^ 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