-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Thursday, July 09, 2015 7:09 PM To: Bard Liao Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; lars@metafoo.de; Flove; Oder Chiou; John Lin; ramesh.babu@intel.com Subject: Re: [PATCH] ASoC: add rt298 codec driver
On Fri, Jun 26, 2015 at 10:59:49AM +0800, Bard Liao wrote:
It is the initial version of ALC298 codec driver.
I'll apply this but a few things here which you should look at:
+static int rt298_probe(struct snd_soc_codec *codec) {
- struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
- rt298->codec = codec;
- if (rt298->i2c->irq) {
regmap_update_bits(rt298->regmap,
RT298_IRQ_CTRL, 0x2, 0x2);
INIT_DELAYED_WORK(&rt298->jack_detect_work,
rt298_jack_detect_work);
schedule_delayed_work(&rt298->jack_detect_work,
msecs_to_jiffies(1250));
That seems like an awfully long time to wait to do the first jack detection. What's this for?
Originally, that is for waiting dapm initialization. Now we check rt298->codec at the beginning of rt298_jack_detect. I don't know if it is still necessary.
+static int rt298_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) {
- struct rt298_platform_data *pdata = dev_get_platdata(&i2c->dev);
- struct rt298_priv *rt298;
- struct device *dev = &i2c->dev;
- const struct acpi_device_id *acpiid;
- int i, ret;
- pr_info("%s\n", __func__);
This isn't adding anything, you should remove it.
Do you mean remove "pr_info("%s\n", __func__);" ?
------Please consider the environment before printing this e-mail.