From f4faf45af44726edea8fbab931967fe5ad320ddd Mon Sep 17 00:00:00 2001 From: Jonathan Tsai Date: Mon, 13 Feb 2017 05:15:06 +0000 Subject: [PATCH] [LY6,LY8,LY9] Change file name from quanta_hwmon.c to quanta_hwmon_ly_series.c --- ...uanta_hwmon.c => quanta_hwmon_ly_series.c} | 57 ++++++++++--------- .../x86_64_quanta_ly6_rangeley_r0/__init__.py | 2 +- .../x86_64_quanta_ly8_rangeley_r0/__init__.py | 2 +- .../x86_64_quanta_ly9_rangeley_r0/__init__.py | 2 +- 4 files changed, 32 insertions(+), 31 deletions(-) rename packages/platforms/quanta/x86-64/modules/builds/{quanta_hwmon.c => quanta_hwmon_ly_series.c} (78%) mode change 100644 => 100755 diff --git a/packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon.c b/packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon_ly_series.c old mode 100644 new mode 100755 similarity index 78% rename from packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon.c rename to packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon_ly_series.c index 244d9a9e..1b807bcf --- a/packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon.c +++ b/packages/platforms/quanta/x86-64/modules/builds/quanta_hwmon_ly_series.c @@ -11,7 +11,7 @@ * * * - * A hwmon driver for the Quanta LY6 + * A hwmon driver for the Quanta LY6/LY8/LY9 */ #include @@ -39,40 +39,40 @@ static const unsigned short normal_i2c[] = { 0x4E, I2C_CLIENT_END }; #define QUANTA_HWMON_NUM_FANS 6 -struct quanta_hwmon_data { +struct quanta_hwmon_ly_series_data { struct device *hwmon_dev; struct attribute_group attrs; struct mutex lock; }; -enum quanta_hwmon_s { +enum quanta_hwmon_ly_series_s { quanta_ly6_hwmon, quanta_ly6f_hwmon, quanta_ly8_hwmon, quanta_ly9_hwmon, }; -static int quanta_hwmon_probe(struct i2c_client *client, +static int quanta_hwmon_ly_series_probe(struct i2c_client *client, const struct i2c_device_id *id); -static int quanta_hwmon_remove(struct i2c_client *client); +static int quanta_hwmon_ly_series_remove(struct i2c_client *client); -static const struct i2c_device_id quanta_hwmon_id[] = { +static const struct i2c_device_id quanta_hwmon_ly_series_id[] = { { "quanta_ly6_hwmon", quanta_ly6_hwmon }, { "quanta_ly6f_hwmon", quanta_ly6f_hwmon }, { "quanta_ly8_hwmon", quanta_ly8_hwmon }, { "quanta_ly9_hwmon", quanta_ly9_hwmon }, { } }; -MODULE_DEVICE_TABLE(i2c, quanta_hwmon_id); +MODULE_DEVICE_TABLE(i2c, quanta_hwmon_ly_series_id); -static struct i2c_driver quanta_hwmon_driver = { +static struct i2c_driver quanta_hwmon_ly_series_driver = { .class = I2C_CLASS_HWMON, .driver = { - .name = "quanta_hwmon", + .name = "quanta_hwmon_ly_series", }, - .probe = quanta_hwmon_probe, - .remove = quanta_hwmon_remove, - .id_table = quanta_hwmon_id, + .probe = quanta_hwmon_ly_series_probe, + .remove = quanta_hwmon_ly_series_remove, + .id_table = quanta_hwmon_ly_series_id, .address_list = normal_i2c, }; @@ -81,7 +81,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i2c_client *client = to_i2c_client(dev); - struct quanta_hwmon_data *data = i2c_get_clientdata(client); + struct quanta_hwmon_ly_series_data *data = i2c_get_clientdata(client); int temp; mutex_lock(&data->lock); @@ -97,7 +97,7 @@ static ssize_t show_fan(struct device *dev, struct device_attribute *devattr, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i2c_client *client = to_i2c_client(dev); - struct quanta_hwmon_data *data = i2c_get_clientdata(client); + struct quanta_hwmon_ly_series_data *data = i2c_get_clientdata(client); int fan; mutex_lock(&data->lock); @@ -113,7 +113,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i2c_client *client = to_i2c_client(dev); - struct quanta_hwmon_data *data = i2c_get_clientdata(client); + struct quanta_hwmon_ly_series_data *data = i2c_get_clientdata(client); int pwm; mutex_lock(&data->lock); @@ -129,7 +129,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i2c_client *client = to_i2c_client(dev); - struct quanta_hwmon_data *data = i2c_get_clientdata(client); + struct quanta_hwmon_ly_series_data *data = i2c_get_clientdata(client); long val; int ret; @@ -158,7 +158,7 @@ static SENSOR_DEVICE_ATTR(fan6_input, S_IRUGO, show_fan, NULL, 5); static SENSOR_DEVICE_ATTR(fan7_input, S_IRUGO, show_fan, NULL, 6); static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 0); -static struct attribute *quanta_hwmon_attr[] = { +static struct attribute *quanta_hwmon_ly_series_attr[] = { &sensor_dev_attr_temp1_input.dev_attr.attr, &sensor_dev_attr_temp2_input.dev_attr.attr, &sensor_dev_attr_temp3_input.dev_attr.attr, @@ -174,7 +174,7 @@ static struct attribute *quanta_hwmon_attr[] = { NULL }; -static struct attribute *quanta_hwmon_attr_6temps_3fans[] = { +static struct attribute *quanta_hwmon_ly_series_attr_6temps_3fans[] = { &sensor_dev_attr_temp1_input.dev_attr.attr, &sensor_dev_attr_temp2_input.dev_attr.attr, &sensor_dev_attr_temp3_input.dev_attr.attr, @@ -191,13 +191,13 @@ static struct attribute *quanta_hwmon_attr_6temps_3fans[] = { NULL }; -static int quanta_hwmon_probe(struct i2c_client *client, +static int quanta_hwmon_ly_series_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct quanta_hwmon_data *data; + struct quanta_hwmon_ly_series_data *data; int err; - data = devm_kzalloc(&client->dev, sizeof(struct quanta_hwmon_data), + data = devm_kzalloc(&client->dev, sizeof(struct quanta_hwmon_ly_series_data), GFP_KERNEL); if (!data) return -ENOMEM; @@ -208,10 +208,10 @@ static int quanta_hwmon_probe(struct i2c_client *client, dev_info(&client->dev, "%s chip found\n", client->name); if(!strcmp(client->name, "quanta_ly9_hwmon")){ - data->attrs.attrs = quanta_hwmon_attr_6temps_3fans; + data->attrs.attrs = quanta_hwmon_ly_series_attr_6temps_3fans; } else{ - data->attrs.attrs = quanta_hwmon_attr; + data->attrs.attrs = quanta_hwmon_ly_series_attr; } err = sysfs_create_group(&client->dev.kobj, &data->attrs); if (err) @@ -234,17 +234,18 @@ exit_remove: return err; } -static int quanta_hwmon_remove(struct i2c_client *client) +static int quanta_hwmon_ly_series_remove(struct i2c_client *client) { - struct quanta_hwmon_data *data = i2c_get_clientdata(client); + struct quanta_hwmon_ly_series_data *data = i2c_get_clientdata(client); hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &data->attrs); return 0; } -module_i2c_driver(quanta_hwmon_driver); +module_i2c_driver(quanta_hwmon_ly_series_driver); -MODULE_AUTHOR("QCT Technical "); -MODULE_DESCRIPTION("Quanta LY6 hardware monitor driver"); +MODULE_AUTHOR("Jonathan Tsai (jonathan.tsai@quantatw.com)"); +MODULE_VERSION("1.0"); +MODULE_DESCRIPTION("Quanta LY6/LY8/LY9 hardware monitor driver"); MODULE_LICENSE("GPL"); diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/python/x86_64_quanta_ly6_rangeley_r0/__init__.py b/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/python/x86_64_quanta_ly6_rangeley_r0/__init__.py index 48a87b41..a507afba 100755 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/python/x86_64_quanta_ly6_rangeley_r0/__init__.py +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/python/x86_64_quanta_ly6_rangeley_r0/__init__.py @@ -8,7 +8,7 @@ class OnlPlatform_x86_64_quanta_ly6_rangeley_r0(OnlPlatformQuanta, SYS_OBJECT_ID='.6.1' def baseconfig(self): - self.insmod("quanta_hwmon") + self.insmod("quanta_hwmon_ly_series") self.insmod("quanta-ly6-i2c-mux") self.insmod("quanta_platform_ly6") diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/python/x86_64_quanta_ly8_rangeley_r0/__init__.py b/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/python/x86_64_quanta_ly8_rangeley_r0/__init__.py index 1e0b715a..a8cdbdd2 100755 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/python/x86_64_quanta_ly8_rangeley_r0/__init__.py +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/python/x86_64_quanta_ly8_rangeley_r0/__init__.py @@ -9,7 +9,7 @@ class OnlPlatform_x86_64_quanta_ly8_rangeley_r0(OnlPlatformQuanta, def baseconfig(self): self.insmod("emerson700") - self.insmod("quanta_hwmon") + self.insmod("quanta_hwmon_ly_series") self.insmod("quanta_platform_ly8") # make ds1339 as default rtc diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly9-rangeley/platform-config/r0/src/python/x86_64_quanta_ly9_rangeley_r0/__init__.py b/packages/platforms/quanta/x86-64/x86-64-quanta-ly9-rangeley/platform-config/r0/src/python/x86_64_quanta_ly9_rangeley_r0/__init__.py index 0aa785e9..6cff7f46 100755 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly9-rangeley/platform-config/r0/src/python/x86_64_quanta_ly9_rangeley_r0/__init__.py +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly9-rangeley/platform-config/r0/src/python/x86_64_quanta_ly9_rangeley_r0/__init__.py @@ -9,7 +9,7 @@ class OnlPlatform_x86_64_quanta_ly9_rangeley_r0(OnlPlatformQuanta, def baseconfig(self): self.insmod("emerson700") - self.insmod("quanta_hwmon") + self.insmod("quanta_hwmon_ly_series") self.insmod("qci_cpld") self.insmod("quanta_platform_ly9")