[alsa-devel] [PATCH 3/3] ASoC: rt5645: add device tree support
Liam Girdwood
liam.r.girdwood at linux.intel.com
Tue May 5 16:45:58 CEST 2015
On Tue, 2015-05-05 at 21:42 +0800, Bard Liao wrote:
> Modify the RT5645 driver to parse platform data from device tree.
> Write a DT binding document to describe those properties.
>
> Signed-off-by: Bard Liao <bardliao at realtek.com>
> ---
> Documentation/devicetree/bindings/sound/rt5645.txt | 72 ++++++++++++++++++++++
> sound/soc/codecs/rt5645.c | 35 +++++++++++
> 2 files changed, 107 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/rt5645.txt
>
> diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
> index e435680..36e22b6 100644
> --- a/sound/soc/codecs/rt5645.c
> +++ b/sound/soc/codecs/rt5645.c
> @@ -3134,6 +3134,37 @@ static struct dmi_system_id dmi_platform_intel_braswell[] = {
> { }
> };
>
> +static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device_node *np)
> +{
> + rt5645->pdata.in2_diff = of_property_read_bool(np,
> + "realtek,in2-differential");
> + of_property_read_u32(np,
> + "realtek,dmic1-data-pin", &rt5645->pdata.dmic1_data_pin);
We should really be using device_property_() instead of of_property_()
APIs since we will have to support both DT and ACPI properties.
Liam
More information about the Alsa-devel
mailing list