hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/lpc_sch.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * lpc_sch.c - LPC interface for Intel Poulsbo SCH
34 *
....@@ -9,15 +10,6 @@
910 * Copyright (c) 2010 CompuLab Ltd
1011 * Copyright (c) 2014 Intel Corp.
1112 * Author: Denis Turischev <denis@compulab.co.il>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License 2 as published
15
- * by the Free Software Foundation.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
2113 */
2214
2315 #include <linux/kernel.h>
....@@ -30,12 +22,9 @@
3022 #define SMBASE 0x40
3123 #define SMBUS_IO_SIZE 64
3224
33
-#define GPIOBASE 0x44
25
+#define GPIO_BASE 0x44
3426 #define GPIO_IO_SIZE 64
3527 #define GPIO_IO_SIZE_CENTERTON 128
36
-
37
-/* Intel Quark X1000 GPIO IRQ Number */
38
-#define GPIO_IRQ_QUARK_X1000 9
3928
4029 #define WDTBASE 0x84
4130 #define WDT_IO_SIZE 64
....@@ -51,30 +40,25 @@
5140 unsigned int io_size_smbus;
5241 unsigned int io_size_gpio;
5342 unsigned int io_size_wdt;
54
- int irq_gpio;
5543 };
5644
5745 static struct lpc_sch_info sch_chipset_info[] = {
5846 [LPC_SCH] = {
5947 .io_size_smbus = SMBUS_IO_SIZE,
6048 .io_size_gpio = GPIO_IO_SIZE,
61
- .irq_gpio = -1,
6249 },
6350 [LPC_ITC] = {
6451 .io_size_smbus = SMBUS_IO_SIZE,
6552 .io_size_gpio = GPIO_IO_SIZE,
6653 .io_size_wdt = WDT_IO_SIZE,
67
- .irq_gpio = -1,
6854 },
6955 [LPC_CENTERTON] = {
7056 .io_size_smbus = SMBUS_IO_SIZE,
7157 .io_size_gpio = GPIO_IO_SIZE_CENTERTON,
7258 .io_size_wdt = WDT_IO_SIZE,
73
- .irq_gpio = -1,
7459 },
7560 [LPC_QUARK_X1000] = {
7661 .io_size_gpio = GPIO_IO_SIZE,
77
- .irq_gpio = GPIO_IRQ_QUARK_X1000,
7862 .io_size_wdt = WDT_IO_SIZE,
7963 },
8064 };
....@@ -121,13 +105,13 @@
121105 }
122106
123107 static int lpc_sch_populate_cell(struct pci_dev *pdev, int where,
124
- const char *name, int size, int irq,
125
- int id, struct mfd_cell *cell)
108
+ const char *name, int size, int id,
109
+ struct mfd_cell *cell)
126110 {
127111 struct resource *res;
128112 int ret;
129113
130
- res = devm_kcalloc(&pdev->dev, 2, sizeof(*res), GFP_KERNEL);
114
+ res = devm_kzalloc(&pdev->dev, sizeof(*res), GFP_KERNEL);
131115 if (!res)
132116 return -ENOMEM;
133117
....@@ -143,18 +127,6 @@
143127 cell->ignore_resource_conflicts = true;
144128 cell->id = id;
145129
146
- /* Check if we need to add an IRQ resource */
147
- if (irq < 0)
148
- return 0;
149
-
150
- res++;
151
-
152
- res->start = irq;
153
- res->end = irq;
154
- res->flags = IORESOURCE_IRQ;
155
-
156
- cell->num_resources++;
157
-
158130 return 0;
159131 }
160132
....@@ -166,15 +138,15 @@
166138 int ret;
167139
168140 ret = lpc_sch_populate_cell(dev, SMBASE, "isch_smbus",
169
- info->io_size_smbus, -1,
141
+ info->io_size_smbus,
170142 id->device, &lpc_sch_cells[cells]);
171143 if (ret < 0)
172144 return ret;
173145 if (ret == 0)
174146 cells++;
175147
176
- ret = lpc_sch_populate_cell(dev, GPIOBASE, "sch_gpio",
177
- info->io_size_gpio, info->irq_gpio,
148
+ ret = lpc_sch_populate_cell(dev, GPIO_BASE, "sch_gpio",
149
+ info->io_size_gpio,
178150 id->device, &lpc_sch_cells[cells]);
179151 if (ret < 0)
180152 return ret;
....@@ -182,7 +154,7 @@
182154 cells++;
183155
184156 ret = lpc_sch_populate_cell(dev, WDTBASE, "ie6xx_wdt",
185
- info->io_size_wdt, -1,
157
+ info->io_size_wdt,
186158 id->device, &lpc_sch_cells[cells]);
187159 if (ret < 0)
188160 return ret;