From patchwork Tue Oct 30 10:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10661269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F101113A4 for ; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB5502876B for ; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF2A329809; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 892D72876B for ; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rBvkH2Tq0ZSbooo61/xI7WNgR2lJnuoovpurrrVri4Y=; b=Ca0K9jFx1e40yn0v6YTzy2eBVh Va3RKlJ6a+oSQKbvtee6l1l2L+7++MNNbPjehUwCG+RY2n7AT+87UaGHFKYdjZztX1a6TGC2RGegN j3wVEHw/RvymHka9v/kLdOIAZQKMHW2S9sdAI3hz83cUYCH5GkQ/r4L+MH2Te7kKSKvWa69tKDWMh Wmzb4bzWw6hsxfcHZlMoenCBeu9QMe3YuRBmsEIbKD640fLdRwpyHnBbQN7cH9CNrVS+9F5i4Uz+x z0Z8vLqnZ8lzn0bSoPrfGNH8cTovajX+2NUXW4UO4QNPn1tUtrmsvK4gJcV9H5ZFXlPi1H3SeRFnG d8XYJJmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWhT-0003GU-FI; Tue, 30 Oct 2018 16:17:03 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWAw-0000WK-DE for linux-amlogic@lists.infradead.org; Tue, 30 Oct 2018 15:43:32 +0000 Received: by mail-wr1-x444.google.com with SMTP id y16so13132418wrw.3 for ; Tue, 30 Oct 2018 08:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ygrPMk+pJcXRHcdBwiVFBHzojOA9Y2YhpU+L53lNZo8=; b=toLJdzQXZuWeQ41ePJRpCYzE1Y1Kkqt3wzv1EeS2IEaQLPs02n22JxHgeb4YgnQbt1 wZPoG0YdrhFQS+Ea+on8EQV6AsiDL7Pqq83JaDSvLTzYe1kzZU/xoYCf+Zt7S88cG/ZX IHHJ8HWTIOcs/L8PUqryPG3vjyvgtu5GIsmTwvuBOADxK7ocW476OsheVEsP4TIF/lZC LgpvOa//TBh5SPzs9pQ+2auyU2A0f6kOIVCSSCxSkXq/wjkWgjBB7PdD5buGGia1kwT2 e3U2Xz0HPvZbL/HPpHshj5QiWrBC4OBtD1PMIAZdK8fGMnsFWtvXjozYpqQO/w4Aq/fe yyXQ== 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=ygrPMk+pJcXRHcdBwiVFBHzojOA9Y2YhpU+L53lNZo8=; b=r1xWRW7lHgKoo8t42ZvsH5TBGjvykNxZnrCCKUwRN6IPbAkSXDIEDKUnweK4SUABQH dzvvxsmf3MfSLbIq+TcL8mvqM5VM2Q+KhnnuM5OxK9rYLVtYIENDCMu2hPVloV9O8lZU J4TGFAz80h5iuGB2NQQtzo1MmjQf9c7gLo+iSpxAl/mOmVnB5F/18nQ1if92HMfV9CSQ zShqDnMv+abiet2DKvVLNhB+ODSrlTmwHx9vY5nSpduOM5BYM9+uyMvWzDl6GUT9C3xx +XJsCtlHpkel7VLOHO20u1jy9aGeeUYv3PEXfKDEzRcNJH7YyBSK9Pn+oMgYUhVHuPBr YCjQ== X-Gm-Message-State: AGRZ1gJnkyVxaGq0SdlDsjRNq4RnBU0yFjT5dHtFsphWS2FybgJPVEGH LPqJA+Z/QJKPxRhbytgyWfXUvKBSEy8= X-Google-Smtp-Source: AJdET5cTpLf/6aUDl7mcVpuWwPuGLiWk3ee47vhlyMUW3k1KW2wHmSPuUi+TOnT/mvhMo0rFmhW2WQ== X-Received: by 2002:adf:dc07:: with SMTP id t7-v6mr17115982wri.107.1540894959698; Tue, 30 Oct 2018 03:22:39 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id i204-v6sm26638614wmd.28.2018.10.30.03.22.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 03:22:39 -0700 (PDT) From: Jerome Brunet To: Srinivas Kandagatla , Kevin Hilman , Carlo Caione Subject: [PATCH 1/4] nvmem: meson-efuse: add error message on user_max failure. Date: Tue, 30 Oct 2018 11:22:28 +0100 Message-Id: <20181030102231.4851-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030102231.4851-1-jbrunet@baylibre.com> References: <20181030102231.4851-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_084326_491364_4CB08131 X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add an explicit error message when SM_EFUSE_USER_MAX command fails Signed-off-by: Jerome Brunet --- drivers/nvmem/meson-efuse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index d769840d1e18..40b9df1d030d 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -48,8 +48,10 @@ static int meson_efuse_probe(struct platform_device *pdev) struct nvmem_config *econfig; unsigned int size; - if (meson_sm_call(SM_EFUSE_USER_MAX, &size, 0, 0, 0, 0, 0) < 0) + if (meson_sm_call(SM_EFUSE_USER_MAX, &size, 0, 0, 0, 0, 0) < 0) { + dev_err(dev, "failed to get max user"); return -EINVAL; + } econfig = devm_kzalloc(dev, sizeof(*econfig), GFP_KERNEL); if (!econfig) From patchwork Tue Oct 30 10:22:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10661297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F45B13B5 for ; Tue, 30 Oct 2018 16:34:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C842944C for ; Tue, 30 Oct 2018 16:34:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4CC2A38C; Tue, 30 Oct 2018 16:34:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D55132944C for ; Tue, 30 Oct 2018 16:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GiFXCj+BfoQizSgUHHB4j4wPtXC/qJAqTNHkAJEvUU0=; b=jlFRIpHTKQ1IWIZ3nnOUOkH5cY jLKQGW9c4rOq/ga6nJhG0epp4NmrgXQJNcuG5FsjkB9yJEwPDJonZKv7TlRYtIMrC+s/SPNSwP5AT A4ZIR94knFUxXZNNH8HA7X55k8k0DFVrW2XQShol854AKTNUygIIX+E9aQpYibOPAI3wjcpf1EQEK pLrxxSM89NgNg86VvowTnXaKZueTV5iaEkM1J5SmDeZ2AUNJBvoUu5ghGGKan+sqdzWIe/sa3n2xl 8+xjDE7QZtYpDEmODo2Q6SHAHOVFXGiBLKg0+VEFNujUce7j/qF2YG7W42h1OpM/wKIh7RqrGFZm9 AOvcHIdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWxw-0003of-Ro; Tue, 30 Oct 2018 16:34:04 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWxu-0003Lr-En for linux-amlogic@bombadil.infradead.org; Tue, 30 Oct 2018 16:34:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LLrFK+YRmk7r6/C5e+K5O5DNC2H0ChSiQcyKfu/3Cr4=; b=BJjjf/Q36vOgWKv5FX5PNsm1z qudUIIQlbHZkhzXa8cWMMSdY9ab/LAh515EtQXvVOpmhZesaepLnmUXTJGK2CFiGIPjXI800EGLmr 1KNWmeJW/QsNVNUl9VuJDsQnyEgc8ok7pr7gfcu7LN40H2ErDa+BzYuxeXNHGCj0RA/DNnndGmxAt 2jh22SfpUEESMf9tDkN35fXqiwWA0IKRWdqg4H/vp4gJMk9jOD+e7ZlOsg+7tXG0Yfh0KYVpLvhW1 c3/araq+pFkxRMau+8OvQjLg0qaL9pzHpzzFo4mTxkALd4ZprXq2XEQ71tP4pxphz9G5Ioqy15ez6 9kRexIpFA==; Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWeC-0004pn-2C for linux-amlogic@lists.infradead.org; Tue, 30 Oct 2018 16:13:41 +0000 Received: by mail-wm1-x343.google.com with SMTP id q12-v6so9185351wmq.0 for ; Tue, 30 Oct 2018 09:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LLrFK+YRmk7r6/C5e+K5O5DNC2H0ChSiQcyKfu/3Cr4=; b=krN9fpahlQsQxq5OeXZh6U5/htbiWFQ1JX/bIW0XLXhiAqbOJLgiPwIyt/xquXBQ2M xfQICSgFwaaGK8BMyqlyodcv0EhrLXXu5PTp76IniQ3rze4+nBY0PdPPUjNN4w+upK+/ WSk8whdEbYriDWt1h5Q/4wNKKJxtTM7U7e0VgcdKjLlrU0jNvLX1MfKuywhET+oJAPV7 ylQOsoDp8g2DH2cYuDIFgEJGAkRE3QA9OxvIQ7pOh18WluUCQ16ktm6xnJ35wsxWJlE8 8wG5XTmL1Ao0avStZJro/5CENjKJzbM7aE0ke1WJxJRwKgPFP3oio5Iyc/ri2YHQOTQc enhw== 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=LLrFK+YRmk7r6/C5e+K5O5DNC2H0ChSiQcyKfu/3Cr4=; b=EhnXSMHZlnpewO79d4X8uLKqLrBcAo2qICrY0HkuDucQPEOddtPODwcxh9ReMN6V5U unN5EUyddDZSMaytocLMi0qp05wDlsb8cFqKa96DVX0w1iRXYBwFRv8Zqfjf4tlRhcKI UD4NXi2eiFIW5PASZcpTgyP/oPPJPgLaaiD+NUKRl3GOHrKBxKXVdIYYBjrhAoShXxXI j8h+qEHwjgCW82B2cQwrDcwWBxt/lMeDn/H/8y/BL6B2RwfbOagZva5ZAiKCM5Qmw8l1 GwxNMLC1i5yqCURL6+k74xPr135WA/RdAA10APXUWCReoCI2nMj5Al6TyIhDBBnP4ZuS T6Iw== X-Gm-Message-State: AGRZ1gLPXqmL6Pw6hT4L8IV9xmXKagOJWpJIsJjRy8Z6TJqS/nPWGkyp UrNcfBkNSDe1K4DBzZo0/IFudompSaE= X-Google-Smtp-Source: AJdET5ff+5LmypP42LGKTaQnSm4G0BfTECA7OdU1dR87xJX2Sw2iiWzL5GNoCvnW49UhtW2EV+LkrQ== X-Received: by 2002:a1c:6:: with SMTP id 6-v6mr1193057wma.126.1540894960691; Tue, 30 Oct 2018 03:22:40 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id i204-v6sm26638614wmd.28.2018.10.30.03.22.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 03:22:40 -0700 (PDT) From: Jerome Brunet To: Srinivas Kandagatla , Kevin Hilman , Carlo Caione Subject: [PATCH 2/4] nvmem: meson-efuse: bindings: add peripheral clock Date: Tue, 30 Oct 2018 11:22:29 +0100 Message-Id: <20181030102231.4851-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030102231.4851-1-jbrunet@baylibre.com> References: <20181030102231.4851-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_161340_164475_10821F05 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The efuse found in gx SoC requires a peripheral clock to properly operate. We have been able to work without it until now because the clock was on by default, and left on by the CCF. Soon, it will not be the case anymore, so the device needs to claim the clock it needs Signed-off-by: Jerome Brunet Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt b/Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt index e3298e18de26..2e0723ab3384 100644 --- a/Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt +++ b/Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt @@ -2,6 +2,8 @@ Required properties: - compatible: should be "amlogic,meson-gxbb-efuse" +- clocks: phandle to the efuse peripheral clock provided by the + clock controller. = Data cells = Are child nodes of eFuse, bindings of which as described in @@ -11,6 +13,7 @@ Example: efuse: efuse { compatible = "amlogic,meson-gxbb-efuse"; + clocks = <&clkc CLKID_EFUSE>; #address-cells = <1>; #size-cells = <1>; From patchwork Tue Oct 30 10:22:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10661273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1152214E2 for ; Tue, 30 Oct 2018 16:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF4702A884 for ; Tue, 30 Oct 2018 16:19:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E36222A886; Tue, 30 Oct 2018 16:19:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78DA32A884 for ; Tue, 30 Oct 2018 16:19:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=0LauibkwST5FlEM8EAG1SNFH/VhkesqfoyJelA3/seU=; b=lCwrA+AUQxYhm6YudosA/HoUsn Fh1VPXg9vIMB9eMUk/7Ko3DibNARw2H/2meI373aA3yOtmfIXvQp2ylok6A0LGHLhi56gUfL3ERsh YQA6qhNwN8h7M8Z9m3GrNfy5a4vmK/+wDSXB8Fizj54n3Pcz5rQiZy+bYbvS/AjDOyjcgSRMQbDlg WDz2ONT3CEsnVbyRFiXKyFvq224TypEox8hWISZIgSE9ndx155PVcuMOEUlqSxMEoIuOaJO85aaqT EpVE/wSB0H/ZmE5YELlbF4BUF0kl0zZ0umFTQXVXGXpd9RV6M3+Fy5isCTqYkCR8XpW7grVGNfHKt YCNZZMNw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWjl-0005nZ-2Q; Tue, 30 Oct 2018 16:19:25 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWWh-0004uR-Q4 for linux-amlogic@bombadil.infradead.org; Tue, 30 Oct 2018 16:05:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ldt4WJfI4AQU3DusZodwyg3UdR/b7k3L1OUI368L5js=; b=n1UWzTzvkf99tI/OvzVPEJMsm aa7cWjEi11cUujKJY3Fg+BDVFPlAJ80Xl4dy3wG7MphaRxXrOYQKUtZL/YM1EU9D8Q8Aik2kozNsk g/qBIccSu7g8JL97PCBXIBrJh3AOM5Hpo2Qes5bmYAJ1WrpnkmYZ0lInsJ6feqbLfRC9wPneg+gpL 8EIACJtD4Z4T3w8DqlaWu1wGjC3Q3lviDNCi7XMaFscxRgjPq2aQS+h3M4gd6Q2lOjsgSJFjh7ozY dSr1ffaNAXPEQDWRh/ZoujmTR2fuPtXkOaLoembBt1AGC5WVtiyRI4QPJJZijuX0BhzickGsNAnQc 4W710fcug==; Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWWe-0004Sc-Ng for linux-amlogic@lists.infradead.org; Tue, 30 Oct 2018 16:05:53 +0000 Received: by mail-wr1-x441.google.com with SMTP id t10-v6so13203446wrn.10 for ; Tue, 30 Oct 2018 09:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ldt4WJfI4AQU3DusZodwyg3UdR/b7k3L1OUI368L5js=; b=WRdBXun+6RJXnuDEuatGFExhIB5+eaIgJBTeM7RBuldCHfFaoGgAnR6NsHpqSeDKVq n9kSuaFr3IkK3F87+XlJNuvrSPS1LV0/Q4fbcGpE2hkY7K4Rnhp9SmlGorRIEh4DvkNd km7Keq6Uf+7b9UPQgjPCJtjdk0UavGUv2YwA8wF/7ZYjiKXEhGTfmWmRjTMcCmniFog1 tX6rQOB85l4ti+mLWdjovNcvFoTDUXeMZeyiljHcvf8ol3GkfkZEggYpoNTW5ikZ9ZJA 8kor1L78X+oO+T9hVMpsl+s4dHxqSmL1M+PectcNE33RGIxmDc01pvqICwWcDYFTpnIr 5zcw== 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=Ldt4WJfI4AQU3DusZodwyg3UdR/b7k3L1OUI368L5js=; b=BUZRIaL+kb8AIXLDiwPuhEfW4XUTdaxQJHkPsLcklpH5E3GwADL7JaTWcjSGi8R3ae 4Wo4HCgdTYnHDgH7gpxmj1DIieK7xBEiTcgKBKvqGk7hhq0sPt2Rupx2m8y9OqV3YpDw LjvHr6X8PvetjWHCQvuNc+ZoDfBeElnDeXtisflRThkMyzryk7USe7rOjzs+KnfcRk6f 4jZTs8Doich1m+VlB48MgKXuBGz4sElWlU8HI95bYZdx4Lwlk1Pp6r1ZhH//fNPZ3jSK 8OzgOG3R8aJrl2GSpa+quo8cO9Pv6G+N0pGSnOnrkfebrz6Gt8RllyM9NNOgmGXYi9Ve ytCg== X-Gm-Message-State: AGRZ1gJpqzMsjeP6ypHCgqY79Szerq0o7MIM/x8JdhVfCxRL0XVusKyv Z2SvEXSczdGMEri0SrRTuFpK4ma0aas= X-Google-Smtp-Source: AJdET5dl2ogEPQnxe6yMFr7g1KHIfKHvVj9wG0JNyf8Xj7SEpXrF9caIk7RrZ7P4HQWe0kT9WPODag== X-Received: by 2002:a5d:5086:: with SMTP id a6-v6mr5550614wrt.31.1540894961593; Tue, 30 Oct 2018 03:22:41 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id i204-v6sm26638614wmd.28.2018.10.30.03.22.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 03:22:41 -0700 (PDT) From: Jerome Brunet To: Srinivas Kandagatla , Kevin Hilman , Carlo Caione Subject: [PATCH 3/4] arm64: dts: meson-gx: add efuse pclk Date: Tue, 30 Oct 2018 11:22:30 +0100 Message-Id: <20181030102231.4851-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030102231.4851-1-jbrunet@baylibre.com> References: <20181030102231.4851-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_120552_994962_0E59039E X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the required peripheral clock for the efuse device. Signed-off-by: Jerome Brunet --- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 4 ++++ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 1ade7e486828..524f533e41d4 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi @@ -282,6 +282,10 @@ compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc"; }; +&efuse { + clocks = <&clkc CLKID_EFUSE>; +}; + ðmac { clocks = <&clkc CLKID_ETH>, <&clkc CLKID_FCLK_DIV2>, diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi index 8f0bb3c44bd6..8ccab9a1ebcc 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi @@ -75,6 +75,10 @@ }; }; +&efuse { + clocks = <&clkc CLKID_EFUSE>; +}; + ðmac { reg = <0x0 0xc9410000 0x0 0x10000 0x0 0xc8834540 0x0 0x4>; From patchwork Tue Oct 30 10:22:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10661267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5315313A4 for ; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E28A2876B for ; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3213629809; Tue, 30 Oct 2018 16:17:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDA022876B for ; Tue, 30 Oct 2018 16:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=l/m6NlI8Z9U/Y9z2DJTfbv9WwJNuNqtOEoSyZvc21kI=; b=ew8Gw3QYwa2D3fIrpZXbS05NRB pevkPDLW3wPIJSMEQcZJ1WJlBkWzzAcfbS2XedeQz0bmF1wgahiG00AV8MMlhjMTFlfhzuaf/NvW6 owZyFKoBeSveI0usCvCy+1PjzyrRnOmOqbDIqdWKk9+abg2hBtzdXzmZ7XbyutOKj/gJx/IJKfJIM X99jdkOkrMtflJXweUz9QbWLaT/3y/Qbwb8bbN3fD3sADLW9g1kDV4XE/RR+mrwSvAK45uRjfnJsq 7v9M4sUm1oY101Atiu3+ycfmUcetNJcQqU8eBN9gEnvr3enBQ+BI53gZQsL9vR6DFMFQbhKC20LnV oybC30tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWhJ-00034b-As; Tue, 30 Oct 2018 16:16:53 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHVnE-0002zJ-Pj for linux-amlogic@bombadil.infradead.org; Tue, 30 Oct 2018 15:18:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6ciXHZq7IgUjKzK1dmpUyx2KByjHqFG7X4uzy09xTGg=; b=YRkOqGxN0Abc5en2pgb6kDOjz 4bomAzWkB5s/Ht/5hEEClB1N3h5IH/b2v0lP4vvP8jHZoWlvHVDm6Z3SZmbH/3YTbrMKjdIBf2X8M r5w6ujOdy0rGikGaE4S2cFq0hr3RcN2vJMTtGC5towyfFeHwzqvhpb9AypOhYk86gH44kkWBGWMKr iS4N5teq5kn40LTyPwan8oHKqj2YXguuXWsz1+hr2mAHHBB2GpL32ET/tE6XoOKqZhSLb2y821wxl 7y9T17XdvSPEM2P6Y8Eg+T/RhyI1aSVgDW+OXzI5n+WjSI50Sk/QyB+GTDuNyk2eMZBFnZY2o4v+5 HaVq5LiMA==; Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHSBh-0007kX-Lk for linux-amlogic@lists.infradead.org; Tue, 30 Oct 2018 11:27:59 +0000 Received: by mail-wr1-x444.google.com with SMTP id t10-v6so12142665wrn.10 for ; Tue, 30 Oct 2018 04:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6ciXHZq7IgUjKzK1dmpUyx2KByjHqFG7X4uzy09xTGg=; b=jpu+Z8fvnPHfsMy01qKgjjhOOGsGwdGkd0ILfZQFjcz+SDc1qvmaZ58TN5YbAh75HZ Znhxtxq11l4mzW61ofx1Ly9lbfyMIBzzwEvasPq72WbwB7Up0RwjRuhfyS5U5pDkfNgi AgvBQhlLtzipJUdHAio9eWd26yF49FlhrN3cvbW+WPJXBpymyh11CMNwkNetfuLQ1wyp DiIUv2mXmXt0FdETTP9SbQ3UEOUBIZfrGtnCbsyImumsR139+DCxN+lgwvlEeS7Y38qA tLJl6GC45NUPsQjTErlvLEW7EVJdo0r16FVwTHP6B0heibF7AXTZjOSeedOBkabzaHJd 7NPA== 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=6ciXHZq7IgUjKzK1dmpUyx2KByjHqFG7X4uzy09xTGg=; b=i9Z06x2d27gHlZS95YvLy78PJ0+U+lQETedw5odUOw7qUT2+dC/9RKjitLDKXLQTxK ctSVWmDGPn6pOaLvSCmVzyEzsvbpqfGkyqXcl15IYnJY1E3U8KGlakwLIzBx6z1oOmWB bTTGiG6wTpARk3B0YT3vxodMv9q7fGCKVea0aZOCif4pPUKoBn99MBXTgj6+liuXgvOs Y1VdBHD0FLR2zIlJP8r1vTSuAvq//VKUqUVSZBfZZrljjadRUCMw/p+I0YsfEivG3jVK mxQoO2Kep7ddL5Ue7OfpjENH9owmWBS3i4HbCH99w07RzSiZmCuZ5ksZJs+YEhAMCAlE HCCg== X-Gm-Message-State: AGRZ1gLgIQ6R/Nu4ghcmvGHua9WtDqmac0LcM16/ryvDLI5XXGKL4L/b 2bniSbQjg0DulaHrJQzH6Ue7OQMKnUQ= X-Google-Smtp-Source: AJdET5fKhROE/aimQ1rRt3miLeWFYefFvT3QdSuoQALV4SJ9187Krf1F4uNa0MudrsbwyJjKeaSx7g== X-Received: by 2002:adf:9403:: with SMTP id 3-v6mr17676176wrq.54.1540894962474; Tue, 30 Oct 2018 03:22:42 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id i204-v6sm26638614wmd.28.2018.10.30.03.22.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 03:22:42 -0700 (PDT) From: Jerome Brunet To: Srinivas Kandagatla , Kevin Hilman , Carlo Caione Subject: [PATCH 4/4] nvmem: meson-efuse: add peripheral clock Date: Tue, 30 Oct 2018 11:22:31 +0100 Message-Id: <20181030102231.4851-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030102231.4851-1-jbrunet@baylibre.com> References: <20181030102231.4851-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_112757_735844_574C53E3 X-CRM114-Status: GOOD ( 15.07 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Get and enable the peripheral clock required by the efuse device. The driver has been handle to work without it so far because the clock was left enabled by default but it won't be the case soon. Signed-off-by: Jerome Brunet --- drivers/nvmem/meson-efuse.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 40b9df1d030d..99372768446b 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -14,6 +14,7 @@ * more details. */ +#include #include #include #include @@ -46,7 +47,31 @@ static int meson_efuse_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct nvmem_device *nvmem; struct nvmem_config *econfig; + struct clk *clk; unsigned int size; + int ret; + + clk = devm_clk_get(dev, NULL); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); + if (ret != -EPROBE_DEFER) + dev_err(dev, "failed to get efuse gate"); + return ret; + } + + ret = clk_prepare_enable(clk); + if (ret) { + dev_err(dev, "failed to enable gate"); + return ret; + } + + ret = devm_add_action_or_reset(dev, + (void(*)(void *))clk_disable_unprepare, + clk); + if (ret) { + dev_err(dev, "failed to add disable callback"); + return ret; + } if (meson_sm_call(SM_EFUSE_USER_MAX, &size, 0, 0, 0, 0, 0) < 0) { dev_err(dev, "failed to get max user");