From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F713C49360 for ; Mon, 14 Jun 2021 08:49:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87D396138C for ; Mon, 14 Jun 2021 08:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbhFNIvD (ORCPT ); Mon, 14 Jun 2021 04:51:03 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:42541 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232657AbhFNIvC (ORCPT ); Mon, 14 Jun 2021 04:51:02 -0400 Received: (Authenticated sender: hadess@hadess.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 190381C0002; Mon, 14 Jun 2021 08:48:57 +0000 (UTC) Message-ID: Subject: Re: [PATCH 3/3] Input: goodix - add a settings module-parameter From: Bastien Nocera To: Hans de Goede , Dmitry Torokhov Cc: Gregor Riepl , linux-input@vger.kernel.org Date: Mon, 14 Jun 2021 10:48:57 +0200 In-Reply-To: <20210613102158.16886-4-hdegoede@redhat.com> References: <20210613102158.16886-1-hdegoede@redhat.com> <20210613102158.16886-4-hdegoede@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.1 (3.40.1-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Sun, 2021-06-13 at 12:21 +0200, Hans de Goede wrote: > Add a settings module-parameter which can be allowed to > specify/override > various device-properties. > > Usuually Goodix touchscreens on x86 devices (where there is no > devicetree > to specify the properties) just work. But in some cases the > touchscreen is > mounted 90 or 180 degrees rotated vs the display, requiring setting > the > touchscreen-x/y-inverted or touchscreen-swapped-x-y properties. > > Being able to specify the necessary properties through a module > parameter, > allows users of new device-models to help us with bringing up support > for > new devices without them needing to do a local kernel-build just to > modify > these settings. > > Signed-off-by: Hans de Goede Reviewed-by: Bastien Nocera > --- >  drivers/input/touchscreen/goodix.c | 6 +++++- >  1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/input/touchscreen/goodix.c > b/drivers/input/touchscreen/goodix.c > index 2efb82977115..1bc94c5597ca 100644 > --- a/drivers/input/touchscreen/goodix.c > +++ b/drivers/input/touchscreen/goodix.c > @@ -52,6 +52,10 @@ >  #define ACPI_GPIO_SUPPORT >  #endif >   > +static char *settings; > +module_param(settings, charp, 0444); > +MODULE_PARM_DESC(settings, "Override touchscreen settings using a ; > separated key=value list, e.g. \"touchscreen-fuzz-x=5;touchscreen- > fuzz-y=5;touchscreen-swapped-x-y\""); > + >  struct goodix_chip_id { >         const char *id; >         const struct goodix_chip_data *data; > @@ -1026,7 +1030,7 @@ static int goodix_configure_dev(struct > goodix_ts_data *ts) >         goodix_read_config(ts); >   >         /* Try overriding touchscreen parameters via device > properties */ > -       touchscreen_parse_properties(ts->input_dev, true, &ts->prop, > NULL); > +       touchscreen_parse_properties(ts->input_dev, true, &ts->prop, > settings); >   >         if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) > { >                 dev_err(&ts->client->dev,