diff options
Diffstat (limited to 'drivers/hwmon/adm1026.c')
-rw-r--r-- | drivers/hwmon/adm1026.c | 286 |
1 files changed, 146 insertions, 140 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 6d4f8b8d358e..b4618b2705f7 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -323,15 +323,6 @@ static int adm1026_attach_adapter(struct i2c_adapter *adapter) | |||
323 | return i2c_probe(adapter, &addr_data, adm1026_detect); | 323 | return i2c_probe(adapter, &addr_data, adm1026_detect); |
324 | } | 324 | } |
325 | 325 | ||
326 | static int adm1026_detach_client(struct i2c_client *client) | ||
327 | { | ||
328 | struct adm1026_data *data = i2c_get_clientdata(client); | ||
329 | hwmon_device_unregister(data->class_dev); | ||
330 | i2c_detach_client(client); | ||
331 | kfree(data); | ||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | static int adm1026_read_value(struct i2c_client *client, u8 reg) | 326 | static int adm1026_read_value(struct i2c_client *client, u8 reg) |
336 | { | 327 | { |
337 | int res; | 328 | int res; |
@@ -1450,6 +1441,135 @@ static DEVICE_ATTR(temp1_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); | |||
1450 | static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); | 1441 | static DEVICE_ATTR(temp2_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); |
1451 | static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); | 1442 | static DEVICE_ATTR(temp3_auto_point2_pwm, S_IRUGO, show_auto_pwm_max, NULL); |
1452 | 1443 | ||
1444 | static struct attribute *adm1026_attributes[] = { | ||
1445 | &sensor_dev_attr_in0_input.dev_attr.attr, | ||
1446 | &sensor_dev_attr_in0_max.dev_attr.attr, | ||
1447 | &sensor_dev_attr_in0_min.dev_attr.attr, | ||
1448 | &sensor_dev_attr_in1_input.dev_attr.attr, | ||
1449 | &sensor_dev_attr_in1_max.dev_attr.attr, | ||
1450 | &sensor_dev_attr_in1_min.dev_attr.attr, | ||
1451 | &sensor_dev_attr_in2_input.dev_attr.attr, | ||
1452 | &sensor_dev_attr_in2_max.dev_attr.attr, | ||
1453 | &sensor_dev_attr_in2_min.dev_attr.attr, | ||
1454 | &sensor_dev_attr_in3_input.dev_attr.attr, | ||
1455 | &sensor_dev_attr_in3_max.dev_attr.attr, | ||
1456 | &sensor_dev_attr_in3_min.dev_attr.attr, | ||
1457 | &sensor_dev_attr_in4_input.dev_attr.attr, | ||
1458 | &sensor_dev_attr_in4_max.dev_attr.attr, | ||
1459 | &sensor_dev_attr_in4_min.dev_attr.attr, | ||
1460 | &sensor_dev_attr_in5_input.dev_attr.attr, | ||
1461 | &sensor_dev_attr_in5_max.dev_attr.attr, | ||
1462 | &sensor_dev_attr_in5_min.dev_attr.attr, | ||
1463 | &sensor_dev_attr_in6_input.dev_attr.attr, | ||
1464 | &sensor_dev_attr_in6_max.dev_attr.attr, | ||
1465 | &sensor_dev_attr_in6_min.dev_attr.attr, | ||
1466 | &sensor_dev_attr_in7_input.dev_attr.attr, | ||
1467 | &sensor_dev_attr_in7_max.dev_attr.attr, | ||
1468 | &sensor_dev_attr_in7_min.dev_attr.attr, | ||
1469 | &sensor_dev_attr_in8_input.dev_attr.attr, | ||
1470 | &sensor_dev_attr_in8_max.dev_attr.attr, | ||
1471 | &sensor_dev_attr_in8_min.dev_attr.attr, | ||
1472 | &sensor_dev_attr_in9_input.dev_attr.attr, | ||
1473 | &sensor_dev_attr_in9_max.dev_attr.attr, | ||
1474 | &sensor_dev_attr_in9_min.dev_attr.attr, | ||
1475 | &sensor_dev_attr_in10_input.dev_attr.attr, | ||
1476 | &sensor_dev_attr_in10_max.dev_attr.attr, | ||
1477 | &sensor_dev_attr_in10_min.dev_attr.attr, | ||
1478 | &sensor_dev_attr_in11_input.dev_attr.attr, | ||
1479 | &sensor_dev_attr_in11_max.dev_attr.attr, | ||
1480 | &sensor_dev_attr_in11_min.dev_attr.attr, | ||
1481 | &sensor_dev_attr_in12_input.dev_attr.attr, | ||
1482 | &sensor_dev_attr_in12_max.dev_attr.attr, | ||
1483 | &sensor_dev_attr_in12_min.dev_attr.attr, | ||
1484 | &sensor_dev_attr_in13_input.dev_attr.attr, | ||
1485 | &sensor_dev_attr_in13_max.dev_attr.attr, | ||
1486 | &sensor_dev_attr_in13_min.dev_attr.attr, | ||
1487 | &sensor_dev_attr_in14_input.dev_attr.attr, | ||
1488 | &sensor_dev_attr_in14_max.dev_attr.attr, | ||
1489 | &sensor_dev_attr_in14_min.dev_attr.attr, | ||
1490 | &sensor_dev_attr_in15_input.dev_attr.attr, | ||
1491 | &sensor_dev_attr_in15_max.dev_attr.attr, | ||
1492 | &sensor_dev_attr_in15_min.dev_attr.attr, | ||
1493 | &sensor_dev_attr_in16_input.dev_attr.attr, | ||
1494 | &sensor_dev_attr_in16_max.dev_attr.attr, | ||
1495 | &sensor_dev_attr_in16_min.dev_attr.attr, | ||
1496 | &sensor_dev_attr_fan1_input.dev_attr.attr, | ||
1497 | &sensor_dev_attr_fan1_div.dev_attr.attr, | ||
1498 | &sensor_dev_attr_fan1_min.dev_attr.attr, | ||
1499 | &sensor_dev_attr_fan2_input.dev_attr.attr, | ||
1500 | &sensor_dev_attr_fan2_div.dev_attr.attr, | ||
1501 | &sensor_dev_attr_fan2_min.dev_attr.attr, | ||
1502 | &sensor_dev_attr_fan3_input.dev_attr.attr, | ||
1503 | &sensor_dev_attr_fan3_div.dev_attr.attr, | ||
1504 | &sensor_dev_attr_fan3_min.dev_attr.attr, | ||
1505 | &sensor_dev_attr_fan4_input.dev_attr.attr, | ||
1506 | &sensor_dev_attr_fan4_div.dev_attr.attr, | ||
1507 | &sensor_dev_attr_fan4_min.dev_attr.attr, | ||
1508 | &sensor_dev_attr_fan5_input.dev_attr.attr, | ||
1509 | &sensor_dev_attr_fan5_div.dev_attr.attr, | ||
1510 | &sensor_dev_attr_fan5_min.dev_attr.attr, | ||
1511 | &sensor_dev_attr_fan6_input.dev_attr.attr, | ||
1512 | &sensor_dev_attr_fan6_div.dev_attr.attr, | ||
1513 | &sensor_dev_attr_fan6_min.dev_attr.attr, | ||
1514 | &sensor_dev_attr_fan7_input.dev_attr.attr, | ||
1515 | &sensor_dev_attr_fan7_div.dev_attr.attr, | ||
1516 | &sensor_dev_attr_fan7_min.dev_attr.attr, | ||
1517 | &sensor_dev_attr_fan8_input.dev_attr.attr, | ||
1518 | &sensor_dev_attr_fan8_div.dev_attr.attr, | ||
1519 | &sensor_dev_attr_fan8_min.dev_attr.attr, | ||
1520 | &sensor_dev_attr_temp1_input.dev_attr.attr, | ||
1521 | &sensor_dev_attr_temp1_max.dev_attr.attr, | ||
1522 | &sensor_dev_attr_temp1_min.dev_attr.attr, | ||
1523 | &sensor_dev_attr_temp2_input.dev_attr.attr, | ||
1524 | &sensor_dev_attr_temp2_max.dev_attr.attr, | ||
1525 | &sensor_dev_attr_temp2_min.dev_attr.attr, | ||
1526 | &sensor_dev_attr_temp3_input.dev_attr.attr, | ||
1527 | &sensor_dev_attr_temp3_max.dev_attr.attr, | ||
1528 | &sensor_dev_attr_temp3_min.dev_attr.attr, | ||
1529 | &sensor_dev_attr_temp1_offset.dev_attr.attr, | ||
1530 | &sensor_dev_attr_temp2_offset.dev_attr.attr, | ||
1531 | &sensor_dev_attr_temp3_offset.dev_attr.attr, | ||
1532 | &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr, | ||
1533 | &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr, | ||
1534 | &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr, | ||
1535 | &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr.attr, | ||
1536 | &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr.attr, | ||
1537 | &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr.attr, | ||
1538 | &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr, | ||
1539 | &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr, | ||
1540 | &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr, | ||
1541 | &sensor_dev_attr_temp1_crit.dev_attr.attr, | ||
1542 | &sensor_dev_attr_temp2_crit.dev_attr.attr, | ||
1543 | &sensor_dev_attr_temp3_crit.dev_attr.attr, | ||
1544 | &dev_attr_temp1_crit_enable.attr, | ||
1545 | &dev_attr_temp2_crit_enable.attr, | ||
1546 | &dev_attr_temp3_crit_enable.attr, | ||
1547 | &dev_attr_cpu0_vid.attr, | ||
1548 | &dev_attr_vrm.attr, | ||
1549 | &dev_attr_alarms.attr, | ||
1550 | &dev_attr_alarm_mask.attr, | ||
1551 | &dev_attr_gpio.attr, | ||
1552 | &dev_attr_gpio_mask.attr, | ||
1553 | &dev_attr_pwm1.attr, | ||
1554 | &dev_attr_pwm2.attr, | ||
1555 | &dev_attr_pwm3.attr, | ||
1556 | &dev_attr_pwm1_enable.attr, | ||
1557 | &dev_attr_pwm2_enable.attr, | ||
1558 | &dev_attr_pwm3_enable.attr, | ||
1559 | &dev_attr_temp1_auto_point1_pwm.attr, | ||
1560 | &dev_attr_temp2_auto_point1_pwm.attr, | ||
1561 | &dev_attr_temp3_auto_point1_pwm.attr, | ||
1562 | &dev_attr_temp1_auto_point2_pwm.attr, | ||
1563 | &dev_attr_temp2_auto_point2_pwm.attr, | ||
1564 | &dev_attr_temp3_auto_point2_pwm.attr, | ||
1565 | &dev_attr_analog_out.attr, | ||
1566 | NULL | ||
1567 | }; | ||
1568 | |||
1569 | static const struct attribute_group adm1026_group = { | ||
1570 | .attrs = adm1026_attributes, | ||
1571 | }; | ||
1572 | |||
1453 | static int adm1026_detect(struct i2c_adapter *adapter, int address, | 1573 | static int adm1026_detect(struct i2c_adapter *adapter, int address, |
1454 | int kind) | 1574 | int kind) |
1455 | { | 1575 | { |
@@ -1554,145 +1674,20 @@ static int adm1026_detect(struct i2c_adapter *adapter, int address, | |||
1554 | adm1026_init_client(new_client); | 1674 | adm1026_init_client(new_client); |
1555 | 1675 | ||
1556 | /* Register sysfs hooks */ | 1676 | /* Register sysfs hooks */ |
1677 | if ((err = sysfs_create_group(&new_client->dev.kobj, &adm1026_group))) | ||
1678 | goto exitdetach; | ||
1679 | |||
1557 | data->class_dev = hwmon_device_register(&new_client->dev); | 1680 | data->class_dev = hwmon_device_register(&new_client->dev); |
1558 | if (IS_ERR(data->class_dev)) { | 1681 | if (IS_ERR(data->class_dev)) { |
1559 | err = PTR_ERR(data->class_dev); | 1682 | err = PTR_ERR(data->class_dev); |
1560 | goto exitdetach; | 1683 | goto exitremove; |
1561 | } | 1684 | } |
1562 | 1685 | ||
1563 | device_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr); | ||
1564 | device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr); | ||
1565 | device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr); | ||
1566 | device_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr); | ||
1567 | device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr); | ||
1568 | device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr); | ||
1569 | device_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr); | ||
1570 | device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr); | ||
1571 | device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr); | ||
1572 | device_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr); | ||
1573 | device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr); | ||
1574 | device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr); | ||
1575 | device_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr); | ||
1576 | device_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr); | ||
1577 | device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr); | ||
1578 | device_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr); | ||
1579 | device_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr); | ||
1580 | device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr); | ||
1581 | device_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr); | ||
1582 | device_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr); | ||
1583 | device_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr); | ||
1584 | device_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr); | ||
1585 | device_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr); | ||
1586 | device_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr); | ||
1587 | device_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr); | ||
1588 | device_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr); | ||
1589 | device_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr); | ||
1590 | device_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr); | ||
1591 | device_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr); | ||
1592 | device_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr); | ||
1593 | device_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr); | ||
1594 | device_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr); | ||
1595 | device_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr); | ||
1596 | device_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr); | ||
1597 | device_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr); | ||
1598 | device_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr); | ||
1599 | device_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr); | ||
1600 | device_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr); | ||
1601 | device_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr); | ||
1602 | device_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr); | ||
1603 | device_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr); | ||
1604 | device_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr); | ||
1605 | device_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr); | ||
1606 | device_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr); | ||
1607 | device_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr); | ||
1608 | device_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr); | ||
1609 | device_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr); | ||
1610 | device_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr); | ||
1611 | device_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr); | ||
1612 | device_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr); | ||
1613 | device_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr); | ||
1614 | device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr); | ||
1615 | device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr); | ||
1616 | device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr); | ||
1617 | device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr); | ||
1618 | device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr); | ||
1619 | device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr); | ||
1620 | device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr); | ||
1621 | device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr); | ||
1622 | device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr); | ||
1623 | device_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr); | ||
1624 | device_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr); | ||
1625 | device_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr); | ||
1626 | device_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr); | ||
1627 | device_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr); | ||
1628 | device_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr); | ||
1629 | device_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr); | ||
1630 | device_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr); | ||
1631 | device_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr); | ||
1632 | device_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr); | ||
1633 | device_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr); | ||
1634 | device_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr); | ||
1635 | device_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr); | ||
1636 | device_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr); | ||
1637 | device_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr); | ||
1638 | device_create_file(&new_client->dev, &sensor_dev_attr_temp1_input.dev_attr); | ||
1639 | device_create_file(&new_client->dev, &sensor_dev_attr_temp1_max.dev_attr); | ||
1640 | device_create_file(&new_client->dev, &sensor_dev_attr_temp1_min.dev_attr); | ||
1641 | device_create_file(&new_client->dev, &sensor_dev_attr_temp2_input.dev_attr); | ||
1642 | device_create_file(&new_client->dev, &sensor_dev_attr_temp2_max.dev_attr); | ||
1643 | device_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr); | ||
1644 | device_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr); | ||
1645 | device_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr); | ||
1646 | device_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr); | ||
1647 | device_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr); | ||
1648 | device_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr); | ||
1649 | device_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr); | ||
1650 | device_create_file(&new_client->dev, | ||
1651 | &sensor_dev_attr_temp1_auto_point1_temp.dev_attr); | ||
1652 | device_create_file(&new_client->dev, | ||
1653 | &sensor_dev_attr_temp2_auto_point1_temp.dev_attr); | ||
1654 | device_create_file(&new_client->dev, | ||
1655 | &sensor_dev_attr_temp3_auto_point1_temp.dev_attr); | ||
1656 | device_create_file(&new_client->dev, | ||
1657 | &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr); | ||
1658 | device_create_file(&new_client->dev, | ||
1659 | &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr); | ||
1660 | device_create_file(&new_client->dev, | ||
1661 | &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr); | ||
1662 | device_create_file(&new_client->dev, | ||
1663 | &sensor_dev_attr_temp1_auto_point2_temp.dev_attr); | ||
1664 | device_create_file(&new_client->dev, | ||
1665 | &sensor_dev_attr_temp2_auto_point2_temp.dev_attr); | ||
1666 | device_create_file(&new_client->dev, | ||
1667 | &sensor_dev_attr_temp3_auto_point2_temp.dev_attr); | ||
1668 | device_create_file(&new_client->dev, &sensor_dev_attr_temp1_crit.dev_attr); | ||
1669 | device_create_file(&new_client->dev, &sensor_dev_attr_temp2_crit.dev_attr); | ||
1670 | device_create_file(&new_client->dev, &sensor_dev_attr_temp3_crit.dev_attr); | ||
1671 | device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable); | ||
1672 | device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable); | ||
1673 | device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable); | ||
1674 | device_create_file(&new_client->dev, &dev_attr_cpu0_vid); | ||
1675 | device_create_file(&new_client->dev, &dev_attr_vrm); | ||
1676 | device_create_file(&new_client->dev, &dev_attr_alarms); | ||
1677 | device_create_file(&new_client->dev, &dev_attr_alarm_mask); | ||
1678 | device_create_file(&new_client->dev, &dev_attr_gpio); | ||
1679 | device_create_file(&new_client->dev, &dev_attr_gpio_mask); | ||
1680 | device_create_file(&new_client->dev, &dev_attr_pwm1); | ||
1681 | device_create_file(&new_client->dev, &dev_attr_pwm2); | ||
1682 | device_create_file(&new_client->dev, &dev_attr_pwm3); | ||
1683 | device_create_file(&new_client->dev, &dev_attr_pwm1_enable); | ||
1684 | device_create_file(&new_client->dev, &dev_attr_pwm2_enable); | ||
1685 | device_create_file(&new_client->dev, &dev_attr_pwm3_enable); | ||
1686 | device_create_file(&new_client->dev, &dev_attr_temp1_auto_point1_pwm); | ||
1687 | device_create_file(&new_client->dev, &dev_attr_temp2_auto_point1_pwm); | ||
1688 | device_create_file(&new_client->dev, &dev_attr_temp3_auto_point1_pwm); | ||
1689 | device_create_file(&new_client->dev, &dev_attr_temp1_auto_point2_pwm); | ||
1690 | device_create_file(&new_client->dev, &dev_attr_temp2_auto_point2_pwm); | ||
1691 | device_create_file(&new_client->dev, &dev_attr_temp3_auto_point2_pwm); | ||
1692 | device_create_file(&new_client->dev, &dev_attr_analog_out); | ||
1693 | return 0; | 1686 | return 0; |
1694 | 1687 | ||
1695 | /* Error out and cleanup code */ | 1688 | /* Error out and cleanup code */ |
1689 | exitremove: | ||
1690 | sysfs_remove_group(&new_client->dev.kobj, &adm1026_group); | ||
1696 | exitdetach: | 1691 | exitdetach: |
1697 | i2c_detach_client(new_client); | 1692 | i2c_detach_client(new_client); |
1698 | exitfree: | 1693 | exitfree: |
@@ -1700,6 +1695,17 @@ exitfree: | |||
1700 | exit: | 1695 | exit: |
1701 | return err; | 1696 | return err; |
1702 | } | 1697 | } |
1698 | |||
1699 | static int adm1026_detach_client(struct i2c_client *client) | ||
1700 | { | ||
1701 | struct adm1026_data *data = i2c_get_clientdata(client); | ||
1702 | hwmon_device_unregister(data->class_dev); | ||
1703 | sysfs_remove_group(&client->dev.kobj, &adm1026_group); | ||
1704 | i2c_detach_client(client); | ||
1705 | kfree(data); | ||
1706 | return 0; | ||
1707 | } | ||
1708 | |||
1703 | static int __init sm_adm1026_init(void) | 1709 | static int __init sm_adm1026_init(void) |
1704 | { | 1710 | { |
1705 | return i2c_add_driver(&adm1026_driver); | 1711 | return i2c_add_driver(&adm1026_driver); |