Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright 2019 Inspur Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include <linux/debugfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/pmbus.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/hwmon-sysfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "pmbus.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define IPSPS_REG_VENDOR_ID	0x99
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define IPSPS_REG_MODEL		0x9A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define IPSPS_REG_FW_VERSION	0x9B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define IPSPS_REG_PN		0x9C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define IPSPS_REG_SN		0x9E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define IPSPS_REG_HW_VERSION	0xB0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define IPSPS_REG_MODE		0xFC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define MODE_ACTIVE		0x55
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define MODE_STANDBY		0x0E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define MODE_REDUNDANCY		0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #define MODE_ACTIVE_STRING		"active"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define MODE_STANDBY_STRING		"standby"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define MODE_REDUNDANCY_STRING		"redundancy"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) enum ipsps_index {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	vendor,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	model,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	fw_version,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	part_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	serial_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	hw_version,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	num_regs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) static const u8 ipsps_regs[num_regs] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	[vendor] = IPSPS_REG_VENDOR_ID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	[model] = IPSPS_REG_MODEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	[fw_version] = IPSPS_REG_FW_VERSION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	[part_number] = IPSPS_REG_PN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	[serial_number] = IPSPS_REG_SN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	[hw_version] = IPSPS_REG_HW_VERSION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	[mode] = IPSPS_REG_MODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static ssize_t ipsps_string_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 				 struct device_attribute *devattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 				 char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	u8 reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	char *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	char data[I2C_SMBUS_BLOCK_MAX + 1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	struct i2c_client *client = to_i2c_client(dev->parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	reg = ipsps_regs[attr->index];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	rc = i2c_smbus_read_block_data(client, reg, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/* filled with printable characters, ending with # */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	p = memscan(data, '#', rc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	*p = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	return snprintf(buf, PAGE_SIZE, "%s\n", data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) static ssize_t ipsps_fw_version_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 				     struct device_attribute *devattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 				     char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	u8 reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	u8 data[I2C_SMBUS_BLOCK_MAX] = { 0 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	struct i2c_client *client = to_i2c_client(dev->parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	reg = ipsps_regs[attr->index];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	rc = i2c_smbus_read_block_data(client, reg, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	if (rc != 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		return -EPROTO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return snprintf(buf, PAGE_SIZE, "%u.%02u%u-%u.%02u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 			data[1], data[2]/* < 100 */, data[3]/*< 10*/,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			data[4], data[5]/* < 100 */);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) static ssize_t ipsps_mode_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			       struct device_attribute *devattr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	u8 reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	struct i2c_client *client = to_i2c_client(dev->parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	reg = ipsps_regs[attr->index];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	rc = i2c_smbus_read_byte_data(client, reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	switch (rc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	case MODE_ACTIVE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		return snprintf(buf, PAGE_SIZE, "[%s] %s %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 				MODE_ACTIVE_STRING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	case MODE_STANDBY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		return snprintf(buf, PAGE_SIZE, "%s [%s] %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 				MODE_ACTIVE_STRING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	case MODE_REDUNDANCY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		return snprintf(buf, PAGE_SIZE, "%s %s [%s]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 				MODE_ACTIVE_STRING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		return snprintf(buf, PAGE_SIZE, "unspecified\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static ssize_t ipsps_mode_store(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 				struct device_attribute *devattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 				const char *buf, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	u8 reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	struct i2c_client *client = to_i2c_client(dev->parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	reg = ipsps_regs[attr->index];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	if (sysfs_streq(MODE_STANDBY_STRING, buf)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		rc = i2c_smbus_write_byte_data(client, reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 					       MODE_STANDBY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 			return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	} else if (sysfs_streq(MODE_ACTIVE_STRING, buf)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		rc = i2c_smbus_write_byte_data(client, reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 					       MODE_ACTIVE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) static SENSOR_DEVICE_ATTR_RO(vendor, ipsps_string, vendor);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) static SENSOR_DEVICE_ATTR_RO(model, ipsps_string, model);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) static SENSOR_DEVICE_ATTR_RO(part_number, ipsps_string, part_number);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) static SENSOR_DEVICE_ATTR_RO(serial_number, ipsps_string, serial_number);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) static SENSOR_DEVICE_ATTR_RO(hw_version, ipsps_string, hw_version);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) static SENSOR_DEVICE_ATTR_RO(fw_version, ipsps_fw_version, fw_version);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) static SENSOR_DEVICE_ATTR_RW(mode, ipsps_mode, mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) static struct attribute *ipsps_attrs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	&sensor_dev_attr_vendor.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	&sensor_dev_attr_model.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	&sensor_dev_attr_part_number.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	&sensor_dev_attr_serial_number.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	&sensor_dev_attr_hw_version.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	&sensor_dev_attr_fw_version.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	&sensor_dev_attr_mode.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) ATTRIBUTE_GROUPS(ipsps);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) static struct pmbus_driver_info ipsps_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	.pages = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		PMBUS_HAVE_IIN | PMBUS_HAVE_POUT | PMBUS_HAVE_PIN |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		PMBUS_HAVE_FAN12 | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_VOUT |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_INPUT |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_STATUS_FAN12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	.groups = ipsps_groups,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static struct pmbus_platform_data ipsps_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	.flags = PMBUS_SKIP_STATUS_CHECK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) static int ipsps_probe(struct i2c_client *client)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	client->dev.platform_data = &ipsps_pdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	return pmbus_do_probe(client, &ipsps_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) static const struct i2c_device_id ipsps_id[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	{ "ipsps1", 0 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	{}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) MODULE_DEVICE_TABLE(i2c, ipsps_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) #ifdef CONFIG_OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) static const struct of_device_id ipsps_of_match[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	{ .compatible = "inspur,ipsps1" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	{}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) MODULE_DEVICE_TABLE(of, ipsps_of_match);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) static struct i2c_driver ipsps_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		.name = "inspur-ipsps",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		.of_match_table = of_match_ptr(ipsps_of_match),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	.probe_new = ipsps_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	.remove = pmbus_do_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	.id_table = ipsps_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) module_i2c_driver(ipsps_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) MODULE_AUTHOR("John Wang");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) MODULE_DESCRIPTION("PMBus driver for Inspur Power System power supplies");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) MODULE_LICENSE("GPL");