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=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no 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 E950EC43331 for ; Sat, 28 Mar 2020 14:42:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B332B2074F for ; Sat, 28 Mar 2020 14:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585406560; bh=HKMwuYbUTGNEue8ByOr11Gad1bKuwOOXaGWjoM3Duto=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=oTgyoMdPUAgEz7xILg1FdfpfUJQxtHExrv8Ti6mEtiDU/aPEPNZWGXh4hf8ags1Le p/VadyGH5c+6G0V0orWhE/0wSpAW5VbSVoqiiqT41LBfqF8AY+Ag2bPVtzxkgIw/DI 02nTPD5Gf66Kj6vqWIocrswPwp2AvMgR6dnORJoc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbgC1Omk (ORCPT ); Sat, 28 Mar 2020 10:42:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:55242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgC1Omk (ORCPT ); Sat, 28 Mar 2020 10:42:40 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5780520716; Sat, 28 Mar 2020 14:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585406559; bh=HKMwuYbUTGNEue8ByOr11Gad1bKuwOOXaGWjoM3Duto=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LJ3dDIVgO/sUSb70eqKyqIO4JP3Ycun+z0o6nYYyvUngU/ubADp/Iepozv5BtG2Ft UxsUleu1GgXab5BeddFWeLOa3ZBZtHCna9wox5q3ls59xlcldQYacasEO6DU/XThrr jG0d9nVeAODgNqeTABfnXcArt6L/aX1x7p64uz50= Date: Sat, 28 Mar 2020 14:42:34 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Saravanan Sekar , Lee Jones , Rob Herring , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Sebastian Reichel , devicetree , Linux Kernel Mailing List , linux-iio , Linux PM Subject: Re: [PATCH v4 3/5] iio: adc: mp2629: Add support for mp2629 ADC driver Message-ID: <20200328144234.081b964f@archlinux> In-Reply-To: References: <20200322224626.13160-1-sravanhome@gmail.com> <20200322224626.13160-4-sravanhome@gmail.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Mon, 23 Mar 2020 01:32:34 +0200 Andy Shevchenko wrote: > On Mon, Mar 23, 2020 at 12:47 AM Saravanan Sekar wrote: > > > > Add support for 8-bit resolution ADC readings for input power > > supply and battery charging measurement. Provides voltage, current > > readings to mp2629 power supply driver. > > ... > > > +#include > > > +#include > > Don't see users of it. > > > +#include > > +#include > > +#include > > > +#include > > Any users? > > > +#include > > Perhaps ordered? > > > +#include > > +#include > > +#include > > + blank line? > > > +#include > > ... > > > +static int mp2629_read_raw(struct iio_dev *indio_dev, > > + struct iio_chan_spec const *chan, > > + int *val, int *val2, long mask) > > +{ > > + struct mp2629_adc *info = iio_priv(indio_dev); > > + unsigned int rval; > > + int ret; > > + > > + switch (mask) { > > + case IIO_CHAN_INFO_RAW: > > + ret = regmap_read(info->regmap, chan->address, &rval); > > + if (ret < 0) > > + return ret; > > + > > + if (chan->address == MP2629_INPUT_VOLT) > > > + rval &= 0x7f; > > GENMASK() ? > > > + *val = rval; > > + return IIO_VAL_INT; > > > + return 0; > > +} > > ... > > > + void **pdata = pdev->dev.platform_data; > > Same Qs as per other patch. > > ... > > > + indio_dev->dev.of_node = pdev->dev.of_node; > > Jonathan, doesn't IIO core do this for all? > Nope. I'm not totally sure it's always safe to do so as we have some weird parent structures in some cases. A quick grep suggests that we may be fine though, or alternatively be able to get away with a set it if not already set approach. I'll take a look when I get some time. It would be nice to clean this up. Jonathan