| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * cs42l56.c -- CS42L51 ALSA SoC I2C audio driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2014 CirrusLogic, Inc. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Brian Austin <brian.austin@cirrus.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #include <linux/i2c.h> |
|---|
| .. | .. |
|---|
| 23 | 19 | }; |
|---|
| 24 | 20 | MODULE_DEVICE_TABLE(i2c, cs42l51_i2c_id); |
|---|
| 25 | 21 | |
|---|
| 22 | +const struct of_device_id cs42l51_of_match[] = { |
|---|
| 23 | + { .compatible = "cirrus,cs42l51", }, |
|---|
| 24 | + { } |
|---|
| 25 | +}; |
|---|
| 26 | +MODULE_DEVICE_TABLE(of, cs42l51_of_match); |
|---|
| 27 | + |
|---|
| 26 | 28 | static int cs42l51_i2c_probe(struct i2c_client *i2c, |
|---|
| 27 | 29 | const struct i2c_device_id *id) |
|---|
| 28 | 30 | { |
|---|
| 29 | 31 | struct regmap_config config; |
|---|
| 30 | 32 | |
|---|
| 31 | 33 | config = cs42l51_regmap; |
|---|
| 32 | | - config.val_bits = 8; |
|---|
| 33 | | - config.reg_bits = 8; |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | return cs42l51_probe(&i2c->dev, devm_regmap_init_i2c(i2c, &config)); |
|---|
| 36 | 36 | } |
|---|
| 37 | + |
|---|
| 38 | +static int cs42l51_i2c_remove(struct i2c_client *i2c) |
|---|
| 39 | +{ |
|---|
| 40 | + return cs42l51_remove(&i2c->dev); |
|---|
| 41 | +} |
|---|
| 42 | + |
|---|
| 43 | +static const struct dev_pm_ops cs42l51_pm_ops = { |
|---|
| 44 | + SET_SYSTEM_SLEEP_PM_OPS(cs42l51_suspend, cs42l51_resume) |
|---|
| 45 | +}; |
|---|
| 37 | 46 | |
|---|
| 38 | 47 | static struct i2c_driver cs42l51_i2c_driver = { |
|---|
| 39 | 48 | .driver = { |
|---|
| 40 | 49 | .name = "cs42l51", |
|---|
| 41 | 50 | .of_match_table = cs42l51_of_match, |
|---|
| 51 | + .pm = &cs42l51_pm_ops, |
|---|
| 42 | 52 | }, |
|---|
| 43 | 53 | .probe = cs42l51_i2c_probe, |
|---|
| 54 | + .remove = cs42l51_i2c_remove, |
|---|
| 44 | 55 | .id_table = cs42l51_i2c_id, |
|---|
| 45 | 56 | }; |
|---|
| 46 | 57 | |
|---|