From patchwork Sun Mar 24 15:46:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 1063240 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="DwnfGA0Y"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44S1x41WN1z9sSV for ; Mon, 25 Mar 2019 02:47:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D551DC21E4E; Sun, 24 Mar 2019 15:47:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7DDA9C21E34; Sun, 24 Mar 2019 15:46:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 699C3C21DF9; Sun, 24 Mar 2019 15:46:58 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by lists.denx.de (Postfix) with ESMTPS id 0ED7CC21BE5 for ; Sun, 24 Mar 2019 15:46:57 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id y197so6539245wmd.0 for ; Sun, 24 Mar 2019 08:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ccfOm8cd1JtKBQOF0TzrDLiJIVXZU72ptFjNl/0K75Y=; b=DwnfGA0YutdLElxJ6rNyvD2IgR6FNRsjg85Euxicwr4w2dttPTvyF/2e4d8hG5GUkY njm9N4w8OpK3mivBrx6nyuddsAbVWyZww3VB0E+kkISt0yKSfbnBklj2RlJG4BG5JTYk GShHl+q2hVA0wRcIMBxTj+M9H8bkBgXI7LlztFm2IqMf2OfyVt1aCiKQWsyelHVOoDYJ pItjPqoTkyJcyY1lJroRucxExLkiz5ZN4n8IkE0pHo/D70BmH9JyhI8gEZfprEZ74wT4 QWfUxVYFOVjN24jTMQu6iZWAFQ7tgMHOfYN9BgazvTtLSWcqegM4hgs7Gyjf/oMJCkWZ ObEg== 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=ccfOm8cd1JtKBQOF0TzrDLiJIVXZU72ptFjNl/0K75Y=; b=PAyOilfuNgV4IoSeg1mOBddc7K9VElPsZueDuWzj7AKdRsb9s4AbNKp6DJ7g1wELgz +rw0TD8hZtBpkuTDFlPMTYDjW5L+xrPFrBfru7GnWK1vrp8IrXeeBV1ja4xryECwpn4A xLlMnKcfRGh9Yktxg89VvNfhiXIr7w0RZItm64cwtw7WNQxMZq/cF+upOUnTrAaPvHIo ObA2KuKS9B/QjCrGi0VsqgjOioQhalmWBKKU+bOV1LFg9Fwrnshvx9aFc8tuHD+9tveH T9pewbAduXp25GH5hKyJMT+pq5QCGFqtwsh81eFW6SYn7yQIukX7it5KSNy135k7y4+C y12Q== X-Gm-Message-State: APjAAAXKYClVrfjQ4c2U0G7iDzZ+HI2gjsWQr0glclqFQ/OPXilyCkDy PVDhmePUejzVqOJGUUB5lMczfuGZEQA3ZJRe X-Google-Smtp-Source: APXvYqwKTbEtsomau2varesohgZhrb0TAoYGtM+/7PsNjIT6Clxc3O1QNCvmM7Q5Wqt4/oGlmF8mOw== X-Received: by 2002:a1c:7e82:: with SMTP id z124mr2774354wmc.43.1553442416435; Sun, 24 Mar 2019 08:46:56 -0700 (PDT) Received: from localhost.localdomain (cag06-8-78-203-165-84.fbx.proxad.net. [78.203.165.84]) by smtp.gmail.com with ESMTPSA id k11sm28917683wmk.45.2019.03.24.08.46.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 08:46:55 -0700 (PDT) From: Fabien Parent To: u-boot@lists.denx.de Date: Sun, 24 Mar 2019 16:46:32 +0100 Message-Id: <20190324154638.29800-2-fparent@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190324154638.29800-1-fparent@baylibre.com> References: <20190324154638.29800-1-fparent@baylibre.com> MIME-Version: 1.0 Cc: trini@konsulko.com, ryder.lee@mediatek.com, stephane.leprovost@mediatek.com, GSS_MTK_Uboot_upstream@mediatek.com Subject: [U-Boot] [PATCH v3 1/7] mmc: mtk-sd: add source_cg clock support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Some MediaTek SoC need an additional clock "source_cg". Enable this new clock. We reuse the same clock name as in the kernel. Signed-off-by: Fabien Parent Acked-by: Ryder Lee --- v3: * No change v2: * Get rid of variable has_src_clk_cg --- drivers/mmc/mtk-sd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index d3f0778368..eed98b769c 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -247,6 +247,7 @@ struct msdc_host { struct msdc_compatible *dev_comp; struct clk src_clk; /* for SD/MMC bus clock */ + struct clk src_clk_cg; /* optional, MSDC source clock control gate */ struct clk h_clk; /* MSDC core clock */ u32 src_clk_freq; /* source clock */ @@ -1269,6 +1270,8 @@ static void msdc_ungate_clock(struct msdc_host *host) { clk_enable(&host->src_clk); clk_enable(&host->h_clk); + if (host->src_clk_cg.dev) + clk_enable(&host->src_clk_cg); } static int msdc_drv_probe(struct udevice *dev) @@ -1332,6 +1335,8 @@ static int msdc_ofdata_to_platdata(struct udevice *dev) if (ret < 0) return ret; + clk_get_by_name(dev, "source_cg", &host->src_clk_cg); /* optional */ + #if IS_ENABLED(DM_GPIO) gpio_request_by_name(dev, "wp-gpios", 0, &host->gpio_wp, GPIOD_IS_IN); gpio_request_by_name(dev, "cd-gpios", 0, &host->gpio_cd, GPIOD_IS_IN);