Received: by 10.213.65.68 with SMTP id h4csp421752imn; Sat, 17 Mar 2018 08:52:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELvwb5QEgXkeHSsrqgt3x4oAsHnUT9AJeOpsg5jSy4AiiXJW++YGWJMVzHS3XAQnXO9Bt4DP X-Received: by 10.98.144.205 with SMTP id q74mr1523616pfk.55.1521301960053; Sat, 17 Mar 2018 08:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521301960; cv=none; d=google.com; s=arc-20160816; b=XLFdx+ThUqppBiS8uT+TE3PoUvZA1rU9Ua7E/P7AN0/hThnu50MnX3OAwfpAnrkACl hl4RcJJbmWhCNIof2oZOiY6ZmMGYCi7uHnKfam5EwelJGt4x/xXNdHK4SsXC8i3G7Z5I Y8vnyYObqtzsmZ7Ix+sYiW7HmPYMhSXZiVuumaJeGH7LLyK+Uzf5MsVLfF5oSmNm57bJ 0ZsrEp0VwNI6JYDhYYxeWEAnzwgLD1QXXEFA8y7B9i5Fb2RyFbWn/Ev8hgW8k6u4sF6g yOG3fNg65ouSeTsg+H7gBbkXiF2LmUWx+0iQ68kHmYMlSogC6UdS3WeS4PaVZq8XoLq1 RsqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=oW7qoF0vCVNAEeVV6/d5z0FY+Hgb2Bn7ueLmM0QXAqA=; b=BigunDnOt5oMfnt34n/6VM+I4OWpNvYXJiquwW1WdkLA59Go+jEqhfz+ndlp+h38YY mxoLWwBzMmeXhrYsJUQ11Tj9MEEHI2yn+7FHMuZkzbzQ6RHXtQVSbzQ3EBeHdab92fUH S7PCb3tEORkpU5LHE8KAl0F2RkecO+NVhUU4MVqkiwrCGRJZPfjsXqNI5mTZ+8NoY5MX z/1kN23/QUFa1BCa5zO6k5rg1vE3jhdbXQKzZh8ymzJMU8/IAAYOYY6UhR97ZS4ailOP nmbRliWLgMY3fZRVvThWIJHVlQ7PQwERe4xcuFfSeITAi7eFhjYqutK70KkF4mBz6Nuk Rq1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J3a1f9QX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u190si6938486pgc.532.2018.03.17.08.52.26; Sat, 17 Mar 2018 08:52:40 -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=@gmail.com header.s=20161025 header.b=J3a1f9QX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582AbeCQPuM (ORCPT + 99 others); Sat, 17 Mar 2018 11:50:12 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:33520 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752875AbeCQPuI (ORCPT ); Sat, 17 Mar 2018 11:50:08 -0400 Received: by mail-yw0-f193.google.com with SMTP id l200so8928913ywb.0; Sat, 17 Mar 2018 08:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oW7qoF0vCVNAEeVV6/d5z0FY+Hgb2Bn7ueLmM0QXAqA=; b=J3a1f9QXL4sE/sZmPywwiN4tUrO7e2n37FPkZlaE33zrHXxfT2Is/PYgyrcEYd5I2G k0hXkZtxW8JcjNuKSJfSllOn6f03DOGO/Tvk8AuydVpK8C3SOAhnxq0oStVljHwmTuzY Y9GtxMUKZtirgqC+yFiKQq6jNAY+LYwg0sKgJy8UDV/Yx+bw5GW6AAYKs/YWEtPiRtl/ igFbCgb9iDIXEllumTj0vfpZz6gTNvbjyCiiJUqtu+x0BD2lLd2+OkVSMTwPGt7ajTD7 im3Kxq9RmzBzElYpnG5ngmD2ShNIk9vXRGDq/9JeS18sk3r3xL7DyhwWmdEvWlCBDnWI IPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oW7qoF0vCVNAEeVV6/d5z0FY+Hgb2Bn7ueLmM0QXAqA=; b=pBXwuoaz7oanbMQqtiqB223tGkfxuS0WVnpcrvYyvQ3B9CU5JN4QqBKwyscKJtXV0n uF1v+p0RRHI3p7FZATmiRi/S3R2KvxWW1yQgf9s4H0vbr36Z76/mh1E+kVkLcC/m8oQH rMAZp+4S1USo7al+iNtpi780wfX3BPACTrG0lnWnGtMSLghcRJpwEUcUu5qndrwgD0Ck zovXYb9wkPLNpbsapM/7KxDKRkHGrf4GBomy0BidRgxPybtYvV8fVHnACKRiAdX/6tzu 7gET4TCR1kibFHnK/qu0sScEJOw5bFUvWcFhRXYcRI+NDTrJUeZnX/gx/pR2Wphvl3El 1Fdw== X-Gm-Message-State: AElRT7ErIAsBqZH4z7XjM7bzxQ13RfGU1pa1Ad0SgUrYp805XKFzIb/c D3+gA4ox0CoZsxVFPinLQcI= X-Received: by 2002:a25:4bc1:: with SMTP id y184-v6mr3442786yba.203.1521301808197; Sat, 17 Mar 2018 08:50:08 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id a189sm3616246ywc.51.2018.03.17.08.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Mar 2018 08:50:07 -0700 (PDT) From: William Breathitt Gray To: linus.walleij@linaro.org Cc: andy.shevchenko@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, William Breathitt Gray , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH v3 1/8] iio: stx104: Implement get_multiple callback Date: Sat, 17 Mar 2018 11:49:56 -0400 Message-Id: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1521301345.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.16.2