Exemple #1
0
static int cs4271_spi_probe(struct spi_device *spi)
{
	struct cs4271_private *cs4271;
	int ret;

	ret = cs4271_common_probe(&spi->dev, &cs4271);
	if (ret < 0)
		return ret;

	spi_set_drvdata(spi, cs4271);
	cs4271->regmap = devm_regmap_init_spi(spi, &cs4271_spi_regmap);
	if (IS_ERR(cs4271->regmap))
		return PTR_ERR(cs4271->regmap);

	return snd_soc_register_codec(&spi->dev, &soc_codec_dev_cs4271,
		&cs4271_dai, 1);
}
Exemple #2
0
int cs4271_probe(struct device *dev, struct regmap *regmap)
{
	struct cs4271_private *cs4271;
	int ret;

	if (IS_ERR(regmap))
		return PTR_ERR(regmap);

	ret = cs4271_common_probe(dev, &cs4271);
	if (ret < 0)
		return ret;

	dev_set_drvdata(dev, cs4271);
	cs4271->regmap = regmap;

	return snd_soc_register_codec(dev, &soc_codec_dev_cs4271, &cs4271_dai,
				      1);
}
Exemple #3
0
static int cs4271_i2c_probe(struct i2c_client *client,
			    const struct i2c_device_id *id)
{
	struct cs4271_private *cs4271;
	int ret;

	ret = cs4271_common_probe(&client->dev, &cs4271);
	if (ret < 0)
		return ret;

	i2c_set_clientdata(client, cs4271);
	cs4271->regmap = devm_regmap_init_i2c(client, &cs4271_i2c_regmap);
	if (IS_ERR(cs4271->regmap))
		return PTR_ERR(cs4271->regmap);

	return snd_soc_register_codec(&client->dev, &soc_codec_dev_cs4271,
		&cs4271_dai, 1);
}