From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Irina Tirdea <irina.tirdea@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Octavian Purdila <octavian.purdila@intel.com>,
Cristina Ciocan <cristina.ciocan@intel.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/4] pinctrl: Add ACPI support
Date: Fri, 01 Apr 2016 17:14:34 +0300 [thread overview]
Message-ID: <1459520074.5907.205.camel@linux.intel.com> (raw)
In-Reply-To: <1459424685-26965-4-git-send-email-irina.tirdea@intel.com>
On Thu, 2016-03-31 at 14:44 +0300, Irina Tirdea wrote:
> Add ACPI support for pin controller properties. These are
> based on ACPI _DSD properties and follow the device tree
> model based on states and node configurations. The states
> are defined as _DSD properties and configuration nodes
> are defined using the _DSD Hierarchical Properties Extension.
>
> A configuration node supports the generic device tree properties.
>
> The implementation is based on device tree code from devicetree.c.
>
Patch is good to me, though few minor comments below.
> +/**
> + * struct pinctrl_acpi_map - mapping table chunk parsed from ACPI
> + * @node: list node for struct pinctrl's @fw_maps field
> + * @pctldev: the pin controller that allocated this struct, and will
> free it
> + * @maps: the mapping table entries
We have @map and @num_maps.
> + */
> +struct pinctrl_acpi_map {
> + struct list_head node;
> + struct pinctrl_dev *pctldev;
> + struct pinctrl_map *map;
> + unsigned num_maps;
> +};
> +
>
> +static int acpi_remember_or_free_map(struct pinctrl *p, const char
> *statename,
> + struct pinctrl_dev *pctldev,
> + struct pinctrl_map *map,
> unsigned num_maps)
> +{
> + struct pinctrl_acpi_map *acpi_map;
> + struct list_head *acpi_maps;
> + unsigned int i;
Just unsigned i to be in align with unsigned num_maps.
> +
> + /* Initialize common mapping table entry fields */
> + for (i = 0; i < num_maps; i++) {
> + map[i].dev_name = dev_name(p->dev);
> + map[i].name = statename;
> + if (pctldev)
> + map[i].ctrl_dev_name = dev_name(pctldev-
> >dev);
> + }
> +int pinctrl_acpi_to_map(struct pinctrl *p)
> +{
> + const union acpi_object *prop, *statenames, *configs;
> + unsigned int state, nstates, nconfigs, config;
> + char *statename, *propname, *configname;
> + struct fwnode_handle *fw_prop;
> + struct acpi_device *adev;
> + int ret;
> +
> + /* We may store pointers to property names within the node
> */
> + adev = acpi_bus_get_acpi_device(ACPI_HANDLE(p->dev));
> + if (!adev)
> + return -ENODEV;
> +
> + /* Only allow named states (device must have prop 'pinctrl-
> names') */
Does it fit one line?
> +err_free_map:
Perhaps err_free_maps?
> + pinctrl_acpi_free_maps(p);
> + return ret;
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-01 14:14 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 11:44 [RFC PATCH 0/4] Add ACPI support for pinctrl configuration Irina Tirdea
2016-03-31 11:44 ` [RFC PATCH 1/4] pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map Irina Tirdea
2016-04-01 13:08 ` Linus Walleij
2016-03-31 11:44 ` [RFC PATCH 2/4] pinctrl: pinconf-generic: Add ACPI support Irina Tirdea
2016-04-01 14:05 ` Andy Shevchenko
2016-04-04 13:03 ` Tirdea, Irina
2016-03-31 11:44 ` [RFC PATCH 3/4] pinctrl: " Irina Tirdea
2016-04-01 14:14 ` Andy Shevchenko [this message]
2016-04-04 13:13 ` Tirdea, Irina
[not found] ` <1459424685-26965-4-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-04 13:37 ` Mika Westerberg
2016-04-04 14:01 ` Tirdea, Irina
2016-04-05 7:49 ` Mika Westerberg
2016-03-31 11:44 ` [RFC PATCH 4/4] pinctrl: Parse GpioInt/GpioIo resources Irina Tirdea
2016-04-04 13:47 ` Mika Westerberg
[not found] ` <20160404134740.GB1727-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-04-04 14:05 ` Tirdea, Irina
2016-04-04 21:40 ` [RFC PATCH 0/4] Add ACPI support for pinctrl configuration Mark Brown
2016-04-05 9:00 ` Linus Walleij
2016-04-05 16:12 ` Mark Brown
2016-04-05 12:51 ` Octavian Purdila
2016-04-05 17:31 ` Mark Brown
2016-04-04 22:52 ` Mark Rutland
2016-04-05 8:43 ` Linus Walleij
2016-04-05 16:59 ` Mark Brown
2016-04-05 19:37 ` Octavian Purdila
2016-04-05 22:44 ` Mark Brown
2016-04-05 23:48 ` Al Stone
2016-04-06 8:52 ` Lorenzo Pieralisi
2016-04-05 8:56 ` Charles Garcia-Tobin
2016-04-06 0:00 ` Al Stone
2016-04-06 10:49 ` Graeme Gregory
2016-04-07 14:17 ` Octavian Purdila
2016-04-07 18:01 ` Linus Walleij
2016-04-05 15:33 ` Tirdea, Irina
2016-04-05 18:16 ` Mark Rutland
2016-04-05 20:09 ` Octavian Purdila
2016-04-06 0:01 ` Mark Rutland
2016-04-07 12:11 ` Octavian Purdila
2016-04-06 10:39 ` Mark Rutland
2016-04-07 21:24 ` Rafael J. Wysocki
2016-04-12 12:15 ` Mark Brown
2016-04-13 5:08 ` Rafael J. Wysocki
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=1459520074.5907.205.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=cristina.ciocan@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=irina.tirdea@intel.com \
--cc=lenb@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=octavian.purdila@intel.com \
--cc=rjw@rjwysocki.net \
--cc=robh+dt@kernel.org \
/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).