linux/drivers/hwmon/sch5636.c
<<
>>
Prefs
   1/***************************************************************************
   2 *   Copyright (C) 2011-2012 Hans de Goede <hdegoede@redhat.com>           *
   3 *                                                                         *
   4 *   This program is free software; you can redistribute it and/or modify  *
   5 *   it under the terms of the GNU General Public License as published by  *
   6 *   the Free Software Foundation; either version 2 of the License, or     *
   7 *   (at your option) any later version.                                   *
   8 *                                                                         *
   9 *   This program is distributed in the hope that it will be useful,       *
  10 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  12 *   GNU General Public License for more details.                          *
  13 *                                                                         *
  14 *   You should have received a copy of the GNU General Public License     *
  15 *   along with this program; if not, write to the                         *
  16 *   Free Software Foundation, Inc.,                                       *
  17 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  18 ***************************************************************************/
  19
  20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  21
  22#include <linux/module.h>
  23#include <linux/init.h>
  24#include <linux/slab.h>
  25#include <linux/jiffies.h>
  26#include <linux/platform_device.h>
  27#include <linux/hwmon.h>
  28#include <linux/hwmon-sysfs.h>
  29#include <linux/err.h>
  30#include <linux/mutex.h>
  31#include "sch56xx-common.h"
  32
  33#define DRVNAME "sch5636"
  34#define DEVNAME "theseus" /* We only support one model for now */
  35
  36#define SCH5636_REG_FUJITSU_ID          0x780
  37#define SCH5636_REG_FUJITSU_REV         0x783
  38
  39#define SCH5636_NO_INS                  5
  40#define SCH5636_NO_TEMPS                16
  41#define SCH5636_NO_FANS                 8
  42
  43static const u16 SCH5636_REG_IN_VAL[SCH5636_NO_INS] = {
  44        0x22, 0x23, 0x24, 0x25, 0x189 };
  45static const u16 SCH5636_REG_IN_FACTORS[SCH5636_NO_INS] = {
  46        4400, 1500, 4000, 4400, 16000 };
  47static const char * const SCH5636_IN_LABELS[SCH5636_NO_INS] = {
  48        "3.3V", "VREF", "VBAT", "3.3AUX", "12V" };
  49
  50static const u16 SCH5636_REG_TEMP_VAL[SCH5636_NO_TEMPS] = {
  51        0x2B, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x180, 0x181,
  52        0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C };
  53#define SCH5636_REG_TEMP_CTRL(i)        (0x790 + (i))
  54#define SCH5636_TEMP_WORKING            0x01
  55#define SCH5636_TEMP_ALARM              0x02
  56#define SCH5636_TEMP_DEACTIVATED        0x80
  57
  58static const u16 SCH5636_REG_FAN_VAL[SCH5636_NO_FANS] = {
  59        0x2C, 0x2E, 0x30, 0x32, 0x62, 0x64, 0x66, 0x68 };
  60#define SCH5636_REG_FAN_CTRL(i)         (0x880 + (i))
  61/* FAULT in datasheet, but acts as an alarm */
  62#define SCH5636_FAN_ALARM               0x04
  63#define SCH5636_FAN_NOT_PRESENT         0x08
  64#define SCH5636_FAN_DEACTIVATED         0x80
  65
  66
  67struct sch5636_data {
  68        unsigned short addr;
  69        struct device *hwmon_dev;
  70        struct sch56xx_watchdog_data *watchdog;
  71
  72        struct mutex update_lock;
  73        char valid;                     /* !=0 if following fields are valid */
  74        unsigned long last_updated;     /* In jiffies */
  75        u8 in[SCH5636_NO_INS];
  76        u8 temp_val[SCH5636_NO_TEMPS];
  77        u8 temp_ctrl[SCH5636_NO_TEMPS];
  78        u16 fan_val[SCH5636_NO_FANS];
  79        u8 fan_ctrl[SCH5636_NO_FANS];
  80};
  81
  82static struct sch5636_data *sch5636_update_device(struct device *dev)
  83{
  84        struct sch5636_data *data = dev_get_drvdata(dev);
  85        struct sch5636_data *ret = data;
  86        int i, val;
  87
  88        mutex_lock(&data->update_lock);
  89
  90        /* Cache the values for 1 second */
  91        if (data->valid && !time_after(jiffies, data->last_updated + HZ))
  92                goto abort;
  93
  94        for (i = 0; i < SCH5636_NO_INS; i++) {
  95                val = sch56xx_read_virtual_reg(data->addr,
  96                                               SCH5636_REG_IN_VAL[i]);
  97                if (unlikely(val < 0)) {
  98                        ret = ERR_PTR(val);
  99                        goto abort;
 100                }
 101                data->in[i] = val;
 102        }
 103
 104        for (i = 0; i < SCH5636_NO_TEMPS; i++) {
 105                if (data->temp_ctrl[i] & SCH5636_TEMP_DEACTIVATED)
 106                        continue;
 107
 108                val = sch56xx_read_virtual_reg(data->addr,
 109                                               SCH5636_REG_TEMP_VAL[i]);
 110                if (unlikely(val < 0)) {
 111                        ret = ERR_PTR(val);
 112                        goto abort;
 113                }
 114                data->temp_val[i] = val;
 115
 116                val = sch56xx_read_virtual_reg(data->addr,
 117                                               SCH5636_REG_TEMP_CTRL(i));
 118                if (unlikely(val < 0)) {
 119                        ret = ERR_PTR(val);
 120                        goto abort;
 121                }
 122                data->temp_ctrl[i] = val;
 123                /* Alarms need to be explicitly write-cleared */
 124                if (val & SCH5636_TEMP_ALARM) {
 125                        sch56xx_write_virtual_reg(data->addr,
 126                                                SCH5636_REG_TEMP_CTRL(i), val);
 127                }
 128        }
 129
 130        for (i = 0; i < SCH5636_NO_FANS; i++) {
 131                if (data->fan_ctrl[i] & SCH5636_FAN_DEACTIVATED)
 132                        continue;
 133
 134                val = sch56xx_read_virtual_reg16(data->addr,
 135                                                 SCH5636_REG_FAN_VAL[i]);
 136                if (unlikely(val < 0)) {
 137                        ret = ERR_PTR(val);
 138                        goto abort;
 139                }
 140                data->fan_val[i] = val;
 141
 142                val = sch56xx_read_virtual_reg(data->addr,
 143                                               SCH5636_REG_FAN_CTRL(i));
 144                if (unlikely(val < 0)) {
 145                        ret = ERR_PTR(val);
 146                        goto abort;
 147                }
 148                data->fan_ctrl[i] = val;
 149                /* Alarms need to be explicitly write-cleared */
 150                if (val & SCH5636_FAN_ALARM) {
 151                        sch56xx_write_virtual_reg(data->addr,
 152                                                SCH5636_REG_FAN_CTRL(i), val);
 153                }
 154        }
 155
 156        data->last_updated = jiffies;
 157        data->valid = 1;
 158abort:
 159        mutex_unlock(&data->update_lock);
 160        return ret;
 161}
 162
 163static int reg_to_rpm(u16 reg)
 164{
 165        if (reg == 0)
 166                return -EIO;
 167        if (reg == 0xffff)
 168                return 0;
 169
 170        return 5400540 / reg;
 171}
 172
 173static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
 174        char *buf)
 175{
 176        return snprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
 177}
 178
 179static ssize_t show_in_value(struct device *dev, struct device_attribute
 180        *devattr, char *buf)
 181{
 182        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 183        struct sch5636_data *data = sch5636_update_device(dev);
 184        int val;
 185
 186        if (IS_ERR(data))
 187                return PTR_ERR(data);
 188
 189        val = DIV_ROUND_CLOSEST(
 190                data->in[attr->index] * SCH5636_REG_IN_FACTORS[attr->index],
 191                255);
 192        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 193}
 194
 195static ssize_t show_in_label(struct device *dev, struct device_attribute
 196        *devattr, char *buf)
 197{
 198        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 199
 200        return snprintf(buf, PAGE_SIZE, "%s\n",
 201                        SCH5636_IN_LABELS[attr->index]);
 202}
 203
 204static ssize_t show_temp_value(struct device *dev, struct device_attribute
 205        *devattr, char *buf)
 206{
 207        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 208        struct sch5636_data *data = sch5636_update_device(dev);
 209        int val;
 210
 211        if (IS_ERR(data))
 212                return PTR_ERR(data);
 213
 214        val = (data->temp_val[attr->index] - 64) * 1000;
 215        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 216}
 217
 218static ssize_t show_temp_fault(struct device *dev, struct device_attribute
 219        *devattr, char *buf)
 220{
 221        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 222        struct sch5636_data *data = sch5636_update_device(dev);
 223        int val;
 224
 225        if (IS_ERR(data))
 226                return PTR_ERR(data);
 227
 228        val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_WORKING) ? 0 : 1;
 229        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 230}
 231
 232static ssize_t show_temp_alarm(struct device *dev, struct device_attribute
 233        *devattr, char *buf)
 234{
 235        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 236        struct sch5636_data *data = sch5636_update_device(dev);
 237        int val;
 238
 239        if (IS_ERR(data))
 240                return PTR_ERR(data);
 241
 242        val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_ALARM) ? 1 : 0;
 243        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 244}
 245
 246static ssize_t show_fan_value(struct device *dev, struct device_attribute
 247        *devattr, char *buf)
 248{
 249        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 250        struct sch5636_data *data = sch5636_update_device(dev);
 251        int val;
 252
 253        if (IS_ERR(data))
 254                return PTR_ERR(data);
 255
 256        val = reg_to_rpm(data->fan_val[attr->index]);
 257        if (val < 0)
 258                return val;
 259
 260        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 261}
 262
 263static ssize_t show_fan_fault(struct device *dev, struct device_attribute
 264        *devattr, char *buf)
 265{
 266        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 267        struct sch5636_data *data = sch5636_update_device(dev);
 268        int val;
 269
 270        if (IS_ERR(data))
 271                return PTR_ERR(data);
 272
 273        val = (data->fan_ctrl[attr->index] & SCH5636_FAN_NOT_PRESENT) ? 1 : 0;
 274        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 275}
 276
 277static ssize_t show_fan_alarm(struct device *dev, struct device_attribute
 278        *devattr, char *buf)
 279{
 280        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 281        struct sch5636_data *data = sch5636_update_device(dev);
 282        int val;
 283
 284        if (IS_ERR(data))
 285                return PTR_ERR(data);
 286
 287        val = (data->fan_ctrl[attr->index] & SCH5636_FAN_ALARM) ? 1 : 0;
 288        return snprintf(buf, PAGE_SIZE, "%d\n", val);
 289}
 290
 291static struct sensor_device_attribute sch5636_attr[] = {
 292        SENSOR_ATTR(name, 0444, show_name, NULL, 0),
 293        SENSOR_ATTR(in0_input, 0444, show_in_value, NULL, 0),
 294        SENSOR_ATTR(in0_label, 0444, show_in_label, NULL, 0),
 295        SENSOR_ATTR(in1_input, 0444, show_in_value, NULL, 1),
 296        SENSOR_ATTR(in1_label, 0444, show_in_label, NULL, 1),
 297        SENSOR_ATTR(in2_input, 0444, show_in_value, NULL, 2),
 298        SENSOR_ATTR(in2_label, 0444, show_in_label, NULL, 2),
 299        SENSOR_ATTR(in3_input, 0444, show_in_value, NULL, 3),
 300        SENSOR_ATTR(in3_label, 0444, show_in_label, NULL, 3),
 301        SENSOR_ATTR(in4_input, 0444, show_in_value, NULL, 4),
 302        SENSOR_ATTR(in4_label, 0444, show_in_label, NULL, 4),
 303};
 304
 305static struct sensor_device_attribute sch5636_temp_attr[] = {
 306        SENSOR_ATTR(temp1_input, 0444, show_temp_value, NULL, 0),
 307        SENSOR_ATTR(temp1_fault, 0444, show_temp_fault, NULL, 0),
 308        SENSOR_ATTR(temp1_alarm, 0444, show_temp_alarm, NULL, 0),
 309        SENSOR_ATTR(temp2_input, 0444, show_temp_value, NULL, 1),
 310        SENSOR_ATTR(temp2_fault, 0444, show_temp_fault, NULL, 1),
 311        SENSOR_ATTR(temp2_alarm, 0444, show_temp_alarm, NULL, 1),
 312        SENSOR_ATTR(temp3_input, 0444, show_temp_value, NULL, 2),
 313        SENSOR_ATTR(temp3_fault, 0444, show_temp_fault, NULL, 2),
 314        SENSOR_ATTR(temp3_alarm, 0444, show_temp_alarm, NULL, 2),
 315        SENSOR_ATTR(temp4_input, 0444, show_temp_value, NULL, 3),
 316        SENSOR_ATTR(temp4_fault, 0444, show_temp_fault, NULL, 3),
 317        SENSOR_ATTR(temp4_alarm, 0444, show_temp_alarm, NULL, 3),
 318        SENSOR_ATTR(temp5_input, 0444, show_temp_value, NULL, 4),
 319        SENSOR_ATTR(temp5_fault, 0444, show_temp_fault, NULL, 4),
 320        SENSOR_ATTR(temp5_alarm, 0444, show_temp_alarm, NULL, 4),
 321        SENSOR_ATTR(temp6_input, 0444, show_temp_value, NULL, 5),
 322        SENSOR_ATTR(temp6_fault, 0444, show_temp_fault, NULL, 5),
 323        SENSOR_ATTR(temp6_alarm, 0444, show_temp_alarm, NULL, 5),
 324        SENSOR_ATTR(temp7_input, 0444, show_temp_value, NULL, 6),
 325        SENSOR_ATTR(temp7_fault, 0444, show_temp_fault, NULL, 6),
 326        SENSOR_ATTR(temp7_alarm, 0444, show_temp_alarm, NULL, 6),
 327        SENSOR_ATTR(temp8_input, 0444, show_temp_value, NULL, 7),
 328        SENSOR_ATTR(temp8_fault, 0444, show_temp_fault, NULL, 7),
 329        SENSOR_ATTR(temp8_alarm, 0444, show_temp_alarm, NULL, 7),
 330        SENSOR_ATTR(temp9_input, 0444, show_temp_value, NULL, 8),
 331        SENSOR_ATTR(temp9_fault, 0444, show_temp_fault, NULL, 8),
 332        SENSOR_ATTR(temp9_alarm, 0444, show_temp_alarm, NULL, 8),
 333        SENSOR_ATTR(temp10_input, 0444, show_temp_value, NULL, 9),
 334        SENSOR_ATTR(temp10_fault, 0444, show_temp_fault, NULL, 9),
 335        SENSOR_ATTR(temp10_alarm, 0444, show_temp_alarm, NULL, 9),
 336        SENSOR_ATTR(temp11_input, 0444, show_temp_value, NULL, 10),
 337        SENSOR_ATTR(temp11_fault, 0444, show_temp_fault, NULL, 10),
 338        SENSOR_ATTR(temp11_alarm, 0444, show_temp_alarm, NULL, 10),
 339        SENSOR_ATTR(temp12_input, 0444, show_temp_value, NULL, 11),
 340        SENSOR_ATTR(temp12_fault, 0444, show_temp_fault, NULL, 11),
 341        SENSOR_ATTR(temp12_alarm, 0444, show_temp_alarm, NULL, 11),
 342        SENSOR_ATTR(temp13_input, 0444, show_temp_value, NULL, 12),
 343        SENSOR_ATTR(temp13_fault, 0444, show_temp_fault, NULL, 12),
 344        SENSOR_ATTR(temp13_alarm, 0444, show_temp_alarm, NULL, 12),
 345        SENSOR_ATTR(temp14_input, 0444, show_temp_value, NULL, 13),
 346        SENSOR_ATTR(temp14_fault, 0444, show_temp_fault, NULL, 13),
 347        SENSOR_ATTR(temp14_alarm, 0444, show_temp_alarm, NULL, 13),
 348        SENSOR_ATTR(temp15_input, 0444, show_temp_value, NULL, 14),
 349        SENSOR_ATTR(temp15_fault, 0444, show_temp_fault, NULL, 14),
 350        SENSOR_ATTR(temp15_alarm, 0444, show_temp_alarm, NULL, 14),
 351        SENSOR_ATTR(temp16_input, 0444, show_temp_value, NULL, 15),
 352        SENSOR_ATTR(temp16_fault, 0444, show_temp_fault, NULL, 15),
 353        SENSOR_ATTR(temp16_alarm, 0444, show_temp_alarm, NULL, 15),
 354};
 355
 356static struct sensor_device_attribute sch5636_fan_attr[] = {
 357        SENSOR_ATTR(fan1_input, 0444, show_fan_value, NULL, 0),
 358        SENSOR_ATTR(fan1_fault, 0444, show_fan_fault, NULL, 0),
 359        SENSOR_ATTR(fan1_alarm, 0444, show_fan_alarm, NULL, 0),
 360        SENSOR_ATTR(fan2_input, 0444, show_fan_value, NULL, 1),
 361        SENSOR_ATTR(fan2_fault, 0444, show_fan_fault, NULL, 1),
 362        SENSOR_ATTR(fan2_alarm, 0444, show_fan_alarm, NULL, 1),
 363        SENSOR_ATTR(fan3_input, 0444, show_fan_value, NULL, 2),
 364        SENSOR_ATTR(fan3_fault, 0444, show_fan_fault, NULL, 2),
 365        SENSOR_ATTR(fan3_alarm, 0444, show_fan_alarm, NULL, 2),
 366        SENSOR_ATTR(fan4_input, 0444, show_fan_value, NULL, 3),
 367        SENSOR_ATTR(fan4_fault, 0444, show_fan_fault, NULL, 3),
 368        SENSOR_ATTR(fan4_alarm, 0444, show_fan_alarm, NULL, 3),
 369        SENSOR_ATTR(fan5_input, 0444, show_fan_value, NULL, 4),
 370        SENSOR_ATTR(fan5_fault, 0444, show_fan_fault, NULL, 4),
 371        SENSOR_ATTR(fan5_alarm, 0444, show_fan_alarm, NULL, 4),
 372        SENSOR_ATTR(fan6_input, 0444, show_fan_value, NULL, 5),
 373        SENSOR_ATTR(fan6_fault, 0444, show_fan_fault, NULL, 5),
 374        SENSOR_ATTR(fan6_alarm, 0444, show_fan_alarm, NULL, 5),
 375        SENSOR_ATTR(fan7_input, 0444, show_fan_value, NULL, 6),
 376        SENSOR_ATTR(fan7_fault, 0444, show_fan_fault, NULL, 6),
 377        SENSOR_ATTR(fan7_alarm, 0444, show_fan_alarm, NULL, 6),
 378        SENSOR_ATTR(fan8_input, 0444, show_fan_value, NULL, 7),
 379        SENSOR_ATTR(fan8_fault, 0444, show_fan_fault, NULL, 7),
 380        SENSOR_ATTR(fan8_alarm, 0444, show_fan_alarm, NULL, 7),
 381};
 382
 383static int sch5636_remove(struct platform_device *pdev)
 384{
 385        struct sch5636_data *data = platform_get_drvdata(pdev);
 386        int i;
 387
 388        if (data->watchdog)
 389                sch56xx_watchdog_unregister(data->watchdog);
 390
 391        if (data->hwmon_dev)
 392                hwmon_device_unregister(data->hwmon_dev);
 393
 394        for (i = 0; i < ARRAY_SIZE(sch5636_attr); i++)
 395                device_remove_file(&pdev->dev, &sch5636_attr[i].dev_attr);
 396
 397        for (i = 0; i < SCH5636_NO_TEMPS * 3; i++)
 398                device_remove_file(&pdev->dev,
 399                                   &sch5636_temp_attr[i].dev_attr);
 400
 401        for (i = 0; i < SCH5636_NO_FANS * 3; i++)
 402                device_remove_file(&pdev->dev,
 403                                   &sch5636_fan_attr[i].dev_attr);
 404
 405        return 0;
 406}
 407
 408static int __devinit sch5636_probe(struct platform_device *pdev)
 409{
 410        struct sch5636_data *data;
 411        int i, err, val, revision[2];
 412        char id[4];
 413
 414        data = devm_kzalloc(&pdev->dev, sizeof(struct sch5636_data),
 415                            GFP_KERNEL);
 416        if (!data)
 417                return -ENOMEM;
 418
 419        data->addr = platform_get_resource(pdev, IORESOURCE_IO, 0)->start;
 420        mutex_init(&data->update_lock);
 421        platform_set_drvdata(pdev, data);
 422
 423        for (i = 0; i < 3; i++) {
 424                val = sch56xx_read_virtual_reg(data->addr,
 425                                               SCH5636_REG_FUJITSU_ID + i);
 426                if (val < 0) {
 427                        pr_err("Could not read Fujitsu id byte at %#x\n",
 428                                SCH5636_REG_FUJITSU_ID + i);
 429                        err = val;
 430                        goto error;
 431                }
 432                id[i] = val;
 433        }
 434        id[i] = '\0';
 435
 436        if (strcmp(id, "THS")) {
 437                pr_err("Unknown Fujitsu id: %02x%02x%02x\n",
 438                       id[0], id[1], id[2]);
 439                err = -ENODEV;
 440                goto error;
 441        }
 442
        for (i = 0; i <2;49"> 349 375    22 3796lat>"line" name"sre5">tem33" id="L433".ass="sref">val;
 427                        NULL, 12),
data->addr,
NULL, 13),
,
NULL, 13),
 426                if (s="sref">id[0], id[1], NULL, 13),
