File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -214,17 +214,27 @@ static const struct acpi_device_id bcm2835aux_serial_acpi_match[] = {
214
214
};
215
215
MODULE_DEVICE_TABLE (acpi , bcm2835aux_serial_acpi_match );
216
216
217
- static int bcm2835aux_suspend (struct device * dev )
217
+ static bool bcm2835aux_can_disable_clock (struct device * dev )
218
218
{
219
219
struct bcm2835aux_data * data = dev_get_drvdata (dev );
220
220
struct uart_8250_port * up = serial8250_get_port (data -> line );
221
221
222
- serial8250_suspend_port (data -> line );
223
-
224
222
if (device_may_wakeup (dev ))
225
- return 0 ;
223
+ return false ;
226
224
227
225
if (uart_console (& up -> port ) && !console_suspend_enabled )
226
+ return false;
227
+
228
+ return true;
229
+ }
230
+
231
+ static int bcm2835aux_suspend (struct device * dev )
232
+ {
233
+ struct bcm2835aux_data * data = dev_get_drvdata (dev );
234
+
235
+ serial8250_suspend_port (data -> line );
236
+
237
+ if (!bcm2835aux_can_disable_clock (dev ))
228
238
return 0 ;
229
239
230
240
clk_disable_unprepare (data -> clk );
@@ -236,9 +246,11 @@ static int bcm2835aux_resume(struct device *dev)
236
246
struct bcm2835aux_data * data = dev_get_drvdata (dev );
237
247
int ret ;
238
248
239
- ret = clk_prepare_enable (data -> clk );
240
- if (ret )
241
- return ret ;
249
+ if (bcm2835aux_can_disable_clock (dev )) {
250
+ ret = clk_prepare_enable (data -> clk );
251
+ if (ret )
252
+ return ret ;
253
+ }
242
254
243
255
serial8250_resume_port (data -> line );
244
256
You can’t perform that action at this time.
0 commit comments