From patchwork Fri May 11 11:07:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 135526 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp721731lji; Fri, 11 May 2018 04:11:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrnxar5iVeygEDKgYMm4QZxpxlkJ0vcCiRUcuE3DlGaOkwgqMe/GrWOzCgBLvV4R9tQ7K9V X-Received: by 2002:a62:f909:: with SMTP id o9-v6mr5077861pfh.256.1526037111246; Fri, 11 May 2018 04:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526037111; cv=none; d=google.com; s=arc-20160816; b=eJjux4o+hDZVJVs0Ayk+FTS+c9plp/WEF+sZ/IYLRS7+tLVB3ZUPKOaK12U+59bRsA o3oMjPaa2OZ6CTqWCjRUh0JPLiPMQGd6Eyg8BZ2RxcfirWUnrLpfvI1OpfNY4kuQA1IJ eKUPQ4+O0sUQ5QYrTNHUsGfeG+BwtKUtQc3waRRB/YYC57qyN1Ziht8Xsov9mllt4Amj fkMD1wvlPClM1yAH+F/l6N5d3aTk/g2ehSacGj4RwFoN9AoM0nZxWAmXGHxlIR+saH2i cfvnQiqqDSteki9bv9hkO8gljNG3NRamREKV5daqWLx3Z7Y8F233+pzqtlUKJzT1ZtQ9 rkfw== 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=knlOZa3kWejwQyXaSPUlYA5Ylqs5mOu7wvB+yHzU8sg=; b=vK0oYHew3ZX96i92llgFJZ/bKksBk6VIvG7JRQdDds1J7eJpvDq4uiAuDwwhiaMkbZ kNjFhpabNo34y4n5KQNzR3JvHCv5mJSarnZj1BInmVTbFrHDwbuwlxnilIAvG1tZB4uM XDLbiE4SIU93SqMsdTa+hpLzw96/SnqOVZXqHrXcKiRlhUx5EsrEOKi2dgK4GpPpCUTl If6s3xhFNZLpjPsH4gcRGPTM9gKbiXv/q6C49O5lVZfbkPWbbohoAC7Si7EY1AvnfS2W /SYY08bt/TRgsS+xNKYnNcpX2wHWGcYApfL9iCvQfaS8zzP0Ji27vgSbnCb6Jv0g057r IlrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hxTlPOpr; 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 i2-v6si2476813pgo.289.2018.05.11.04.11.50; Fri, 11 May 2018 04:11:51 -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=@linaro.org header.s=google header.b=hxTlPOpr; 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 S1753632AbeEKLLr (ORCPT + 29 others); Fri, 11 May 2018 07:11:47 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35782 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753428AbeEKLJg (ORCPT ); Fri, 11 May 2018 07:09:36 -0400 Received: by mail-wm0-f67.google.com with SMTP id o78-v6so2532856wmg.0 for ; Fri, 11 May 2018 04:09:35 -0700 (PDT) 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=knlOZa3kWejwQyXaSPUlYA5Ylqs5mOu7wvB+yHzU8sg=; b=hxTlPOprUWX/s/vO1eReVCVgZtjHuYRsKPxEbsDeItre2yo8mGtL+EuksEFF8rHRE2 txa/LpqA/bjWAp96wWtYPpKlpTG50HaydRRz1Lzq3ajdUk06M90QeKvYmAVJNdf+joI2 s3GEUiZrS3NvD9iif6Js3Yz4DjJKlkD3pcor0= 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=knlOZa3kWejwQyXaSPUlYA5Ylqs5mOu7wvB+yHzU8sg=; b=jk8vcGzDKtJRoWy6dFpSAPYQDRT/9rQuGEIsnX7jz/FRdzikrlsaoWENBVJ5wJLGqg ntHctxVyLDkh31ha/9DJOYRH0jM6ZsJWoCWPgMeT9eVWpIOLC9qPgFBZ+VnImLCYMfIZ iTI/v41uDii0t2zb3yXkCZlPD7pnCDTIJN2YOc3+VhI/B59DxJ+eH00wwixgrHrf13uy A2W70gPpzUCuDHhf558WOHAuWudWnwD+54g8+D7TgEUorwyXrm3etBJ3tsJ1RPWfgBAF +DcJ2SJBUXwETAVRcRD1U2rimDD1t+edf1Ja7e5V+YqrWajVglSgOc8WnUIkNc+4d7o4 nAxQ== X-Gm-Message-State: ALKqPwdtbQh6zfaRon/Yw/R9xPDSuGNpeJArmLZVvw1Aduln1N82lVZ/ 4p2TOZ5l8DO0B5qAcLXCalKhfA== X-Received: by 2002:a1c:7d42:: with SMTP id y63-v6mr1695943wmc.121.1526036975092; Fri, 11 May 2018 04:09:35 -0700 (PDT) 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 a129-v6sm714047wme.34.2018.05.11.04.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 May 2018 04:09:34 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Jerome Brunet Subject: [PATCH 6/8] nvmem: meson-efuse: add write support Date: Fri, 11 May 2018 12:07:01 +0100 Message-Id: <20180511110703.4924-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180511110703.4924-1-srinivas.kandagatla@linaro.org> References: <20180511110703.4924-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: Jerome Brunet Add write support to the meson-gx efuse driver. Beware, this efuse is one time programmable ! Reviewed-by: Kevin Hilman Signed-off-by: Jerome Brunet Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/meson-efuse.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.16.2 diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 4623249dfd87..d769840d1e18 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -28,6 +28,13 @@ static int meson_efuse_read(void *context, unsigned int offset, bytes, 0, 0, 0); } +static int meson_efuse_write(void *context, unsigned int offset, + void *val, size_t bytes) +{ + return meson_sm_call_write((u8 *)val, bytes, SM_EFUSE_WRITE, offset, + bytes, 0, 0, 0); +} + static const struct of_device_id meson_efuse_match[] = { { .compatible = "amlogic,meson-gxbb-efuse", }, { /* sentinel */ }, @@ -52,8 +59,8 @@ static int meson_efuse_probe(struct platform_device *pdev) econfig->name = dev_name(dev); econfig->stride = 1; econfig->word_size = 1; - econfig->read_only = true; econfig->reg_read = meson_efuse_read; + econfig->reg_write = meson_efuse_write; econfig->size = size; nvmem = devm_nvmem_register(&pdev->dev, econfig);