Few fixes for omaps against v4.5-rc3:

- Improve omap_device error message to tell driver writers what is
   wrong after commit 5de85b9d57 ("PM / runtime: Re-init runtime PM
   states at probe error and driver unbind"). There will be also a
   handful of driver related fixes also queued separately. But adding
   this error message makes it easy to fix any omap_device using
   drivers suffering from this issue so I think it's important to
   have.
 
 - Also related to commit 5de85b9d57 discussion, let's fix a bug
   where disabling PM runtime via sysfs will also cause the hardware
   state to be different from PM runtime state.
 
 - Fix audio clocks for beagle-x15.
 
 - Use wakeup-source instead of gpio-key,wakeup for the new entries
   that sneaked in during the merge window.
 
 - Fix a legacy booting vs device tree based booting regression for
   n900 where the legacy user space expects to have the device
   revision available in /proc/atags also when booted with device
   tree.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWvmElAAoJEBvUPslcq6VzZ7sQAIdMX4Tn1z1lWA/dOvjczzSf
 5hZM9CBAn3McXAFKjKRLHbUDfkRGv/VQunbaZaQ8/nJQX3vlW9sd56oqHioQ2kAT
 DwrxdtX4aUasleGQmQh/gK0CI/eOhKpkARVrFr9XyAYS+My8xPes7sWlM5y9GCUO
 zJXsUH/FtXH/IgSO76QfkFceVUedNy0lYZqgEy5DcwJIwO5ZjuYF75Iy5xRDnX4G
 VSKKA8ap0qrTrAU2zBfb/djcLxt/7MgE0HBGMnEIXNRnQtFzw5NUzTibA0LUuj27
 YgpdcdiuBz6icCIuNJZH8GjWsx9J4BalHb2+qhDQtm0EJhV+uhpbXJ3BoPqvVw/7
 6Sv767DnbsBs2L8w1i0+DspRjJxKEfJxifISlbOz2g0O17Lbm1y+CPu767TUiuQ/
 KNHNfuI3uIxFfTZKEA6ae42wwFGP2B3SEaPOH5uINB6HjybNpRb6/xQNRe5OfY8E
 dG5Y8hsPjqsx9HiD2eqlpYlb8o7Yhf5vowXFG6EvwLM6rm1lL/9pOh3HGQXin075
 QTWHkhpwS/ihpEeRgJiG1sNTY5EjiqDvCZSDADpg1Nx4+RgdWm/WBxJEiflmaC0h
 ONdjcCsoApnrRRaWmVEUaYvZl9JmkUNH1r//PbWI9pDgvSqQUFOFEQmOoAo2W1xj
 4L6GzuxjNCERq8mc/8tC
 =1rk2
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v4.5/fixes-rc3-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Few fixes for omaps against v4.5-rc3:

- Improve omap_device error message to tell driver writers what is
  wrong after commit 5de85b9d57 ("PM / runtime: Re-init runtime PM
  states at probe error and driver unbind"). There will be also a
  handful of driver related fixes also queued separately. But adding
  this error message makes it easy to fix any omap_device using
  drivers suffering from this issue so I think it's important to
  have.

- Also related to commit 5de85b9d57 discussion, let's fix a bug
  where disabling PM runtime via sysfs will also cause the hardware
  state to be different from PM runtime state.

- Fix audio clocks for beagle-x15.

- Use wakeup-source instead of gpio-key,wakeup for the new entries
  that sneaked in during the merge window.

- Fix a legacy booting vs device tree based booting regression for
  n900 where the legacy user space expects to have the device
  revision available in /proc/atags also when booted with device
  tree.

* tag 'omap-for-v4.5/fixes-rc3-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix omap_device for module reload on PM runtime forbid
  ARM: OMAP2+: Improve omap_device error for driver writers
  ARM: DTS: am57xx-beagle-x15: Select SYS_CLK2 for audio clocks
  ARM: dts: am335x/am57xx: replace gpio-key,wakeup with wakeup-source property
  ARM: OMAP2+: Set system_rev from ATAGS for n900

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2016-02-24 00:05:11 -08:00
commit e3acd74f92
5 changed files with 41 additions and 5 deletions

View File

@ -46,7 +46,7 @@
gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_BACK>;
debounce-interval = <1000>;
gpio-key,wakeup;
wakeup-source;
};
front_button {
@ -54,7 +54,7 @@
gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_FRONT>;
debounce-interval = <1000>;
gpio-key,wakeup;
wakeup-source;
};
};

View File

@ -173,6 +173,8 @@
sound0_master: simple-audio-card,codec {
sound-dai = <&tlv320aic3104>;
assigned-clocks = <&clkoutmux2_clk_mux>;
assigned-clock-parents = <&sys_clk2_dclk_div>;
clocks = <&clkout2_clk>;
};
};
@ -796,6 +798,8 @@
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mcasp3_pins_default>;
pinctrl-1 = <&mcasp3_pins_sleep>;
assigned-clocks = <&mcasp3_ahclkx_mux>;
assigned-clock-parents = <&sys_clkin2>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */

View File

@ -545,7 +545,7 @@
ti,debounce-tol = /bits/ 16 <10>;
ti,debounce-rep = /bits/ 16 <1>;
linux,wakeup;
wakeup-source;
};
};

View File

@ -18,6 +18,7 @@
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/system_info.h>
#include "common.h"
@ -77,12 +78,31 @@ static const char *const n900_boards_compat[] __initconst = {
NULL,
};
/* Set system_rev from atags */
static void __init rx51_set_system_rev(const struct tag *tags)
{
const struct tag *tag;
if (tags->hdr.tag != ATAG_CORE)
return;
for_each_tag(tag, tags) {
if (tag->hdr.tag == ATAG_REVISION) {
system_rev = tag->u.revision.rev;
break;
}
}
}
/* Legacy userspace on Nokia N900 needs ATAGS exported in /proc/atags,
* save them while the data is still not overwritten
*/
static void __init rx51_reserve(void)
{
save_atags((const struct tag *)(PAGE_OFFSET + 0x100));
const struct tag *tags = (const struct tag *)(PAGE_OFFSET + 0x100);
save_atags(tags);
rx51_set_system_rev(tags);
omap_reserve();
}

View File

@ -191,12 +191,22 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
{
struct platform_device *pdev = to_platform_device(dev);
struct omap_device *od;
int err;
switch (event) {
case BUS_NOTIFY_DEL_DEVICE:
if (pdev->archdata.od)
omap_device_delete(pdev->archdata.od);
break;
case BUS_NOTIFY_UNBOUND_DRIVER:
od = to_omap_device(pdev);
if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED)) {
dev_info(dev, "enabled after unload, idling\n");
err = omap_device_idle(pdev);
if (err)
dev_err(dev, "failed to idle\n");
}
break;
case BUS_NOTIFY_ADD_DEVICE:
if (pdev->dev.of_node)
omap_device_build_from_dt(pdev);
@ -602,8 +612,10 @@ static int _od_runtime_resume(struct device *dev)
int ret;
ret = omap_device_enable(pdev);
if (ret)
if (ret) {
dev_err(dev, "use pm_runtime_put_sync_suspend() in driver?\n");
return ret;
}
return pm_generic_runtime_resume(dev);
}