Skip to content

Commit 3c0dcb6

Browse files
committed
[platform-module-cel] Update Silverstone to use buster kernel.
1 parent 0452e0e commit 3c0dcb6

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

platform/broadcom/sonic-platform-modules-cel/silverstone/modules/cls-switchboard.c

+42-42
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/interrupt.h>
2323
#include <linux/i2c.h>
2424
#include <linux/platform_device.h>
25-
#include <linux/i2c/pca954x.h>
25+
#include <linux/platform_data/pca954x.h>
2626
#include "i2c-ocores.h"
2727
#include "xcvr-cls.h"
2828

@@ -58,7 +58,7 @@ struct i2c_bus_config {
5858
struct resource *res;
5959
ssize_t num_res;
6060
struct ocores_i2c_platform_data pdata;
61-
};
61+
};
6262

6363
/* switchbrd_priv - switchboard private data */
6464
struct switchbrd_priv {
@@ -73,27 +73,27 @@ struct switchbrd_priv {
7373
/* I2C bus speed param */
7474
static int bus_clock_master_1 = 100;
7575
module_param(bus_clock_master_1, int, 0660);
76-
MODULE_PARM_DESC(bus_clock_master_1,
76+
MODULE_PARM_DESC(bus_clock_master_1,
7777
"I2C master 1 bus speed in KHz 50/80/100/200/400");
7878

7979
static int bus_clock_master_2 = 100;
8080
module_param(bus_clock_master_2, int, 0660);
81-
MODULE_PARM_DESC(bus_clock_master_2,
81+
MODULE_PARM_DESC(bus_clock_master_2,
8282
"I2C master 2 bus speed in KHz 50/80/100/200/400");
8383

8484
static int bus_clock_master_3 = 100;
8585
module_param(bus_clock_master_3, int, 0660);
86-
MODULE_PARM_DESC(bus_clock_master_3,
86+
MODULE_PARM_DESC(bus_clock_master_3,
8787
"I2C master 3 bus speed in KHz 50/80/100/200/400");
8888

8989
static int bus_clock_master_4 = 100;
9090
module_param(bus_clock_master_4, int, 0660);
91-
MODULE_PARM_DESC(bus_clock_master_4,
91+
MODULE_PARM_DESC(bus_clock_master_4,
9292
"I2C master 4 bus speed in KHz 50/80/100/200/400");
9393

9494
static int bus_clock_master_5 = 100;
9595
module_param(bus_clock_master_5, int, 0660);
96-
MODULE_PARM_DESC(bus_clock_master_5,
96+
MODULE_PARM_DESC(bus_clock_master_5,
9797
"I2C master 5 bus speed in KHz 50/80/100/200/400");
9898

9999
// NOTE: Silverstone i2c channel mapping is very wierd!!!
@@ -186,54 +186,54 @@ static struct i2c_board_info i2c_info_3[] = {
186186
static struct resource cls_i2c_res_1[] = {
187187
{
188188
.start = 0x800, .end = 0x81F,
189-
.flags = IORESOURCE_MEM,},
189+
.flags = IORESOURCE_MEM,},
190190
};
191191

192192
/* Resource IOMEM for i2c bus 2 */
193193
static struct resource cls_i2c_res_2[] = {
194194
{
195195
.start = 0x820, .end = 0x83F,
196-
.flags = IORESOURCE_MEM,},
196+
.flags = IORESOURCE_MEM,},
197197
};
198198

199199
/* Resource IOMEM for i2c bus 3 */
200200
static struct resource cls_i2c_res_3[] = {
201201
{
202202
.start = 0x840, .end = 0x85F,
203-
.flags = IORESOURCE_MEM,},
203+
.flags = IORESOURCE_MEM,},
204204
};
205205

206206
/* Resource IOMEM for i2c bus 4 */
207207
static struct resource cls_i2c_res_4[] = {
208208
{
209209
.start = 0x860, .end = 0x87F,
210-
.flags = IORESOURCE_MEM,},
210+
.flags = IORESOURCE_MEM,},
211211
};
212212

213213
/* Resource IOMEM for i2c bus 5 */
214214
static struct resource cls_i2c_res_5[] = {
215215
{
216216
.start = 0x880, .end = 0x89F,
217-
.flags = IORESOURCE_MEM,},
217+
.flags = IORESOURCE_MEM,},
218218
};
219219

220220
/* Resource IOMEM for reg access */
221221
static struct resource reg_io_res[] = {
222-
{
222+
{
223223
.start = 0x00, .end = 0xFF,
224224
.flags = IORESOURCE_MEM,},
225225
};
226226

227227
/* Resource IOMEM for spi flash firmware upgrade */
228228
static struct resource spi_flash_res[] = {
229-
{
229+
{
230230
.start = 0x1200, .end = 0x121F,
231231
.flags = IORESOURCE_MEM,},
232232
};
233233

234234
/* Resource IOMEM for front panel XCVR */
235235
static struct resource xcvr_res[] = {
236-
{
236+
{
237237
.start = 0x4000, .end = 0x421F,
238238
.flags = IORESOURCE_MEM,},
239239
};
@@ -254,9 +254,9 @@ static struct i2c_bus_config i2c_bus_configs[] = {
254254
},
255255
},
256256
{
257-
.id = 2,
258-
.res = cls_i2c_res_2,
259-
.num_res = ARRAY_SIZE(cls_i2c_res_2),
257+
.id = 2,
258+
.res = cls_i2c_res_2,
259+
.num_res = ARRAY_SIZE(cls_i2c_res_2),
260260
.pdata = {
261261
.reg_shift = OCORE_REGSHIFT,
262262
.reg_io_width = OCORE_REG_IO_WIDTH,
@@ -268,9 +268,9 @@ static struct i2c_bus_config i2c_bus_configs[] = {
268268
},
269269
},
270270
{
271-
.id = 3,
272-
.res = cls_i2c_res_3,
273-
.num_res = ARRAY_SIZE(cls_i2c_res_3),
271+
.id = 3,
272+
.res = cls_i2c_res_3,
273+
.num_res = ARRAY_SIZE(cls_i2c_res_3),
274274
.pdata = {
275275
.reg_shift = OCORE_REGSHIFT,
276276
.reg_io_width = OCORE_REG_IO_WIDTH,
@@ -282,9 +282,9 @@ static struct i2c_bus_config i2c_bus_configs[] = {
282282
},
283283
},
284284
{
285-
.id = 4,
286-
.res = cls_i2c_res_4,
287-
.num_res = ARRAY_SIZE(cls_i2c_res_4),
285+
.id = 4,
286+
.res = cls_i2c_res_4,
287+
.num_res = ARRAY_SIZE(cls_i2c_res_4),
288288
.pdata = {
289289
.reg_shift = OCORE_REGSHIFT,
290290
.reg_io_width = OCORE_REG_IO_WIDTH,
@@ -296,9 +296,9 @@ static struct i2c_bus_config i2c_bus_configs[] = {
296296
},
297297
},
298298
{
299-
.id = 5,
300-
.res = cls_i2c_res_5,
301-
.num_res = ARRAY_SIZE(cls_i2c_res_5),
299+
.id = 5,
300+
.res = cls_i2c_res_5,
301+
.num_res = ARRAY_SIZE(cls_i2c_res_5),
302302
.pdata = {
303303
.reg_shift = OCORE_REGSHIFT,
304304
.reg_io_width = OCORE_REG_IO_WIDTH,
@@ -386,10 +386,10 @@ static int cls_fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
386386
goto err_disable_device;
387387
}
388388

389-
dev_dbg(&dev->dev, "BAR%d res: 0x%lx-0x%llx\n", MMIO_BAR,
389+
dev_dbg(&dev->dev, "BAR%d res: 0x%lx-0x%llx\n", MMIO_BAR,
390390
rstart, pci_resource_end(dev, MMIO_BAR));
391391

392-
priv = devm_kzalloc(&dev->dev,
392+
priv = devm_kzalloc(&dev->dev,
393393
sizeof(struct switchbrd_priv), GFP_KERNEL);
394394
if (!priv){
395395
err = -ENOMEM;
@@ -399,8 +399,8 @@ static int cls_fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
399399
pci_set_drvdata(dev, priv);
400400
num_i2c_bus = ARRAY_SIZE(i2c_bus_configs);
401401
i2cbuses_pdev = devm_kzalloc(
402-
&dev->dev,
403-
num_i2c_bus * sizeof(struct platform_device*),
402+
&dev->dev,
403+
num_i2c_bus * sizeof(struct platform_device*),
404404
GFP_KERNEL);
405405

406406
reg_io_res[0].start += rstart;
@@ -410,7 +410,7 @@ static int cls_fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
410410
xcvr_res[0].end += rstart;
411411

412412
regio_pdev = platform_device_register_resndata(
413-
&dev->dev, "cls-swbrd-io",
413+
&dev->dev, "cls-swbrd-io",
414414
-1,
415415
reg_io_res, ARRAY_SIZE(reg_io_res),
416416
NULL, 0);
@@ -422,12 +422,12 @@ static int cls_fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
422422
}
423423

424424
xcvr_pdev = platform_device_register_resndata(
425-
NULL,
426-
"cls-xcvr",
425+
NULL,
426+
"cls-xcvr",
427427
-1,
428-
xcvr_res,
428+
xcvr_res,
429429
ARRAY_SIZE(xcvr_res),
430-
&xcvr_data,
430+
&xcvr_data,
431431
sizeof(xcvr_data));
432432

433433
if (IS_ERR(xcvr_pdev)) {
@@ -462,20 +462,20 @@ static int cls_fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
462462
}
463463

464464
dev_dbg(&dev->dev, "i2c-bus.%d: 0x%llx - 0x%llx\n",
465-
i2c_bus_configs[i].id,
466-
i2c_bus_configs[i].res[0].start,
465+
i2c_bus_configs[i].id,
466+
i2c_bus_configs[i].res[0].start,
467467
i2c_bus_configs[i].res[0].end);
468468

469469
i2cbuses_pdev[i] = platform_device_register_resndata(
470-
&dev->dev, "cls-ocores-i2c",
470+
&dev->dev, "cls-ocores-i2c",
471471
i2c_bus_configs[i].id,
472-
i2c_bus_configs[i].res,
472+
i2c_bus_configs[i].res,
473473
i2c_bus_configs[i].num_res,
474-
&i2c_bus_configs[i].pdata,
474+
&i2c_bus_configs[i].pdata,
475475
sizeof(i2c_bus_configs[i].pdata));
476476

477477
if (IS_ERR(i2cbuses_pdev[i])) {
478-
dev_err(&dev->dev, "Failed to register ocores-i2c.%d\n",
478+
dev_err(&dev->dev, "Failed to register ocores-i2c.%d\n",
479479
i2c_bus_configs[i].id);
480480
err = PTR_ERR(i2cbuses_pdev[i]);
481481
goto err_unregister_ocore;

0 commit comments

Comments
 (0)