Re: [PATCH 04/13] HID: playstation: add DualSense touchpad support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Samuel,

Thanks for your review.


On Fri, Dec 25, 2020 at 6:14 PM Samuel Čavoj <samuel@xxxxxxxxx> wrote:
>
> Hello,
>
> thank you for this driver. It makes me really happy to see an official
> one. Just a small thing I noticed while reading through it:
>
>
> On 18.12.2020 22:23, Roderick Colenbrander wrote:
> > @@ -311,6 +345,25 @@ static int dualsense_parse_report(struct ps_device *ps_dev, struct hid_report *r
> >       input_report_key(ds->gamepad, BTN_MODE, ds_report->buttons[2] & DS_BUTTONS2_PS_HOME);
> >       input_sync(ds->gamepad);
> >
> > +     input_report_key(ds->touchpad, BTN_LEFT, ds_report->buttons[2] & DS_BUTTONS2_TOUCHPAD);
>
> The above line is duplicated right before the input_sync (marked). Is
> there any reason for this or is it accidental?

Good catch. It was purely accidental as the code went through many
rebases and code shuffling. So a little artifact..

>
> > +     for (i = 0; i < 2; i++) {
> > +             bool active = (ds_report->points[i].contact & 0x80) ? false : true;
> > +
> > +             input_mt_slot(ds->touchpad, i);
> > +             input_mt_report_slot_state(ds->touchpad, MT_TOOL_FINGER, active);
> > +
> > +             if (active) {
> > +                     int x = (ds_report->points[i].x_hi << 8) | ds_report->points[i].x_lo;
> > +                     int y = (ds_report->points[i].y_hi << 4) | ds_report->points[i].y_lo;
> > +
> > +                     input_report_abs(ds->touchpad, ABS_MT_POSITION_X, x);
> > +                     input_report_abs(ds->touchpad, ABS_MT_POSITION_Y, y);
> > +             }
> > +     }
> > +     input_mt_sync_frame(ds->touchpad);
> > +     input_report_key(ds->touchpad, BTN_LEFT, ds_report->buttons[2] & DS_BUTTONS2_TOUCHPAD);
>
> Right here.

I will probably keep this one and take the other one out as this is
next to the other touchpad code.

>
> > +     input_sync(ds->touchpad);
> > +
>
> Regards,
> Samuel

Thanks,
Roderick




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux