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: 119431 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6224903qgn; Tue, 21 Nov 2017 21:15:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMbYAFH9HhpDUNCeOCe8U1NKry1NC2jkQypRLiJHuzXsIg2RhebbcXlYoBnxai6Jx6GGfkDo X-Received: by 10.99.115.4 with SMTP id o4mr19216709pgc.371.1511327724357; Tue, 21 Nov 2017 21:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511327724; cv=none; d=google.com; s=arc-20160816; b=YMyGDoQxAqW/BT6tgpTGtWhxqFh01OnRVXrkM13t260JfxXoDbCjaHtuwNR9jx5V06 n29LEHGJyT7l615+IgDtyLrcHrqciIBT08m2g0mPLTcDzytS8lKkoMfwwm9pB5TQjdNd ROUbNraObw+4xZ7/k5K7Zyg7Njc5ZyM27RsqYOo24+rZBn25O/fA1sJRdn4/xyv7wQJZ CRXi511LKPpFzn9Qmzvul4N1SnCjUZfrSE6SkpwFuZ62vLh91i0V2U3/41UgFXPw1Iun 5nLwCXGKhX7jqqKE//5IGOdiBuHMml/NGKC1MV0DUugmcz0+XCq+ww9UoqCMgFdAxT79 bzpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Z5z5NnoPjD1svGEhaNVxcwfC2KbJRLBYXOWpitktnuw=; b=Om1Dx7V2ff4eO7Hux3qA6c9bojw449W6GrWU3+tH/iysYZEaqW8K89vM8gav2IrgSD NsOxyHBQhWlmGUCr5r2k3VG0UmL4/mY7uajle9qC28ouIQ5L1wCVcDo2hS+jcPTR2UFg xKJPpUMuQj+2NZv3TKyaBiUrOls4dU+ahnaJRrrHYwUmI2CjLCzY6jLEZBwz8HhoaBKD Brlu7ePz3k/RvcS3UA2kj2pvULvHqlqEgvhZ5ZtEDet13/j+qqUZKNvSb393JHfDfk+N li+eSc+RQmapFbgfY8PkA6VsX4e2oCef6VUSoSr8HZ9IjXhVzXRFlwd6/JiGSJXKnEWe D2Cw== ARC-Authentication-Results: i=1; mx.google.com; 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 s13si12521367plp.502.2017.11.21.21.15.24; Tue, 21 Nov 2017 21:15:24 -0800 (PST) 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; 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 S1751400AbdKVFPW (ORCPT + 28 others); Wed, 22 Nov 2017 00:15:22 -0500 Received: from mx.socionext.com ([202.248.49.38]:52508 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbdKVFPV (ORCPT ); Wed, 22 Nov 2017 00:15:21 -0500 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 Cc: Masahiro Yamada , hayashibara.keiji@socionext.com, masami.hiramatsu@linaro.org, jaswinder.singh@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/nvmem/uniphier-efuse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 Tested-by: Masahiro Yamada Reviewed-by: Keiji Hayashibara 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);