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 20
20
#include <linux/spi/spi.h>
21
21
#include <linux/mutex.h>
22
22
#include <linux/of.h>
23
+ #include <linux/reset.h>
23
24
24
25
#define HSSPI_GLOBAL_CTRL_REG 0x0
25
26
#define GLOBAL_CTRL_CS_POLARITY_SHIFT 0
@@ -334,6 +335,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
334
335
struct clk * clk , * pll_clk = NULL ;
335
336
int irq , ret ;
336
337
u32 reg , rate , num_cs = HSSPI_SPI_MAX_CS ;
338
+ struct reset_control * reset ;
337
339
338
340
irq = platform_get_irq (pdev , 0 );
339
341
if (irq < 0 )
@@ -348,10 +350,20 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
348
350
if (IS_ERR (clk ))
349
351
return PTR_ERR (clk );
350
352
353
+ reset = devm_reset_control_get_optional_exclusive (dev , NULL );
354
+ if (IS_ERR (reset ))
355
+ return PTR_ERR (reset );
356
+
351
357
ret = clk_prepare_enable (clk );
352
358
if (ret )
353
359
return ret ;
354
360
361
+ ret = reset_control_reset (reset );
362
+ if (ret ) {
363
+ dev_err (dev , "unable to reset device: %d\n" , ret );
364
+ goto out_disable_clk ;
365
+ }
366
+
355
367
rate = clk_get_rate (clk );
356
368
if (!rate ) {
357
369
pll_clk = devm_clk_get (dev , "pll" );
You can’t perform that action at this time.
0 commit comments