pcm512x-i2c.c (f01387d2693813eb5271a3448e6a082322c7d75d) pcm512x-i2c.c (681a19560378213a193c424881b2180a783b81ae)
1/*
2 * Driver for the PCM512x CODECs
3 *
4 * Author: Mark Brown <broonie@linaro.org>
5 * Copyright 2014 Linaro Ltd
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 10 unchanged lines hidden (view full) ---

19#include <linux/i2c.h>
20
21#include "pcm512x.h"
22
23static int pcm512x_i2c_probe(struct i2c_client *i2c,
24 const struct i2c_device_id *id)
25{
26 struct regmap *regmap;
1/*
2 * Driver for the PCM512x CODECs
3 *
4 * Author: Mark Brown <broonie@linaro.org>
5 * Copyright 2014 Linaro Ltd
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 10 unchanged lines hidden (view full) ---

19#include <linux/i2c.h>
20
21#include "pcm512x.h"
22
23static int pcm512x_i2c_probe(struct i2c_client *i2c,
24 const struct i2c_device_id *id)
25{
26 struct regmap *regmap;
27 struct regmap_config config = pcm512x_regmap;
27
28
28 regmap = devm_regmap_init_i2c(i2c, &pcm512x_regmap);
29 /* msb needs to be set to enable auto-increment of addresses */
30 config.read_flag_mask = 0x80;
31 config.write_flag_mask = 0x80;
32
33 regmap = devm_regmap_init_i2c(i2c, &config);
29 if (IS_ERR(regmap))
30 return PTR_ERR(regmap);
31
32 return pcm512x_probe(&i2c->dev, regmap);
33}
34
35static int pcm512x_i2c_remove(struct i2c_client *i2c)
36{

--- 35 unchanged lines hidden ---
34 if (IS_ERR(regmap))
35 return PTR_ERR(regmap);
36
37 return pcm512x_probe(&i2c->dev, regmap);
38}
39
40static int pcm512x_i2c_remove(struct i2c_client *i2c)
41{

--- 35 unchanged lines hidden ---