From patchwork Fri Jun 29 06:35:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140513 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp465290ljj; Thu, 28 Jun 2018 23:36:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPXmnK5uMc5hdMcdfkjAHCW3ZooQHfxMCaEGMYOYiXcFNfopkJwLHZ14vruux+sP1EWC/I X-Received: by 2002:a65:5a01:: with SMTP id y1-v6mr716773pgs.125.1530254164927; Thu, 28 Jun 2018 23:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530254164; cv=none; d=google.com; s=arc-20160816; b=nln6CDokLCak9jLqHOMTvQ8pqywB+x//nzFi9MDDpeC1ooAKig7GTRoS6SmTjktWJS R8xIF5V/MYkl0W14o1DGqZYwa6UU7UAi1sQxP/B/58noSRxGLMNDzqkAy+6ldXe9CFlJ dGfT/mxXtBdZsPnU3HNZmnXjGY57dkqJ3/83KPoQM2E3QA/QggY3mYE7mCJN9V0RRTDd Rdp6KiQN/gN1R9wGiIQcPDvim1XIX7Cc3Fkypdi04ok1vZHHijlf2Tt46Doi0TSWiUX2 nWvCGlV340FHmeWsqf0LTtR5VXsXp0nDu2U46lxm3r8X/X5JyHKFhdT50c+BGg7h2gzn 3stw== 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=a5O8t9E9sRfp0QgCF4F3Nx2V3mexKXmyBZtEsg1lvm0=; b=ev+HycKnOIX+dJ5qhTfidEzMfysA/6s/lepnklwA8IcpPgVc4dP3j56UfaEuNkT+su slLgHQY404HGxpajS5ScfLk4amA006F+lx4c0300CG9KPHTjYQT9TbAf/YkwM55wT/WI GXKTSCyzaz9YlykjaBmozH9JMrIRxlfFQyv37Iz4mC1DabaO4PmCjaUGlIzpp7dZROFA vi4BGjG7NwH0jendoNNovB+5/3VmVZUW2BTrYFHgxfMhIbl/9BJ6XfHx9c7IeIjBaCtS wF4h4graXqUIEWjA7vVcoMCnNICVRZFnnTU6mW2ELKogm9+wkyCTGmxr//oCAJkI+btg rK+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=h6+PlJUP; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si398613pge.585.2018.06.28.23.36.04; Thu, 28 Jun 2018 23:36:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=h6+PlJUP; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbeF2GgE (ORCPT + 5 others); Fri, 29 Jun 2018 02:36:04 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:43706 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753210AbeF2GgD (ORCPT ); Fri, 29 Jun 2018 02:36:03 -0400 Received: by mail-lf0-f65.google.com with SMTP id m12-v6so5419448lfc.10 for ; Thu, 28 Jun 2018 23:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j2pYjLQi68s+yyqoJk4GQv/JRe3AfQdKvQR0jKalUT8=; b=h6+PlJUPzR4tO1DEgj24GK9ZqzEhAecCEdpoa+MS4eO2x1M/0p4ozc3zjfXxJWCHLM 1S1S3cnPOwXlFBPEefS3cgvx2L+tl2Dv3Mu7TFg+4vamWn2eRsj//R3HR9N5w9t2PxYL jCg1hihfF2V3g6oA2YZzomcbG/tMduVkbIEf4= 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=j2pYjLQi68s+yyqoJk4GQv/JRe3AfQdKvQR0jKalUT8=; b=lwNHNyBmnzqqV4I6GHXrIO2+rXs7aU0Z4jXUro9tp/n2KE5xO02ZSt4/17CcSPE5bz gq1CjWyA5YUvlHb6o/l+js4vYOL3oZLcjU9iWfXES66TenA6U+wWAg7zfZ7iqmHYE9RW R99Jvdh6XAhz4JebkOl4GHtuUOht6wy26jBLzxycSFJ+G1fvNU1sivTZEBn0WQNIcPB3 vn3IFM5CMQ+0jf0g4xP1bv/FJptxTqewtd6X3Uq9kS+3L9r/vHN0cpYMucgvrzp3525O 1TynvC8LziLFsNVI8R0hepWe2nyTjMdtBIRhyWt5Lk/dG+ZOGOf5TtBlUKa0WiVcANeO ZcRg== X-Gm-Message-State: APt69E06SiWdUC8ZiFHdT+0jrTu7iI9l+Cuq9GjOAlvd5EBs8s3QVS/I 3vMOgg1VPOKj31z9h5nja9SPAItw6t0= X-Received: by 2002:a19:c004:: with SMTP id q4-v6mr8648835lff.16.1530254162023; Thu, 28 Jun 2018 23:36:02 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v2-v6sm1382162ljj.71.2018.06.28.23.36.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jun 2018 23:36:00 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Denis Turischev , Daniel Krueger , Mika Westerberg Subject: [PATCH 06/18] gpio: sch: Implement .get_direction() Date: Fri, 29 Jun 2018 08:35:32 +0200 Message-Id: <20180629063544.3826-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180629063544.3826-1-linus.walleij@linaro.org> References: <20180629063544.3826-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org It's pretty simple to implement the .get_direction() for this chip, so let's just do it. Cc: Denis Turischev Cc: Daniel Krueger Cc: Mika Westerberg Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sch.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Mika Westerberg diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c index 26e9b1cd2c78..e9878f6ede67 100644 --- a/drivers/gpio/gpio-sch.c +++ b/drivers/gpio/gpio-sch.c @@ -137,6 +137,13 @@ static int sch_gpio_direction_out(struct gpio_chip *gc, unsigned gpio_num, return 0; } +static int sch_gpio_get_direction(struct gpio_chip *gc, unsigned gpio_num) +{ + struct sch_gpio *sch = gpiochip_get_data(gc); + + return sch_gpio_reg_get(sch, gpio_num, GIO); +} + static const struct gpio_chip sch_gpio_chip = { .label = "sch_gpio", .owner = THIS_MODULE, @@ -144,6 +151,7 @@ static const struct gpio_chip sch_gpio_chip = { .get = sch_gpio_get, .direction_output = sch_gpio_direction_out, .set = sch_gpio_set, + .get_direction = sch_gpio_get_direction, }; static int sch_gpio_probe(struct platform_device *pdev)