From patchwork Sat Apr 23 03:46:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 565671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331EFC433F5 for ; Sat, 23 Apr 2022 03:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232594AbiDWDtz (ORCPT ); Fri, 22 Apr 2022 23:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbiDWDtq (ORCPT ); Fri, 22 Apr 2022 23:49:46 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2043.outbound.protection.outlook.com [40.92.47.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCCFA13976C; Fri, 22 Apr 2022 20:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jhORCvLN9lhpZJvvQHVaOUFJ/G7++hoclB7isnmbHXrP7NSKAnhBCCLh8d0Yj6JwJarFuxwpsBRxTgEKOhsVF9sx/QpYK9oNSkG3C5DNWXHtyTZVFYiTGN++qR3Vn8LX/r+g0i28LXqMn90JK8j0q4Z94t5scmVSlVbycQgVCfPsU0eh7BU0jDkOoo4k5hnqtDdBQxbVovrhyDM0vF2gdojQSLITx7NBBpL+n+ZqXPjwMeR0B+m2lZpK2DIBYlcb23d35Yz0hec95OHKQQYQRdmQvY31iOhmQFCBpdMmLTdtGOyJgsIYQBHkNpK95fZAQwIFBiE5XiyNCrB2UgGAjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dcP75b0sIfQb1qUJhu4FHo+cowifBokjGJEEWhB4fmQ=; b=UqLA4nUegFmMwY8wD7IR5cZtuY2X6BkdVIgcyGBM1DzPobkNBCkBws7wZM3mFgtSqZkZDW4IoVdSQlReHzlwUUyAGeCbmEYkJu/Dlq8ymLgzArnMWw7AKhjl8wRx2HZe7/Oomn5JPg0QWFx+snyqDzl/3YRd83n5khKvogZRfZJA/pCOQVpJ2Ol+RgtuMaefnbYYLlO9NBOEx4aXEWSbTny6jJn5t714WR80Hfo2IiZwl908/iqcFf4bEBPR29W/OyKn8UvL6Z/8SfQ6lr6esdlC4vIGxKza35nVpYAFfFJYHrcRSH8ZLROzJQC4O0ICgivhjdOMJWAz04BpWP6GFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:46:47 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:46:47 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Tomasz Figa , =?utf-8?q?Pawe=C5=82_Chmiel?= , Jonathan Bakker Subject: [PATCH 4/5] mtd: onenand: samsung: Make sure that bus clock is enabled Date: Fri, 22 Apr 2022 20:46:21 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034622.366696-1-xc-racer2@live.ca> References: <20220423034524.366612-1-xc-racer2@live.ca> <20220423034622.366696-1-xc-racer2@live.ca> X-TMN: [jzISU3lGJgpMSJxoT8XLznq63W7cCwgumnU7uamOx5cgbkFrk0Xx4bEPZF4VEom7] X-ClientProxiedBy: MW4PR04CA0210.namprd04.prod.outlook.com (2603:10b6:303:86::35) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034622.366696-3-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dc3d1f3-057d-4284-a07e-08da24dbe454 X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F7JMQTwKf1gP4G3EdEh40g37+FbTyIuMpi4dPggSK812Pp865EqDbjq7/pZZVczXLMpligvLiO0kZO2egd9qgvF3uZ24l/V3l8MnOI78CLk5DPhYXsvRlhL0mQmG1trm9qHWWRrKCxBWTZ5DgR8Xz35Pp7lqaRciVVrCQ9j5KUvGWGarmktJD5js3wrVEunTr8B1IEPAfq9M4jS4MXwaop5tQ/KmkxeH+I0N/CsE0WzSagACiZmPIC9RZW7Zg4ck/6IVKquwq2ld++/WXESl6lDZUc20GdygvwQQhlrmHxpZzpCrucHUDLBSHoR/3k5JFtM2HGIIYibYhPne/UWwZvPsHK5tX0miT4trXsf7NIikshEzsMqsUn6dKJAlHBD+iI0wG4p+4sFlNOEqtx3ih95aTxMrd0nRpKpuZqrI4bQi0r4LuaZQrVMpx57nc221xPJzj+mx0bG1R64D+b/4PLf/zskGJGgT6ukeQtrx33U9n1cGB3PV+FRylCRyGlEMu7J2VgzO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SAh/kXlf95xi5BfzPFLO?= =?utf-8?q?34m2NDdb3afe0GBuSBTF3I8KYaKApFajrvxX6S8OJugnTFLGF8kmfBaVMPRoV61j+?= =?utf-8?q?DxhLhHAYwrUvV0sjXANzA+dvDTBD836IhR2oPsdgl4o34WgAFa+i5XqoaTqhZIWPL?= =?utf-8?q?/VvTmo7EQe4PWD+1vnB0XDpK1nNl+b5ngzhvMPBbtYwXVCrIx4CiMjs1hJO7X1rvY?= =?utf-8?q?pswIlWbUPgvFqt0no0zuZgiz/9OiFICYki/hkmBXcTEuIJwCSq3dkjToJjWJszGlm?= =?utf-8?q?B2evSgvnoyMVcRTtcytzSRE9wUMwKCmFvBcDDGbqI95Lgia/eCpIf8PEj91kVverf?= =?utf-8?q?v3Qv224dybyjW0tbGWD2dec4WQ0Zl/6Fby8NWuRTviMEpza4/7GUeZ14t4oIHQfDy?= =?utf-8?q?GGqAE6gzEfQR/Rcxkp1k9N/yLV5M6x5V6FnE9nze7de7s93bGKsvEcAH+EHMRbG+Q?= =?utf-8?q?NwnplGpNivr5VApFImOb9rz/JR80tT6J5r1WyrLmMf/HiV1gfsK/NpOs5zVy17Xkl?= =?utf-8?q?9B0J1hS78P8d2SaES1NpsFOcQ/03wDPjtLuhxtuWpj1HBvFasp2rn6jhstjAy3yav?= =?utf-8?q?1wF/fb1ASFiIh+q+cv9hLi3wVFS4BAM19p6cXJZny91JKq+vWhgii6/fLotDtxkPA?= =?utf-8?q?Xq6PHEvIVMSO80yBOMBtFOgs2XRHkArovMRJUwd1VBU60ETka6sCjXAbY=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 0dc3d1f3-057d-4284-a07e-08da24dbe454 X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:46:47.6972 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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 Reviewed-by: Miquel Raynal Signed-off-by: Jonathan Bakker --- drivers/mtd/nand/onenand/onenand_samsung.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index a3ef4add865a..62014f8d27b6 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -11,6 +11,7 @@ * S5PC110: use DMA */ +#include #include #include #include @@ -122,6 +123,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; @@ -914,6 +916,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; @@ -945,6 +951,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; }