75
75
76
76
#define DRV_NAME "spi-bcm2835"
77
77
78
+ static bool realtime = 1 ;
79
+ module_param (realtime , bool , 0 );
80
+ MODULE_PARM_DESC (realtime , "Run the driver with realtime priority" );
81
+
78
82
struct bcm2835_spi {
79
83
void __iomem * regs ;
80
84
struct clk * clk ;
@@ -315,10 +319,15 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
315
319
316
320
master -> mode_bits = BCM2835_SPI_MODE_BITS ;
317
321
master -> bits_per_word_mask = BIT (8 - 1 );
322
+ #ifdef CONFIG_MACH_BCM2708
323
+ master -> bus_num = pdev -> id ;
324
+ #else
318
325
master -> bus_num = -1 ;
326
+ #endif
319
327
master -> num_chipselect = 3 ;
320
328
master -> transfer_one_message = bcm2835_spi_transfer_one ;
321
329
master -> dev .of_node = pdev -> dev .of_node ;
330
+ master -> rt = realtime ;
322
331
323
332
bs = spi_master_get_devdata (master );
324
333
@@ -345,7 +354,13 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
345
354
goto out_master_put ;
346
355
}
347
356
348
- bs -> irq = irq_of_parse_and_map (pdev -> dev .of_node , 0 );
357
+ #ifdef CONFIG_MACH_BCM2708
358
+ if (!(bs -> irq = platform_get_irq (pdev , 0 ))) {
359
+ #endif
360
+ bs -> irq = irq_of_parse_and_map (pdev -> dev .of_node , 0 );
361
+ #ifdef CONFIG_MACH_BCM2708
362
+ }
363
+ #endif
349
364
if (bs -> irq <= 0 ) {
350
365
dev_err (& pdev -> dev , "could not get IRQ: %d\n" , bs -> irq );
351
366
err = bs -> irq ? bs -> irq : - ENODEV ;
@@ -406,6 +421,15 @@ static const struct of_device_id bcm2835_spi_match[] = {
406
421
};
407
422
MODULE_DEVICE_TABLE (of , bcm2835_spi_match );
408
423
424
+ /* and "normal" aliases */
425
+ #ifdef CONFIG_MACH_BCM2708
426
+ static const struct platform_device_id bcm2835_id_table [] = {
427
+ { "bcm2835_spi" , 2835 },
428
+ { "bcm2708_spi" , 2708 },
429
+ { },
430
+ };
431
+ #endif
432
+
409
433
static struct platform_driver bcm2835_spi_driver = {
410
434
.driver = {
411
435
.name = DRV_NAME ,
@@ -414,6 +438,9 @@ static struct platform_driver bcm2835_spi_driver = {
414
438
},
415
439
.probe = bcm2835_spi_probe ,
416
440
.remove = bcm2835_spi_remove ,
441
+ #ifdef CONFIG_MACH_BCM2708
442
+ .id_table = bcm2835_id_table ,
443
+ #endif
417
444
};
418
445
module_platform_driver (bcm2835_spi_driver );
419
446
0 commit comments