From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B50FC43613 for ; Thu, 20 Jun 2019 08:14:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2405B2084A for ; Thu, 20 Jun 2019 08:14:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E4lQmbxT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="1EkRwQks" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2405B2084A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zw5JCUeVnvyPk+v9qvsoLV7YzQE2uODhOGlx7YvP8Kk=; b=E4lQmbxTbJ15O4 5Egf5nJZV81SzuLUfWNGgO7IMGhJJqahCnJEh5NFXdQvKML/QT2VGEaG/Yz0ePuDDZl/Zw+b9Ia09 3RF82GljbIGK23tlcGBB9hpOIlHdqk2LspwhuEc7wt9YUE0lKdTxGgkbaYPEA0Cbe/Og5awF87jU7 UDjWmUQVdQ19vJoCt/UjXU5SrFso0MuR1WmeSDB06LD6FNaWqB6h7jJUipKUPd/5sNl6L65uoOgKQ l1Sv+FvjW4gA9vlqXluklHo7NbM5l2EZ4C7whzlwWzWRHqRPCOKVYaooxGCLFiGcHV1yptrj7RuZD 6+wbfvty3QmxOZULMOVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdsCy-0007Z0-LS; Thu, 20 Jun 2019 08:14:12 +0000 Received: from mail-eopbgr690059.outbound.protection.outlook.com ([40.107.69.59] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdsCu-0007YK-Vt for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2019 08:14:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5s9j+QmbOasbgR8+aqoPraZvCb+NNKosgOJU7KsJYLE=; b=1EkRwQkskLmAnc0Mjf/CdGX9rNf9GyjzPt+bt/U1sMK6u4hzIkIf+nbIavK2KJih8jRVLrQKb+GlK0CjdUyn4Hnj8Li0cDcmsY7XK65bzlueXWb36AMQ9Frq3M1f0kbL+lPeuPwOL3G1qpoRROZ8WcSJ+4OdO9YgYSs5370ut/g= Received: from MN2PR02MB6029.namprd02.prod.outlook.com (10.255.7.10) by MN2PR02MB5886.namprd02.prod.outlook.com (20.179.86.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.11; Thu, 20 Jun 2019 08:14:02 +0000 Received: from MN2PR02MB6029.namprd02.prod.outlook.com ([fe80::e55a:e2d1:953f:ed3b]) by MN2PR02MB6029.namprd02.prod.outlook.com ([fe80::e55a:e2d1:953f:ed3b%4]) with mapi id 15.20.1987.014; Thu, 20 Jun 2019 08:14:02 +0000 From: Manish Narani To: Ulf Hansson Subject: RE: [PATCH 3/3] mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup Thread-Topic: [PATCH 3/3] mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup Thread-Index: AQHVIDwWKZKZdF95gUaFGq/oqBvspKafu1mAgAADioCAAA8FAIAC5KtwgABVmICAARvKAA== Date: Thu, 20 Jun 2019 08:14:02 +0000 Message-ID: References: <1560247011-26369-1-git-send-email-manish.narani@xilinx.com> <1560247011-26369-4-git-send-email-manish.narani@xilinx.com> <5feac3fb-bef3-b7d1-57d6-81e115e1f555@xilinx.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=MNARANI@xilinx.com; x-originating-ip: [149.199.50.133] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e50c468d-1619-474f-cb56-08d6f5574169 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:MN2PR02MB5886; x-ms-traffictypediagnostic: MN2PR02MB5886: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0074BBE012 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(51444003)(13464003)(189003)(199004)(8936002)(99286004)(6506007)(53546011)(76176011)(66066001)(229853002)(81156014)(81166006)(8676002)(2906002)(486006)(4326008)(71190400001)(26005)(53936002)(86362001)(102836004)(71200400001)(25786009)(478600001)(11346002)(316002)(446003)(186003)(74316002)(64756008)(66556008)(66476007)(66946007)(76116006)(66446008)(73956011)(7736002)(305945005)(14454004)(6246003)(256004)(5660300002)(476003)(55016002)(33656002)(6916009)(9686003)(6116002)(68736007)(72206003)(3846002)(6436002)(54906003)(7696005)(52536014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR02MB5886; H:MN2PR02MB6029.namprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: xilinx.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9xq48dJTl7+Rs7iHxnN6D79arCW+vHV+6fzSVflXJQQjauC1p90arUhPEVmzuu+mubxM1kR7nIwVz67M5mWkCTKxt5hA/bQGfO5a2Gk2YohaiqTcYwoDFWuLmjmWDsgC7IU+VkYtoU5xW+81fmEQoujG8mwbbt8VowPn3D+y0WE0FWzuc7VtTo90FTwFXdTbhE65h4uOvhGBNJohfkf1XyH4A52pB0gfKkafStgXiztIokZZ/5fab20F9Ith8g+e8gxLFlgTyrViAhuAFL97JxqMqxxqHvT0TXr+VoGGB6j6HLqMrSxz2GlUj0ZjTybRJpEE4i3ntaMbStjBTRJ/A4L3n7/6i4zy2Abskr+s3kZxnScQ2ogCeJUyk/Vh+35+zYi9XZ4z7M2xB+5iMOVD6JQQqiCiNUXaQB89EIzvZMc= MIME-Version: 1.0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: e50c468d-1619-474f-cb56-08d6f5574169 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2019 08:14:02.5367 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mnarani@xilinx.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB5886 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_011409_026835_99121E42 X-CRM114-Status: GOOD ( 23.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , DTML , Nava kishore Manne , "linux-mmc@vger.kernel.org" , Adrian Hunter , Linux Kernel Mailing List , Jolly Shah , Rajan Vaja , Rob Herring , Michal Simek , Olof Johansson , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Uffe, > -----Original Message----- > From: Ulf Hansson > Sent: Wednesday, June 19, 2019 7:09 PM > To: Manish Narani > Cc: Michal Simek ; Rob Herring ; > Mark Rutland ; Adrian Hunter > ; Rajan Vaja ; Jolly Shah > ; Nava kishore Manne ; Olof > Johansson ; linux-mmc@vger.kernel.org; DTML > ; Linux Kernel Mailing List kernel@vger.kernel.org>; Linux ARM > Subject: Re: [PATCH 3/3] mmc: sdhci-of-arasan: Add support for ZynqMP > Platform Tap Delays Setup > > On Wed, 19 Jun 2019 at 10:40, Manish Narani wrote: > > > > Hi Uffe, > > > > > > > -----Original Message----- > > > From: Ulf Hansson > > > Sent: Monday, June 17, 2019 5:51 PM > > [...] > > > > > > The "const struct zynqmp_eemi_ops *eemi_ops; should then be moved into > > > a clock provider specific struct, which is assigned when calling > > > sdhci_arasan_register_sdclk. I understand that all the clock data is > > > folded into struct sdhci_arasan_data today, but I think that should be > > > moved into a "sub-struct" for the clock specifics. > > > > > > Moreover, when registering the clock, we should convert from using > > > devm_clk_register() into devm_clk_hw_register() as the first one is > > > now deprecated. > > > > Just a query here: > > When we switch to using devm_clk_hw_register() here, it will register the > clk_hw and return int. > > Is there a way we can get the clk (related to the clk_hw registered) from the > > clock framework? > > I am asking this because we will need that clk pointer while calling > clk_set_phase() function. > > I assume devm_clk_get() should work fine? This clock does not come through ZynqMP Clock framework. We are initializing it in this 'sdhci-of-arasan' driver and getting only the clock name from "clock_output_names" property. So I think devm_clk_get() will not work here for our case. I have gone through the clock framework and I found one function which may be used to create clock from clock hw, that is ' clk_hw_create_clk()' which can be used from our driver, however this needs change in the clock framework as below : --- diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index aa51756..4dc69ff 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3420,6 +3420,7 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, return clk; } +EXPORT_SYMBOL_GPL(clk_hw_create_clk); static int clk_cpy_name(const char **dst_p, const char *src, bool must_exist) { diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h index d8400d6..2319899 100644 --- a/drivers/clk/clk.h +++ b/drivers/clk/clk.h @@ -22,17 +22,9 @@ static inline struct clk_hw *of_clk_get_hw(struct device_node *np, struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id); #ifdef CONFIG_COMMON_CLK -struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, - const char *dev_id, const char *con_id); void __clk_put(struct clk *clk); #else /* All these casts to avoid ifdefs in clkdev... */ -static inline struct clk * -clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id, - const char *con_id) -{ - return (struct clk *)hw; -} static struct clk_hw *__clk_get_hw(struct clk *clk) { return (struct clk_hw *)clk; diff --git a/include/linux/clk.h b/include/linux/clk.h index f689fc5..d3f60fe 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -18,6 +18,7 @@ struct device; struct clk; +struct clk_hw; struct device_node; struct of_phandle_args; @@ -934,4 +935,15 @@ static inline struct clk *of_clk_get_from_provider(struct of_phandle_args *clksp } #endif +#ifdef CONFIG_COMMON_CLK +struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, + const char *dev_id, const char *con_id); +#else +static inline struct clk * +clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id, + const char *con_id) +{ + return (struct clk *)hw; +} +#endif #endif --- This change should help other drivers (outside 'drivers/clk/') as well for getting the clock created from clk_hw. Is this fine to do? Thanks, Manish _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel