Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2751714ybd; Thu, 27 Jun 2019 19:03:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx5me1SHXODuB5a2enPf2yEooSA+6MgO11h7UuJUMaayff3YhyjO7LYpkjKtl0ACHS19Ip X-Received: by 2002:a17:90a:2023:: with SMTP id n32mr9528189pjc.3.1561687403901; Thu, 27 Jun 2019 19:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561687403; cv=none; d=google.com; s=arc-20160816; b=1KEwRZxcmDymsL/pXja/gf3LXtD5k4slTO0UPtCL8Z4rBAW5HOuCLjaOIa6irEbUrj KlPcVe20cgrP0Qj7GdTon9PqRVJvWcXni4+y8F4o2mspjIwZKCn3pFrfD0wPzB9bewDc NL3+xlZpndrgEQO4XbISBLHprDnneVJTYtUts1JSC0kRBtJI77jBK2EvrzuoxqUMc3aA eZJnYoAdcLJZWRFhlDnfspTloeFKiBrbUt4xjxgLKOFeMdEUnCqXlRcqHf8mNGPxoTXX mPH+AOtUjbu7xz3MKwHuo7efxhH/8BZYHYWqLviUdk7wuejPntvI33tZ441sONuaqs55 Vang== 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:date:cc:to:from:subject:message-id; bh=VKJm8lgKuHlDEVol3wRgidl0XZja93LsnslBVw27wMU=; b=hV+NBJkWckSf0oN2qbzmGr5YvF4IHmEUkTDmyHgSCMW7Pn8T7e3q6zpSc/ZcAll7B7 Kbu+ByCurigm90XaLcCFnuN82DALS2hXjzVyJMQvsnC5CbNzejcflBD+vhR/J0IPs4u+ AQlmJeCWLII2qJU6OHvMW9i5cKoZIqrqwK69x1XbDK64c2oJPTxF6YiDYDbbDKxLjN3R CCFWqZKbsS6Hzsv7c4Ckz7E2Lmj3wO+2fHc+sc3pe/DXwgT7AMaGikWPwsh5RwXjmZrX TyloleMuTud0kVdZaEvv66o3/nplIHFH+fsWFEUQ6m8PJNJY+BRYhh3m/zGyI+y9K2O8 XFxg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj12si609627plb.378.2019.06.27.19.03.07; Thu, 27 Jun 2019 19:03:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfF1CDC (ORCPT + 99 others); Thu, 27 Jun 2019 22:03:02 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:36781 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725770AbfF1CDC (ORCPT ); Thu, 27 Jun 2019 22:03:02 -0400 X-UUID: c2ece93bab67479591380ff8da29426a-20190628 X-UUID: c2ece93bab67479591380ff8da29426a-20190628 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1235482751; Fri, 28 Jun 2019 10:02:55 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 28 Jun 2019 10:02:52 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 28 Jun 2019 10:02:51 +0800 Message-ID: <1561687371.29330.11.camel@mtksdaap41> Subject: Re: [v5 2/3] drm/mediatek: separate mipi_tx to different file From: CK Hu To: Jitao Shi CC: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , , David Airlie , Matthias Brugger , "Thierry Reding" , Ajay Kumar , "Inki Dae" , Rahul Sharma , "Sean Paul" , Vincent Palatin , "Andy Yan" , Philipp Zabel , Russell King , , , , , , , Sascha Hauer , , , , , Date: Fri, 28 Jun 2019 10:02:51 +0800 In-Reply-To: <20190627025901.28418-3-jitao.shi@mediatek.com> References: <20190627025901.28418-1-jitao.shi@mediatek.com> <20190627025901.28418-3-jitao.shi@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-Product-Ver: SMEX-12.5.0.1684-8.5.1010-24722.000 X-TM-AS-Result: No-10.247700-8.000000-10 X-TMASE-MatchedRID: L8tZF6zWW2rmLzc6AOD8DfHkpkyUphL9APiR4btCEeZJK2eJhY02w+Z5 Gn23AeDZBCJmNbrkQwEB1c8PTXnqofI1YbpS1+avgmAd4Attpn/YuVu0X/rOkBpX1zEL4nq3zod Om+zp8Klvb8FTrUVVI7tTg4w4u0QPVdgv/fqHkl7obINHZkH5xqgmQ5FI9tvDDlLOAk1ICsupTt npKpQyOnuvCtBi52L250DWRAwkrYTtmWsUlPYSbZXIRfiL5JZTGEfoClqBl86bKItl61J/ycnjL TA/UDoAoTCA5Efyn8CNo+PRbWqfRDsAVzN+Ov/sHFf9y5qyR15CjO3g32i4QW3xAkDtY0KKM0RM yIBWAJybBCcU0pWFpQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.247700-8.000000 X-TMASE-Version: SMEX-12.5.0.1684-8.5.1010-24722.000 X-TM-SNTS-SMTP: 5329DA286C4A6660442E20F3A9F915E02E66B2517D31A07EE8877C820797CA0F2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jitao: On Thu, 2019-06-27 at 10:59 +0800, Jitao Shi wrote: > Different IC has different mipi_tx setting of dsi. > This patch separates the mipi_tx hardware relate part for mt8173. > > Signed-off-by: Jitao Shi > Reviewed-by: CK Hu > --- > drivers/gpu/drm/mediatek/Makefile | 1 + > drivers/gpu/drm/mediatek/mtk_mipi_tx.c | 343 ++---------------- > drivers/gpu/drm/mediatek/mtk_mipi_tx.h | 49 +++ > drivers/gpu/drm/mediatek/mtk_mt8173_mipi_tx.c | 289 +++++++++++++++ > 4 files changed, 363 insertions(+), 319 deletions(-) > create mode 100644 drivers/gpu/drm/mediatek/mtk_mipi_tx.h > create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8173_mipi_tx.c > [snip] > @@ -391,10 +101,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct mtk_mipi_tx *mipi_tx; > struct resource *mem; > - struct clk *ref_clk; > const char *ref_clk_name; > struct clk_init_data clk_init = { > - .ops = &mtk_mipi_tx_pll_ops, > .num_parents = 1, > .parent_names = (const char * const *)&ref_clk_name, > .flags = CLK_SET_RATE_GATE, > @@ -408,6 +116,7 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) > return -ENOMEM; > > mipi_tx->driver_data = of_device_get_match_data(dev); > + > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > mipi_tx->regs = devm_ioremap_resource(dev, mem); > if (IS_ERR(mipi_tx->regs)) { > @@ -416,13 +125,14 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) > return ret; > } > > - ref_clk = devm_clk_get(dev, NULL); > - if (IS_ERR(ref_clk)) { > - ret = PTR_ERR(ref_clk); > + mipi_tx->ref_clk = devm_clk_get(dev, NULL); I think you need not to keep ref_clk in driver private data because you would not use it any more. Regards, CK > + if (IS_ERR(mipi_tx->ref_clk)) { > + ret = PTR_ERR(mipi_tx->ref_clk); > dev_err(dev, "Failed to get reference clock: %d\n", ret); > return ret; > } > - ref_clk_name = __clk_get_name(ref_clk); > + > + ref_clk_name = __clk_get_name(mipi_tx->ref_clk); > > ret = of_property_read_string(dev->of_node, "clock-output-names", > &clk_init.name); > @@ -431,6 +141,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) > return ret; > } > > + clk_init.ops = mipi_tx->driver_data->mipi_tx_clk_ops; > + > mipi_tx->pll_hw.init = &clk_init; > mipi_tx->pll = devm_clk_register(dev, &mipi_tx->pll_hw); > if (IS_ERR(mipi_tx->pll)) { > @@ -465,20 +177,12 @@ static int mtk_mipi_tx_remove(struct platform_device *pdev) > return 0; > } >