All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jens Reidel <adrian@travitia.xyz>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bastien Nocera <hadess@hadess.net>,
	Hans de Goede <hdegoede@redhat.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Luca Weiss <luca.weiss@fairphone.com>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org,
	linux@mainlining.org, ~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH 2/2] Input: goodix_berlin - Add support for Berlin-A series
Date: Tue, 4 Feb 2025 06:07:01 -0800	[thread overview]
Message-ID: <Z6IfBXzb2hg7-lAW@google.com> (raw)
In-Reply-To: <20250203174309.21574-3-adrian@travitia.xyz>

Hi Jens,

On Mon, Feb 03, 2025 at 06:43:09PM +0100, Jens Reidel wrote:
>  
> -	error = regmap_raw_read(cd->regmap, GOODIX_BERLIN_FW_VERSION_INFO_ADDR,
> +	if (ic_data->ic_type == IC_TYPE_BERLIN_A)
> +		fw_version_info_addr = GOODIX_BERLIN_FW_VERSION_INFO_ADDR_A;
> +	else
> +		fw_version_info_addr = GOODIX_BERLIN_FW_VERSION_INFO_ADDR;
> +

Instead of branching on IC type please have goodix_berlin_ic_data
structure describe differences in the chips (by adding
fw_version_info_addr, ic_info_addr and other fields) and then simply use
them.

Thanks.

-- 
Dmitry

      parent reply	other threads:[~2025-02-04 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 17:43 [PATCH 0/2] Add Goodix Berlin-A series support Jens Reidel
2025-02-03 17:43 ` [PATCH 1/2] dt-bindings: input: goodix,gt9916: Document gt9897 compatible Jens Reidel
2025-02-03 23:02   ` Rob Herring (Arm)
2025-02-03 17:43 ` [PATCH 2/2] Input: goodix_berlin - Add support for Berlin-A series Jens Reidel
2025-02-03 19:55   ` Luca Weiss
2025-02-04  8:25   ` Neil Armstrong
2025-02-04 14:07   ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z6IfBXzb2hg7-lAW@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=adrian@travitia.xyz \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hadess@hadess.net \
    --cc=hdegoede@redhat.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@mainlining.org \
    --cc=luca.weiss@fairphone.com \
    --cc=neil.armstrong@linaro.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.