From: Stanimir Varbanov <svarbanov@mm-sol.com>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Jonathan Cameron <jic23@kernel.org>,
linux-iio@vger.kernel.org, "Ivan T. Ivanov" <iivanov@mm-sol.com>
Subject: Re: [PATCH 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Date: Mon, 08 Sep 2014 01:42:35 +0300 [thread overview]
Message-ID: <540CDF5B.7040708@mm-sol.com> (raw)
In-Reply-To: <alpine.DEB.2.01.1409051418520.13940@pmeerw.net>
Hi Peter,
Thanks for the comments!
On 09/05/2014 03:46 PM, Peter Meerwald wrote:
>
>> The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has
>> 15bits resolution and register space inside PMIC accessible across
>> SPMI bus.
>>
>> The vadc driver registers itself through IIO interface.
>
> several trivial comments below
>
> there plenty of device-specific sysfs attributes which need to be
> documented (in ABI/testing/sysfs-bus-iio-xxx)
sure, will document the attributes.by you
>
>> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
>> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
>> ---
>> drivers/iio/adc/Kconfig | 11 +
>> drivers/iio/adc/Makefile | 1 +
>> drivers/iio/adc/qcom-spmi-vadc.c | 1275 +++++++++++++++++++++++++
>> include/dt-bindings/iio/qcom,spmi-pmic-vadc.h | 119 +++
>> 4 files changed, 1406 insertions(+), 0 deletions(-)
>> create mode 100644 drivers/iio/adc/qcom-spmi-vadc.c
>> create mode 100644 include/dt-bindings/iio/qcom,spmi-pmic-vadc.h
>>
>> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
>> index 11b048a..e652d40 100644
>> --- a/drivers/iio/adc/Kconfig
>> +++ b/drivers/iio/adc/Kconfig
>> @@ -279,4 +279,15 @@ config XILINX_XADC
>> The driver can also be build as a module. If so, the module will be called
>> xilinx-xadc.
>>
>> +config QCOM_SPMI_VADC
>
> alphabetic order please
OK.
>
>> + tristate "Qualcomm SPMI PMIC voltage ADC"
>> + depends on SPMI
>> + help
>> + Say yes here if you want support for the Qualcomm SPMI PMIC voltage ADC.
>> +
>> + The driver supports reading the HKADC, XOADC through the ADC AMUX arbiter.
>> + The VADC includes support for the conversion sequencer. The driver
>> + supports reading the ADC through the AMUX channels for external pull-ups
>> + simultaneously.
>> +
>> endmenu
>> diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
>> index ad81b51..050cc96 100644
>> --- a/drivers/iio/adc/Makefile
>> +++ b/drivers/iio/adc/Makefile
>> @@ -30,3 +30,4 @@ obj-$(CONFIG_VF610_ADC) += vf610_adc.o
>> obj-$(CONFIG_VIPERBOARD_ADC) += viperboard_adc.o
>> xilinx-xadc-y := xilinx-xadc-core.o xilinx-xadc-events.o
>> obj-$(CONFIG_XILINX_XADC) += xilinx-xadc.o
>> +obj-$(CONFIG_QCOM_SPMI_VADC) += qcom-spmi-vadc.o
>> diff --git a/drivers/iio/adc/qcom-spmi-vadc.c b/drivers/iio/adc/qcom-spmi-vadc.c
>> new file mode 100644
>> index 0000000..0c500df
>> --- /dev/null
>> +++ b/drivers/iio/adc/qcom-spmi-vadc.c
>> @@ -0,0 +1,1275 @@
>> +/*
>> + * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 and
>> + * only version 2 as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + */
>> +
>> +#include <linux/bitops.h>
>> +#include <linux/completion.h>
>> +#include <linux/delay.h>
>> +#include <linux/err.h>
>> +#include <linux/iio/iio.h>
>> +#include <linux/iio/sysfs.h>
>> +#include <linux/interrupt.h>
>> +#include <linux/kernel.h>
>> +#include <linux/mutex.h>
>> +#include <linux/module.h>
>> +#include <linux/of.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/regmap.h>
>> +#include <linux/slab.h>
>> +#include <linux/log2.h>
>
> log2 needed?
is_power_of_2()
>
>> +
>> +#include <dt-bindings/iio/qcom,spmi-pmic-vadc.h>
>> +
>> +/* QPNP VADC register and bit definition */
>
> what is QPNP?
This is leftover from downstream driver and I shouldn't be here.
Here is a brief explanation from Josh:
http://lkml.iu.edu/hypermail/linux/kernel/1401.1/05060.html
>
>> +#define VADC_REVISION2 0x1
>
> PREFIX should probably be QCOM_SPMI_VADC_
I'd prefer to keep as is. With proposed by you prefix the references of
defines could break the code indentation and IMO the file name
qcom-spmi-vadc is enough.
<snip>
I agree with all of your comments and will update the code in next version.
regards,
Stan
next prev parent reply other threads:[~2014-09-07 22:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 12:14 [PATCH 0/2] Intial support for voltage ADC Stanimir Varbanov
2014-09-05 12:14 ` Stanimir Varbanov
2014-09-05 12:14 ` [PATCH 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver Stanimir Varbanov
2014-09-05 12:26 ` Arnd Bergmann
2014-09-05 12:26 ` Arnd Bergmann
2014-09-08 8:13 ` Stanimir Varbanov
2014-09-08 8:13 ` Stanimir Varbanov
2014-09-08 10:19 ` Arnd Bergmann
2014-09-08 10:19 ` Arnd Bergmann
2014-09-08 15:30 ` Stanimir Varbanov
2014-09-08 15:30 ` Stanimir Varbanov
2014-09-09 10:32 ` Arnd Bergmann
2014-09-09 10:32 ` Arnd Bergmann
2014-09-09 12:49 ` Stanimir Varbanov
2014-09-09 12:49 ` Stanimir Varbanov
2014-09-10 9:49 ` Ivan T. Ivanov
2014-09-10 9:49 ` Ivan T. Ivanov
2014-09-05 12:46 ` Peter Meerwald
2014-09-07 22:42 ` Stanimir Varbanov [this message]
[not found] ` <1409919274-13419-1-git-send-email-svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-09-05 12:14 ` [PATCH 2/2] DT: iio: vadc: document dt binding Stanimir Varbanov
2014-09-05 12:14 ` Stanimir Varbanov
[not found] ` <1409919274-13419-3-git-send-email-svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-09-09 22:22 ` Hartmut Knaack
2014-09-09 22:22 ` Hartmut Knaack
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=540CDF5B.7040708@mm-sol.com \
--to=svarbanov@mm-sol.com \
--cc=iivanov@mm-sol.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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.