Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Match data improvements for tlv320aic32x4 driver

Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for tlv320aic32x4
driver.

This patch series is only compile tested.

+11 -34
+3 -16
sound/soc/codecs/tlv320aic32x4-i2c.c
··· 16 16 17 17 #include "tlv320aic32x4.h" 18 18 19 - static const struct of_device_id aic32x4_of_id[]; 20 - static const struct i2c_device_id aic32x4_i2c_id[]; 21 - 22 19 static int aic32x4_i2c_probe(struct i2c_client *i2c) 23 20 { 24 21 struct regmap *regmap; 25 22 struct regmap_config config; 23 + enum aic32x4_type type; 26 24 27 25 config = aic32x4_regmap_config; 28 26 config.reg_bits = 8; 29 27 config.val_bits = 8; 30 28 31 29 regmap = devm_regmap_init_i2c(i2c, &config); 30 + type = (uintptr_t)i2c_get_match_data(i2c); 32 31 33 - if (i2c->dev.of_node) { 34 - const struct of_device_id *oid; 35 - 36 - oid = of_match_node(aic32x4_of_id, i2c->dev.of_node); 37 - dev_set_drvdata(&i2c->dev, (void *)oid->data); 38 - } else { 39 - const struct i2c_device_id *id; 40 - 41 - id = i2c_match_id(aic32x4_i2c_id, i2c); 42 - dev_set_drvdata(&i2c->dev, (void *)id->driver_data); 43 - } 44 - 45 - return aic32x4_probe(&i2c->dev, regmap); 32 + return aic32x4_probe(&i2c->dev, regmap, type); 46 33 } 47 34 48 35 static void aic32x4_i2c_remove(struct i2c_client *i2c)
+3 -15
sound/soc/codecs/tlv320aic32x4-spi.c
··· 16 16 17 17 #include "tlv320aic32x4.h" 18 18 19 - static const struct of_device_id aic32x4_of_id[]; 20 - 21 19 static int aic32x4_spi_probe(struct spi_device *spi) 22 20 { 23 21 struct regmap *regmap; 24 22 struct regmap_config config; 23 + enum aic32x4_type type; 25 24 26 25 config = aic32x4_regmap_config; 27 26 config.reg_bits = 7; ··· 29 30 config.read_flag_mask = 0x01; 30 31 31 32 regmap = devm_regmap_init_spi(spi, &config); 33 + type = (uintptr_t)spi_get_device_match_data(spi); 32 34 33 - if (spi->dev.of_node) { 34 - const struct of_device_id *oid; 35 - 36 - oid = of_match_node(aic32x4_of_id, spi->dev.of_node); 37 - dev_set_drvdata(&spi->dev, (void *)oid->data); 38 - } else { 39 - const struct spi_device_id *id_entry; 40 - 41 - id_entry = spi_get_device_id(spi); 42 - dev_set_drvdata(&spi->dev, (void *)id_entry->driver_data); 43 - } 44 - 45 - return aic32x4_probe(&spi->dev, regmap); 35 + return aic32x4_probe(&spi->dev, regmap, type); 46 36 } 47 37 48 38 static void aic32x4_spi_remove(struct spi_device *spi)
+3 -2
sound/soc/codecs/tlv320aic32x4.c
··· 1333 1333 return ret; 1334 1334 } 1335 1335 1336 - int aic32x4_probe(struct device *dev, struct regmap *regmap) 1336 + int aic32x4_probe(struct device *dev, struct regmap *regmap, 1337 + enum aic32x4_type type) 1337 1338 { 1338 1339 struct aic32x4_priv *aic32x4; 1339 1340 struct aic32x4_pdata *pdata = dev->platform_data; ··· 1350 1349 return -ENOMEM; 1351 1350 1352 1351 aic32x4->dev = dev; 1353 - aic32x4->type = (uintptr_t)dev_get_drvdata(dev); 1352 + aic32x4->type = type; 1354 1353 1355 1354 dev_set_drvdata(dev, aic32x4); 1356 1355
+2 -1
sound/soc/codecs/tlv320aic32x4.h
··· 17 17 }; 18 18 19 19 extern const struct regmap_config aic32x4_regmap_config; 20 - int aic32x4_probe(struct device *dev, struct regmap *regmap); 20 + int aic32x4_probe(struct device *dev, struct regmap *regmap, 21 + enum aic32x4_type type); 21 22 void aic32x4_remove(struct device *dev); 22 23 int aic32x4_register_clocks(struct device *dev, const char *mclk_name); 23 24