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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable 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 9DFADC33CB7 for ; Sat, 18 Jan 2020 11:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7437B2468B for ; Sat, 18 Jan 2020 11:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579346303; bh=8VwY+FeNaHDSZkR/EGAKvPjztnT+yD2Sz/QaUPWbryM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=yGE796GSLw1x9rrs0u5Ue6HHAmPZQAccRxgwYfZ11g6Lkz1tJPpvyFdz1IkI1pQPC Iko2xJ41m13djbfVTEZDAFb8IMiw84o1LCV8rrXgdf+OeaH5FOwKDa8/6v846Akn9r ro9PhLnMnWCmJB+s/beznMcnuo6hDCcZIuoMG9xs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728596AbgARLSW (ORCPT ); Sat, 18 Jan 2020 06:18:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:37700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbgARLSW (ORCPT ); Sat, 18 Jan 2020 06:18:22 -0500 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 EFDC32468B; Sat, 18 Jan 2020 11:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579346301; bh=8VwY+FeNaHDSZkR/EGAKvPjztnT+yD2Sz/QaUPWbryM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=v3Twrj1/9vzr3FsU2vRkcBYVoakgd2Oxof3gGUhw4uHDNF7cp6oExcSORRWlOo/6Y SUrezceMGg0JweGb5sXK9TNIa9BeXyCRW7Mq9+raxXD+Iud/odnL/LbfW2XKUmFKjV Wl3TSodJrhC4ruE9WKKTolgKLkJ5F0/Y1UCKnXsI= Date: Sat, 18 Jan 2020 11:18:17 +0000 From: Jonathan Cameron To: Alexandru Tachici Cc: , Subject: Re: [PATCH 1/2 V3] iio: adc: ad-sigma-delta: Allow custom IRQ flags Message-ID: <20200118111817.71cd8a63@archlinux> In-Reply-To: <20200113102653.20900-2-alexandru.tachici@analog.com> References: <20200111112317.1cf2d878@archlinux> <20200113102653.20900-1-alexandru.tachici@analog.com> <20200113102653.20900-2-alexandru.tachici@analog.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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jan 2020 12:26:52 +0200 Alexandru Tachici wrote: > Before this patch the ad_sigma_delta implementation hardcoded > the irq trigger type to low, assuming that all Sigma-Delta ADCs > have the same interrupt-type. > > This patch allows all drivers using the ad_sigma_delta layer to set the > irq trigger type to the one specified in the datasheet. > > Signed-off-by: Alexandru Tachici Now, as neither of these has a fixes tag, I've taken them in the togreg branch of iio.git. If you want them backported to stable, one they are in Linus's tree you can send a specific message to request they are applied. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/adc/ad7124.c | 2 ++ > drivers/iio/adc/ad7780.c | 1 + > drivers/iio/adc/ad7791.c | 1 + > drivers/iio/adc/ad7793.c | 1 + > drivers/iio/adc/ad_sigma_delta.c | 2 +- > include/linux/iio/adc/ad_sigma_delta.h | 2 ++ > 6 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c > index edc6f1cc90b2..9531d8a6cb27 100644 > --- a/drivers/iio/adc/ad7124.c > +++ b/drivers/iio/adc/ad7124.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -222,6 +223,7 @@ static const struct ad_sigma_delta_info ad7124_sigma_delta_info = { > .addr_shift = 0, > .read_mask = BIT(6), > .data_reg = AD7124_DATA, > + .irq_flags = IRQF_TRIGGER_LOW, > }; > > static int ad7124_set_channel_odr(struct ad7124_state *st, > diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c > index 217a5a5c3c6d..291c1a898129 100644 > --- a/drivers/iio/adc/ad7780.c > +++ b/drivers/iio/adc/ad7780.c > @@ -203,6 +203,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = { > .set_mode = ad7780_set_mode, > .postprocess_sample = ad7780_postprocess_sample, > .has_registers = false, > + .irq_flags = IRQF_TRIGGER_LOW, > }; > > #define AD7780_CHANNEL(bits, wordsize) \ > diff --git a/drivers/iio/adc/ad7791.c b/drivers/iio/adc/ad7791.c > index 54025ea10239..abb239392631 100644 > --- a/drivers/iio/adc/ad7791.c > +++ b/drivers/iio/adc/ad7791.c > @@ -205,6 +205,7 @@ static const struct ad_sigma_delta_info ad7791_sigma_delta_info = { > .has_registers = true, > .addr_shift = 4, > .read_mask = BIT(3), > + .irq_flags = IRQF_TRIGGER_LOW, > }; > > static int ad7791_read_raw(struct iio_dev *indio_dev, > diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c > index bbc41ecf0d2f..b747db97f78a 100644 > --- a/drivers/iio/adc/ad7793.c > +++ b/drivers/iio/adc/ad7793.c > @@ -206,6 +206,7 @@ static const struct ad_sigma_delta_info ad7793_sigma_delta_info = { > .has_registers = true, > .addr_shift = 3, > .read_mask = BIT(6), > + .irq_flags = IRQF_TRIGGER_LOW, > }; > > static const struct ad_sd_calib_data ad7793_calib_arr[6] = { > diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c > index 8ba90486c787..8115b6de1d6c 100644 > --- a/drivers/iio/adc/ad_sigma_delta.c > +++ b/drivers/iio/adc/ad_sigma_delta.c > @@ -500,7 +500,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) > > ret = request_irq(sigma_delta->spi->irq, > ad_sd_data_rdy_trig_poll, > - IRQF_TRIGGER_LOW, > + sigma_delta->info->irq_flags, > indio_dev->name, > sigma_delta); > if (ret) > diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h > index 8a4e25a7080c..5a127c0ed200 100644 > --- a/include/linux/iio/adc/ad_sigma_delta.h > +++ b/include/linux/iio/adc/ad_sigma_delta.h > @@ -40,6 +40,7 @@ struct iio_dev; > * @read_mask: Mask for the communications register having the read bit set. > * @data_reg: Address of the data register, if 0 the default address of 0x3 will > * be used. > + * @irq_flags: flags for the interrupt used by the triggered buffer > */ > struct ad_sigma_delta_info { > int (*set_channel)(struct ad_sigma_delta *, unsigned int channel); > @@ -49,6 +50,7 @@ struct ad_sigma_delta_info { > unsigned int addr_shift; > unsigned int read_mask; > unsigned int data_reg; > + unsigned long irq_flags; > }; > > /**