ASoC: rt5651: Make rt5651_apply_properties() private

The idea behind exporting rt5651_apply_properties(), was for it to be used
on platforms where the platform code may need to add device-properties,
rather then relying only on properties set by the firmware. The platform
code could then call rt5651_apply_properties() after adding properties to
make sure that the codec driver was aware of the new properties.

But this is not necessary, as long as we do all property parsing from
the codec component-driver's probe function (or later) then the machine
driver can attach properties before calling snd_soc_register_card and
calling rt5651_apply_properties() for ordering reasons is not necessary.

This commit makes rt5651_apply_properties() private and adds 2 comments
documenting that all property parsing must be done from the codec
component-driver's probe function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Hans de Goede 2018-03-04 15:35:49 +01:00 committed by Mark Brown
parent f1088d4b81
commit 1cf5b50426
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 12 additions and 4 deletions

View File

@ -1666,7 +1666,14 @@ static int rt5651_set_jack(struct snd_soc_component *component,
return 0;
}
void rt5651_apply_properties(struct snd_soc_component *component)
/*
* Note on some platforms the platform code may need to add device-properties,
* rather then relying only on properties set by the firmware. Therefor the
* property parsing MUST be done from the component driver's probe function,
* rather then from the i2c driver's probe function, so that the platform-code
* can attach extra properties before calling snd_soc_register_card().
*/
static void rt5651_apply_properties(struct snd_soc_component *component)
{
if (device_property_read_bool(component->dev, "realtek,in2-differential"))
snd_soc_component_update_bits(component, RT5651_IN1_IN2,
@ -1676,7 +1683,6 @@ void rt5651_apply_properties(struct snd_soc_component *component)
snd_soc_component_update_bits(component, RT5651_GPIO_CTRL1,
RT5651_GP2_PIN_MASK, RT5651_GP2_PIN_DMIC1_SCL);
}
EXPORT_SYMBOL_GPL(rt5651_apply_properties);
static int rt5651_probe(struct snd_soc_component *component)
{
@ -1893,6 +1899,10 @@ static void rt5651_jack_detect_work(struct work_struct *work)
snd_soc_jack_report(rt5651->hp_jack, report, SND_JACK_HEADSET);
}
/*
* Note this function MUST not look at device-properties, see the comment
* above rt5651_apply_properties().
*/
static int rt5651_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{

View File

@ -2080,6 +2080,4 @@ struct rt5651_priv {
bool hp_mute;
};
void rt5651_apply_properties(struct snd_soc_component *component);
#endif /* __RT5651_H__ */