Skip to content

Commit 2f3e4eb

Browse files
committed
Merge tag 'omap-for-v5.13/fixes-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes
PM and build warning fixes for omaps While chasing system suspend related regressions, I noticed few other issues related to PM would be good to have fixed: - UART idling does not always work for hardware autoidle features - am335x resume works only the first time unless musb module is loaded Then there are three patches for omap1 related warnings caused by the gpio changes, and one build warning fix for legacy mmc platform code when mmc is built as a loadable module. These can all be merged whenever suitable naturally. I've sent the more urgent SATA regression fix separately although it appears in this pull request too because of the branches merged. * tag 'omap-for-v5.13/fixes-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: ams-delta: remove unused function ams_delta_camera_power bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act bus: ti-sysc: Fix am335x resume hang for usb otg module ARM: OMAP2+: Fix build warning when mmc_omap is not built ARM: OMAP1: isp1301-omap: Add missing gpiod_add_lookup_table function ARM: OMAP1: Fix use of possibly uninitialized irq variable Link: https://lore.kernel.org/r/pull-1622614772-543196@atomide.com Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 94277cb + bae989c commit 2f3e4eb

File tree

6 files changed

+64
-24
lines changed

6 files changed

+64
-24
lines changed

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -458,20 +458,6 @@ static struct gpiod_lookup_table leds_gpio_table = {
458458

459459
#ifdef CONFIG_LEDS_TRIGGERS
460460
DEFINE_LED_TRIGGER(ams_delta_camera_led_trigger);
461-
462-
static int ams_delta_camera_power(struct device *dev, int power)
463-
{
464-
/*
465-
* turn on camera LED
466-
*/
467-
if (power)
468-
led_trigger_event(ams_delta_camera_led_trigger, LED_FULL);
469-
else
470-
led_trigger_event(ams_delta_camera_led_trigger, LED_OFF);
471-
return 0;
472-
}
473-
#else
474-
#define ams_delta_camera_power NULL
475461
#endif
476462

477463
static struct platform_device ams_delta_audio_device = {

arch/arm/mach-omap1/board-h2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static int tps_setup(struct i2c_client *client, void *context)
320320
{
321321
if (!IS_BUILTIN(CONFIG_TPS65010))
322322
return -ENOSYS;
323-
323+
324324
tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V |
325325
TPS_LDO1_ENABLE | TPS_VLDO1_3_0V);
326326

@@ -394,6 +394,8 @@ static void __init h2_init(void)
394394
BUG_ON(gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0);
395395
gpio_direction_input(H2_NAND_RB_GPIO_PIN);
396396

397+
gpiod_add_lookup_table(&isp1301_gpiod_table);
398+
397399
omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
398400
omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
399401

arch/arm/mach-omap1/pm.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,13 @@ static int __init omap_pm_init(void)
655655
irq = INT_7XX_WAKE_UP_REQ;
656656
else if (cpu_is_omap16xx())
657657
irq = INT_1610_WAKE_UP_REQ;
658-
if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup",
659-
NULL))
660-
pr_err("Failed to request irq %d (peripheral wakeup)\n", irq);
658+
else
659+
irq = -1;
660+
661+
if (irq >= 0) {
662+
if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup", NULL))
663+
pr_err("Failed to request irq %d (peripheral wakeup)\n", irq);
664+
}
661665

