* [PATCH v2] input/imx_keypad: add PM support
@ 2010-06-17 18:59 Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
We use keypad_data to enable wakeup from platform data
suspend/resume is tested on an i.MX27 when keypad is not
in use and when it's is in use (in which case we immediatly
get the key pressed at wakeup)
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: maramaopercheseimorto at gmail.com
Cc: linux-input at vger.kernel.org
Cc: dmitry.torokhov at gmail.com
Cc: linux-arm-kernel at lists.infradead.org
---
v2 :
- simplify suspend & resume functions
- convert to pm_ops
drivers/input/keyboard/imx_keypad.c | 40 +++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index d92c15c..9aa0005 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -364,6 +364,38 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad)
writew(0xff00, keypad->mmio_base + KPCR);
}
+#ifdef CONFIG_PM
+static int mxc_kpp_suspend(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct imx_keypad *keypad = platform_get_drvdata(pdev);
+
+ keypad->enabled = false;
+ synchronize_irq(keypad->irq);
+ disable_irq(keypad->irq);
+ clk_disable(keypad->clk);
+
+ return 0;
+}
+
+static int mxc_kpp_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct imx_keypad *keypad = platform_get_drvdata(pdev);
+
+ keypad->enabled = true;
+ clk_enable(keypad->clk);
+ enable_irq(keypad->irq);
+
+ return 0;
+}
+
+static const struct dev_pm_ops mxc_kpp_pm_ops = {
+ .suspend = mxc_kpp_suspend,
+ .resume = mxc_kpp_resume,
+};
+#endif
+
static void imx_keypad_close(struct input_dev *dev)
{
struct imx_keypad *keypad = input_get_drvdata(dev);
@@ -410,7 +442,8 @@ open_err:
static int __devinit imx_keypad_probe(struct platform_device *pdev)
{
- const struct matrix_keymap_data *keymap_data = pdev->dev.platform_data;
+ const struct matrix_keypad_platform_data *keypad_data = pdev->dev.platform_data;
+ const struct matrix_keymap_data *keymap_data = keypad_data->keymap_data;
struct imx_keypad *keypad;
struct input_dev *input_dev;
struct resource *res;
@@ -525,7 +558,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, keypad);
- device_init_wakeup(&pdev->dev, 1);
+ device_init_wakeup(&pdev->dev, keypad_data->wakeup);
return 0;
@@ -571,6 +604,9 @@ static struct platform_driver imx_keypad_driver = {
.driver = {
.name = "imx-keypad",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &mxc_kpp_pm_ops,
+#endif
},
.probe = imx_keypad_probe,
.remove = __devexit_p(imx_keypad_remove),
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] eukrea_mbimx27: update keyboard platform data
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled Eric Bénard
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
2010-06-24 16:39 ` Dmitry Torokhov
2 siblings, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
use matrix_keypad_platform_data
enable wakeup
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: s.hauer at pengutronix.de
Cc: linux-arm-kernel at lists.infradead.org
---
arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index 80f6268..e7fd65a 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -116,6 +116,11 @@ static struct matrix_keymap_data eukrea_mbimx27_keymap_data = {
.keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap),
};
+static struct matrix_keypad_platform_data eukrea_mbimx27_keypad_data = {
+ .keymap_data = &eukrea_mbimx27_keymap_data,
+ .wakeup = 1,
+};
+
static struct gpio_led gpio_leds[] = {
{
.name = "led1",
@@ -392,7 +397,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
gpio_request(GPIO_PORTA | 25, "lcd_enable");
platform_device_register(&eukrea_mbimx27_lcd_powerdev);
- mxc_register_device(&imx_kpp_device, &eukrea_mbimx27_keymap_data);
+ mxc_register_device(&imx_kpp_device, &eukrea_mbimx27_keypad_data);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
0 siblings, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
the i2c_board_info structure landed into the SPI #if/#endif
which is wrong.
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: s.hauer at pengutronix.de
Cc: linux-arm-kernel at lists.infradead.org
---
arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index e7fd65a..2e57912 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -301,11 +301,6 @@ static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = {
},
};
-static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = {
- {
- I2C_BOARD_INFO("tlv320aic23", 0x1a),
- },
-};
static int eukrea_mbimx27_spi_cs[] = {GPIO_PORTD | 28};
@@ -315,6 +310,11 @@ static struct spi_imx_master eukrea_mbimx27_spi_0_data = {
};
#endif
+static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = {
+ {
+ I2C_BOARD_INFO("tlv320aic23", 0x1a),
+ },
+};
static struct platform_device *platform_devices[] __initdata = {
&leds_gpio,
};
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
The mtd layer is responsible to call mtd->{suspend,resume}. Doing it
again in the driver is wrong and results in a warning:
nand_resume called for a chip which is not in suspended state
at resume time. Removing the calls from the resume and suspend
functions makes them empty allowing them to be deleted completely.
Signed-off-by: Eric B?nard <eric@eukrea.com>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-mtd at lists.infradead.org
---
v2:
fix commit log (writen by Uwe Kleine-K?nig)
drivers/mtd/nand/mxc_nand.c | 44 +------------------------------------------
1 files changed, 1 insertions(+), 43 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 0d76b16..ad19dc6 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -873,53 +873,11 @@ static int __devexit mxcnd_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
-{
- struct mtd_info *mtd = platform_get_drvdata(pdev);
- struct nand_chip *nand_chip = mtd->priv;
- struct mxc_nand_host *host = nand_chip->priv;
- int ret = 0;
-
- DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
-
- ret = mtd->suspend(mtd);
-
- /*
- * nand_suspend locks the device for exclusive access, so
- * the clock must already be off.
- */
- BUG_ON(!ret && host->clk_act);
-
- return ret;
-}
-
-static int mxcnd_resume(struct platform_device *pdev)
-{
- struct mtd_info *mtd = platform_get_drvdata(pdev);
- struct nand_chip *nand_chip = mtd->priv;
- struct mxc_nand_host *host = nand_chip->priv;
- int ret = 0;
-
- DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
-
- mtd->resume(mtd);
-
- return ret;
-}
-
-#else
-# define mxcnd_suspend NULL
-# define mxcnd_resume NULL
-#endif /* CONFIG_PM */
-
static struct platform_driver mxcnd_driver = {
.driver = {
.name = DRIVER_NAME,
- },
+ },
.remove = __devexit_p(mxcnd_remove),
- .suspend = mxcnd_suspend,
- .resume = mxcnd_resume,
};
static int __init mxc_nd_init(void)
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] video/imxfb: fix suspend when screen is blanked
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
2010-06-17 19:22 ` [PATCH] video/imxfb: fix suspend when screen is blanked Luotao Fu
2010-07-07 14:17 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 7:24 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2 siblings, 2 replies; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
if the screen is blanked when suspending, the clock is already disabled,
leading to the following log :
WARNING: at arch/arm/plat-mxc/clock.c:59 __clk_disable+0x68/0x74()
Modules linked in:
[<c002d200>] (unwind_backtrace+0x0/0xf8) from [<c0046008>] (warn_slowpath_common+0x48/0x78)
[<c0046008>] (warn_slowpath_common+0x48/0x78) from [<c0031e28>] (__clk_disable+0x68/0x74)
[<c0031e28>] (__clk_disable+0x68/0x74) from [<c0031ddc>] (__clk_disable+0x1c/0x74)
[<c0031ddc>] (__clk_disable+0x1c/0x74) from [<c0031e58>] (clk_disable+0x24/0x34)
[<c0031e58>] (clk_disable+0x24/0x34) from [<c019808c>] (imxfb_disable_controller+0x38/0x48)
[<c019808c>] (imxfb_disable_controller+0x38/0x48) from [<c01980b0>] (imxfb_suspend+0x14/0x1c)
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: kernel at pengutronix.de
Cc: u.kleine-koenig at pengutronix.de
Cc: linux-fbdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
---
drivers/video/imxfb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index b4b6dec..6cbfbff 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -597,8 +597,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
struct imxfb_info *fbi = info->par;
pr_debug("%s\n", __func__);
-
- imxfb_disable_controller(fbi);
+ if (readl(fbi->regs + LCDC_RMCR))
+ imxfb_disable_controller(fbi);
return 0;
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] mxcmmc: convert to pm_ops and enable/disable clock Eric Bénard
2010-06-17 19:22 ` [PATCH] video/imxfb: fix suspend when screen is blanked Luotao Fu
1 sibling, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
depends on "input/imx_keypad: add PM support"
Note : this patch is not tested
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: s.hauer at pengutronix.de
Cc: linux-arm-kernel at lists.infradead.org
Cc: maramaopercheseimorto at gmail.com
---
arch/arm/mach-mx3/mach-mx31_3ds.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 58e5729..04c8700 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -114,6 +114,11 @@ static struct matrix_keymap_data mx31_3ds_keymap_data = {
.keymap_size = ARRAY_SIZE(mx31_3ds_keymap),
};
+static struct matrix_keypad_platform_data mx31_3ds_keypad_data = {
+ .keymap_data = &mx31_3ds_keymap_data,
+ .wakeup = 1,
+};
+
/* Regulators */
static struct regulator_init_data pwgtx_init = {
.constraints = {
@@ -397,7 +402,7 @@ static void __init mxc_board_init(void)
spi_register_board_info(mx31_3ds_spi_devs,
ARRAY_SIZE(mx31_3ds_spi_devs));
- mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data);
+ mxc_register_device(&imx_kpp_device, &mx31_3ds_keypad_data);
mx31_3ds_usbotg_init();
mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] mxcmmc: convert to pm_ops and enable/disable clock
2010-06-17 18:59 ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
@ 2010-06-17 18:59 ` Eric Bénard
0 siblings, 0 replies; 19+ messages in thread
From: Eric Bénard @ 2010-06-17 18:59 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: s.hauer at pengutronix.de
Cc: linux-mmc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
---
drivers/mmc/host/mxcmmc.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index fdf33e8..350f78e 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -936,43 +936,47 @@ static int mxcmci_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int mxcmci_suspend(struct platform_device *dev, pm_message_t state)
+static int mxcmci_suspend(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
if (mmc)
ret = mmc_suspend_host(mmc);
+ clk_disable(host->clk);
return ret;
}
-static int mxcmci_resume(struct platform_device *dev)
+static int mxcmci_resume(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
- struct mxcmci_host *host;
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
- if (mmc) {
- host = mmc_priv(mmc);
+ clk_enable(host->clk);
+ if (mmc)
ret = mmc_resume_host(mmc);
- }
return ret;
}
-#else
-#define mxcmci_suspend NULL
-#define mxcmci_resume NULL
-#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops mxcmci_pm_ops = {
+ .suspend = mxcmci_suspend,
+ .resume = mxcmci_resume,
+};
+#endif
static struct platform_driver mxcmci_driver = {
.probe = mxcmci_probe,
.remove = mxcmci_remove,
- .suspend = mxcmci_suspend,
- .resume = mxcmci_resume,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &mxcmci_pm_ops,
+#endif
}
};
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH] video/imxfb: fix suspend when screen is blanked
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
2010-06-17 18:59 ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
@ 2010-06-17 19:22 ` Luotao Fu
2010-06-18 6:30 ` Eric Bénard
1 sibling, 1 reply; 19+ messages in thread
From: Luotao Fu @ 2010-06-17 19:22 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Thu, Jun 17, 2010 at 08:59:05PM +0200, Eric B?nard wrote:
> if the screen is blanked when suspending, the clock is already disabled,
> leading to the following log :
> WARNING: at arch/arm/plat-mxc/clock.c:59 __clk_disable+0x68/0x74()
> Modules linked in:
> [<c002d200>] (unwind_backtrace+0x0/0xf8) from [<c0046008>] (warn_slowpath_common+0x48/0x78)
> [<c0046008>] (warn_slowpath_common+0x48/0x78) from [<c0031e28>] (__clk_disable+0x68/0x74)
> [<c0031e28>] (__clk_disable+0x68/0x74) from [<c0031ddc>] (__clk_disable+0x1c/0x74)
> [<c0031ddc>] (__clk_disable+0x1c/0x74) from [<c0031e58>] (clk_disable+0x24/0x34)
> [<c0031e58>] (clk_disable+0x24/0x34) from [<c019808c>] (imxfb_disable_controller+0x38/0x48)
> [<c019808c>] (imxfb_disable_controller+0x38/0x48) from [<c01980b0>] (imxfb_suspend+0x14/0x1c)
>
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> Cc: kernel at pengutronix.de
> Cc: u.kleine-koenig at pengutronix.de
> Cc: linux-fbdev at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> ---
> drivers/video/imxfb.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index b4b6dec..6cbfbff 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -597,8 +597,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
> struct imxfb_info *fbi = info->par;
>
> pr_debug("%s\n", __func__);
> -
> - imxfb_disable_controller(fbi);
> + if (readl(fbi->regs + LCDC_RMCR))
> + imxfb_disable_controller(fbi);
> return 0;
> }
I've already submitted a patch to fix this issue:
http://lkml.org/lkml/2010/6/3/187
cheers
Luotao Fu
--
Pengutronix e.K. | Dipl.-Ing. Luotao Fu |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100617/0d8a4f3e/attachment.sig>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
@ 2010-07-07 14:17 ` Artem Bityutskiy
2010-07-17 7:24 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2 siblings, 0 replies; 19+ messages in thread
From: Artem Bityutskiy @ 2010-07-07 14:17 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2010-06-17 at 20:59 +0200, Eric B?nard wrote:
> The mtd layer is responsible to call mtd->{suspend,resume}. Doing it
> again in the driver is wrong and results in a warning:
>
> nand_resume called for a chip which is not in suspended state
>
> at resume time. Removing the calls from the resume and suspend
> functions makes them empty allowing them to be deleted completely.
>
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Pushed to l2-mtd-2.6.git / dunno
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
2010-07-07 14:17 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
@ 2010-07-17 7:24 ` Eric Bénard
2010-07-17 7:33 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2 siblings, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-07-17 7:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi Artem,
can you also pick this patch for mxc_nand ?
Thanks
Eric
Le 17/06/2010 20:59, Eric B?nard a ?crit :
> The mtd layer is responsible to call mtd->{suspend,resume}. Doing it
> again in the driver is wrong and results in a warning:
>
> nand_resume called for a chip which is not in suspended state
>
> at resume time. Removing the calls from the resume and suspend
> functions makes them empty allowing them to be deleted completely.
>
> Signed-off-by: Eric B?nard<eric@eukrea.com>
> Acked-by: Uwe Kleine-K?nig<u.kleine-koenig@pengutronix.de>
> Cc: Sascha Hauer<s.hauer@pengutronix.de>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-mtd at lists.infradead.org
> ---
> v2:
> fix commit log (writen by Uwe Kleine-K?nig)
>
> drivers/mtd/nand/mxc_nand.c | 44 +------------------------------------------
> 1 files changed, 1 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index 0d76b16..ad19dc6 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -873,53 +873,11 @@ static int __devexit mxcnd_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
> -{
> - struct mtd_info *mtd = platform_get_drvdata(pdev);
> - struct nand_chip *nand_chip = mtd->priv;
> - struct mxc_nand_host *host = nand_chip->priv;
> - int ret = 0;
> -
> - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
> -
> - ret = mtd->suspend(mtd);
> -
> - /*
> - * nand_suspend locks the device for exclusive access, so
> - * the clock must already be off.
> - */
> - BUG_ON(!ret&& host->clk_act);
> -
> - return ret;
> -}
> -
> -static int mxcnd_resume(struct platform_device *pdev)
> -{
> - struct mtd_info *mtd = platform_get_drvdata(pdev);
> - struct nand_chip *nand_chip = mtd->priv;
> - struct mxc_nand_host *host = nand_chip->priv;
> - int ret = 0;
> -
> - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
> -
> - mtd->resume(mtd);
> -
> - return ret;
> -}
> -
> -#else
> -# define mxcnd_suspend NULL
> -# define mxcnd_resume NULL
> -#endif /* CONFIG_PM */
> -
> static struct platform_driver mxcnd_driver = {
> .driver = {
> .name = DRIVER_NAME,
> - },
> + },
> .remove = __devexit_p(mxcnd_remove),
> - .suspend = mxcnd_suspend,
> - .resume = mxcnd_resume,
> };
>
> static int __init mxc_nd_init(void)
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly
2010-07-17 7:24 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
@ 2010-07-17 7:33 ` Artem Bityutskiy
2010-07-17 12:49 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
0 siblings, 1 reply; 19+ messages in thread
From: Artem Bityutskiy @ 2010-07-17 7:33 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 2010-07-17 at 09:24 +0200, Eric B?nard wrote:
> Hi Artem,
>
> can you also pick this patch for mxc_nand ?
It is in my tree already, and I sent a notification as well :-)
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly
2010-07-17 7:33 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
@ 2010-07-17 12:49 ` Eric Bénard
2010-07-17 15:13 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
0 siblings, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-07-17 12:49 UTC (permalink / raw)
To: linux-arm-kernel
Hi Artem,
Le 17/07/2010 09:33, Artem Bityutskiy a ?crit :
> On Sat, 2010-07-17 at 09:24 +0200, Eric B?nard wrote:
>> can you also pick this patch for mxc_nand ?
>
> It is in my tree already, and I sent a notification as well :-)
>
OK, sorry, I didn't see the notification mail and only checked your
master branch, not the dunno branch where you applied this patch !
Thanks,
Eric
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly
2010-07-17 12:49 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
@ 2010-07-17 15:13 ` Artem Bityutskiy
0 siblings, 0 replies; 19+ messages in thread
From: Artem Bityutskiy @ 2010-07-17 15:13 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 2010-07-17 at 14:49 +0200, Eric B?nard wrote:
> Hi Artem,
>
> Le 17/07/2010 09:33, Artem Bityutskiy a ?crit :
> > On Sat, 2010-07-17 at 09:24 +0200, Eric B?nard wrote:
> >> can you also pick this patch for mxc_nand ?
> >
> > It is in my tree already, and I sent a notification as well :-)
> >
>
> OK, sorry, I didn't see the notification mail and only checked your
> master branch, not the dunno branch where you applied this patch !
Yeah, I put to master only the stuff I understand and hence, can
sight-off. The rest goes to dunno - David then processes it.
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] input/imx_keypad: add PM support
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
@ 2010-06-18 10:16 ` Alberto Panizzo
2010-06-18 14:37 ` Eric Bénard
2010-06-24 16:39 ` Dmitry Torokhov
2 siblings, 1 reply; 19+ messages in thread
From: Alberto Panizzo @ 2010-06-18 10:16 UTC (permalink / raw)
To: linux-arm-kernel
Hi Eric,
On gio, 2010-06-17 at 20:59 +0200, Eric B?nard wrote:
> We use keypad_data to enable wakeup from platform data
>
> suspend/resume is tested on an i.MX27 when keypad is not
> in use and when it's is in use (in which case we immediatly
> get the key pressed at wakeup)
>
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> Cc: maramaopercheseimorto at gmail.com
> Cc: linux-input at vger.kernel.org
> Cc: dmitry.torokhov at gmail.com
> Cc: linux-arm-kernel at lists.infradead.org
> ---
> v2 :
> - simplify suspend & resume functions
> - convert to pm_ops
>
> drivers/input/keyboard/imx_keypad.c | 40 +++++++++++++++++++++++++++++++++-
> 1 files changed, 38 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index d92c15c..9aa0005 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -364,6 +364,38 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad)
> writew(0xff00, keypad->mmio_base + KPCR);
> }
>
> +#ifdef CONFIG_PM
> +static int mxc_kpp_suspend(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct imx_keypad *keypad = platform_get_drvdata(pdev);
> +
> + keypad->enabled = false;
> + synchronize_irq(keypad->irq);
> + disable_irq(keypad->irq);
> + clk_disable(keypad->clk);
> +
> + return 0;
> +}
> +
> +static int mxc_kpp_resume(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct imx_keypad *keypad = platform_get_drvdata(pdev);
> +
> + keypad->enabled = true;
> + clk_enable(keypad->clk);
> + enable_irq(keypad->irq);
> +
> + return 0;
> +}
Ok, so with this patch the keypad cannot wake the system?
It is scheduled another patch?
--
Alberto!
Be Persistent!
- Greg Kroah-Hartman (FOSDEM 2010)
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v2] input/imx_keypad: add PM support
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
@ 2010-06-18 14:37 ` Eric Bénard
2010-06-18 17:40 ` Alberto Panizzo
0 siblings, 1 reply; 19+ messages in thread
From: Eric Bénard @ 2010-06-18 14:37 UTC (permalink / raw)
To: linux-arm-kernel
Hi Alberto,
Le 18/06/2010 12:16, Alberto Panizzo a ?crit :
> Ok, so with this patch the keypad cannot wake the system?
> It is scheduled another patch?
>
well, actually, the keypad wakes the system, at least on my board here.
I was quite surprised to get this working this way as I would have
expected disable_irq + clk_disable would prevent the keypad from being a
wake source.
Can you try on your board as this cleanup may be wrong on i.MX3 ?
Thanks,
Eric
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] input/imx_keypad: add PM support
2010-06-18 14:37 ` Eric Bénard
@ 2010-06-18 17:40 ` Alberto Panizzo
2010-06-18 17:50 ` Eric Bénard
0 siblings, 1 reply; 19+ messages in thread
From: Alberto Panizzo @ 2010-06-18 17:40 UTC (permalink / raw)
To: linux-arm-kernel
On ven, 2010-06-18 at 16:37 +0200, Eric B?nard wrote:
> Hi Alberto,
>
> Le 18/06/2010 12:16, Alberto Panizzo a ?crit :
> > Ok, so with this patch the keypad cannot wake the system?
> > It is scheduled another patch?
> >
> well, actually, the keypad wakes the system, at least on my board here.
>
> I was quite surprised to get this working this way as I would have
> expected disable_irq + clk_disable would prevent the keypad from being a
> wake source.
> Can you try on your board as this cleanup may be wrong on i.MX3 ?
>
> Thanks,
> Eric
Well.. it is a surprise to me too. I have to look down the documentation
ad soon I will try on the mx31pdk.
I don't wont to tell you wrong things.
--
Alberto!
Be Persistent!
- Greg Kroah-Hartman (FOSDEM 2010)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] input/imx_keypad: add PM support
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
@ 2010-06-24 16:39 ` Dmitry Torokhov
2 siblings, 0 replies; 19+ messages in thread
From: Dmitry Torokhov @ 2010-06-24 16:39 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jun 17, 2010 at 08:59:01PM +0200, Eric B?nard wrote:
> We use keypad_data to enable wakeup from platform data
>
> suspend/resume is tested on an i.MX27 when keypad is not
> in use and when it's is in use (in which case we immediatly
> get the key pressed at wakeup)
>
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> Cc: maramaopercheseimorto at gmail.com
> Cc: linux-input at vger.kernel.org
> Cc: dmitry.torokhov at gmail.com
> Cc: linux-arm-kernel at lists.infradead.org
> ---
> v2 :
> - simplify suspend & resume functions
> - convert to pm_ops
>
> drivers/input/keyboard/imx_keypad.c | 40 +++++++++++++++++++++++++++++++++-
> 1 files changed, 38 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index d92c15c..9aa0005 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -364,6 +364,38 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad)
> writew(0xff00, keypad->mmio_base + KPCR);
> }
>
> +#ifdef CONFIG_PM
> +static int mxc_kpp_suspend(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct imx_keypad *keypad = platform_get_drvdata(pdev);
> +
> + keypad->enabled = false;
> + synchronize_irq(keypad->irq);
> + disable_irq(keypad->irq);
> + clk_disable(keypad->clk);
> +
This is not correct. imx_keypad_probe() keypad->enabled = false, waiting for
imx_keypad_open() to be called. However if nobody opens the device and
you go through suspend/resume cycle you'll leave keypad->enabled = true.
BTW, why do you call new functions mxc_kpp_XXX while the rest of the
driver uses imx_keypad_XXX naming?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2010-07-17 15:13 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled Eric Bénard
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
2010-06-17 18:59 ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
2010-06-17 18:59 ` [PATCH] mxcmmc: convert to pm_ops and enable/disable clock Eric Bénard
2010-06-17 19:22 ` [PATCH] video/imxfb: fix suspend when screen is blanked Luotao Fu
2010-06-18 6:30 ` Eric Bénard
2010-07-07 14:17 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 7:24 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17 7:33 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 12:49 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17 15:13 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
2010-06-18 14:37 ` Eric Bénard
2010-06-18 17:40 ` Alberto Panizzo
2010-06-18 17:50 ` Eric Bénard
2010-06-24 16:39 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).