aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/Kconfig
blob: 1cf1a98952fa0045fbb2510eefaee494a819084e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
generated by cgit 1.2.3-korg (git 2.43.0) at 2025-12-12 20:14:05 +0000
 


n>
}
EXPORT_SYMBOL_GPL(lp3943_read_byte);

int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data)
{
	return regmap_write(lp3943->regmap, reg, data);
}
EXPORT_SYMBOL_GPL(lp3943_write_byte);

int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data)
{
	return regmap_update_bits(lp3943->regmap, reg, mask, data);
}
EXPORT_SYMBOL_GPL(lp3943_update_bits);

static const struct regmap_config lp3943_regmap_config = {
	.reg_bits = 8,
	.val_bits = 8,
	.max_register = LP3943_MAX_REGISTERS,
};

static int lp3943_probe(struct i2c_client *cl)
{
	struct lp3943 *lp3943;
	struct device *dev = &cl->dev;

	lp3943 = devm_kzalloc(dev, sizeof(*lp3943), GFP_KERNEL);
	if (!lp3943)
		return -ENOMEM;

	lp3943->regmap = devm_regmap_init_i2c(cl, &lp3943_regmap_config);
	if (IS_ERR(lp3943->regmap))
		return PTR_ERR(lp3943->regmap);

	lp3943->pdata = dev_get_platdata(dev);
	lp3943->dev = dev;
	lp3943->mux_cfg = lp3943_mux_cfg;
	i2c_set_clientdata(cl, lp3943);

	return devm_mfd_add_devices(dev, -1, lp3943_devs,
				    ARRAY_SIZE(lp3943_devs),
				    NULL, 0, NULL);
}

static const struct i2c_device_id lp3943_ids[] = {
	{ "lp3943" },
	{ }
};
MODULE_DEVICE_TABLE(i2c, lp3943_ids);

#ifdef CONFIG_OF
static const struct of_device_id lp3943_of_match[] = {
	{ .compatible = "ti,lp3943", },
	{ }
};
MODULE_DEVICE_TABLE(of, lp3943_of_match);
#endif

static struct i2c_driver lp3943_driver = {
	.probe = lp3943_probe,
	.driver = {
		.name = "lp3943",
		.of_match_table = of_match_ptr(lp3943_of_match),
	},
	.id_table = lp3943_ids,
};

module_i2c_driver(lp3943_driver);

MODULE_DESCRIPTION("LP3943 MFD Core Driver");
MODULE_AUTHOR("Milo Kim");
MODULE_LICENSE("GPL");