From patchwork Wed Feb 1 06:47:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13123837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AFB0C636D4 for ; Wed, 1 Feb 2023 06:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rkN86TIGDYJR+4nG2fHZ23r9O15jnUv5Y7OgjldbOWg=; b=bJ/LWOnAXhJ0Lf3EmdWsn17f8g nKhI562tfOmfihgVT40MamDWp1BedqNCx0AHR57vB257uWI7kDsKEj+H7VtfUN7kmZx4cG1Wh+NUW y68PfrLNWB+QRSjsQnahtSyYTwcHR2xnJn73AqZIUc0+/2EGQXfKBre384YVf2MCkNcspmub6ihLt BiwobTFFkJUEV5EAZLNH2vlc2tXiRzZtTFUJaTJg7L8tB0D/is6bj8veWmCYn3Rt6XnNPQiY2LwEY vIetl4Y8JkcyrvkKaE7qOYsSQ3IdJEbh2T+/s0s+Ya+FFqeZ1+ZsADR1hvWvlBnUTBO6JWFcX/SQ3 NF0isTMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6z4-00AVm5-QJ; Wed, 01 Feb 2023 06:52:42 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6yt-00AVhW-VV; Wed, 01 Feb 2023 06:52:33 +0000 Received: by mail-ej1-x62d.google.com with SMTP id dr8so26881048ejc.12; Tue, 31 Jan 2023 22:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rkN86TIGDYJR+4nG2fHZ23r9O15jnUv5Y7OgjldbOWg=; b=XQIBijkI8+OKqPlP1sL19SlqXbWw60maYM9giAx3GHyaI8sTJzjRmp2DolRMnASr0y KN+uzR6MaFeH/IuHZUnl3SEco9dEAigoohMzr0+VR8jnKTbFs1fCxFNC7IK019wWt8OY QlzYoAHwljH2DooyMDx5L6kYW21Py4D8vjJ6cfSynz3h51BrFBttejiOKfgd1GgTw0dZ nvzLHSsmvPeJHRhlskiqcv2KfYB/dmNUWPK4L88y9+WMg/F2dS1qJkXnsz7aGsFYHnUn JUswLiy7imzInpudmE6IkD6zZJt8FYlpLUtjMa3u4G3B8tWtvyaAACqDkuz6q4JX0ttc zRsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rkN86TIGDYJR+4nG2fHZ23r9O15jnUv5Y7OgjldbOWg=; b=wpceln8iZA6MWrKoj5PuFQM8EhwOJgTLBsjsDKbW1JKsB/qLfAiTOeBYyPA32Drb4n OCwlofDYVoWQCEd29THlnmV8SGlqlDwSDIYELLRAnCzzqb0hGZt59YbSuWA6WVdl4JDh 9zWoq64ei48o9MHVcPUzlRDKkYDz4w+L/KXn/pPCv4fPEl5LLcAcYTPTMFBq+yfFSLwc Um1P079aNCWr4JmQOVFrOjSuvBo08qRbokgnAI75v4ZNzwR6A+chXVip1lfF/Me7WZ8V UsBu+HzdivSRI30Kom2PR0CG9V5UIoxTGk51nto2NzBM2iJBdPg5ItBjV39fuFU1IuGZ f9fA== X-Gm-Message-State: AO0yUKXXtRYA/ffsQLnFNS+GFuw6R8VHT/Bmc+LQYWuLvmNua0h5fKLY eTiSiqpt+tYKwARBNyd04g4= X-Google-Smtp-Source: AK7set9RlXgjOXhXlIkZpvFu0cd4Wj6DSXLwpe5l9TlAygwD+iwHH++wtMJmQg75MNEL1biWwmOg+w== X-Received: by 2002:a17:906:b7d7:b0:88d:fe1:1aca with SMTP id fy23-20020a170906b7d700b0088d0fe11acamr1102961ejb.34.1675234348849; Tue, 31 Jan 2023 22:52:28 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b008720c458bd4sm9509608eju.3.2023.01.31.22.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 22:52:28 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski Cc: Matthias Brugger , Kunihiko Hayashi , Masami Hiramatsu , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/4] dt-bindings: nvmem: mmio: new binding for MMIO accessible NVMEM devices Date: Wed, 1 Feb 2023 07:47:14 +0100 Message-Id: <20230201064717.18410-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201064717.18410-1-zajec5@gmail.com> References: <20230201064717.18410-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_225232_037908_9E4D51DF X-CRM114-Status: GOOD ( 15.68 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki With the NVMEM layouts binding in place we should now use: 1. NVMEM device access bindings 2. NVMEM content description bindings This binding allows describing NVMEM devices that can be MMIO accessed. Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/nvmem/mmio.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/mmio.yaml diff --git a/Documentation/devicetree/bindings/nvmem/mmio.yaml b/Documentation/devicetree/bindings/nvmem/mmio.yaml new file mode 100644 index 000000000000..27e3f6142769 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/mmio.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/mmio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MMIO access based NVMEM + +description: | + This binding describes simple NVMEM devices that can be accessed by using MMIO + (memory-mapped I/O access). + + It's a generic solution for providing NVMEM content access. The way of + handling actual content may be device specific and can be described using a + proper layout. + +maintainers: + - Rafał Miłecki + +allOf: + - $ref: nvmem.yaml# + +properties: + compatible: + const: mmio-nvmem + + reg: + maxItems: 1 + + reg-io-width: + description: | + The size (in bytes) of the IO accesses that should be performed + on the device. + enum: [1, 2, 4, 8] + +required: + - reg + +unevaluatedProperties: false + +examples: + - | + nvmem@10000 { + compatible = "mmio-nvmem"; + reg = <0x10000000 0x10000>; + }; From patchwork Wed Feb 1 06:47:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13123838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FF04C05027 for ; Wed, 1 Feb 2023 06:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LPyU19+VhmMuIMMpSU5GySmAIP6oqfiCTnK5b5e8Lus=; b=uC41/7djBFMbfHDjMMjOj51uDu 7Nam9Z4ZS9zxCTctT4z7VTOwSAbnSyAdQHhVorbwyKsfj3xX7RrvQz6uWFJAiBka3M7s38j1vVsVy jCOpcD4ELI6n+mYQV/IgSNi2bc/qY476l9ijz2ijXVx0lEFm0zy5yNoAkoER2oKqCmMMoSL77JsF6 4nUDzPP48AxUtguUhm8sAiZV6YOJ6bKyIlY24Jc9Q3aP/lMZjjUnp1Wtkue91U9i8XxfzBB74yBXt OCyLni1/rLDHG7sCMgr/Lom67Ot2CjaXjP4u2nxE3TAGBPCHsZ9wVsfzeY7DmSKxx70yYxNqWMBJr H1c4I+dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6zG-00AVrI-GJ; Wed, 01 Feb 2023 06:52:54 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6yw-00AViO-9Y; Wed, 01 Feb 2023 06:52:35 +0000 Received: by mail-ej1-x634.google.com with SMTP id mc11so25961456ejb.10; Tue, 31 Jan 2023 22:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LPyU19+VhmMuIMMpSU5GySmAIP6oqfiCTnK5b5e8Lus=; b=WrbOhXAP/9dmBsWhH17HvQ/1RmrjVeZyRRbdY5B8ueOrb3gEhdOqTxM7CW4PMPYFL4 TfCfQoI9GAnc2vHMfMEMPctNOI+K95B9YLclNRWNuuTXcKzKWmoLgIucD5Ri2dRB9+Rm QLv/KzB8rnUvez0ZHoG4nZrJ85jQDhii7gbbkQKCmrmEKC4KDkfntN51xX569+x5XVeb dFpPQPuZ6oaAADR43HGvkfC2TBXTPPPMjpzuxkmHkQI9fkG2WBMeiFoFY8mWgPOubeq/ Dz6XsYizMF8UQYUJihKY5arEzzl4iYYd4W6XzB6rUSmkhwPwjD5UKxN8KKLZxC+7L1v9 Ohug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPyU19+VhmMuIMMpSU5GySmAIP6oqfiCTnK5b5e8Lus=; b=QuvwgTgnWmMAfYcP7o+qRJ971SWIh45vB42MiC5Z4XAwzxnWkFd53Ret92gWPC0CNb vMWfXqR8qShg8L0euEG2Yam4JU8nK4ncs31Je8Ghg0+QVrfvKIrheA+wVG7ucePZ5qyP GkUTnpSYcq0bllDkpSUFeNBO4LCLpRJNV9ekETGkRHLumpyTLdx9O0n7wamNY/QVoKyA 7b4lo2abxoatLEyGDTTGvuIxTkZ90zlgBLsdZdhq6fMhBE6DFPs/iSxQZtsYmAyu20Mp feG3rnGyvH5Lw+5gI9KZNy8g9GV6EbfFc2lTR0IO5Pp6uL9I6QvUbYXfmBqcE1Toq59O IOyw== X-Gm-Message-State: AO0yUKXlB25ZM2dQGuG7xlXPBrOo0cfWTBzMqNyxGqW9IfSuOfTmJnpT Aq5/nxutAR0s/wDI7676hcAiKaqSlAw= X-Google-Smtp-Source: AK7set9i41akd5yXdQqcl/yGbOzAYiYzmbj+ird09ej50uN9MO10IRnAkqTkHdnPFbklxuI5P/WbBQ== X-Received: by 2002:a17:907:7244:b0:886:323c:dc39 with SMTP id ds4-20020a170907724400b00886323cdc39mr562016ejc.55.1675234351419; Tue, 31 Jan 2023 22:52:31 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b008720c458bd4sm9509608eju.3.2023.01.31.22.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 22:52:30 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski Cc: Matthias Brugger , Kunihiko Hayashi , Masami Hiramatsu , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/4] nvmem: add generic driver for devices with MMIO access Date: Wed, 1 Feb 2023 07:47:15 +0100 Message-Id: <20230201064717.18410-3-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201064717.18410-1-zajec5@gmail.com> References: <20230201064717.18410-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_225234_371278_CFC65D75 X-CRM114-Status: GOOD ( 24.22 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki With nvmem layouts in place we should now work on plain content access NVMEM drivers (e.g. MMIO one). Actual NVMEM content handling should go to layout drivers. Signed-off-by: Rafał Miłecki --- drivers/nvmem/Kconfig | 10 ++++++ drivers/nvmem/Makefile | 2 ++ drivers/nvmem/mmio.c | 80 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 drivers/nvmem/mmio.c diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 789729ff7e50..9eb5e93f0455 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -170,6 +170,16 @@ config NVMEM_MICROCHIP_OTPC This driver enable the OTP controller available on Microchip SAMA7G5 SoCs. It controls the access to the OTP memory connected to it. +config NVMEM_MMIO + tristate "MMIO access based NVMEM support" + depends on HAS_IOMEM + help + This driver provides support for NVMEM devices that can be accessed + using MMIO. + + This driver can also be built as a module. If so, the module + will be called nvmem-mmio. + config NVMEM_MTK_EFUSE tristate "Mediatek SoCs EFUSE support" depends on ARCH_MEDIATEK || COMPILE_TEST diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 442f9a4876a5..2f2bed7cdf24 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -36,6 +36,8 @@ obj-$(CONFIG_NVMEM_MESON_MX_EFUSE) += nvmem_meson_mx_efuse.o nvmem_meson_mx_efuse-y := meson-mx-efuse.o obj-$(CONFIG_NVMEM_MICROCHIP_OTPC) += nvmem-microchip-otpc.o nvmem-microchip-otpc-y := microchip-otpc.o +obj-$(CONFIG_NVMEM_MMIO) += nvmem-mmio.o +nvmem-mmio-y := mmio.o obj-$(CONFIG_NVMEM_MTK_EFUSE) += nvmem_mtk-efuse.o nvmem_mtk-efuse-y := mtk-efuse.o obj-$(CONFIG_NVMEM_MXS_OCOTP) += nvmem-mxs-ocotp.o diff --git a/drivers/nvmem/mmio.c b/drivers/nvmem/mmio.c new file mode 100644 index 000000000000..19c8880dc675 --- /dev/null +++ b/drivers/nvmem/mmio.c @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2023 Rafał Miłecki + */ + +#include +#include +#include +#include +#include +#include +#include + +struct mmio_nvmem { + void __iomem *base; +}; + +static int mmio_nvmem_read(void *context, unsigned int offset, void *val, size_t bytes) +{ + struct mmio_nvmem *priv = context; + + memcpy_fromio(val, priv->base, bytes); + + return 0; +} + +static int mmio_nvmem_probe(struct platform_device *pdev) +{ + struct nvmem_config config = { + .name = "mmio-nvmem", + .read_only = true, + .reg_read = mmio_nvmem_read, + }; + struct device *dev = &pdev->dev; + struct mmio_nvmem *priv; + struct resource *res; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); + + config.dev = dev; + config.size = resource_size(res); + config.word_size = sizeof(u8); + config.stride = sizeof(u8); + config.priv = priv; + + if (!device_property_present(dev, "read-only")) + dev_warn(dev, "Writing is not supported yet"); + + return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); +} + +static const struct of_device_id mmio_nvmem_of_match_table[] = { + { .compatible = "mmio-nvmem", }, + {}, +}; + +static struct platform_driver mmio_nvmem_driver = { + .probe = mmio_nvmem_probe, + .driver = { + .name = "mmio_nvmem", + .of_match_table = mmio_nvmem_of_match_table, + }, +}; + +static int __init mmio_nvmem_init(void) +{ + return platform_driver_register(&mmio_nvmem_driver); +} + +subsys_initcall_sync(mmio_nvmem_init); + +MODULE_AUTHOR("Rafał Miłecki"); +MODULE_LICENSE("GPL"); +MODULE_DEVICE_TABLE(of, mmio_nvmem_of_match_table); From patchwork Wed Feb 1 06:47:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13123839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE647C38142 for ; Wed, 1 Feb 2023 06:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ivmgC6/sjsLjgnwubV4IXo9QoAIf+yIcsu15miGgEqc=; b=KT7TRZ+IqXdrYP4K/QMRt96Kbs +B/nxBbgBO74qeRKTAdGtVR925CdHpymxtZ/zcqkTUV7DDPaGDZdxzV5cam51Je8G/rENpyaJZCCv VtPWIRDSsLLH52vc6F/E+1khOb/8YatuWlhBarxBOasc65H3t13UUCZI/SLz/10aCdBH+7Uuu6k4u k9PZtchZSYOKVL6Tc90D9DhEpM1Qnu1hrtIP6QCHe21Xj1wVfEOza7e+6vuCzuEGfqGU/0zA02rZN Gjn8eu3BLvGSl3v5y6KBh3WR6Y7xc7cgCtfm6jKcCJPfavjRXTnN65esoNeT6xNGpuLX86coCa4DV HDB/MHzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6zV-00AVxd-TN; Wed, 01 Feb 2023 06:53:09 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6yy-00AVjF-AY; Wed, 01 Feb 2023 06:52:38 +0000 Received: by mail-ej1-x62c.google.com with SMTP id hx15so28914608ejc.11; Tue, 31 Jan 2023 22:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ivmgC6/sjsLjgnwubV4IXo9QoAIf+yIcsu15miGgEqc=; b=mBvY7kC/f82hBqQON7oWzx9mBX2znC0pmZY4xaPua/eYyTm/W03yT8pcEJ7O5FDAv6 FTCg2jzUmS7NRAPjqyoF4bCfjAvcM0khTtDT8EJiBMD2s3A2WpLOI9TLpHkqnYJqQWOL g9NptaqyvHLrOy+uXxII81OLBPCsUS38obEox4KOCZ7J0u2MM4d9Zwrm4soLUpgLeQfx L8pveJ8fhOADpiNNB7SIZw0M3IGO4g39okWTdPipmzt8zYU2r5bblVziQl4rpcvPEk+o WSqZEgIfjRKyaZBhCX7ZWGngBriuHUnCG0ITlwR7jsbBpf2EN2tERQ0DwImVc8CJ/6X4 jiYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ivmgC6/sjsLjgnwubV4IXo9QoAIf+yIcsu15miGgEqc=; b=pEvUiU93/wRKgD2jvIgDxktsaC+wfmMbMRbRlJbNlNfl/nSSA0V+kRFFnFsXBH5EW4 7DDLWY5cjrCnAun1Y26Cm2Lvc1Bp4UFY94FkxoLFB+cgDzzsnJtGud3PrgI7eHNSmU9h RVEZ+C7OHowloOZr06uBN0eN2EudsnnjnMkBumajGkF6ynx+yaWDfQeC9TVrrTpgfKp5 X2ChffgTaHvd+EBbY3iAO3piAhr0a/jXhY2e7Q6Hdt0Jt4LaYYSvMLW1WtbcWvqpQlde wC4CKcCX9765e/aslPHELXvuVqB8X6DiaOoJBdaywqRsMTHLFqwq02fCA2Ie3afXc+IY XApA== X-Gm-Message-State: AO0yUKXB73FbxAmdPb2GnY/cQWt9bYP525QYqGtWSRC/TS9IWI87d73g +XSj9c7KUfgc5RXem9YQnPU= X-Google-Smtp-Source: AK7set/Dpqj2fRLsbPD0jrzfSP/6e4yi5fhGZfwqrwUUb7TADJ5CfGq3g2ytVtma0MO7D/s+ex2PgA== X-Received: by 2002:a17:906:8395:b0:878:6f1d:e5d4 with SMTP id p21-20020a170906839500b008786f1de5d4mr1263932ejx.70.1675234353793; Tue, 31 Jan 2023 22:52:33 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b008720c458bd4sm9509608eju.3.2023.01.31.22.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 22:52:33 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski Cc: Matthias Brugger , Kunihiko Hayashi , Masami Hiramatsu , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 3/4] nvmem: mtk-efuse: replace driver with a generic MMIO one Date: Wed, 1 Feb 2023 07:47:16 +0100 Message-Id: <20230201064717.18410-4-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201064717.18410-1-zajec5@gmail.com> References: <20230201064717.18410-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_225236_448644_7FA92580 X-CRM114-Status: GOOD ( 23.72 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki Mediatek EFUSE uses a simple MMIO that can be handled with a generic driver. Replace this driver to avoid code duplication. Keep Kconfig symbol for a release or two to help with "make oldconfig". Signed-off-by: Rafał Miłecki --- drivers/nvmem/Kconfig | 7 ++- drivers/nvmem/Makefile | 2 - drivers/nvmem/mmio.c | 3 ++ drivers/nvmem/mtk-efuse.c | 97 --------------------------------------- 4 files changed, 6 insertions(+), 103 deletions(-) delete mode 100644 drivers/nvmem/mtk-efuse.c diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 9eb5e93f0455..4d652c7382a6 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -184,12 +184,11 @@ config NVMEM_MTK_EFUSE tristate "Mediatek SoCs EFUSE support" depends on ARCH_MEDIATEK || COMPILE_TEST depends on HAS_IOMEM + select NVMEM_MMIO help - This is a driver to access hardware related data like sensor - calibration, HDMI impedance etc. + This driver has been replaced by a generic MMIO implementation. - This driver can also be built as a module. If so, the module - will be called efuse-mtk. + Update your config as this symbol will be dropped in the next release. config NVMEM_MXS_OCOTP tristate "Freescale MXS On-Chip OTP Memory Support" diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 2f2bed7cdf24..7a8e29ea408e 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -38,8 +38,6 @@ obj-$(CONFIG_NVMEM_MICROCHIP_OTPC) += nvmem-microchip-otpc.o nvmem-microchip-otpc-y := microchip-otpc.o obj-$(CONFIG_NVMEM_MMIO) += nvmem-mmio.o nvmem-mmio-y := mmio.o -obj-$(CONFIG_NVMEM_MTK_EFUSE) += nvmem_mtk-efuse.o -nvmem_mtk-efuse-y := mtk-efuse.o obj-$(CONFIG_NVMEM_MXS_OCOTP) += nvmem-mxs-ocotp.o nvmem-mxs-ocotp-y := mxs-ocotp.o obj-$(CONFIG_NVMEM_NINTENDO_OTP) += nvmem-nintendo-otp.o diff --git a/drivers/nvmem/mmio.c b/drivers/nvmem/mmio.c index 19c8880dc675..253ade72e0c3 100644 --- a/drivers/nvmem/mmio.c +++ b/drivers/nvmem/mmio.c @@ -57,6 +57,9 @@ static int mmio_nvmem_probe(struct platform_device *pdev) static const struct of_device_id mmio_nvmem_of_match_table[] = { { .compatible = "mmio-nvmem", }, + /* Custom bindings that were introduced before the mmio one */ + { .compatible = "mediatek,mt8173-efuse", }, + { .compatible = "mediatek,efuse", }, {}, }; diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c deleted file mode 100644 index a08e0aedd21c..000000000000 --- a/drivers/nvmem/mtk-efuse.c +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2015 MediaTek Inc. - * Author: Andrew-CT Chen - */ - -#include -#include -#include -#include -#include -#include - -struct mtk_efuse_priv { - void __iomem *base; -}; - -static int mtk_reg_read(void *context, - unsigned int reg, void *_val, size_t bytes) -{ - struct mtk_efuse_priv *priv = context; - void __iomem *addr = priv->base + reg; - u8 *val = _val; - int i; - - for (i = 0; i < bytes; i++, val++) - *val = readb(addr + i); - - return 0; -} - -static int mtk_efuse_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct resource *res; - struct nvmem_device *nvmem; - struct nvmem_config econfig = {}; - struct mtk_efuse_priv *priv; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); - if (IS_ERR(priv->base)) - return PTR_ERR(priv->base); - - econfig.stride = 1; - econfig.word_size = 1; - econfig.reg_read = mtk_reg_read; - econfig.size = resource_size(res); - econfig.priv = priv; - econfig.dev = dev; - nvmem = devm_nvmem_register(dev, &econfig); - - return PTR_ERR_OR_ZERO(nvmem); -} - -static const struct of_device_id mtk_efuse_of_match[] = { - { .compatible = "mediatek,mt8173-efuse",}, - { .compatible = "mediatek,efuse",}, - {/* sentinel */}, -}; -MODULE_DEVICE_TABLE(of, mtk_efuse_of_match); - -static struct platform_driver mtk_efuse_driver = { - .probe = mtk_efuse_probe, - .driver = { - .name = "mediatek,efuse", - .of_match_table = mtk_efuse_of_match, - }, -}; - -static int __init mtk_efuse_init(void) -{ - int ret; - - ret = platform_driver_register(&mtk_efuse_driver); - if (ret) { - pr_err("Failed to register efuse driver\n"); - return ret; - } - - return 0; -} - -static void __exit mtk_efuse_exit(void) -{ - return platform_driver_unregister(&mtk_efuse_driver); -} - -subsys_initcall(mtk_efuse_init); -module_exit(mtk_efuse_exit); - -MODULE_AUTHOR("Andrew-CT Chen "); -MODULE_DESCRIPTION("Mediatek EFUSE driver"); -MODULE_LICENSE("GPL v2"); From patchwork Wed Feb 1 06:47:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13123840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D71E8C05027 for ; Wed, 1 Feb 2023 06:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3fPObB622ZHAsw7bG4ZtmD1WDgZDX6KJYI3QC9H/s34=; b=yIE/ECOFBclJbcoKHrjxTdv3jA lnwP/qPXNe4MVlJ7TPArkZE0nspFPnPaayNUt1ZHJRzb91ycWI468tWCEPFieZsOD8eMQEB3WZTsb ATl68WZmQpM5RZV2xxVsvZ+J+qEASt7ghhwVaFYuDqVjOGFxH313SroO05VW0mije1vVgUHsS6M1E x8SEzE/+qTYEHrRf49Jtpv8EkxK0bexmvhLOAlOCVq00Fu+lk8zwBlyk8yJBiwnAb2PT93dTePD2+ Eh6OTx033pu6SQGqtv3Eb6k4E0Ecfi2p4ESBTFR3JxkfWf3JZ8/rCliPxmrDHafnHjUisoSNrf092 SbSww7lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6zq-00AW6X-O4; Wed, 01 Feb 2023 06:53:30 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6z0-00AVkP-Da; Wed, 01 Feb 2023 06:52:40 +0000 Received: by mail-ej1-x632.google.com with SMTP id ud5so48485125ejc.4; Tue, 31 Jan 2023 22:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3fPObB622ZHAsw7bG4ZtmD1WDgZDX6KJYI3QC9H/s34=; b=ljP+fzclIJjlHMmWQaVJkSQr2M+/sTDBmC+RbHmj5xcO8zNyuRjC8NiPadP5CH96UW hwstXaExliDwmXvG1q/3NxIPr7E+9PQRx9y/kd0XAoZiMRNDf63pdddE1YvA+jj0pEaR qsTyR8XSWJELU4ZcN2936SYxGUbKHcq8gl+mj0yvFtNQD0PW6Jti18z/hGicmmlcdNdM 77B9IlMXefaRaJSkGlyMHK4J41FUZX+ggKo+nU9VziXYgfXWlkxN2h0llCnQndKl36vV sT47hAfA9Q+cNGgDxchrI1Pz1bK2pG6isyveGc04kdPYWNfuGjsGRrvz+RKF7s2g4iQ0 NzTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3fPObB622ZHAsw7bG4ZtmD1WDgZDX6KJYI3QC9H/s34=; b=5rFzM5+mCLrKUIro5K/5prPJM2DKeLdPif2D4ajtl6CiF29QlVawUywbtziXZK4vzk CojWN5zkihkjvb5i3MXvMOxgJYA3hU2nA88AgE/kZ6bfirpmTceEdqLvPkrlh+KY6K0H jY0eOAoeYNiD1bvCEDE6hh6Z94F88J9LVoYZoSMjWiAX9ygl8n4K34Ht67U15gQOSoBS LK6tQHHWYOPyDkgp+hjEhkUJ30jaeWYqZXJop6yUAcYd50sreT8GxcmtrQkqkvfNVtEr J0o6j4X+9Sut1g2cwXXu+SENWAqPN5/WV5XVTAwNwD7OAwDFzDoUM+Q5qsigqRKnNS9+ QmwQ== X-Gm-Message-State: AO0yUKVBm1ps2MSkcWzJN21N/dSP5iY+428rvAFbJlDS2B5nb1iZ3gfE 7UyqwLkavVfhqrYSr67moVxitT2NGp8= X-Google-Smtp-Source: AK7set9xqKbGnzuL5L4PM1F4eU43RdssaMCIk3qlYJ+LGtln8nEmEMKDbshH9HM1j4tonfQ/w2p3Ow== X-Received: by 2002:a17:907:9909:b0:887:9a7f:4326 with SMTP id ka9-20020a170907990900b008879a7f4326mr1108784ejc.8.1675234356056; Tue, 31 Jan 2023 22:52:36 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b008720c458bd4sm9509608eju.3.2023.01.31.22.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 22:52:35 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski Cc: Matthias Brugger , Kunihiko Hayashi , Masami Hiramatsu , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 4/4] nvmem: uniphier-efuse: replace driver with a generic MMIO one Date: Wed, 1 Feb 2023 07:47:17 +0100 Message-Id: <20230201064717.18410-5-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201064717.18410-1-zajec5@gmail.com> References: <20230201064717.18410-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_225238_527810_9189D8D9 X-CRM114-Status: GOOD ( 23.29 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki UniPhier eFuse uses a simple MMIO that can be handled with a generic driver. Replace this driver to avoid code duplication. Keep Kconfig symbol for a release or two to help with "make oldconfig". Signed-off-by: Rafał Miłecki --- drivers/nvmem/Kconfig | 7 ++- drivers/nvmem/Makefile | 2 - drivers/nvmem/mmio.c | 1 + drivers/nvmem/uniphier-efuse.c | 78 ---------------------------------- 4 files changed, 4 insertions(+), 84 deletions(-) delete mode 100644 drivers/nvmem/uniphier-efuse.c diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 4d652c7382a6..d65950da39b0 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -359,12 +359,11 @@ config NVMEM_UNIPHIER_EFUSE tristate "UniPhier SoCs eFuse support" depends on ARCH_UNIPHIER || COMPILE_TEST depends on HAS_IOMEM + select NVMEM_MMIO help - This is a simple driver to dump specified values of UniPhier SoC - from eFuse. + This driver has been replaced by a generic MMIO implementation. - This driver can also be built as a module. If so, the module - will be called nvmem-uniphier-efuse. + Update your config as this symbol will be dropped in the next release. config NVMEM_VF610_OCOTP tristate "VF610 SoC OCOTP support" diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 7a8e29ea408e..70dd1154c832 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -67,8 +67,6 @@ obj-$(CONFIG_NVMEM_SUNPLUS_OCOTP) += nvmem_sunplus_ocotp.o nvmem_sunplus_ocotp-y := sunplus-ocotp.o obj-$(CONFIG_NVMEM_SUNXI_SID) += nvmem_sunxi_sid.o nvmem_sunxi_sid-y := sunxi_sid.o -obj-$(CONFIG_NVMEM_UNIPHIER_EFUSE) += nvmem-uniphier-efuse.o -nvmem-uniphier-efuse-y := uniphier-efuse.o obj-$(CONFIG_NVMEM_VF610_OCOTP) += nvmem-vf610-ocotp.o nvmem-vf610-ocotp-y := vf610-ocotp.o obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynqmp_nvmem.o diff --git a/drivers/nvmem/mmio.c b/drivers/nvmem/mmio.c index 253ade72e0c3..f44ff2a56c56 100644 --- a/drivers/nvmem/mmio.c +++ b/drivers/nvmem/mmio.c @@ -60,6 +60,7 @@ static const struct of_device_id mmio_nvmem_of_match_table[] = { /* Custom bindings that were introduced before the mmio one */ { .compatible = "mediatek,mt8173-efuse", }, { .compatible = "mediatek,efuse", }, + { .compatible = "socionext,uniphier-efuse", }, {}, }; diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c deleted file mode 100644 index aca910b3b6f8..000000000000 --- a/drivers/nvmem/uniphier-efuse.c +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * UniPhier eFuse driver - * - * Copyright (C) 2017 Socionext Inc. - */ - -#include -#include -#include -#include -#include -#include - -struct uniphier_efuse_priv { - void __iomem *base; -}; - -static int uniphier_reg_read(void *context, - unsigned int reg, void *_val, size_t bytes) -{ - struct uniphier_efuse_priv *priv = context; - u8 *val = _val; - int offs; - - for (offs = 0; offs < bytes; offs += sizeof(u8)) - *val++ = readb(priv->base + reg + offs); - - return 0; -} - -static int uniphier_efuse_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct resource *res; - struct nvmem_device *nvmem; - struct nvmem_config econfig = {}; - struct uniphier_efuse_priv *priv; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(dev, res); - if (IS_ERR(priv->base)) - return PTR_ERR(priv->base); - - econfig.stride = 1; - econfig.word_size = 1; - econfig.read_only = true; - econfig.reg_read = uniphier_reg_read; - econfig.size = resource_size(res); - econfig.priv = priv; - econfig.dev = dev; - nvmem = devm_nvmem_register(dev, &econfig); - - return PTR_ERR_OR_ZERO(nvmem); -} - -static const struct of_device_id uniphier_efuse_of_match[] = { - { .compatible = "socionext,uniphier-efuse",}, - {/* sentinel */}, -}; -MODULE_DEVICE_TABLE(of, uniphier_efuse_of_match); - -static struct platform_driver uniphier_efuse_driver = { - .probe = uniphier_efuse_probe, - .driver = { - .name = "uniphier-efuse", - .of_match_table = uniphier_efuse_of_match, - }, -}; -module_platform_driver(uniphier_efuse_driver); - -MODULE_AUTHOR("Keiji Hayashibara "); -MODULE_DESCRIPTION("UniPhier eFuse driver"); -MODULE_LICENSE("GPL v2");