Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp990497pxa; Sat, 22 Aug 2020 07:09:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXgXAQeDX7CXnGEu5WEIhIzhrUTSOUUwG2DqkNA/r6tqzV8tOQiEo4VSOPAcnpYjqbhN7m X-Received: by 2002:a05:6402:17a2:: with SMTP id j2mr2540054edy.79.1598105378056; Sat, 22 Aug 2020 07:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598105378; cv=none; d=google.com; s=arc-20160816; b=Z3l1Dir15FxiHCPX7JN+jdoj/n+1acoiWqQd+Z5XDoumNtOiA8o04ZUk+/WTQw/AZ9 ZaP8PQen53gm9LNZVa8o5ayUruBwtnk0PpQqMGmpkJCDJyZWfgIseIU7+N/kAjTTWzCA bfBRJ/vfdxTEoGR97dQfOmcmp0JFp7dahAvuKo9tOiXuSWuYWXVEgkULfAO+Z5lyUaU1 u3uWYgGzl5Go9rqjD+38WKbN24MNwxUcjLbGNEqlloIxEpRyqbozUKY5bZHZl+a1D4h6 K5QnoNlO3ujofo0rLuwyJDf0Nwf1TYuQh/zV7sZBYKu/PYBN2LiSTl7GG/kjBCRg8o6g aa0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date :thread-index:mime-version:in-reply-to:references:from :dkim-signature; bh=Zfgk8dyvwVv5/BR9Ue01YxFjydKGHjpfZPQCE6N5dCY=; b=BRApec4Vtip6jfRL58jB/63w4rEXF3Ls8LTXPD4kePzz56iL2izM8gm6EgJip2fIxV xOYsKBCPxl8biyDCoU7a/MvGYgbt/VfOxD1bmZfiMe6QjNObkDWkYTRxzgVf5tBJok96 yzwvk/z5oEm9HnGHwXPYxhzNJviXUbpqPhleZrt0A0CnsRnbABSyG7ZjCxgRrpnw7/05 IPalRIn0lrLfhzdWmChCU2d6GDSU0ie0OwdoOlxzLv9oRdF+NwCGynp66eM20C96/PpG hlQ1ILc3C3MHKw60AmDPI5lZo2Eh08JhpRF7xGXIDBy0LpDdC6W30pD/ZZd/QtPzlB6t qxCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@puresoftware-com.20150623.gappssmtp.com header.s=20150623 header.b=j22PzrSX; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=puresoftware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb5si3187019ejb.206.2020.08.22.07.09.14; Sat, 22 Aug 2020 07:09:38 -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=fail header.i=@puresoftware-com.20150623.gappssmtp.com header.s=20150623 header.b=j22PzrSX; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=puresoftware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728067AbgHVOHe (ORCPT + 99 others); Sat, 22 Aug 2020 10:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbgHVOHc (ORCPT ); Sat, 22 Aug 2020 10:07:32 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C6FDC061573 for ; Sat, 22 Aug 2020 07:07:31 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id i26so3919928edv.4 for ; Sat, 22 Aug 2020 07:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=puresoftware-com.20150623.gappssmtp.com; s=20150623; h=return-receipt-to:from:references:in-reply-to:mime-version :thread-index:disposition-notification-to:date:message-id:subject:to :cc; bh=Zfgk8dyvwVv5/BR9Ue01YxFjydKGHjpfZPQCE6N5dCY=; b=j22PzrSXJp7S9KTi4ai9+3RJnFl3jhWm5OLVtMbJt84BPAMXR7zE+e7KtUoQcIHuo/ rok6cCAq/8Fcvjo3T0USmhKgJQ2JMM0AbuXuu0TDNn5GknrmE/fO0WuVSL3o7LCwfwbw sXQjsu2oHLRCGPscTa+rewdcWlLSZVAo72qXeIWCMAR+WAne2IAPmiWI6Henwq2kTKSY Qx33SS6iDCE08N2sAR8wzvTikBmNDMC2VSyC2W+SSC6ZnqtfLsYPCgf7EzSJmOXwOVsn jxj1TXwD7saodxUJyXPE8ivHjFNbzPZJ7jt+se0lU/72N+15nmKEnxXTA6NXvI5CyQxv Iv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:return-receipt-to:from:references:in-reply-to :mime-version:thread-index:disposition-notification-to:date :message-id:subject:to:cc; bh=Zfgk8dyvwVv5/BR9Ue01YxFjydKGHjpfZPQCE6N5dCY=; b=m2y3SqSlD3xLPfQverKI6drpFNi32RYjKEdNSoGIEGXwFh6ngHHHTmzWF0xgxB6wJ2 6hJ7F63pGqXq3M9G31/BAACvg9J1RRTjysdadjnya2Dd+gHq/eQDLiRySQm4AIYTZlxR BfFzJJxRR+bfAa5lOKS4lc+ZCU9Sn2kXEvpaTzBSoelgxtfYtvo+I7iShv/AEHEBdrNr RshBDVKod52snA/30V1zIIpCO5tnrqCqqNPOjEi89y5RP6oLcZYk6g5CuH94w1uJdujX R/pi9nreveylFZlq1IGahZb1fiCJCUtFHGDfKsk3Y8oWhh7jj2HXU8Awr+eKEr9cRMyP 4GFg== X-Gm-Message-State: AOAM530oR4RXUoF9mMejw1s4hnnZB+kqqnE/J/cBEFI3ats/1e0ArmiA JMrmZayfzRZQ1zGEojet5lwXrx9T/2RxTHLoUYjNBQ== X-Received: by 2002:a05:6402:1d17:: with SMTP id dg23mr7429245edb.198.1598105246846; Sat, 22 Aug 2020 07:07:26 -0700 (PDT) From: Kuldip Dwivedi References: <20200821131029.11440-1-kuldip.dwivedi@puresoftware.com> <20200821140718.GH4870@sirena.org.uk> In-Reply-To: <20200821140718.GH4870@sirena.org.uk> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQF7/ycK6cTpjLXBKD+ruXNZEs6GEAE4wSq+qe9WNoA= Date: Sat, 22 Aug 2020 19:37:25 +0530 Message-ID: Subject: RE: [PATCH] spi: spi-fsl-dspi: Add ACPI support To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Qiang Zhao , Pankaj Bansal , Varun Sethi , Tanveer Alam Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Mark Brown > Sent: Friday, August 21, 2020 7:37 PM > To: kuldip dwivedi > Cc: linux-spi@vger.kernel.org; linux-kernel@vger.kernel.org; Qiang Zhao > ; Pankaj Bansal ; Varun Sethi > ; tanveer > Subject: Re: [PATCH] spi: spi-fsl-dspi: Add ACPI support > > On Fri, Aug 21, 2020 at 06:40:29PM +0530, kuldip dwivedi wrote: > > > +static const struct acpi_device_id fsl_dspi_acpi_ids[] = { > > + { "NXP0005", .driver_data = (kernel_ulong_t)&devtype_data[LS2085A], }, > > + {}, > > +}; > > +MODULE_DEVICE_TABLE(acpi, fsl_dspi_acpi_ids); > > Does NXP know about this ID assignment from their namespace? ACPI IDs should > be namespaced by whoever's assigning the ID to avoid collisions. Yes, I got HID from NXP only. > > > - ret = of_property_read_u32(np, "spi-num-chipselects", &cs_num); > > + if (is_acpi_node(pdev->dev.fwnode)) > > + ret = device_property_read_u32(&pdev->dev, > > + "spi-num-chipselects", &cs_num); > > + else > > + ret = of_property_read_u32(np, > > + "spi-num-chipselects", &cs_num); > > The whole point with the device property API is that it works with both DT and ACPI > without needing separate parsing, though in this case I'm wondering why we'd > need to specify this in an ACPI system at all? Understood. Will take care in v2 PATCH > > > - of_property_read_u32(np, "bus-num", &bus_num); > > + if (is_acpi_node(pdev->dev.fwnode)) { > > + ret = device_property_read_u32(&pdev->dev, > > + "bus-num", &bus_num); > > This is a bad idea for DT and I can't understand why you'd carry it over for ACPI - > why would an ACPI system ever care about this? It's Linux internal at the best of > times. Will take care in v2 PATCH > > It looks like you've done this by simply adding these device property alternatives > for every DT property. This isn't how that API is intended to be used and suggests > that this isn't a thought through, idiomatic ACPI binding. I'd suggest looking at the > Synquacer driver for an example of how this would normally be done, I'd expect > your ACPI code to look very much like theirs.