From patchwork Wed Nov 22 05:14:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 10069557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DA8960353 for ; Wed, 22 Nov 2017 05:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09B0929641 for ; Wed, 22 Nov 2017 05:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F105629B3E; Wed, 22 Nov 2017 05:15:53 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 63EBB29641 for ; Wed, 22 Nov 2017 05:15:52 +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: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:In-Reply-To: References:List-Owner; bh=lApY0tox2kCpSs2X2WwY7pe85dyTtJn2sboz22FnWxI=; b=J99 8tSlOeHTBZjqDNBfkE8zj0B4xi6z/x4kEfgmFSM28xbHYHaMvLt3Q4s6c8knC5D8GlbJ3IWO218Qu QcYBsVFWwqssc6sjn3FNQ1RwrEuQUIt5ttgAMWpEyWMQ1EnGB2G7Qsor7WYUe+yNEqc4sn3RPxNaY QBSPgjddpoX8yyy0Gkyi7paEthOwrCycrzngEA4FeTW3jVsmorhESMiQmQWLop68qPBZJDH1vrrkj vcWqdwdDgnIKckGTpOkIlcxXscYmyC7O5ovzSJNTW38cCA9XBm2E8n+YUAtOL1Kt52KykX/ui5M7g /ed8J4GsuI0VfOrmyh8H+viLRV8Tqrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eHNO2-0006xe-7r; Wed, 22 Nov 2017 05:15:50 +0000 Received: from mx.socionext.com ([202.248.49.38]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eHNNy-0006oN-Hw for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2017 05:15:48 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 22 Nov 2017 14:15:20 +0900 Received: from mail.mfilter.local (unknown [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 76475600B8; Wed, 22 Nov 2017 14:15:20 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 22 Nov 2017 14:15:20 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id 26C191A0E17; Wed, 22 Nov 2017 14:15:20 +0900 (JST) From: Kunihiko Hayashi To: Srinivas Kandagatla Subject: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit Date: Wed, 22 Nov 2017 14:14:59 +0900 Message-Id: <1511327699-26396-1-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171121_211546_723896_105136E6 X-CRM114-Status: UNSURE ( 6.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kunihiko Hayashi , masami.hiramatsu@linaro.org, jaswinder.singh@linaro.org, hayashibara.keiji@socionext.com, linux-kernel@vger.kernel.org, Masahiro Yamada , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The efuse on UniPhier allows 8bit access according to the specification. Since bit offset of nvmem is limited to 0-7, it is desiable to change access unit of nvmem to 8bit. Signed-off-by: Kunihiko Hayashi Tested-by: Masahiro Yamada Reviewed-by: Keiji Hayashibara --- drivers/nvmem/uniphier-efuse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c index 2bb45c4..fac3122 100644 --- a/drivers/nvmem/uniphier-efuse.c +++ b/drivers/nvmem/uniphier-efuse.c @@ -27,11 +27,11 @@ static int uniphier_reg_read(void *context, unsigned int reg, void *_val, size_t bytes) { struct uniphier_efuse_priv *priv = context; - u32 *val = _val; + u8 *val = _val; int offs; - for (offs = 0; offs < bytes; offs += sizeof(u32)) - *val++ = readl(priv->base + reg + offs); + for (offs = 0; offs < bytes; offs += sizeof(u8)) + *val++ = readb(priv->base + reg + offs); return 0; } @@ -53,8 +53,8 @@ static int uniphier_efuse_probe(struct platform_device *pdev) if (IS_ERR(priv->base)) return PTR_ERR(priv->base); - econfig.stride = 4; - econfig.word_size = 4; + econfig.stride = 1; + econfig.word_size = 1; econfig.read_only = true; econfig.reg_read = uniphier_reg_read; econfig.size = resource_size(res);