Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4410649imu; Tue, 29 Jan 2019 00:45:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4p+YnYapFdTxzuPpCDJf+oDMBVJQuPkSPgeB7Tizpf/1+C2RnFLyBXr41xAHHbysUU5+sI X-Received: by 2002:a63:1258:: with SMTP id 24mr22570898pgs.114.1548751547466; Tue, 29 Jan 2019 00:45:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548751547; cv=none; d=google.com; s=arc-20160816; b=zCDa74cQka9/8hYTNHYIUXIS6JJzr/5U14jJHyqakx0Mm7SKxv0NF3wDlHWWIOXqxf QcfhGIKks1bgxPoOtLqpAljn59IqWZi7U6gR/8fX7ZHnJWejw/JPsf5r/HZzXMoaOFu5 +V/9+pazozJgPxo4twWtQe07fvBhizviHrWO17416J/B6rGyRhNllVjkAELN0cc9th9L Uy4A7144sVOxxFfcuRKZj7DqQhfGcosfoYmpVheCt0xQOyTHfe595R1uFkX4eaXtw3Wj /JsYcpLppZOcMh15SjJiK3RgEvLdVNs6e4qBRx+gwGADciJDOCeLxayGvDukZTaTNmna wINw== 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=PpLsHCDGluO1vsNVw+7Cy8rzFc8ImPXS2+/9yCySWm4=; b=VW7kxOYymLEPwpRbau9mjCQFsVSj3njSrahddpOgtIUoPgibE2G9w7dvqCgzJlLrhH 4If9Ro6zw8PdtsHdyXr4/A88uh6CFfVYjwXB2x+J44etyCthcO77IRf7mMjRrtN/hEmH lGhHCjhrMszBWH7B1q9TOhVWHjIFgPSgJTNAOqI/zouLdjPsFKG3udbimg1p1uGYOYNJ sOKvF5PiIkRou5LkBTS93ltqnnIGx+URcEpDOFngqdsToTJz5cEZCc+uGiU1OEuRnc8w YslBClEUkaMRM9hs563WlVcU51zhvUug58r3xhbFQYKXYEtLiHPYVGZY7xyhkGKrL1an caZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Pp5HBo+z; 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 d7si12935747pfo.108.2019.01.29.00.45.32; Tue, 29 Jan 2019 00:45:47 -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=Pp5HBo+z; 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 S1728177AbfA2Io5 (ORCPT + 99 others); Tue, 29 Jan 2019 03:44:57 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39637 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbfA2IoZ (ORCPT ); Tue, 29 Jan 2019 03:44:25 -0500 Received: by mail-wm1-f66.google.com with SMTP id y8so16697438wmi.4 for ; Tue, 29 Jan 2019 00:44:24 -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=PpLsHCDGluO1vsNVw+7Cy8rzFc8ImPXS2+/9yCySWm4=; b=Pp5HBo+zRn/FU3isdmHpTUH2RZxF4VrG1kIQFAFHV7e3eCTHrhIqw0HV5j+fgORdEb AyeOXMEEhhUV5WAOteb6y+p8Db3NR4cwuI2d6nk2DTcBeM9wrJxY3L1DumfbihVPbUir K8UYsOdcbW+BFEr5+nBg+p1ebfAsf/tWzkDgOWZb4fMe8AID9Lg85VvOcBf0oSHF9RVK LbnHmFnKYOqMG4nC//v3wcvYBkVjCvO+o/RmKxa1kKQ8YyxdXS7mSBdEQuGh1OWgHyOp PPsuU/Kw5vf9vNkQQCH7htsqKQsaKSZcVtgKjugMEeXPH6Zw08HIj5uxvMZ67m1SW4JV AOiw== 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=PpLsHCDGluO1vsNVw+7Cy8rzFc8ImPXS2+/9yCySWm4=; b=PGGhQuK8gwK8jMMPPvFMUApVltIJNasvoSPe2VtSaXrLPDK64XhAx94ERRmBUJR6ea hiNJWajE7hAZsVxvVYsgMUrQJJVzpSol3190jBzc7YZQZYBJutUoIL68Pfl3Uie/Uz8+ HZd8d8OBBNoAS2SpufrT7n3gUBfY/xnocI/hSgR9cWZ2fUIKdbj5pbtIBlzL0Cb5tFO6 S2qSG5JEwnafatNDKq8ZtYzsr7mqxQ8ZBjnxNtT5ZJQpXqVuOdhhtdTnsaKLq6pF5MXB xIpydnLgp5/BweF9taBhmuQ7ZJqgJj3eBsIIqNVRazwU95J3zNlhrXQzrv/rbN2T8rIT N3sw== X-Gm-Message-State: AJcUukcCGohCqoSPxAZICVyNrp+p2QSmzv+mdQmLZnso9DnAGYcqFYlp thHldNt+bFn1sPXR/RlaLSBusA== X-Received: by 2002:a1c:b189:: with SMTP id a131mr21019132wmf.38.1548751464206; Tue, 29 Jan 2019 00:44:24 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id c1sm3979319wmb.14.2019.01.29.00.44.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 00:44:23 -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 v2 5/9] gpio: mockup: implement get_multiple() Date: Tue, 29 Jan 2019 09:44:07 +0100 Message-Id: <20190129084411.30495-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190129084411.30495-1-brgl@bgdev.pl> References: <20190129084411.30495-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.19.1