Source
37
37
*/
38
38
39
39
static const unsigned short normal_i2c[] = {0x18, 0x19, 0x1a, 0x2c, 0x2d, 0x2e,
40
40
0x4c, 0x4d, 0x4e, I2C_CLIENT_END};
41
41
42
42
/*
43
43
* Insmod parameters
44
44
*/
45
45
46
46
static int pwminv; /*Inverted PWM output. */
47
-
module_param(pwminv, int, S_IRUGO);
47
+
module_param(pwminv, int, 0444);
48
48
49
49
static int init = 1; /*Power-on initialization.*/
50
-
module_param(init, int, S_IRUGO);
50
+
module_param(init, int, 0444);
51
51
52
52
enum chips { amc6821 };
53
53
54
54
#define AMC6821_REG_DEV_ID 0x3D
55
55
#define AMC6821_REG_COMP_ID 0x3E
56
56
#define AMC6821_REG_CONF1 0x00
57
57
#define AMC6821_REG_CONF2 0x01
58
58
#define AMC6821_REG_CONF3 0x3F
59
59
#define AMC6821_REG_CONF4 0x04
60
60
#define AMC6821_REG_STAT1 0x02
270
270
break;
271
271
}
272
272
273
273
data->last_updated = jiffies;
274
274
data->valid = 1;
275
275
}
276
276
mutex_unlock(&data->update_lock);
277
277
return data;
278
278
}
279
279
280
-
static ssize_t get_temp(
281
-
struct device *dev,
282
-
struct device_attribute *devattr,
283
-
char *buf)
280
+
static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
281
+
char *buf)
284
282
{
285
283
struct amc6821_data *data = amc6821_update_device(dev);
286
284
int ix = to_sensor_dev_attr(devattr)->index;
287
285
288
286
return sprintf(buf, "%d\n", data->temp[ix] * 1000);
289
287
}
290
288
291
-
static ssize_t set_temp(
292
-
struct device *dev,
293
-
struct device_attribute *attr,
294
-
const char *buf,
295
-
size_t count)
289
+
static ssize_t temp_store(struct device *dev, struct device_attribute *attr,
290
+
const char *buf, size_t count)
296
291
{
297
292
struct amc6821_data *data = dev_get_drvdata(dev);
298
293
struct i2c_client *client = data->client;
299
294
int ix = to_sensor_dev_attr(attr)->index;
300
295
long val;
301
296
302
297
int ret = kstrtol(buf, 10, &val);
303
298
if (ret)
304
299
return ret;
305
300
val = clamp_val(val / 1000, -128, 127);
307
302
mutex_lock(&data->update_lock);
308
303
data->temp[ix] = val;
309
304
if (i2c_smbus_write_byte_data(client, temp_reg[ix], data->temp[ix])) {
310
305
dev_err(&client->dev, "Register write error, aborting.\n");
311
306
count = -EIO;
312
307
}
313
308
mutex_unlock(&data->update_lock);
314
309
return count;
315
310
}
316
311
317
-
static ssize_t get_temp_alarm(
318
-
struct device *dev,
319
-
struct device_attribute *devattr,
320
-
char *buf)
312
+
static ssize_t temp_alarm_show(struct device *dev,
313
+
struct device_attribute *devattr, char *buf)
321
314
{
322
315
struct amc6821_data *data = amc6821_update_device(dev);
323
316
int ix = to_sensor_dev_attr(devattr)->index;
324
317
u8 flag;
325
318
326
319
switch (ix) {
327
320
case IDX_TEMP1_MIN:
328
321
flag = data->stat1 & AMC6821_STAT1_LTL;
329
322
break;
330
323
case IDX_TEMP1_MAX:
345
338
default:
346
339
dev_dbg(dev, "Unknown attr->index (%d).\n", ix);
347
340
return -EINVAL;
348
341
}
349
342
if (flag)
350
343
return sprintf(buf, "1");
351
344
else
352
345
return sprintf(buf, "0");
353
346
}
354
347
355
-
static ssize_t get_temp2_fault(
356
-
struct device *dev,
357
-
struct device_attribute *devattr,
358
-
char *buf)
348
+
static ssize_t temp2_fault_show(struct device *dev,
349
+
struct device_attribute *devattr, char *buf)
359
350
{
360
351
struct amc6821_data *data = amc6821_update_device(dev);
361
352
if (data->stat1 & AMC6821_STAT1_RTF)
362
353
return sprintf(buf, "1");
363
354
else
364
355
return sprintf(buf, "0");
365
356
}
366
357
367
-
static ssize_t get_pwm1(
368
-
struct device *dev,
369
-
struct device_attribute *devattr,
370
-
char *buf)
358
+
static ssize_t pwm1_show(struct device *dev, struct device_attribute *devattr,
359
+
char *buf)
371
360
{
372
361
struct amc6821_data *data = amc6821_update_device(dev);
373
362
return sprintf(buf, "%d\n", data->pwm1);
374
363
}
375
364
376
-
static ssize_t set_pwm1(
377
-
struct device *dev,
378
-
struct device_attribute *devattr,
379
-
const char *buf,
380
-
size_t count)
365
+
static ssize_t pwm1_store(struct device *dev,
366
+
struct device_attribute *devattr, const char *buf,
367
+
size_t count)
381
368
{
382
369
struct amc6821_data *data = dev_get_drvdata(dev);
383
370
struct i2c_client *client = data->client;
384
371
long val;
385
372
int ret = kstrtol(buf, 10, &val);
386
373
if (ret)
387
374
return ret;
388
375
389
376
mutex_lock(&data->update_lock);
390
377
data->pwm1 = clamp_val(val , 0, 255);
391
378
i2c_smbus_write_byte_data(client, AMC6821_REG_DCY, data->pwm1);
392
379
mutex_unlock(&data->update_lock);
393
380
return count;
394
381
}
395
382
396
-
static ssize_t get_pwm1_enable(
397
-
struct device *dev,
398
-
struct device_attribute *devattr,
399
-
char *buf)
383
+
static ssize_t pwm1_enable_show(struct device *dev,
384
+
struct device_attribute *devattr, char *buf)
400
385
{
401
386
struct amc6821_data *data = amc6821_update_device(dev);
402
387
return sprintf(buf, "%d\n", data->pwm1_enable);
403
388
}
404
389
405
-
static ssize_t set_pwm1_enable(
406
-
struct device *dev,
407
-
struct device_attribute *attr,
408
-
const char *buf,
409
-
size_t count)
390
+
static ssize_t pwm1_enable_store(struct device *dev,
391
+
struct device_attribute *attr,
392
+
const char *buf, size_t count)
410
393
{
411
394
struct amc6821_data *data = dev_get_drvdata(dev);
412
395
struct i2c_client *client = data->client;
413
396
long val;
414
397
int config = kstrtol(buf, 10, &val);
415
398
if (config)
416
399
return config;
417
400
418
401
mutex_lock(&data->update_lock);
419
402
config = i2c_smbus_read_byte_data(client, AMC6821_REG_CONF1);
444
427
if (i2c_smbus_write_byte_data(client, AMC6821_REG_CONF1, config)) {
445
428
dev_err(&client->dev,
446
429
"Configuration register write error, aborting.\n");
447
430
count = -EIO;
448
431
}
449
432
unlock:
450
433
mutex_unlock(&data->update_lock);
451
434
return count;
452
435
}
453
436
454
-
static ssize_t get_pwm1_auto_channels_temp(
455
-
struct device *dev,
456
-
struct device_attribute *devattr,
457
-
char *buf)
437
+
static ssize_t pwm1_auto_channels_temp_show(struct device *dev,
438
+
struct device_attribute *devattr,
439
+
char *buf)
458
440
{
459
441
struct amc6821_data *data = amc6821_update_device(dev);
460
442
return sprintf(buf, "%d\n", data->pwm1_auto_channels_temp);
461
443
}
462
444
463
-
static ssize_t get_temp_auto_point_temp(
464
-
struct device *dev,
465
-
struct device_attribute *devattr,
466
-
char *buf)
445
+
static ssize_t temp_auto_point_temp_show(struct device *dev,
446
+
struct device_attribute *devattr,
447
+
char *buf)
467
448
{
468
449
int ix = to_sensor_dev_attr_2(devattr)->index;
469
450
int nr = to_sensor_dev_attr_2(devattr)->nr;
470
451
struct amc6821_data *data = amc6821_update_device(dev);
471
452
switch (nr) {
472
453
case 1:
473
454
return sprintf(buf, "%d\n",
474
455
data->temp1_auto_point_temp[ix] * 1000);
475
456
case 2:
476
457
return sprintf(buf, "%d\n",
477
458
data->temp2_auto_point_temp[ix] * 1000);
478
459
default:
479
460
dev_dbg(dev, "Unknown attr->nr (%d).\n", nr);
480
461
return -EINVAL;
481
462
}
482
463
}
483
464
484
-
static ssize_t get_pwm1_auto_point_pwm(
485
-
struct device *dev,
486
-
struct device_attribute *devattr,
487
-
char *buf)
465
+
static ssize_t pwm1_auto_point_pwm_show(struct device *dev,
466
+
struct device_attribute *devattr,
467
+
char *buf)
488
468
{
489
469
int ix = to_sensor_dev_attr(devattr)->index;
490
470
struct amc6821_data *data = amc6821_update_device(dev);
491
471
return sprintf(buf, "%d\n", data->pwm1_auto_point_pwm[ix]);
492
472
}
493
473
494
474
static inline ssize_t set_slope_register(struct i2c_client *client,
495
475
u8 reg,
496
476
u8 dpwm,
497
477
u8 *ptemp)
506
486
}
507
487
tmp |= (ptemp[1] & 0x7C) << 1;
508
488
if (i2c_smbus_write_byte_data(client,
509
489
reg, tmp)) {
510
490
dev_err(&client->dev, "Register write error, aborting.\n");
511
491
return -EIO;
512
492
}
513
493
return 0;
514
494
}
515
495
516
-
static ssize_t set_temp_auto_point_temp(
517
-
struct device *dev,
518
-
struct device_attribute *attr,
519
-
const char *buf,
520
-
size_t count)
496
+
static ssize_t temp_auto_point_temp_store(struct device *dev,
497
+
struct device_attribute *attr,
498
+
const char *buf, size_t count)
521
499
{
522
500
struct amc6821_data *data = amc6821_update_device(dev);
523
501
struct i2c_client *client = data->client;
524
502
int ix = to_sensor_dev_attr_2(attr)->index;
525
503
int nr = to_sensor_dev_attr_2(attr)->nr;
526
504
u8 *ptemp;
527
505
u8 reg;
528
506
int dpwm;
529
507
long val;
530
508
int ret = kstrtol(buf, 10, &val);
579
557
}
580
558
dpwm = data->pwm1_auto_point_pwm[2] - data->pwm1_auto_point_pwm[1];
581
559
if (set_slope_register(client, reg, dpwm, ptemp))
582
560
count = -EIO;
583
561
584
562
EXIT:
585
563
mutex_unlock(&data->update_lock);
586
564
return count;
587
565
}
588
566
589
-
static ssize_t set_pwm1_auto_point_pwm(
590
-
struct device *dev,
591
-
struct device_attribute *attr,
592
-
const char *buf,
593
-
size_t count)
567
+
static ssize_t pwm1_auto_point_pwm_store(struct device *dev,
568
+
struct device_attribute *attr,
569
+
const char *buf, size_t count)
594
570
{
595
571
struct amc6821_data *data = dev_get_drvdata(dev);
596
572
struct i2c_client *client = data->client;
597
573
int dpwm;
598
574
long val;
599
575
int ret = kstrtol(buf, 10, &val);
600
576
if (ret)
601
577
return ret;
602
578
603
579
mutex_lock(&data->update_lock);
619
595
count = -EIO;
620
596
goto EXIT;
621
597
}
622
598
623
599
EXIT:
624
600
data->valid = 0;
625
601
mutex_unlock(&data->update_lock);
626
602
return count;
627
603
}
628
604
629
-
static ssize_t get_fan(
630
-
struct device *dev,
631
-
struct device_attribute *devattr,
632
-
char *buf)
605
+
static ssize_t fan_show(struct device *dev, struct device_attribute *devattr,
606
+
char *buf)
633
607
{
634
608
struct amc6821_data *data = amc6821_update_device(dev);
635
609
int ix = to_sensor_dev_attr(devattr)->index;
636
610
if (0 == data->fan[ix])
637
611
return sprintf(buf, "0");
638
612
return sprintf(buf, "%d\n", (int)(6000000 / data->fan[ix]));
639
613
}
640
614
641
-
static ssize_t get_fan1_fault(
642
-
struct device *dev,
643
-
struct device_attribute *devattr,
644
-
char *buf)
615
+
static ssize_t fan1_fault_show(struct device *dev,
616
+
struct device_attribute *devattr, char *buf)
645
617
{
646
618
struct amc6821_data *data = amc6821_update_device(dev);
647
619
if (data->stat1 & AMC6821_STAT1_FANS)
648
620
return sprintf(buf, "1");
649
621
else
650
622
return sprintf(buf, "0");
651
623
}
652
624
653
-
static ssize_t set_fan(
654
-
struct device *dev,
655
-
struct device_attribute *attr,
656
-
const char *buf, size_t count)
625
+
static ssize_t fan_store(struct device *dev, struct device_attribute *attr,
626
+
const char *buf, size_t count)
657
627
{
658
628
struct amc6821_data *data = dev_get_drvdata(dev);
659
629
struct i2c_client *client = data->client;
660
630
long val;
661
631
int ix = to_sensor_dev_attr(attr)->index;
662
632
int ret = kstrtol(buf, 10, &val);
663
633
if (ret)
664
634
return ret;
665
635
val = 1 > val ? 0xFFFF : 6000000/val;
666
636
675
645
if (i2c_smbus_write_byte_data(client,
676
646
fan_reg_hi[ix], data->fan[ix] >> 8)) {
677
647
dev_err(&client->dev, "Register write error, aborting.\n");
678
648
count = -EIO;
679
649
}
680
650
EXIT:
681
651
mutex_unlock(&data->update_lock);
682
652
return count;
683
653
}
684
654
685
-
static ssize_t get_fan1_div(
686
-
struct device *dev,
687
-
struct device_attribute *devattr,
688
-
char *buf)
655
+
static ssize_t fan1_div_show(struct device *dev,
656
+
struct device_attribute *devattr, char *buf)
689
657
{
690
658
struct amc6821_data *data = amc6821_update_device(dev);
691
659
return sprintf(buf, "%d\n", data->fan1_div);
692
660
}
693
661
694
-
static ssize_t set_fan1_div(
695
-
struct device *dev,
696
-
struct device_attribute *attr,
697
-
const char *buf, size_t count)
662
+
static ssize_t fan1_div_store(struct device *dev,
663
+
struct device_attribute *attr, const char *buf,
664
+
size_t count)
698
665
{
699
666
struct amc6821_data *data = dev_get_drvdata(dev);
700
667
struct i2c_client *client = data->client;
701
668
long val;
702
669
int config = kstrtol(buf, 10, &val);
703
670
if (config)
704
671
return config;
705
672
706
673
mutex_lock(&data->update_lock);
707
674
config = i2c_smbus_read_byte_data(client, AMC6821_REG_CONF4);
727
694
if (i2c_smbus_write_byte_data(client, AMC6821_REG_CONF4, config)) {
728
695
dev_err(&client->dev,
729
696
"Configuration register write error, aborting.\n");
730
697
count = -EIO;
731
698
}
732
699
EXIT:
733
700
mutex_unlock(&data->update_lock);
734
701
return count;
735
702
}
736
703
737
-
static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO,
738
-
get_temp, NULL, IDX_TEMP1_INPUT);
739
-
static SENSOR_DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, get_temp,
740
-
set_temp, IDX_TEMP1_MIN);
741
-
static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, get_temp,
742
-
set_temp, IDX_TEMP1_MAX);
743
-
static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO | S_IWUSR, get_temp,
744
-
set_temp, IDX_TEMP1_CRIT);
745
-
static SENSOR_DEVICE_ATTR(temp1_min_alarm, S_IRUGO,
746
-
get_temp_alarm, NULL, IDX_TEMP1_MIN);
747
-
static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO,
748
-
get_temp_alarm, NULL, IDX_TEMP1_MAX);
749
-
static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO,
750
-
get_temp_alarm, NULL, IDX_TEMP1_CRIT);
751
-
static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO,
752
-
get_temp, NULL, IDX_TEMP2_INPUT);
753
-
static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO | S_IWUSR, get_temp,
754
-
set_temp, IDX_TEMP2_MIN);
755
-
static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO | S_IWUSR, get_temp,
756
-
set_temp, IDX_TEMP2_MAX);
757
-
static SENSOR_DEVICE_ATTR(temp2_crit, S_IRUGO | S_IWUSR, get_temp,
758
-
set_temp, IDX_TEMP2_CRIT);
759
-
static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO,
760
-
get_temp2_fault, NULL, 0);
761
-
static SENSOR_DEVICE_ATTR(temp2_min_alarm, S_IRUGO,
762
-
get_temp_alarm, NULL, IDX_TEMP2_MIN);
763
-
static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO,
764
-
get_temp_alarm, NULL, IDX_TEMP2_MAX);
765
-
static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO,
766
-
get_temp_alarm, NULL, IDX_TEMP2_CRIT);
767
-
static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, get_fan, NULL, IDX_FAN1_INPUT);
768
-
static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO | S_IWUSR,
769
-
get_fan, set_fan, IDX_FAN1_MIN);
770
-
static SENSOR_DEVICE_ATTR(fan1_max, S_IRUGO | S_IWUSR,
771
-
get_fan, set_fan, IDX_FAN1_MAX);
772
-
static SENSOR_DEVICE_ATTR(fan1_fault, S_IRUGO, get_fan1_fault, NULL, 0);
773
-
static SENSOR_DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR,
774
-
get_fan1_div, set_fan1_div, 0);
775
-
776
-
static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, get_pwm1, set_pwm1, 0);
777
-
static SENSOR_DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO,
778
-
get_pwm1_enable, set_pwm1_enable, 0);
779
-
static SENSOR_DEVICE_ATTR(pwm1_auto_point1_pwm, S_IRUGO,
780
-
get_pwm1_auto_point_pwm, NULL, 0);
781
-
static SENSOR_DEVICE_ATTR(pwm1_auto_point2_pwm, S_IWUSR | S_IRUGO,
782
-
get_pwm1_auto_point_pwm, set_pwm1_auto_point_pwm, 1);
783
-
static SENSOR_DEVICE_ATTR(pwm1_auto_point3_pwm, S_IRUGO,
784
-
get_pwm1_auto_point_pwm, NULL, 2);
785
-
static SENSOR_DEVICE_ATTR(pwm1_auto_channels_temp, S_IRUGO,
786
-
get_pwm1_auto_channels_temp, NULL, 0);
787
-
static SENSOR_DEVICE_ATTR_2(temp1_auto_point1_temp, S_IRUGO,
788
-
get_temp_auto_point_temp, NULL, 1, 0);
789
-
static SENSOR_DEVICE_ATTR_2(temp1_auto_point2_temp, S_IWUSR | S_IRUGO,
790
-
get_temp_auto_point_temp, set_temp_auto_point_temp, 1, 1);
791
-
static SENSOR_DEVICE_ATTR_2(temp1_auto_point3_temp, S_IWUSR | S_IRUGO,
792
-
get_temp_auto_point_temp, set_temp_auto_point_temp, 1, 2);
793
-
794
-
static SENSOR_DEVICE_ATTR_2(temp2_auto_point1_temp, S_IWUSR | S_IRUGO,
795
-
get_temp_auto_point_temp, set_temp_auto_point_temp, 2, 0);
796
-
static SENSOR_DEVICE_ATTR_2(temp2_auto_point2_temp, S_IWUSR | S_IRUGO,
797
-
get_temp_auto_point_temp, set_temp_auto_point_temp, 2, 1);
798
-
static SENSOR_DEVICE_ATTR_2(temp2_auto_point3_temp, S_IWUSR | S_IRUGO,
799
-
get_temp_auto_point_temp, set_temp_auto_point_temp, 2, 2);
704
+
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, IDX_TEMP1_INPUT);
705
+
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp, IDX_TEMP1_MIN);
706
+
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, IDX_TEMP1_MAX);
707
+
static SENSOR_DEVICE_ATTR_RW(temp1_crit, temp, IDX_TEMP1_CRIT);
708
+
static SENSOR_DEVICE_ATTR_RO(temp1_min_alarm, temp_alarm, IDX_TEMP1_MIN);
709
+
static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, temp_alarm, IDX_TEMP1_MAX);
710
+
static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, temp_alarm, IDX_TEMP1_CRIT);
711
+
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, IDX_TEMP2_INPUT);
712
+
static SENSOR_DEVICE_ATTR_RW(temp2_min, temp, IDX_TEMP2_MIN);
713
+
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp, IDX_TEMP2_MAX);
714
+
static SENSOR_DEVICE_ATTR_RW(temp2_crit, temp, IDX_TEMP2_CRIT);
715
+
static SENSOR_DEVICE_ATTR_RO(temp2_fault, temp2_fault, 0);
716
+
static SENSOR_DEVICE_ATTR_RO(temp2_min_alarm, temp_alarm, IDX_TEMP2_MIN);
717
+
static SENSOR_DEVICE_ATTR_RO(temp2_max_alarm, temp_alarm, IDX_TEMP2_MAX);
718
+
static SENSOR_DEVICE_ATTR_RO(temp2_crit_alarm, temp_alarm, IDX_TEMP2_CRIT);
719
+
static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, IDX_FAN1_INPUT);
720
+
static SENSOR_DEVICE_ATTR_RW(fan1_min, fan, IDX_FAN1_MIN);
721
+
static SENSOR_DEVICE_ATTR_RW(fan1_max, fan, IDX_FAN1_MAX);
722
+
static SENSOR_DEVICE_ATTR_RO(fan1_fault, fan1_fault, 0);
723
+
static SENSOR_DEVICE_ATTR_RW(fan1_div, fan1_div, 0);
724
+
725
+
static SENSOR_DEVICE_ATTR_RW(pwm1, pwm1, 0);
726
+
static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm1_enable, 0);
727
+
static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point1_pwm, pwm1_auto_point_pwm, 0);
728
+
static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point2_pwm, pwm1_auto_point_pwm, 1);
729
+
static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point3_pwm, pwm1_auto_point_pwm, 2);
730
+
static SENSOR_DEVICE_ATTR_RO(pwm1_auto_channels_temp, pwm1_auto_channels_temp,
731
+
0);
732
+
static SENSOR_DEVICE_ATTR_2_RO(temp1_auto_point1_temp, temp_auto_point_temp,
733
+
1, 0);
734
+
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_point2_temp, temp_auto_point_temp,
735
+
1, 1);
736
+
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_point3_temp, temp_auto_point_temp,
737
+
1, 2);
738
+
739
+
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_point1_temp, temp_auto_point_temp,
740
+
2, 0);
741
+
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_point2_temp, temp_auto_point_temp,
742
+
2, 1);
743
+
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_point3_temp, temp_auto_point_temp,
744
+
2, 2);
800
745
801
746
static struct attribute *amc6821_attrs[] = {
802
747
&sensor_dev_attr_temp1_input.dev_attr.attr,
803
748
&sensor_dev_attr_temp1_min.dev_attr.attr,
804
749
&sensor_dev_attr_temp1_max.dev_attr.attr,
805
750
&sensor_dev_attr_temp1_crit.dev_attr.attr,
806
751
&sensor_dev_attr_temp1_min_alarm.dev_attr.attr,
807
752
&sensor_dev_attr_temp1_max_alarm.dev_attr.attr,
808
753
&sensor_dev_attr_temp1_crit_alarm.dev_attr.attr,
809
754
&sensor_dev_attr_temp2_input.dev_attr.attr,