Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1091672pxu; Thu, 17 Dec 2020 01:48:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHYhhDgghpM4+3Bxh3Z/Y/6lqiosq41cKgjQ8Q/fkPjEYtGSWLsFioL/UnJGIez++GpRXh X-Received: by 2002:a17:906:edd2:: with SMTP id sb18mr35618452ejb.114.1608198521772; Thu, 17 Dec 2020 01:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608198521; cv=none; d=google.com; s=arc-20160816; b=E+yPwrUuV4qxEo0WugMFyu4s+tkH04e8eh5NIMYO4Q4GMVtEFgM9BH6gdBLHHHHHut r+XWoIDYtxegchnSasfYyvYCXDIKmPdMZsIFMKep0ZSOIHH0X7n6QKVOab3mfh5j2/yw 6rcQYdrgOgDSlmolyVyQ/CJLydoCAjvJREx1RP1yLbzA9kZNA27qzxYfo9exw6jnQz+4 vm/iWrEsh0VJ81AuKoCGTfY6BHDhkRsAFxcN1CH+jxqLZdF8eAl/LzMf+WTpdwFQfpgp qUco0E2FQOFfumKSBdfe7XAU78THWVQSGqopItRrOcEr6HieayfZxXXdw1rRDxInLFKK WgJA== 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=e/s4t43r0ZZzvJjdsYSRYc856yAM0pnhvAjXcUu6QCA=; b=bHl6kQpZrv4y6mhXQ/hUEYTbz71YqrFrkSo4nlReBJIu5XR9c3LixxiYJuyn6lMAUF hohPyIUcOd0Z2Lt+fPRgVfpPU9JG3ZGPu4d9hTML/2huSlSc1eLjynBbywbdhcE9Ym3K /TTM58C0ghLgD8+N9XCPfpqD3d+1XHUiD9Wjv5KoY2eEEb1Pe9AW97vfwzbMDrglJFrV vLPJqkUtZ+LlH75NiUwjhvXrIvz9SRFUKI7luHbQUArSV3PSVx+pNV4dRCQ9uy8sysk0 QoLHe5mR69vFUCglBNy9m90hUP5eqaIqidJ4iTHLZFHl/pRUWdMkVE9eiLqlY6ZJQQiA pKag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dRENPnv+; 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 z9si2319934ejw.623.2020.12.17.01.48.18; Thu, 17 Dec 2020 01:48:41 -0800 (PST) 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=dRENPnv+; 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 S1728014AbgLQJqL (ORCPT + 99 others); Thu, 17 Dec 2020 04:46:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727668AbgLQJqJ (ORCPT ); Thu, 17 Dec 2020 04:46:09 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12270C061282; Thu, 17 Dec 2020 01:44:52 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id 23so55726009lfg.10; Thu, 17 Dec 2020 01:44:51 -0800 (PST) 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=e/s4t43r0ZZzvJjdsYSRYc856yAM0pnhvAjXcUu6QCA=; b=dRENPnv+ikaVpieNnDU20D7qfSOhPYY+wbnBSMz1+Jc2XW0ELkR52BRzs5TZwiGoRP f+PIbNmLFaIhLBwTQI+kM/uxPS2RIqVaHArU7p5fj22et2dK80Abgs2kthZk382hlvBD Of87MSIvISm17S894HqhCluKHy/fyg7BGjddw0IVCAUf+C5ODERg9CDlQPysANoMfLfe ciick7b85GvxJkU0zj8Aklu+xb6N/ePIFKS8HbBM8btUbgMOvj3d92Wyqe/QNxHOjK2t jS6Eh26U89/uXPNmoDyA8pWNjN4545+At+Qdt5jw75awASfVRYjRnBpvKofQR5tenAOc PrHA== 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=e/s4t43r0ZZzvJjdsYSRYc856yAM0pnhvAjXcUu6QCA=; b=qKBDXB5y8Xs56povMk4DrZovN6cnSNkv4PWo2igTdWh5iqe3Eltwxy9z6zTZIbXVhk uQszFStn9/q2O0LKLshrHyyCy8WZ6MIqxF5PPW5Ove/nssRZ1oCtprYSSqs2/uNl39T8 ji6DoGuRZaYA+rp6hf2a6vOpX5jIF5VXN4se9k+HHBOaV6wxugVxwMje4boEQywhurIO TMRV6y+9gPIRbgqe0o9iCzKiepJkg9aM/UCbQQH8ETJhLm01e2aRmHJStSVcSLFNc9F/ vEfyIFV1ei3KoTcoPs+sqBo3OZJShJtamHGbd8NbdRq+XaebLD8e+glE5evamzGNCV5u uY0g== X-Gm-Message-State: AOAM532zl0qmol0VnWdV5Dn3sBWGwUQmzuMcsVum7lRO1IzQU4dNm6Vh n8/3tn4z3HBDlmrUUUEBA2V24pbIp0w= X-Received: by 2002:ac2:4a65:: with SMTP id q5mr7862348lfp.320.1608198290433; Thu, 17 Dec 2020 01:44:50 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id u19sm613917lji.2.2020.12.17.01.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 01:44:50 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter Chen , Greg Kroah-Hartman , Alan Stern , Felipe Balbi , Matt Merhar , Nicolas Chauvet , Peter Geis , Ion Agorria Cc: linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/8] usb: chipidea: tegra: Rename UDC to USB Date: Thu, 17 Dec 2020 12:40:03 +0300 Message-Id: <20201217094007.19336-5-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217094007.19336-1-digetx@gmail.com> References: <20201217094007.19336-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename all occurrences in the code from "udc" to "usb" and change the Kconfig entry in order to show that this driver supports USB modes other than device-only mode. The follow up patch will add host-mode support and it will be cleaner to perform the renaming separately, i.e. in this patch. Tested-by: Matt Merhar Tested-by: Nicolas Chauvet Tested-by: Peter Geis Tested-by: Ion Agorria Signed-off-by: Dmitry Osipenko --- drivers/usb/chipidea/Kconfig | 2 +- drivers/usb/chipidea/ci_hdrc_tegra.c | 78 ++++++++++++++-------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index 8bafcfc6080d..8685ead6ccc7 100644 --- a/drivers/usb/chipidea/Kconfig +++ b/drivers/usb/chipidea/Kconfig @@ -53,7 +53,7 @@ config USB_CHIPIDEA_GENERIC default USB_CHIPIDEA config USB_CHIPIDEA_TEGRA - tristate "Enable Tegra UDC glue driver" if EMBEDDED + tristate "Enable Tegra USB glue driver" if EMBEDDED depends on OF depends on USB_CHIPIDEA_UDC default USB_CHIPIDEA diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c index 10eaaba2a3f0..d8efa80aa1c2 100644 --- a/drivers/usb/chipidea/ci_hdrc_tegra.c +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c @@ -12,7 +12,7 @@ #include "ci.h" -struct tegra_udc { +struct tegra_usb { struct ci_hdrc_platform_data data; struct platform_device *dev; @@ -20,15 +20,15 @@ struct tegra_udc { struct clk *clk; }; -struct tegra_udc_soc_info { +struct tegra_usb_soc_info { unsigned long flags; }; -static const struct tegra_udc_soc_info tegra_udc_soc_info = { +static const struct tegra_usb_soc_info tegra_udc_soc_info = { .flags = CI_HDRC_REQUIRES_ALIGNED_DMA, }; -static const struct of_device_id tegra_udc_of_match[] = { +static const struct of_device_id tegra_usb_of_match[] = { { .compatible = "nvidia,tegra20-udc", .data = &tegra_udc_soc_info, @@ -45,16 +45,16 @@ static const struct of_device_id tegra_udc_of_match[] = { /* sentinel */ } }; -MODULE_DEVICE_TABLE(of, tegra_udc_of_match); +MODULE_DEVICE_TABLE(of, tegra_usb_of_match); -static int tegra_udc_probe(struct platform_device *pdev) +static int tegra_usb_probe(struct platform_device *pdev) { - const struct tegra_udc_soc_info *soc; - struct tegra_udc *udc; + const struct tegra_usb_soc_info *soc; + struct tegra_usb *usb; int err; - udc = devm_kzalloc(&pdev->dev, sizeof(*udc), GFP_KERNEL); - if (!udc) + usb = devm_kzalloc(&pdev->dev, sizeof(*usb), GFP_KERNEL); + if (!usb) return -ENOMEM; soc = of_device_get_match_data(&pdev->dev); @@ -63,69 +63,69 @@ static int tegra_udc_probe(struct platform_device *pdev) return -EINVAL; } - udc->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); - if (IS_ERR(udc->phy)) { - err = PTR_ERR(udc->phy); + usb->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); + if (IS_ERR(usb->phy)) { + err = PTR_ERR(usb->phy); dev_err(&pdev->dev, "failed to get PHY: %d\n", err); return err; } - udc->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(udc->clk)) { - err = PTR_ERR(udc->clk); + usb->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(usb->clk)) { + err = PTR_ERR(usb->clk); dev_err(&pdev->dev, "failed to get clock: %d\n", err); return err; } - err = clk_prepare_enable(udc->clk); + err = clk_prepare_enable(usb->clk); if (err < 0) { dev_err(&pdev->dev, "failed to enable clock: %d\n", err); return err; } /* setup and register ChipIdea HDRC device */ - udc->data.name = "tegra-udc"; - udc->data.flags = soc->flags; - udc->data.usb_phy = udc->phy; - udc->data.capoffset = DEF_CAPOFFSET; - - udc->dev = ci_hdrc_add_device(&pdev->dev, pdev->resource, - pdev->num_resources, &udc->data); - if (IS_ERR(udc->dev)) { - err = PTR_ERR(udc->dev); + usb->data.name = "tegra-usb"; + usb->data.flags = soc->flags; + usb->data.usb_phy = usb->phy; + usb->data.capoffset = DEF_CAPOFFSET; + + usb->dev = ci_hdrc_add_device(&pdev->dev, pdev->resource, + pdev->num_resources, &usb->data); + if (IS_ERR(usb->dev)) { + err = PTR_ERR(usb->dev); dev_err(&pdev->dev, "failed to add HDRC device: %d\n", err); goto fail_power_off; } - platform_set_drvdata(pdev, udc); + platform_set_drvdata(pdev, usb); return 0; fail_power_off: - clk_disable_unprepare(udc->clk); + clk_disable_unprepare(usb->clk); return err; } -static int tegra_udc_remove(struct platform_device *pdev) +static int tegra_usb_remove(struct platform_device *pdev) { - struct tegra_udc *udc = platform_get_drvdata(pdev); + struct tegra_usb *usb = platform_get_drvdata(pdev); - ci_hdrc_remove_device(udc->dev); - clk_disable_unprepare(udc->clk); + ci_hdrc_remove_device(usb->dev); + clk_disable_unprepare(usb->clk); return 0; } -static struct platform_driver tegra_udc_driver = { +static struct platform_driver tegra_usb_driver = { .driver = { - .name = "tegra-udc", - .of_match_table = tegra_udc_of_match, + .name = "tegra-usb", + .of_match_table = tegra_usb_of_match, }, - .probe = tegra_udc_probe, - .remove = tegra_udc_remove, + .probe = tegra_usb_probe, + .remove = tegra_usb_remove, }; -module_platform_driver(tegra_udc_driver); +module_platform_driver(tegra_usb_driver); -MODULE_DESCRIPTION("NVIDIA Tegra USB device mode driver"); +MODULE_DESCRIPTION("NVIDIA Tegra USB driver"); MODULE_AUTHOR("Thierry Reding "); MODULE_LICENSE("GPL v2"); -- 2.29.2