File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 18
18
#include <linux/err.h>
19
19
#include <linux/pm_runtime.h>
20
20
#include <linux/of.h>
21
+ #include <linux/reset.h>
21
22
22
23
/* BCM 6338/6348 SPI core */
23
24
#define SPI_6348_RSET_SIZE 64
@@ -493,6 +494,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
493
494
struct bcm63xx_spi * bs ;
494
495
int ret ;
495
496
u32 num_cs = BCM63XX_SPI_MAX_CS ;
497
+ struct reset_control * reset ;
496
498
497
499
if (dev -> of_node ) {
498
500
const struct of_device_id * match ;
@@ -529,6 +531,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
529
531
return PTR_ERR (clk );
530
532
}
531
533
534
+ reset = devm_reset_control_get_optional_exclusive (dev , NULL );
535
+ if (IS_ERR (reset ))
536
+ return PTR_ERR (reset );
537
+
532
538
master = spi_alloc_master (dev , sizeof (* bs ));
533
539
if (!master ) {
534
540
dev_err (dev , "out of memory\n" );
@@ -579,6 +585,12 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
579
585
if (ret )
580
586
goto out_err ;
581
587
588
+ ret = reset_control_reset (reset );
589
+ if (ret ) {
590
+ dev_err (dev , "unable to reset device: %d\n" , ret );
591
+ goto out_clk_disable ;
592
+ }
593
+
582
594
bcm_spi_writeb (bs , SPI_INTR_CLEAR_ALL , SPI_INT_STATUS );
583
595
584
596
/* register and we are done */
You can’t perform that action at this time.
0 commit comments