g762.c (6ce402327a6fb714a9f40a0bb59bcbfe383839a5) g762.c (f4a180247e06c69e7d8fac4eb14d172c3a5d43a3)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * g762 - Driver for the Global Mixed-mode Technology Inc. fan speed
4 * PWM controller chips from G762 family, i.e. G762 and G763
5 *
6 * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
7 *
8 * This work is based on a basic version for 2.6.31 kernel developed

--- 30 unchanged lines hidden (view full) ---

39#include <linux/kernel.h>
40#include <linux/clk.h>
41#include <linux/of.h>
42#include <linux/platform_data/g762.h>
43
44#define DRVNAME "g762"
45
46static const struct i2c_device_id g762_id[] = {
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * g762 - Driver for the Global Mixed-mode Technology Inc. fan speed
4 * PWM controller chips from G762 family, i.e. G762 and G763
5 *
6 * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
7 *
8 * This work is based on a basic version for 2.6.31 kernel developed

--- 30 unchanged lines hidden (view full) ---

39#include <linux/kernel.h>
40#include <linux/clk.h>
41#include <linux/of.h>
42#include <linux/platform_data/g762.h>
43
44#define DRVNAME "g762"
45
46static const struct i2c_device_id g762_id[] = {
47 { "g761" },
47 { "g762" },
48 { "g763" },
49 { }
50};
51MODULE_DEVICE_TABLE(i2c, g762_id);
52
53enum g762_regs {
54 G762_REG_SET_CNT = 0x00,

--- 1023 unchanged lines hidden (view full) ---

1078 data = devm_kzalloc(dev, sizeof(struct g762_data), GFP_KERNEL);
1079 if (!data)
1080 return -ENOMEM;
1081
1082 i2c_set_clientdata(client, data);
1083 data->client = client;
1084 mutex_init(&data->update_lock);
1085
48 { "g762" },
49 { "g763" },
50 { }
51};
52MODULE_DEVICE_TABLE(i2c, g762_id);
53
54enum g762_regs {
55 G762_REG_SET_CNT = 0x00,

--- 1023 unchanged lines hidden (view full) ---

1079 data = devm_kzalloc(dev, sizeof(struct g762_data), GFP_KERNEL);
1080 if (!data)
1081 return -ENOMEM;
1082
1083 i2c_set_clientdata(client, data);
1084 data->client = client;
1085 mutex_init(&data->update_lock);
1086
1086 /* Enable fan failure detection and fan out of control protection */
1087 ret = g762_fan_init(dev);
1087 /* Get configuration via DT ... */
1088 ret = g762_of_clock_enable(client);
1088 if (ret)
1089 return ret;
1090
1089 if (ret)
1090 return ret;
1091
1091 /* Get configuration via DT ... */
1092 ret = g762_of_clock_enable(client);
1092 /* Enable fan failure detection and fan out of control protection */
1093 ret = g762_fan_init(dev);
1093 if (ret)
1094 return ret;
1094 if (ret)
1095 return ret;
1096
1095 ret = g762_of_prop_import(client);
1096 if (ret)
1097 return ret;
1098 /* ... or platform_data */
1099 ret = g762_pdata_prop_import(client);
1100 if (ret)
1101 return ret;
1102

--- 19 unchanged lines hidden ---
1097 ret = g762_of_prop_import(client);
1098 if (ret)
1099 return ret;
1100 /* ... or platform_data */
1101 ret = g762_pdata_prop_import(client);
1102 if (ret)
1103 return ret;
1104

--- 19 unchanged lines hidden ---