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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EB8DC433FE for ; Tue, 28 Sep 2021 10:34:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C6BA6113E for ; Tue, 28 Sep 2021 10:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240155AbhI1KgA convert rfc822-to-8bit (ORCPT ); Tue, 28 Sep 2021 06:36:00 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:50403 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239952AbhI1Kf7 (ORCPT ); Tue, 28 Sep 2021 06:35:59 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 72B1C2000F; Tue, 28 Sep 2021 10:34:16 +0000 (UTC) Date: Tue, 28 Sep 2021 12:34:15 +0200 From: Miquel Raynal To: Lee Jones Cc: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Dmitry Torokhov , bcousson@baylibre.com, Tony Lindgren , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, Thomas Petazzoni , Vignesh Raghavendra , Lokesh Vutla , Tero Kristo , Ryan Barnett , Grygorii Strashko , Jason Reeder , Jonathan Cameron Subject: Re: [PATCH v3 35/47] mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support Message-ID: <20210928123415.332f9d5a@xps13> In-Reply-To: References: <20210915155908.476767-1-miquel.raynal@bootlin.com> <20210915155908.476767-36-miquel.raynal@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Lee, > > static const struct ti_tscadc_data tscdata = { > > .has_tsc = true, > > + .has_mag = false, > > .name_tscmag = "TI-am335x-tsc", > > .compat_tscmag = "ti,am3359-tsc", > > .name_adc = "TI-am335x-adc", > > @@ -341,11 +356,25 @@ static const struct ti_tscadc_data tscdata = { > > .target_clk_rate = TSC_ADC_CLK, > > }; > > > > +static const struct ti_tscadc_data magdata = { > > + .has_tsc = false, > > + .has_mag = true, > > Why 2 bools? > > Better to have a single u8: > > MODE_TOUCHSCREEN > MODE_MAG_STRING > MODE_NONE I was about to add an enum for these but actually it is totally redundant with the compatible name. Instead, I have added a helper which checks the compatible string and gives the same information. Thanks, Miquèl