Received: by 10.213.65.68 with SMTP id h4csp485531imn; Sat, 17 Mar 2018 11:24:12 -0700 (PDT) X-Google-Smtp-Source: AG47ELsOIB7SyLnNqXh7EvcYuKk0F78DO1MgRqVqTYLHwP6/tQs73HBwslcU/0pCfofwZ5Kke0W4 X-Received: by 2002:a17:902:3303:: with SMTP id a3-v6mr6413773plc.399.1521311052170; Sat, 17 Mar 2018 11:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521311052; cv=none; d=google.com; s=arc-20160816; b=HEeIwtQizFr5Y7vfCRZm8VrPUX0pU3Bj1VAjnrG1oQCowQHebAjDWCqXD15Pe32Af6 drul9g7MCB4pJePaMiqADK6Zy2jF3b672afzsFryuqgVSK0o4LyNQHyH4pAh9n+lbRFm kbF3jYiJMQa+KSZY3MeiG+QCZKPjS/2JeTbIVHjeaPgAvrJUD0PVAqIddu7G2okHTZkQ BK4KjNcPSttYzdIt67gqxhWWi7PSvmlFpoVZii1WidTeCbITUb0VBbNLWNFx7Ba+HyZu IwjEW2r0i8TdnlvCkW6tUF5qQqKtIwTiT42sBuRg2Z6iFK+vxklj9/CI9S35FTkQYc6L 4NsA== 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 :dmarc-filter:arc-authentication-results; bh=NjFVu1ovV2gEHghKTpJJH8Scm+JnkacSM7tjzMrjnwA=; b=hk24PcrsJWfLHSB29OnIHA0IcBeAsMJyplzddc/0E1LSBrXZJJwpMmD2EQkjysi60h sHguidEDepVj7mroCMjlRAcsw2YNbBNt+vU6CH0b0j+U56nqb68ogzd5yJpixAv9LwzH UGHup3HbqH/osURgoGlRDQGlMIsmsRxPk6oRG9IGwUhoRCUgHv0hbVsV6yT3bvES1ERG +Pt6UBgqnY8fXMPhbtVq0Huq3MP7besCYwTeJvhrrq6Mcan4xlVw+yWAILQhYvWTx0hD c4RXqjrEfEhRu6w5FZDh3SOJ0vKuhx0sBvWD1mW/yQcsRtZpgKgUFQDkk/FVPgSfaZ8J PlrQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r76si6880491pgr.794.2018.03.17.11.23.56; Sat, 17 Mar 2018 11:24:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753657AbeCQSWz (ORCPT + 99 others); Sat, 17 Mar 2018 14:22:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbeCQSWx (ORCPT ); Sat, 17 Mar 2018 14:22:53 -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 3BDE420855; Sat, 17 Mar 2018 18:22:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BDE420855 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 17 Mar 2018 18:22:48 +0000 From: Jonathan Cameron To: William Breathitt Gray Cc: linus.walleij@linaro.org, andy.shevchenko@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: Re: [PATCH v3 1/8] iio: stx104: Implement get_multiple callback Message-ID: <20180317182248.28fc9cbb@archlinux> In-Reply-To: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1521301345.git.vilhelm.gray@gmail.com> References: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1521301345.git.vilhelm.gray@gmail.com> X-Mailer: Claws Mail 3.16.0 (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 Sat, 17 Mar 2018 11:49:56 -0400 William Breathitt Gray wrote: > The Apex Embedded Systems STX104 series of devices provides 4 TTL > compatible lines of inputs accessed via a single 4-bit port. Since four > input lines are acquired on a single port input read, the STX104 GPIO > driver may improve multiple input reads by utilizing a get_multiple > callback. This patch implements the stx104_gpio_get_multiple function > which serves as the respective get_multiple callback. > > Cc: Jonathan Cameron > Cc: Hartmut Knaack > Cc: Lars-Peter Clausen > Cc: Peter Meerwald-Stadler > Signed-off-by: William Breathitt Gray This one is simple so 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/stx104.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/iio/adc/stx104.c b/drivers/iio/adc/stx104.c > index 17b021f33180..0662ca199eb0 100644 > --- a/drivers/iio/adc/stx104.c > +++ b/drivers/iio/adc/stx104.c > @@ -233,6 +233,16 @@ static int stx104_gpio_get(struct gpio_chip *chip, unsigned int offset) > return !!(inb(stx104gpio->base) & BIT(offset)); > } > > +static int stx104_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, > + unsigned long *bits) > +{ > + struct stx104_gpio *const stx104gpio = gpiochip_get_data(chip); > + > + *bits = inb(stx104gpio->base); > + > + return 0; > +} > + > static void stx104_gpio_set(struct gpio_chip *chip, unsigned int offset, > int value) > { > @@ -342,6 +352,7 @@ static int stx104_probe(struct device *dev, unsigned int id) > stx104gpio->chip.direction_input = stx104_gpio_direction_input; > stx104gpio->chip.direction_output = stx104_gpio_direction_output; > stx104gpio->chip.get = stx104_gpio_get; > + stx104gpio->chip.get_multiple = stx104_gpio_get_multiple; > stx104gpio->chip.set = stx104_gpio_set; > stx104gpio->chip.set_multiple = stx104_gpio_set_multiple; > stx104gpio->base = base[id] + 3;