Received: by 10.213.65.68 with SMTP id h4csp35222imn; Thu, 15 Mar 2018 08:48:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELtuykL+xlo2FgHLZQrGODAnuxg0/V9cVj9X7QXVez4T63Dami28st2cVbrB9bzQstHayUh1 X-Received: by 2002:a17:902:47aa:: with SMTP id r39-v6mr8651982pld.72.1521128881764; Thu, 15 Mar 2018 08:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521128881; cv=none; d=google.com; s=arc-20160816; b=p+5S7YXSI0Z+i6eQiYblLzy/ulLcHv6T7N/IhUslz2bMiS5SvyDIrn75b3WxqosBO9 MJHCE8pf3BeH1HzIkMkfUVHKLhynStNA9YCrvkyiFemz1nd4NdYFcD64pTRtZAWr+Wq5 pQh3lfaVJsHZpL+rg8290M3TPxYmUO7B1OQ4AQQXgO3wK0my016LTXHR534mlifD1GfD PEg5cTbmO/caHsfMr1zC6V03K39b+sKPkYPKvL2nAwA7z6PhhQ6icfOiO0bgH+MvN9bU ckAwo4HHoL9RgaanyX8/40R7rxC8ut0lySwtNT/JcanD1vYkiMiEqh4DfuopDErRxhfY 3YDw== 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=1DOOqNP/Ia3jVEiDRjsEeszdgiEeyjiZb08NlpTMSu7YUaoiy9M95nwUCzVC9HDvqw 0gDZAGKj8K/VoBXLjkWpMRzDTkG8VoGAR0UXLGAGiyh4d66Ji9gmziYDQyFEP7b8vRJx qJWroT9chp1fIb8kVAngL0j23CKrD4MnU4D9Gpevvur+7InQSMCdMi4Adhs+BrwCqffE sJxxy+1q9jCaYrgmiIRkD1wdGsZfFA8CP5vz1mxjDTShjSFnY0BuTFHyg8qZEQhalpgL 4kOHwe6AoXlhBwQagwEH9a1LS7KIlHyIdgEB311QW1K+MxgpxChv5x10qfEGfJIwlhnh g6lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t+VQxzlA; 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 w16-v6si740596plp.621.2018.03.15.08.47.46; Thu, 15 Mar 2018 08:48:01 -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=t+VQxzlA; 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 S1752866AbeCOPqx (ORCPT + 99 others); Thu, 15 Mar 2018 11:46:53 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:34208 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbeCOPqu (ORCPT ); Thu, 15 Mar 2018 11:46:50 -0400 Received: by mail-yw0-f196.google.com with SMTP id x17so4908944ywj.1; Thu, 15 Mar 2018 08:46:50 -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=t+VQxzlAItpwtMnr8RShSSf+YCS9tglX4TwoJjWm77L2kTpshnWhY/sdB18LdVvdl0 Sbkbo3xxg5NGoqG+IfJVmyK6asyg9dA94BKooaKtjvTNlFad7WMUkcNLVpF6yQuzsPW0 n5hQKfujnmMNQVvRyP0syrJ0TtmBPtEWCG141Qb2oFEimM9cPZWTjTyrZS7ifNB7JbDf k6nMUbC6UpFDhs2NMB+iMmGFcxbXRpG0V8GtiO/E1aaI0v8WsmnvvLbzcsYpx5TdMZpd Oiz524G0P4FbpeKpkMCeBYSAeVYH9O3PMejPU5mRuWUcfkm53DwDxyfN6Q20oHKQjyot hpsA== 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=jp0lYXVbkxvWFqA6oWPGNNLBNEvYmyjG7YSNiA7qvL+8Rn3Unstcnr/eK8m8QXDoTs UeNFZyQFu2EdYkclg4Yo8TxccY2eCfRXNZlp2714WaV8MnwERqN4UpAYXMPPj2VudfQG VwyP0XtG/6O4YcMVH8Nn+EFb3THT2LQBmpRCnjMKQ9UdlivkoDraVauE8cGlsj/od5Zd IWZDnZWquwX4MXMRd5fOcj5HXDf8A24FITjaqMeyt+/cdOP0gRgdVr0wO6T6u+exBuQl Nq68lUfCvnFxwLGDfRZ6MPjMrmCXY/rYhP17UBWwASlZschapyqAKBA9akbcHXELLsYA t9OA== X-Gm-Message-State: AElRT7GUXNoo20E9/7ApXxBAKH+lQA27GDSn+vHDy/1NSDNIXT015e7C 2uLRaRRnjoH5MTm2KJpaYwrJbQ== X-Received: by 2002:a25:2185:: with SMTP id h127-v6mr6156471ybh.36.1521128809626; Thu, 15 Mar 2018 08:46:49 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id p5sm1991343ywc.1.2018.03.15.08.46.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 08:46:49 -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 v2 1/8] iio: stx104: Implement get_multiple callback Date: Thu, 15 Mar 2018 11:46:37 -0400 Message-Id: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1521128287.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