"439" id="L439" class="line" name="L43LL" class4"sref">NULL, 14),
 430                        goto NULL, 14),
NULL, 14),
 435
(i <LL" class4"sref">NULL, 15),
 * 3;         for (i = 0; )) {
<" id="L410" class="line" name="L410"1437"> 437                NULL, 15),
dev,
 353     4   comment">/* RSU_Iall 98" 27"fe="Ltrl class="ls "srde="lm353 which are actlas */ne" nam+code=dev" class="sref">dev,
dlass="sref">pdev->dev, &sch5636_attr[error;
 354};
;
 442
        for (i = 0; i <lass="sre4">sch5636_fan_attr[]4= {
<45> 426                if ( 37"> 437                NULL,40),
<45 class="string">">addr,
NULL,40),
<46       NULL,40),
<46.c#L429" id="L429" cllllllllls="sref">id[0], id[1], NULL,41),
<46s="sref">err = NULL,41),
<46_FANS * 3;         for (    98" cLtrlL410"
 430                        goto NULL,41),
<4 href="drivers439" id="L439" class="line" name="L43+="line" 4" class="sref">NULL,42),
<46sref">val;
NULL,42),
<46lass="sref">dlass="sref">pdev->dev, &s6_temp_attr[error;
NULL,42),
<46pan>;
 442
        for (i = 0; NULL,43),
