adt7475.c (7b8664f126e90d1d2129b8653c587bf230dd800c) adt7475.c (d45cd804280d5cf43d539f49f671ea26552cedc3)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives
4 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc.
5 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
6 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com>
7 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de>
8 *

--- 1555 unchanged lines hidden (view full) ---

1564 *config |= (1 << bit_index);
1565 else
1566 *config &= ~(1 << bit_index);
1567 }
1568
1569 return ret;
1570}
1571
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives
4 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc.
5 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
6 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com>
7 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de>
8 *

--- 1555 unchanged lines hidden (view full) ---

1564 *config |= (1 << bit_index);
1565 else
1566 *config &= ~(1 << bit_index);
1567 }
1568
1569 return ret;
1570}
1571
1572static int load_attenuators(const struct i2c_client *client, int chip,
1572static int load_attenuators(const struct i2c_client *client, enum chips chip,
1573 struct adt7475_data *data)
1574{
1573 struct adt7475_data *data)
1574{
1575 int ret;
1576
1577 if (chip == adt7476 || chip == adt7490) {
1575 switch (chip) {
1576 case adt7476:
1577 case adt7490:
1578 set_property_bit(client, "adi,bypass-attenuator-in0",
1579 &data->config4, 4);
1580 set_property_bit(client, "adi,bypass-attenuator-in1",
1581 &data->config4, 5);
1582 set_property_bit(client, "adi,bypass-attenuator-in3",
1583 &data->config4, 6);
1584 set_property_bit(client, "adi,bypass-attenuator-in4",
1585 &data->config4, 7);
1586
1578 set_property_bit(client, "adi,bypass-attenuator-in0",
1579 &data->config4, 4);
1580 set_property_bit(client, "adi,bypass-attenuator-in1",
1581 &data->config4, 5);
1582 set_property_bit(client, "adi,bypass-attenuator-in3",
1583 &data->config4, 6);
1584 set_property_bit(client, "adi,bypass-attenuator-in4",
1585 &data->config4, 7);
1586
1587 ret = i2c_smbus_write_byte_data(client, REG_CONFIG4,
1588 data->config4);
1589 if (ret < 0)
1590 return ret;
1591 } else if (chip == adt7473 || chip == adt7475) {
1587 return i2c_smbus_write_byte_data(client, REG_CONFIG4,
1588 data->config4);
1589 case adt7473:
1590 case adt7475:
1592 set_property_bit(client, "adi,bypass-attenuator-in1",
1593 &data->config2, 5);
1594
1591 set_property_bit(client, "adi,bypass-attenuator-in1",
1592 &data->config2, 5);
1593
1595 ret = i2c_smbus_write_byte_data(client, REG_CONFIG2,
1596 data->config2);
1597 if (ret < 0)
1598 return ret;
1594 return i2c_smbus_write_byte_data(client, REG_CONFIG2,
1595 data->config2);
1599 }
1600
1601 return 0;
1602}
1603
1604static int adt7475_set_pwm_polarity(struct i2c_client *client)
1605{
1606 u32 states[ADT7475_PWM_COUNT];

--- 419 unchanged lines hidden ---
1596 }
1597
1598 return 0;
1599}
1600
1601static int adt7475_set_pwm_polarity(struct i2c_client *client)
1602{
1603 u32 states[ADT7475_PWM_COUNT];

--- 419 unchanged lines hidden ---