Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2720081imj; Mon, 18 Feb 2019 10:54:14 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib6HKSJTxagS6fZYT1P4dB+80focSCejKBHhNKiFqgWEjTEDolRZ6aohUjABnNgNwl4cSe6 X-Received: by 2002:a63:e952:: with SMTP id q18mr11425935pgj.156.1550516054449; Mon, 18 Feb 2019 10:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550516054; cv=none; d=google.com; s=arc-20160816; b=H5GYt9u07F5vJJvUIgrC7kcPGu2YMHIEKn+CJ+TJn2p+bC9Cz2BZbt8GlfgtsoTDZo 8D4QovSASnmsB7q/Z1iNbWYbQ389b2e0xlHuRsUMjRW+e2hsGg+p2O+6dgjv25hqF2Zl uVXcfyCcgmpi/fM8IDe1Ex5o2JH06ZbWHxEd2z2ABPahYl/CE/7jbDRYtYfzcwmC2GLO vhh1rh3MFWV7vrtoVB1tBZLH694EVP65DlPAHgQRwQOUUyBKxooGWHUSACNhV6sDw1Km P3K2FT//MEY7jtsV30mmFPgXyNumKz2A18Q4dj4stTcwDwRG8Z3LBDPOzEt+Si/ERS7u 3QjA== 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:date:subject:cc:to:from :dkim-signature; bh=1WGhX7lh3GClMJMpleuT6xjtmXeQaabY429BNB+za3s=; b=H4jKcHr1jwRbfS/a/adHLPCFZyZ3aO/XP5VTmDqyb+kAUN9pFY7+k91Y4I3hFnLn7o KrmfApsv7Jcxt4flqBbFxDjX1xso0UI/1nksuD7k1N5QYd3wITwnwoUEW/yP2FvAf9Xp R2jOVzsJ0Mj/wpqre17G7RzJycgKCdn1E+w1B7mvyR9J2p1ptV6yzKJVkEwns4V6i3BQ cXLN8pCY2/LL3P6hqe++1DvNv2o70cqlcslbcVTnIraLZqhosU4YxowwFUnij9/4BAv6 XpIKgKwKdUE0gd12GMAaXt/uXN+UgAeHeuAimRIsN8OuE+CGrBymOMqV+S4N7amcQdhQ r0yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=P6FcZXhq; 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 g8si14332726pgo.166.2019.02.18.10.53.57; Mon, 18 Feb 2019 10:54:14 -0800 (PST) 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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=P6FcZXhq; 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 S2390001AbfBRQlv (ORCPT + 99 others); Mon, 18 Feb 2019 11:41:51 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45155 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733255AbfBRQlr (ORCPT ); Mon, 18 Feb 2019 11:41:47 -0500 Received: by mail-wr1-f68.google.com with SMTP id w17so19047636wrn.12 for ; Mon, 18 Feb 2019 08:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1WGhX7lh3GClMJMpleuT6xjtmXeQaabY429BNB+za3s=; b=P6FcZXhquM9/aAoB0WzXCs/+tvhTlKD4swvjDljYHre3gInE7yXRHz4KjWkN6JL8dI Nl2wHNcvbKDG5fW9nlOyjq/g4TBAhR5XEi1bU1NiKgtIFt57ehH99cSv96NrMO2IowJ7 MwUrbswlr9vBKl+MXpkEM/TH7LDCMARY5YmLFWWIPppAdg3djLNLRQGrrbp+QppNHPNF WHXPw3SMF0UDIiWOJAtkOW0zBnudcI6hjParwxYHVIEy22jP50VnhVK71o7incyMA4NO 6u4d/KkV67U07UZBfdbUHM8VvwmgDrHG8u8Fj3AwoRdOfT5bIaDBUO4TCLXbvRIi50fj EkJA== 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:mime-version:content-transfer-encoding; bh=1WGhX7lh3GClMJMpleuT6xjtmXeQaabY429BNB+za3s=; b=EtUULQo6dHselDAHZnX1haZTO+mx8blp3DjrbK0S40sN09EUlFTm4/yyAVeHqrhiGp gFHpph2Bh57j0Q5ZDjQ3T3QE+/0e03PLiBHXuOGZwODQWtKOxPeavLOBWqNFhxNdrxIY p0BuvQ4G6wH804qHmWapI6s6x/HN3R+Kmoe3KZKkFqdvtDnSQdSlijIs8bWUZhPSZWJR Wf9QglP02nFNFZNlVlwecVd/1wqwpfb6Rd/JkaMKvyoOknIuuGXRM69x+18u2bndpFD5 NQs1+2U1KjBuA7bhRwTPPhJ8ZBVdcZbv9nrzGkeTWSLudlAvCBq0dKv8IcCOWm/qK69p h6WQ== X-Gm-Message-State: AHQUAua2lRtiB3ix+RKeZTf7j8UQemgORmRIs1sauKX1w+dyDm9bCqn2 njSac1jn3IsyWnfOJJDYTb/tMA== X-Received: by 2002:a5d:4686:: with SMTP id u6mr18227506wrq.206.1550508105746; Mon, 18 Feb 2019 08:41:45 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-7-43.w90-86.abo.wanadoo.fr. [90.86.124.43]) by smtp.gmail.com with ESMTPSA id w10sm6325442wru.5.2019.02.18.08.41.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 08:41:45 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Thomas Gleixner , Marc Zyngier , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v5 3/7] gpio: mockup: implement get_multiple() Date: Mon, 18 Feb 2019 17:41:34 +0100 Message-Id: <20190218164138.24921-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218164138.24921-1-brgl@bgdev.pl> References: <20190218164138.24921-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski We already support set_multiple(). Implement get_multiple() as well. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-mockup.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index b4c1de6acf74..1c945c967f60 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -102,6 +102,22 @@ static int gpio_mockup_get(struct gpio_chip *gc, unsigned int offset) return val; } +static int gpio_mockup_get_multiple(struct gpio_chip *gc, + unsigned long *mask, unsigned long *bits) +{ + struct gpio_mockup_chip *chip = gpiochip_get_data(gc); + unsigned int bit, val; + + mutex_lock(&chip->lock); + for_each_set_bit(bit, mask, gc->ngpio) { + val = __gpio_mockup_get(gc, bit); + __assign_bit(bit, bits, val); + } + mutex_unlock(&chip->lock); + + return 0; +} + static void __gpio_mockup_set(struct gpio_chip *gc, unsigned int offset, int value) { @@ -327,6 +343,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) gc->parent = dev; gc->get = gpio_mockup_get; gc->set = gpio_mockup_set; + gc->get_multiple = gpio_mockup_get_multiple; gc->set_multiple = gpio_mockup_set_multiple; gc->direction_output = gpio_mockup_dirout; gc->direction_input = gpio_mockup_dirin; -- 2.20.1