2 * SSM2602/SSM2603/SSM2604 I2C audio driver
4 * Copyright 2014 Analog Devices Inc.
6 * Licensed under the GPL-2.
9 #include <linux/module.h>
10 #include <linux/i2c.h>
11 #include <linux/regmap.h>
13 #include <sound/soc.h>
18 * ssm2602 2 wire address is determined by GPIO5
19 * state during powerup.
23 static int ssm2602_i2c_probe(struct i2c_client
*client
,
24 const struct i2c_device_id
*id
)
26 return ssm2602_probe(&client
->dev
, id
->driver_data
,
27 devm_regmap_init_i2c(client
, &ssm2602_regmap_config
));
30 static int ssm2602_i2c_remove(struct i2c_client
*client
)
32 snd_soc_unregister_codec(&client
->dev
);
36 static const struct i2c_device_id ssm2602_i2c_id
[] = {
37 { "ssm2602", SSM2602
},
38 { "ssm2603", SSM2602
},
39 { "ssm2604", SSM2604
},
42 MODULE_DEVICE_TABLE(i2c
, ssm2602_i2c_id
);
44 static const struct of_device_id ssm2602_of_match
[] = {
45 { .compatible
= "adi,ssm2602", },
46 { .compatible
= "adi,ssm2603", },
47 { .compatible
= "adi,ssm2604", },
50 MODULE_DEVICE_TABLE(of
, ssm2602_of_match
);
52 static struct i2c_driver ssm2602_i2c_driver
= {
55 .of_match_table
= ssm2602_of_match
,
57 .probe
= ssm2602_i2c_probe
,
58 .remove
= ssm2602_i2c_remove
,
59 .id_table
= ssm2602_i2c_id
,
61 module_i2c_driver(ssm2602_i2c_driver
);
63 MODULE_DESCRIPTION("ASoC SSM2602/SSM2603/SSM2604 I2C driver");
64 MODULE_AUTHOR("Cliff Cai");
65 MODULE_LICENSE("GPL");