From patchwork Fri Dec 15 14:06:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 122106 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp526389qgn; Fri, 15 Dec 2017 06:14:43 -0800 (PST) X-Google-Smtp-Source: ACJfBou8CFPnAkB6s6ahfcM/KeAMoK1hlLw+OIdjBmaeDm8KrN4DIVMqctYcI9V/I4WaXBjWFH2v X-Received: by 10.98.100.71 with SMTP id y68mr13600294pfb.178.1513347283113; Fri, 15 Dec 2017 06:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513347283; cv=none; d=google.com; s=arc-20160816; b=MtDf1wQjbDMLlKltjkgSm+ZpSZdV0ifXwYgmAhqKbXiSMFn14ZzMKPM9Tdqw8ArTjq UpcS/GqAxpiXe+7OHW959gxLB4XH5MGSJvAbzfs2u+f2mGVNteSfEhMDj3DAyV00hm/h jDULZ0t9dmT9C4YUCI0LhS360/irgqq1sXgBBOS7sRMKC7dSswadNT2CoxeT2fjZtRBp IC35u+/WeqjFTaB3J6mojyOS5IcU6ZxHtGLYbAAig0aCI7m9AuXW1lZWUZ/zIJ5FpqgK //06b0Wy2m0RUwZqwINE3SMepljP0asDZy6nAxbX82HMR5GGic7zmZKuS/2tc2yhHflO sxXw== 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:arc-authentication-results; bh=LwkOczeODoEfqNqp5Q11+simEsBX0SBGUimATH3n8zM=; b=NKRlNmejEg1WQYPzxXxKvsxbPGCnhwm6D9ksIBaznXYAmb4rRyZ9BsKSwSdV/EwYVM QySiEmlZO4IwUzzcqUMFe27/TRqvqdAwg7JDR5ndlU4Wjr+RsDr+im/RF/HEnSOuc1OC qWvMz28egrSx6MhcCXo6OovwHACDD7OekYg8aiNHQi2nuVegwa073NNVW1E+IWbtXwUX cS4xiBqB5ZInJS73gG1Ha7dAL8sRejOWlJChRPprgR5sO5XWZZLQT0jPvuXXd0zJdAE5 TijGLozIhqopo/APbAPeVepmprqQjg3D0nguSwHZVDyJ7+tJ9NpA31+KsMiy1Th8GfCx 8kgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E6poqWdB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p27si4612393pgc.402.2017.12.15.06.14.42; Fri, 15 Dec 2017 06:14:43 -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; dkim=pass header.i=@linaro.org header.s=google header.b=E6poqWdB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136AbdLOOOj (ORCPT + 20 others); Fri, 15 Dec 2017 09:14:39 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40922 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755739AbdLOOJg (ORCPT ); Fri, 15 Dec 2017 09:09:36 -0500 Received: by mail-wm0-f67.google.com with SMTP id f206so17756470wmf.5 for ; Fri, 15 Dec 2017 06:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LwkOczeODoEfqNqp5Q11+simEsBX0SBGUimATH3n8zM=; b=E6poqWdByJ+QFSXZE/RZlP2uy57IS7rkJAnVRaOdvmjiuov69Yj6VAhqSa9tmmoFzZ Wrn4G3SgQ1NrZEyrENYpSYCaP4+qgDy/5BLWNwZ5Oi4WPJLnBwJrzNJJO1cOUQdt4Hko gS41mIz/x7frI/38rs2mZGyVdPgos8EQwZjSc= 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=LwkOczeODoEfqNqp5Q11+simEsBX0SBGUimATH3n8zM=; b=fBzbuDaStZbyYVE9l2ar6UHB/+wRgkTwGn9W6O9QTzTulh2e+oYi003HXKoTW+ntJV KUaNulAET08kvg3gb/T+nxD7AmDm/kDeTANst9t2Yvui19RlXitYDtvBZ91ew2RJe/BF 7NAWH5+oC+DQdfD8uSfiCH9IW8OzvqqFHT4YJAYhUDtqndSfD+ipM6Dboei1D+zPFhR/ XfcYi1WXXvkL4edGN8w1WxUG6sCh3QRO2ZElj12rUbVlZ15wUyxMdkKnUlRS5aaSJR9D 5pmscwExxVrzlNT9gpez9d8UNWdrCG1/ta/ukrg5qYEzOaWMK8+nfgi5eEFAN48XoqIw slzg== X-Gm-Message-State: AKGB3mJVLJq7hz43hLrnthgGy/xPz33cBa2/wfX1Pt5ULXFxHfV4drFJ lN+XmPQ9FA0MKmGB/HlztiwYnQ== X-Received: by 10.28.232.208 with SMTP id f77mr5013468wmi.155.1513346975288; Fri, 15 Dec 2017 06:09:35 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id n7sm6295034wra.23.2017.12.15.06.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 06:09:33 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Kunihiko Hayashi Subject: [PATCH 4/6] nvmem: uniphier: change access unit from 32bit to 8bit Date: Fri, 15 Dec 2017 14:06:07 +0000 Message-Id: <20171215140609.17193-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171215140609.17193-1-srinivas.kandagatla@linaro.org> References: <20171215140609.17193-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kunihiko Hayashi 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 Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/uniphier-efuse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.15.0 diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c index 9d278b4e1dc7..be11880a1358 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);