[alsa-devel] [PATCH 3/3] ASoC: rt5645: add device tree support

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu May 7 13:26:01 CEST 2015


On Thu, 2015-05-07 at 05:34 +0000, Bard Liao wrote:
> > > > +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.
> 
> Unfortunately, I can't find a way to test it.

device_property() API calls abstract the device tree calls and ACPI
calls. So testing with your DT based HW will work.

> Is that ok we just replace all of_property_ with device_property_?

Yes, that's the intention.

> Also, is there any corresponding API for of_get_named_gpio?
> Or we can replace it with device_property_read_u32?
> I tried the change above, and it can build. However I don't know
> if it can work.

Oh, I think that's a question for Rafael. I think the intention is to
have a 1:1 mapping between the APIs so that there are no gaps ?

Liam




More information about the Alsa-devel mailing list