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: 149732 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5259524ljp; Tue, 30 Oct 2018 03:22:45 -0700 (PDT) X-Google-Smtp-Source: AJdET5eSykTALw+cy3S531sOc4dNGpsrEmqKv4nV+SqcNgZQmggXjjj3rT+N/UpZJdQ897oE89/E X-Received: by 2002:a62:c42:: with SMTP id u63-v6mr2332112pfi.43.1540894965218; Tue, 30 Oct 2018 03:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540894965; cv=none; d=google.com; s=arc-20160816; b=DWwZRtSv12d/foGHF1XMxKw2LdzmsYbaH3O/X1uA3MDF/UHDqGXMkmb6hV1i5dYjtZ QC/oss2MRgeYW8aFVjNxmZ4pMLBbEQu7vDKlnlaLiMdiqGQkLzPJ9rgsGY5bYBK2rygH HlSCZJPYPFVyFGVNIuB7SRPD0MXiuyJYJEArFlxpt+maO2eOEZl9YYMRv8Jei1UNpJkG MUJYCse4IYx7uVtK0C+kkInUZX4qFQVty9PH8SbY/gx15G43C007Qv5695EkJabA0+SH c5e2tMA4oIPv/utllESeO9SFDaUz0iA75fvUj440ICD67KY7zmrMN8KOGQJxXrF2lWC4 noEQ== 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; bh=ygrPMk+pJcXRHcdBwiVFBHzojOA9Y2YhpU+L53lNZo8=; b=eHuqBl//CzV4KduEDbw69LgXilnBhQY18NTDu+hcPbrGeWI+uTTiMjf5FzZ9I5kABw 9L6J9K4lRPXs864bn3ox81Vm+Z/YgS6gR+d7xi24v8MFRGOSzdG5bJxb6Zt1QHQwnHKh CM5qy2NOd/NxeUMzPFCTQv9Fj9ioqLupjoO8BlkcwJqou6uosHr9ECIQx6v5vfT6akCV 88ZfTr+K02JgcY29dCrc5G5tgxn600k+Antfdxo9+OMkTyWW6dta+TTBjrSeMbAVFWHf osmR4woUAsS6Io/rSEyu2EWrNoOyLXpI95yzqQBCo2O/C6XfhhaGQI/pvjCUD50q2XOS Mreg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=toLJdzQX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10-v6si12804861pgt.206.2018.10.30.03.22.44; Tue, 30 Oct 2018 03:22:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=toLJdzQX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbeJ3TPd (ORCPT + 32 others); Tue, 30 Oct 2018 15:15:33 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42705 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbeJ3TPd (ORCPT ); Tue, 30 Oct 2018 15:15:33 -0400 Received: by mail-wr1-f66.google.com with SMTP id y15-v6so11922673wru.9 for ; Tue, 30 Oct 2018 03:22:40 -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=H0qK1JwgMADhuNrH6Cy3nHkdwESPgrYbEBCfU6SiZkNqPzus3mUwiCsmiVyDO71uo2 md6fqs9Do+2riHnL7o38+swt6o9JvPoMHSIaYSmdEGvZcz+LQus8L1KqXtb39uhuJaCV 8iZk1103Ju2QlcEG0o+tT55fPcAh8T8VqzyBoesJjrlLYVwIHe9s9lg9gOpS7kdLG3QU DvW64eQq3CbpTIfmNZmh8e52Ou6aPqC2Bzp0SyzPdJ7fU8w5SaqXleVHMXjZ+0jPU/Gy Vjne8s4H5V5MB21NAUnU6vECi/CNsMIvnySru4qiEV9CaNssqUw8QqIeeFHSlONBDtrz vn+Q== X-Gm-Message-State: AGRZ1gJGqTzxn//ZSbEIl1K5WoHdgi0O0Ksrw0wzyuACDefoKaQOLIY+ k6AefukAOlT54uHUzNC9WguodA== 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 Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.2 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: 149733 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5259541ljp; Tue, 30 Oct 2018 03:22:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5eLpJ2lUQdAisxrsulDHVsW2+nuhvUguBzhAtM5Kz590BF9AupHl0DGwgzzdAUQUs+dIqxQ X-Received: by 2002:a62:3245:: with SMTP id y66-v6mr2327214pfy.72.1540894966239; Tue, 30 Oct 2018 03:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540894966; cv=none; d=google.com; s=arc-20160816; b=xGPgrBiYpMdtYQwFBsKv9vvKxdjoZ94xcYEiJm3hu1+45mPASMwC5xDhT438thbsOd dFCwe7q+y3oVL0ZXkHuUXCetMCDC5tinIhinb+1oBDXXCr5LetkjMXN2furWd49ofRmi GZbUPk+zUa+FDBsccUDsyYnMOifG2fjZBmeu7U8IX2ES0BSJkHgGilNEiaqotus1rZyP whfv8QsfEH3j8T00WCCGWxs2ex2p2kRcLhjmhLr+xNE/zVgfjrHW5bZxpStzZYxii4E/ orRMHW6jluR6OdvJoava91ErQa8V5nH401OK7kMCGbBWPI1wClvL6vBFfeMsfB/5yNp3 zmtA== 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; bh=LLrFK+YRmk7r6/C5e+K5O5DNC2H0ChSiQcyKfu/3Cr4=; b=Zv3jGov1Mm713jKicO9mJCqdy6ki56tMMJUUCRmzKdyv+wnmtw1nWUh6DpQO0bwck/ Zqn9IBam9tlN8B8UROWTKVStIGeYGfPPQad/meTiRGXpwsbDdTE/Ij2cDfJWksiBiUp1 rAAvpIjWT3VUYbjyUbrFoW+iK1TLEi9A/alo4JTcumni8HDiLeGXoIAzdVJifC6va4OK omj1E53qkDNEe8fsTFHSEwAKy87wkKexv0qfRdg8irVuT3RwchAvVuImx1sbK6m9Clge qGUXzJ2HDs8MtSoOYAFXrU0Z082SvHEed9fCktG94EBlP+cvtF9sXK85DPdsORdJVBFi NwZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=krN9fpah; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si9945739pla.38.2018.10.30.03.22.45; Tue, 30 Oct 2018 03:22:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=krN9fpah; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727503AbeJ3TPf (ORCPT + 32 others); Tue, 30 Oct 2018 15:15:35 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52327 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbeJ3TPd (ORCPT ); Tue, 30 Oct 2018 15:15:33 -0400 Received: by mail-wm1-f68.google.com with SMTP id 189-v6so11148078wmw.2 for ; Tue, 30 Oct 2018 03:22: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=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=lV7hvq4ka9d+C36beZ+uzu/V/sUpw3as2v61Wz7Vev6yWgbCgCQjjrvEjRnazU4vbD pjeyA+hq4OQnm79FKlIEtea2YhJ+0WFbBNoqLHSVn9iFCs/fMvg/qMuB2HxPk1gbRCgN Tdl2KWK9IxsrdILi23Le4Kp+QeCfxRmdBunnfRmluTIuNetlgDbYW7PmZaN+Osp0g2Wv f+TNT0xyK5ydAQllOGBaY8Ib8PPk11nx2J+S40ewnMKzSf0yrYUNH4JZH1w6B6OoywMD SMPOpTfDJBBY2TRQ/AUjFOw0XXjF0Ku+s0ABL2Z6OCK0kyC+VG9hQh+StUA1HmBR2bvT ++vQ== X-Gm-Message-State: AGRZ1gI9+EMW5iQbtHH/A8YJ+8eqMMRGO7ZH+MzTDzsIczzWxENe5Apt b9N7YNSSQ6mpIe5+vOnEtZktiQ== 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 Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Documentation/devicetree/bindings/nvmem/amlogic-efuse.txt | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.2 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: 149734 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5259555ljp; Tue, 30 Oct 2018 03:22:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5fn1GA4dm0WxuuL/HHGwEDCwPvTzPXemCx9QGy0DsMttwLO1PMyAxzc8g/9KeuI9LXqh62d X-Received: by 2002:a63:9409:: with SMTP id m9-v6mr16885157pge.93.1540894967504; Tue, 30 Oct 2018 03:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540894967; cv=none; d=google.com; s=arc-20160816; b=afugk8eYwpRjbIKCpoYveYkb8vluzfdx2PmDW6sjG8YqnklY/1zNNun6p0lRp7qucI kaMnwlepztpOfk+/MYI5PscucrNdlKMUMFnwdMMXIxB0VRsk0H9da8VB7n7pcWguBX5y yClIjf7ioI95WuP9Mgb+BfSHEtPajWd0NCajiU6UUWT9UN/WSTgnTzlLX+g92S8xxJ2O I2A2pH7z5s2gRcvnKo7rj6i51ggnCsGe9c0GPoWT8oIBWVuA3cV4axWPLolDvcTwLDcs 8Q/a4qmkn8A5BE5V9hGCKXG0BIdPpQBz2daSXbIGkv7dRYsrhsBRjMJZWQ9kV+YbexLW fRoQ== 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; bh=Ldt4WJfI4AQU3DusZodwyg3UdR/b7k3L1OUI368L5js=; b=IwwuCWug3akNWXoVZAHriQhNng89qibVCTPX33/JGLCeR6bmM8Tc+xDUPb8nQHeXaH gsnib7Lbh00eBpNvIldsrr38oegdVq3EZzLgN0fF4JC3S0cw1nI9xJ1JQ/v7f9G2pOAh /JHa9nFaI4H0O1rvq8nQ2man0bUPn9dvdByowmrAxJptgCe8Pe/gBYxHn52cT/MMPRjU 892KpMDOFO0Z7IAKha4k+Tid6Low6NWdNTEPcXRwyFiXdGAi99KXXNoY2Xobas/UO5xg MTQxo+ZovkUWHbkXkY1c2oVlIpMRv7a7btLnlkm9LBDc/j1tKab21Iqv/s0WCoCgIXqX pvIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=WRdBXun+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14-v6si25609785pgd.282.2018.10.30.03.22.47; Tue, 30 Oct 2018 03:22:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=WRdBXun+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727556AbeJ3TPg (ORCPT + 32 others); Tue, 30 Oct 2018 15:15:36 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41908 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbeJ3TPf (ORCPT ); Tue, 30 Oct 2018 15:15:35 -0400 Received: by mail-wr1-f67.google.com with SMTP id x12-v6so11920118wrw.8 for ; Tue, 30 Oct 2018 03:22:42 -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=mjcnAcEoG2FbODEx8DWLFr4CZEdl28WSVKyJJ/6OukWnrOAAc9bXQcdrkSPY7utK9B vrCsVRFlR95pY6HMzWS2xFQInePNfO1FIqcCEY1ToWy1odXEQlFCn7iC2qQfK/lbUayO i2eL9B9HWTEC6Yjbianx2a/fw6XThfoWHRcQabpKv7aL3Mft71p6IGu/FtY1P1CD3auv 7GYKDiIO+4QUizm02BtiAq63bDAHuplsWDqC0oxsQ6L/Eijweml7gFXklaSe6E6JuL91 wE2T/a9tugG5ODeG4jin5IY5PknfJ5pgSPOCerhNdag/5Z1TmLAfI8oquU2XoXXTPEGj hJkw== X-Gm-Message-State: AGRZ1gJks7w+tjIQrLVuQlriykdmYRatiBkYWeqtM5Y6Mnyk1+SJ6AQS j8VT1vY3hZqe/MRRXVN8wNC75Q== 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 Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.17.2 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: 149735 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5259569ljp; Tue, 30 Oct 2018 03:22:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5deZ85ykKTmeljxR+UE99R2JEhmt7uVpGH5bUWuikbgLubWUKDjxRBcQfd3yOGOfAyP63kg X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr18328666pln.319.1540894968049; Tue, 30 Oct 2018 03:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540894968; cv=none; d=google.com; s=arc-20160816; b=ce4b5K7KyJZbpm+H/l3+5NIRUlBrPHh9AMy//SeYHXs6gPJY5N6JoKsR6VH9EShNve yFUEfdOe/aCi6DjWPsrbnxPBafsUCV6BYRS5f207Ov/fQZvknFJlzb/PCZl4udVg3eHe 9s0Lpr/PQ5Q8lEJvgvPpl97b8tbX5nDr0e/aQjXYzzoHnpUYS/jxO3fcV8imaNAhO/MJ aHDO8RMN3aLZQumF5aE7cUsXcX6CCk84t50uj4Ruoo4WTyBVEtqv7+D0iRGs5z1YRu1r Z70XfM9/jSMlfrzlslGsjrzdnSlJjY/S2lcstUCmVQwJPkb1AqCDx0MPVi5iDsVpgzWd EE1Q== 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; bh=6ciXHZq7IgUjKzK1dmpUyx2KByjHqFG7X4uzy09xTGg=; b=m8t9b3qRe+ujQol/z6XAxhFE+YNjQmvMYaLRglnVtPveLKhC9EjU0ANiO8UVmHu/GO +5qXW0112u6+iBUwpFTRQY0tHAfQWNcEs3YGUBxLRZxrXGuc8kIXsHzrWHdDGoXEX+4i n5vB0gwwJE/JvGkwQ5Lt48tmKPyh9kUGL1VTbeYPTL6o7X8V6v1u1cNY0VF6weaVJKxj Iz2r4TL/wCOEhQbqc6jakB5KB+/D6r2sX21+M25hhqMM0OJUI5iECqyOZI/J3ppRogpG pJATp6IGQq1foWW7/+cP2RY3IodJbzlpjf/WsbYhb4aXCIOffnmCz7/S1fI3YaBA0A1w gslw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jpu+Z8fv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14-v6si25609785pgd.282.2018.10.30.03.22.47; Tue, 30 Oct 2018 03:22:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jpu+Z8fv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbeJ3TPh (ORCPT + 32 others); Tue, 30 Oct 2018 15:15:37 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34495 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727420AbeJ3TPg (ORCPT ); Tue, 30 Oct 2018 15:15:36 -0400 Received: by mail-wr1-f65.google.com with SMTP id l6-v6so11939418wrt.1 for ; Tue, 30 Oct 2018 03:22:43 -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=azkZCLuwmEOdZO0L2EULRj8OV90ACCQLlNaLq6uBZj8KeJnPVcqKNfgMvUrGCBdJDZ /A0Y9GTXQ/LyqR17zXHyUPQDigPqPopiQJ7AfiNLoW3OeMJgriAGIUkSdcFJ0LUrR7cr W8rDio/uudcE2yV2iUfB+cxIDEH1Len512ZABDQrxrX4Etbr3twHIRcYp1SOGDhpeXs4 J7c3MRDp4YOYjS7wbFwAhA0BIpYtV9sXHZlfB1kSTetV7iS/WEXMdp7IRl/Dqfj4v4Xn FqOUQfa+KMp1MN0MbYm+rFJ5Xe3W9tBx3YDnAcnTPukFPPBt5sG8TAckpqJyC76Ix9vk 4daA== X-Gm-Message-State: AGRZ1gJUoYfbhye3EAsjU1Zjdc07OW9sOVvSnX7ELpxv+A7AAwStPkbN GUI6xZ7SbY0dUJKG8Fgxq6Fdbg== 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 Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.17.2 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");