662666
/* Program new power ramp-up time
663667
* (0 for most boards since we don't lower voltage when in deep sleep)

arch/arm/mach-omap2/board-n8x0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
322322

323323
static void n8x0_mmc_callback(void *data, u8 card_mask)
324324
{
325+
#ifdef CONFIG_MMC_OMAP
325326
int bit, *openp, index;
326327

327328
if (board_is_n800()) {
@@ -339,7 +340,6 @@ static void n8x0_mmc_callback(void *data, u8 card_mask)
339340
else
340341
*openp = 0;
341342

342-
#ifdef CONFIG_MMC_OMAP
343343
omap_mmc_notify_cover_event(mmc_device, index, *openp);
344344
#else
345345
pr_warn("MMC: notify cover event not available\n");

drivers/bus/ti-sysc.c

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,34 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev)
13341334
return error;
13351335
}
13361336

1337+
static int sysc_reinit_module(struct sysc *ddata, bool leave_enabled)
1338+
{
1339+
struct device *dev = ddata->dev;
1340+
int error;
1341+
1342+
/* Disable target module if it is enabled */
1343+
if (ddata->enabled) {
1344+
error = sysc_runtime_suspend(dev);
1345+
if (error)
1346+
dev_warn(dev, "reinit suspend failed: %i\n", error);
1347+
}
1348+
1349+
/* Enable target module */
1350+
error = sysc_runtime_resume(dev);
1351+
if (error)
1352+
dev_warn(dev, "reinit resume failed: %i\n", error);
1353+
1354+
if (leave_enabled)
1355+
return error;
1356+
1357+
/* Disable target module if no leave_enabled was set */
1358+
error = sysc_runtime_suspend(dev);
1359+
if (error)
1360+
dev_warn(dev, "reinit suspend failed: %i\n", error);
1361+
1362+
return error;
1363+
}
1364+
13371365
static int __maybe_unused sysc_noirq_suspend(struct device *dev)
13381366
{
13391367
struct sysc *ddata;
@@ -1344,20 +1372,38 @@ static int __maybe_unused sysc_noirq_suspend(struct device *dev)
13441372
(SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
13451373
return 0;
13461374

1347-
return pm_runtime_force_suspend(dev);
1375+
if (!ddata->enabled)
1376+
return 0;
1377+
1378+
ddata->needs_resume = 1;
1379+
1380+
return sysc_runtime_suspend(dev);
13481381
}
13491382

13501383
static int __maybe_unused sysc_noirq_resume(struct device *dev)
13511384
{
13521385
struct sysc *ddata;
1386+
int error = 0;
13531387

13541388
ddata = dev_get_drvdata(dev);
13551389

13561390
if (ddata->cfg.quirks &
13571391
(SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
13581392
return 0;
13591393

1360-
return pm_runtime_force_resume(dev);
1394+
if (ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME) {
1395+
error = sysc_reinit_module(ddata, ddata->needs_resume);
1396+
if (error)
1397+
dev_warn(dev, "noirq_resume failed: %i\n", error);
1398+
} else if (ddata->needs_resume) {
1399+
error = sysc_runtime_resume(dev);
1400+
if (error)
1401+
dev_warn(dev, "noirq_resume failed: %i\n", error);
1402+
}
1403+
1404+
ddata->needs_resume = 0;
1405+
1406+
return error;
13611407
}
13621408

13631409
static const struct dev_pm_ops sysc_pm_ops = {
@@ -1408,9 +1454,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14081454
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
14091455
/* Uarts on omap4 and later */
14101456
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff,
1411-
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
1457+
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
14121458
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff,
1413-
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
1459+
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
14141460

14151461
/* Quirks that need to be set based on the module address */
14161462
SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff,
@@ -1468,7 +1514,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14681514
SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,
14691515
0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
14701516
SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -ENODEV, 0x4ea2080d, 0xffffffff,
1471-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
1517+
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY |
1518+
SYSC_QUIRK_REINIT_ON_RESUME),
14721519
SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
14731520
SYSC_MODULE_QUIRK_WDT),
14741521
/* PRUSS on am3, am4 and am5 */

include/linux/platform_data/ti-sysc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct sysc_regbits {
5050
s8 emufree_shift;
5151
};
5252

53+
#define SYSC_QUIRK_REINIT_ON_RESUME BIT(27)
5354
#define SYSC_QUIRK_GPMC_DEBUG BIT(26)
5455
#define SYSC_MODULE_QUIRK_ENA_RESETDONE BIT(25)
5556
#define SYSC_MODULE_QUIRK_PRUSS BIT(24)

0 commit comments

Comments
 (0)