From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Brandon Anderson <brandon.anderson@amd.com>
Cc: ssg.sos.patches@amd.com, linaro-acpi@lists.linaro.org,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH 3/4] ACPI/ARM: Add ACPI to AMBA SPI driver
Date: Tue, 12 Nov 2013 12:43:22 +0200 [thread overview]
Message-ID: <20131112104321.GQ22916@intel.com> (raw)
In-Reply-To: <1384190170-8707-4-git-send-email-brandon.anderson@amd.com>
On Mon, Nov 11, 2013 at 11:16:09AM -0600, Brandon Anderson wrote:
> +#ifdef CONFIG_ACPI
> +static struct pl022_ssp_controller *
> +acpi_pl022_get_platform_data(struct device *dev)
> +{
> + struct pl022_ssp_controller *pd, *ret;
> + struct acpi_amba_dsm_entry entry;
> +
> + pd = devm_kzalloc(dev, sizeof(struct pl022_ssp_controller), GFP_KERNEL);
> + if (!pd) {
> + dev_err(dev, "cannot allocate platform data memory\n");
> + return NULL;
> + }
> + ret = pd;
> +
> + pd->bus_id = -1;
> + pd->enable_dma = 1;
> + if (acpi_amba_dsm_lookup(ACPI_HANDLE(dev), "num-cs", 0, &entry) == 0) {
> + if (kstrtou8(entry.value, 0, &pd->num_chipselect) != 0) {
> + dev_err(dev, "invalid 'num-cs' in ACPI definition\n");
> + ret = NULL;
> + }
> + kfree(entry.key);
> + kfree(entry.value);
> + }
> + if (acpi_amba_dsm_lookup(ACPI_HANDLE(dev),
> + "autosuspend-delay", 0, &entry) == 0) {
> + if (kstrtoint(entry.value, 0, &pd->autosuspend_delay) != 0) {
> + dev_err(dev, "invalid 'autosuspend-delay' in ACPI definition\n");
> + ret = NULL;
> + }
> + kfree(entry.key);
> + kfree(entry.value);
> + }
> + if (acpi_amba_dsm_lookup(ACPI_HANDLE(dev), "rt", 0, &entry) == 0) {
> + pd->rt = (entry.value && strcmp(entry.value, "1") == 0);
> + kfree(entry.key);
> + kfree(entry.value);
> + }
> +
> + return ret;
> +}
> +#endif
If you add dummy stub acpi_pl022_get_platform_data() here in case of
!CONFIG_ACPI...
> +
> static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
> {
> struct device *dev = &adev->dev;
> @@ -2081,6 +2125,11 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
>
> dev_info(&adev->dev,
> "ARM PL022 driver, device ID: 0x%08x\n", adev->periphid);
> +#ifdef CONFIG_ACPI
You don't need this ugly #ifdef here.
> + if (!platform_info && ACPI_HANDLE(dev))
> + platform_info = acpi_pl022_get_platform_data(dev);
> + else
> +#endif
> if (!platform_info && IS_ENABLED(CONFIG_OF))
> platform_info = pl022_platform_data_dt_get(dev);
next prev parent reply other threads:[~2013-11-12 10:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 17:16 [PATCH 0/4] ACPI/ARM: AMBA bus ACPI module Brandon Anderson
2013-11-11 17:16 ` [PATCH 1/4] ACPI/ARM: Load fixed-clk module early Brandon Anderson
2013-11-11 17:16 ` [PATCH 2/4] ACPI/ARM: Add AMBA bus ACPI module Brandon Anderson
2013-11-12 10:40 ` Mika Westerberg
[not found] ` <CE40542A5D952D47989966E71788B1840157C0F8@satlexdag05.amd.com>
2013-11-12 19:13 ` Mika Westerberg
2013-11-21 15:09 ` Tomasz Nowicki
[not found] ` <CE40542A5D952D47989966E71788B184037DE61F@satlexdag05.amd.com>
2013-11-22 9:35 ` Tomasz Nowicki
2013-11-11 17:16 ` [PATCH 3/4] ACPI/ARM: Add ACPI to AMBA SPI driver Brandon Anderson
2013-11-12 10:43 ` Mika Westerberg [this message]
[not found] ` <CE40542A5D952D47989966E71788B1840157C119@satlexdag05.amd.com>
2013-11-12 19:14 ` Mika Westerberg
2013-11-17 21:42 ` Rafael J. Wysocki
2013-11-11 17:16 ` [PATCH 4/4] ACPI/ARM: Remove sections of DTS definition Brandon Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131112104321.GQ22916@intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=brandon.anderson@amd.com \
--cc=linaro-acpi@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=ssg.sos.patches@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).