Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * cs42l56.c -- CS42L51 ALSA SoC I2C audio driver
0004  *
0005  * Copyright 2014 CirrusLogic, Inc.
0006  *
0007  * Author: Brian Austin <brian.austin@cirrus.com>
0008  */
0009 
0010 #include <linux/i2c.h>
0011 #include <linux/module.h>
0012 #include <sound/soc.h>
0013 
0014 #include "cs42l51.h"
0015 
0016 static struct i2c_device_id cs42l51_i2c_id[] = {
0017     {"cs42l51", 0},
0018     {}
0019 };
0020 MODULE_DEVICE_TABLE(i2c, cs42l51_i2c_id);
0021 
0022 static int cs42l51_i2c_probe(struct i2c_client *i2c)
0023 {
0024     struct regmap_config config;
0025 
0026     config = cs42l51_regmap;
0027 
0028     return cs42l51_probe(&i2c->dev, devm_regmap_init_i2c(i2c, &config));
0029 }
0030 
0031 static int cs42l51_i2c_remove(struct i2c_client *i2c)
0032 {
0033     cs42l51_remove(&i2c->dev);
0034 
0035     return 0;
0036 }
0037 
0038 static const struct dev_pm_ops cs42l51_pm_ops = {
0039     SET_SYSTEM_SLEEP_PM_OPS(cs42l51_suspend, cs42l51_resume)
0040 };
0041 
0042 static struct i2c_driver cs42l51_i2c_driver = {
0043     .driver = {
0044         .name = "cs42l51",
0045         .of_match_table = cs42l51_of_match,
0046         .pm = &cs42l51_pm_ops,
0047     },
0048     .probe_new = cs42l51_i2c_probe,
0049     .remove = cs42l51_i2c_remove,
0050     .id_table = cs42l51_i2c_id,
0051 };
0052 
0053 module_i2c_driver(cs42l51_i2c_driver);
0054 
0055 MODULE_DESCRIPTION("ASoC CS42L51 I2C Driver");
0056 MODULE_AUTHOR("Brian Austin, Cirrus Logic Inc, <brian.austin@cirrus.com>");
0057 MODULE_LICENSE("GPL");