From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751001AbdBFHJ0 (ORCPT ); Mon, 6 Feb 2017 02:09:26 -0500 Received: from mailgw02.mediatek.com ([218.249.47.111]:32814 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750924AbdBFHJY (ORCPT ); Mon, 6 Feb 2017 02:09:24 -0500 Message-ID: <1486364621.3750.4.camel@mhfsdcap03> Subject: Re: [PATCH 2/6] usb: mtu3: add reference clock From: Chunfeng Yun To: Matthias Brugger CC: Mathias Nyman , Felipe Balbi , Greg Kroah-Hartman , Rob Herring , "Mark Rutland" , Ian Campbell , , , , , Date: Mon, 6 Feb 2017 15:03:41 +0800 In-Reply-To: <60a7c32a-b7d9-5856-2a61-3670e266bea3@gmail.com> References: <1484719707-12107-1-git-send-email-chunfeng.yun@mediatek.com> <1484719707-12107-2-git-send-email-chunfeng.yun@mediatek.com> <7fc9de99-4bef-ddf2-c5fe-985f8d2348d2@gmail.com> <1484878825.10292.58.camel@mhfsdcap03> <60a7c32a-b7d9-5856-2a61-3670e266bea3@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-01-25 at 00:23 +0100, Matthias Brugger wrote: > > On 01/20/2017 03:20 AM, Chunfeng Yun wrote: > > On Thu, 2017-01-19 at 13:22 +0100, Matthias Brugger wrote: > >> > >> On 18/01/17 07:08, Chunfeng Yun wrote: > >>> usually, the reference clock comes from 26M oscillator directly, > >>> but some SoCs are not, add it for compatibility. > >>> > >>> Signed-off-by: Chunfeng Yun > >>> --- > >>> drivers/usb/mtu3/mtu3.h | 1 + > >>> drivers/usb/mtu3/mtu3_plat.c | 21 +++++++++++++++++++-- > >>> 2 files changed, 20 insertions(+), 2 deletions(-) > > [...] > >>> @@ -154,6 +162,7 @@ static int ssusb_rscs_init(struct ssusb_mtk *ssusb) > >>> static void ssusb_rscs_exit(struct ssusb_mtk *ssusb) > >>> { > >>> clk_disable_unprepare(ssusb->sys_clk); > >>> + clk_disable_unprepare(ssusb->ref_clk); > >>> regulator_disable(ssusb->vusb33); > >>> ssusb_phy_power_off(ssusb); > >>> ssusb_phy_exit(ssusb); > >>> @@ -216,6 +225,12 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) > >>> return PTR_ERR(ssusb->sys_clk); > >>> } > >>> > >>> + ssusb->ref_clk = devm_clk_get(dev, "ref_ck"); > >>> + if (IS_ERR(ssusb->ref_clk)) { > >>> + dev_err(dev, "failed to get ref clock\n"); > >>> + return PTR_ERR(ssusb->ref_clk); > >>> + } > >>> + > >> > >> That would break older dts bindings, right? > > Yes, So I send a new patch for the related dts. Maybe it's not a > > problem, only one dts file need be updated currently. > > > >> ref_ck must be optional for the code. > > I tend to make it be optional for the dts, but not for the code. > > There are some "fixed-clock" which can be treated as dummy ones, and if > > a clock is really optional, we can use one fixed-clock in dts, and keep > > the code simple. > > In fact, the reference clock is essential for usb controller. > > Well the thing is that there are devices in the field with an older dtb > which would break on a newer kernel. That's why we need to make it work > with the old dtb in the code as well. > Happy Chinese New Year! Ok, I will make it optional. Thanks and sorry for later reply. > Regards, > Matthias > > >> > >> Regards, > >> Matthias > > > >