Received: by 10.213.65.68 with SMTP id h4csp286020imn; Mon, 12 Mar 2018 13:50:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELslhKElmEP94h6eni01clRKl0btCwwmy2k2XQuaQCJbFBdgVNAJJrX1SIcAt2IJE7oZJef1 X-Received: by 2002:a17:902:ad0b:: with SMTP id i11-v6mr9472581plr.10.1520887838804; Mon, 12 Mar 2018 13:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520887838; cv=none; d=google.com; s=arc-20160816; b=Kthvk3ePwxcwkbWEbrZLpnin4xxVFehWsYV87+1YN8YGcat2XLcHxzS8bLNg5u6Iap Kv7gMEyaMFm4pc5w3ZP9QIjfTw1Hy6caUe0bGs5BYvGx4RHmh3PTK16D8IgoQlgQGwft uCqlfB8Lob8xR37nlJFEO7hm7ShPCVg5o4EL5pq0j6y/Ty+AnY+xBw1ZD/IGKjPfYkWa jfbrShct91HDQIrJDOlLk8vTpZOHLgHLlkQnshYUafv2f1vqUrkpjb9Z0FqJG4Xly6gz KzF70cRPPwb7yyQyLKxSjio6dNDxCoDrxMCmgFocMznWNBU4FGMbHSnV5eP0m+keJRKc GVhg== 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=ttLfzey7ceRMCibxiRT8YvLqYBQ4yvZgHhlHr8wM75wkTK/VL2ha9ITsFKYFyAgFcm /nVVm9xjThPwAztcZnbmvb6FEwz7CdItodkS06uawbRo/qPsONZLsEHJalN3rWqwfw/d N7dN44kPvpmbmAY5n8TIeoGG9lpDBg2fBdqXJmnlRL+OgGp5AqtpX5/MkKOdJy9RULEC u+JyJ8TFzOawDeRJIpeMw32zgFO/iOn534e3DXDK7SQA2ScU8US+qd+5pYSuGILWZlgk NSpeWugiZg85jIsC+02Act1K8eZ+EMZ6TMJJ69vWNpIth3z8ijLvu1MjQLejO2+aM/EQ mugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g0P6FKq8; 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 g11si5444428pgv.97.2018.03.12.13.50.24; Mon, 12 Mar 2018 13:50:38 -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=g0P6FKq8; 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 S932445AbeCLUsu (ORCPT + 99 others); Mon, 12 Mar 2018 16:48:50 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:41309 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932274AbeCLUsr (ORCPT ); Mon, 12 Mar 2018 16:48:47 -0400 Received: by mail-yw0-f194.google.com with SMTP id w12so6390494ywa.8; Mon, 12 Mar 2018 13:48:47 -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=g0P6FKq8Zw2mYvSaVLGyc6P2JH+B+rKftjlYOnnBbe+lX8g/n+ke6OtujrjAwPtmsj VobYcwzTLctDSYWQB5Or4xAdi212MYn9cYYVjDwwcTBWgYPUBJpKD9kW2WnofpKorcgV E5qGHmYtdpsKN0k24Ws42seGmuyF4HOMg2fpqEnaFXNoQ0W7J/ALEXWru0Sszy/2whoz thln/umKOpqptim1K2YczimOTkYvdNawE3nASSAVRr9iMuB+8GngxdUEYMFEGmzp11h3 SIbeDSDVtNb+xyGihJzNXg+JvqyRDuznLhPSrKtPJth21/d2ScYHOkC8J0EVia+bAZmf RfIA== 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=K5Xj4k/mUtNyXHrexQuzUUvA6ozceicIx1TQOClhUe1ygHnopVEgd0+nfH8tGgi0fq uswS0vdwLrY/Mq4tXfIbp4MvNz/VHtDRT0aHuSi9Nj55ZS8eWjdWPWMtG3rce5SRQN2I YRQWWVb0m4xZhxLrsOzMTY/LkvEK37D/uLoDXTlalzi73nziaE4eDOglxcq/kg9tDKiS i6l986Atli9EtezXK9cTcJrDkCUNAY4Q7Q7txKHrXg4pJz+6HUt70ohqqsD0zrARR/z9 GIwDfDY9kFS9gSBiJ1grt0BxxCC+GprTGmsP+Pzk3xfPivZvYDtXTRGvckg7dlj2XUgt NkvQ== X-Gm-Message-State: AElRT7GrN23eKM3k0hh0xxypu7BjEWRZR3yGyrw7AHUnNgvoTo/i7Z/G IjImlsTNR4eEjqheEcMqBZ0= X-Received: by 10.13.252.198 with SMTP id m189mr5358088ywf.84.1520887727006; Mon, 12 Mar 2018 13:48:47 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id r127sm3279553ywr.45.2018.03.12.13.48.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 13:48:46 -0700 (PDT) From: William Breathitt Gray To: linus.walleij@linaro.org Cc: 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 1/8] iio: stx104: Implement get_multiple callback Date: Mon, 12 Mar 2018 16:48:40 -0400 Message-Id: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1520886945.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