Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp807282pxj; Thu, 17 Jun 2021 14:29:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh2mPoWG0ih8vVODp1yIZh/9clPvcGPi2dYr7+dvSXsd8I+tSmpEe14BlF6RN9rKpqTSWb X-Received: by 2002:a17:906:82cf:: with SMTP id a15mr5699180ejy.359.1623965355077; Thu, 17 Jun 2021 14:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623965355; cv=none; d=google.com; s=arc-20160816; b=a9Ahn5kv+ms/gJtGenv9/XMD+pocGF9IUHphG7dl5iNin0dpvxraoShFH7U61HWg1U ahaJdq6TMuirhFaOit0paT/QPh85GXkxVxChCJO+gnxCE9KYuUUihrU3r6Ux+TMdWNQP 0bHaueXT7WKimVvBmus8qYd1k2dsl1jXhIsPEmZyblzYdddCkqPa1vt6djzB2DFDeWuu owC00I+rvGjEiu2jtQ0DS0YWgbFCX5gw/JrHmViIDK1IEvAN0MCZ4nwrl/LqOXqgpV1V iHxBxhQ+H6/+oaijDLqirNfCGWXMIQZf5vk7XsvATah7m9z7pR58GKZ1wLfXqeq4wyXQ DAZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tzl7V45UMyttxYvjiG/RGthazfovWqPJvvGzwmVDhlo=; b=yall1CCjp4yf0zfNT8fZ5q7fcebts6c8nah+cOKE3AczaAtp3tXoaev8NZFBkKjH4R t9KsiaOIVqWnNOibn6f3/BbLntpLkQSrRYwBEhGU3D62wO35AKfKL8CbyuCfZT3sX6HI Oi6vllLyyEdDSVifVpO30/g7TnrNU1AZrSGP/lcRA+6Wi6SHOUqo4AM2lcfdOuQk5IU9 6EN5SLovB6D5dstRro64qf7ZcIsx1N06pNGJBiqNTqtIFk612WUNuEV8gXo7i0ydwF+g Z5c07/0wWQ+nDjgxfeN6BItP94SO1XY1+am7uIMEod7dbwecnapSgocHIe8prqbBQmO6 p4oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nX6c2e29; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz16si188115ejc.342.2021.06.17.14.28.52; Thu, 17 Jun 2021 14:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nX6c2e29; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232845AbhFQTpV (ORCPT + 99 others); Thu, 17 Jun 2021 15:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbhFQTpT (ORCPT ); Thu, 17 Jun 2021 15:45:19 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E5D6C061574 for ; Thu, 17 Jun 2021 12:43:10 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id q15so5769011pgg.12; Thu, 17 Jun 2021 12:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tzl7V45UMyttxYvjiG/RGthazfovWqPJvvGzwmVDhlo=; b=nX6c2e296ygCF1xZbasjThl+i6Ji+L2S4BwRH6Yqu5GAayLfXb/+7noHwKrOBgUhT9 eg2K8QQKUCQtGI30BQjNCvkson1PiNZIydbEt4cn3X0jb3cSPVKu8RtW23Ga/do6cx8l s/i584YLWZFfY2swVuF0bgfLDDTAJDioZtSyV46rFruBtv95EFO/v26qprrx+naHMg6M lFwo2KSs4Ir8cAEpHhXJCuHOCzDuFlXqVr9mSZov9TiqBb9CS8s88/2qQbksE+oNykis D1BoDJgcAA4aFeSifOrKf3dxz8Zh9NnbDwFhbyRFV++z4+dmK99df1yl1LRUFxVEsCG/ UX4g== 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=Tzl7V45UMyttxYvjiG/RGthazfovWqPJvvGzwmVDhlo=; b=tTxoCJhnfZLlTrSuC33s6mWiAHniBMq+srPGWhmLPBaKSH/H17PRD8C8fsRePQ+OSL z4TABYVzx4+K2sGybh3wbGbEuQ3QvbKoDxE/Pzs2Ed9+5PD+1ftDEbrM6PDlV/LUJxz3 3wcDbcQYBBbKCpQ7WISzSrk1saYxDQI2DZan4qiHzjpaXiRxKG9mj/k59kcoeAVhnkUo RSj6eX+2cC4+IJqz7BIrbITjIbSu1sFewgOzAfHTQt2GOzw9vmvN+vWew7Lw/ZY11gtv FbqeeI1A7PLtEGqFykJwSE6oGTzVjyV+Dzt6bXLOKFktNTwxeSwY+fULnJZ1s9DcD/+V F4Lw== X-Gm-Message-State: AOAM533cBpJ04HSd7vbhhi/9wKWPeNRjLQqiIlBjOUalNb0KTtnJjAmn Z9tn7W25NRV8oLRwoO2809s= X-Received: by 2002:aa7:8587:0:b029:2f8:8439:c265 with SMTP id w7-20020aa785870000b02902f88439c265mr1528450pfn.38.1623958989932; Thu, 17 Jun 2021 12:43:09 -0700 (PDT) Received: from archl-c2lm.. ([103.51.75.27]) by smtp.gmail.com with ESMTPSA id z9sm5987187pfa.2.2021.06.17.12.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 12:43:09 -0700 (PDT) From: Anand Moon To: --to=linux-phy@lists.infradead.org, --to=linux-arm-kernel@lists.infradead.org, --to=linux-amlogic@lists.infradead.org, --to=linux-kernel@vger.kernel.org Cc: Anand Moon , Martin Blumenstingl , Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFCv1 2/8] phy: amlogic: meson8b-usb2: Use phy init callback function Date: Thu, 17 Jun 2021 19:41:37 +0000 Message-Id: <20210617194154.2397-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210617194154.2397-1-linux.amoon@gmail.com> References: <20210617194154.2397-1-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reorder the code for bulk clk_enable into .init callback function. Cc: Martin Blumenstingl Signed-off-by: Anand Moon --- drivers/phy/amlogic/phy-meson8b-usb2.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/phy/amlogic/phy-meson8b-usb2.c b/drivers/phy/amlogic/phy-meson8b-usb2.c index 771b73f3b44e..d48171b0b32e 100644 --- a/drivers/phy/amlogic/phy-meson8b-usb2.c +++ b/drivers/phy/amlogic/phy-meson8b-usb2.c @@ -142,10 +142,9 @@ static const struct regmap_config phy_meson8b_usb2_regmap_conf = { .max_register = REG_TUNE, }; -static int phy_meson8b_usb2_power_on(struct phy *phy) +static int phy_meson8b_usb2_init(struct phy *phy) { struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy); - u32 reg; int ret; if (!IS_ERR_OR_NULL(priv->reset)) { @@ -162,6 +161,14 @@ static int phy_meson8b_usb2_power_on(struct phy *phy) return ret; } + return 0; +} + +static int phy_meson8b_usb2_power_on(struct phy *phy) +{ + struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy); + u32 reg; + regmap_update_bits(priv->regmap, REG_CONFIG, REG_CONFIG_CLK_32k_ALTSEL, REG_CONFIG_CLK_32k_ALTSEL); @@ -219,6 +226,7 @@ static int phy_meson8b_usb2_power_off(struct phy *phy) } static const struct phy_ops phy_meson8b_usb2_ops = { + .init = phy_meson8b_usb2_init, .power_on = phy_meson8b_usb2_power_on, .power_off = phy_meson8b_usb2_power_off, .owner = THIS_MODULE, -- 2.31.1