From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97F80C282DE for ; Wed, 5 Jun 2019 06:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7083D2083E for ; Wed, 5 Jun 2019 06:34:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b0zeeCKt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbfFEGeY (ORCPT ); Wed, 5 Jun 2019 02:34:24 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39203 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbfFEGeY (ORCPT ); Wed, 5 Jun 2019 02:34:24 -0400 Received: by mail-pg1-f195.google.com with SMTP id 196so11838506pgc.6 for ; Tue, 04 Jun 2019 23:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MDnhT69i4+3igVNMGRO0Olac0iYlmd7+e9rYlDGKlMQ=; b=b0zeeCKtZnHGuRksL/MviXPn9ETjzaS+XVRjInqPSn3MmRYG1h2xHNGblAhI+hwSgW 27ZfCX1Gruevo4QQpULxZqIYe5C+Zgz/G1c55aHrsLCR1l4SuO6Zl2rqHMz/HhFh9Z9Q QxMw+vu3nl1p1nftk6+cafNIaL0Qc2EIwNB2KxZMrgxWW1jAV1G6l5NzkuLcxcGZCAGE 4WVEq1fL81w0hRjY+jxAYMV+Z8z5ugYVoDpGILoXwPvhIzQqgv5xTEOy7KxvxfLB+J1S ODzal5jdUT/lQkiRAr2R384iYKbide9/PJ3H67SHJn10yNgF/PbuaKGoJUtwsqQIGR2B g+0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MDnhT69i4+3igVNMGRO0Olac0iYlmd7+e9rYlDGKlMQ=; b=kEG3AE9haO+6cE2DnEiFZmEUjr9pPS8LY/wSWAzcBSCIEjA/R8Z2xdWs4BV9+gpK0N QS9q3izWGJx3WHAYKdgMlNwCtkXW9dIs6OxwXj40KchHUkS9kbsoGTGqttuv8kuH7Omc 6RzdXrYm0DOgYgsVW++xP9EfQdtBLrT+H5wlsVOperpZP8yTou/BM+yYbhrDJElhJqkd S7LF6ECHYc0RxtPb3pY+FVn1oSzPtMvkQZvDCj5R3Ie+QCgwEg7WdfrAdVWMrYiyn+Pm 9nJ4maLFeHFpvwsQQj7Yp6XV7Y2lOCxwCi678D58pCPA8Kldb4Km7Gb+Od6LK3NSadom TjZA== X-Gm-Message-State: APjAAAWF23fZpN/47ou64rdsJoEi7j18KsHRU2ex7WjUoCBc+F3zkEZR jKAF5SBSWGSV5V1jGuVEP/ZJvQ== X-Google-Smtp-Source: APXvYqy3bNsHWjS/PwRCl4JZk2sWXQhzg3FwJWCnisZBOEnbpp0qgkByrv0MfZW4pI4x2RdDmUP25g== X-Received: by 2002:a63:f146:: with SMTP id o6mr2228929pgk.179.1559716463205; Tue, 04 Jun 2019 23:34:23 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k8sm8144854pfk.177.2019.06.04.23.34.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 23:34:22 -0700 (PDT) Date: Tue, 4 Jun 2019 23:35:07 -0700 From: Bjorn Andersson To: Lee Jones Cc: alokc@codeaurora.org, kramasub@codeaurora.org, andy.gross@linaro.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, linus.walleij@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jlhugo@gmail.com, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 6/8] usb: dwc3: qcom: Add support for booting with ACPI Message-ID: <20190605063507.GM22737@tuxbook-pro> References: <20190604104455.8877-1-lee.jones@linaro.org> <20190604104455.8877-6-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190604104455.8877-6-lee.jones@linaro.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Tue 04 Jun 03:44 PDT 2019, Lee Jones wrote: > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c [..] > @@ -373,7 +416,7 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) > > qcom->num_clocks = count; > > - if (!count) > + if (!count || ACPI_HANDLE(dev)) > return 0; Afaict you call this with count = of_count_phandle_with_args(), which should be 0. But why not skip calling this at all? > > qcom->clks = devm_kcalloc(dev, qcom->num_clocks, > @@ -409,12 +452,28 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) > return 0; > } > > +static const struct dwc3_acpi_pdata sdm845_acpi_pdata = { > + .qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET, > + .qscratch_base_size = SDM845_QSCRATCH_SIZE, > + .dwc3_core_base_size = SDM845_DWC3_CORE_SIZE, > + .hs_phy_irq_index = 1, > + .dp_hs_phy_irq_index = 4, > + .dm_hs_phy_irq_index = 3, > + .ss_phy_irq_index = 2 > +}; > + > +static const struct acpi_device_id dwc3_qcom_acpi_match[] = { > + { "QCOM2430", (unsigned long)&sdm845_acpi_pdata }, > + { }, > +}; > +MODULE_DEVICE_TABLE(acpi, dwc3_qcom_acpi_match); Analog to of_device_get_match_data() there seems to be a acpi_device_get_match_data(), if you use this you should be able to have you acpi_device_id array next to the of_device_id. > + > static int dwc3_qcom_probe(struct platform_device *pdev) It seems that all that's left unconditional on ACPI_HANDLE() in this function are the optional pieces and the tail. Wouldn't it be cleaner to split it out in different functions? Regards, Bjorn From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AE03C282DE for ; Wed, 5 Jun 2019 06:34:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0129F2083E for ; Wed, 5 Jun 2019 06:34:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ENuclNZL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b0zeeCKt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0129F2083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9ZbeD0wJsbK6+WFPDdVqjq+WYDIGegenNO42IUkhxdQ=; b=ENuclNZLs0qgfO 8ZIOUs80OvW/O0XNl+TWodYacry1kRX49LiuZzslPUN5MufzjDVgyJJXTwVSFhzJSofBc0ztnE9Zh rnGC19TqTLJWB1ihihsfUFA2Z0Ltbt1iDWDjjSbdYqyZhnwbmTjD0ieJGBvwTGU9XJa0kQp3dIq7N krxh/3YT4lfZBOAmwE/N4u1flRc+JQ0U5sT6C8FIDZOMQqNiL6zKpEiHNk0IcSOUlAF0cNkx6nuLd juGdQu1aXeH+EHvfSt667jeU0prEEgtCCEmGy9RoqZuu5HZKXAsWrX2aMFufib5SomxqoLCvY+hqm /lgCWcOU/R3EsZKxsX2w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYPVF-0005kq-QU; Wed, 05 Jun 2019 06:34:29 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYPVA-0005cP-7l for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2019 06:34:28 +0000 Received: by mail-pg1-x544.google.com with SMTP id v9so11811020pgr.13 for ; Tue, 04 Jun 2019 23:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MDnhT69i4+3igVNMGRO0Olac0iYlmd7+e9rYlDGKlMQ=; b=b0zeeCKtZnHGuRksL/MviXPn9ETjzaS+XVRjInqPSn3MmRYG1h2xHNGblAhI+hwSgW 27ZfCX1Gruevo4QQpULxZqIYe5C+Zgz/G1c55aHrsLCR1l4SuO6Zl2rqHMz/HhFh9Z9Q QxMw+vu3nl1p1nftk6+cafNIaL0Qc2EIwNB2KxZMrgxWW1jAV1G6l5NzkuLcxcGZCAGE 4WVEq1fL81w0hRjY+jxAYMV+Z8z5ugYVoDpGILoXwPvhIzQqgv5xTEOy7KxvxfLB+J1S ODzal5jdUT/lQkiRAr2R384iYKbide9/PJ3H67SHJn10yNgF/PbuaKGoJUtwsqQIGR2B g+0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MDnhT69i4+3igVNMGRO0Olac0iYlmd7+e9rYlDGKlMQ=; b=QUeB16ST388x8yf6nRzQyhHnUswO5Q7cikGVMyDHEHsqVs3hjDJVwu1PqY3wJgrAkG umkGyqm/rP3t3MK1GxcnQ5889eaOWG0atz8FyKANFkWfp5+PsjF1wpd7qOdy80le9x6D qUw73IDhhPR0NnB5A4Boz0i1qsaec4A+ABAZvCo1LiGXL4bHmHfRu1GJbx7/cimija+d q/SZhdGh3ajglaIKWgCAxcfGeNb4Qa42lk9Pe+I89Ktyfis6HzCuuAbEHwobvt44RBkl 1rv2pockNxTZc+jKHuf5gcBk+oX77gVZxRT8sbQuq3tHOuMKc5aN6wHBr8D1G+gbE95l 6Whg== X-Gm-Message-State: APjAAAXgbRVPFTCNyTZ8g4POqhEBlTBVZthE8dw8kQDrLBUxebLlfiDQ FPNrGoEB6pVLyRer5K4cc7glSA== X-Google-Smtp-Source: APXvYqy3bNsHWjS/PwRCl4JZk2sWXQhzg3FwJWCnisZBOEnbpp0qgkByrv0MfZW4pI4x2RdDmUP25g== X-Received: by 2002:a63:f146:: with SMTP id o6mr2228929pgk.179.1559716463205; Tue, 04 Jun 2019 23:34:23 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k8sm8144854pfk.177.2019.06.04.23.34.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 23:34:22 -0700 (PDT) Date: Tue, 4 Jun 2019 23:35:07 -0700 From: Bjorn Andersson To: Lee Jones Subject: Re: [PATCH 6/8] usb: dwc3: qcom: Add support for booting with ACPI Message-ID: <20190605063507.GM22737@tuxbook-pro> References: <20190604104455.8877-1-lee.jones@linaro.org> <20190604104455.8877-6-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190604104455.8877-6-lee.jones@linaro.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_233425_164335_33CA4B6C X-CRM114-Status: GOOD ( 14.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: balbi@kernel.org, wsa+renesas@sang-engineering.com, gregkh@linuxfoundation.org, linus.walleij@linaro.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, david.brown@linaro.org, alokc@codeaurora.org, kramasub@codeaurora.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, andy.gross@linaro.org, jlhugo@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue 04 Jun 03:44 PDT 2019, Lee Jones wrote: > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c [..] > @@ -373,7 +416,7 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) > > qcom->num_clocks = count; > > - if (!count) > + if (!count || ACPI_HANDLE(dev)) > return 0; Afaict you call this with count = of_count_phandle_with_args(), which should be 0. But why not skip calling this at all? > > qcom->clks = devm_kcalloc(dev, qcom->num_clocks, > @@ -409,12 +452,28 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) > return 0; > } > > +static const struct dwc3_acpi_pdata sdm845_acpi_pdata = { > + .qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET, > + .qscratch_base_size = SDM845_QSCRATCH_SIZE, > + .dwc3_core_base_size = SDM845_DWC3_CORE_SIZE, > + .hs_phy_irq_index = 1, > + .dp_hs_phy_irq_index = 4, > + .dm_hs_phy_irq_index = 3, > + .ss_phy_irq_index = 2 > +}; > + > +static const struct acpi_device_id dwc3_qcom_acpi_match[] = { > + { "QCOM2430", (unsigned long)&sdm845_acpi_pdata }, > + { }, > +}; > +MODULE_DEVICE_TABLE(acpi, dwc3_qcom_acpi_match); Analog to of_device_get_match_data() there seems to be a acpi_device_get_match_data(), if you use this you should be able to have you acpi_device_id array next to the of_device_id. > + > static int dwc3_qcom_probe(struct platform_device *pdev) It seems that all that's left unconditional on ACPI_HANDLE() in this function are the optional pieces and the tail. Wouldn't it be cleaner to split it out in different functions? Regards, Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel