mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
Revert "hwmon: add SMARC-sAM67 support"
This reverts commit 443b39c82c.
I was just informed that this product is discontinued (without being
ever released to the market). Pull the plug and let's not waste any more
maintainers time.
Signed-off-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20260223100459.844967-4-mwalle@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
b7497b5a99
commit
e710b22837
6 changed files with 0 additions and 215 deletions
|
|
@ -220,7 +220,6 @@ Hardware Monitoring Kernel Drivers
|
||||||
q54sj108a2
|
q54sj108a2
|
||||||
qnap-mcu-hwmon
|
qnap-mcu-hwmon
|
||||||
raspberrypi-hwmon
|
raspberrypi-hwmon
|
||||||
sa67
|
|
||||||
sbrmi
|
sbrmi
|
||||||
sbtsi_temp
|
sbtsi_temp
|
||||||
sch5627
|
sch5627
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
.. SPDX-License-Identifier: GPL-2.0-only
|
|
||||||
|
|
||||||
Kernel driver sa67mcu
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Supported chips:
|
|
||||||
|
|
||||||
* Kontron sa67mcu
|
|
||||||
|
|
||||||
Prefix: 'sa67mcu'
|
|
||||||
|
|
||||||
Datasheet: not available
|
|
||||||
|
|
||||||
Authors: Michael Walle <mwalle@kernel.org>
|
|
||||||
|
|
||||||
Description
|
|
||||||
-----------
|
|
||||||
|
|
||||||
The sa67mcu is a board management controller which also exposes a hardware
|
|
||||||
monitoring controller.
|
|
||||||
|
|
||||||
The controller has two voltage and one temperature sensor. The values are
|
|
||||||
hold in two 8 bit registers to form one 16 bit value. Reading the lower byte
|
|
||||||
will also capture the high byte to make the access atomic. The unit of the
|
|
||||||
volatge sensors are 1mV and the unit of the temperature sensor is 0.1degC.
|
|
||||||
|
|
||||||
Sysfs entries
|
|
||||||
-------------
|
|
||||||
|
|
||||||
The following attributes are supported.
|
|
||||||
|
|
||||||
======================= ========================================================
|
|
||||||
in0_label "VDDIN"
|
|
||||||
in0_input Measured VDDIN voltage.
|
|
||||||
|
|
||||||
in1_label "VDD_RTC"
|
|
||||||
in1_input Measured VDD_RTC voltage.
|
|
||||||
|
|
||||||
temp1_input MCU temperature. Roughly the board temperature.
|
|
||||||
======================= ========================================================
|
|
||||||
|
|
||||||
|
|
@ -24337,7 +24337,6 @@ F: Documentation/devicetree/bindings/interrupt-controller/kontron,sl28cpld-intc.
|
||||||
F: Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml
|
F: Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml
|
||||||
F: Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml
|
F: Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml
|
||||||
F: drivers/gpio/gpio-sl28cpld.c
|
F: drivers/gpio/gpio-sl28cpld.c
|
||||||
F: drivers/hwmon/sa67mcu-hwmon.c
|
|
||||||
F: drivers/hwmon/sl28cpld-hwmon.c
|
F: drivers/hwmon/sl28cpld-hwmon.c
|
||||||
F: drivers/irqchip/irq-sl28cpld.c
|
F: drivers/irqchip/irq-sl28cpld.c
|
||||||
F: drivers/pwm/pwm-sl28cpld.c
|
F: drivers/pwm/pwm-sl28cpld.c
|
||||||
|
|
|
||||||
|
|
@ -1927,16 +1927,6 @@ config SENSORS_RASPBERRYPI_HWMON
|
||||||
This driver can also be built as a module. If so, the module
|
This driver can also be built as a module. If so, the module
|
||||||
will be called raspberrypi-hwmon.
|
will be called raspberrypi-hwmon.
|
||||||
|
|
||||||
config SENSORS_SA67MCU
|
|
||||||
tristate "Kontron sa67mcu hardware monitoring driver"
|
|
||||||
depends on MFD_SL28CPLD || COMPILE_TEST
|
|
||||||
help
|
|
||||||
If you say yes here you get support for the voltage and temperature
|
|
||||||
monitor of the sa67 board management controller.
|
|
||||||
|
|
||||||
This driver can also be built as a module. If so, the module
|
|
||||||
will be called sa67mcu-hwmon.
|
|
||||||
|
|
||||||
config SENSORS_SL28CPLD
|
config SENSORS_SL28CPLD
|
||||||
tristate "Kontron sl28cpld hardware monitoring driver"
|
tristate "Kontron sl28cpld hardware monitoring driver"
|
||||||
depends on MFD_SL28CPLD || COMPILE_TEST
|
depends on MFD_SL28CPLD || COMPILE_TEST
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,6 @@ obj-$(CONFIG_SENSORS_PT5161L) += pt5161l.o
|
||||||
obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
|
obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
|
||||||
obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o
|
obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o
|
||||||
obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
|
obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
|
||||||
obj-$(CONFIG_SENSORS_SA67MCU) += sa67mcu-hwmon.o
|
|
||||||
obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
|
obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
|
||||||
obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o
|
obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o
|
||||||
obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
|
obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
|
||||||
|
|
|
||||||
|
|
@ -1,161 +0,0 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-only
|
|
||||||
/*
|
|
||||||
* sl67mcu hardware monitoring driver
|
|
||||||
*
|
|
||||||
* Copyright 2025 Kontron Europe GmbH
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/bitfield.h>
|
|
||||||
#include <linux/hwmon.h>
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/mod_devicetable.h>
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/platform_device.h>
|
|
||||||
#include <linux/property.h>
|
|
||||||
#include <linux/regmap.h>
|
|
||||||
|
|
||||||
#define SA67MCU_VOLTAGE(n) (0x00 + ((n) * 2))
|
|
||||||
#define SA67MCU_TEMP(n) (0x04 + ((n) * 2))
|
|
||||||
|
|
||||||
struct sa67mcu_hwmon {
|
|
||||||
struct regmap *regmap;
|
|
||||||
u32 offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int sa67mcu_hwmon_read(struct device *dev,
|
|
||||||
enum hwmon_sensor_types type, u32 attr,
|
|
||||||
int channel, long *input)
|
|
||||||
{
|
|
||||||
struct sa67mcu_hwmon *hwmon = dev_get_drvdata(dev);
|
|
||||||
unsigned int offset;
|
|
||||||
u8 reg[2];
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case hwmon_in:
|
|
||||||
switch (attr) {
|
|
||||||
case hwmon_in_input:
|
|
||||||
offset = hwmon->offset + SA67MCU_VOLTAGE(channel);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case hwmon_temp:
|
|
||||||
switch (attr) {
|
|
||||||
case hwmon_temp_input:
|
|
||||||
offset = hwmon->offset + SA67MCU_TEMP(channel);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reading the low byte will capture the value */
|
|
||||||
ret = regmap_bulk_read(hwmon->regmap, offset, reg, ARRAY_SIZE(reg));
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
*input = reg[1] << 8 | reg[0];
|
|
||||||
|
|
||||||
/* Temperatures are s16 and in 0.1degC steps. */
|
|
||||||
if (type == hwmon_temp)
|
|
||||||
*input = sign_extend32(*input, 15) * 100;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct hwmon_channel_info * const sa67mcu_hwmon_info[] = {
|
|
||||||
HWMON_CHANNEL_INFO(in,
|
|
||||||
HWMON_I_INPUT | HWMON_I_LABEL,
|
|
||||||
HWMON_I_INPUT | HWMON_I_LABEL),
|
|
||||||
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *const sa67mcu_hwmon_in_labels[] = {
|
|
||||||
"VDDIN",
|
|
||||||
"VDD_RTC",
|
|
||||||
};
|
|
||||||
|
|
||||||
static int sa67mcu_hwmon_read_string(struct device *dev,
|
|
||||||
enum hwmon_sensor_types type, u32 attr,
|
|
||||||
int channel, const char **str)
|
|
||||||
{
|
|
||||||
switch (type) {
|
|
||||||
case hwmon_in:
|
|
||||||
switch (attr) {
|
|
||||||
case hwmon_in_label:
|
|
||||||
*str = sa67mcu_hwmon_in_labels[channel];
|
|
||||||
return 0;
|
|
||||||
default:
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct hwmon_ops sa67mcu_hwmon_ops = {
|
|
||||||
.visible = 0444,
|
|
||||||
.read = sa67mcu_hwmon_read,
|
|
||||||
.read_string = sa67mcu_hwmon_read_string,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct hwmon_chip_info sa67mcu_hwmon_chip_info = {
|
|
||||||
.ops = &sa67mcu_hwmon_ops,
|
|
||||||
.info = sa67mcu_hwmon_info,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int sa67mcu_hwmon_probe(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct sa67mcu_hwmon *hwmon;
|
|
||||||
struct device *hwmon_dev;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!pdev->dev.parent)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL);
|
|
||||||
if (!hwmon)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
|
||||||
if (!hwmon->regmap)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
ret = device_property_read_u32(&pdev->dev, "reg", &hwmon->offset);
|
|
||||||
if (ret)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev,
|
|
||||||
"sa67mcu_hwmon", hwmon,
|
|
||||||
&sa67mcu_hwmon_chip_info,
|
|
||||||
NULL);
|
|
||||||
if (IS_ERR(hwmon_dev))
|
|
||||||
dev_err(&pdev->dev, "failed to register as hwmon device");
|
|
||||||
|
|
||||||
return PTR_ERR_OR_ZERO(hwmon_dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id sa67mcu_hwmon_of_match[] = {
|
|
||||||
{ .compatible = "kontron,sa67mcu-hwmon", },
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
MODULE_DEVICE_TABLE(of, sa67mcu_hwmon_of_match);
|
|
||||||
|
|
||||||
static struct platform_driver sa67mcu_hwmon_driver = {
|
|
||||||
.probe = sa67mcu_hwmon_probe,
|
|
||||||
.driver = {
|
|
||||||
.name = "sa67mcu-hwmon",
|
|
||||||
.of_match_table = sa67mcu_hwmon_of_match,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
module_platform_driver(sa67mcu_hwmon_driver);
|
|
||||||
|
|
||||||
MODULE_DESCRIPTION("sa67mcu Hardware Monitoring Driver");
|
|
||||||
MODULE_AUTHOR("Michael Walle <mwalle@kernel.org>");
|
|
||||||
MODULE_LICENSE("GPL");
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue