From patchwork Fri Oct 27 20:21:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 117381 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1178027qgn; Fri, 27 Oct 2017 13:22:09 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QxwYOgdaHYWSNdO78G2QIc6b08hgyWj3hWctmPqdLhziZkNSz9yclHB01k8tPZMR9/z2Vq X-Received: by 10.99.157.133 with SMTP id i127mr1270060pgd.204.1509135729748; Fri, 27 Oct 2017 13:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509135729; cv=none; d=google.com; s=arc-20160816; b=yY4kSt6f5V8HJDSQDuvbes70f1aisleL/Tncb+0KQIFOyamkUjY/0+jTfCoUfUpc/O /LLk3a1tEmJ6tYI0pVyQDtGYe+39X0nn2rZqmHY3O14Lo6OiplTdrj+mmoIdIofK+meM Ej2sblV2TOFKzZgToJUx4CSIhsWinbuFLPcDvp1hCMDt5hHLhC7wrs7W1gYYkDZkSh63 o6lcU1iaZW/8kU6X9rOhgerqluwGMX3vDxCE0eWII2k70CMsE5dRLpAdezNFnmCarZLu L3W2YvxXu5tEq/Ty8qVzRiNcKxKHu7pfiY9JaCThfnJ+kbjvz7XtGZgqFn4THSkfKypr 4qjA== 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=LgO1Rfv3BERt/U0Fa8kgdg+GpJnnt/rTt70bAXorpyA=; b=tzKuVxS0nln0uL9IR0uHfJyJBLr5MITKBTxGE4HWppphVuw0QluOhiG8kDTY/gq6Og QHGjiLRji7kkf04XQmp1gFSRT4naQ3G+eGD7BvAhOULDJJ9uX0pk6Ij59LbuCRWaIKId ZSfVC67SzUZ+yxhWc0CKBmcj2MrmoFQTxzrjuYXU1lRO9xLni9R2IiG8AYCE7TVtxa9G ZNdOFaleSVwMoGezaj3nBe+81XnWqiKPl7Rh377vHu8LXhqrVH+BokBgnyuTWyqNIeR4 nhxkgppjGYiSZlZXS5cwps9EbaUHyupcRRypWTCEIuWoxlQxOJI2RZSltO4W+rzWOnDl 7tYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=E+57a4Tw; 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 m1si4794691pld.579.2017.10.27.13.22.09; Fri, 27 Oct 2017 13:22:09 -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=E+57a4Tw; 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 S1751854AbdJ0UWJ (ORCPT + 6 others); Fri, 27 Oct 2017 16:22:09 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:53116 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbdJ0UWI (ORCPT ); Fri, 27 Oct 2017 16:22:08 -0400 Received: by mail-wm0-f67.google.com with SMTP id t139so5844078wmt.1 for ; Fri, 27 Oct 2017 13:22:07 -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=vwEgeMlANj81tpLa4Ph8+3rET1AF6vw2TAj/lcZ6Ejo=; b=E+57a4TwMLTdIJNlJzxlur8g9O+1JqSNmAbQObzWYxuqC0Xz0nI4lleJb03VgJt7Y/ FcD+/99e0sOGygAf3W3TFzC7wc9b/IqdVkwqnjRWjiV2yO6VcJmcrtAH6VKpUb0f3EHi 8Wpd+6aw29CCfSDG2+39bHm3ELgH9527hshf0= 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=vwEgeMlANj81tpLa4Ph8+3rET1AF6vw2TAj/lcZ6Ejo=; b=fjJ5yCtg2ospwAEkDtzaB6OGHk5BT6kmibupxDXnHO92QUtgXimnJ3C9XEAXcuuNZX Y02+RF/G4UeA3l802yu28O9+edG87cV8qneOQbbEfKMe9Bekexez1U1A7fdIXqd+j/tZ e/HbJuC32SCcS1KfclXB3S00jdRyOR9kjlUSYEegNexQ4ShheKODV+d45AaQcaFspQkU ZQNu/oFGQGMmkW1YS64odkjZxC+k8cMGrm+JWzK/2TsYbrcKF6nkXp95xgjKndNy6TDV EXiQwQVXzQe0jYdhPK7609YriCQ0pDbZBxnuergQtYOwQhOAAQmRSo5nUsqwRE0YHOjd lXPg== X-Gm-Message-State: AMCzsaVWVbyoXBptiUPXlWdVMfuLsIP4CeXI2/MQ709xAOd8JQXqaNp+ 8OpdfPnGByHOSnjBJ0cJf+jFbhkGYFo= X-Received: by 10.28.174.78 with SMTP id x75mr1427527wme.27.1509135727002; Fri, 27 Oct 2017 13:22:07 -0700 (PDT) Received: from localhost.localdomain ([160.171.245.11]) by smtp.gmail.com with ESMTPSA id c37sm10388722wrc.92.2017.10.27.13.22.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 13:22:05 -0700 (PDT) From: Ard Biesheuvel To: linux-gpio@vger.kernel.org Cc: linus.walleij@linaro.org, daniel.thompson@linaro.org, leif.lindholm@linaro.org, jaswinder.singh@linaro.org, masami.hiramatsu@linaro.org, Ard Biesheuvel , Geliang Tang , Paul Gortmaker Subject: [PATCH 1/2] gpio: mb86s7x: share with other SoCs as module Date: Fri, 27 Oct 2017 21:21:47 +0100 Message-Id: <20171027202148.4188-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171027202148.4188-1-ard.biesheuvel@linaro.org> References: <20171027202148.4188-1-ard.biesheuvel@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org In order to reuse this driver for the Socionext Synquacer SC2A11 SoC, which inherited this IP from Fujitsu, remove the ARCH_MB86S7X Kconfig dependency, and revert the changes that prevent it from being built as a module. This reverts commits d65aa4b67b4f47f303bdeaef1e4d42ef18e6b293 and d5610e514e92144d19bd5e39e5cf3804bbf85f3e. Cc: Geliang Tang Cc: Linus Walleij Cc: Paul Gortmaker Signed-off-by: Ard Biesheuvel --- drivers/gpio/Kconfig | 3 +-- drivers/gpio/gpio-mb86s7x.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) -- 2.11.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 diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 3f80f167ed56..bf40a948e4cc 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -286,8 +286,7 @@ config GPIO_LYNXPOINT Requires ACPI device enumeration code to set up a platform device. config GPIO_MB86S7X - bool "GPIO support for Fujitsu MB86S7x Platforms" - depends on ARCH_MB86S7X || COMPILE_TEST + tristate "GPIO support for Fujitsu MB86S7x Platforms" help Say yes here to support the GPIO controller in Fujitsu MB86S70 SoCs. diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c index 94d772677ed6..6e1598471733 100644 --- a/drivers/gpio/gpio-mb86s7x.c +++ b/drivers/gpio/gpio-mb86s7x.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -209,6 +210,7 @@ static const struct of_device_id mb86s70_gpio_dt_ids[] = { { .compatible = "fujitsu,mb86s70-gpio" }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, mb86s70_gpio_dt_ids); static struct platform_driver mb86s70_gpio_driver = { .driver = { @@ -219,4 +221,12 @@ static struct platform_driver mb86s70_gpio_driver = { .remove = mb86s70_gpio_remove, }; -builtin_platform_driver(mb86s70_gpio_driver); +static int __init mb86s70_gpio_init(void) +{ + return platform_driver_register(&mb86s70_gpio_driver); +} +module_init(mb86s70_gpio_init); + +MODULE_DESCRIPTION("MB86S7x GPIO Driver"); +MODULE_ALIAS("platform:mb86s70-gpio"); +MODULE_LICENSE("GPL"); From patchwork Fri Oct 27 20:21:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 117382 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1178060qgn; Fri, 27 Oct 2017 13:22:12 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Ssq0GsO5IG6UFJZfiDTdUCVJgoeMFhmNm6GZ+IobV6TGTeP9VMCXDjuWCibMHoCAYGslMJ X-Received: by 10.98.9.207 with SMTP id 76mr1545908pfj.70.1509135732292; Fri, 27 Oct 2017 13:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509135732; cv=none; d=google.com; s=arc-20160816; b=ystb7b2RrXkZ7I3zqp50UU2CwLfnYN3pdCBHe1MNWPePvNuaDVgcFWn8xYvZ/SDOsm 8nyycKjsAHbM4U5MND3awrkxRirtWNPFhzqTYuH78d9+PYHsqeXWvpt5M0iiT+p8rBku rdjVh7uQkBElYDMuI3HlVSBdzdM6o/U28cWUonef86v6fdE2H1z9Kg8B/RxvddY6kei/ 7fl3VnDDROoiH0mWll8st6jkxkFEiUmwLbKXeOK+SIFDtR5ThKDy3ITBKwlw+2C2H1gF +xSRC6qZjD+Reop8YO0qq34bGgoyeP1acRyrwm1G/0zBJ+DrgdWrOtN1AH03emZeRH52 mu0g== 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=CTFhVK/vNgoDy+aWIzC/JEmZlOoYDU2LzsDfjjyvytQ=; b=SIzJFiAGlhZ9dkGBqUvVWxoG8FVAeSN8Q6V6GOycJwLQW8SithM37P+5k+LXMMHgT6 zLqcgz9DNuc0DxYtRL0pMH8SVt5gQiX0Klz5nnAtuKywdMNJ9DEfcv+T+rgKvLKd0wRn eP/bLXbKU0tG/QD2yoNJaeuzsmGYgmDh18kqJEZsBqtNZzSyOf6DU/lkPHwYRkTNv8oC fizeHPz+Pe8gGGjnsVMkP4Z+6wje7YhGeNgCOcnz0sLVT/pffiDYrrCKBTiranPcFEDF kzB567jFSQtqYMo6DmnmBKwiwXqh7kSOmfzWQJs070fvx+Wns3KQh/Fjcfw5QBG6/aYd 00/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZpBikJL1; 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 m1si4794691pld.579.2017.10.27.13.22.12; Fri, 27 Oct 2017 13:22:12 -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=ZpBikJL1; 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 S1751937AbdJ0UWL (ORCPT + 6 others); Fri, 27 Oct 2017 16:22:11 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:56575 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbdJ0UWL (ORCPT ); Fri, 27 Oct 2017 16:22:11 -0400 Received: by mail-wm0-f68.google.com with SMTP id z3so5811324wme.5 for ; Fri, 27 Oct 2017 13:22:10 -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=0/NKbU3bn70N2wDAa/SJuZL5Bi72sfRkly7jnxJofBM=; b=ZpBikJL1ggvNWzPv3Bny1/uB4giQqGprbbknLJ/1K0XfIuE8QBuCuMtRZFP1TjSY0c tbnD4x4Ermh3uPHVPerS1eB5hmLpaorU43MmHd3YDliPSi2ujY/liM6zTR1R23eu/tFI x9PjmfS0sCYUiHUIevqNReIaQBncXeF1efwxU= 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=0/NKbU3bn70N2wDAa/SJuZL5Bi72sfRkly7jnxJofBM=; b=q/oIVF9AVMzkYKxOsAsTm/cbp2EIbntFqYTUoG/E6rl9RFGOwCkFJQNpGdmmx0rMbX suFVHY7Onamv6elukgA9qd1sHiFg8J1wU3jdwIPQW31f9O+gVrqEPFDbrBwvZXFq4F72 IV1a4xbBWuBkYFIfHtWIGLFkw6pUBCXi1mWCJQJLzGjcwvubX/qVb4ujIQuFKCvuJ8Oy yK7tRc4aaTIYHdgtECE4Vn6w5Yiw3akPakAuYXpgxiDw4hfdUb/UDHf+Wuy0eMn+YWbY 18IxZPbek7pnSYt74EP/c7XU/WRyDkmsp2aYVdUb5jVeb2TV//VYWRLlWvHsqTbizxN0 6kUw== X-Gm-Message-State: AMCzsaVzbXKOopM9TN94ioClm5J85ZUaXvDfIpAGhU+3h3qEEBdCHdro NdDE5gjERnqvA/5zOzwD2PMESWf+EGg= X-Received: by 10.28.178.205 with SMTP id b196mr1272031wmf.103.1509135729647; Fri, 27 Oct 2017 13:22:09 -0700 (PDT) Received: from localhost.localdomain ([160.171.245.11]) by smtp.gmail.com with ESMTPSA id c37sm10388722wrc.92.2017.10.27.13.22.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 13:22:08 -0700 (PDT) From: Ard Biesheuvel To: linux-gpio@vger.kernel.org Cc: linus.walleij@linaro.org, daniel.thompson@linaro.org, leif.lindholm@linaro.org, jaswinder.singh@linaro.org, masami.hiramatsu@linaro.org, Ard Biesheuvel , Axel Lin Subject: [PATCH 2/2] gpio: mb86s70: Revert "Return error if requesting an already assigned gpio" Date: Fri, 27 Oct 2017 21:21:48 +0100 Message-Id: <20171027202148.4188-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171027202148.4188-1-ard.biesheuvel@linaro.org> References: <20171027202148.4188-1-ard.biesheuvel@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Commit fd9c963c5661 ("gpio: mb86s70: Return error if requesting an already assigned gpio") adds code that infers from the state of the GPIO Pin Function Register (PFR) whether a GPIO has been assigned already. This assumes that the pin functions are set to 'peripheral' when the driver is loaded, which is not guaranteed. Also, the GPIO layer is perfectly capable of keeping track of which GPIOs have been assigned already, so we shouldn't need this check in the first place. This reverts commit fd9c963c5661af3403e77e312c0d9941773b6c1b. Cc: Axel Lin Cc: Linus Walleij Signed-off-by: Ard Biesheuvel --- drivers/gpio/gpio-mb86s7x.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.11.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: Axel Lin diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c index 6e1598471733..5cd77dcdbb16 100644 --- a/drivers/gpio/gpio-mb86s7x.c +++ b/drivers/gpio/gpio-mb86s7x.c @@ -53,11 +53,6 @@ static int mb86s70_gpio_request(struct gpio_chip *gc, unsigned gpio) spin_lock_irqsave(&gchip->lock, flags); val = readl(gchip->base + PFR(gpio)); - if (!(val & OFFSET(gpio))) { - spin_unlock_irqrestore(&gchip->lock, flags); - return -EINVAL; - } - val &= ~OFFSET(gpio); writel(val, gchip->base + PFR(gpio));