From patchwork Mon Sep 3 08:15:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145752 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2214159ljw; Mon, 3 Sep 2018 01:22:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNqAj4em3AO9+tdfwqvINP18cCcxDNtV/g1jTW4aBM3wVT+PhOQooT+gWyFPQsF8xOsszy X-Received: by 2002:a63:5204:: with SMTP id g4-v6mr24990294pgb.274.1535962967463; Mon, 03 Sep 2018 01:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535962967; cv=none; d=google.com; s=arc-20160816; b=pvBFiRpMwaIoUsSqW31SW+HXtM+CXlvJlO1Byfhbzrb6LDxQl2Rs8BVGOqoOJunkGZ 88F60e2nylbdCpBZ6+7HPUrAgCTT9hIIzsqkOeU2Gw0DrB4/PC9XB4s+NiF0MuEhLAh0 v2bs3SRkFPU85F4hz5BXIU0QRTyWjyA6SQiwqiYsJDUxV3zeWbUX6jqrahsnTYhjSoN0 kSrSJPFkBtbSoJIDwWpf3zg6JkBbp2Fw7P0HRpe+NMwTF77pealp/tr4mSl3qmJcbPcY e4sCWaOcLrqCcJVU3JzrVGhUbbfdRo1Q0GnoDyixymwL7mnEA1+WpKEEbM/l36ejZ6SP jIWw== 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=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=e0du7L3/4DGI8BLYAiA6z0JVWPtuJsn9Y/03GZwr9hIRsbz5cQ1oDGOlL8kmZYfIvY 8ZntqmlI9zhuabiDyuPTptsaPKUX21IR+3Ild4h0LQF4ecITKvqG5mk+1gr3YV0bE+L7 eQwBy/JqTJkb1OVgFr/KPSMa/6cwNixJgIBZIBAUXFFfsK+Sm/XyNw5PGD/4g2kwr3I1 ORy5W025UEuyP5XRDxK+nUxxcfGxfqN7dlUWm4RmQ8plyViG93m795bSkcuHQrvkmr0V bRa7NrMnyU7y5jg9Pxzo+E/qlTrElVMHO64J9NnCjefkVw4FRMVRQla6BZETWiwm+VhW yX+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sgq0zeWu; 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=pass (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 x61-v6si18233629plb.216.2018.09.03.01.22.47; Mon, 03 Sep 2018 01:22:47 -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=pass header.i=@linaro.org header.s=google header.b=Sgq0zeWu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726046AbeICMlt (ORCPT + 5 others); Mon, 3 Sep 2018 08:41:49 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35976 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeICMlt (ORCPT ); Mon, 3 Sep 2018 08:41:49 -0400 Received: by mail-lf1-f67.google.com with SMTP id x207-v6so8808501lff.3 for ; Mon, 03 Sep 2018 01:22:45 -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=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=Sgq0zeWuQdO5omA1TlFNDQjD0xFqvPj5x8hRa04thS9pWj7oe0Z48fIC51me/CaUre /GNjKAGB8rfeTgiDaNWZhcsNVddrJZ2sx5ltDwwpdytfseJVKg+NOmA571SnBmJu5aXV /kFosWMy7YghUBBo9h9EaVoy2tTQiJwEWg1Yk= 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=RkAEzL9F/AJzDFsnOwjiJnYhAPrZ+GGRNAZxSD+T5Og=; b=YOqqfjrZ0QIU3XL4Yf8wmycKYg/oqrf0467GNisK4Hg2LILzmQgN6kwh2n3rUux3Lb 2kwmSgFoYOi7YQ5BCel66dRX1Up8RBK1eYC4Q1KawTwUiLaxSbA8sBomrGDtgxKcn7Sz bIiPOUqcfCenuNttBoAkR4xtBwRfPCqYRSP+RkvFfcDxijey3Zj3dRG5Wti2RwOmQm78 5Sb6JLgfvDKkOAYA5sed4QJdwNytFIJZs2CEDPs4qnPXVk5O5FxDu+mztQEQZ4xCogsZ 8zNrh2QXDF3t+6ixETAT8rkNP0AKqvsu5RbHkyAa1BheP0fTgxWszaPssh770oe7HpTK rk3A== X-Gm-Message-State: APzg51APpHsMgMWrXxyw940MCFs7A3PJnavWeeW3Dm0EGZyj0QfA+FtL kQ3FkHUs6Ka+WaIoRf8hOHl1cRJHvz2P8Q== X-Received: by 2002:a19:f015:: with SMTP id p21-v6mr6352220lfc.56.1535962964561; Mon, 03 Sep 2018 01:22:44 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id r70-v6sm3316035lff.0.2018.09.03.01.22.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:22:43 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Tony Lindgren Subject: [PATCH 7/7] gpio: twl6040: Implement .get_direction() Date: Mon, 3 Sep 2018 10:15:56 +0200 Message-Id: <20180903081556.1411-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903081556.1411-1-linus.walleij@linaro.org> References: <20180903081556.1411-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The gpiolib cannot deduce the fact that every line is output by itself, implement a .get_direction() callback so we can inspect this. Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/gpio/gpio-twl6040.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.1 diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c index 77d50542bf61..c845b2ff1f43 100644 --- a/drivers/gpio/gpio-twl6040.c +++ b/drivers/gpio/gpio-twl6040.c @@ -32,6 +32,12 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset) return !!(ret & BIT(offset)); } +static int twl6040gpo_get_direction(struct gpio_chip *chip, unsigned offset) +{ + /* This means "out" */ + return 0; +} + static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset, int value) { @@ -62,6 +68,7 @@ static struct gpio_chip twl6040gpo_chip = { .owner = THIS_MODULE, .get = twl6040gpo_get, .direction_output = twl6040gpo_direction_out, + .get_direction = twl6040gpo_get_direction, .set = twl6040gpo_set, .can_sleep = true, };