<46> 426                if ( 37"> 437                NULL,43),
<46 class="string">">addr,
NULL,43),
<47       NULL,44),
<47.c#L429" id="L429" cllllllllls="sref">id[0], id[1], NULL,44),
<47s="sref">err = NULL,44),
<47_FANS * 3;         for (    402"LtrlL410"
 430                        goto NULL,45),
<47href="drivers439" id="L439" class="line" name="L43+code=NUL4" class="sref">NULL,45),
<47sref">val;
NULL,45),
<47lass="sref">dlass="sref">pdev->dev, &(data->hwmon_dev);
NULL,46),
<47pan>;
 401        for (i = 0; i < NULL,46),
<47> 426                if (ARRAY_SIZE(sch5636_attr); i++)
NULL,46),
<47 class="string">">dev, sizeof(struct NULL,47),
<48       SCH5636_REG_FUJITSU_ID + NULL,47),
<48n/sch5636.c#L439" id="L439" class="line" name="L430" class=4line" name="L380"> 380    4   SENSOR_4TTR( 440                goto sch5636_attr[hwmon_dev);
};
 389                    98" cLtrlL410"
;
i" c_DEACTIVATE; 0) {
dev, sizeof(struct tem33" id="L43continue_ID +  384{
,
 401        for (i = 0; i < data = i++)
 398                device_remove_file(& 3864     4 int dev, sizeof(struct d4ta->SCH5636_REG_FUJITSU_ID + data->data-> 440                goto s6_temp_attr[hwmon_dev);
 389                    402"LtrlL410"
;
=i"_DEACTIVATE; 0) {
dev, sizeof(struct  393
 +  395          4     4a href="+code=device_remove_file" class="4ref">devi4e_remove_file(&<4 href49pan>;
 401        for (i = 0; i <  39999999999999999999999999sref">i++)
 402                device_remove_file(&SCH4636_N4_TEMPS * 3; dev, sizeof(struct pdev-&g5;SCH5636_REG_FUJITSU_ID + SC55636_50href="drivers/hwmon/sch5636.0
 391",
 401        for (i = 0; device_remove_file(&pdev-5gt;        }
        for ( 391,
        for ( 391(& 395          5ch56350lass="sref">data-/hwmon/sch5636.0
 391",
(&(&<5/a>].50pan>;
SCH5636_REG_FUJITSU_ID + SCH5
 4085tatic5int  comment">/* Note fai408g "srclass="l the 88"> 388 is_FUJIa fatal G_FUJ */ne" nam+code=dev" class="sref">dev,
 * 388lass="line" name="L442"> 4387" clasers/hwmon/sch5636.c#L387" id="L387" clasclass="line" ame="L401"> 401        for (i = 0;  420        i = 0; sch56365data<51s="sref">err = )) {
<" id="L410" class="line" name="L410"14ref="+code=i" class="sch5636.c#L441"5s=SCH56365e" name="L411"> 411 5     51_FANS * 3; addr = platform_get_resource(e5r51ref="+code=dev" class="sref">dev,
 403                    5"sref">de5m_kzalloc(&SCH5636_REG_FUJITSU:="+code=device_remove_file" class="5=8ef="dri5 401        for ( +  419        IO5ESOUR5E_IO5ata->" id="L/a>        return 0;
las href="drivers/hwmon/sch5636.c#L441"5ref">upda5e_lock);
las href="drivers/hwmon/sch5636.c#L441"5ra href="5 href="+code=data" class5"sref5>data);
5+5) {
(i <5ead_virtu5l_reg(d}ref="+code=i" class="sref">i <5e"+code=s5ss="line" name="L425"> 4555                   405"drivers/hass="line" name="L442" id="L405" class="line" name="L405"> 405ref="+code=i" class="sref">i <5e8ef="dri5="L426" class="line" nam5="L425"> 426        i <5e9ef="dri5r_err" class="sref">pr_e5r55428                 5     53f="+code=dev" class="sref">dev,
i5;
 401 2" id="Lr9" cl   for (=_ID + erro5;5 401 MODULe_DESCRIPTION   for ( 435
id_ID +  431   5     5      L401"> 401 MODULe_AUTHO="L379" class="lMODULe_AUTHO=="sreLame="L435"> 435
id_ID +  401 MODULe_LICENSer( 435
id_ID + 


The o5 + LXR communitye=pdasthis experimental ref=e=" by D + lxo@" cux.noe=pd.
lxo." cux.no kindly hosted by D + Redpill L cpro ASe=pdasprovider of L cux"consult