|
54 | 54 | enum mms_type {
|
55 | 55 | TYPE_MMS114 = 114,
|
56 | 56 | TYPE_MMS152 = 152,
|
| 57 | + TYPE_MMS345L = 345, |
57 | 58 | };
|
58 | 59 |
|
59 | 60 | struct mms114_data {
|
@@ -250,6 +251,15 @@ static int mms114_get_version(struct mms114_data *data)
|
250 | 251 | int error;
|
251 | 252 |
|
252 | 253 | switch (data->type) {
|
| 254 | + case TYPE_MMS345L: |
| 255 | + error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); |
| 256 | + if (error) |
| 257 | + return error; |
| 258 | + |
| 259 | + dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n", |
| 260 | + buf[0], buf[1], buf[2]); |
| 261 | + break; |
| 262 | + |
253 | 263 | case TYPE_MMS152:
|
254 | 264 | error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf);
|
255 | 265 | if (error)
|
@@ -287,8 +297,8 @@ static int mms114_setup_regs(struct mms114_data *data)
|
287 | 297 | if (error < 0)
|
288 | 298 | return error;
|
289 | 299 |
|
290 |
| - /* MMS152 has no configuration or power on registers */ |
291 |
| - if (data->type == TYPE_MMS152) |
| 300 | + /* Only MMS114 has configuration and power on registers */ |
| 301 | + if (data->type != TYPE_MMS114) |
292 | 302 | return 0;
|
293 | 303 |
|
294 | 304 | error = mms114_set_active(data, true);
|
@@ -599,6 +609,9 @@ static const struct of_device_id mms114_dt_match[] = {
|
599 | 609 | }, {
|
600 | 610 | .compatible = "melfas,mms152",
|
601 | 611 | .data = (void *)TYPE_MMS152,
|
| 612 | + }, { |
| 613 | + .compatible = "melfas,mms345l", |
| 614 | + .data = (void *)TYPE_MMS345L, |
602 | 615 | },
|
603 | 616 | { }
|
604 | 617 | };
|
|
0 commit comments