Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp851447yba; Fri, 26 Apr 2019 09:45:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwD5JnJFj2TzpZy4bGszuoqcnQmETy8kKXjTjfSDdy5jdpJfB5bWDSK99rfZN82QUqHv/OM X-Received: by 2002:a63:d043:: with SMTP id s3mr43530664pgi.359.1556297130877; Fri, 26 Apr 2019 09:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556297130; cv=none; d=google.com; s=arc-20160816; b=wvzppDoCwnKApeLrIGuBDRS3w8ohH3P6LyZmSvGqx1AaHwS1ShRCrqRNe9xe6shQUT 5R5UVjMJdFfHUyL1Vz2RS7Hqp6gsdsHLu/atBXFa12snO2lrl9RHuP97nvN8hSg9Bl08 U7RMS5DY9Fk5Yhh1txB0pt0nwNn5YICxDeFKzk0BtcDB91q1gvKDaEWwGPLbTXiOfeHq Qx499VNb4qC4kThdf6LsvtWWwTUR8cJCCxc5je/5iEawRf+0bHpSm5+0Mtk/R2AxBhZq 5c/AUFjbv6lQAYqS3Rcqe6/gGYD2K/gCwVxy3zxdzGSeDcns31EF05WUM+ek1v1T9+Pr ojJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eWVEhVXV6Szyd9/44KMWrRQaDEl4L0ZWJnDi1/l1OvU=; b=rYu7lIcmeMy6jwB3mcJN1aasesuXwlmGatWVJr6NyWnHx7Dsz0m3/UsS8sqmjtIU+v dAynYwYOzINMqCUGTcx67OzV0hmNcthM/PCDgv+IY/BwGJc8/d3xiBEokLRuAfzTdNYu 6rbVvJt4kxODgQFWXfhOnjsV4a0XcbsxgPmRDAVRiRkqSK2tOuACqtsXN+wbEQ4X2x0h YhQdKcE4f3sB5C/o/yuQxBxImr/m0prggCeX9ohNHxV/EIzwrS/0pX7L9BjXBJVQeB+l VLIYt6EveDhHH8Yj7/p0bP1D1saF7A+uixRIr9vxoyawLm8ZhzGYsyc5wKpbJNvRA8WN Uyhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WkHXdRvo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si25307972pfd.19.2019.04.26.09.45.15; Fri, 26 Apr 2019 09:45:30 -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=@gmail.com header.s=20161025 header.b=WkHXdRvo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfDZQm4 (ORCPT + 99 others); Fri, 26 Apr 2019 12:42:56 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:40130 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfDZQmg (ORCPT ); Fri, 26 Apr 2019 12:42:36 -0400 Received: by mail-lf1-f68.google.com with SMTP id o16so2944727lfl.7; Fri, 26 Apr 2019 09:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eWVEhVXV6Szyd9/44KMWrRQaDEl4L0ZWJnDi1/l1OvU=; b=WkHXdRvo7xgf4zAkZ1FgFwoafjH+HccU9KLH1nV9eSay+kL9EbIhE6HkomyibxW1e4 lNHutCqEG+L35Mk8D6utdJQ97nVWRuksU1keF0ALEwIfHvmOpLMVogA/Wi5dsdXkj6ZH heoVg3WDdIQwDg0auIn9YOkFfd1EjsS6W3Xm8S1MFOVqip9GQ5Q8M9dxn0u6389PMpTr C5SXY+nN5SKa4QMyjEZQ6vNGwTxE0MxU2JzTkAD7zuNxehhx3MBHRh6z7wxd/gSBScS2 n+JZfX5Ahg5EbO2YYTuPLFt/ibIXN/yzINXn0rCyOrI7VZ5g7YpEmZD6TmN+KgxMm4bV 3/hA== 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:mime-version:content-transfer-encoding; bh=eWVEhVXV6Szyd9/44KMWrRQaDEl4L0ZWJnDi1/l1OvU=; b=GbUGUDgc1r+KzlsdwPrkEyprJb5wq0KwuNL4u0QJcIoGrM+FAHadrTVi0JFq2lXmN/ Pr+zd3Dzq6WbrMzvKfq44DPEDFRjV+QHU1GkKni1B4FpbzKLWEyvQbWLdusj9E+gy9rs l8sP/NAo0QbqFrtgcPdobjQo/8AvoLhNYC1DXeJ0kNjXpXNfZdOwlJI/7Jj66ceAVP7L FBhiXlLpVN/+9Kcs5zBKgApt9mzgcdsImxUtgqM7ryfNmCQj/Pf6OVopmdDmSr44l5q0 BpeanPc5NFK0jeCoMsVkaX8LUdx0ZzjX0FzKuKS+hTg4j+XT0GXsFuO93gCYRauU4TWb oKcQ== X-Gm-Message-State: APjAAAWiGh76j4Fqg04qPdW8iY2CgWzmyeocD4CmrhnBYPgOpmlZzfk/ pte4PdJapQNEFkcBuppxu6c= X-Received: by 2002:a19:7702:: with SMTP id s2mr26244975lfc.102.1556296954524; Fri, 26 Apr 2019 09:42:34 -0700 (PDT) Received: from localhost.localdomain ([2a02:a315:5445:5300:2492:ad61:69f1:23cc]) by smtp.googlemail.com with ESMTPSA id q11sm5637807lfc.51.2019.04.26.09.42.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 09:42:33 -0700 (PDT) From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= To: kyungmin.park@samsung.com Cc: bbrezillon@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Tomasz Figa , =?UTF-8?q?Pawe=C5=82=20Chmiel?= Subject: [PATCH 2/5] mtd: onenand/samsung: Make sure that bus clock is enabled Date: Fri, 26 Apr 2019 18:42:21 +0200 Message-Id: <20190426164224.11327-3-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190426164224.11327-1-pawel.mikolaj.chmiel@gmail.com> References: <20190426164224.11327-1-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomasz Figa This patch adds basic handling of controller bus clock to make sure that in device probe it is enabled and device can operate correctly. The clock is optional and driver behavior is identical as before this patch if not provided. Signed-off-by: Tomasz Figa Signed-off-by: Paweł Chmiel --- drivers/mtd/nand/onenand/samsung.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/nand/onenand/samsung.c b/drivers/mtd/nand/onenand/samsung.c index a425f19a3876..9628bf5bc397 100644 --- a/drivers/mtd/nand/onenand/samsung.c +++ b/drivers/mtd/nand/onenand/samsung.c @@ -14,6 +14,7 @@ * S5PC110: use DMA */ +#include #include #include #include @@ -125,6 +126,7 @@ enum soc_type { struct s3c_onenand { struct mtd_info *mtd; struct platform_device *pdev; + struct clk *clk_bus; enum soc_type type; void __iomem *ctrl_base; void __iomem *chip_base; @@ -916,6 +918,10 @@ static int s3c_onenand_probe(struct platform_device *pdev) } } + onenand->clk_bus = devm_clk_get(&pdev->dev, "bus"); + if (!IS_ERR(onenand->clk_bus)) + clk_prepare_enable(onenand->clk_bus); + err = onenand_scan(mtd, 1); if (err) return err; @@ -947,6 +953,8 @@ static int s3c_onenand_remove(struct platform_device *pdev) struct mtd_info *mtd = platform_get_drvdata(pdev); onenand_release(mtd); + if (!IS_ERR(onenand->clk_bus)) + clk_disable_unprepare(onenand->clk_bus); return 0; } -- 2.20.1