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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* huawei-gaokun-battery - A power supply driver for HUAWEI Matebook E Go
*
* Copyright (C) 2024 Pengyu Luo <mitltlatltl@gmail.com>
*/
#include <linux/auxiliary_bus.h>
#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/platform_data/huawei-gaokun-ec.h>
#include <linux/power_supply.h>
#include <linux/sprintf.h>
/* -------------------------------------------------------------------------- */
/* String Data Reg */
#define EC_BAT_VENDOR 0x01 /* from 0x01 to 0x0F, SUNWODA */
#define EC_BAT_MODEL 0x11 /* from 0x11 to 0x1F, HB30A8P9ECW-22T */
#define EC_ADP_STATUS 0x81
#define EC_AC_STATUS BIT(0)
#define EC_BAT_PRESENT BIT(1) /* BATC._STA */
#define EC_BAT_STATUS 0x82 /* _BST */
#define EC_BAT_DISCHARGING BIT(0)
#define EC_BAT_CHARGING BIT(1)
#define EC_BAT_CRITICAL BIT(2) /* Low Battery Level */
#define EC_BAT_FULL BIT(3)
/* -------------------------------------------------------------------------- */
/* Word Data Reg */
/* 0x5A: ?
* 0x5C: ?
* 0x5E: ?
* 0X60: ?
* 0x84: ?
*/
#define EC_BAT_STATUS_START 0x90
#define EC_BAT_PERCENTAGE 0x90
#define EC_BAT_VOLTAGE 0x92
#define EC_BAT_CAPACITY 0x94
#define EC_BAT_FULL_CAPACITY 0x96
/* 0x98: ? */
#define EC_BAT_CURRENT 0x9A
/* 0x9C: ? */
#define EC_BAT_INFO_START 0xA0
/* 0xA0: POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT? */
#define EC_BAT_DESIGN_CAPACITY 0xA2
#define EC_BAT_DESIGN_VOLTAGE 0xA4
#define EC_BAT_SERIAL_NUMBER 0xA6
#define EC_BAT_CYCLE_COUNT 0xAA
/* -------------------------------------------------------------------------- */
/* Battery Event ID */
#define EC_EVENT_BAT_A0 0xA0
#define EC_EVENT_BAT_A1 0xA1
#define EC_EVENT_BAT_A2 0xA2
#define EC_EVENT_BAT_A3 0xA3
#define EC_EVENT_BAT_B1 0xB1
/* EVENT B1 A0 A1 repeat about every 1s 2s 3s respectively */
/* ACPI _BIX field, Min sampling time, the duration between two _BST */
#define CACHE_TIME 2000 /* cache time in milliseconds */
#define MILLI_TO_MICRO 1000
#define SMART_CHARGE_MODE 0
#define SMART_CHARGE_DELAY 1
#define SMART_CHARGE_START 2
#define SMART_CHARGE_END 3
#define NO_DELAY_MODE 1
#define DELAY_MODE 4
struct gaokun_psy_bat_status {
__le16 percentage_now; /* 0x90 */
__le16 voltage_now;
__le16 capacity_now;
__le16 full_capacity;
__le16 unknown1;
__le16 rate_now;
__le16 unknown2; /* 0x9C */
} __packed;
struct gaokun_psy_bat_info {
__le16 unknown3; /* 0xA0 */
__le16 design_capacity;
__le16 design_voltage;
__le16 serial_number;
__le16 padding2;
__le16 cycle_count; /* 0xAA */
} __packed;
struct gaokun_psy {
struct gaokun_ec *ec;
struct device *dev;
struct notifier_block nb;
struct power_supply *bat_psy;
struct power_supply *adp_psy;
unsigned long update_time;
struct gaokun_psy_bat_status status;
struct gaokun_psy_bat_info info;
char battery_model[0x10]; /* HB30A8P9ECW-22T, the real one is XXX-22A */
char battery_serial[0x10];
char battery_vendor[0x10];
int charge_now;
int online;
int bat_present;
};
/* -------------------------------------------------------------------------- */
/* Adapter */
static int gaokun_psy_get_adp_status(struct gaokun_psy *ecbat)
{
/* _PSR */
int ret;
u8 online;
ret = gaokun_ec_psy_read_byte(ecbat->ec, EC_ADP_STATUS, &online);
if (ret)
return ret;
ecbat->online = !!(online & EC_AC_STATUS);
return 0;
}
static int gaokun_psy_get_adp_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
int ret;
ret = gaokun_psy_get_adp_status(ecbat);
if (ret)
return ret;
switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ecbat->online;
break;
case POWER_SUPPLY_PROP_USB_TYPE:
val->intval = POWER_SUPPLY_USB_TYPE_C;
break;
default:
return -EINVAL;
}
return 0;
}
static enum power_supply_property gaokun_psy_adp_props[] = {
POWER_SUPPLY_PROP_ONLINE,
POWER_SUPPLY_PROP_USB_TYPE,
};
static const struct power_supply_desc gaokun_psy_adp_desc = {
.name = "gaokun-ec-adapter",
.type = POWER_SUPPLY_TYPE_USB,
.usb_types = BIT(POWER_SUPPLY_USB_TYPE_C),
.get_property = gaokun_psy_get_adp_property,
.properties = gaokun_psy_adp_props,
.num_properties = ARRAY_SIZE(gaokun_psy_adp_props),
};
/* -------------------------------------------------------------------------- */
/* Battery */
static inline void gaokun_psy_get_bat_present(struct gaokun_psy *ecbat)
{
int ret;
u8 present;
/* Some kind of initialization */
gaokun_ec_write(ecbat->ec, (u8 []){0x02, 0xB2, 1, 0x90});
ret = gaokun_ec_psy_read_byte(ecbat->ec, EC_ADP_STATUS, &present);
ecbat->bat_present = ret ? false : !!(present & EC_BAT_PRESENT);
}
static inline int gaokun_psy_bat_present(struct gaokun_psy *ecbat)
{
return ecbat->bat_present;
}
static int gaokun_psy_get_bat_info(struct gaokun_psy *ecbat)
{
/* _BIX */
if (!gaokun_psy_bat_present(ecbat))
return 0;
return gaokun_ec_psy_multi_read(ecbat->ec, EC_BAT_INFO_START,
sizeof(ecbat->info), (u8 *)&ecbat->info);
}
static void gaokun_psy_update_bat_charge(struct gaokun_psy *ecbat)
{
u8 charge;
gaokun_ec_psy_read_byte(ecbat->ec, EC_BAT_STATUS, &charge);
switch (charge) {
case EC_BAT_CHARGING:
ecbat->charge_now = POWER_SUPPLY_STATUS_CHARGING;
break;
case EC_BAT_DISCHARGING:
ecbat->charge_now = POWER_SUPPLY_STATUS_DISCHARGING;
break;
case EC_BAT_FULL:
ecbat->charge_now = POWER_SUPPLY_STATUS_FULL;
break;
default:
dev_warn(ecbat->dev, "unknown charge state %d\n", charge);
}
}
static int gaokun_psy_get_bat_status(struct gaokun_psy *ecbat)
{
/* _BST */
int ret;
if (time_before(jiffies, ecbat->update_time +
msecs_to_jiffies(CACHE_TIME)))
return 0;
gaokun_psy_update_bat_charge(ecbat);
ret = gaokun_ec_psy_multi_read(ecbat->ec, EC_BAT_STATUS_START,
sizeof(ecbat->status), (u8 *)&ecbat->status);
ecbat->update_time = jiffies;
return ret;
}
static void gaokun_psy_init(struct gaokun_psy *ecbat)
{
gaokun_psy_get_bat_present(ecbat);
if (!gaokun_psy_bat_present(ecbat))
return;
gaokun_psy_get_bat_info(ecbat);
snprintf(ecbat->battery_serial, sizeof(ecbat->battery_serial),
"%d", le16_to_cpu(ecbat->info.serial_number));
gaokun_ec_psy_multi_read(ecbat->ec, EC_BAT_VENDOR,
sizeof(ecbat->battery_vendor) - 1,
ecbat->battery_vendor);
gaokun_ec_psy_multi_read(ecbat->ec, EC_BAT_MODEL,
sizeof(ecbat->battery_model) - 1,
ecbat->battery_model);
ecbat->battery_model[14] = 'A'; /* FIX UP */
}
static int gaokun_psy_get_bat_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
u8 buf[GAOKUN_SMART_CHARGE_DATA_SIZE];
int ret;
if (gaokun_psy_bat_present(ecbat))
gaokun_psy_get_bat_status(ecbat);
else if (psp != POWER_SUPPLY_PROP_PRESENT)
return -ENODEV;
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
val->intval = ecbat->charge_now;
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = ecbat->bat_present;
break;
case POWER_SUPPLY_PROP_TECHNOLOGY:
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
case POWER_SUPPLY_PROP_CYCLE_COUNT:
val->intval = le16_to_cpu(ecbat->info.cycle_count);
break;
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
val->intval = le16_to_cpu(ecbat->info.design_voltage) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
val->intval = le16_to_cpu(ecbat->status.voltage_now) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_CURRENT_NOW:
val->intval = (s16)le16_to_cpu(ecbat->status.rate_now) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
val->intval = le16_to_cpu(ecbat->info.design_capacity) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL:
val->intval = le16_to_cpu(ecbat->status.full_capacity) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_CHARGE_NOW:
val->intval = le16_to_cpu(ecbat->status.capacity_now) * MILLI_TO_MICRO;
break;
case POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD:
case POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD:
ret = gaokun_ec_psy_get_smart_charge(ecbat->ec, buf);
if (ret)
return ret;
if (psp == POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD)
val->intval = buf[SMART_CHARGE_START];
else
val->intval = buf[SMART_CHARGE_END];
break;
case POWER_SUPPLY_PROP_CAPACITY:
val->intval = le16_to_cpu(ecbat->status.percentage_now);
break;
case POWER_SUPPLY_PROP_MODEL_NAME:
val->strval = ecbat->battery_model;
break;
case POWER_SUPPLY_PROP_MANUFACTURER:
val->strval = ecbat->battery_vendor;
break;
case POWER_SUPPLY_PROP_SERIAL_NUMBER:
val->strval = ecbat->battery_serial;
break;
default:
return -EINVAL;
}
return 0;
}
static int gaokun_psy_set_bat_property(struct power_supply *psy,
enum power_supply_property psp,
const union power_supply_propval *val)
{
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
u8 buf[GAOKUN_SMART_CHARGE_DATA_SIZE];
int ret;
if (!gaokun_psy_bat_present(ecbat))
return -ENODEV;
ret = gaokun_ec_psy_get_smart_charge(ecbat->ec, buf);
if (ret)
return ret;
switch (psp) {
/*
* Resetting another thershold makes single thersold setting more likely
* to succeed. But setting start = end makes thing strange(failure).
*/
case POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD:
buf[SMART_CHARGE_START] = val->intval;
if (buf[SMART_CHARGE_START] > buf[SMART_CHARGE_END])
buf[SMART_CHARGE_END] = buf[SMART_CHARGE_START] + 1;
return gaokun_ec_psy_set_smart_charge(ecbat->ec, buf);
case POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD:
buf[SMART_CHARGE_END] = val->intval;
if (buf[SMART_CHARGE_END] < buf[SMART_CHARGE_START])
buf[SMART_CHARGE_START] = buf[SMART_CHARGE_END] - 1;
return gaokun_ec_psy_set_smart_charge(ecbat->ec, buf);
default:
return -EINVAL;
}
return 0;
}
static int gaokun_psy_is_bat_property_writeable(struct power_supply *psy,
enum power_supply_property psp)
{
return psp == POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD ||
psp == POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD;
}
static enum power_supply_property gaokun_psy_bat_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
POWER_SUPPLY_PROP_CHARGE_FULL,
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD,
POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD,
POWER_SUPPLY_PROP_CAPACITY,
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
};
static const struct power_supply_desc gaokun_psy_bat_desc = {
.name = "gaokun-ec-battery",
.type = POWER_SUPPLY_TYPE_BATTERY,
.get_property = gaokun_psy_get_bat_property,
.set_property = gaokun_psy_set_bat_property,
.property_is_writeable = gaokun_psy_is_bat_property_writeable,
.properties = gaokun_psy_bat_props,
.num_properties = ARRAY_SIZE(gaokun_psy_bat_props),
};
/* -------------------------------------------------------------------------- */
/* Sysfs */
/*
* Note that, HUAWEI calls them SBAC/GBAC and SBCM/GBCM in DSDT, they are likely
* Set/Get Battery Adaptive Charging and Set/Get Battery Charging Mode.
*/
/* battery adaptive charge */
static ssize_t battery_adaptive_charge_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct power_supply *psy = to_power_supply(dev);
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
int ret;
bool on;
ret = gaokun_ec_psy_get_smart_charge_enable(ecbat->ec, &on);
if (ret)
return ret;
return sysfs_emit(buf, "%d\n", on);
}
static ssize_t battery_adaptive_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct power_supply *psy = to_power_supply(dev);
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
int ret;
bool on;
if (kstrtobool(buf, &on))
return -EINVAL;
ret = gaokun_ec_psy_set_smart_charge_enable(ecbat->ec, on);
if (ret)
return ret;
return size;
}
static DEVICE_ATTR_RW(battery_adaptive_charge);
static inline int get_charge_delay(u8 buf[GAOKUN_SMART_CHARGE_DATA_SIZE])
{
return buf[SMART_CHARGE_MODE] == NO_DELAY_MODE ? 0 : buf[SMART_CHARGE_DELAY];
}
static inline void
set_charge_delay(u8 buf[GAOKUN_SMART_CHARGE_DATA_SIZE], u8 delay)
{
if (delay) {
buf[SMART_CHARGE_DELAY] = delay;
buf[SMART_CHARGE_MODE] = DELAY_MODE;
} else {
/* No writing zero, there is a specific mode for it. */
buf[SMART_CHARGE_MODE] = NO_DELAY_MODE;
}
}
/* Smart charge */
static ssize_t smart_charge_delay_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct power_supply *psy = to_power_supply(dev);
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
u8 bf[GAOKUN_SMART_CHARGE_DATA_SIZE];
int ret;
ret = gaokun_ec_psy_get_smart_charge(ecbat->ec, bf);
if (ret)
return ret;
return sysfs_emit(buf, "%d\n", get_charge_delay(bf));
}
static ssize_t smart_charge_delay_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct power_supply *psy = to_power_supply(dev);
struct gaokun_psy *ecbat = power_supply_get_drvdata(psy);
u8 bf[GAOKUN_SMART_CHARGE_DATA_SIZE];
u8 delay;
int ret;
if (kstrtou8(buf, 10, &delay))
return -EINVAL;
ret = gaokun_ec_psy_get_smart_charge(ecbat->ec, bf);
if (ret)
return ret;
set_charge_delay(bf, delay);
ret = gaokun_ec_psy_set_smart_charge(ecbat->ec, bf);
if (ret)
return ret;
return size;
}
static DEVICE_ATTR_RW(smart_charge_delay);
static struct attribute *gaokun_psy_features_attrs[] = {
&dev_attr_battery_adaptive_charge.attr,
&dev_attr_smart_charge_delay.attr,
NULL,
};
ATTRIBUTE_GROUPS(gaokun_psy_features);
static int gaokun_psy_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
struct gaokun_psy *ecbat = container_of(nb, struct gaokun_psy, nb);
switch (action) {
case EC_EVENT_BAT_A2:
case EC_EVENT_BAT_B1:
gaokun_psy_get_bat_info(ecbat);
return NOTIFY_OK;
case EC_EVENT_BAT_A0:
gaokun_psy_get_adp_status(ecbat);
power_supply_changed(ecbat->adp_psy);
msleep(10);
fallthrough;
case EC_EVENT_BAT_A1:
case EC_EVENT_BAT_A3:
if (action == EC_EVENT_BAT_A3) {
gaokun_psy_get_bat_info(ecbat);
msleep(100);
}
gaokun_psy_get_bat_status(ecbat);
power_supply_changed(ecbat->bat_psy);
return NOTIFY_OK;
default:
return NOTIFY_DONE;
}
}
static int gaokun_psy_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{
struct gaokun_ec *ec = adev->dev.platform_data;
struct power_supply_config psy_cfg = {};
struct device *dev = &adev->dev;
struct gaokun_psy *ecbat;
ecbat = devm_kzalloc(&adev->dev, sizeof(*ecbat), GFP_KERNEL);
if (!ecbat)
return -ENOMEM;
ecbat->ec = ec;
ecbat->dev = dev;
ecbat->nb.notifier_call = gaokun_psy_notify;
auxiliary_set_drvdata(adev, ecbat);
psy_cfg.drv_data = ecbat;
ecbat->adp_psy = devm_power_supply_register(dev, &gaokun_psy_adp_desc,
&psy_cfg);
if (IS_ERR(ecbat->adp_psy))
return dev_err_probe(dev, PTR_ERR(ecbat->adp_psy),
"Failed to register AC power supply\n");
psy_cfg.supplied_to = (char **)&gaokun_psy_bat_desc.name;
psy_cfg.num_supplicants = 1;
psy_cfg.no_wakeup_source = true;
psy_cfg.attr_grp = gaokun_psy_features_groups;
ecbat->bat_psy = devm_power_supply_register(dev, &gaokun_psy_bat_desc,
&psy_cfg);
if (IS_ERR(ecbat->bat_psy))
return dev_err_probe(dev, PTR_ERR(ecbat->bat_psy),
"Failed to register battery power supply\n");
gaokun_psy_init(ecbat);
return gaokun_ec_register_notify(ec, &ecbat->nb);
}
static void gaokun_psy_remove(struct auxiliary_device *adev)
{
struct gaokun_psy *ecbat = auxiliary_get_drvdata(adev);
gaokun_ec_unregister_notify(ecbat->ec, &ecbat->nb);
}
static const struct auxiliary_device_id gaokun_psy_id_table[] = {
{ .name = GAOKUN_MOD_NAME "." GAOKUN_DEV_PSY, },
{}
};
MODULE_DEVICE_TABLE(auxiliary, gaokun_psy_id_table);
static struct auxiliary_driver gaokun_psy_driver = {
.name = GAOKUN_DEV_PSY,
.id_table = gaokun_psy_id_table,
.probe = gaokun_psy_probe,
.remove = gaokun_psy_remove,
};
module_auxiliary_driver(gaokun_psy_driver);
MODULE_DESCRIPTION("HUAWEI Matebook E Go psy driver");
MODULE_LICENSE("GPL");
|