Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp599364imc; Sat, 16 Mar 2019 09:57:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5X51A6L1waTILtoeC+wbpncn+lgct8jY/wc1wwrxDy3lyqtdvCDXSH1y/krWLsn670wnl X-Received: by 2002:a65:4147:: with SMTP id x7mr9375939pgp.54.1552755476413; Sat, 16 Mar 2019 09:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552755476; cv=none; d=google.com; s=arc-20160816; b=f888s/Q70zid19lQlwRaj2lDh3FQoIt0A2knhiPAKpoyMSy9YFwSTomd3aQqyC11U4 urdjHaid+PkMzsUc7MY1rR3my7a7lTSD3B1STUcNWkJUlE3Tsq5ZndJcSb01pFa40gDE 0fAfg7H0RjTDAhlbhkJeK+ii9ltc9Y5//RpKdzIRWX1oQPYED1JSV5A6pzBEa84X/tMd wZ0kLfUt3F1XVRq+64HUQ0u1nCVw31z2uKBK4dlvP5VkCTKmFD7zV2AwTvaFGdijCc1p k0jpeOEC00sjVGQbH1PYA4IBzHb6+Beo5zRp79X4R5ExezBGs86CEovL+X2GWVrFTpYB +xJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=X2qLgZzFAP1SdIu6p6/2QdzstXqP64eeAXkjk9zVxig=; b=NnQYbxFjJGevtOix1q8TIQDai01ZmbTvZZWl6HFcI67I7PbCIBE/fMHjkouiIq0jOs 4wjX7j1VXTi9Crdx0aczsuk7v/bIxTENnXDIT1TjV7EMpDWpfXLXici256urUSbsrM0Y hWfBIbZwxSTeqkEuQIRgO9FlzqHhL752DfHFG4P2l+oNHOvTfMOONq6fBvMC00yo9L/s SZrlQrf96gG9v5+qE+jgstMOsCl/FSBrqpAf6O4JfBqxLqdjT1JZkX85dV9fyobRY366 IkfTXlIOUM6+pu4vPZrVOEJ3QuubemEGh71bwOns5XncQ0gjpZ0xZFO3IC/GuEZDGg9o tD6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EYZ+eeml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si4839916pfn.42.2019.03.16.09.57.40; Sat, 16 Mar 2019 09:57:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EYZ+eeml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726972AbfCPQ5F (ORCPT + 99 others); Sat, 16 Mar 2019 12:57:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:47068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbfCPQ5F (ORCPT ); Sat, 16 Mar 2019 12:57:05 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 078842186A; Sat, 16 Mar 2019 16:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552755423; bh=IUcLFuDlICUROJ6wZx7QspOWCzJQ7JgKZlHRPAQFK8U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EYZ+eemlpMDmcWngmOgeOKWqrqdyWpslFW6xXL7q8QFyuYwjgslHMqJa/mTm7AAJF RXzohacISDN8Av8olta/zedH4jOT5a03Cs9unAkzAe9fKoGwWlsCjCdvt7pHXqjh0p Dhr2RCFj7M4qGM9+zCN5Ahca++y/MaWYLmzc3zrs= Date: Sat, 16 Mar 2019 16:56:58 +0000 From: Jonathan Cameron To: Mircea Caprioru Cc: , , , , , Subject: Re: [PATCH 2/2] staging: iio: adc: ad7192: Convert platform data to DT properties Message-ID: <20190316165658.0cdc2f49@archlinux> In-Reply-To: <20190315112903.15855-2-mircea.caprioru@analog.com> References: <20190315112903.15855-1-mircea.caprioru@analog.com> <20190315112903.15855-2-mircea.caprioru@analog.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Mar 2019 13:29:03 +0200 Mircea Caprioru wrote: > This patch will remove platform data members and replace them with device > tree properties. These properties will be subject to further modifications > and probably replaced with other functionalities at some point in time. =46rom the description I was initially thinking this would be a crazy temporary binding but as they all seem to be reasonably sensible (even if we haven't formally reviewed the binding yet so they may change) I'm happy to take this as a step in the right direction. >=20 > Signed-off-by: Mircea Caprioru Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7192.c | 33 ++++++++++++++++++++------------ > drivers/staging/iio/adc/ad7192.h | 7 ------- > 2 files changed, 21 insertions(+), 19 deletions(-) >=20 > diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/a= d7192.c > index 5c54ce380fa5..c56eaefbbe41 100644 > --- a/drivers/staging/iio/adc/ad7192.c > +++ b/drivers/staging/iio/adc/ad7192.c > @@ -250,10 +250,11 @@ static int ad7192_of_clock_select(struct ad7192_sta= te *st) > return clock_sel; > } > =20 > -static int ad7192_setup(struct ad7192_state *st, > - const struct ad7192_platform_data *pdata) > +static int ad7192_setup(struct ad7192_state *st, struct device_node *np) > { > struct iio_dev *indio_dev =3D spi_get_drvdata(st->sd.spi); > + bool rej60_en, sinc3_en, refin2_en, chop_en; > + bool buf_en, bipolar, burnout_curr_en; > unsigned long long scale_uv; > int i, ret, id; > =20 > @@ -280,18 +281,22 @@ static int ad7192_setup(struct ad7192_state *st, > =20 > st->conf =3D AD7192_CONF_GAIN(0); > =20 > - if (pdata->rej60_en) > + rej60_en =3D of_property_read_bool(np, "adi,rejection-60-Hz-enable"); > + if (rej60_en) > st->mode |=3D AD7192_MODE_REJ60; > =20 > - if (pdata->sinc3_en) > + sinc3_en =3D of_property_read_bool(np, "adi,sinc3-filter-enable"); > + if (sinc3_en) > st->mode |=3D AD7192_MODE_SINC3; > =20 > - if (pdata->refin2_en && st->devid !=3D ID_AD7195) > + refin2_en =3D of_property_read_bool(np, "adi,refin2-pins-enable"); > + if (refin2_en && st->devid !=3D ID_AD7195) > st->conf |=3D AD7192_CONF_REFSEL; > =20 > - if (pdata->chop_en) { > + chop_en =3D of_property_read_bool(np, "adi,chop-enable"); > + if (chop_en) { > st->conf |=3D AD7192_CONF_CHOP; > - if (pdata->sinc3_en) > + if (sinc3_en) > st->f_order =3D 3; /* SINC 3rd order */ > else > st->f_order =3D 4; /* SINC 4th order */ > @@ -299,15 +304,19 @@ static int ad7192_setup(struct ad7192_state *st, > st->f_order =3D 1; > } > =20 > - if (pdata->buf_en) > + buf_en =3D of_property_read_bool(np, "adi,buffer-enable"); > + if (buf_en) > st->conf |=3D AD7192_CONF_BUF; > =20 > - if (pdata->unipolar_en) > + bipolar =3D of_property_read_bool(np, "bipolar"); > + if (!bipolar) > st->conf |=3D AD7192_CONF_UNIPOLAR; > =20 > - if (pdata->burnout_curr_en && pdata->buf_en && !pdata->chop_en) { > + burnout_curr_en =3D of_property_read_bool(np, > + "adi,burnout-currents-enable"); > + if (burnout_curr_en && buf_en && !chop_en) { > st->conf |=3D AD7192_CONF_BURN; > - } else if (pdata->burnout_curr_en) { > + } else if (burnout_curr_en) { > dev_warn(&st->sd.spi->dev, > "Can't enable burnout currents: see CHOP or buffer\n"); > } > @@ -735,7 +744,7 @@ static int ad7192_probe(struct spi_device *spi) > } > } > =20 > - ret =3D ad7192_setup(st, pdata); > + ret =3D ad7192_setup(st, spi->dev.of_node); > if (ret) > goto error_disable_clk; > =20 > diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/a= d7192.h > index 3be3ee269ed5..aa3322c14e38 100644 > --- a/drivers/staging/iio/adc/ad7192.h > +++ b/drivers/staging/iio/adc/ad7192.h > @@ -33,13 +33,6 @@ > =20 > struct ad7192_platform_data { > u16 vref_mv; > - bool refin2_en; > - bool rej60_en; > - bool sinc3_en; > - bool chop_en; > - bool buf_en; > - bool unipolar_en; > - bool burnout_curr_en; > }; > =20 > #endif /* IIO_ADC_AD7192_H_ */