| 50 | | SENSORS_INSMOD_5(pc87360, pc87363, pc87364, pc87365, pc87366); |
| | 51 | enum chips { any_chip, pc87360, pc87363, pc87364, pc87365, pc87366 }; |
| | 52 | static struct i2c_address_data addr_data = { |
| | 53 | .normal_i2c = normal_i2c, |
| | 54 | .normal_i2c_range = normal_i2c_range, |
| | 55 | .normal_isa = normal_isa, |
| | 56 | .normal_isa_range = normal_isa_range, |
| | 57 | .probe = normal_i2c, /* cheat */ |
| | 58 | .probe_range = normal_i2c_range, /* cheat */ |
| | 59 | .ignore = normal_i2c, /* cheat */ |
| | 60 | .ignore_range = normal_i2c_range, /* cheat */ |
| | 61 | .forces = forces, |
| | 62 | }; |
| | 63 | |
| | 64 | static int init = 1; |
| | 65 | MODULE_PARM(init, "i"); |
| | 66 | MODULE_PARM_DESC(init, |
| | 67 | "Chip initialization level:\n" |
| | 68 | " 0: None\n" |
| | 69 | "*1: Forcibly enable internal voltage and temperature channels, except in9\n" |
| | 70 | " 2: Forcibly enable all voltage and temperature channels, except in9\n" |
| | 71 | " 3: Forcibly enable all voltage and temperature channels, including in9"); |
| 654 | | if (data->innr >= 10) { |
| 655 | | /* Forcibly enable in7 (Vsb) */ |
| 656 | | reg = pc87360_read_value(data, LD_IN, 7, |
| 657 | | PC87365_REG_IN_STATUS); |
| 658 | | if (!(reg & 0x01)) { |
| | 687 | for (i=0; i<data->innr; i++) { |
| | 688 | if (init >= init_in[i]) { |
| | 689 | /* Forcibly enable voltage channel */ |
| | 690 | reg = pc87360_read_value(data, LD_IN, i, |
| | 691 | PC87365_REG_IN_STATUS); |
| | 692 | if (!(reg & 0x01)) { |
| 663 | | pc87360_write_value(data, LD_IN, 7, |
| 664 | | PC87365_REG_IN_STATUS, |
| 665 | | (reg & 0x68) | 0x87); |
| 666 | | } |
| 667 | | /* Forcibly enable in8 (Vdd) */ |
| 668 | | reg = pc87360_read_value(data, LD_IN, 8, |
| 669 | | PC87365_REG_IN_STATUS); |
| 670 | | if (!(reg & 0x01)) { |
| 671 | | pc87360_write_value(data, LD_IN, 8, |
| 672 | | PC87365_REG_IN_STATUS, |
| 673 | | (reg & 0x68) | 0x87); |
| | 697 | pc87360_write_value(data, LD_IN, i, |
| | 698 | PC87365_REG_IN_STATUS, |
| | 699 | (reg & 0x68) | 0x87); |
| | 700 | } |
| | 701 | |
| | 702 | } |
| | 703 | } |
| | 704 | |
| | 705 | for (i=0; i<data->tempnr; i++) { |
| | 706 | if (init >= init_temp[i]) { |
| | 707 | /* Forcibly enable temperature channel */ |
| | 708 | reg = pc87360_read_value(data, LD_TEMP, i, |
| | 709 | PC87365_REG_TEMP_STATUS); |
| | 710 | if (!(reg & 0x01)) { |
| 678 | | } |
| 679 | | /* Forcibly enable in10 (AVdd) */ |
| 680 | | reg = pc87360_read_value(data, LD_IN, 10, |
| 681 | | PC87365_REG_IN_STATUS); |
| 682 | | if (!(reg & 0x01)) { |
| 683 | | pc87360_write_value(data, LD_IN, 10, |
| 684 | | PC87365_REG_IN_STATUS, |
| 685 | | (reg & 0x68) | 0x87); |
| 686 | | #ifdef DEBUG |
| 687 | | printk(KERN_DEBUG "pc87360.o: Forcibly enabling " |
| 688 | | "in10 (AVdd)\n"); |
| 689 | | #endif |
| 690 | | } |
| 691 | | } |
| 692 | | if (data->tempnr >= 3) { |
| 693 | | /* Forcibly enable temp3 (PC87366 temperature) */ |
| 694 | | reg = pc87360_read_value(data, LD_TEMP, 2, |
| 695 | | PC87365_REG_TEMP_STATUS); |
| 696 | | if (!(reg & 0x01)) { |
| 697 | | pc87360_write_value(data, LD_TEMP, 2, |
| 698 | | PC87365_REG_TEMP_STATUS, 0xCF); |
| 699 | | #ifdef DEBUG |
| 700 | | printk(KERN_DEBUG "pc87360.o: Forcibly enabling " |
| 701 | | "temp3 (PC87366 temperature)\n"); |
| 702 | | #endif |
| | 715 | pc87360_write_value(data, LD_TEMP, i, |
| | 716 | PC87365_REG_TEMP_STATUS, |
| | 717 | 0xCF); |
| | 718 | } |