Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "hwmon: add SMARC-sAM67 support"

This reverts commit 443b39c82c322c9f3c38bea0389fe927ba00b3b4.

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>

authored by

Michael Walle and committed by
Guenter Roeck
e710b228 b7497b5a

-215
-1
Documentation/hwmon/index.rst
··· 220 220 q54sj108a2 221 221 qnap-mcu-hwmon 222 222 raspberrypi-hwmon 223 - sa67 224 223 sbrmi 225 224 sbtsi_temp 226 225 sch5627
-41
Documentation/hwmon/sa67.rst
··· 1 - .. SPDX-License-Identifier: GPL-2.0-only 2 - 3 - Kernel driver sa67mcu 4 - ===================== 5 - 6 - Supported chips: 7 - 8 - * Kontron sa67mcu 9 - 10 - Prefix: 'sa67mcu' 11 - 12 - Datasheet: not available 13 - 14 - Authors: Michael Walle <mwalle@kernel.org> 15 - 16 - Description 17 - ----------- 18 - 19 - The sa67mcu is a board management controller which also exposes a hardware 20 - monitoring controller. 21 - 22 - The controller has two voltage and one temperature sensor. The values are 23 - hold in two 8 bit registers to form one 16 bit value. Reading the lower byte 24 - will also capture the high byte to make the access atomic. The unit of the 25 - volatge sensors are 1mV and the unit of the temperature sensor is 0.1degC. 26 - 27 - Sysfs entries 28 - ------------- 29 - 30 - The following attributes are supported. 31 - 32 - ======================= ======================================================== 33 - in0_label "VDDIN" 34 - in0_input Measured VDDIN voltage. 35 - 36 - in1_label "VDD_RTC" 37 - in1_input Measured VDD_RTC voltage. 38 - 39 - temp1_input MCU temperature. Roughly the board temperature. 40 - ======================= ======================================================== 41 -
-1
MAINTAINERS
··· 24337 24337 F: Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml 24338 24338 F: Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml 24339 24339 F: drivers/gpio/gpio-sl28cpld.c 24340 - F: drivers/hwmon/sa67mcu-hwmon.c 24341 24340 F: drivers/hwmon/sl28cpld-hwmon.c 24342 24341 F: drivers/irqchip/irq-sl28cpld.c 24343 24342 F: drivers/pwm/pwm-sl28cpld.c
-10
drivers/hwmon/Kconfig
··· 1927 1927 This driver can also be built as a module. If so, the module 1928 1928 will be called raspberrypi-hwmon. 1929 1929 1930 - config SENSORS_SA67MCU 1931 - tristate "Kontron sa67mcu hardware monitoring driver" 1932 - depends on MFD_SL28CPLD || COMPILE_TEST 1933 - help 1934 - If you say yes here you get support for the voltage and temperature 1935 - monitor of the sa67 board management controller. 1936 - 1937 - This driver can also be built as a module. If so, the module 1938 - will be called sa67mcu-hwmon. 1939 - 1940 1930 config SENSORS_SL28CPLD 1941 1931 tristate "Kontron sl28cpld hardware monitoring driver" 1942 1932 depends on MFD_SL28CPLD || COMPILE_TEST
-1
drivers/hwmon/Makefile
··· 199 199 obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o 200 200 obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o 201 201 obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o 202 - obj-$(CONFIG_SENSORS_SA67MCU) += sa67mcu-hwmon.o 203 202 obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o 204 203 obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o 205 204 obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
-161
drivers/hwmon/sa67mcu-hwmon.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * sl67mcu hardware monitoring driver 4 - * 5 - * Copyright 2025 Kontron Europe GmbH 6 - */ 7 - 8 - #include <linux/bitfield.h> 9 - #include <linux/hwmon.h> 10 - #include <linux/kernel.h> 11 - #include <linux/mod_devicetable.h> 12 - #include <linux/module.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/property.h> 15 - #include <linux/regmap.h> 16 - 17 - #define SA67MCU_VOLTAGE(n) (0x00 + ((n) * 2)) 18 - #define SA67MCU_TEMP(n) (0x04 + ((n) * 2)) 19 - 20 - struct sa67mcu_hwmon { 21 - struct regmap *regmap; 22 - u32 offset; 23 - }; 24 - 25 - static int sa67mcu_hwmon_read(struct device *dev, 26 - enum hwmon_sensor_types type, u32 attr, 27 - int channel, long *input) 28 - { 29 - struct sa67mcu_hwmon *hwmon = dev_get_drvdata(dev); 30 - unsigned int offset; 31 - u8 reg[2]; 32 - int ret; 33 - 34 - switch (type) { 35 - case hwmon_in: 36 - switch (attr) { 37 - case hwmon_in_input: 38 - offset = hwmon->offset + SA67MCU_VOLTAGE(channel); 39 - break; 40 - default: 41 - return -EOPNOTSUPP; 42 - } 43 - break; 44 - case hwmon_temp: 45 - switch (attr) { 46 - case hwmon_temp_input: 47 - offset = hwmon->offset + SA67MCU_TEMP(channel); 48 - break; 49 - default: 50 - return -EOPNOTSUPP; 51 - } 52 - break; 53 - default: 54 - return -EOPNOTSUPP; 55 - } 56 - 57 - /* Reading the low byte will capture the value */ 58 - ret = regmap_bulk_read(hwmon->regmap, offset, reg, ARRAY_SIZE(reg)); 59 - if (ret) 60 - return ret; 61 - 62 - *input = reg[1] << 8 | reg[0]; 63 - 64 - /* Temperatures are s16 and in 0.1degC steps. */ 65 - if (type == hwmon_temp) 66 - *input = sign_extend32(*input, 15) * 100; 67 - 68 - return 0; 69 - } 70 - 71 - static const struct hwmon_channel_info * const sa67mcu_hwmon_info[] = { 72 - HWMON_CHANNEL_INFO(in, 73 - HWMON_I_INPUT | HWMON_I_LABEL, 74 - HWMON_I_INPUT | HWMON_I_LABEL), 75 - HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), 76 - NULL 77 - }; 78 - 79 - static const char *const sa67mcu_hwmon_in_labels[] = { 80 - "VDDIN", 81 - "VDD_RTC", 82 - }; 83 - 84 - static int sa67mcu_hwmon_read_string(struct device *dev, 85 - enum hwmon_sensor_types type, u32 attr, 86 - int channel, const char **str) 87 - { 88 - switch (type) { 89 - case hwmon_in: 90 - switch (attr) { 91 - case hwmon_in_label: 92 - *str = sa67mcu_hwmon_in_labels[channel]; 93 - return 0; 94 - default: 95 - return -EOPNOTSUPP; 96 - } 97 - default: 98 - return -EOPNOTSUPP; 99 - } 100 - } 101 - 102 - static const struct hwmon_ops sa67mcu_hwmon_ops = { 103 - .visible = 0444, 104 - .read = sa67mcu_hwmon_read, 105 - .read_string = sa67mcu_hwmon_read_string, 106 - }; 107 - 108 - static const struct hwmon_chip_info sa67mcu_hwmon_chip_info = { 109 - .ops = &sa67mcu_hwmon_ops, 110 - .info = sa67mcu_hwmon_info, 111 - }; 112 - 113 - static int sa67mcu_hwmon_probe(struct platform_device *pdev) 114 - { 115 - struct sa67mcu_hwmon *hwmon; 116 - struct device *hwmon_dev; 117 - int ret; 118 - 119 - if (!pdev->dev.parent) 120 - return -ENODEV; 121 - 122 - hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL); 123 - if (!hwmon) 124 - return -ENOMEM; 125 - 126 - hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL); 127 - if (!hwmon->regmap) 128 - return -ENODEV; 129 - 130 - ret = device_property_read_u32(&pdev->dev, "reg", &hwmon->offset); 131 - if (ret) 132 - return -EINVAL; 133 - 134 - hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, 135 - "sa67mcu_hwmon", hwmon, 136 - &sa67mcu_hwmon_chip_info, 137 - NULL); 138 - if (IS_ERR(hwmon_dev)) 139 - dev_err(&pdev->dev, "failed to register as hwmon device"); 140 - 141 - return PTR_ERR_OR_ZERO(hwmon_dev); 142 - } 143 - 144 - static const struct of_device_id sa67mcu_hwmon_of_match[] = { 145 - { .compatible = "kontron,sa67mcu-hwmon", }, 146 - {} 147 - }; 148 - MODULE_DEVICE_TABLE(of, sa67mcu_hwmon_of_match); 149 - 150 - static struct platform_driver sa67mcu_hwmon_driver = { 151 - .probe = sa67mcu_hwmon_probe, 152 - .driver = { 153 - .name = "sa67mcu-hwmon", 154 - .of_match_table = sa67mcu_hwmon_of_match, 155 - }, 156 - }; 157 - module_platform_driver(sa67mcu_hwmon_driver); 158 - 159 - MODULE_DESCRIPTION("sa67mcu Hardware Monitoring Driver"); 160 - MODULE_AUTHOR("Michael Walle <mwalle@kernel.org>"); 161 - MODULE_LICENSE("GPL");