aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-19 15:10:41 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-19 15:10:41 +0100
commitfbda9468360f184fe2161a3170968b936f29de1c (patch)
treeb92b8c03f65141181f44dfe41405728d3d81278e
parentd85a58e257069605a024d497d9a518d069b026c8 (diff)
downloadltsi-kernel-fbda9468360f184fe2161a3170968b936f29de1c.tar.gz
open up the 3.4 LTSI branch.
Only thing left from 3.0 is pramfs and lttng. I have no idea if they really work (or build) at this time. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--KERNEL_VERSION2
-rw-r--r--patches.android/android-0001-Revert-Staging-android-delete-android-drivers.patch5904
-rw-r--r--patches.android/android-0002-staging-android-fix-build-issues.patch46
-rw-r--r--patches.android/android-0003-android-common-include-linux-slab.h.patch21
-rw-r--r--patches.android/android-0004-android-common-Fix-slab.h-includes-for-2.6.34-rc4.patch33
-rw-r--r--patches.android/android-0005-Revert-Staging-android-mark-subsystem-as-broken.patch30
-rw-r--r--patches.android/android-0006-staging-android-ramconsole-Ensure-ramconsole-does-not-get-cl.patch35
-rw-r--r--patches.android/android-0007-Staging-android-ram_console-Start-ram-console-earlier.patch26
-rw-r--r--patches.android/android-0008-Staging-android-timed_gpio-Request-gpios.patch49
-rw-r--r--patches.android/android-0009-android-logger-Add-new-system-log-for-framework-system-log-m.patch55
-rw-r--r--patches.android/android-0010-binder-Use-seq_file-for-debug-interface.patch835
-rw-r--r--patches.android/android-0011-staging-android-binder-Move-debugging-information-from-procf.patch151
-rw-r--r--patches.android/android-0012-Staging-android-timed_gpio-Properly-discard-invalid-timeout-.patch30
-rw-r--r--patches.android/android-0013-Staging-android-binder-Create-dedicated-workqueue-for-binder.patch49
-rw-r--r--patches.android/android-0014-staging-android-lowmemorykiller-Don-t-try-to-kill-the-same-p.patch42
-rw-r--r--patches.android/android-0015-staging-android-lowmemkiller-Substantially-reduce-overhead-d.patch99
-rw-r--r--patches.android/android-0016-staging-binder-Fix-memory-corruption-via-page-aliasing.patch48
-rw-r--r--patches.android/android-0017-staging-android-lowmemorykiller-Remove-bitrotted-codepath.patch32
-rw-r--r--patches.android/android-0018-staging-android-lowmemorykiller-Update-arguments-of-shrinker.patch24
-rw-r--r--patches.android/android-0019-staging-android-lowmemorykiller-Ignore-shmem-pages-in-page-c.patch28
-rw-r--r--patches.android/android-0020-android-lowmemorykiller-Fix-arguments-to-lowmem_shrink.patch61
-rw-r--r--patches.android/android-0021-android-logger-bump-up-the-logger-buffer-sizes.patch36
-rw-r--r--patches.android/android-0022-staging-android-ram_console-pass-in-a-boot-info-string.patch166
-rw-r--r--patches.android/android-0023-Staging-android-fixed-white-spaces-coding-style-issue-in-log.patch52
-rw-r--r--patches.android/android-0024-staging-android-switch-switch-class-and-GPIO-drivers.patch499
-rw-r--r--patches.android/android-0025-staging-android-switch-minor-code-formatting-cleanups.patch55
-rw-r--r--patches.android/android-0026-staging-android-add-pmem-driver.patch1499
-rw-r--r--patches.android/android-0027-ashmem-Anonymous-shared-memory-subsystem.patch829
-rw-r--r--patches.android/android-0028-ashmem-Implement-read-2-in-ashmem-driver.patch65
-rw-r--r--patches.android/android-0029-ashmem-Fix-ASHMEM_SET_PROT_MASK.patch51
-rw-r--r--patches.android/android-0030-ashmem-Update-arguments-of-shrinker-for-2.6.35.patch43
-rw-r--r--patches.android/android-0031-ashmem-Support-lseek-2-in-ashmem-driver.patch84
-rw-r--r--patches.android/android-0032-ashmem-Fix-arguments-to-ashmem_shrink.patch72
-rw-r--r--patches.android/android-0033-ashmem-Whitespace-cleanups.patch142
-rw-r--r--patches.android/android-0034-Staging-android-fixed-a-space-warning-in-binder.h.patch25
-rw-r--r--patches.android/android-0035-Staging-android-fixed-80-characters-warnings-in-lowmemorykil.patch43
-rw-r--r--patches.android/android-0036-Staging-android-binder-Don-t-call-dump_stack-in-binder_vma_o.patch32
-rw-r--r--patches.android/android-0037-Staging-android-Remove-pmem-driver.patch1490
-rw-r--r--patches.android/android-0038-Staging-android-binder-Fix-crashes-when-sharing-a-binder-fil.patch87
-rw-r--r--patches.android/android-0039-staging-android-lowmemorykiller-Don-t-wait-more-than-one-sec.patch49
-rw-r--r--patches.android/android-0040-staging-android-ram_console-Don-t-build-on-arches-w-o-iorema.patch33
-rw-r--r--patches.android/staging-android-add-the-code-back-to-the-build.patch36
-rw-r--r--patches.armadillo800eva/0001-module.h-split-out-the-EXPORT_SYMBOL-into-export.h.patch247
-rw-r--r--patches.armadillo800eva/0002-arm-Add-export.h-to-ARM-specific-files-as-required.patch460
-rw-r--r--patches.armadillo800eva/0003-ARM-mach-shmobile-cpuidle-single-global-and-last_sta.patch177
-rw-r--r--patches.armadillo800eva/0004-ARM-entry-re-allocate-registers-in-irq-entry-assembl.patch92
-rw-r--r--patches.armadillo800eva/0005-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch108
-rw-r--r--patches.armadillo800eva/0006-ARM-mach-shmobile-add-shmobile_earlytimer_init.patch55
-rw-r--r--patches.armadillo800eva/0007-ARM-mach-shmobile-default-to-no-earlytimer.patch34
-rw-r--r--patches.armadillo800eva/0008-ARM-shmobile-Consolidate-time-keeping-and-irq-enable.patch79
-rw-r--r--patches.armadillo800eva/0009-sh-pfc-get_config_reg-shift-clean-up.patch33
-rw-r--r--patches.armadillo800eva/0010-sh-pfc-Remove-unused-gpio_in_use-member.patch31
-rw-r--r--patches.armadillo800eva/0011-sh-pfc-Add-GPIO-IRQ-support.patch101
-rw-r--r--patches.armadillo800eva/0012-ARM-mach-shmobile-move-helper-macro-PORT_DATA_xx-to-.patch443
-rw-r--r--patches.armadillo800eva/0013-ARM-mach-shmobile-move-helper-macro-PORT_xx-to-sh_pf.patch509
-rw-r--r--patches.armadillo800eva/0014-ARM-mach-shmobile-move-helper-macro-PORTCR-to-sh_pfc.patch153
-rw-r--r--patches.armadillo800eva/0015-sh-pfc-ioremap-support.patch350
-rw-r--r--patches.armadillo800eva/0016-sh-pfc-Add-gpio_read_bit-for-data-register-access.patch56
-rw-r--r--patches.armadillo800eva/0017-sh-pfc-Convert-index-to-field-and-value-pair.patch133
-rw-r--r--patches.armadillo800eva/0018-sh-pfc-Add-config_reg_helper-function.patch140
-rw-r--r--patches.armadillo800eva/0019-sh-pfc-Variable-bitfield-width-config-register-suppo.patch121
-rw-r--r--patches.armadillo800eva/0020-sh-pfc-Unlock-register-support.patch74
-rw-r--r--patches.armadillo800eva/0021-ARM-mach-shmobile-Break-out-INTC-IRQ-code.patch223
-rw-r--r--patches.armadillo800eva/0022-sh-intc-enable-both-edges-GPIO-interrupts-on-sh7372.patch35
-rw-r--r--patches.armadillo800eva/0023-sh-intc-Add-IRQ-trigger-bit-field-check.patch45
-rw-r--r--patches.armadillo800eva/0024-sh-userimask.c-needs-linux-stat.h.patch41
-rw-r--r--patches.armadillo800eva/0025-sh-fix-implicit-use-of-stat.h-in-arch-sh-specific-fi.patch41
-rw-r--r--patches.armadillo800eva/0026-sh-Add-module.h-to-arch-sh-specific-files-as-require.patch32
-rw-r--r--patches.armadillo800eva/0027-sh-Add-export.h-to-arch-sh-specific-files-as-require.patch36
-rw-r--r--patches.armadillo800eva/0028-drivers-sh-Add-export.h-for-EXPORT_SYMBOL-to-intc-vi.patch31
-rw-r--r--patches.armadillo800eva/0029-driver-core-implement-sysdev-functionality-for-regul.patch892
-rw-r--r--patches.armadillo800eva/0030-sh-intc-Allow-triggering-on-both-edges-for-ARM-SoCs.patch34
-rw-r--r--patches.armadillo800eva/0031-sh-intc-convert-sysdev_class-to-a-regular-subsystem.patch183
-rw-r--r--patches.armadillo800eva/0032-PM-shmobile-Don-t-include-SH7372-s-INTCS-in-syscore-.patch103
-rw-r--r--patches.armadillo800eva/0033-sh-intc-unify-evt2irq-irq2evt-macros-for-sh-and-arm.patch103
-rw-r--r--patches.armadillo800eva/0034-sh-intc-Make-global-intc-controller-counter-static.patch44
-rw-r--r--patches.armadillo800eva/0035-genirq-Add-IRQCHIP_SKIP_SET_WAKE-flag.patch56
-rw-r--r--patches.armadillo800eva/0036-sh-intc-Prefer-IRQCHIP_SKIP_SET_WAKE-over-a-dummy-se.patch47
-rw-r--r--patches.armadillo800eva/0037-sh-intc-Kill-off-superfluous-irq_shutdown-hooking.patch30
-rw-r--r--patches.armadillo800eva/0038-sh-intc-Use-IRQ_SET_MASK_OK_NOCOPY-for-intc_set_affi.patch32
-rw-r--r--patches.armadillo800eva/0039-sh-intc-optimize-intc-IRQ-lookup.patch135
-rw-r--r--patches.armadillo800eva/0040-sh-intc-remove-dependency-on-NR_IRQS.patch93
-rw-r--r--patches.armadillo800eva/0041-sh-intc-Fix-up-section-mismatch-for-intc_ack_data.patch44
-rw-r--r--patches.armadillo800eva/0042-drivers-sh-late-disabling-of-clocks-V2.patch80
-rw-r--r--patches.armadillo800eva/0043-sh-clkfwk-Convert-to-IS_ERR_OR_NULL.patch31
-rw-r--r--patches.armadillo800eva/0044-sh-move-CLKDEV_xxx_ID-macro-to-sh_clk.h.patch174
-rw-r--r--patches.armadillo800eva/0045-switch-assorted-clock-drivers-to-debugfs_remove_recu.patch193
-rw-r--r--patches.armadillo800eva/0046-sh-clkfwk-add-clk_rate_mult_range_round.patch67
-rw-r--r--patches.armadillo800eva/0047-sh-clkfwk-Kill-off-remaining-debugfs-cruft.patch146
-rw-r--r--patches.armadillo800eva/0048-sh-clkfwk-setup-clock-parent-from-current-register-v.patch143
-rw-r--r--patches.armadillo800eva/0049-sh-extend-clock-struct-with-mapped_reg-member.patch70
-rw-r--r--patches.armadillo800eva/0050-sh-use-ioread32-iowrite32-and-mapped_reg-for-mstp32.patch44
-rw-r--r--patches.armadillo800eva/0051-sh-use-ioread32-iowrite32-and-mapped_reg-for-div4.patch81
-rw-r--r--patches.armadillo800eva/0052-sh-use-ioread32-iowrite32-and-mapped_reg-for-div6.patch93
-rw-r--r--patches.armadillo800eva/0053-sh-clkfwk-sh_clk_init_parent-should-be-called-after-.patch39
-rw-r--r--patches.armadillo800eva/0054-sh-clkfwk-bugfix-use-clk_reparent-for-div6-clocks.patch33
-rw-r--r--patches.armadillo800eva/0055-sh-introduce-sh_clk_ops-in-parallel-with-clk_ops.patch32
-rw-r--r--patches.armadillo800eva/0056-sh-convert-cpg-code-to-sh_clk_ops.patch93
-rw-r--r--patches.armadillo800eva/0057-ARM-mach-shmobile-R-Mobile-A1-support.patch1378
-rw-r--r--patches.armadillo800eva/0058-ARM-mach-shmobile-r8a7740-add-PFC-support.patch2602
-rw-r--r--patches.armadillo800eva/0059-ARM-mach-shmobile-r8a7740-add-i2c-support.patch151
-rw-r--r--patches.armadillo800eva/0060-ARM-mach-shmobile-r8a7740-add-INTC-support.patch804
-rw-r--r--patches.armadillo800eva/0061-ARM-mach-shmobile-bonito-Add-LCDC0-support.patch56
-rw-r--r--patches.armadillo800eva/0062-ARM-mach-shmobile-r8a7740-sh_clk_ops-rename.patch50
-rw-r--r--patches.armadillo800eva/0063-ARM-mach-shmobile-r8a7740-map_io-and-init_early-upda.patch91
-rw-r--r--patches.armadillo800eva/0064-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch37
-rw-r--r--patches.armadillo800eva/0065-ARM-mach-shmobile-r8a7740-and-Bonito-timer-rework.patch59
-rw-r--r--patches.armadillo800eva/0066-ARM-mach-shmobile-pfc-r8a7740-add-gpio_irq-support.patch82
-rw-r--r--patches.armadillo800eva/0067-net-sh_eth-tidyup-compile-warning.patch45
-rw-r--r--patches.armadillo800eva/0068-net-sh_eth-remove-__flush_purge_region.patch58
-rw-r--r--patches.armadillo800eva/0069-sh_eth-Move-the-Renesas-SuperH-driver.patch290
-rw-r--r--patches.armadillo800eva/0070-net-sh_eth-Fix-build-by-forgot-including-linux-inter.patch43
-rw-r--r--patches.armadillo800eva/0071-net-remove-use-of-ndo_set_multicast_list-in-drivers.patch283
-rw-r--r--patches.armadillo800eva/0072-net-sh_eth-fix-the-compile-error.patch45
-rw-r--r--patches.armadillo800eva/0073-net-sh_eth-use-ioremap.patch172
-rw-r--r--patches.armadillo800eva/0074-sh-modify-prototype-in-sh_eth.h.patch30
-rw-r--r--patches.armadillo800eva/0075-net-sh_eth-move-the-asm-sh_eth.h-to-include-linux.patch55
-rw-r--r--patches.armadillo800eva/0076-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-some.patch86
-rw-r--r--patches.armadillo800eva/0077-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh77.patch31
-rw-r--r--patches.armadillo800eva/0078-net-sh_eth-fix-build-failure.patch55
-rw-r--r--patches.armadillo800eva/0079-net-ethernet-convert-drivers-net-ethernet-to-use-mod.patch101
-rw-r--r--patches.armadillo800eva/0080-net-make-ethtool_ops-const.patch49
-rw-r--r--patches.armadillo800eva/0081-sh-eth-use-an-unique-MDIO-bus-name.patch31
-rw-r--r--patches.armadillo800eva/0082-net-sh-eth-Fix-build-error-by-the-value-which-is-not.patch38
-rw-r--r--patches.armadillo800eva/0083-drivers-net-Remove-alloc_etherdev-error-messages.patch120
-rw-r--r--patches.armadillo800eva/0084-net-sh_eth-fix-skb_over_panic-happen.patch64
-rw-r--r--patches.armadillo800eva/0085-sh-eth-use-netdev-stats-structure-and-fix-dma_map_si.patch229
-rw-r--r--patches.armadillo800eva/0086-netdev-ethernet-dev_alloc_skb-to-netdev_alloc_skb.patch89
-rw-r--r--patches.armadillo800eva/0087-renesas-sh_eth.c-fix-linux-interrupt.h-included-twic.patch31
-rw-r--r--patches.armadillo800eva/0088-net-sh_eth-add-the-value-of-tsu-to-the-SH7757-s-GETH.patch32
-rw-r--r--patches.armadillo800eva/0089-net-sh_eth-change-the-condition-of-initialization.patch50
-rw-r--r--patches.armadillo800eva/0090-net-sh_eth-modify-a-condition-of-ioremap-for-TSU.patch65
-rw-r--r--patches.armadillo800eva/0091-net-sh_eth-add-support-for-multicast-filtering.patch362
-rw-r--r--patches.armadillo800eva/0092-net-sh_eth-add-support-for-VLAN-tag-filtering.patch130
-rw-r--r--patches.armadillo800eva/0093-net-sh_eth-Add-support-SH7734.patch163
-rw-r--r--patches.armadillo800eva/0094-net-sh_eth-fix-endian-check-for-architecture-indepen.patch56
-rw-r--r--patches.armadillo800eva/0095-net-sh_eth-add-support-R8A7740.patch211
-rw-r--r--patches.armadillo800eva/0096-atomic-use-linux-atomic.h.patch480
-rw-r--r--patches.armadillo800eva/0097-fbdev-sh_mobile_meram-Enable-runtime-PM.patch46
-rw-r--r--patches.armadillo800eva/0098-fbdev-sh_mobile_meram-Enable-disable-MERAM-along-wit.patch41
-rw-r--r--patches.armadillo800eva/0099-fbdev-sh_mobile_meram-Move-private-data-from-.h-to-..patch58
-rw-r--r--patches.armadillo800eva/0100-fbdev-sh_mobile_meram-Backup-restore-device-register.patch122
-rw-r--r--patches.armadillo800eva/0101-drivercore-Add-helper-macro-for-platform_driver-boil.patch83
-rw-r--r--patches.armadillo800eva/0102-drivercore-Generalize-module_platform_driver.patch85
-rw-r--r--patches.armadillo800eva/0103-fbdev-sh_mobile_lcdc-Turn-dot-clock-on-before-resumi.patch53
-rw-r--r--patches.armadillo800eva/0104-fbdev-sh_mobile_lcdc-Replace-hardcoded-register-valu.patch573
-rw-r--r--patches.armadillo800eva/0105-fbdev-sh_mobile_lcdc-Don-t-acknowlege-interrupts-uni.patch73
-rw-r--r--patches.armadillo800eva/0106-fbdev-sh_mobile_lcdc-Compute-clock-pattern-using-div.patch50
-rw-r--r--patches.armadillo800eva/0107-fbdev-sh_mobile_lcdc-Split-LCDC-start-code-from-sh_m.patch443
-rw-r--r--patches.armadillo800eva/0108-fbdev-sh_mobile_lcdc-Store-the-frame-buffer-base-add.patch67
-rw-r--r--patches.armadillo800eva/0109-fbdev-sh_mobile_lcdc-Restart-LCDC-in-runtime-PM-resu.patch120
-rw-r--r--patches.armadillo800eva/0110-fbdev-sh_mobile_meram-Replace-hardcoded-register-val.patch162
-rw-r--r--patches.armadillo800eva/0111-fbdev-sh_mobile_meram-Validate-ICB-configuration-out.patch56
-rw-r--r--patches.armadillo800eva/0112-fbdev-sh_mobile_meram-Fix-MExxCTL-register-save-on-r.patch36
-rw-r--r--patches.armadillo800eva/0113-fbdev-sh_mobile_meram-Remove-unneeded-sh_mobile_mera.patch101
-rw-r--r--patches.armadillo800eva/0114-sh_mobile_meram-Reset-ICBs-at-unregistration-time.patch38
-rw-r--r--patches.armadillo800eva/0115-fbdev-sh_mobile_lcdc-Adjust-requested-parameters-in-.patch142
-rw-r--r--patches.armadillo800eva/0116-fbdev-sh_mobile_lcdc-Add-support-for-format-changes-.patch51
-rw-r--r--patches.armadillo800eva/0117-fbdev-sh_mobile_lcdc-use-display-information-in-info.patch71
-rw-r--r--patches.armadillo800eva/0118-fbdev-sh_mobile_lcdc-Update-fix.line_length-in-.fb_s.patch61
-rw-r--r--patches.armadillo800eva/0119-fbdev-sh_mobile_lcdc-Avoid-forward-declarations.patch139
-rw-r--r--patches.armadillo800eva/0120-fbdev-sh_mobile_lcdc-Split-channel-initialization-fr.patch332
-rw-r--r--patches.armadillo800eva/0121-fbdev-sh_mobile_lcdc-Remove-sh_mobile_lcdc_set_bpp.patch169
-rw-r--r--patches.armadillo800eva/0122-video-irq-Remove-IRQF_DISABLED.patch59
-rw-r--r--patches.armadillo800eva/0123-video-Add-module.h-to-drivers-video-files-who-really.patch72
-rw-r--r--patches.armadillo800eva/0124-fbdev-sh_mobile_lcdcfb-fixup-LDHAJR-HSYNPAJ-needs-ma.patch33
-rw-r--r--patches.armadillo800eva/0125-fbdev-sh_mipi_dsi-tidyup-dsip_clk.patch75
-rw-r--r--patches.armadillo800eva/0126-fbdev-sh_mipi_dsi-typo-fix-of-SH_MIPI_DSI_HBPBM.patch45
-rw-r--r--patches.armadillo800eva/0127-fbdev-sh_mipi_dsi-tidyup-VMCTR2-parameter-expression.patch37
-rw-r--r--patches.armadillo800eva/0128-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_HFPBM-flag.patch44
-rw-r--r--patches.armadillo800eva/0129-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_BL2E-flag.patch44
-rw-r--r--patches.armadillo800eva/0130-fbdev-sh_mipi_dsi-add-lane-control-support.patch101
-rw-r--r--patches.armadillo800eva/0131-fbdev-sh_mipi_dsi-add-sync_pulses-sync_events-burst-.patch94
-rw-r--r--patches.armadillo800eva/0132-fbdev-sh_mipi_dsi-add-VMLEN1-VMLEN2-calculation.patch106
-rw-r--r--patches.armadillo800eva/0133-fbdev-sh_mipi_dsi-add-set_dot_clock-for-each-platfor.patch147
-rw-r--r--patches.armadillo800eva/0134-fbdev-sh_mipi_dsi-add-HSxxCLK-support.patch84
-rw-r--r--patches.armadillo800eva/0135-fbdev-sh_mipi_dsi-sh_mipi-has-pdata-instead-of-dev.patch58
-rw-r--r--patches.armadillo800eva/0136-fbdev-sh_mipi_dsi-fixup-setup-timing-of-sh_mipi_setu.patch138
-rw-r--r--patches.armadillo800eva/0137-fbdev-sh_mipi_dsi-fixup-setup-timing-of-SYSCONF.patch61
-rw-r--r--patches.armadillo800eva/0138-fbdev-sh_mipi_dsi-fixup-setup-timing-DSICTRL.patch43
-rw-r--r--patches.armadillo800eva/0139-video-convert-drivers-video-to-use-module_platform_d.patch386
-rw-r--r--patches.armadillo800eva/0140-fbdev-Add-FOURCC-based-format-configuration-API.patch423
-rw-r--r--patches.armadillo800eva/0141-v4l-Add-V4L2_PIX_FMT_NV24-and-V4L2_PIX_FMT_NV42-form.patch35
-rw-r--r--patches.armadillo800eva/0142-arm-fix-compile-failure-in-mach-shmobile-board-ag5ev.patch33
-rw-r--r--patches.armadillo800eva/0143-sh-se7724-fix-compile-breakage.patch99
-rw-r--r--patches.armadillo800eva/0144-fbdev-sh_mobile_lcdc-Support-FOURCC-based-format-API.patch731
-rw-r--r--patches.armadillo800eva/0145-fbdev-sh_mobile_lcdc-Reorder-code-into-sections.patch547
-rw-r--r--patches.armadillo800eva/0146-fbdev-sh_mobile_lcdc-Mark-init-only-symbols-with-__d.patch42
-rw-r--r--patches.armadillo800eva/0147-fbdev-sh_mobile_lcdc-Move-pm-runtime-enable-to-probe.patch96
-rw-r--r--patches.armadillo800eva/0148-fbdev-sh_mobile_lcdc-Don-t-pass-struct-device-around.patch149
-rw-r--r--patches.armadillo800eva/0149-fbdev-sh_mobile_lcdc-Create-functions-to-turn-the-di.patch144
-rw-r--r--patches.armadillo800eva/0150-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-channel-in-no.patch47
-rw-r--r--patches.armadillo800eva/0151-sh_mobile_hdmi-Remove-platform-data-lcd_dev-field.patch112
-rw-r--r--patches.armadillo800eva/0152-fbdev-sh_mobile_lcdc-Add-sh_mobile_lcdc_entity-defin.patch49
-rw-r--r--patches.armadillo800eva/0153-fbdev-sh_mobile_hdmi-Implement-sh_mobile_lcdc_entity.patch134
-rw-r--r--patches.armadillo800eva/0154-fbdev-sh_mipi_dsi-Implement-sh_mobile_lcdc_entity-in.patch173
-rw-r--r--patches.armadillo800eva/0155-fbdev-sh_mobile_lcdc-Handle-HDMI-MIPI-transmitter-de.patch118
-rw-r--r--patches.armadillo800eva/0156-fbdev-sh_mipi_dsi-Don-t-hook-up-into-board_cfg-displ.patch129
-rw-r--r--patches.armadillo800eva/0157-fbdev-sh_mobile_hdmi-Don-t-hook-up-into-board_cfg-di.patch120
-rw-r--r--patches.armadillo800eva/0158-arm-mach-shmobile-Don-t-initialize-the-hdmi_info-lcd.patch47
-rw-r--r--patches.armadillo800eva/0159-fbdev-sh_mobile_hdmi-Remove-sh_mobile_hdmi_info-lcd_.patch30
-rw-r--r--patches.armadillo800eva/0160-fbdev-sh_mobile_lcdc-Remove-board-configuration-owne.patch60
-rw-r--r--patches.armadillo800eva/0161-fbdev-sh_mobile_lcdc-Remove-board-configuration-boar.patch344
-rw-r--r--patches.armadillo800eva/0162-fbdev-sh_mobile_lcdc-Move-brightness-ops-to-sh_mobil.patch132
-rw-r--r--patches.armadillo800eva/0163-fbdev-sh_mobile_lcdc-Merge-board_cfg-and-lcd_size_cf.patch314
-rw-r--r--patches.armadillo800eva/0164-sh_mobile_lcdc-Add-an-lcdc-channel-pointer-to-sh_mob.patch64
-rw-r--r--patches.armadillo800eva/0165-sh_mobile_hdmi-Use-sh_mobile_lcdc_entity-channel-to-.patch240
-rw-r--r--patches.armadillo800eva/0166-fbdev-sh_mobile_lcdc-Remove-fb_info-parameter-to-dis.patch95
-rw-r--r--patches.armadillo800eva/0167-fbdev-sh_mobile_lcdc-Return-display-connection-state.patch102
-rw-r--r--patches.armadillo800eva/0168-sh_mobile_lcdc-Add-display-notify-callback-to-sh_mob.patch156
-rw-r--r--patches.armadillo800eva/0169-sh_mobile_hdmi-Use-LCDC-notification-callback.patch158
-rw-r--r--patches.armadillo800eva/0170-fbdev-sh_mobile_lcdc-Pass-a-video-mode-to-the-notify.patch296
-rw-r--r--patches.armadillo800eva/0171-fbdev-sh_mobile_hdmi-Don-t-set-sh_hdmi-mode-in-the-d.patch50
-rw-r--r--patches.armadillo800eva/0172-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-fb_info.patch145
-rw-r--r--patches.armadillo800eva/0173-fbdev-sh_mobile_lcdc-Store-display-mode-in-a-struct-.patch193
-rw-r--r--patches.armadillo800eva/0174-fbdev-sh_mobile_lcdc-Rename-lcd-num-_cfg-lcd-num-_mo.patch405
-rw-r--r--patches.armadillo800eva/0175-fbdev-sh_mobile_lcdc-Reorganize-the-sh_mobile_lcdc_c.patch84
-rw-r--r--patches.armadillo800eva/0176-fbdev-sh_mobile_lcdc-Add-sh_mobile_format_info-funct.patch277
-rw-r--r--patches.armadillo800eva/0177-fbdev-sh_mobile_lcdc-Store-the-format-in-struct-sh_m.patch126
-rw-r--r--patches.armadillo800eva/0178-fbdev-sh_mobile_lcdc-Split-fb-init-cleanup-from-chan.patch396
-rw-r--r--patches.armadillo800eva/0179-fbdev-sh_mobile_lcdc-Pass-physical-device-pointer-to.patch38
-rw-r--r--patches.armadillo800eva/0180-fbdev-sh_mobile_lcdc-Store-configuration-in-channel-.patch278
-rw-r--r--patches.armadillo800eva/0181-fbdev-sh_mobile_lcdc-Pass-channel-pointer-to-sh_mobi.patch100
-rw-r--r--patches.armadillo800eva/0182-fbdev-sh_mobile_meram-Request-memory-regions-for-mem.patch127
-rw-r--r--patches.armadillo800eva/0183-fbdev-sh_mobile_meram-Add-_cfg-suffix-to-struct-sh_m.patch102
-rw-r--r--patches.armadillo800eva/0184-fbdev-sh_mobile_meram-Make-variables-unsigned-where-.patch219
-rw-r--r--patches.armadillo800eva/0185-fbdev-sh_mobile_meram-Make-current_reg-field-store-t.patch34
-rw-r--r--patches.armadillo800eva/0186-fbdev-sh_mobile_meram-Add-struct-sh_mobile_meram_icb.patch444
-rw-r--r--patches.armadillo800eva/0187-fbdev-sh_mobile_meram-Don-t-inline-everything.patch108
-rw-r--r--patches.armadillo800eva/0188-fbdev-sh_mobile_meram-Divide-the-code-into-sections.patch263
-rw-r--r--patches.armadillo800eva/0189-fbdev-sh_mobile_meram-Use-genalloc-to-manage-MERAM-a.patch366
-rw-r--r--patches.armadillo800eva/0190-fbdev-sh_mobile_meram-Allocate-ICBs-automatically.patch740
-rw-r--r--patches.armadillo800eva/0191-arm-mach-shmobile-Don-t-set-MERAM-ICB-numbers-in-pla.patch88
-rw-r--r--patches.armadillo800eva/0192-fbdev-sh_mobile_meram-Remove-unused-sh_mobile_meram_.patch31
-rw-r--r--patches.armadillo800eva/0193-fbdev-sh_mobile_lcdc-Don-t-store-copy-of-platform-da.patch315
-rw-r--r--patches.armadillo800eva/0194-fbdev-sh_mobile_meram-Don-t-perform-update-in-regist.patch97
-rw-r--r--patches.armadillo800eva/0195-fbdev-sh_mobile_meram-Remove-unneeded-sanity-checks.patch155
-rw-r--r--patches.armadillo800eva/0196-fbdev-sh_mobile_meram-Implement-system-suspend-resum.patch56
-rw-r--r--patches.armadillo800eva/0197-fbdev-sh_mipi_dsi-add-extra-phyctrl-for-sh_mipi_dsi_.patch64
-rw-r--r--patches.armadillo800eva/0198-serial-sh-sci-Kill-off-bitrotted-H8-300-support.patch263
-rw-r--r--patches.armadillo800eva/0199-serial-sh-sci-Tidy-up-ioread-write-wrappers-kill-off.patch87
-rw-r--r--patches.armadillo800eva/0200-serial-sh-sci-Kill-off-some-more-unused-definitions.patch38
-rw-r--r--patches.armadillo800eva/0201-serial-sh-sci-Generalize-overrun-handling.patch304
-rw-r--r--patches.armadillo800eva/0202-serial-sh-sci-Consolidate-RXD-pin-handling.patch108
-rw-r--r--patches.armadillo800eva/0203-serial-sh-sci-More-unused-define-purging.patch80
-rw-r--r--patches.armadillo800eva/0204-serial-sh-sci-Abstract-register-maps.patch766
-rw-r--r--patches.armadillo800eva/0205-serial-sh-sci-FIFO-sizing-helper-consolidation.patch255
-rw-r--r--patches.armadillo800eva/0206-serial-sh-sci-Support-generic-SCLSR-overrun-detectio.patch44
-rw-r--r--patches.armadillo800eva/0207-serial-sh-sci-Regtype-probing-doesn-t-need-to-be-fat.patch45
-rw-r--r--patches.armadillo800eva/0208-serial-sh-sci-Add-missing-module-description-author-.patch26
-rw-r--r--patches.armadillo800eva/0209-serial-sh-sci-Kill-off-per-port-enable-disable-callb.patch194
-rw-r--r--patches.armadillo800eva/0210-serial-sh-sci-Fix-up-pretty-name-printing-for-port-I.patch203
-rw-r--r--patches.armadillo800eva/0211-serial-sh-sci-Fix-up-default-regtype-probing.patch34
-rw-r--r--patches.armadillo800eva/0212-serial-sh-sci-fix-DMA-build-by-including-dma-mapping.patch46
-rw-r--r--patches.armadillo800eva/0213-serial-sh-sci-console-Runtime-PM-support.patch145
-rw-r--r--patches.armadillo800eva/0214-sh-sci-PM-Use-power.irq_safe.patch35
-rw-r--r--patches.armadillo800eva/0215-serial-sh-sci-report-CTS-as-active-for-get_mctrl.patch43
-rw-r--r--patches.armadillo800eva/0216-serial-sh-sci-don-t-filter-on-DMA-device-use-only-ch.patch108
-rw-r--r--patches.armadillo800eva/0217-TTY-irq-Remove-IRQF_DISABLED.patch60
-rw-r--r--patches.armadillo800eva/0218-serial-sh-sci-Fix-up-SH-2A-SCIF-support.patch71
-rw-r--r--patches.armadillo800eva/0219-serial-sh-sci-Fix-up-SCFCR-handling.patch111
-rw-r--r--patches.armadillo800eva/0220-serial-sh-sci-Support-icount-statistics-for-error-ca.patch99
-rw-r--r--patches.armadillo800eva/0221-serial-sh-sci-Clarify-enable_ms-break_ctl-comments.patch44
-rw-r--r--patches.armadillo800eva/0222-serial-sh-sci-Fix-up-modem-control-handling.patch60
-rw-r--r--patches.armadillo800eva/0223-serial-sh-sci-Add-support-for-loopback-mode.patch48
-rw-r--r--patches.armadillo800eva/0224-serial-sh-sci-per-port-modem-control.patch110
-rw-r--r--patches.armadillo800eva/0225-serial-sh-sci-Avoid-FIFO-clear-for-MCE-toggle.patch56
-rw-r--r--patches.armadillo800eva/0226-serial-sh-sci-Handle-GPIO-function-requests.patch177
-rw-r--r--patches.armadillo800eva/0227-Input-gpio_keys-switch-to-using-threaded-IRQs.patch42
-rw-r--r--patches.armadillo800eva/0228-Input-gpio_keys-move-to-late_initcall.patch38
-rw-r--r--patches.armadillo800eva/0229-Input-gpio_keys-fix-a-memory-leak.patch29
-rw-r--r--patches.armadillo800eva/0230-Input-gpio_keys-add-support-for-device-tree-platform.patch305
-rw-r--r--patches.armadillo800eva/0231-Input-gpio_keys-switch-to-using-SIMPLE_DEV_PM_OPS.patch56
-rw-r--r--patches.armadillo800eva/0232-Input-gpio_keys-return-proper-error-code-if-memory-a.patch33
-rw-r--r--patches.armadillo800eva/0233-Input-gpio_keys-fix-two-typos-in-devicetree-document.patch30
-rw-r--r--patches.armadillo800eva/0234-Input-gpio_keys-use-of_property_read_u32.patch78
-rw-r--r--patches.armadillo800eva/0235-Input-gpio_keys-fix-struct-device-declared-inside-pa.patch36
-rw-r--r--patches.armadillo800eva/0236-Input-gpio_keys-constify-platform-data.patch139
-rw-r--r--patches.armadillo800eva/0237-Input-revert-gpio_keys-switch-to-using-threaded-IRQs.patch33
-rw-r--r--patches.armadillo800eva/0238-Input-gpio_keys-consolidate-key-destructor-code.patch78
-rw-r--r--patches.armadillo800eva/0239-Input-gpio_keys-add-support-for-interrupt-only-keys.patch395
-rw-r--r--patches.armadillo800eva/0240-Input-sh_keysc-fix-compile-warning.patch36
-rw-r--r--patches.armadillo800eva/0241-Input-keyboard-use-macro-module_platform_driver.patch73
-rw-r--r--patches.armadillo800eva/0242-Update-Nook-Color-machine-3284-to-common-Encore-name.patch34
-rw-r--r--patches.armadillo800eva/0243-ARM-7051-1-cpuimx-boards-fix-mach-types-errors.patch90
-rw-r--r--patches.armadillo800eva/0244-ARM-Add-a-few-machine-types-to-mach-types.patch122
-rw-r--r--patches.armadillo800eva/0245-ARM-Update-mach-types-to-fix-mxs-build-breakage.patch41
-rw-r--r--patches.armadillo800eva/0246-ARM-7193-1-Fix-machine_is_xxx-naming-for-eSata-Sheev.patch90
-rw-r--r--patches.armadillo800eva/0247-ARM-Update-mach-types.patch828
-rw-r--r--patches.armadillo800eva/0248-ARM-mach-shmobile-add-armadillo800eva-board-support.patch235
-rw-r--r--patches.armadillo800eva/0249-ARM-mach-shmobile-armadillo800eva-add-defconfig.patch168
-rw-r--r--patches.armadillo800eva/0250-ARM-mach-shmobile-armadillo800eva-add-support-LCDC0.patch159
-rw-r--r--patches.armadillo800eva/0251-ARM-mach-shmobile-armadillo800eva-add-support-ST1232.patch58
-rw-r--r--patches.armadillo800eva/0252-ARM-mach-shmobile-armadillo800eva-add-support-gpio_k.patch69
-rw-r--r--patches.armadillo800eva/0253-ARM-mach-shmobile-armadillo800eva-add-support-sh_eth.patch108
-rw-r--r--patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-allow-use-of-armhf-userspace.patch45
-rw-r--r--patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-disable-config_sysfs_deprecated.patch38
-rw-r--r--patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-update.patch95
-rw-r--r--patches.armadillo800eva/arm-mach-shmobile-sh7372-ap4evb-and-mackerel-timer-rework.patch67
-rw-r--r--patches.armadillo800eva/ltsi-bugfix-armadillo800eva-sh_eth-needs-net_ethernet-on-defconfig.patch36
-rw-r--r--patches.kzm9g/0001-net-remove-mm.h-inclusion-from-netdevice.h.patch167
-rw-r--r--patches.kzm9g/0001-tty-serial-allow-ports-to-override-the-irq-handler.patch36
-rw-r--r--patches.kzm9g/0002-Include-linux-dma-mapping.h-in-linux-dmaengine.h.patch35
-rw-r--r--patches.kzm9g/0002-serial-introduce-generic-port-in-out-helpers.patch53
-rw-r--r--patches.kzm9g/0003-dmaengine-failure-to-get-a-specific-DMA-channel-is-n.patch53
-rw-r--r--patches.kzm9g/0003-serial-8250-increase-PASS_LIMIT.patch39
-rw-r--r--patches.kzm9g/0004-Improve-slave-cyclic-DMA-engine-documentation.patch279
-rw-r--r--patches.kzm9g/0004-serial-Fix-wakeup-init-logic-to-speed-up-startup.patch60
-rw-r--r--patches.kzm9g/0005-dmaengine-use-DEFINE_IDR-for-static-initialization.patch47
-rw-r--r--patches.kzm9g/0005-tty-serial8250-allow-platforms-to-override-irq-handl.patch140
-rw-r--r--patches.kzm9g/0006-dmaengine-add-helper-function-for-slave_single.patch51
-rw-r--r--patches.kzm9g/0006-tty-serial8250-remove-UPIO_DWAPB-32.patch167
-rw-r--r--patches.kzm9g/0007-dmaengine-remove-struct-scatterlist-for-header.patch37
-rw-r--r--patches.kzm9g/0007-tty-8250-export-serial8250_handle_irq.patch32
-rw-r--r--patches.kzm9g/0008-dmaengine-add-new-enum-dma_transfer_direction.patch83
-rw-r--r--patches.kzm9g/0008-serial-8250-Move-UPIO_TSI-to-powerpc.patch129
-rw-r--r--patches.kzm9g/0009-linux-dmaengine.h-fix-implicit-use-of-bitmap.h-and-a.patch45
-rw-r--r--patches.kzm9g/0009-serial-Support-the-EFR-register-of-XR1715x-uarts.patch159
-rw-r--r--patches.kzm9g/001-ltsi-backport-arm-mach-shmobile-kzm9g-add-smsc-9221-support.patch96
-rw-r--r--patches.kzm9g/0010-8250-ratelimit-LSR-safety-check-engaged-warning.patch44
-rw-r--r--patches.kzm9g/0010-DMAEngine-Define-interleaved-transfer-request-api.patch192
-rw-r--r--patches.kzm9g/0011-dmaengine-add-DMA_TRANS_NONE-to-dma_transfer_directi.patch60
-rw-r--r--patches.kzm9g/0011-serial-8250-replace-hardcoded-0xbf-with-define.patch33
-rw-r--r--patches.kzm9g/0012-dmaengine-Add-flow-controller-information-to-dma_sla.patch59
-rw-r--r--patches.kzm9g/0012-serial-move-struct-uart_8250_port-from-8250.c-to-825.patch98
-rw-r--r--patches.kzm9g/0013-dma-dmaengine-Distinguish-between-dmaengine-failed-t.patch49
-rw-r--r--patches.kzm9g/0013-serial-clean-up-parameter-passing-for-8250-Rx-IRQ-ha.patch79
-rw-r--r--patches.kzm9g/0014-dmaengine-add-private-header-file.patch87
-rw-r--r--patches.kzm9g/0014-serial-export-the-key-functions-for-an-8250-IRQ-hand.patch161
-rw-r--r--patches.kzm9g/0015-dmaengine-dma_slave-introduce-inline-wrappers.patch79
-rw-r--r--patches.kzm9g/0015-serial-make-8250-timeout-use-the-specified-IRQ-handl.patch51
-rw-r--r--patches.kzm9g/0016-ARM-Add-init_consistent_dma_size.patch195
-rw-r--r--patches.kzm9g/0016-serial-manually-inline-serial8250_handle_port.patch77
-rw-r--r--patches.kzm9g/0017-mmc-add-a-card-hotplug-handler-context.patch55
-rw-r--r--patches.kzm9g/0017-serial-group-all-the-8250-related-code-together.patch746
-rw-r--r--patches.kzm9g/0018-mmc-add-a-generic-GPIO-card-detect-helper.patch144
-rw-r--r--patches.kzm9g/0018-serial-Kill-off-NO_IRQ.patch361
-rw-r--r--patches.kzm9g/0019-mmc-simplify-mmc_cd_gpio_request-by-removing-two-par.patch71
-rw-r--r--patches.kzm9g/0019-tty-fix-a-build-failure-on-sparc.patch42
-rw-r--r--patches.kzm9g/002-lsti-backport-arm-mach-shmobile-kzm9g-add-external-usb-host-support.patch82
-rw-r--r--patches.kzm9g/0020-mmc-Standardize-header-file-inclusion-checks.patch65
-rw-r--r--patches.kzm9g/0020-tty-sparc-rename-drivers-tty-serial-suncore.h-includ.patch199
-rw-r--r--patches.kzm9g/0021-mmc-tmio-name-0xd8-as-CTL_DMA_ENABLE.patch48
-rw-r--r--patches.kzm9g/0021-serial-delete-last-unused-traces-of-pausing-I-O-in-8.patch732
-rw-r--r--patches.kzm9g/0022-mmc-tmio-Share-register-access-functions.patch130
-rw-r--r--patches.kzm9g/0022-serial-make-8250-s-serial_in-shareable-to-other-driv.patch73
-rw-r--r--patches.kzm9g/0023-mmc-sdhi-Add-write16_hook.patch149
-rw-r--r--patches.kzm9g/0023-serial-delete-useless-void-casts-in-8250.c.patch84
-rw-r--r--patches.kzm9g/0024-mmc-tmio-Fix-race-condition-resulting-in-spurious-in.patch132
-rw-r--r--patches.kzm9g/0024-serial-reduce-number-of-indirections-in-8250-code.patch958
-rw-r--r--patches.kzm9g/0025-mmc-tmio-fix-recursive-spinlock-don-t-schedule-with-.patch167
-rw-r--r--patches.kzm9g/0025-serial-use-serial_port_in-out-vs-serial_in-out-in-82.patch455
-rw-r--r--patches.kzm9g/0026-mmc-tmio-maximize-power-saving.patch172
-rw-r--r--patches.kzm9g/0026-serial-remove-back-and-forth-conversions-in-serial_o.patch56
-rw-r--r--patches.kzm9g/0027-mmc-tmio-fix-a-recently-introduced-bug-in-DMA-code.patch34
-rw-r--r--patches.kzm9g/0027-serial-8250_pci-add-a-force-background-timer-flag-an.patch118
-rw-r--r--patches.kzm9g/0028-8250.c-less-than-2400-baud-fix.patch51
-rw-r--r--patches.kzm9g/0028-mmc-tmio-fix-a-deadlock.patch85
-rw-r--r--patches.kzm9g/0029-net-remove-mm.h-inclusion-from-netdevice.h.patch109
-rw-r--r--patches.kzm9g/0029-serial8250-Add-dl_read-dl_write-callbacks.patch203
-rw-r--r--patches.kzm9g/003-ltsi-bugfix-sh73a0-add-lost-clk_enable_on_init-for-div6_zb1.patch52
-rw-r--r--patches.kzm9g/0030-MMC-TMIO-Fix-build-issue-related-to-struct-scatterli.patch32
-rw-r--r--patches.kzm9g/0030-serial8250-Use-dl_read-dl_write-on-Alchemy.patch138
-rw-r--r--patches.kzm9g/0031-mmc-tmio-eliminate-unused-variable-mmc-warning.patch45
-rw-r--r--patches.kzm9g/0031-serial8250-Use-dl_read-dl_write-on-RM9K.patch139
-rw-r--r--patches.kzm9g/0032-mmc-sdhi-initialise-mmc_data-flags-before-use.patch39
-rw-r--r--patches.kzm9g/0032-serial8250-Clean-up-default-map-and-dl-code.patch134
-rw-r--r--patches.kzm9g/0033-mmc-tmio-Cache-interrupt-masks.patch131
-rw-r--r--patches.kzm9g/0033-serial8250-Introduce-serial8250_register_8250_port.patch169
-rw-r--r--patches.kzm9g/0034-mmc-tmio-Provide-separate-interrupt-handlers.patch215
-rw-r--r--patches.kzm9g/0034-serial8250-em-Emma-Mobile-UART-driver-V2.patch254
-rw-r--r--patches.kzm9g/0035-mmc-sdhi-Allow-named-IRQs-to-use-specific-handlers.patch180
-rw-r--r--patches.kzm9g/0035-serial8250-em-clk_get-IS_ERR-error-handling-fix.patch38
-rw-r--r--patches.kzm9g/0036-cpuidle-create-bootparam-cpuidle.off-1.patch116
-rw-r--r--patches.kzm9g/0036-mmc-irq-Remove-IRQF_DISABLED.patch46
-rw-r--r--patches.kzm9g/0037-cpuidle-replace-xen-access-to-x86-pm_idle-and-defaul.patch85
-rw-r--r--patches.kzm9g/0037-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch36
-rw-r--r--patches.kzm9g/0038-cpuidle-stop-depending-on-pm_idle.patch254
-rw-r--r--patches.kzm9g/0038-mmc-replace-printk-with-appropriate-display-macro.patch36
-rw-r--r--patches.kzm9g/0039-cpuidle-Consistent-spelling-of-cpuidle_idle_call.patch53
-rw-r--r--patches.kzm9g/0039-mmc-tmio-fix-clock-gating-on-platforms-with-a-.set_p.patch33
-rw-r--r--patches.kzm9g/004-ltsi-arm-mach_shmobile-kzm9g-update-defconfig.patch48
-rw-r--r--patches.kzm9g/0040-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch103
-rw-r--r--patches.kzm9g/0040-sh-Fix-up-fallout-from-cpuidle-changes.patch32
-rw-r--r--patches.kzm9g/0041-cpuidle-Add-module.h-to-drivers-cpuidle-files-as-req.patch41
-rw-r--r--patches.kzm9g/0041-mmc-remove-the-second-argument-of-k-un-map_atomic.patch46
-rw-r--r--patches.kzm9g/0042-cpuidle-Move-dev-last_residency-update-to-driver-ent.patch868
-rw-r--r--patches.kzm9g/0042-mmc-tmio_mmc-Hotplug-code-regrouping.patch84
-rw-r--r--patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch89
-rw-r--r--patches.kzm9g/0043-mmc-host-move-to-dma_transfer_direction.patch54
-rw-r--r--patches.kzm9g/0044-cpuidle-Split-cpuidle_state-structure-and-move-per-c.patch531
-rw-r--r--patches.kzm9g/0044-mmc-tmio_mmc-fix-card-eject-during-IO-with-DMA.patch111
-rw-r--r--patches.kzm9g/0045-cpuidle-Single-Global-registration-of-idle-states.patch1520
-rw-r--r--patches.kzm9g/0045-mmc-tmio_mmc-do-not-enable-card-hotplug-interrupts-i.patch53
-rw-r--r--patches.kzm9g/0046-cpuidle-Add-common-time-keeping-and-irq-enabling.patch285
-rw-r--r--patches.kzm9g/0046-mmc-tmio-calculate-the-native-hotplug-condition-only.patch71
-rw-r--r--patches.kzm9g/0047-mm-add-vm_area_add_early.patch92
-rw-r--r--patches.kzm9g/0047-mmc-tmio_mmc-support-the-generic-MMC-GPIO-card-hotpl.patch255
-rw-r--r--patches.kzm9g/0048-clockevents-Make-clockevents_config-a-global-symbol.patch46
-rw-r--r--patches.kzm9g/0048-mmc-sh_mobile_sdhi-pass-card-hotplug-GPIO-number-to-.patch55
-rw-r--r--patches.kzm9g/0049-clocksource-em_sti-Emma-Mobile-STI-driver-V2.patch484
-rw-r--r--patches.kzm9g/0049-mmc-tmio_mmc-power-status-flag-doesn-t-have-to-be-ex.patch101
-rw-r--r--patches.kzm9g/0050-ARM-move-initialization-of-the-high_memory-variable-.patch63
-rw-r--r--patches.kzm9g/0050-mmc-tmio_mmc-remove-unused-sdio_irq_enabled-flag.patch54
-rw-r--r--patches.kzm9g/0051-ARM-move-iotable-mappings-within-the-vmalloc-region.patch207
-rw-r--r--patches.kzm9g/0051-mmc-sh_mobile_sdhi-do-not-manage-PM-clocks-manually.patch52
-rw-r--r--patches.kzm9g/0052-ARM-simplify-__iounmap-when-dealing-with-section-bas.patch66
-rw-r--r--patches.kzm9g/0052-mmc-tmio-cosmetic-prettify-the-tmio_mmc_set_ios-func.patch63
-rw-r--r--patches.kzm9g/0053-ARM-add-generic-ioremap-optimization-by-reusing-stat.patch177
-rw-r--r--patches.kzm9g/0053-mmc-sh_mobile_sdhi-add-a-callback-for-board-specific.patch74
-rw-r--r--patches.kzm9g/0054-ARM-mach-shmobile-Introduce-shmobile_setup_delay.patch72
-rw-r--r--patches.kzm9g/0054-mmc-sh_mobile_sdhi-support-modular-mmc-core-with-non.patch85
-rw-r--r--patches.kzm9g/0055-ARM-mach-shmobile-Allow-SoC-specific-CPU-kill-code.patch67
-rw-r--r--patches.kzm9g/0055-mmc-Standardize-header-file-inclusion-checks.patch61
-rw-r--r--patches.kzm9g/0056-ARM-mach-shmobile-Use-preset_lpj-with-calibrate_dela.patch46
-rw-r--r--patches.kzm9g/0056-mmc-sh_mmcif-maximize-power-saving.patch82
-rw-r--r--patches.kzm9g/0057-ARM-Undelete-KZM9D-mach-type.patch32
-rw-r--r--patches.kzm9g/0057-mmc-sh_mmcif-simplify-platform-data.patch89
-rw-r--r--patches.kzm9g/0058-gpio-Emma-Mobile-GPIO-driver.patch481
-rw-r--r--patches.kzm9g/0058-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch52
-rw-r--r--patches.kzm9g/0059-mach-shmobile-Emma-Mobile-EV2-SoC-base-support-V3.patch493
-rw-r--r--patches.kzm9g/0059-mmc-host-move-to-dma_transfer_direction.patch54
-rw-r--r--patches.kzm9g/0060-mach-shmobile-KZM9D-board-support-V3.patch110
-rw-r--r--patches.kzm9g/0060-mmc-sh_mmcif-fix-clock-gating-on-platforms-with-a-.d.patch34
-rw-r--r--patches.kzm9g/0061-mach-shmobile-Emma-Mobile-EV2-SMP-support-V3.patch329
-rw-r--r--patches.kzm9g/0061-mmc-sh_mmcif-simplify-clock-divisor-calculation.patch42
-rw-r--r--patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch280
-rw-r--r--patches.kzm9g/0062-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch79
-rw-r--r--patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch82
-rw-r--r--patches.kzm9g/0063-mmc-sh_mmcif-process-error-interrupts-first.patch53
-rw-r--r--patches.kzm9g/0064-mmc-sh_mmcif-cosmetic-clean-up.patch211
-rw-r--r--patches.kzm9g/0065-mmc-sh_mmcif-process-requests-asynchronously.patch788
-rw-r--r--patches.kzm9g/0066-mmc-sh_mmcif-remove-now-superfluous-sh_mmcif_host-da.patch319
-rw-r--r--patches.kzm9g/0067-mmc-sh_mmcif-fix-MMC_GEN_CMD-setting.patch40
-rw-r--r--patches.kzm9g/0068-mmc-sh_mmcif-simplify-bitmask-macros.patch51
-rw-r--r--patches.kzm9g/0069-mmc-sh_mmcif-double-clock-speed.patch41
-rw-r--r--patches.kzm9g/0070-mmc-sh_mmcif-mmc-f_max-should-be-half-of-the-bus-clo.patch49
-rw-r--r--patches.kzm9g/0071-mmc-sh_mmcif-Simplify-calculation-of-mmc-f_min.patch44
-rw-r--r--patches.kzm9g/0072-ARM-mach-shmobile-clock-r8a7740-add-USB-clock.patch203
-rw-r--r--patches.kzm9g/0073-ALSA-workaround-change-the-timing-of-alsa_sound_last.patch38
-rw-r--r--patches.kzm9g/0074-ASoC-core-Optimise-and-refactor-pcm_new-to-pass-only.patch529
-rw-r--r--patches.kzm9g/0075-ASoC-core-Allow-components-to-probe-remove-in-sequen.patch249
-rw-r--r--patches.kzm9g/0076-ASoC-core-Separate-out-PCM-operations-into-new-file.patch1333
-rw-r--r--patches.kzm9g/0077-ASoC-core-PCM-mutex-per-rtd.patch203
-rw-r--r--patches.kzm9g/0078-ASoC-Allow-DAI-formats-to-be-specified-in-the-dai_li.patch148
-rw-r--r--patches.kzm9g/0079-ASoC-Hold-runtime-PM-references-to-components-of-act.patch78
-rw-r--r--patches.kzm9g/0080-ASoC-sh-fsi-tidyup-parameter-of-fsi_stream_push.patch64
-rw-r--r--patches.kzm9g/0081-ASoC-sh-fsi-add-fsi_set_master_clk.patch273
-rw-r--r--patches.kzm9g/0082-ASoC-sh-fsi-irq-control-moves-to-fsi_port_start-stop.patch74
-rw-r--r--patches.kzm9g/0083-ASoC-sh-fsi-tidyup-unclear-variable-naming.patch344
-rw-r--r--patches.kzm9g/0084-ASoC-sh-fsi-remove-pm_runtime-from-fsi_dai_set_fmt.patch160
-rw-r--r--patches.kzm9g/0085-ASoC-sh-fsi-make-sure-fsi_stream_push-pop-access-by-.patch62
-rw-r--r--patches.kzm9g/0086-ASoC-sh-fsi-remove-fsi_module_init-kill.patch106
-rw-r--r--patches.kzm9g/0087-ASoC-sh-fsi-cleanup-suspend-resume.patch202
-rw-r--r--patches.kzm9g/0088-ASoC-sh-fsi-add-fsi_hw_startup-shutdown.patch116
-rw-r--r--patches.kzm9g/0089-sound-irq-Remove-IRQF_DISABLED.patch43
-rw-r--r--patches.kzm9g/0090-ASoC-sh-use-correct-__iomem-annotations.patch66
-rw-r--r--patches.kzm9g/0091-sound-Add-module.h-to-the-previously-silent-sound-us.patch63
-rw-r--r--patches.kzm9g/0092-ASoC-fsi-fixup-compile-warning.patch50
-rw-r--r--patches.kzm9g/0093-ASoC-fsi-add-valid-data-position-control-support.patch62
-rw-r--r--patches.kzm9g/0094-ASoC-Constify-snd_soc_dai_ops-structs.patch169
-rw-r--r--patches.kzm9g/0095-ASoC-fsi-ak4642-modify-specification-method-of-FSI-a.patch272
-rw-r--r--patches.kzm9g/0096-ASoC-Convert-sh-directory-to-module_platform_driver.patch100
-rw-r--r--patches.kzm9g/0097-ASoC-Use-core-pm_runtime-callbacks-for-fsi.patch41
-rw-r--r--patches.kzm9g/0098-ASoC-sh-Add-.owner-to-struct-snd_soc_card.patch67
-rw-r--r--patches.kzm9g/0099-ASoC-fsi-Remove-unneeded-empty-runtime-PM-callbacks.patch47
-rw-r--r--patches.kzm9g/0100-ASoC-fsi-reduce-runtime-calculation-by-using-pre-set.patch81
-rw-r--r--patches.kzm9g/0101-ASoC-fsi-tidyup-fsi_stream_xx-functions-were-gathere.patch204
-rw-r--r--patches.kzm9g/0102-ASoC-fsi-data-push-pop-calculation-part-was-divided.patch159
-rw-r--r--patches.kzm9g/0103-ASoC-fsi-rename-fsi_dma_soft_xxx-to-fsi_pio_xxx.patch114
-rw-r--r--patches.kzm9g/0104-ASoC-fsi-tidyup-move-fsi_fifo_init-onto-fsi_hw_start.patch146
-rw-r--r--patches.kzm9g/0105-ASoC-fsi-remove-unnecessary-parameter-from-fsi_hw_sh.patch51
-rw-r--r--patches.kzm9g/0106-ASoC-fsi-rename-fsi_stream_push-pop-to-fsi_stream_in.patch57
-rw-r--r--patches.kzm9g/0107-ASoC-fsi-modify-fsi_pio_get_area-parameter-and-using.patch127
-rw-r--r--patches.kzm9g/0108-ASoC-fsi-re-define-fsi_is_play-and-fsi_stream_is_pla.patch70
-rw-r--r--patches.kzm9g/0109-ASoC-fsi-use-fsi_stream-in-fsi_get_current_fifo_samp.patch64
-rw-r--r--patches.kzm9g/0110-ASoC-fsi-add-fsi_stream_handler-and-PIO-handler.patch286
-rw-r--r--patches.kzm9g/0111-ASoC-fsi-tidyup-fsi_pio_xxx-are-gathered.patch152
-rw-r--r--patches.kzm9g/0112-ASoC-fsi-don-t-use-is_play-as-a-parameter-of-fsi-fun.patch291
-rw-r--r--patches.kzm9g/0113-ASoC-fsi-add-.start_stop-handler-to-fsi_stream_handl.patch129
-rw-r--r--patches.kzm9g/0114-ASoC-fsi-fsi_stream_is_working-care-substream-runtim.patch41
-rw-r--r--patches.kzm9g/0115-ASoC-fsi-PortA-B-information-was-controlled-by-sh_fs.patch285
-rw-r--r--patches.kzm9g/0116-ASoC-fsi-add-.init-.quit-handler-support.patch48
-rw-r--r--patches.kzm9g/0117-ASoC-fsi-fixup-fsi_pointer-calculation-method.patch42
-rw-r--r--patches.kzm9g/0118-ASoC-fsi-Add-DMAEngine-support.patch316
-rw-r--r--patches.kzm9g/0119-ASoC-fsi-update-for-dmaengine-prep_slave_sg-fallout.patch47
-rw-r--r--patches.kzm9g/0120-ASoC-add-generic-simple-card-support.patch241
-rw-r--r--patches.kzm9g/0121-ASoC-sh-fsi-select-simple-card-on-Kconfig.patch34
-rw-r--r--patches.kzm9g/0122-ASoC-ak4642-convert-to-soc-cache.patch162
-rw-r--r--patches.kzm9g/0123-ASoC-ak4642-ak4642-was-tested.patch32
-rw-r--r--patches.kzm9g/0124-ASoC-ak4642-add-ak4642_set_bias_level.patch88
-rw-r--r--patches.kzm9g/0125-ASoC-ak4642-add-DAPM-support-for-HeadPhone-Output.patch95
-rw-r--r--patches.kzm9g/0126-ASoC-ak4642-add-headphone-mute-switch-control.patch47
-rw-r--r--patches.kzm9g/0127-ASoC-ak4642-add-Line-out-support.patch61
-rw-r--r--patches.kzm9g/0128-ASoC-ak4642-add-ak4648-support.patch115
-rw-r--r--patches.kzm9g/0129-ASoC-Remove-driver-versioning-from-ak4642.patch41
-rw-r--r--patches.kzm9g/0130-ASoC-Convert-ak4642-to-devm_kzalloc.patch47
-rw-r--r--patches.kzm9g/0131-ASoC-ak4642-fixup-HeadPhone-L-R-dapm-settings.patch85
-rw-r--r--patches.kzm9g/0132-ARM-mach-shmobile-clock-r8a7740-add-SDHI-clock.patch54
-rw-r--r--patches.kzm9g/0133-ARM-mach-shmobile-clock-r8a7740-add-MMCIF-clock.patch45
-rw-r--r--patches.kzm9g/0134-ARM-mach-shmobile-r8a7740-reserve-DMA-memory-for-the.patch44
-rw-r--r--patches.kzm9g/0135-ARM-mach-shmobile-clock-r8a7740-add-FSI-clock.patch45
-rw-r--r--patches.kzm9g/0136-ARM-mach-shmobile-armadillo800eva-add-SDHI0-support.patch131
-rw-r--r--patches.kzm9g/0137-ARM-mach-shmobile-armadillo800eva-add-SDHI1-support.patch110
-rw-r--r--patches.kzm9g/0138-ARM-mach-shmobile-armadillo800eva-add-MMCIF-support.patch105
-rw-r--r--patches.kzm9g/0139-ARM-mach-shmobile-armadillo800eva-Add-FSI-WM8978-sup.patch181
-rw-r--r--patches.kzm9g/0140-ARM-mach-shmobile-Add-support-for-PINT-though-INTC-m.patch80
-rw-r--r--patches.kzm9g/0141-irq-Track-the-owner-of-irq-descriptor.patch260
-rw-r--r--patches.kzm9g/0142-irq-add-irq_domain-translation-infrastructure.patch400
-rw-r--r--patches.kzm9g/0143-dt-irq-add-irq_domain_generate_simple-helper.patch122
-rw-r--r--patches.kzm9g/0144-irq-Add-declaration-of-irq_domain_simple_ops-to-irqd.patch41
-rw-r--r--patches.kzm9g/0145-irq-Fix-check-for-already-initialized-irq_domain-in-.patch56
-rw-r--r--patches.kzm9g/0146-irq-support-domains-with-non-zero-hwirq-base.patch113
-rw-r--r--patches.kzm9g/0147-genirq-Add-support-for-per-cpu-dev_id-interrupts.patch769
-rw-r--r--patches.kzm9g/0148-ARM-introduce-handle_IRQ-not-to-dump-exception-stack.patch123
-rw-r--r--patches.kzm9g/0149-ARM-GIC-move-gic_chip_data-structure-declaration-to-.patch59
-rw-r--r--patches.kzm9g/0150-ARM-CPU-hotplug-fix-abuse-of-irqdesc-node.patch55
-rw-r--r--patches.kzm9g/0151-ARM-GIC-avoid-routing-interrupts-to-offline-CPUs.patch52
-rw-r--r--patches.kzm9g/0152-ARM-gic-Use-cpu-pm-notifiers-to-save-gic-state.patch268
-rw-r--r--patches.kzm9g/0153-ARM-7011-1-Add-ARM-cpu-topology-definition.patch351
-rw-r--r--patches.kzm9g/0154-ARM-7060-1-smp-populate-logical-CPU-mapping-during-b.patch74
-rw-r--r--patches.kzm9g/0155-ARM-gic-Allow-gic-arch-extensions-to-provide-irqchip.patch35
-rw-r--r--patches.kzm9g/0156-ARM-7061-1-gic-convert-logical-CPU-numbers-into-phys.patch67
-rw-r--r--patches.kzm9g/0157-ARM-7123-1-smp-Add-an-IPI-handler-callable-from-C-co.patch46
-rw-r--r--patches.kzm9g/0158-ARM-7124-1-smp-Add-a-localtimer-handler-callable-fro.patch46
-rw-r--r--patches.kzm9g/0159-ARM-gic-consolidate-PPI-handling.patch532
-rw-r--r--patches.kzm9g/0160-ARM-GIC-Add-global-gic_handle_irq-function.patch81
-rw-r--r--patches.kzm9g/0161-ARM-twd-register-clockevents-device-before-enabling-.patch41
-rw-r--r--patches.kzm9g/0162-ARM-EXYNOS4-set-the-affinity-of-mct1-interrupt-using.patch36
-rw-r--r--patches.kzm9g/0163-genirq-percpu-allow-interrupt-type-to-be-set-at-enab.patch75
-rw-r--r--patches.kzm9g/0164-ARM-gic-local-timers-use-the-request_percpu_irq-inte.patch489
-rw-r--r--patches.kzm9g/0165-ARM-gic-add-irq_domain-support.patch288
-rw-r--r--patches.kzm9g/0166-ARM-gic-add-OF-based-initialization.patch195
-rw-r--r--patches.kzm9g/0167-ARM-gic-fix-irq_alloc_descs-handling-for-sparse-irq.patch99
-rw-r--r--patches.kzm9g/0168-ARM-gic-use-module.h-instead-of-export.h.patch32
-rw-r--r--patches.kzm9g/0169-ARM-7176-1-cpu_pm-register-GIC-PM-notifier-only-once.patch44
-rw-r--r--patches.kzm9g/0170-ARM-7177-1-GIC-avoid-skipping-non-existent-PPIs-in-i.patch52
-rw-r--r--patches.kzm9g/0171-ARM-mach-shmobile-clock-sh73a0-tidyup-CKSCR-main-clo.patch32
-rw-r--r--patches.kzm9g/0172-ARM-mach-shmobile-sh73a0-PFC-pull-up-support-for-SDH.patch189
-rw-r--r--patches.kzm9g/0173-ARM-shmobile-convert-logical-CPU-numbers-to-physical.patch51
-rw-r--r--patches.kzm9g/0174-ARM-mach-shmobile-sh73a0-GPIO-IRQ-support.patch91
-rw-r--r--patches.kzm9g/0175-ARM-mach-shmobile-Use-common-INTC-IRQ-code-on-sh73a0.patch259
-rw-r--r--patches.kzm9g/0176-ARM-mach-shmobile-sh73a0-and-AG5EVM-PINT-support.patch174
-rw-r--r--patches.kzm9g/0177-ARM-mach-shmobile-Kota2-TPU-LED-platform-data.patch88
-rw-r--r--patches.kzm9g/0178-ARM-mach-shmobile-SH73A0-external-Ethernet-fix.patch38
-rw-r--r--patches.kzm9g/0179-sh-clkfwk-clock-sh73a0-all-div6_clks-use-SH_CLK_DIV6.patch233
-rw-r--r--patches.kzm9g/0180-arm-mach-shmobile-add-a-resource-name-for-shdma.patch55
-rw-r--r--patches.kzm9g/0181-ARM-mach-shmobile-sh73a0-PINT-IRQ-base-fix.patch39
-rw-r--r--patches.kzm9g/0182-ARM-mach-shmobile-sh73a0-IRQ-sparse-alloc-fix.patch44
-rw-r--r--patches.kzm9g/0183-ARM-mach-shmobile-clock-sh73a0-add-DSIxPHY-clock-sup.patch159
-rw-r--r--patches.kzm9g/0184-ARM-shmobile-remove-NR_IRQS.patch54
-rw-r--r--patches.kzm9g/0185-ARM-mach-shmobile-sh73a0-PSTR-32-bit-access-fix.patch34
-rw-r--r--patches.kzm9g/0186-ARM-mach-shmobile-sh73a0-sh_clk_ops-rename.patch77
-rw-r--r--patches.kzm9g/0187-ARM-mach-shmobile-sh73a0-map_io-and-init_early-updat.patch129
-rw-r--r--patches.kzm9g/0188-ARM-mach-shmobile-sh73a0-AG5EVM-and-Kota2-timer-rewo.patch95
-rw-r--r--patches.kzm9g/0189-ARM-mach-shmobile-sh73a0-add-MMC-data-pin-pull-up.patch130
-rw-r--r--patches.kzm9g/0190-ARM-Update-mach-types.patch640
-rw-r--r--patches.kzm9g/0191-ARM-mach-shmobile-add-KZM-A9-GT-board-support.patch126
-rw-r--r--patches.kzm9g/0192-ARM-mach-shmobile-kzm9g-add-defconfig.patch155
-rw-r--r--patches.kzm9g/0193-ARM-mach-shmobile-Invalidate-caches-when-booting-sec.patch97
-rw-r--r--patches.kzm9g/0194-ARM-mach-shmobile-kzm9g-enable-SMP-boot.patch92
-rw-r--r--patches.kzm9g/0195-ARM-mach-shmobile-kzm9g-add-LCDC-support.patch204
-rw-r--r--patches.kzm9g/0196-ARM-mach-shmobile-kzm9g-add-ST1232-Touchscreen-suppo.patch65
-rw-r--r--patches.kzm9g/0197-ARM-mach-shmobile-pfc-sh73a0-fixup-MSEL2CR-MSEL18-fo.patch44
-rw-r--r--patches.kzm9g/0198-ARM-mach-shmobile-sh73a0.h-add-GPIO_NR.patch38
-rw-r--r--patches.kzm9g/0199-ARM-mach-shmobile-kzm9g-correct-screen-direction.patch40
-rw-r--r--patches.kzm9g/0200-ARM-mach-shmobile-kzm9g-add-MMCIF-support.patch106
-rw-r--r--patches.kzm9g/0201-ARM-mach-shmobile-kzm9g-add-SDHI-support.patch110
-rw-r--r--patches.kzm9g/0202-ARM-mach-shmobile-kzm9g-add-PCF8757-gpio-key.patch140
-rw-r--r--patches.kzm9g/0203-ARM-mach-shmobile-kzm9g-defconfig-update.patch88
-rw-r--r--patches.kzm9g/0204-ARM-mach-shmobile-clock-sh73a0-add-FSI-clock.patch46
-rw-r--r--patches.kzm9g/0205-ARM-mach-shmobile-kzm9g-add-FSI-AK4648-support.patch162
-rw-r--r--patches.kzm9g/arm-mach-shmobile-kzm9d-add-defconfig.patch114
-rw-r--r--patches.kzm9g/arm-mach-shmobile-kzm9d-defconfig-enable-net_ethernet.patch30
-rw-r--r--patches.kzm9g/arm-shmobile-sh73a0-bugfix-sy-dmac-number.patch86
-rw-r--r--patches.kzm9g/ltsi-arm-shmobile-kzm9g-support-real-time-clock.patch53
-rw-r--r--patches.kzm9g/ltsi-bugfix-add-config_i2c-to-kzm9g_defconfig.patch51
-rw-r--r--patches.kzm9g/of-address-add-of_find_matching_node_by_address-helper.patch66
-rw-r--r--patches.ltsi/ltsi-makefile-addition.patch6
-rw-r--r--patches.lttng/0018-staging-add-LTTng-to-build.patch12
-rw-r--r--patches.lttng/0019-staging-Add-LTTng-entry-to-MAINTAINERS-file.patch4
-rw-r--r--patches.pramfs/08-pramfs-headers.patch15
-rw-r--r--patches.pramfs/17-pramfs-makefile-and-kconfig.patch20
-rw-r--r--patches.r8a66597-udc/001-usb-gadget-add-platform-module-alias-where-it-is-missing.patch43
-rw-r--r--patches.r8a66597-udc/002-usb-update-email-address-in-r8a66597-udc-and-m66592-udc.patch50
-rw-r--r--patches.r8a66597-udc/003-usb-gadget-r8a66597-udc-make-buswait-configurable-through-platform-data.patch63
-rw-r--r--patches.r8a66597-udc/004-usb-gadget-r8a66597-udc-add-support-for-test_mode.patch76
-rw-r--r--patches.r8a66597-udc/005-usb-gadget-clean-up-fsf-boilerplate-text.patch134
-rw-r--r--patches.r8a66597-udc/006-usb-irq-remove-irqf_disabled.patch92
-rw-r--r--patches.r8a66597-udc/007-usb-gadget-r8a66597-udc-change-prototype-of-r8a66597_write_fifo.patch59
-rw-r--r--patches.r8a66597-udc/008-usb-r8a66597-hcd-add-function-for-external-controller.patch44
-rw-r--r--patches.r8a66597-udc/009-usb-gadget-r8a66597-udc-add-function-for-external-controller.patch86
-rw-r--r--patches.r8a66597-udc/010-usb-gadget-r8a66597-udc-use-dev_-instead-of-printk.patch311
-rw-r--r--patches.r8a66597-udc/011-usb-gadget-r8a66597-udc-add-support-for-sudmac.patch664
-rw-r--r--patches.r8a66597-udc/012-usb-gadget-r8a66597-udc-fix-flush-fifo-handling.patch37
-rw-r--r--patches.runtime_pm/0001-Revert-PM-Runtime-Automatically-retry-failed-autosus.patch78
-rw-r--r--patches.runtime_pm/0002-PM-Domains-Rename-struct-dev_power_domain-to-struct-.patch397
-rw-r--r--patches.runtime_pm/0003-PM-subsys_data-in-struct-dev_pm_info-need-not-depend.patch35
-rw-r--r--patches.runtime_pm/0004-PM-Domains-Support-for-generic-I-O-PM-domains-v8.patch656
-rw-r--r--patches.runtime_pm/0005-PM-Introduce-generic-noirq-callback-routines-for-sub.patch340
-rw-r--r--patches.runtime_pm/0006-PM-Domains-Move-code-from-under-ifdef-CONFIG_PM_RUNT.patch184
-rw-r--r--patches.runtime_pm/0007-PM-Domains-System-wide-transitions-support-for-gener.patch735
-rw-r--r--patches.runtime_pm/0008-PM-Domains-Wakeup-devices-support-for-system-sleep-t.patch75
-rw-r--r--patches.runtime_pm/0009-PM-Allow-the-clocks-management-code-to-be-used-durin.patch147
-rw-r--r--patches.runtime_pm/0010-PM-Rename-clock-management-functions.patch588
-rw-r--r--patches.runtime_pm/0011-PM-Runtime-Update-documentation-of-interactions-with.patch90
-rw-r--r--patches.runtime_pm/0012-PM-Runtime-Return-special-error-code-if-runtime-PM-i.patch115
-rw-r--r--patches.runtime_pm/0013-PM-Limit-race-conditions-between-runtime-PM-and-syst.patch224
-rw-r--r--patches.runtime_pm/0014-PM-Runtime-Improve-documentation-of-enable-disable-a.patch60
-rw-r--r--patches.runtime_pm/0015-PM-Runtime-Replace-run-time-with-runtime-in-document.patch685
-rw-r--r--patches.runtime_pm/0016-PM-Runtime-Prevent-runtime_resume-from-racing-with-p.patch53
-rw-r--r--patches.runtime_pm/0017-PM-Runtime-Consistent-utilization-of-deferred_resume.patch32
-rw-r--r--patches.runtime_pm/0018-PM-Domains-Export-pm_genpd_poweron-in-header.patch56
-rw-r--r--patches.runtime_pm/0019-doc-Konfig-Documentation-power-pm-apm-acpi-.txt.patch48
-rw-r--r--patches.runtime_pm/0020-PM-Domains-Set-device-state-to-active-during-system-.patch36
-rw-r--r--patches.runtime_pm/0021-PM-Domains-Make-failing-pm_genpd_prepare-clean-up-pr.patch53
-rw-r--r--patches.runtime_pm/0022-PM-Domains-Do-not-execute-device-callbacks-under-loc.patch604
-rw-r--r--patches.runtime_pm/0023-PM-Domains-Allow-callbacks-to-execute-all-runtime-PM.patch383
-rw-r--r--patches.runtime_pm/0024-PM-Domains-Do-not-restore-all-devices-on-power-off-e.patch52
-rw-r--r--patches.runtime_pm/0025-PM-Domains-Improve-handling-of-wakeup-devices-during.patch88
-rw-r--r--patches.runtime_pm/0026-PM-Domains-Queue-up-power-off-work-only-if-it-is-not.patch56
-rw-r--r--patches.runtime_pm/0027-PM-Runtime-Add-new-helper-function-pm_runtime_status.patch63
-rw-r--r--patches.runtime_pm/0028-PM-Domains-Introduce-function-to-power-off-all-unuse.patch88
-rw-r--r--patches.runtime_pm/0029-ARM-shmobile-Use-genpd_queue_power_off_work.patch59
-rw-r--r--patches.runtime_pm/0030-PM-Domains-Take-.power_off-error-code-into-account.patch47
-rw-r--r--patches.runtime_pm/0031-PM-OPP-Introduce-function-to-free-cpufreq-table.patch88
-rw-r--r--patches.runtime_pm/0032-PM-Suspend-Add-.suspend_again-callback-to-suspend_op.patch151
-rw-r--r--patches.runtime_pm/0033-PM-Suspend-Export-suspend_set_ops-suspend_valid_only.patch43
-rw-r--r--patches.runtime_pm/0034-PM-Add-RTC-to-PM-trace-time-stamps-to-avoid-confusio.patch35
-rw-r--r--patches.runtime_pm/0035-PM-Improve-error-code-of-pm_notifier_call_chain.patch100
-rw-r--r--patches.runtime_pm/0036-drivers-base-power-opp.c-fix-dev_opp-initial-value.patch36
-rw-r--r--patches.runtime_pm/0037-PM-Domains-Fix-pm_genpd_poweron.patch45
-rw-r--r--patches.runtime_pm/0038-PM-Runtime-Allow-_put_sync-from-interrupts-disabled-.patch90
-rw-r--r--patches.runtime_pm/0039-PM-Domains-Fix-build-for-CONFIG_PM_RUNTIME-unset.patch109
-rw-r--r--patches.runtime_pm/0040-PM-Runtime-Add-might_sleep-to-runtime-PM-functions.patch106
-rw-r--r--patches.runtime_pm/0041-PM-Runtime-Add-macro-to-test-for-runtime-PM-events.patch323
-rw-r--r--patches.runtime_pm/0042-PM-Use-spinlock-instead-of-mutex-in-clock-management.patch197
-rw-r--r--patches.runtime_pm/0043-PM-Runtime-Correct-documentation-of-pm_runtime_irq_s.patch35
-rw-r--r--patches.runtime_pm/0044-PM-Domains-Implement-subdomain-counters-as-atomic-fi.patch128
-rw-r--r--patches.runtime_pm/0045-PM-Domains-Do-not-take-parent-locks-to-modify-subdom.patch150
-rw-r--r--patches.runtime_pm/0046-PM-Domains-Make-pm_genpd_poweron-always-survive-pare.patch93
-rw-r--r--patches.runtime_pm/0047-PM-Domains-Add-wait-for-parent-status-for-generic-PM.patch219
-rw-r--r--patches.runtime_pm/0048-PM-Domains-Allow-generic-PM-domains-to-have-multiple.patch329
-rw-r--r--patches.runtime_pm/0049-PM-Domains-Rename-GPD_STATE_WAIT_PARENT-to-GPD_STATE.patch74
-rw-r--r--patches.runtime_pm/0050-PM-Domains-Rename-argument-of-pm_genpd_add_subdomain.patch88
-rw-r--r--patches.runtime_pm/0051-PM-Introduce-struct-pm_subsys_data.patch391
-rw-r--r--patches.runtime_pm/0052-PM-Reference-counting-of-power.subsys_data.patch207
-rw-r--r--patches.runtime_pm/0053-PM-Domains-Use-power.sybsys_data-to-reduce-overhead.patch519
-rw-r--r--patches.runtime_pm/0054-PM-QoS-Move-and-rename-the-implementation-files.patch326
-rw-r--r--patches.runtime_pm/0055-plist-Remove-the-need-to-supply-locks-to-plist-heads.patch246
-rw-r--r--patches.runtime_pm/0056-PM-QoS-Minor-clean-ups.patch409
-rw-r--r--patches.runtime_pm/0057-PM-QoS-Code-reorganization.patch85
-rw-r--r--patches.runtime_pm/0058-PM-QoS-Reorganize-data-structs.patch243
-rw-r--r--patches.runtime_pm/0059-PM-QoS-Generalize-and-export-constraints-management-.patch292
-rw-r--r--patches.runtime_pm/0060-PM-QoS-Implement-per-device-PM-QoS-constraints.patch535
-rw-r--r--patches.runtime_pm/0061-PM-QoS-Add-global-notification-mechanism-for-device-.patch230
-rw-r--r--patches.runtime_pm/0062-PM-Domains-Preliminary-support-for-devices-with-powe.patch110
-rw-r--r--patches.runtime_pm/0063-PM-Runtime-pm_runtime_idle-can-be-called-in-atomic-c.patch33
-rw-r--r--patches.runtime_pm/0064-cpu_pm-Add-cpu-power-management-notifiers.patch382
-rw-r--r--patches.runtime_pm/0065-PM-Clocks-Do-not-acquire-a-mutex-under-a-spinlock.patch194
-rw-r--r--patches.runtime_pm/0066-PM-Domains-Split-device-PM-domain-data-into-base-and.patch173
-rw-r--r--patches.runtime_pm/0067-doc-fix-broken-references.patch136
-rw-r--r--patches.runtime_pm/0068-PM-Runtime-Don-t-run-callbacks-under-lock-for-power..patch146
-rw-r--r--patches.runtime_pm/0069-PM-Runtime-Introduce-trace-points-for-tracing-rpm_-f.patch169
-rw-r--r--patches.runtime_pm/0070-PM-Tracing-build-rpm-traces.c-only-if-CONFIG_PM_RUNT.patch36
-rw-r--r--patches.runtime_pm/0071-PM-Runtime-Replace-dev_dbg-with-trace_rpm_.patch105
-rw-r--r--patches.runtime_pm/0072-PM-OPP-Add-OPP-availability-change-notifier.patch143
-rw-r--r--patches.runtime_pm/0073-PM-OPP-Fix-build-when-CONFIG_PM_OPP-is-not-set.patch45
-rw-r--r--patches.runtime_pm/0074-PM-QoS-Add-function-dev_pm_qos_read_value-v3.patch463
-rw-r--r--patches.runtime_pm/0075-PM-QoS-Update-Documentation-for-the-pm_qos-and-dev_p.patch155
-rw-r--r--patches.runtime_pm/0076-regulator-Fix-some-bitrot-in-the-machine-driver-docu.patch51
-rw-r--r--patches.runtime_pm/0077-regulator-Clarify-documentation-for-regulator-regula.patch55
-rw-r--r--patches.runtime_pm/0078-PM-Runtime-Update-document-about-callbacks.patch57
-rw-r--r--patches.runtime_pm/0079-PM-Runtime-Fix-kerneldoc-comment-for-rpm_suspend.patch57
-rw-r--r--patches.runtime_pm/0080-PM-Runtime-Handle-.runtime_suspend-failure-correctly.patch74
-rw-r--r--patches.runtime_pm/0081-PM-Suspend-Add-statistics-debugfs-file-for-suspend-t.patch409
-rw-r--r--patches.runtime_pm/0082-PM-Fix-build-issue-in-main.c-for-CONFIG_PM_SLEEP-uns.patch41
-rw-r--r--patches.runtime_pm/0083-PM-Hibernate-Include-storage-keys-in-hibernation-ima.patch302
-rw-r--r--patches.runtime_pm/0084-PM-VT-Cleanup-if-defined-uglyness-and-fix-compile-er.patch114
-rw-r--r--patches.runtime_pm/0085-PM-Update-the-policy-on-default-wakeup-settings.patch52
-rw-r--r--patches.runtime_pm/0086-PM-Hibernate-Freeze-kernel-threads-after-preallocati.patch171
-rw-r--r--patches.runtime_pm/0087-PM-Hibernate-Fix-typo-in-a-kerneldoc-comment.patch35
-rw-r--r--patches.runtime_pm/0088-PM-Hibernate-Add-resumewait-param-to-support-MMC-lik.patch101
-rw-r--r--patches.runtime_pm/0089-PM-Hibernate-Add-resumedelay-kernel-param-in-additio.patch82
-rw-r--r--patches.runtime_pm/0090-PM-Hibernate-Do-not-initialize-static-and-extern-var.patch46
-rw-r--r--patches.runtime_pm/0091-PM-Hibernate-Improve-performance-of-LZO-plain-hibern.patch1160
-rw-r--r--patches.runtime_pm/0092-PM-Sleep-Mark-devices-involved-in-wakeup-signaling-d.patch95
-rw-r--r--patches.runtime_pm/0093-PM-Documentation-Update-docs-about-suspend-and-CPU-h.patch321
-rw-r--r--patches.runtime_pm/0094-PM-Clocks-Remove-redundant-NULL-checks-before-kfree.patch37
-rw-r--r--patches.runtime_pm/0095-kernel-fix-several-implicit-usasges-of-kmod.h.patch70
-rw-r--r--patches.runtime_pm/0096-kernel-Fix-files-explicitly-needing-EXPORT_SYMBOL-in.patch151
-rw-r--r--patches.runtime_pm/0097-drivers-base-Add-export.h-for-EXPORT_SYMBOL-THIS_MOD.patch143
-rw-r--r--patches.runtime_pm/0098-drivers-base-change-module.h-export.h-in-power-commo.patch33
-rw-r--r--patches.runtime_pm/0099-pm_runtime.h-explicitly-requires-notifier.h.patch31
-rw-r--r--patches.runtime_pm/0100-PM-Sleep-Update-freezer-documentation.patch53
-rw-r--r--patches.runtime_pm/0101-PM-Runtime-Fix-runtime-accounting-calculation-error.patch40
-rw-r--r--patches.runtime_pm/0102-PM-QoS-Remove-redundant-check.patch33
-rw-r--r--patches.runtime_pm/0103-PM-Runtime-Automatically-retry-failed-autosuspends.patch95
-rw-r--r--patches.runtime_pm/0104-PM-QoS-Set-cpu_dma_pm_qos-name.patch35
-rw-r--r--patches.runtime_pm/0105-PM-OPP-Use-ERR_CAST-instead-of-ERR_PTR-PTR_ERR.patch38
-rw-r--r--patches.runtime_pm/0106-PM-Clocks-Only-disable-enabled-clocks-in-pm_clk_susp.patch44
-rw-r--r--patches.runtime_pm/0107-PM-QoS-Properly-use-the-WARN-macro-in-dev_pm_qos_add.patch66
-rw-r--r--patches.runtime_pm/0108-PM-Sleep-Do-not-extend-wakeup-paths-to-devices-with-.patch115
-rw-r--r--patches.runtime_pm/0109-PM-Hibernate-Fix-the-early-termination-of-test-modes.patch81
-rw-r--r--patches.runtime_pm/0110-PM-Suspend-Fix-bug-in-suspend-statistics-update.patch45
-rw-r--r--patches.runtime_pm/0111-freezer-don-t-unnecessarily-set-PF_NOFREEZE-explicit.patch86
-rw-r--r--patches.runtime_pm/0112-freezer-fix-current-state-restoration-race-in-refrig.patch57
-rw-r--r--patches.runtime_pm/0113-freezer-unexport-refrigerator-and-update-try_to_free.patch336
-rw-r--r--patches.runtime_pm/0114-oom-thaw-threads-if-oom-killed-thread-is-frozen-befo.patch53
-rw-r--r--patches.runtime_pm/0115-freezer-implement-and-use-kthread_freezable_should_s.patch239
-rw-r--r--patches.runtime_pm/0116-freezer-rename-thaw_process-to-__thaw_task-and-simpl.patch158
-rw-r--r--patches.runtime_pm/0117-freezer-remove-racy-clear_freeze_flag-and-set-PF_NOF.patch66
-rw-r--r--patches.runtime_pm/0118-freezer-don-t-distinguish-nosig-tasks-on-thaw.patch68
-rw-r--r--patches.runtime_pm/0119-freezer-use-dedicated-lock-instead-of-task_lock-memo.patch187
-rw-r--r--patches.runtime_pm/0120-freezer-make-freezing-indicate-freeze-condition-in-e.patch162
-rw-r--r--patches.runtime_pm/0121-freezer-test-freezable-conditions-while-holding-free.patch87
-rw-r--r--patches.runtime_pm/0122-freezer-clean-up-freeze_processes-failure-path.patch239
-rw-r--r--patches.runtime_pm/0123-cgroup_freezer-prepare-for-removal-of-TIF_FREEZE.patch178
-rw-r--r--patches.runtime_pm/0124-freezer-make-freezing-test-freeze-conditions-in-effe.patch316
-rw-r--r--patches.runtime_pm/0125-Freezer-fix-more-fallout-from-the-thaw_process-renam.patch30
-rw-r--r--patches.runtime_pm/0126-freezer-remove-unused-sig_only-from-freeze_task.patch142
-rw-r--r--patches.runtime_pm/0127-PM-Hibernate-Do-not-leak-memory-in-error-test-code-p.patch75
-rw-r--r--patches.runtime_pm/0128-PM-Fix-indentation-and-remove-extraneous-whitespaces.patch55
-rw-r--r--patches.runtime_pm/0129-PM-Sleep-Remove-unnecessary-label-and-jumps-to-it-fo.patch57
-rw-r--r--patches.runtime_pm/0130-PM-Sleep-Simplify-device_suspend_noirq.patch58
-rw-r--r--patches.runtime_pm/0131-PM-Hibernate-Refactor-and-simplify-hibernation_snaps.patch80
-rw-r--r--patches.runtime_pm/0132-PM-Domains-Document-how-PM-domains-are-used-by-the-P.patch122
-rw-r--r--patches.runtime_pm/0133-PM-Sleep-Correct-inaccurate-information-in-devices.t.patch46
-rw-r--r--patches.runtime_pm/0134-PM-Runtime-Make-documentation-follow-the-new-behavio.patch42
-rw-r--r--patches.runtime_pm/0135-PM-Sleep-Update-documentation-related-to-system-wake.patch103
-rw-r--r--patches.runtime_pm/0136-PM-Update-comments-describing-device-power-managemen.patch309
-rw-r--r--patches.runtime_pm/0137-PM-Runtime-Use-device-PM-QoS-constraints-v2.patch353
-rw-r--r--patches.runtime_pm/0138-PM-Domains-Make-it-possible-to-use-per-device-domain.patch390
-rw-r--r--patches.runtime_pm/0139-PM-Domains-Introduce-save-restore-state-device-callb.patch173
-rw-r--r--patches.runtime_pm/0140-PM-Domains-Rework-system-suspend-callback-routines-v.patch420
-rw-r--r--patches.runtime_pm/0141-PM-Domains-Add-device-stop-governor-function-v4.patch319
-rw-r--r--patches.runtime_pm/0142-PM-Domains-Add-default-power-off-governor-function-v.patch207
-rw-r--r--patches.runtime_pm/0143-PM-Domains-Automatically-update-overoptimistic-laten.patch128
-rw-r--r--patches.runtime_pm/0144-PM-Domains-fix-compilation-failure-for-CONFIG_PM_GEN.patch44
-rw-r--r--patches.runtime_pm/0145-regulator-Fix-regulator_register-API-signature-in-Do.patch37
-rw-r--r--patches.runtime_pm/0146-PM-Hibernate-Enable-usermodehelpers-in-software_resu.patch38
-rw-r--r--patches.runtime_pm/0147-PM-Hibernate-Thaw-processes-in-SNAPSHOT_CREATE_IMAGE.patch83
-rw-r--r--patches.runtime_pm/0148-PM-Hibernate-Remove-deprecated-hibernation-test-mode.patch138
-rw-r--r--patches.runtime_pm/0149-PM-Sleep-Unify-diagnostic-messages-from-device-suspe.patch251
-rw-r--r--patches.runtime_pm/0150-PM-Hibernate-Replace-unintuitive-if-condition-in-ker.patch35
-rw-r--r--patches.runtime_pm/0151-PM-Domains-Make-it-possible-to-assign-names-to-gener.patch73
-rw-r--r--patches.runtime_pm/0152-PM-Domains-Fix-default-system-suspend-resume-operati.patch78
-rw-r--r--patches.runtime_pm/0153-PM-Sleep-Replace-mutex_-un-lock-pm_mutex-with-un-loc.patch234
-rw-r--r--patches.runtime_pm/0154-PM-Sleep-Recommend-un-lock_system_sleep-over-using-p.patch55
-rw-r--r--patches.runtime_pm/0155-PM-Domains-Provide-an-always-on-power-domain-governo.patch66
-rw-r--r--patches.runtime_pm/0156-PM-Hibernate-Remove-deprecated-hibernation-snapshot-.patch190
-rw-r--r--patches.runtime_pm/0157-PM-Sleep-Simplify-generic-system-suspend-callbacks.patch97
-rw-r--r--patches.runtime_pm/0158-PM-Sleep-Merge-internal-functions-in-generic_ops.c.patch122
-rw-r--r--patches.runtime_pm/0159-PM-Sleep-Make-pm_op-and-pm_noirq_op-return-callback-.patch394
-rw-r--r--patches.runtime_pm/0160-PM-Run-the-driver-callback-directly-if-the-subsystem.patch512
-rw-r--r--patches.runtime_pm/0161-PM-Drop-generic_subsys_pm_ops.patch100
-rw-r--r--patches.runtime_pm/0162-PM-QoS-Introduce-dev_pm_qos_add_ancestor_request.patch111
-rw-r--r--patches.runtime_pm/0163-power_supply-Add-initial-Charger-Manager-driver.patch1143
-rw-r--r--patches.runtime_pm/0164-PM-Hibernate-Implement-compat_ioctl-for-dev-snapshot.patch110
-rw-r--r--patches.runtime_pm/0165-mm-more-intensive-memory-corruption-debugging.patch266
-rw-r--r--patches.runtime_pm/0166-PM-Hibernate-do-not-count-debug-pages-as-savable.patch56
-rw-r--r--patches.runtime_pm/0167-power_supply-Charger-Manager-Add-properties-for-powe.patch475
-rw-r--r--patches.runtime_pm/0168-PM-Domains-Fix-build-for-CONFIG_PM_SLEEP-unset.patch55
-rw-r--r--patches.runtime_pm/0169-PM-Domains-Skip-governor-functions-for-CONFIG_PM_RUN.patch69
-rw-r--r--patches.runtime_pm/0170-PM-Documentation-Fix-spelling-mistake-in-basic-pm-de.patch30
-rw-r--r--patches.runtime_pm/0171-PM-Documentation-Fix-minor-issue-in-freezing_of_task.patch42
-rw-r--r--patches.runtime_pm/0172-PM-Hibernate-Correct-additional-pages-number-calcula.patch34
-rw-r--r--patches.runtime_pm/0173-PM-Domains-Add-OF-support.patch124
-rw-r--r--patches.runtime_pm/0174-PM-Hibernate-Fix-s2disk-regression-related-to-freezi.patch110
-rw-r--r--patches.runtime_pm/0175-PM-Sleep-Introduce-late-suspend-and-early-resume-of-.patch979
-rw-r--r--patches.runtime_pm/0176-PM-Sleep-Introduce-generic-callbacks-for-new-device-.patch316
-rw-r--r--patches.runtime_pm/0177-PM-Domains-Run-late-early-device-suspend-callbacks-a.patch352
-rw-r--r--patches.runtime_pm/0178-PM-QoS-Simplify-PM-QoS-expansion-merge.patch89
-rw-r--r--patches.runtime_pm/0179-PM-Hibernate-Thaw-kernel-threads-in-SNAPSHOT_CREATE_.patch49
-rw-r--r--patches.runtime_pm/0180-PM-Freezer-Thaw-only-kernel-threads-if-freezing-of-k.patch110
-rw-r--r--patches.runtime_pm/0181-PM-QoS-CPU-C-state-breakage-with-PM-Qos-change.patch58
-rw-r--r--patches.runtime_pm/0182-PM-Suspend-Avoid-code-duplication-in-suspend-statist.patch93
-rw-r--r--patches.runtime_pm/0183-PM-Freezer-Docs-Document-the-beauty-of-freeze-thaw-s.patch60
-rw-r--r--patches.runtime_pm/0184-PM-Hibernate-Thaw-kernel-threads-in-hibernation_snap.patch77
-rw-r--r--patches.runtime_pm/0185-PM-Hibernate-Refactor-and-simplify-freezer_test_done.patch71
-rw-r--r--patches.runtime_pm/0186-PM-Domains-Provide-a-dummy-dev_gpd_data-when-generic.patch52
-rw-r--r--patches.runtime_pm/0187-PM-Make-sysrq-o-be-available-for-CONFIG_PM-unset.patch53
-rw-r--r--patches.runtime_pm/0188-PM-QoS-unconditionally-build-the-feature.patch116
-rw-r--r--patches.runtime_pm/0189-PM-Sleep-Initialize-wakeup-source-locks-in-wakeup_so.patch41
-rw-r--r--patches.runtime_pm/0190-PM-Sleep-Do-not-check-wakeup-too-often-in-try_to_fre.patch48
-rw-r--r--patches.runtime_pm/0191-PM-Sleep-Remove-unnecessary-label-from-suspend_freez.patch51
-rw-r--r--patches.runtime_pm/0192-PM-Sleep-Unify-kerneldoc-comments-in-kernel-power-su.patch142
-rw-r--r--patches.runtime_pm/0193-PM-Sleep-Make-enter_state-in-kernel-power-suspend.c-.patch75
-rw-r--r--patches.runtime_pm/0194-PM-Sleep-Drop-suspend_stats_update.patch79
-rw-r--r--patches.runtime_pm/0195-PM-Add-comment-describing-relationships-between-PM-c.patch45
-rw-r--r--patches.runtime_pm/0196-PM-Hibernate-print-physical-addresses-consistently-w.patch39
-rw-r--r--patches.runtime_pm/0197-PM-Sleep-Fix-possible-infinite-loop-during-wakeup-so.patch66
-rw-r--r--patches.runtime_pm/0198-PM-Sleep-Fix-race-conditions-related-to-wakeup-sourc.patch75
-rw-r--r--patches.runtime_pm/0199-PM-Sleep-Add-more-wakeup-source-initialization-routi.patch179
-rw-r--r--patches.runtime_pm/0200-PM-Freezer-Remove-references-to-TIF_FREEZE-in-commen.patch80
-rw-r--r--patches.runtime_pm/0201-PM-Domains-Fix-include-for-PM_GENERIC_DOMAINS-n-case.patch59
-rw-r--r--patches.runtime_pm/0202-PM-QoS-Make-it-possible-to-expose-PM-QoS-latency-con.patch282
-rw-r--r--patches.runtime_pm/0203-PM-Domains-Fix-handling-of-wakeup-devices-during-sys.patch51
-rw-r--r--patches.runtime_pm/0204-PM-Domains-Fix-hibernation-restore-of-devices-v2.patch97
-rw-r--r--patches.runtime_pm/0205-PM-Domains-Introduce-always-on-device-flag.patch155
-rw-r--r--patches.runtime_pm/0206-PM-Domains-Check-domain-status-during-hibernation-re.patch40
-rw-r--r--patches.runtime_pm/0207-PM-Runtime-don-t-forget-to-wake-up-waitqueue-on-fail.patch49
-rw-r--r--patches.runtime_pm/0208-PM-Hibernate-Disable-usermode-helpers-right-before-f.patch94
-rw-r--r--patches.runtime_pm/0209-PM-Sleep-Move-disabling-of-usermode-helpers-to-the-f.patch188
-rw-r--r--patches.runtime_pm/0210-PM-QoS-add-pm_qos_update_request_timeout-API.patch150
-rw-r--r--patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch595
-rw-r--r--patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch57
-rw-r--r--patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch92
-rw-r--r--patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch85
-rw-r--r--patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch82
-rw-r--r--patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch54
-rw-r--r--patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch51
-rw-r--r--patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch57
-rw-r--r--patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch75
-rw-r--r--patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch46
-rw-r--r--patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch68
-rw-r--r--patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch48
-rw-r--r--patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch58
-rw-r--r--patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch44
-rw-r--r--patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch67
-rw-r--r--patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch82
-rw-r--r--patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch93
-rw-r--r--patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch48
-rw-r--r--patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch48
-rw-r--r--patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch63
-rw-r--r--patches.sh7757lcr/021-sh-kexec-add-physical_start.patch165
-rw-r--r--patches.sh7757lcr/drivers-sh-generalize-runtime-pm-platform-stub.patch198
-rw-r--r--patches.sh7757lcr/sh-also-without-pm_runtime-pm_runtime.o-must-be-built.patch41
-rw-r--r--patches.sh7757lcr/sh-fix-clock-sh7757-for-the-latest-sh_mobile_sdhi-driver.patch41
-rw-r--r--series836
830 files changed, 29 insertions, 129725 deletions
diff --git a/KERNEL_VERSION b/KERNEL_VERSION
index f4605dc50cbe8c..0ce07b72f8090e 100644
--- a/KERNEL_VERSION
+++ b/KERNEL_VERSION
@@ -1 +1 @@
-3.0.36
+3.4.11
diff --git a/patches.android/android-0001-Revert-Staging-android-delete-android-drivers.patch b/patches.android/android-0001-Revert-Staging-android-delete-android-drivers.patch
deleted file mode 100644
index e278f5d6b3c06d..00000000000000
--- a/patches.android/android-0001-Revert-Staging-android-delete-android-drivers.patch
+++ /dev/null
@@ -1,5904 +0,0 @@
-From 355b0502f6efea0ff9492753888772c96972d2a3 Mon Sep 17 00:00:00 2001
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Date: Wed, 30 Nov 2011 20:18:14 +0900
-Subject: Revert "Staging: android: delete android drivers"
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 355b0502f6efea0ff9492753888772c96972d2a3
-
-This reverts commit b0a0ccfad85b3657fe999805df65f5cfe634ab8a.
-
-Turns out I was wrong, we want these in the tree.
-
-Note, I've disabled the drivers from the build at the moment, so other
-patches can be applied to fix some build issues due to internal api
-changes since the code was removed from the tree.
-
-Cc: Arve Hjønnevåg <arve@android.com>
-Cc: Brian Swetland <swetland@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-new file mode 100644
-index 0000000..eb67563
---- /dev/null
-+++ b/drivers/staging/android/Kconfig
-@@ -0,0 +1,96 @@
-+menu "Android"
-+
-+config ANDROID
-+ bool "Android Drivers"
-+ depends on BROKEN
-+ default N
-+ ---help---
-+ Enable support for various drivers needed on the Android platform
-+
-+if ANDROID
-+
-+config ANDROID_BINDER_IPC
-+ bool "Android Binder IPC Driver"
-+ default n
-+
-+config ANDROID_LOGGER
-+ tristate "Android log driver"
-+ default n
-+
-+config ANDROID_RAM_CONSOLE
-+ bool "Android RAM buffer console"
-+ default n
-+
-+config ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
-+ bool "Enable verbose console messages on Android RAM console"
-+ default y
-+ depends on ANDROID_RAM_CONSOLE
-+
-+menuconfig ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ bool "Android RAM Console Enable error correction"
-+ default n
-+ depends on ANDROID_RAM_CONSOLE
-+ depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
-+ select REED_SOLOMON
-+ select REED_SOLOMON_ENC8
-+ select REED_SOLOMON_DEC8
-+
-+if ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+
-+config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE
-+ int "Android RAM Console Data data size"
-+ default 128
-+ help
-+ Must be a power of 2.
-+
-+config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE
-+ int "Android RAM Console ECC size"
-+ default 16
-+
-+config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE
-+ int "Android RAM Console Symbol size"
-+ default 8
-+
-+config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL
-+ hex "Android RAM Console Polynomial"
-+ default 0x19 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 4)
-+ default 0x29 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 5)
-+ default 0x61 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 6)
-+ default 0x89 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 7)
-+ default 0x11d if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 8)
-+
-+endif # ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+
-+config ANDROID_RAM_CONSOLE_EARLY_INIT
-+ bool "Start Android RAM console early"
-+ default n
-+ depends on ANDROID_RAM_CONSOLE
-+
-+config ANDROID_RAM_CONSOLE_EARLY_ADDR
-+ hex "Android RAM console virtual address"
-+ default 0
-+ depends on ANDROID_RAM_CONSOLE_EARLY_INIT
-+
-+config ANDROID_RAM_CONSOLE_EARLY_SIZE
-+ hex "Android RAM console buffer size"
-+ default 0
-+ depends on ANDROID_RAM_CONSOLE_EARLY_INIT
-+
-+config ANDROID_TIMED_OUTPUT
-+ bool "Timed output class driver"
-+ default y
-+
-+config ANDROID_TIMED_GPIO
-+ tristate "Android timed gpio driver"
-+ depends on GENERIC_GPIO && ANDROID_TIMED_OUTPUT
-+ default n
-+
-+config ANDROID_LOW_MEMORY_KILLER
-+ bool "Android Low Memory Killer"
-+ default N
-+ ---help---
-+ Register processes to be killed when memory is low
-+
-+endif # if ANDROID
-+
-+endmenu
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-new file mode 100644
-index 0000000..8e057e6
---- /dev/null
-+++ b/drivers/staging/android/Makefile
-@@ -0,0 +1,6 @@
-+obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o
-+obj-$(CONFIG_ANDROID_LOGGER) += logger.o
-+obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
-+obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
-+obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
-+obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
-diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO
-new file mode 100644
-index 0000000..e59c5be
---- /dev/null
-+++ b/drivers/staging/android/TODO
-@@ -0,0 +1,10 @@
-+TODO:
-+ - checkpatch.pl cleanups
-+ - sparse fixes
-+ - rename files to be not so "generic"
-+ - make sure things build as modules properly
-+ - add proper arch dependancies as needed
-+ - audit userspace interfaces to make sure they are sane
-+
-+Please send patches to Greg Kroah-Hartman <greg@kroah.com> and Cc:
-+Brian Swetland <swetland@google.com>
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-new file mode 100644
-index 0000000..99010d4
---- /dev/null
-+++ b/drivers/staging/android/binder.c
-@@ -0,0 +1,3767 @@
-+/* binder.c
-+ *
-+ * Android IPC Subsystem
-+ *
-+ * Copyright (C) 2007-2008 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <asm/cacheflush.h>
-+#include <linux/fdtable.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+#include <linux/list.h>
-+#include <linux/miscdevice.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/mutex.h>
-+#include <linux/nsproxy.h>
-+#include <linux/poll.h>
-+#include <linux/proc_fs.h>
-+#include <linux/rbtree.h>
-+#include <linux/sched.h>
-+#include <linux/uaccess.h>
-+#include <linux/vmalloc.h>
-+
-+#include "binder.h"
-+
-+static DEFINE_MUTEX(binder_lock);
-+static DEFINE_MUTEX(binder_deferred_lock);
-+
-+static HLIST_HEAD(binder_procs);
-+static HLIST_HEAD(binder_deferred_list);
-+static HLIST_HEAD(binder_dead_nodes);
-+
-+static struct proc_dir_entry *binder_proc_dir_entry_root;
-+static struct proc_dir_entry *binder_proc_dir_entry_proc;
-+static struct binder_node *binder_context_mgr_node;
-+static uid_t binder_context_mgr_uid = -1;
-+static int binder_last_id;
-+
-+static int binder_read_proc_proc(char *page, char **start, off_t off,
-+ int count, int *eof, void *data);
-+
-+/* This is only defined in include/asm-arm/sizes.h */
-+#ifndef SZ_1K
-+#define SZ_1K 0x400
-+#endif
-+
-+#ifndef SZ_4M
-+#define SZ_4M 0x400000
-+#endif
-+
-+#define FORBIDDEN_MMAP_FLAGS (VM_WRITE)
-+
-+#define BINDER_SMALL_BUF_SIZE (PAGE_SIZE * 64)
-+
-+enum {
-+ BINDER_DEBUG_USER_ERROR = 1U << 0,
-+ BINDER_DEBUG_FAILED_TRANSACTION = 1U << 1,
-+ BINDER_DEBUG_DEAD_TRANSACTION = 1U << 2,
-+ BINDER_DEBUG_OPEN_CLOSE = 1U << 3,
-+ BINDER_DEBUG_DEAD_BINDER = 1U << 4,
-+ BINDER_DEBUG_DEATH_NOTIFICATION = 1U << 5,
-+ BINDER_DEBUG_READ_WRITE = 1U << 6,
-+ BINDER_DEBUG_USER_REFS = 1U << 7,
-+ BINDER_DEBUG_THREADS = 1U << 8,
-+ BINDER_DEBUG_TRANSACTION = 1U << 9,
-+ BINDER_DEBUG_TRANSACTION_COMPLETE = 1U << 10,
-+ BINDER_DEBUG_FREE_BUFFER = 1U << 11,
-+ BINDER_DEBUG_INTERNAL_REFS = 1U << 12,
-+ BINDER_DEBUG_BUFFER_ALLOC = 1U << 13,
-+ BINDER_DEBUG_PRIORITY_CAP = 1U << 14,
-+ BINDER_DEBUG_BUFFER_ALLOC_ASYNC = 1U << 15,
-+};
-+static uint32_t binder_debug_mask = BINDER_DEBUG_USER_ERROR |
-+ BINDER_DEBUG_FAILED_TRANSACTION | BINDER_DEBUG_DEAD_TRANSACTION;
-+module_param_named(debug_mask, binder_debug_mask, uint, S_IWUSR | S_IRUGO);
-+
-+static int binder_debug_no_lock;
-+module_param_named(proc_no_lock, binder_debug_no_lock, bool, S_IWUSR | S_IRUGO);
-+
-+static DECLARE_WAIT_QUEUE_HEAD(binder_user_error_wait);
-+static int binder_stop_on_user_error;
-+
-+static int binder_set_stop_on_user_error(const char *val,
-+ struct kernel_param *kp)
-+{
-+ int ret;
-+ ret = param_set_int(val, kp);
-+ if (binder_stop_on_user_error < 2)
-+ wake_up(&binder_user_error_wait);
-+ return ret;
-+}
-+module_param_call(stop_on_user_error, binder_set_stop_on_user_error,
-+ param_get_int, &binder_stop_on_user_error, S_IWUSR | S_IRUGO);
-+
-+#define binder_debug(mask, x...) \
-+ do { \
-+ if (binder_debug_mask & mask) \
-+ printk(KERN_INFO x); \
-+ } while (0)
-+
-+#define binder_user_error(x...) \
-+ do { \
-+ if (binder_debug_mask & BINDER_DEBUG_USER_ERROR) \
-+ printk(KERN_INFO x); \
-+ if (binder_stop_on_user_error) \
-+ binder_stop_on_user_error = 2; \
-+ } while (0)
-+
-+enum binder_stat_types {
-+ BINDER_STAT_PROC,
-+ BINDER_STAT_THREAD,
-+ BINDER_STAT_NODE,
-+ BINDER_STAT_REF,
-+ BINDER_STAT_DEATH,
-+ BINDER_STAT_TRANSACTION,
-+ BINDER_STAT_TRANSACTION_COMPLETE,
-+ BINDER_STAT_COUNT
-+};
-+
-+struct binder_stats {
-+ int br[_IOC_NR(BR_FAILED_REPLY) + 1];
-+ int bc[_IOC_NR(BC_DEAD_BINDER_DONE) + 1];
-+ int obj_created[BINDER_STAT_COUNT];
-+ int obj_deleted[BINDER_STAT_COUNT];
-+};
-+
-+static struct binder_stats binder_stats;
-+
-+static inline void binder_stats_deleted(enum binder_stat_types type)
-+{
-+ binder_stats.obj_deleted[type]++;
-+}
-+
-+static inline void binder_stats_created(enum binder_stat_types type)
-+{
-+ binder_stats.obj_created[type]++;
-+}
-+
-+struct binder_transaction_log_entry {
-+ int debug_id;
-+ int call_type;
-+ int from_proc;
-+ int from_thread;
-+ int target_handle;
-+ int to_proc;
-+ int to_thread;
-+ int to_node;
-+ int data_size;
-+ int offsets_size;
-+};
-+struct binder_transaction_log {
-+ int next;
-+ int full;
-+ struct binder_transaction_log_entry entry[32];
-+};
-+static struct binder_transaction_log binder_transaction_log;
-+static struct binder_transaction_log binder_transaction_log_failed;
-+
-+static struct binder_transaction_log_entry *binder_transaction_log_add(
-+ struct binder_transaction_log *log)
-+{
-+ struct binder_transaction_log_entry *e;
-+ e = &log->entry[log->next];
-+ memset(e, 0, sizeof(*e));
-+ log->next++;
-+ if (log->next == ARRAY_SIZE(log->entry)) {
-+ log->next = 0;
-+ log->full = 1;
-+ }
-+ return e;
-+}
-+
-+struct binder_work {
-+ struct list_head entry;
-+ enum {
-+ BINDER_WORK_TRANSACTION = 1,
-+ BINDER_WORK_TRANSACTION_COMPLETE,
-+ BINDER_WORK_NODE,
-+ BINDER_WORK_DEAD_BINDER,
-+ BINDER_WORK_DEAD_BINDER_AND_CLEAR,
-+ BINDER_WORK_CLEAR_DEATH_NOTIFICATION,
-+ } type;
-+};
-+
-+struct binder_node {
-+ int debug_id;
-+ struct binder_work work;
-+ union {
-+ struct rb_node rb_node;
-+ struct hlist_node dead_node;
-+ };
-+ struct binder_proc *proc;
-+ struct hlist_head refs;
-+ int internal_strong_refs;
-+ int local_weak_refs;
-+ int local_strong_refs;
-+ void __user *ptr;
-+ void __user *cookie;
-+ unsigned has_strong_ref:1;
-+ unsigned pending_strong_ref:1;
-+ unsigned has_weak_ref:1;
-+ unsigned pending_weak_ref:1;
-+ unsigned has_async_transaction:1;
-+ unsigned accept_fds:1;
-+ unsigned min_priority:8;
-+ struct list_head async_todo;
-+};
-+
-+struct binder_ref_death {
-+ struct binder_work work;
-+ void __user *cookie;
-+};
-+
-+struct binder_ref {
-+ /* Lookups needed: */
-+ /* node + proc => ref (transaction) */
-+ /* desc + proc => ref (transaction, inc/dec ref) */
-+ /* node => refs + procs (proc exit) */
-+ int debug_id;
-+ struct rb_node rb_node_desc;
-+ struct rb_node rb_node_node;
-+ struct hlist_node node_entry;
-+ struct binder_proc *proc;
-+ struct binder_node *node;
-+ uint32_t desc;
-+ int strong;
-+ int weak;
-+ struct binder_ref_death *death;
-+};
-+
-+struct binder_buffer {
-+ struct list_head entry; /* free and allocated entries by addesss */
-+ struct rb_node rb_node; /* free entry by size or allocated entry */
-+ /* by address */
-+ unsigned free:1;
-+ unsigned allow_user_free:1;
-+ unsigned async_transaction:1;
-+ unsigned debug_id:29;
-+
-+ struct binder_transaction *transaction;
-+
-+ struct binder_node *target_node;
-+ size_t data_size;
-+ size_t offsets_size;
-+ uint8_t data[0];
-+};
-+
-+enum binder_deferred_state {
-+ BINDER_DEFERRED_PUT_FILES = 0x01,
-+ BINDER_DEFERRED_FLUSH = 0x02,
-+ BINDER_DEFERRED_RELEASE = 0x04,
-+};
-+
-+struct binder_proc {
-+ struct hlist_node proc_node;
-+ struct rb_root threads;
-+ struct rb_root nodes;
-+ struct rb_root refs_by_desc;
-+ struct rb_root refs_by_node;
-+ int pid;
-+ struct vm_area_struct *vma;
-+ struct task_struct *tsk;
-+ struct files_struct *files;
-+ struct hlist_node deferred_work_node;
-+ int deferred_work;
-+ void *buffer;
-+ ptrdiff_t user_buffer_offset;
-+
-+ struct list_head buffers;
-+ struct rb_root free_buffers;
-+ struct rb_root allocated_buffers;
-+ size_t free_async_space;
-+
-+ struct page **pages;
-+ size_t buffer_size;
-+ uint32_t buffer_free;
-+ struct list_head todo;
-+ wait_queue_head_t wait;
-+ struct binder_stats stats;
-+ struct list_head delivered_death;
-+ int max_threads;
-+ int requested_threads;
-+ int requested_threads_started;
-+ int ready_threads;
-+ long default_priority;
-+};
-+
-+enum {
-+ BINDER_LOOPER_STATE_REGISTERED = 0x01,
-+ BINDER_LOOPER_STATE_ENTERED = 0x02,
-+ BINDER_LOOPER_STATE_EXITED = 0x04,
-+ BINDER_LOOPER_STATE_INVALID = 0x08,
-+ BINDER_LOOPER_STATE_WAITING = 0x10,
-+ BINDER_LOOPER_STATE_NEED_RETURN = 0x20
-+};
-+
-+struct binder_thread {
-+ struct binder_proc *proc;
-+ struct rb_node rb_node;
-+ int pid;
-+ int looper;
-+ struct binder_transaction *transaction_stack;
-+ struct list_head todo;
-+ uint32_t return_error; /* Write failed, return error code in read buf */
-+ uint32_t return_error2; /* Write failed, return error code in read */
-+ /* buffer. Used when sending a reply to a dead process that */
-+ /* we are also waiting on */
-+ wait_queue_head_t wait;
-+ struct binder_stats stats;
-+};
-+
-+struct binder_transaction {
-+ int debug_id;
-+ struct binder_work work;
-+ struct binder_thread *from;
-+ struct binder_transaction *from_parent;
-+ struct binder_proc *to_proc;
-+ struct binder_thread *to_thread;
-+ struct binder_transaction *to_parent;
-+ unsigned need_reply:1;
-+ /* unsigned is_dead:1; */ /* not used at the moment */
-+
-+ struct binder_buffer *buffer;
-+ unsigned int code;
-+ unsigned int flags;
-+ long priority;
-+ long saved_priority;
-+ uid_t sender_euid;
-+};
-+
-+static void
-+binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
-+
-+/*
-+ * copied from get_unused_fd_flags
-+ */
-+int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
-+{
-+ struct files_struct *files = proc->files;
-+ int fd, error;
-+ struct fdtable *fdt;
-+ unsigned long rlim_cur;
-+ unsigned long irqs;
-+
-+ if (files == NULL)
-+ return -ESRCH;
-+
-+ error = -EMFILE;
-+ spin_lock(&files->file_lock);
-+
-+repeat:
-+ fdt = files_fdtable(files);
-+ fd = find_next_zero_bit(fdt->open_fds->fds_bits, fdt->max_fds,
-+ files->next_fd);
-+
-+ /*
-+ * N.B. For clone tasks sharing a files structure, this test
-+ * will limit the total number of files that can be opened.
-+ */
-+ rlim_cur = 0;
-+ if (lock_task_sighand(proc->tsk, &irqs)) {
-+ rlim_cur = proc->tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur;
-+ unlock_task_sighand(proc->tsk, &irqs);
-+ }
-+ if (fd >= rlim_cur)
-+ goto out;
-+
-+ /* Do we need to expand the fd array or fd set? */
-+ error = expand_files(files, fd);
-+ if (error < 0)
-+ goto out;
-+
-+ if (error) {
-+ /*
-+ * If we needed to expand the fs array we
-+ * might have blocked - try again.
-+ */
-+ error = -EMFILE;
-+ goto repeat;
-+ }
-+
-+ FD_SET(fd, fdt->open_fds);
-+ if (flags & O_CLOEXEC)
-+ FD_SET(fd, fdt->close_on_exec);
-+ else
-+ FD_CLR(fd, fdt->close_on_exec);
-+ files->next_fd = fd + 1;
-+#if 1
-+ /* Sanity check */
-+ if (fdt->fd[fd] != NULL) {
-+ printk(KERN_WARNING "get_unused_fd: slot %d not NULL!\n", fd);
-+ fdt->fd[fd] = NULL;
-+ }
-+#endif
-+ error = fd;
-+
-+out:
-+ spin_unlock(&files->file_lock);
-+ return error;
-+}
-+
-+/*
-+ * copied from fd_install
-+ */
-+static void task_fd_install(
-+ struct binder_proc *proc, unsigned int fd, struct file *file)
-+{
-+ struct files_struct *files = proc->files;
-+ struct fdtable *fdt;
-+
-+ if (files == NULL)
-+ return;
-+
-+ spin_lock(&files->file_lock);
-+ fdt = files_fdtable(files);
-+ BUG_ON(fdt->fd[fd] != NULL);
-+ rcu_assign_pointer(fdt->fd[fd], file);
-+ spin_unlock(&files->file_lock);
-+}
-+
-+/*
-+ * copied from __put_unused_fd in open.c
-+ */
-+static void __put_unused_fd(struct files_struct *files, unsigned int fd)
-+{
-+ struct fdtable *fdt = files_fdtable(files);
-+ __FD_CLR(fd, fdt->open_fds);
-+ if (fd < files->next_fd)
-+ files->next_fd = fd;
-+}
-+
-+/*
-+ * copied from sys_close
-+ */
-+static long task_close_fd(struct binder_proc *proc, unsigned int fd)
-+{
-+ struct file *filp;
-+ struct files_struct *files = proc->files;
-+ struct fdtable *fdt;
-+ int retval;
-+
-+ if (files == NULL)
-+ return -ESRCH;
-+
-+ spin_lock(&files->file_lock);
-+ fdt = files_fdtable(files);
-+ if (fd >= fdt->max_fds)
-+ goto out_unlock;
-+ filp = fdt->fd[fd];
-+ if (!filp)
-+ goto out_unlock;
-+ rcu_assign_pointer(fdt->fd[fd], NULL);
-+ FD_CLR(fd, fdt->close_on_exec);
-+ __put_unused_fd(files, fd);
-+ spin_unlock(&files->file_lock);
-+ retval = filp_close(filp, files);
-+
-+ /* can't restart close syscall because file table entry was cleared */
-+ if (unlikely(retval == -ERESTARTSYS ||
-+ retval == -ERESTARTNOINTR ||
-+ retval == -ERESTARTNOHAND ||
-+ retval == -ERESTART_RESTARTBLOCK))
-+ retval = -EINTR;
-+
-+ return retval;
-+
-+out_unlock:
-+ spin_unlock(&files->file_lock);
-+ return -EBADF;
-+}
-+
-+static void binder_set_nice(long nice)
-+{
-+ long min_nice;
-+ if (can_nice(current, nice)) {
-+ set_user_nice(current, nice);
-+ return;
-+ }
-+ min_nice = 20 - current->signal->rlim[RLIMIT_NICE].rlim_cur;
-+ binder_debug(BINDER_DEBUG_PRIORITY_CAP,
-+ "binder: %d: nice value %ld not allowed use "
-+ "%ld instead\n", current->pid, nice, min_nice);
-+ set_user_nice(current, min_nice);
-+ if (min_nice < 20)
-+ return;
-+ binder_user_error("binder: %d RLIMIT_NICE not set\n", current->pid);
-+}
-+
-+static size_t binder_buffer_size(struct binder_proc *proc,
-+ struct binder_buffer *buffer)
-+{
-+ if (list_is_last(&buffer->entry, &proc->buffers))
-+ return proc->buffer + proc->buffer_size - (void *)buffer->data;
-+ else
-+ return (size_t)list_entry(buffer->entry.next,
-+ struct binder_buffer, entry) - (size_t)buffer->data;
-+}
-+
-+static void binder_insert_free_buffer(struct binder_proc *proc,
-+ struct binder_buffer *new_buffer)
-+{
-+ struct rb_node **p = &proc->free_buffers.rb_node;
-+ struct rb_node *parent = NULL;
-+ struct binder_buffer *buffer;
-+ size_t buffer_size;
-+ size_t new_buffer_size;
-+
-+ BUG_ON(!new_buffer->free);
-+
-+ new_buffer_size = binder_buffer_size(proc, new_buffer);
-+
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: add free buffer, size %zd, "
-+ "at %p\n", proc->pid, new_buffer_size, new_buffer);
-+
-+ while (*p) {
-+ parent = *p;
-+ buffer = rb_entry(parent, struct binder_buffer, rb_node);
-+ BUG_ON(!buffer->free);
-+
-+ buffer_size = binder_buffer_size(proc, buffer);
-+
-+ if (new_buffer_size < buffer_size)
-+ p = &parent->rb_left;
-+ else
-+ p = &parent->rb_right;
-+ }
-+ rb_link_node(&new_buffer->rb_node, parent, p);
-+ rb_insert_color(&new_buffer->rb_node, &proc->free_buffers);
-+}
-+
-+static void binder_insert_allocated_buffer(struct binder_proc *proc,
-+ struct binder_buffer *new_buffer)
-+{
-+ struct rb_node **p = &proc->allocated_buffers.rb_node;
-+ struct rb_node *parent = NULL;
-+ struct binder_buffer *buffer;
-+
-+ BUG_ON(new_buffer->free);
-+
-+ while (*p) {
-+ parent = *p;
-+ buffer = rb_entry(parent, struct binder_buffer, rb_node);
-+ BUG_ON(buffer->free);
-+
-+ if (new_buffer < buffer)
-+ p = &parent->rb_left;
-+ else if (new_buffer > buffer)
-+ p = &parent->rb_right;
-+ else
-+ BUG();
-+ }
-+ rb_link_node(&new_buffer->rb_node, parent, p);
-+ rb_insert_color(&new_buffer->rb_node, &proc->allocated_buffers);
-+}
-+
-+static struct binder_buffer *binder_buffer_lookup(struct binder_proc *proc,
-+ void __user *user_ptr)
-+{
-+ struct rb_node *n = proc->allocated_buffers.rb_node;
-+ struct binder_buffer *buffer;
-+ struct binder_buffer *kern_ptr;
-+
-+ kern_ptr = user_ptr - proc->user_buffer_offset
-+ - offsetof(struct binder_buffer, data);
-+
-+ while (n) {
-+ buffer = rb_entry(n, struct binder_buffer, rb_node);
-+ BUG_ON(buffer->free);
-+
-+ if (kern_ptr < buffer)
-+ n = n->rb_left;
-+ else if (kern_ptr > buffer)
-+ n = n->rb_right;
-+ else
-+ return buffer;
-+ }
-+ return NULL;
-+}
-+
-+static int binder_update_page_range(struct binder_proc *proc, int allocate,
-+ void *start, void *end,
-+ struct vm_area_struct *vma)
-+{
-+ void *page_addr;
-+ unsigned long user_page_addr;
-+ struct vm_struct tmp_area;
-+ struct page **page;
-+ struct mm_struct *mm;
-+
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: %s pages %p-%p\n", proc->pid,
-+ allocate ? "allocate" : "free", start, end);
-+
-+ if (end <= start)
-+ return 0;
-+
-+ if (vma)
-+ mm = NULL;
-+ else
-+ mm = get_task_mm(proc->tsk);
-+
-+ if (mm) {
-+ down_write(&mm->mmap_sem);
-+ vma = proc->vma;
-+ }
-+
-+ if (allocate == 0)
-+ goto free_range;
-+
-+ if (vma == NULL) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf failed to "
-+ "map pages in userspace, no vma\n", proc->pid);
-+ goto err_no_vma;
-+ }
-+
-+ for (page_addr = start; page_addr < end; page_addr += PAGE_SIZE) {
-+ int ret;
-+ struct page **page_array_ptr;
-+ page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE];
-+
-+ BUG_ON(*page);
-+ *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
-+ if (*page == NULL) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
-+ "for page at %p\n", proc->pid, page_addr);
-+ goto err_alloc_page_failed;
-+ }
-+ tmp_area.addr = page_addr;
-+ tmp_area.size = PAGE_SIZE + PAGE_SIZE /* guard page? */;
-+ page_array_ptr = page;
-+ ret = map_vm_area(&tmp_area, PAGE_KERNEL, &page_array_ptr);
-+ if (ret) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
-+ "to map page at %p in kernel\n",
-+ proc->pid, page_addr);
-+ goto err_map_kernel_failed;
-+ }
-+ user_page_addr =
-+ (uintptr_t)page_addr + proc->user_buffer_offset;
-+ ret = vm_insert_page(vma, user_page_addr, page[0]);
-+ if (ret) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
-+ "to map page at %lx in userspace\n",
-+ proc->pid, user_page_addr);
-+ goto err_vm_insert_page_failed;
-+ }
-+ /* vm_insert_page does not seem to increment the refcount */
-+ }
-+ if (mm) {
-+ up_write(&mm->mmap_sem);
-+ mmput(mm);
-+ }
-+ return 0;
-+
-+free_range:
-+ for (page_addr = end - PAGE_SIZE; page_addr >= start;
-+ page_addr -= PAGE_SIZE) {
-+ page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE];
-+ if (vma)
-+ zap_page_range(vma, (uintptr_t)page_addr +
-+ proc->user_buffer_offset, PAGE_SIZE, NULL);
-+err_vm_insert_page_failed:
-+ unmap_kernel_range((unsigned long)page_addr, PAGE_SIZE);
-+err_map_kernel_failed:
-+ __free_page(*page);
-+ *page = NULL;
-+err_alloc_page_failed:
-+ ;
-+ }
-+err_no_vma:
-+ if (mm) {
-+ up_write(&mm->mmap_sem);
-+ mmput(mm);
-+ }
-+ return -ENOMEM;
-+}
-+
-+static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
-+ size_t data_size,
-+ size_t offsets_size, int is_async)
-+{
-+ struct rb_node *n = proc->free_buffers.rb_node;
-+ struct binder_buffer *buffer;
-+ size_t buffer_size;
-+ struct rb_node *best_fit = NULL;
-+ void *has_page_addr;
-+ void *end_page_addr;
-+ size_t size;
-+
-+ if (proc->vma == NULL) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf, no vma\n",
-+ proc->pid);
-+ return NULL;
-+ }
-+
-+ size = ALIGN(data_size, sizeof(void *)) +
-+ ALIGN(offsets_size, sizeof(void *));
-+
-+ if (size < data_size || size < offsets_size) {
-+ binder_user_error("binder: %d: got transaction with invalid "
-+ "size %zd-%zd\n", proc->pid, data_size, offsets_size);
-+ return NULL;
-+ }
-+
-+ if (is_async &&
-+ proc->free_async_space < size + sizeof(struct binder_buffer)) {
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: binder_alloc_buf size %zd"
-+ "failed, no async space left\n", proc->pid, size);
-+ return NULL;
-+ }
-+
-+ while (n) {
-+ buffer = rb_entry(n, struct binder_buffer, rb_node);
-+ BUG_ON(!buffer->free);
-+ buffer_size = binder_buffer_size(proc, buffer);
-+
-+ if (size < buffer_size) {
-+ best_fit = n;
-+ n = n->rb_left;
-+ } else if (size > buffer_size)
-+ n = n->rb_right;
-+ else {
-+ best_fit = n;
-+ break;
-+ }
-+ }
-+ if (best_fit == NULL) {
-+ printk(KERN_ERR "binder: %d: binder_alloc_buf size %zd failed, "
-+ "no address space\n", proc->pid, size);
-+ return NULL;
-+ }
-+ if (n == NULL) {
-+ buffer = rb_entry(best_fit, struct binder_buffer, rb_node);
-+ buffer_size = binder_buffer_size(proc, buffer);
-+ }
-+
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: binder_alloc_buf size %zd got buff"
-+ "er %p size %zd\n", proc->pid, size, buffer, buffer_size);
-+
-+ has_page_addr =
-+ (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK);
-+ if (n == NULL) {
-+ if (size + sizeof(struct binder_buffer) + 4 >= buffer_size)
-+ buffer_size = size; /* no room for other buffers */
-+ else
-+ buffer_size = size + sizeof(struct binder_buffer);
-+ }
-+ end_page_addr =
-+ (void *)PAGE_ALIGN((uintptr_t)buffer->data + buffer_size);
-+ if (end_page_addr > has_page_addr)
-+ end_page_addr = has_page_addr;
-+ if (binder_update_page_range(proc, 1,
-+ (void *)PAGE_ALIGN((uintptr_t)buffer->data), end_page_addr, NULL))
-+ return NULL;
-+
-+ rb_erase(best_fit, &proc->free_buffers);
-+ buffer->free = 0;
-+ binder_insert_allocated_buffer(proc, buffer);
-+ if (buffer_size != size) {
-+ struct binder_buffer *new_buffer = (void *)buffer->data + size;
-+ list_add(&new_buffer->entry, &buffer->entry);
-+ new_buffer->free = 1;
-+ binder_insert_free_buffer(proc, new_buffer);
-+ }
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: binder_alloc_buf size %zd got "
-+ "%p\n", proc->pid, size, buffer);
-+ buffer->data_size = data_size;
-+ buffer->offsets_size = offsets_size;
-+ buffer->async_transaction = is_async;
-+ if (is_async) {
-+ proc->free_async_space -= size + sizeof(struct binder_buffer);
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
-+ "binder: %d: binder_alloc_buf size %zd "
-+ "async free %zd\n", proc->pid, size,
-+ proc->free_async_space);
-+ }
-+
-+ return buffer;
-+}
-+
-+static void *buffer_start_page(struct binder_buffer *buffer)
-+{
-+ return (void *)((uintptr_t)buffer & PAGE_MASK);
-+}
-+
-+static void *buffer_end_page(struct binder_buffer *buffer)
-+{
-+ return (void *)(((uintptr_t)(buffer + 1) - 1) & PAGE_MASK);
-+}
-+
-+static void binder_delete_free_buffer(struct binder_proc *proc,
-+ struct binder_buffer *buffer)
-+{
-+ struct binder_buffer *prev, *next = NULL;
-+ int free_page_end = 1;
-+ int free_page_start = 1;
-+
-+ BUG_ON(proc->buffers.next == &buffer->entry);
-+ prev = list_entry(buffer->entry.prev, struct binder_buffer, entry);
-+ BUG_ON(!prev->free);
-+ if (buffer_end_page(prev) == buffer_start_page(buffer)) {
-+ free_page_start = 0;
-+ if (buffer_end_page(prev) == buffer_end_page(buffer))
-+ free_page_end = 0;
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: merge free, buffer %p "
-+ "share page with %p\n", proc->pid, buffer, prev);
-+ }
-+
-+ if (!list_is_last(&buffer->entry, &proc->buffers)) {
-+ next = list_entry(buffer->entry.next,
-+ struct binder_buffer, entry);
-+ if (buffer_start_page(next) == buffer_end_page(buffer)) {
-+ free_page_end = 0;
-+ if (buffer_start_page(next) ==
-+ buffer_start_page(buffer))
-+ free_page_start = 0;
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: merge free, buffer"
-+ " %p share page with %p\n", proc->pid,
-+ buffer, prev);
-+ }
-+ }
-+ list_del(&buffer->entry);
-+ if (free_page_start || free_page_end) {
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: merge free, buffer %p do "
-+ "not share page%s%s with with %p or %p\n",
-+ proc->pid, buffer, free_page_start ? "" : " end",
-+ free_page_end ? "" : " start", prev, next);
-+ binder_update_page_range(proc, 0, free_page_start ?
-+ buffer_start_page(buffer) : buffer_end_page(buffer),
-+ (free_page_end ? buffer_end_page(buffer) :
-+ buffer_start_page(buffer)) + PAGE_SIZE, NULL);
-+ }
-+}
-+
-+static void binder_free_buf(struct binder_proc *proc,
-+ struct binder_buffer *buffer)
-+{
-+ size_t size, buffer_size;
-+
-+ buffer_size = binder_buffer_size(proc, buffer);
-+
-+ size = ALIGN(buffer->data_size, sizeof(void *)) +
-+ ALIGN(buffer->offsets_size, sizeof(void *));
-+
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder: %d: binder_free_buf %p size %zd buffer"
-+ "_size %zd\n", proc->pid, buffer, size, buffer_size);
-+
-+ BUG_ON(buffer->free);
-+ BUG_ON(size > buffer_size);
-+ BUG_ON(buffer->transaction != NULL);
-+ BUG_ON((void *)buffer < proc->buffer);
-+ BUG_ON((void *)buffer > proc->buffer + proc->buffer_size);
-+
-+ if (buffer->async_transaction) {
-+ proc->free_async_space += size + sizeof(struct binder_buffer);
-+
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
-+ "binder: %d: binder_free_buf size %zd "
-+ "async free %zd\n", proc->pid, size,
-+ proc->free_async_space);
-+ }
-+
-+ binder_update_page_range(proc, 0,
-+ (void *)PAGE_ALIGN((uintptr_t)buffer->data),
-+ (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK),
-+ NULL);
-+ rb_erase(&buffer->rb_node, &proc->allocated_buffers);
-+ buffer->free = 1;
-+ if (!list_is_last(&buffer->entry, &proc->buffers)) {
-+ struct binder_buffer *next = list_entry(buffer->entry.next,
-+ struct binder_buffer, entry);
-+ if (next->free) {
-+ rb_erase(&next->rb_node, &proc->free_buffers);
-+ binder_delete_free_buffer(proc, next);
-+ }
-+ }
-+ if (proc->buffers.next != &buffer->entry) {
-+ struct binder_buffer *prev = list_entry(buffer->entry.prev,
-+ struct binder_buffer, entry);
-+ if (prev->free) {
-+ binder_delete_free_buffer(proc, buffer);
-+ rb_erase(&prev->rb_node, &proc->free_buffers);
-+ buffer = prev;
-+ }
-+ }
-+ binder_insert_free_buffer(proc, buffer);
-+}
-+
-+static struct binder_node *binder_get_node(struct binder_proc *proc,
-+ void __user *ptr)
-+{
-+ struct rb_node *n = proc->nodes.rb_node;
-+ struct binder_node *node;
-+
-+ while (n) {
-+ node = rb_entry(n, struct binder_node, rb_node);
-+
-+ if (ptr < node->ptr)
-+ n = n->rb_left;
-+ else if (ptr > node->ptr)
-+ n = n->rb_right;
-+ else
-+ return node;
-+ }
-+ return NULL;
-+}
-+
-+static struct binder_node *binder_new_node(struct binder_proc *proc,
-+ void __user *ptr,
-+ void __user *cookie)
-+{
-+ struct rb_node **p = &proc->nodes.rb_node;
-+ struct rb_node *parent = NULL;
-+ struct binder_node *node;
-+
-+ while (*p) {
-+ parent = *p;
-+ node = rb_entry(parent, struct binder_node, rb_node);
-+
-+ if (ptr < node->ptr)
-+ p = &(*p)->rb_left;
-+ else if (ptr > node->ptr)
-+ p = &(*p)->rb_right;
-+ else
-+ return NULL;
-+ }
-+
-+ node = kzalloc(sizeof(*node), GFP_KERNEL);
-+ if (node == NULL)
-+ return NULL;
-+ binder_stats_created(BINDER_STAT_NODE);
-+ rb_link_node(&node->rb_node, parent, p);
-+ rb_insert_color(&node->rb_node, &proc->nodes);
-+ node->debug_id = ++binder_last_id;
-+ node->proc = proc;
-+ node->ptr = ptr;
-+ node->cookie = cookie;
-+ node->work.type = BINDER_WORK_NODE;
-+ INIT_LIST_HEAD(&node->work.entry);
-+ INIT_LIST_HEAD(&node->async_todo);
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d:%d node %d u%p c%p created\n",
-+ proc->pid, current->pid, node->debug_id,
-+ node->ptr, node->cookie);
-+ return node;
-+}
-+
-+static int binder_inc_node(struct binder_node *node, int strong, int internal,
-+ struct list_head *target_list)
-+{
-+ if (strong) {
-+ if (internal) {
-+ if (target_list == NULL &&
-+ node->internal_strong_refs == 0 &&
-+ !(node == binder_context_mgr_node &&
-+ node->has_strong_ref)) {
-+ printk(KERN_ERR "binder: invalid inc strong "
-+ "node for %d\n", node->debug_id);
-+ return -EINVAL;
-+ }
-+ node->internal_strong_refs++;
-+ } else
-+ node->local_strong_refs++;
-+ if (!node->has_strong_ref && target_list) {
-+ list_del_init(&node->work.entry);
-+ list_add_tail(&node->work.entry, target_list);
-+ }
-+ } else {
-+ if (!internal)
-+ node->local_weak_refs++;
-+ if (!node->has_weak_ref && list_empty(&node->work.entry)) {
-+ if (target_list == NULL) {
-+ printk(KERN_ERR "binder: invalid inc weak node "
-+ "for %d\n", node->debug_id);
-+ return -EINVAL;
-+ }
-+ list_add_tail(&node->work.entry, target_list);
-+ }
-+ }
-+ return 0;
-+}
-+
-+static int binder_dec_node(struct binder_node *node, int strong, int internal)
-+{
-+ if (strong) {
-+ if (internal)
-+ node->internal_strong_refs--;
-+ else
-+ node->local_strong_refs--;
-+ if (node->local_strong_refs || node->internal_strong_refs)
-+ return 0;
-+ } else {
-+ if (!internal)
-+ node->local_weak_refs--;
-+ if (node->local_weak_refs || !hlist_empty(&node->refs))
-+ return 0;
-+ }
-+ if (node->proc && (node->has_strong_ref || node->has_weak_ref)) {
-+ if (list_empty(&node->work.entry)) {
-+ list_add_tail(&node->work.entry, &node->proc->todo);
-+ wake_up_interruptible(&node->proc->wait);
-+ }
-+ } else {
-+ if (hlist_empty(&node->refs) && !node->local_strong_refs &&
-+ !node->local_weak_refs) {
-+ list_del_init(&node->work.entry);
-+ if (node->proc) {
-+ rb_erase(&node->rb_node, &node->proc->nodes);
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: refless node %d deleted\n",
-+ node->debug_id);
-+ } else {
-+ hlist_del(&node->dead_node);
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: dead node %d deleted\n",
-+ node->debug_id);
-+ }
-+ kfree(node);
-+ binder_stats_deleted(BINDER_STAT_NODE);
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+
-+static struct binder_ref *binder_get_ref(struct binder_proc *proc,
-+ uint32_t desc)
-+{
-+ struct rb_node *n = proc->refs_by_desc.rb_node;
-+ struct binder_ref *ref;
-+
-+ while (n) {
-+ ref = rb_entry(n, struct binder_ref, rb_node_desc);
-+
-+ if (desc < ref->desc)
-+ n = n->rb_left;
-+ else if (desc > ref->desc)
-+ n = n->rb_right;
-+ else
-+ return ref;
-+ }
-+ return NULL;
-+}
-+
-+static struct binder_ref *binder_get_ref_for_node(struct binder_proc *proc,
-+ struct binder_node *node)
-+{
-+ struct rb_node *n;
-+ struct rb_node **p = &proc->refs_by_node.rb_node;
-+ struct rb_node *parent = NULL;
-+ struct binder_ref *ref, *new_ref;
-+
-+ while (*p) {
-+ parent = *p;
-+ ref = rb_entry(parent, struct binder_ref, rb_node_node);
-+
-+ if (node < ref->node)
-+ p = &(*p)->rb_left;
-+ else if (node > ref->node)
-+ p = &(*p)->rb_right;
-+ else
-+ return ref;
-+ }
-+ new_ref = kzalloc(sizeof(*ref), GFP_KERNEL);
-+ if (new_ref == NULL)
-+ return NULL;
-+ binder_stats_created(BINDER_STAT_REF);
-+ new_ref->debug_id = ++binder_last_id;
-+ new_ref->proc = proc;
-+ new_ref->node = node;
-+ rb_link_node(&new_ref->rb_node_node, parent, p);
-+ rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node);
-+
-+ new_ref->desc = (node == binder_context_mgr_node) ? 0 : 1;
-+ for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) {
-+ ref = rb_entry(n, struct binder_ref, rb_node_desc);
-+ if (ref->desc > new_ref->desc)
-+ break;
-+ new_ref->desc = ref->desc + 1;
-+ }
-+
-+ p = &proc->refs_by_desc.rb_node;
-+ while (*p) {
-+ parent = *p;
-+ ref = rb_entry(parent, struct binder_ref, rb_node_desc);
-+
-+ if (new_ref->desc < ref->desc)
-+ p = &(*p)->rb_left;
-+ else if (new_ref->desc > ref->desc)
-+ p = &(*p)->rb_right;
-+ else
-+ BUG();
-+ }
-+ rb_link_node(&new_ref->rb_node_desc, parent, p);
-+ rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc);
-+ if (node) {
-+ hlist_add_head(&new_ref->node_entry, &node->refs);
-+
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d new ref %d desc %d for "
-+ "node %d\n", proc->pid, new_ref->debug_id,
-+ new_ref->desc, node->debug_id);
-+ } else {
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d new ref %d desc %d for "
-+ "dead node\n", proc->pid, new_ref->debug_id,
-+ new_ref->desc);
-+ }
-+ return new_ref;
-+}
-+
-+static void binder_delete_ref(struct binder_ref *ref)
-+{
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d delete ref %d desc %d for "
-+ "node %d\n", ref->proc->pid, ref->debug_id,
-+ ref->desc, ref->node->debug_id);
-+
-+ rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc);
-+ rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node);
-+ if (ref->strong)
-+ binder_dec_node(ref->node, 1, 1);
-+ hlist_del(&ref->node_entry);
-+ binder_dec_node(ref->node, 0, 1);
-+ if (ref->death) {
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder: %d delete ref %d desc %d "
-+ "has death notification\n", ref->proc->pid,
-+ ref->debug_id, ref->desc);
-+ list_del(&ref->death->work.entry);
-+ kfree(ref->death);
-+ binder_stats_deleted(BINDER_STAT_DEATH);
-+ }
-+ kfree(ref);
-+ binder_stats_deleted(BINDER_STAT_REF);
-+}
-+
-+static int binder_inc_ref(struct binder_ref *ref, int strong,
-+ struct list_head *target_list)
-+{
-+ int ret;
-+ if (strong) {
-+ if (ref->strong == 0) {
-+ ret = binder_inc_node(ref->node, 1, 1, target_list);
-+ if (ret)
-+ return ret;
-+ }
-+ ref->strong++;
-+ } else {
-+ if (ref->weak == 0) {
-+ ret = binder_inc_node(ref->node, 0, 1, target_list);
-+ if (ret)
-+ return ret;
-+ }
-+ ref->weak++;
-+ }
-+ return 0;
-+}
-+
-+
-+static int binder_dec_ref(struct binder_ref *ref, int strong)
-+{
-+ if (strong) {
-+ if (ref->strong == 0) {
-+ binder_user_error("binder: %d invalid dec strong, "
-+ "ref %d desc %d s %d w %d\n",
-+ ref->proc->pid, ref->debug_id,
-+ ref->desc, ref->strong, ref->weak);
-+ return -EINVAL;
-+ }
-+ ref->strong--;
-+ if (ref->strong == 0) {
-+ int ret;
-+ ret = binder_dec_node(ref->node, strong, 1);
-+ if (ret)
-+ return ret;
-+ }
-+ } else {
-+ if (ref->weak == 0) {
-+ binder_user_error("binder: %d invalid dec weak, "
-+ "ref %d desc %d s %d w %d\n",
-+ ref->proc->pid, ref->debug_id,
-+ ref->desc, ref->strong, ref->weak);
-+ return -EINVAL;
-+ }
-+ ref->weak--;
-+ }
-+ if (ref->strong == 0 && ref->weak == 0)
-+ binder_delete_ref(ref);
-+ return 0;
-+}
-+
-+static void binder_pop_transaction(struct binder_thread *target_thread,
-+ struct binder_transaction *t)
-+{
-+ if (target_thread) {
-+ BUG_ON(target_thread->transaction_stack != t);
-+ BUG_ON(target_thread->transaction_stack->from != target_thread);
-+ target_thread->transaction_stack =
-+ target_thread->transaction_stack->from_parent;
-+ t->from = NULL;
-+ }
-+ t->need_reply = 0;
-+ if (t->buffer)
-+ t->buffer->transaction = NULL;
-+ kfree(t);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION);
-+}
-+
-+static void binder_send_failed_reply(struct binder_transaction *t,
-+ uint32_t error_code)
-+{
-+ struct binder_thread *target_thread;
-+ BUG_ON(t->flags & TF_ONE_WAY);
-+ while (1) {
-+ target_thread = t->from;
-+ if (target_thread) {
-+ if (target_thread->return_error != BR_OK &&
-+ target_thread->return_error2 == BR_OK) {
-+ target_thread->return_error2 =
-+ target_thread->return_error;
-+ target_thread->return_error = BR_OK;
-+ }
-+ if (target_thread->return_error == BR_OK) {
-+ binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-+ "binder: send failed reply for "
-+ "transaction %d to %d:%d\n",
-+ t->debug_id, target_thread->proc->pid,
-+ target_thread->pid);
-+
-+ binder_pop_transaction(target_thread, t);
-+ target_thread->return_error = error_code;
-+ wake_up_interruptible(&target_thread->wait);
-+ } else {
-+ printk(KERN_ERR "binder: reply failed, target "
-+ "thread, %d:%d, has error code %d "
-+ "already\n", target_thread->proc->pid,
-+ target_thread->pid,
-+ target_thread->return_error);
-+ }
-+ return;
-+ } else {
-+ struct binder_transaction *next = t->from_parent;
-+
-+ binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-+ "binder: send failed reply "
-+ "for transaction %d, target dead\n",
-+ t->debug_id);
-+
-+ binder_pop_transaction(target_thread, t);
-+ if (next == NULL) {
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder: reply failed,"
-+ " no target thread at root\n");
-+ return;
-+ }
-+ t = next;
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder: reply failed, no target "
-+ "thread -- retry %d\n", t->debug_id);
-+ }
-+ }
-+}
-+
-+static void binder_transaction_buffer_release(struct binder_proc *proc,
-+ struct binder_buffer *buffer,
-+ size_t *failed_at)
-+{
-+ size_t *offp, *off_end;
-+ int debug_id = buffer->debug_id;
-+
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ "binder: %d buffer release %d, size %zd-%zd, failed at %p\n",
-+ proc->pid, buffer->debug_id,
-+ buffer->data_size, buffer->offsets_size, failed_at);
-+
-+ if (buffer->target_node)
-+ binder_dec_node(buffer->target_node, 1, 0);
-+
-+ offp = (size_t *)(buffer->data + ALIGN(buffer->data_size, sizeof(void *)));
-+ if (failed_at)
-+ off_end = failed_at;
-+ else
-+ off_end = (void *)offp + buffer->offsets_size;
-+ for (; offp < off_end; offp++) {
-+ struct flat_binder_object *fp;
-+ if (*offp > buffer->data_size - sizeof(*fp) ||
-+ buffer->data_size < sizeof(*fp) ||
-+ !IS_ALIGNED(*offp, sizeof(void *))) {
-+ printk(KERN_ERR "binder: transaction release %d bad"
-+ "offset %zd, size %zd\n", debug_id,
-+ *offp, buffer->data_size);
-+ continue;
-+ }
-+ fp = (struct flat_binder_object *)(buffer->data + *offp);
-+ switch (fp->type) {
-+ case BINDER_TYPE_BINDER:
-+ case BINDER_TYPE_WEAK_BINDER: {
-+ struct binder_node *node = binder_get_node(proc, fp->binder);
-+ if (node == NULL) {
-+ printk(KERN_ERR "binder: transaction release %d"
-+ " bad node %p\n", debug_id, fp->binder);
-+ break;
-+ }
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " node %d u%p\n",
-+ node->debug_id, node->ptr);
-+ binder_dec_node(node, fp->type == BINDER_TYPE_BINDER, 0);
-+ } break;
-+ case BINDER_TYPE_HANDLE:
-+ case BINDER_TYPE_WEAK_HANDLE: {
-+ struct binder_ref *ref = binder_get_ref(proc, fp->handle);
-+ if (ref == NULL) {
-+ printk(KERN_ERR "binder: transaction release %d"
-+ " bad handle %ld\n", debug_id,
-+ fp->handle);
-+ break;
-+ }
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " ref %d desc %d (node %d)\n",
-+ ref->debug_id, ref->desc, ref->node->debug_id);
-+ binder_dec_ref(ref, fp->type == BINDER_TYPE_HANDLE);
-+ } break;
-+
-+ case BINDER_TYPE_FD:
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " fd %ld\n", fp->handle);
-+ if (failed_at)
-+ task_close_fd(proc, fp->handle);
-+ break;
-+
-+ default:
-+ printk(KERN_ERR "binder: transaction release %d bad "
-+ "object type %lx\n", debug_id, fp->type);
-+ break;
-+ }
-+ }
-+}
-+
-+static void binder_transaction(struct binder_proc *proc,
-+ struct binder_thread *thread,
-+ struct binder_transaction_data *tr, int reply)
-+{
-+ struct binder_transaction *t;
-+ struct binder_work *tcomplete;
-+ size_t *offp, *off_end;
-+ struct binder_proc *target_proc;
-+ struct binder_thread *target_thread = NULL;
-+ struct binder_node *target_node = NULL;
-+ struct list_head *target_list;
-+ wait_queue_head_t *target_wait;
-+ struct binder_transaction *in_reply_to = NULL;
-+ struct binder_transaction_log_entry *e;
-+ uint32_t return_error;
-+
-+ e = binder_transaction_log_add(&binder_transaction_log);
-+ e->call_type = reply ? 2 : !!(tr->flags & TF_ONE_WAY);
-+ e->from_proc = proc->pid;
-+ e->from_thread = thread->pid;
-+ e->target_handle = tr->target.handle;
-+ e->data_size = tr->data_size;
-+ e->offsets_size = tr->offsets_size;
-+
-+ if (reply) {
-+ in_reply_to = thread->transaction_stack;
-+ if (in_reply_to == NULL) {
-+ binder_user_error("binder: %d:%d got reply transaction "
-+ "with no transaction stack\n",
-+ proc->pid, thread->pid);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_empty_call_stack;
-+ }
-+ binder_set_nice(in_reply_to->saved_priority);
-+ if (in_reply_to->to_thread != thread) {
-+ binder_user_error("binder: %d:%d got reply transaction "
-+ "with bad transaction stack,"
-+ " transaction %d has target %d:%d\n",
-+ proc->pid, thread->pid, in_reply_to->debug_id,
-+ in_reply_to->to_proc ?
-+ in_reply_to->to_proc->pid : 0,
-+ in_reply_to->to_thread ?
-+ in_reply_to->to_thread->pid : 0);
-+ return_error = BR_FAILED_REPLY;
-+ in_reply_to = NULL;
-+ goto err_bad_call_stack;
-+ }
-+ thread->transaction_stack = in_reply_to->to_parent;
-+ target_thread = in_reply_to->from;
-+ if (target_thread == NULL) {
-+ return_error = BR_DEAD_REPLY;
-+ goto err_dead_binder;
-+ }
-+ if (target_thread->transaction_stack != in_reply_to) {
-+ binder_user_error("binder: %d:%d got reply transaction "
-+ "with bad target transaction stack %d, "
-+ "expected %d\n",
-+ proc->pid, thread->pid,
-+ target_thread->transaction_stack ?
-+ target_thread->transaction_stack->debug_id : 0,
-+ in_reply_to->debug_id);
-+ return_error = BR_FAILED_REPLY;
-+ in_reply_to = NULL;
-+ target_thread = NULL;
-+ goto err_dead_binder;
-+ }
-+ target_proc = target_thread->proc;
-+ } else {
-+ if (tr->target.handle) {
-+ struct binder_ref *ref;
-+ ref = binder_get_ref(proc, tr->target.handle);
-+ if (ref == NULL) {
-+ binder_user_error("binder: %d:%d got "
-+ "transaction to invalid handle\n",
-+ proc->pid, thread->pid);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_invalid_target_handle;
-+ }
-+ target_node = ref->node;
-+ } else {
-+ target_node = binder_context_mgr_node;
-+ if (target_node == NULL) {
-+ return_error = BR_DEAD_REPLY;
-+ goto err_no_context_mgr_node;
-+ }
-+ }
-+ e->to_node = target_node->debug_id;
-+ target_proc = target_node->proc;
-+ if (target_proc == NULL) {
-+ return_error = BR_DEAD_REPLY;
-+ goto err_dead_binder;
-+ }
-+ if (!(tr->flags & TF_ONE_WAY) && thread->transaction_stack) {
-+ struct binder_transaction *tmp;
-+ tmp = thread->transaction_stack;
-+ if (tmp->to_thread != thread) {
-+ binder_user_error("binder: %d:%d got new "
-+ "transaction with bad transaction stack"
-+ ", transaction %d has target %d:%d\n",
-+ proc->pid, thread->pid, tmp->debug_id,
-+ tmp->to_proc ? tmp->to_proc->pid : 0,
-+ tmp->to_thread ?
-+ tmp->to_thread->pid : 0);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_bad_call_stack;
-+ }
-+ while (tmp) {
-+ if (tmp->from && tmp->from->proc == target_proc)
-+ target_thread = tmp->from;
-+ tmp = tmp->from_parent;
-+ }
-+ }
-+ }
-+ if (target_thread) {
-+ e->to_thread = target_thread->pid;
-+ target_list = &target_thread->todo;
-+ target_wait = &target_thread->wait;
-+ } else {
-+ target_list = &target_proc->todo;
-+ target_wait = &target_proc->wait;
-+ }
-+ e->to_proc = target_proc->pid;
-+
-+ /* TODO: reuse incoming transaction for reply */
-+ t = kzalloc(sizeof(*t), GFP_KERNEL);
-+ if (t == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_alloc_t_failed;
-+ }
-+ binder_stats_created(BINDER_STAT_TRANSACTION);
-+
-+ tcomplete = kzalloc(sizeof(*tcomplete), GFP_KERNEL);
-+ if (tcomplete == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_alloc_tcomplete_failed;
-+ }
-+ binder_stats_created(BINDER_STAT_TRANSACTION_COMPLETE);
-+
-+ t->debug_id = ++binder_last_id;
-+ e->debug_id = t->debug_id;
-+
-+ if (reply)
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ "binder: %d:%d BC_REPLY %d -> %d:%d, "
-+ "data %p-%p size %zd-%zd\n",
-+ proc->pid, thread->pid, t->debug_id,
-+ target_proc->pid, target_thread->pid,
-+ tr->data.ptr.buffer, tr->data.ptr.offsets,
-+ tr->data_size, tr->offsets_size);
-+ else
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ "binder: %d:%d BC_TRANSACTION %d -> "
-+ "%d - node %d, data %p-%p size %zd-%zd\n",
-+ proc->pid, thread->pid, t->debug_id,
-+ target_proc->pid, target_node->debug_id,
-+ tr->data.ptr.buffer, tr->data.ptr.offsets,
-+ tr->data_size, tr->offsets_size);
-+
-+ if (!reply && !(tr->flags & TF_ONE_WAY))
-+ t->from = thread;
-+ else
-+ t->from = NULL;
-+ t->sender_euid = proc->tsk->cred->euid;
-+ t->to_proc = target_proc;
-+ t->to_thread = target_thread;
-+ t->code = tr->code;
-+ t->flags = tr->flags;
-+ t->priority = task_nice(current);
-+ t->buffer = binder_alloc_buf(target_proc, tr->data_size,
-+ tr->offsets_size, !reply && (t->flags & TF_ONE_WAY));
-+ if (t->buffer == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_binder_alloc_buf_failed;
-+ }
-+ t->buffer->allow_user_free = 0;
-+ t->buffer->debug_id = t->debug_id;
-+ t->buffer->transaction = t;
-+ t->buffer->target_node = target_node;
-+ if (target_node)
-+ binder_inc_node(target_node, 1, 0, NULL);
-+
-+ offp = (size_t *)(t->buffer->data + ALIGN(tr->data_size, sizeof(void *)));
-+
-+ if (copy_from_user(t->buffer->data, tr->data.ptr.buffer, tr->data_size)) {
-+ binder_user_error("binder: %d:%d got transaction with invalid "
-+ "data ptr\n", proc->pid, thread->pid);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_copy_data_failed;
-+ }
-+ if (copy_from_user(offp, tr->data.ptr.offsets, tr->offsets_size)) {
-+ binder_user_error("binder: %d:%d got transaction with invalid "
-+ "offsets ptr\n", proc->pid, thread->pid);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_copy_data_failed;
-+ }
-+ if (!IS_ALIGNED(tr->offsets_size, sizeof(size_t))) {
-+ binder_user_error("binder: %d:%d got transaction with "
-+ "invalid offsets size, %zd\n",
-+ proc->pid, thread->pid, tr->offsets_size);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_bad_offset;
-+ }
-+ off_end = (void *)offp + tr->offsets_size;
-+ for (; offp < off_end; offp++) {
-+ struct flat_binder_object *fp;
-+ if (*offp > t->buffer->data_size - sizeof(*fp) ||
-+ t->buffer->data_size < sizeof(*fp) ||
-+ !IS_ALIGNED(*offp, sizeof(void *))) {
-+ binder_user_error("binder: %d:%d got transaction with "
-+ "invalid offset, %zd\n",
-+ proc->pid, thread->pid, *offp);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_bad_offset;
-+ }
-+ fp = (struct flat_binder_object *)(t->buffer->data + *offp);
-+ switch (fp->type) {
-+ case BINDER_TYPE_BINDER:
-+ case BINDER_TYPE_WEAK_BINDER: {
-+ struct binder_ref *ref;
-+ struct binder_node *node = binder_get_node(proc, fp->binder);
-+ if (node == NULL) {
-+ node = binder_new_node(proc, fp->binder, fp->cookie);
-+ if (node == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_binder_new_node_failed;
-+ }
-+ node->min_priority = fp->flags & FLAT_BINDER_FLAG_PRIORITY_MASK;
-+ node->accept_fds = !!(fp->flags & FLAT_BINDER_FLAG_ACCEPTS_FDS);
-+ }
-+ if (fp->cookie != node->cookie) {
-+ binder_user_error("binder: %d:%d sending u%p "
-+ "node %d, cookie mismatch %p != %p\n",
-+ proc->pid, thread->pid,
-+ fp->binder, node->debug_id,
-+ fp->cookie, node->cookie);
-+ goto err_binder_get_ref_for_node_failed;
-+ }
-+ ref = binder_get_ref_for_node(target_proc, node);
-+ if (ref == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_binder_get_ref_for_node_failed;
-+ }
-+ if (fp->type == BINDER_TYPE_BINDER)
-+ fp->type = BINDER_TYPE_HANDLE;
-+ else
-+ fp->type = BINDER_TYPE_WEAK_HANDLE;
-+ fp->handle = ref->desc;
-+ binder_inc_ref(ref, fp->type == BINDER_TYPE_HANDLE,
-+ &thread->todo);
-+
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " node %d u%p -> ref %d desc %d\n",
-+ node->debug_id, node->ptr, ref->debug_id,
-+ ref->desc);
-+ } break;
-+ case BINDER_TYPE_HANDLE:
-+ case BINDER_TYPE_WEAK_HANDLE: {
-+ struct binder_ref *ref = binder_get_ref(proc, fp->handle);
-+ if (ref == NULL) {
-+ binder_user_error("binder: %d:%d got "
-+ "transaction with invalid "
-+ "handle, %ld\n", proc->pid,
-+ thread->pid, fp->handle);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_binder_get_ref_failed;
-+ }
-+ if (ref->node->proc == target_proc) {
-+ if (fp->type == BINDER_TYPE_HANDLE)
-+ fp->type = BINDER_TYPE_BINDER;
-+ else
-+ fp->type = BINDER_TYPE_WEAK_BINDER;
-+ fp->binder = ref->node->ptr;
-+ fp->cookie = ref->node->cookie;
-+ binder_inc_node(ref->node, fp->type == BINDER_TYPE_BINDER, 0, NULL);
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " ref %d desc %d -> node %d u%p\n",
-+ ref->debug_id, ref->desc, ref->node->debug_id,
-+ ref->node->ptr);
-+ } else {
-+ struct binder_ref *new_ref;
-+ new_ref = binder_get_ref_for_node(target_proc, ref->node);
-+ if (new_ref == NULL) {
-+ return_error = BR_FAILED_REPLY;
-+ goto err_binder_get_ref_for_node_failed;
-+ }
-+ fp->handle = new_ref->desc;
-+ binder_inc_ref(new_ref, fp->type == BINDER_TYPE_HANDLE, NULL);
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " ref %d desc %d -> ref %d desc %d (node %d)\n",
-+ ref->debug_id, ref->desc, new_ref->debug_id,
-+ new_ref->desc, ref->node->debug_id);
-+ }
-+ } break;
-+
-+ case BINDER_TYPE_FD: {
-+ int target_fd;
-+ struct file *file;
-+
-+ if (reply) {
-+ if (!(in_reply_to->flags & TF_ACCEPT_FDS)) {
-+ binder_user_error("binder: %d:%d got reply with fd, %ld, but target does not allow fds\n",
-+ proc->pid, thread->pid, fp->handle);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_fd_not_allowed;
-+ }
-+ } else if (!target_node->accept_fds) {
-+ binder_user_error("binder: %d:%d got transaction with fd, %ld, but target does not allow fds\n",
-+ proc->pid, thread->pid, fp->handle);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_fd_not_allowed;
-+ }
-+
-+ file = fget(fp->handle);
-+ if (file == NULL) {
-+ binder_user_error("binder: %d:%d got transaction with invalid fd, %ld\n",
-+ proc->pid, thread->pid, fp->handle);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_fget_failed;
-+ }
-+ target_fd = task_get_unused_fd_flags(target_proc, O_CLOEXEC);
-+ if (target_fd < 0) {
-+ fput(file);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_get_unused_fd_failed;
-+ }
-+ task_fd_install(target_proc, target_fd, file);
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ " fd %ld -> %d\n", fp->handle, target_fd);
-+ /* TODO: fput? */
-+ fp->handle = target_fd;
-+ } break;
-+
-+ default:
-+ binder_user_error("binder: %d:%d got transactio"
-+ "n with invalid object type, %lx\n",
-+ proc->pid, thread->pid, fp->type);
-+ return_error = BR_FAILED_REPLY;
-+ goto err_bad_object_type;
-+ }
-+ }
-+ if (reply) {
-+ BUG_ON(t->buffer->async_transaction != 0);
-+ binder_pop_transaction(target_thread, in_reply_to);
-+ } else if (!(t->flags & TF_ONE_WAY)) {
-+ BUG_ON(t->buffer->async_transaction != 0);
-+ t->need_reply = 1;
-+ t->from_parent = thread->transaction_stack;
-+ thread->transaction_stack = t;
-+ } else {
-+ BUG_ON(target_node == NULL);
-+ BUG_ON(t->buffer->async_transaction != 1);
-+ if (target_node->has_async_transaction) {
-+ target_list = &target_node->async_todo;
-+ target_wait = NULL;
-+ } else
-+ target_node->has_async_transaction = 1;
-+ }
-+ t->work.type = BINDER_WORK_TRANSACTION;
-+ list_add_tail(&t->work.entry, target_list);
-+ tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
-+ list_add_tail(&tcomplete->entry, &thread->todo);
-+ if (target_wait)
-+ wake_up_interruptible(target_wait);
-+ return;
-+
-+err_get_unused_fd_failed:
-+err_fget_failed:
-+err_fd_not_allowed:
-+err_binder_get_ref_for_node_failed:
-+err_binder_get_ref_failed:
-+err_binder_new_node_failed:
-+err_bad_object_type:
-+err_bad_offset:
-+err_copy_data_failed:
-+ binder_transaction_buffer_release(target_proc, t->buffer, offp);
-+ t->buffer->transaction = NULL;
-+ binder_free_buf(target_proc, t->buffer);
-+err_binder_alloc_buf_failed:
-+ kfree(tcomplete);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
-+err_alloc_tcomplete_failed:
-+ kfree(t);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION);
-+err_alloc_t_failed:
-+err_bad_call_stack:
-+err_empty_call_stack:
-+err_dead_binder:
-+err_invalid_target_handle:
-+err_no_context_mgr_node:
-+ binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-+ "binder: %d:%d transaction failed %d, size %zd-%zd\n",
-+ proc->pid, thread->pid, return_error,
-+ tr->data_size, tr->offsets_size);
-+
-+ {
-+ struct binder_transaction_log_entry *fe;
-+ fe = binder_transaction_log_add(&binder_transaction_log_failed);
-+ *fe = *e;
-+ }
-+
-+ BUG_ON(thread->return_error != BR_OK);
-+ if (in_reply_to) {
-+ thread->return_error = BR_TRANSACTION_COMPLETE;
-+ binder_send_failed_reply(in_reply_to, return_error);
-+ } else
-+ thread->return_error = return_error;
-+}
-+
-+int binder_thread_write(struct binder_proc *proc, struct binder_thread *thread,
-+ void __user *buffer, int size, signed long *consumed)
-+{
-+ uint32_t cmd;
-+ void __user *ptr = buffer + *consumed;
-+ void __user *end = buffer + size;
-+
-+ while (ptr < end && thread->return_error == BR_OK) {
-+ if (get_user(cmd, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (_IOC_NR(cmd) < ARRAY_SIZE(binder_stats.bc)) {
-+ binder_stats.bc[_IOC_NR(cmd)]++;
-+ proc->stats.bc[_IOC_NR(cmd)]++;
-+ thread->stats.bc[_IOC_NR(cmd)]++;
-+ }
-+ switch (cmd) {
-+ case BC_INCREFS:
-+ case BC_ACQUIRE:
-+ case BC_RELEASE:
-+ case BC_DECREFS: {
-+ uint32_t target;
-+ struct binder_ref *ref;
-+ const char *debug_string;
-+
-+ if (get_user(target, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (target == 0 && binder_context_mgr_node &&
-+ (cmd == BC_INCREFS || cmd == BC_ACQUIRE)) {
-+ ref = binder_get_ref_for_node(proc,
-+ binder_context_mgr_node);
-+ if (ref->desc != target) {
-+ binder_user_error("binder: %d:"
-+ "%d tried to acquire "
-+ "reference to desc 0, "
-+ "got %d instead\n",
-+ proc->pid, thread->pid,
-+ ref->desc);
-+ }
-+ } else
-+ ref = binder_get_ref(proc, target);
-+ if (ref == NULL) {
-+ binder_user_error("binder: %d:%d refcou"
-+ "nt change on invalid ref %d\n",
-+ proc->pid, thread->pid, target);
-+ break;
-+ }
-+ switch (cmd) {
-+ case BC_INCREFS:
-+ debug_string = "IncRefs";
-+ binder_inc_ref(ref, 0, NULL);
-+ break;
-+ case BC_ACQUIRE:
-+ debug_string = "Acquire";
-+ binder_inc_ref(ref, 1, NULL);
-+ break;
-+ case BC_RELEASE:
-+ debug_string = "Release";
-+ binder_dec_ref(ref, 1);
-+ break;
-+ case BC_DECREFS:
-+ default:
-+ debug_string = "DecRefs";
-+ binder_dec_ref(ref, 0);
-+ break;
-+ }
-+ binder_debug(BINDER_DEBUG_USER_REFS,
-+ "binder: %d:%d %s ref %d desc %d s %d w %d for node %d\n",
-+ proc->pid, thread->pid, debug_string, ref->debug_id,
-+ ref->desc, ref->strong, ref->weak, ref->node->debug_id);
-+ break;
-+ }
-+ case BC_INCREFS_DONE:
-+ case BC_ACQUIRE_DONE: {
-+ void __user *node_ptr;
-+ void *cookie;
-+ struct binder_node *node;
-+
-+ if (get_user(node_ptr, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+ if (get_user(cookie, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+ node = binder_get_node(proc, node_ptr);
-+ if (node == NULL) {
-+ binder_user_error("binder: %d:%d "
-+ "%s u%p no match\n",
-+ proc->pid, thread->pid,
-+ cmd == BC_INCREFS_DONE ?
-+ "BC_INCREFS_DONE" :
-+ "BC_ACQUIRE_DONE",
-+ node_ptr);
-+ break;
-+ }
-+ if (cookie != node->cookie) {
-+ binder_user_error("binder: %d:%d %s u%p node %d"
-+ " cookie mismatch %p != %p\n",
-+ proc->pid, thread->pid,
-+ cmd == BC_INCREFS_DONE ?
-+ "BC_INCREFS_DONE" : "BC_ACQUIRE_DONE",
-+ node_ptr, node->debug_id,
-+ cookie, node->cookie);
-+ break;
-+ }
-+ if (cmd == BC_ACQUIRE_DONE) {
-+ if (node->pending_strong_ref == 0) {
-+ binder_user_error("binder: %d:%d "
-+ "BC_ACQUIRE_DONE node %d has "
-+ "no pending acquire request\n",
-+ proc->pid, thread->pid,
-+ node->debug_id);
-+ break;
-+ }
-+ node->pending_strong_ref = 0;
-+ } else {
-+ if (node->pending_weak_ref == 0) {
-+ binder_user_error("binder: %d:%d "
-+ "BC_INCREFS_DONE node %d has "
-+ "no pending increfs request\n",
-+ proc->pid, thread->pid,
-+ node->debug_id);
-+ break;
-+ }
-+ node->pending_weak_ref = 0;
-+ }
-+ binder_dec_node(node, cmd == BC_ACQUIRE_DONE, 0);
-+ binder_debug(BINDER_DEBUG_USER_REFS,
-+ "binder: %d:%d %s node %d ls %d lw %d\n",
-+ proc->pid, thread->pid,
-+ cmd == BC_INCREFS_DONE ? "BC_INCREFS_DONE" : "BC_ACQUIRE_DONE",
-+ node->debug_id, node->local_strong_refs, node->local_weak_refs);
-+ break;
-+ }
-+ case BC_ATTEMPT_ACQUIRE:
-+ printk(KERN_ERR "binder: BC_ATTEMPT_ACQUIRE not supported\n");
-+ return -EINVAL;
-+ case BC_ACQUIRE_RESULT:
-+ printk(KERN_ERR "binder: BC_ACQUIRE_RESULT not supported\n");
-+ return -EINVAL;
-+
-+ case BC_FREE_BUFFER: {
-+ void __user *data_ptr;
-+ struct binder_buffer *buffer;
-+
-+ if (get_user(data_ptr, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+
-+ buffer = binder_buffer_lookup(proc, data_ptr);
-+ if (buffer == NULL) {
-+ binder_user_error("binder: %d:%d "
-+ "BC_FREE_BUFFER u%p no match\n",
-+ proc->pid, thread->pid, data_ptr);
-+ break;
-+ }
-+ if (!buffer->allow_user_free) {
-+ binder_user_error("binder: %d:%d "
-+ "BC_FREE_BUFFER u%p matched "
-+ "unreturned buffer\n",
-+ proc->pid, thread->pid, data_ptr);
-+ break;
-+ }
-+ binder_debug(BINDER_DEBUG_FREE_BUFFER,
-+ "binder: %d:%d BC_FREE_BUFFER u%p found buffer %d for %s transaction\n",
-+ proc->pid, thread->pid, data_ptr, buffer->debug_id,
-+ buffer->transaction ? "active" : "finished");
-+
-+ if (buffer->transaction) {
-+ buffer->transaction->buffer = NULL;
-+ buffer->transaction = NULL;
-+ }
-+ if (buffer->async_transaction && buffer->target_node) {
-+ BUG_ON(!buffer->target_node->has_async_transaction);
-+ if (list_empty(&buffer->target_node->async_todo))
-+ buffer->target_node->has_async_transaction = 0;
-+ else
-+ list_move_tail(buffer->target_node->async_todo.next, &thread->todo);
-+ }
-+ binder_transaction_buffer_release(proc, buffer, NULL);
-+ binder_free_buf(proc, buffer);
-+ break;
-+ }
-+
-+ case BC_TRANSACTION:
-+ case BC_REPLY: {
-+ struct binder_transaction_data tr;
-+
-+ if (copy_from_user(&tr, ptr, sizeof(tr)))
-+ return -EFAULT;
-+ ptr += sizeof(tr);
-+ binder_transaction(proc, thread, &tr, cmd == BC_REPLY);
-+ break;
-+ }
-+
-+ case BC_REGISTER_LOOPER:
-+ binder_debug(BINDER_DEBUG_THREADS,
-+ "binder: %d:%d BC_REGISTER_LOOPER\n",
-+ proc->pid, thread->pid);
-+ if (thread->looper & BINDER_LOOPER_STATE_ENTERED) {
-+ thread->looper |= BINDER_LOOPER_STATE_INVALID;
-+ binder_user_error("binder: %d:%d ERROR:"
-+ " BC_REGISTER_LOOPER called "
-+ "after BC_ENTER_LOOPER\n",
-+ proc->pid, thread->pid);
-+ } else if (proc->requested_threads == 0) {
-+ thread->looper |= BINDER_LOOPER_STATE_INVALID;
-+ binder_user_error("binder: %d:%d ERROR:"
-+ " BC_REGISTER_LOOPER called "
-+ "without request\n",
-+ proc->pid, thread->pid);
-+ } else {
-+ proc->requested_threads--;
-+ proc->requested_threads_started++;
-+ }
-+ thread->looper |= BINDER_LOOPER_STATE_REGISTERED;
-+ break;
-+ case BC_ENTER_LOOPER:
-+ binder_debug(BINDER_DEBUG_THREADS,
-+ "binder: %d:%d BC_ENTER_LOOPER\n",
-+ proc->pid, thread->pid);
-+ if (thread->looper & BINDER_LOOPER_STATE_REGISTERED) {
-+ thread->looper |= BINDER_LOOPER_STATE_INVALID;
-+ binder_user_error("binder: %d:%d ERROR:"
-+ " BC_ENTER_LOOPER called after "
-+ "BC_REGISTER_LOOPER\n",
-+ proc->pid, thread->pid);
-+ }
-+ thread->looper |= BINDER_LOOPER_STATE_ENTERED;
-+ break;
-+ case BC_EXIT_LOOPER:
-+ binder_debug(BINDER_DEBUG_THREADS,
-+ "binder: %d:%d BC_EXIT_LOOPER\n",
-+ proc->pid, thread->pid);
-+ thread->looper |= BINDER_LOOPER_STATE_EXITED;
-+ break;
-+
-+ case BC_REQUEST_DEATH_NOTIFICATION:
-+ case BC_CLEAR_DEATH_NOTIFICATION: {
-+ uint32_t target;
-+ void __user *cookie;
-+ struct binder_ref *ref;
-+ struct binder_ref_death *death;
-+
-+ if (get_user(target, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (get_user(cookie, (void __user * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+ ref = binder_get_ref(proc, target);
-+ if (ref == NULL) {
-+ binder_user_error("binder: %d:%d %s "
-+ "invalid ref %d\n",
-+ proc->pid, thread->pid,
-+ cmd == BC_REQUEST_DEATH_NOTIFICATION ?
-+ "BC_REQUEST_DEATH_NOTIFICATION" :
-+ "BC_CLEAR_DEATH_NOTIFICATION",
-+ target);
-+ break;
-+ }
-+
-+ binder_debug(BINDER_DEBUG_DEATH_NOTIFICATION,
-+ "binder: %d:%d %s %p ref %d desc %d s %d w %d for node %d\n",
-+ proc->pid, thread->pid,
-+ cmd == BC_REQUEST_DEATH_NOTIFICATION ?
-+ "BC_REQUEST_DEATH_NOTIFICATION" :
-+ "BC_CLEAR_DEATH_NOTIFICATION",
-+ cookie, ref->debug_id, ref->desc,
-+ ref->strong, ref->weak, ref->node->debug_id);
-+
-+ if (cmd == BC_REQUEST_DEATH_NOTIFICATION) {
-+ if (ref->death) {
-+ binder_user_error("binder: %d:%"
-+ "d BC_REQUEST_DEATH_NOTI"
-+ "FICATION death notific"
-+ "ation already set\n",
-+ proc->pid, thread->pid);
-+ break;
-+ }
-+ death = kzalloc(sizeof(*death), GFP_KERNEL);
-+ if (death == NULL) {
-+ thread->return_error = BR_ERROR;
-+ binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-+ "binder: %d:%d "
-+ "BC_REQUEST_DEATH_NOTIFICATION failed\n",
-+ proc->pid, thread->pid);
-+ break;
-+ }
-+ binder_stats_created(BINDER_STAT_DEATH);
-+ INIT_LIST_HEAD(&death->work.entry);
-+ death->cookie = cookie;
-+ ref->death = death;
-+ if (ref->node->proc == NULL) {
-+ ref->death->work.type = BINDER_WORK_DEAD_BINDER;
-+ if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
-+ list_add_tail(&ref->death->work.entry, &thread->todo);
-+ } else {
-+ list_add_tail(&ref->death->work.entry, &proc->todo);
-+ wake_up_interruptible(&proc->wait);
-+ }
-+ }
-+ } else {
-+ if (ref->death == NULL) {
-+ binder_user_error("binder: %d:%"
-+ "d BC_CLEAR_DEATH_NOTIFI"
-+ "CATION death notificat"
-+ "ion not active\n",
-+ proc->pid, thread->pid);
-+ break;
-+ }
-+ death = ref->death;
-+ if (death->cookie != cookie) {
-+ binder_user_error("binder: %d:%"
-+ "d BC_CLEAR_DEATH_NOTIFI"
-+ "CATION death notificat"
-+ "ion cookie mismatch "
-+ "%p != %p\n",
-+ proc->pid, thread->pid,
-+ death->cookie, cookie);
-+ break;
-+ }
-+ ref->death = NULL;
-+ if (list_empty(&death->work.entry)) {
-+ death->work.type = BINDER_WORK_CLEAR_DEATH_NOTIFICATION;
-+ if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
-+ list_add_tail(&death->work.entry, &thread->todo);
-+ } else {
-+ list_add_tail(&death->work.entry, &proc->todo);
-+ wake_up_interruptible(&proc->wait);
-+ }
-+ } else {
-+ BUG_ON(death->work.type != BINDER_WORK_DEAD_BINDER);
-+ death->work.type = BINDER_WORK_DEAD_BINDER_AND_CLEAR;
-+ }
-+ }
-+ } break;
-+ case BC_DEAD_BINDER_DONE: {
-+ struct binder_work *w;
-+ void __user *cookie;
-+ struct binder_ref_death *death = NULL;
-+ if (get_user(cookie, (void __user * __user *)ptr))
-+ return -EFAULT;
-+
-+ ptr += sizeof(void *);
-+ list_for_each_entry(w, &proc->delivered_death, entry) {
-+ struct binder_ref_death *tmp_death = container_of(w, struct binder_ref_death, work);
-+ if (tmp_death->cookie == cookie) {
-+ death = tmp_death;
-+ break;
-+ }
-+ }
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder: %d:%d BC_DEAD_BINDER_DONE %p found %p\n",
-+ proc->pid, thread->pid, cookie, death);
-+ if (death == NULL) {
-+ binder_user_error("binder: %d:%d BC_DEAD"
-+ "_BINDER_DONE %p not found\n",
-+ proc->pid, thread->pid, cookie);
-+ break;
-+ }
-+
-+ list_del_init(&death->work.entry);
-+ if (death->work.type == BINDER_WORK_DEAD_BINDER_AND_CLEAR) {
-+ death->work.type = BINDER_WORK_CLEAR_DEATH_NOTIFICATION;
-+ if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
-+ list_add_tail(&death->work.entry, &thread->todo);
-+ } else {
-+ list_add_tail(&death->work.entry, &proc->todo);
-+ wake_up_interruptible(&proc->wait);
-+ }
-+ }
-+ } break;
-+
-+ default:
-+ printk(KERN_ERR "binder: %d:%d unknown command %d\n",
-+ proc->pid, thread->pid, cmd);
-+ return -EINVAL;
-+ }
-+ *consumed = ptr - buffer;
-+ }
-+ return 0;
-+}
-+
-+void binder_stat_br(struct binder_proc *proc, struct binder_thread *thread,
-+ uint32_t cmd)
-+{
-+ if (_IOC_NR(cmd) < ARRAY_SIZE(binder_stats.br)) {
-+ binder_stats.br[_IOC_NR(cmd)]++;
-+ proc->stats.br[_IOC_NR(cmd)]++;
-+ thread->stats.br[_IOC_NR(cmd)]++;
-+ }
-+}
-+
-+static int binder_has_proc_work(struct binder_proc *proc,
-+ struct binder_thread *thread)
-+{
-+ return !list_empty(&proc->todo) ||
-+ (thread->looper & BINDER_LOOPER_STATE_NEED_RETURN);
-+}
-+
-+static int binder_has_thread_work(struct binder_thread *thread)
-+{
-+ return !list_empty(&thread->todo) || thread->return_error != BR_OK ||
-+ (thread->looper & BINDER_LOOPER_STATE_NEED_RETURN);
-+}
-+
-+static int binder_thread_read(struct binder_proc *proc,
-+ struct binder_thread *thread,
-+ void __user *buffer, int size,
-+ signed long *consumed, int non_block)
-+{
-+ void __user *ptr = buffer + *consumed;
-+ void __user *end = buffer + size;
-+
-+ int ret = 0;
-+ int wait_for_proc_work;
-+
-+ if (*consumed == 0) {
-+ if (put_user(BR_NOOP, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ }
-+
-+retry:
-+ wait_for_proc_work = thread->transaction_stack == NULL &&
-+ list_empty(&thread->todo);
-+
-+ if (thread->return_error != BR_OK && ptr < end) {
-+ if (thread->return_error2 != BR_OK) {
-+ if (put_user(thread->return_error2, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (ptr == end)
-+ goto done;
-+ thread->return_error2 = BR_OK;
-+ }
-+ if (put_user(thread->return_error, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ thread->return_error = BR_OK;
-+ goto done;
-+ }
-+
-+
-+ thread->looper |= BINDER_LOOPER_STATE_WAITING;
-+ if (wait_for_proc_work)
-+ proc->ready_threads++;
-+ mutex_unlock(&binder_lock);
-+ if (wait_for_proc_work) {
-+ if (!(thread->looper & (BINDER_LOOPER_STATE_REGISTERED |
-+ BINDER_LOOPER_STATE_ENTERED))) {
-+ binder_user_error("binder: %d:%d ERROR: Thread waiting "
-+ "for process work before calling BC_REGISTER_"
-+ "LOOPER or BC_ENTER_LOOPER (state %x)\n",
-+ proc->pid, thread->pid, thread->looper);
-+ wait_event_interruptible(binder_user_error_wait,
-+ binder_stop_on_user_error < 2);
-+ }
-+ binder_set_nice(proc->default_priority);
-+ if (non_block) {
-+ if (!binder_has_proc_work(proc, thread))
-+ ret = -EAGAIN;
-+ } else
-+ ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread));
-+ } else {
-+ if (non_block) {
-+ if (!binder_has_thread_work(thread))
-+ ret = -EAGAIN;
-+ } else
-+ ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread));
-+ }
-+ mutex_lock(&binder_lock);
-+ if (wait_for_proc_work)
-+ proc->ready_threads--;
-+ thread->looper &= ~BINDER_LOOPER_STATE_WAITING;
-+
-+ if (ret)
-+ return ret;
-+
-+ while (1) {
-+ uint32_t cmd;
-+ struct binder_transaction_data tr;
-+ struct binder_work *w;
-+ struct binder_transaction *t = NULL;
-+
-+ if (!list_empty(&thread->todo))
-+ w = list_first_entry(&thread->todo, struct binder_work, entry);
-+ else if (!list_empty(&proc->todo) && wait_for_proc_work)
-+ w = list_first_entry(&proc->todo, struct binder_work, entry);
-+ else {
-+ if (ptr - buffer == 4 && !(thread->looper & BINDER_LOOPER_STATE_NEED_RETURN)) /* no data added */
-+ goto retry;
-+ break;
-+ }
-+
-+ if (end - ptr < sizeof(tr) + 4)
-+ break;
-+
-+ switch (w->type) {
-+ case BINDER_WORK_TRANSACTION: {
-+ t = container_of(w, struct binder_transaction, work);
-+ } break;
-+ case BINDER_WORK_TRANSACTION_COMPLETE: {
-+ cmd = BR_TRANSACTION_COMPLETE;
-+ if (put_user(cmd, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+
-+ binder_stat_br(proc, thread, cmd);
-+ binder_debug(BINDER_DEBUG_TRANSACTION_COMPLETE,
-+ "binder: %d:%d BR_TRANSACTION_COMPLETE\n",
-+ proc->pid, thread->pid);
-+
-+ list_del(&w->entry);
-+ kfree(w);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
-+ } break;
-+ case BINDER_WORK_NODE: {
-+ struct binder_node *node = container_of(w, struct binder_node, work);
-+ uint32_t cmd = BR_NOOP;
-+ const char *cmd_name;
-+ int strong = node->internal_strong_refs || node->local_strong_refs;
-+ int weak = !hlist_empty(&node->refs) || node->local_weak_refs || strong;
-+ if (weak && !node->has_weak_ref) {
-+ cmd = BR_INCREFS;
-+ cmd_name = "BR_INCREFS";
-+ node->has_weak_ref = 1;
-+ node->pending_weak_ref = 1;
-+ node->local_weak_refs++;
-+ } else if (strong && !node->has_strong_ref) {
-+ cmd = BR_ACQUIRE;
-+ cmd_name = "BR_ACQUIRE";
-+ node->has_strong_ref = 1;
-+ node->pending_strong_ref = 1;
-+ node->local_strong_refs++;
-+ } else if (!strong && node->has_strong_ref) {
-+ cmd = BR_RELEASE;
-+ cmd_name = "BR_RELEASE";
-+ node->has_strong_ref = 0;
-+ } else if (!weak && node->has_weak_ref) {
-+ cmd = BR_DECREFS;
-+ cmd_name = "BR_DECREFS";
-+ node->has_weak_ref = 0;
-+ }
-+ if (cmd != BR_NOOP) {
-+ if (put_user(cmd, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (put_user(node->ptr, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+ if (put_user(node->cookie, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+
-+ binder_stat_br(proc, thread, cmd);
-+ binder_debug(BINDER_DEBUG_USER_REFS,
-+ "binder: %d:%d %s %d u%p c%p\n",
-+ proc->pid, thread->pid, cmd_name, node->debug_id, node->ptr, node->cookie);
-+ } else {
-+ list_del_init(&w->entry);
-+ if (!weak && !strong) {
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d:%d node %d u%p c%p deleted\n",
-+ proc->pid, thread->pid, node->debug_id,
-+ node->ptr, node->cookie);
-+ rb_erase(&node->rb_node, &proc->nodes);
-+ kfree(node);
-+ binder_stats_deleted(BINDER_STAT_NODE);
-+ } else {
-+ binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-+ "binder: %d:%d node %d u%p c%p state unchanged\n",
-+ proc->pid, thread->pid, node->debug_id, node->ptr,
-+ node->cookie);
-+ }
-+ }
-+ } break;
-+ case BINDER_WORK_DEAD_BINDER:
-+ case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
-+ case BINDER_WORK_CLEAR_DEATH_NOTIFICATION: {
-+ struct binder_ref_death *death;
-+ uint32_t cmd;
-+
-+ death = container_of(w, struct binder_ref_death, work);
-+ if (w->type == BINDER_WORK_CLEAR_DEATH_NOTIFICATION)
-+ cmd = BR_CLEAR_DEATH_NOTIFICATION_DONE;
-+ else
-+ cmd = BR_DEAD_BINDER;
-+ if (put_user(cmd, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (put_user(death->cookie, (void * __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(void *);
-+ binder_debug(BINDER_DEBUG_DEATH_NOTIFICATION,
-+ "binder: %d:%d %s %p\n",
-+ proc->pid, thread->pid,
-+ cmd == BR_DEAD_BINDER ?
-+ "BR_DEAD_BINDER" :
-+ "BR_CLEAR_DEATH_NOTIFICATION_DONE",
-+ death->cookie);
-+
-+ if (w->type == BINDER_WORK_CLEAR_DEATH_NOTIFICATION) {
-+ list_del(&w->entry);
-+ kfree(death);
-+ binder_stats_deleted(BINDER_STAT_DEATH);
-+ } else
-+ list_move(&w->entry, &proc->delivered_death);
-+ if (cmd == BR_DEAD_BINDER)
-+ goto done; /* DEAD_BINDER notifications can cause transactions */
-+ } break;
-+ }
-+
-+ if (!t)
-+ continue;
-+
-+ BUG_ON(t->buffer == NULL);
-+ if (t->buffer->target_node) {
-+ struct binder_node *target_node = t->buffer->target_node;
-+ tr.target.ptr = target_node->ptr;
-+ tr.cookie = target_node->cookie;
-+ t->saved_priority = task_nice(current);
-+ if (t->priority < target_node->min_priority &&
-+ !(t->flags & TF_ONE_WAY))
-+ binder_set_nice(t->priority);
-+ else if (!(t->flags & TF_ONE_WAY) ||
-+ t->saved_priority > target_node->min_priority)
-+ binder_set_nice(target_node->min_priority);
-+ cmd = BR_TRANSACTION;
-+ } else {
-+ tr.target.ptr = NULL;
-+ tr.cookie = NULL;
-+ cmd = BR_REPLY;
-+ }
-+ tr.code = t->code;
-+ tr.flags = t->flags;
-+ tr.sender_euid = t->sender_euid;
-+
-+ if (t->from) {
-+ struct task_struct *sender = t->from->proc->tsk;
-+ tr.sender_pid = task_tgid_nr_ns(sender,
-+ current->nsproxy->pid_ns);
-+ } else {
-+ tr.sender_pid = 0;
-+ }
-+
-+ tr.data_size = t->buffer->data_size;
-+ tr.offsets_size = t->buffer->offsets_size;
-+ tr.data.ptr.buffer = (void *)t->buffer->data +
-+ proc->user_buffer_offset;
-+ tr.data.ptr.offsets = tr.data.ptr.buffer +
-+ ALIGN(t->buffer->data_size,
-+ sizeof(void *));
-+
-+ if (put_user(cmd, (uint32_t __user *)ptr))
-+ return -EFAULT;
-+ ptr += sizeof(uint32_t);
-+ if (copy_to_user(ptr, &tr, sizeof(tr)))
-+ return -EFAULT;
-+ ptr += sizeof(tr);
-+
-+ binder_stat_br(proc, thread, cmd);
-+ binder_debug(BINDER_DEBUG_TRANSACTION,
-+ "binder: %d:%d %s %d %d:%d, cmd %d"
-+ "size %zd-%zd ptr %p-%p\n",
-+ proc->pid, thread->pid,
-+ (cmd == BR_TRANSACTION) ? "BR_TRANSACTION" :
-+ "BR_REPLY",
-+ t->debug_id, t->from ? t->from->proc->pid : 0,
-+ t->from ? t->from->pid : 0, cmd,
-+ t->buffer->data_size, t->buffer->offsets_size,
-+ tr.data.ptr.buffer, tr.data.ptr.offsets);
-+
-+ list_del(&t->work.entry);
-+ t->buffer->allow_user_free = 1;
-+ if (cmd == BR_TRANSACTION && !(t->flags & TF_ONE_WAY)) {
-+ t->to_parent = thread->transaction_stack;
-+ t->to_thread = thread;
-+ thread->transaction_stack = t;
-+ } else {
-+ t->buffer->transaction = NULL;
-+ kfree(t);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION);
-+ }
-+ break;
-+ }
-+
-+done:
-+
-+ *consumed = ptr - buffer;
-+ if (proc->requested_threads + proc->ready_threads == 0 &&
-+ proc->requested_threads_started < proc->max_threads &&
-+ (thread->looper & (BINDER_LOOPER_STATE_REGISTERED |
-+ BINDER_LOOPER_STATE_ENTERED)) /* the user-space code fails to */
-+ /*spawn a new thread if we leave this out */) {
-+ proc->requested_threads++;
-+ binder_debug(BINDER_DEBUG_THREADS,
-+ "binder: %d:%d BR_SPAWN_LOOPER\n",
-+ proc->pid, thread->pid);
-+ if (put_user(BR_SPAWN_LOOPER, (uint32_t __user *)buffer))
-+ return -EFAULT;
-+ }
-+ return 0;
-+}
-+
-+static void binder_release_work(struct list_head *list)
-+{
-+ struct binder_work *w;
-+ while (!list_empty(list)) {
-+ w = list_first_entry(list, struct binder_work, entry);
-+ list_del_init(&w->entry);
-+ switch (w->type) {
-+ case BINDER_WORK_TRANSACTION: {
-+ struct binder_transaction *t;
-+
-+ t = container_of(w, struct binder_transaction, work);
-+ if (t->buffer->target_node && !(t->flags & TF_ONE_WAY))
-+ binder_send_failed_reply(t, BR_DEAD_REPLY);
-+ } break;
-+ case BINDER_WORK_TRANSACTION_COMPLETE: {
-+ kfree(w);
-+ binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
-+ } break;
-+ default:
-+ break;
-+ }
-+ }
-+
-+}
-+
-+static struct binder_thread *binder_get_thread(struct binder_proc *proc)
-+{
-+ struct binder_thread *thread = NULL;
-+ struct rb_node *parent = NULL;
-+ struct rb_node **p = &proc->threads.rb_node;
-+
-+ while (*p) {
-+ parent = *p;
-+ thread = rb_entry(parent, struct binder_thread, rb_node);
-+
-+ if (current->pid < thread->pid)
-+ p = &(*p)->rb_left;
-+ else if (current->pid > thread->pid)
-+ p = &(*p)->rb_right;
-+ else
-+ break;
-+ }
-+ if (*p == NULL) {
-+ thread = kzalloc(sizeof(*thread), GFP_KERNEL);
-+ if (thread == NULL)
-+ return NULL;
-+ binder_stats_created(BINDER_STAT_THREAD);
-+ thread->proc = proc;
-+ thread->pid = current->pid;
-+ init_waitqueue_head(&thread->wait);
-+ INIT_LIST_HEAD(&thread->todo);
-+ rb_link_node(&thread->rb_node, parent, p);
-+ rb_insert_color(&thread->rb_node, &proc->threads);
-+ thread->looper |= BINDER_LOOPER_STATE_NEED_RETURN;
-+ thread->return_error = BR_OK;
-+ thread->return_error2 = BR_OK;
-+ }
-+ return thread;
-+}
-+
-+static int binder_free_thread(struct binder_proc *proc,
-+ struct binder_thread *thread)
-+{
-+ struct binder_transaction *t;
-+ struct binder_transaction *send_reply = NULL;
-+ int active_transactions = 0;
-+
-+ rb_erase(&thread->rb_node, &proc->threads);
-+ t = thread->transaction_stack;
-+ if (t && t->to_thread == thread)
-+ send_reply = t;
-+ while (t) {
-+ active_transactions++;
-+ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
-+ "binder: release %d:%d transaction %d "
-+ "%s, still active\n", proc->pid, thread->pid,
-+ t->debug_id,
-+ (t->to_thread == thread) ? "in" : "out");
-+
-+ if (t->to_thread == thread) {
-+ t->to_proc = NULL;
-+ t->to_thread = NULL;
-+ if (t->buffer) {
-+ t->buffer->transaction = NULL;
-+ t->buffer = NULL;
-+ }
-+ t = t->to_parent;
-+ } else if (t->from == thread) {
-+ t->from = NULL;
-+ t = t->from_parent;
-+ } else
-+ BUG();
-+ }
-+ if (send_reply)
-+ binder_send_failed_reply(send_reply, BR_DEAD_REPLY);
-+ binder_release_work(&thread->todo);
-+ kfree(thread);
-+ binder_stats_deleted(BINDER_STAT_THREAD);
-+ return active_transactions;
-+}
-+
-+static unsigned int binder_poll(struct file *filp,
-+ struct poll_table_struct *wait)
-+{
-+ struct binder_proc *proc = filp->private_data;
-+ struct binder_thread *thread = NULL;
-+ int wait_for_proc_work;
-+
-+ mutex_lock(&binder_lock);
-+ thread = binder_get_thread(proc);
-+
-+ wait_for_proc_work = thread->transaction_stack == NULL &&
-+ list_empty(&thread->todo) && thread->return_error == BR_OK;
-+ mutex_unlock(&binder_lock);
-+
-+ if (wait_for_proc_work) {
-+ if (binder_has_proc_work(proc, thread))
-+ return POLLIN;
-+ poll_wait(filp, &proc->wait, wait);
-+ if (binder_has_proc_work(proc, thread))
-+ return POLLIN;
-+ } else {
-+ if (binder_has_thread_work(thread))
-+ return POLLIN;
-+ poll_wait(filp, &thread->wait, wait);
-+ if (binder_has_thread_work(thread))
-+ return POLLIN;
-+ }
-+ return 0;
-+}
-+
-+static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
-+{
-+ int ret;
-+ struct binder_proc *proc = filp->private_data;
-+ struct binder_thread *thread;
-+ unsigned int size = _IOC_SIZE(cmd);
-+ void __user *ubuf = (void __user *)arg;
-+
-+ /*printk(KERN_INFO "binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/
-+
-+ ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
-+ if (ret)
-+ return ret;
-+
-+ mutex_lock(&binder_lock);
-+ thread = binder_get_thread(proc);
-+ if (thread == NULL) {
-+ ret = -ENOMEM;
-+ goto err;
-+ }
-+
-+ switch (cmd) {
-+ case BINDER_WRITE_READ: {
-+ struct binder_write_read bwr;
-+ if (size != sizeof(struct binder_write_read)) {
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ if (copy_from_user(&bwr, ubuf, sizeof(bwr))) {
-+ ret = -EFAULT;
-+ goto err;
-+ }
-+ binder_debug(BINDER_DEBUG_READ_WRITE,
-+ "binder: %d:%d write %ld at %08lx, read %ld at %08lx\n",
-+ proc->pid, thread->pid, bwr.write_size, bwr.write_buffer,
-+ bwr.read_size, bwr.read_buffer);
-+
-+ if (bwr.write_size > 0) {
-+ ret = binder_thread_write(proc, thread, (void __user *)bwr.write_buffer, bwr.write_size, &bwr.write_consumed);
-+ if (ret < 0) {
-+ bwr.read_consumed = 0;
-+ if (copy_to_user(ubuf, &bwr, sizeof(bwr)))
-+ ret = -EFAULT;
-+ goto err;
-+ }
-+ }
-+ if (bwr.read_size > 0) {
-+ ret = binder_thread_read(proc, thread, (void __user *)bwr.read_buffer, bwr.read_size, &bwr.read_consumed, filp->f_flags & O_NONBLOCK);
-+ if (!list_empty(&proc->todo))
-+ wake_up_interruptible(&proc->wait);
-+ if (ret < 0) {
-+ if (copy_to_user(ubuf, &bwr, sizeof(bwr)))
-+ ret = -EFAULT;
-+ goto err;
-+ }
-+ }
-+ binder_debug(BINDER_DEBUG_READ_WRITE,
-+ "binder: %d:%d wrote %ld of %ld, read return %ld of %ld\n",
-+ proc->pid, thread->pid, bwr.write_consumed, bwr.write_size,
-+ bwr.read_consumed, bwr.read_size);
-+ if (copy_to_user(ubuf, &bwr, sizeof(bwr))) {
-+ ret = -EFAULT;
-+ goto err;
-+ }
-+ break;
-+ }
-+ case BINDER_SET_MAX_THREADS:
-+ if (copy_from_user(&proc->max_threads, ubuf, sizeof(proc->max_threads))) {
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ break;
-+ case BINDER_SET_CONTEXT_MGR:
-+ if (binder_context_mgr_node != NULL) {
-+ printk(KERN_ERR "binder: BINDER_SET_CONTEXT_MGR already set\n");
-+ ret = -EBUSY;
-+ goto err;
-+ }
-+ if (binder_context_mgr_uid != -1) {
-+ if (binder_context_mgr_uid != current->cred->euid) {
-+ printk(KERN_ERR "binder: BINDER_SET_"
-+ "CONTEXT_MGR bad uid %d != %d\n",
-+ current->cred->euid,
-+ binder_context_mgr_uid);
-+ ret = -EPERM;
-+ goto err;
-+ }
-+ } else
-+ binder_context_mgr_uid = current->cred->euid;
-+ binder_context_mgr_node = binder_new_node(proc, NULL, NULL);
-+ if (binder_context_mgr_node == NULL) {
-+ ret = -ENOMEM;
-+ goto err;
-+ }
-+ binder_context_mgr_node->local_weak_refs++;
-+ binder_context_mgr_node->local_strong_refs++;
-+ binder_context_mgr_node->has_strong_ref = 1;
-+ binder_context_mgr_node->has_weak_ref = 1;
-+ break;
-+ case BINDER_THREAD_EXIT:
-+ binder_debug(BINDER_DEBUG_THREADS, "binder: %d:%d exit\n",
-+ proc->pid, thread->pid);
-+ binder_free_thread(proc, thread);
-+ thread = NULL;
-+ break;
-+ case BINDER_VERSION:
-+ if (size != sizeof(struct binder_version)) {
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ if (put_user(BINDER_CURRENT_PROTOCOL_VERSION, &((struct binder_version *)ubuf)->protocol_version)) {
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ break;
-+ default:
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ ret = 0;
-+err:
-+ if (thread)
-+ thread->looper &= ~BINDER_LOOPER_STATE_NEED_RETURN;
-+ mutex_unlock(&binder_lock);
-+ wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
-+ if (ret && ret != -ERESTARTSYS)
-+ printk(KERN_INFO "binder: %d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret);
-+ return ret;
-+}
-+
-+static void binder_vma_open(struct vm_area_struct *vma)
-+{
-+ struct binder_proc *proc = vma->vm_private_data;
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE,
-+ "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
-+ proc->pid, vma->vm_start, vma->vm_end,
-+ (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
-+ (unsigned long)pgprot_val(vma->vm_page_prot));
-+ dump_stack();
-+}
-+
-+static void binder_vma_close(struct vm_area_struct *vma)
-+{
-+ struct binder_proc *proc = vma->vm_private_data;
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE,
-+ "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
-+ proc->pid, vma->vm_start, vma->vm_end,
-+ (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
-+ (unsigned long)pgprot_val(vma->vm_page_prot));
-+ proc->vma = NULL;
-+ binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES);
-+}
-+
-+static struct vm_operations_struct binder_vm_ops = {
-+ .open = binder_vma_open,
-+ .close = binder_vma_close,
-+};
-+
-+static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
-+{
-+ int ret;
-+ struct vm_struct *area;
-+ struct binder_proc *proc = filp->private_data;
-+ const char *failure_string;
-+ struct binder_buffer *buffer;
-+
-+ if ((vma->vm_end - vma->vm_start) > SZ_4M)
-+ vma->vm_end = vma->vm_start + SZ_4M;
-+
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE,
-+ "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n",
-+ proc->pid, vma->vm_start, vma->vm_end,
-+ (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
-+ (unsigned long)pgprot_val(vma->vm_page_prot));
-+
-+ if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) {
-+ ret = -EPERM;
-+ failure_string = "bad vm_flags";
-+ goto err_bad_arg;
-+ }
-+ vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
-+
-+ if (proc->buffer) {
-+ ret = -EBUSY;
-+ failure_string = "already mapped";
-+ goto err_already_mapped;
-+ }
-+
-+ area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP);
-+ if (area == NULL) {
-+ ret = -ENOMEM;
-+ failure_string = "get_vm_area";
-+ goto err_get_vm_area_failed;
-+ }
-+ proc->buffer = area->addr;
-+ proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
-+
-+#ifdef CONFIG_CPU_CACHE_VIPT
-+ if (cache_is_vipt_aliasing()) {
-+ while (CACHE_COLOUR((vma->vm_start ^ (uint32_t)proc->buffer))) {
-+ printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
-+ vma->vm_start += PAGE_SIZE;
-+ }
-+ }
-+#endif
-+ proc->pages = kzalloc(sizeof(proc->pages[0]) * ((vma->vm_end - vma->vm_start) / PAGE_SIZE), GFP_KERNEL);
-+ if (proc->pages == NULL) {
-+ ret = -ENOMEM;
-+ failure_string = "alloc page array";
-+ goto err_alloc_pages_failed;
-+ }
-+ proc->buffer_size = vma->vm_end - vma->vm_start;
-+
-+ vma->vm_ops = &binder_vm_ops;
-+ vma->vm_private_data = proc;
-+
-+ if (binder_update_page_range(proc, 1, proc->buffer, proc->buffer + PAGE_SIZE, vma)) {
-+ ret = -ENOMEM;
-+ failure_string = "alloc small buf";
-+ goto err_alloc_small_buf_failed;
-+ }
-+ buffer = proc->buffer;
-+ INIT_LIST_HEAD(&proc->buffers);
-+ list_add(&buffer->entry, &proc->buffers);
-+ buffer->free = 1;
-+ binder_insert_free_buffer(proc, buffer);
-+ proc->free_async_space = proc->buffer_size / 2;
-+ barrier();
-+ proc->files = get_files_struct(current);
-+ proc->vma = vma;
-+
-+ /*printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p\n",
-+ proc->pid, vma->vm_start, vma->vm_end, proc->buffer);*/
-+ return 0;
-+
-+err_alloc_small_buf_failed:
-+ kfree(proc->pages);
-+ proc->pages = NULL;
-+err_alloc_pages_failed:
-+ vfree(proc->buffer);
-+ proc->buffer = NULL;
-+err_get_vm_area_failed:
-+err_already_mapped:
-+err_bad_arg:
-+ printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n",
-+ proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
-+ return ret;
-+}
-+
-+static int binder_open(struct inode *nodp, struct file *filp)
-+{
-+ struct binder_proc *proc;
-+
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE, "binder_open: %d:%d\n",
-+ current->group_leader->pid, current->pid);
-+
-+ proc = kzalloc(sizeof(*proc), GFP_KERNEL);
-+ if (proc == NULL)
-+ return -ENOMEM;
-+ get_task_struct(current);
-+ proc->tsk = current;
-+ INIT_LIST_HEAD(&proc->todo);
-+ init_waitqueue_head(&proc->wait);
-+ proc->default_priority = task_nice(current);
-+ mutex_lock(&binder_lock);
-+ binder_stats_created(BINDER_STAT_PROC);
-+ hlist_add_head(&proc->proc_node, &binder_procs);
-+ proc->pid = current->group_leader->pid;
-+ INIT_LIST_HEAD(&proc->delivered_death);
-+ filp->private_data = proc;
-+ mutex_unlock(&binder_lock);
-+
-+ if (binder_proc_dir_entry_proc) {
-+ char strbuf[11];
-+ snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
-+ remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
-+ create_proc_read_entry(strbuf, S_IRUGO,
-+ binder_proc_dir_entry_proc,
-+ binder_read_proc_proc, proc);
-+ }
-+
-+ return 0;
-+}
-+
-+static int binder_flush(struct file *filp, fl_owner_t id)
-+{
-+ struct binder_proc *proc = filp->private_data;
-+
-+ binder_defer_work(proc, BINDER_DEFERRED_FLUSH);
-+
-+ return 0;
-+}
-+
-+static void binder_deferred_flush(struct binder_proc *proc)
-+{
-+ struct rb_node *n;
-+ int wake_count = 0;
-+ for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) {
-+ struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node);
-+ thread->looper |= BINDER_LOOPER_STATE_NEED_RETURN;
-+ if (thread->looper & BINDER_LOOPER_STATE_WAITING) {
-+ wake_up_interruptible(&thread->wait);
-+ wake_count++;
-+ }
-+ }
-+ wake_up_interruptible_all(&proc->wait);
-+
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE,
-+ "binder_flush: %d woke %d threads\n", proc->pid,
-+ wake_count);
-+}
-+
-+static int binder_release(struct inode *nodp, struct file *filp)
-+{
-+ struct binder_proc *proc = filp->private_data;
-+ if (binder_proc_dir_entry_proc) {
-+ char strbuf[11];
-+ snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
-+ remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
-+ }
-+
-+ binder_defer_work(proc, BINDER_DEFERRED_RELEASE);
-+
-+ return 0;
-+}
-+
-+static void binder_deferred_release(struct binder_proc *proc)
-+{
-+ struct hlist_node *pos;
-+ struct binder_transaction *t;
-+ struct rb_node *n;
-+ int threads, nodes, incoming_refs, outgoing_refs, buffers, active_transactions, page_count;
-+
-+ BUG_ON(proc->vma);
-+ BUG_ON(proc->files);
-+
-+ hlist_del(&proc->proc_node);
-+ if (binder_context_mgr_node && binder_context_mgr_node->proc == proc) {
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder_release: %d context_mgr_node gone\n",
-+ proc->pid);
-+ binder_context_mgr_node = NULL;
-+ }
-+
-+ threads = 0;
-+ active_transactions = 0;
-+ while ((n = rb_first(&proc->threads))) {
-+ struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node);
-+ threads++;
-+ active_transactions += binder_free_thread(proc, thread);
-+ }
-+ nodes = 0;
-+ incoming_refs = 0;
-+ while ((n = rb_first(&proc->nodes))) {
-+ struct binder_node *node = rb_entry(n, struct binder_node, rb_node);
-+
-+ nodes++;
-+ rb_erase(&node->rb_node, &proc->nodes);
-+ list_del_init(&node->work.entry);
-+ if (hlist_empty(&node->refs)) {
-+ kfree(node);
-+ binder_stats_deleted(BINDER_STAT_NODE);
-+ } else {
-+ struct binder_ref *ref;
-+ int death = 0;
-+
-+ node->proc = NULL;
-+ node->local_strong_refs = 0;
-+ node->local_weak_refs = 0;
-+ hlist_add_head(&node->dead_node, &binder_dead_nodes);
-+
-+ hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
-+ incoming_refs++;
-+ if (ref->death) {
-+ death++;
-+ if (list_empty(&ref->death->work.entry)) {
-+ ref->death->work.type = BINDER_WORK_DEAD_BINDER;
-+ list_add_tail(&ref->death->work.entry, &ref->proc->todo);
-+ wake_up_interruptible(&ref->proc->wait);
-+ } else
-+ BUG();
-+ }
-+ }
-+ binder_debug(BINDER_DEBUG_DEAD_BINDER,
-+ "binder: node %d now dead, "
-+ "refs %d, death %d\n", node->debug_id,
-+ incoming_refs, death);
-+ }
-+ }
-+ outgoing_refs = 0;
-+ while ((n = rb_first(&proc->refs_by_desc))) {
-+ struct binder_ref *ref = rb_entry(n, struct binder_ref,
-+ rb_node_desc);
-+ outgoing_refs++;
-+ binder_delete_ref(ref);
-+ }
-+ binder_release_work(&proc->todo);
-+ buffers = 0;
-+
-+ while ((n = rb_first(&proc->allocated_buffers))) {
-+ struct binder_buffer *buffer = rb_entry(n, struct binder_buffer,
-+ rb_node);
-+ t = buffer->transaction;
-+ if (t) {
-+ t->buffer = NULL;
-+ buffer->transaction = NULL;
-+ printk(KERN_ERR "binder: release proc %d, "
-+ "transaction %d, not freed\n",
-+ proc->pid, t->debug_id);
-+ /*BUG();*/
-+ }
-+ binder_free_buf(proc, buffer);
-+ buffers++;
-+ }
-+
-+ binder_stats_deleted(BINDER_STAT_PROC);
-+
-+ page_count = 0;
-+ if (proc->pages) {
-+ int i;
-+ for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
-+ if (proc->pages[i]) {
-+ binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-+ "binder_release: %d: "
-+ "page %d at %p not freed\n",
-+ proc->pid, i,
-+ proc->buffer + i * PAGE_SIZE);
-+ __free_page(proc->pages[i]);
-+ page_count++;
-+ }
-+ }
-+ kfree(proc->pages);
-+ vfree(proc->buffer);
-+ }
-+
-+ put_task_struct(proc->tsk);
-+
-+ binder_debug(BINDER_DEBUG_OPEN_CLOSE,
-+ "binder_release: %d threads %d, nodes %d (ref %d), "
-+ "refs %d, active transactions %d, buffers %d, "
-+ "pages %d\n",
-+ proc->pid, threads, nodes, incoming_refs, outgoing_refs,
-+ active_transactions, buffers, page_count);
-+
-+ kfree(proc);
-+}
-+
-+static void binder_deferred_func(struct work_struct *work)
-+{
-+ struct binder_proc *proc;
-+ struct files_struct *files;
-+
-+ int defer;
-+ do {
-+ mutex_lock(&binder_lock);
-+ mutex_lock(&binder_deferred_lock);
-+ if (!hlist_empty(&binder_deferred_list)) {
-+ proc = hlist_entry(binder_deferred_list.first,
-+ struct binder_proc, deferred_work_node);
-+ hlist_del_init(&proc->deferred_work_node);
-+ defer = proc->deferred_work;
-+ proc->deferred_work = 0;
-+ } else {
-+ proc = NULL;
-+ defer = 0;
-+ }
-+ mutex_unlock(&binder_deferred_lock);
-+
-+ files = NULL;
-+ if (defer & BINDER_DEFERRED_PUT_FILES) {
-+ files = proc->files;
-+ if (files)
-+ proc->files = NULL;
-+ }
-+
-+ if (defer & BINDER_DEFERRED_FLUSH)
-+ binder_deferred_flush(proc);
-+
-+ if (defer & BINDER_DEFERRED_RELEASE)
-+ binder_deferred_release(proc); /* frees proc */
-+
-+ mutex_unlock(&binder_lock);
-+ if (files)
-+ put_files_struct(files);
-+ } while (proc);
-+}
-+static DECLARE_WORK(binder_deferred_work, binder_deferred_func);
-+
-+static void
-+binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
-+{
-+ mutex_lock(&binder_deferred_lock);
-+ proc->deferred_work |= defer;
-+ if (hlist_unhashed(&proc->deferred_work_node)) {
-+ hlist_add_head(&proc->deferred_work_node,
-+ &binder_deferred_list);
-+ schedule_work(&binder_deferred_work);
-+ }
-+ mutex_unlock(&binder_deferred_lock);
-+}
-+
-+static char *print_binder_transaction(char *buf, char *end, const char *prefix,
-+ struct binder_transaction *t)
-+{
-+ buf += snprintf(buf, end - buf,
-+ "%s %d: %p from %d:%d to %d:%d code %x "
-+ "flags %x pri %ld r%d",
-+ prefix, t->debug_id, t,
-+ t->from ? t->from->proc->pid : 0,
-+ t->from ? t->from->pid : 0,
-+ t->to_proc ? t->to_proc->pid : 0,
-+ t->to_thread ? t->to_thread->pid : 0,
-+ t->code, t->flags, t->priority, t->need_reply);
-+ if (buf >= end)
-+ return buf;
-+ if (t->buffer == NULL) {
-+ buf += snprintf(buf, end - buf, " buffer free\n");
-+ return buf;
-+ }
-+ if (t->buffer->target_node) {
-+ buf += snprintf(buf, end - buf, " node %d",
-+ t->buffer->target_node->debug_id);
-+ if (buf >= end)
-+ return buf;
-+ }
-+ buf += snprintf(buf, end - buf, " size %zd:%zd data %p\n",
-+ t->buffer->data_size, t->buffer->offsets_size,
-+ t->buffer->data);
-+ return buf;
-+}
-+
-+static char *print_binder_buffer(char *buf, char *end, const char *prefix,
-+ struct binder_buffer *buffer)
-+{
-+ buf += snprintf(buf, end - buf, "%s %d: %p size %zd:%zd %s\n",
-+ prefix, buffer->debug_id, buffer->data,
-+ buffer->data_size, buffer->offsets_size,
-+ buffer->transaction ? "active" : "delivered");
-+ return buf;
-+}
-+
-+static char *print_binder_work(char *buf, char *end, const char *prefix,
-+ const char *transaction_prefix,
-+ struct binder_work *w)
-+{
-+ struct binder_node *node;
-+ struct binder_transaction *t;
-+
-+ switch (w->type) {
-+ case BINDER_WORK_TRANSACTION:
-+ t = container_of(w, struct binder_transaction, work);
-+ buf = print_binder_transaction(buf, end, transaction_prefix, t);
-+ break;
-+ case BINDER_WORK_TRANSACTION_COMPLETE:
-+ buf += snprintf(buf, end - buf,
-+ "%stransaction complete\n", prefix);
-+ break;
-+ case BINDER_WORK_NODE:
-+ node = container_of(w, struct binder_node, work);
-+ buf += snprintf(buf, end - buf, "%snode work %d: u%p c%p\n",
-+ prefix, node->debug_id, node->ptr,
-+ node->cookie);
-+ break;
-+ case BINDER_WORK_DEAD_BINDER:
-+ buf += snprintf(buf, end - buf, "%shas dead binder\n", prefix);
-+ break;
-+ case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
-+ buf += snprintf(buf, end - buf,
-+ "%shas cleared dead binder\n", prefix);
-+ break;
-+ case BINDER_WORK_CLEAR_DEATH_NOTIFICATION:
-+ buf += snprintf(buf, end - buf,
-+ "%shas cleared death notification\n", prefix);
-+ break;
-+ default:
-+ buf += snprintf(buf, end - buf, "%sunknown work: type %d\n",
-+ prefix, w->type);
-+ break;
-+ }
-+ return buf;
-+}
-+
-+static char *print_binder_thread(char *buf, char *end,
-+ struct binder_thread *thread,
-+ int print_always)
-+{
-+ struct binder_transaction *t;
-+ struct binder_work *w;
-+ char *start_buf = buf;
-+ char *header_buf;
-+
-+ buf += snprintf(buf, end - buf, " thread %d: l %02x\n",
-+ thread->pid, thread->looper);
-+ header_buf = buf;
-+ t = thread->transaction_stack;
-+ while (t) {
-+ if (buf >= end)
-+ break;
-+ if (t->from == thread) {
-+ buf = print_binder_transaction(buf, end,
-+ " outgoing transaction", t);
-+ t = t->from_parent;
-+ } else if (t->to_thread == thread) {
-+ buf = print_binder_transaction(buf, end,
-+ " incoming transaction", t);
-+ t = t->to_parent;
-+ } else {
-+ buf = print_binder_transaction(buf, end,
-+ " bad transaction", t);
-+ t = NULL;
-+ }
-+ }
-+ list_for_each_entry(w, &thread->todo, entry) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_work(buf, end, " ",
-+ " pending transaction", w);
-+ }
-+ if (!print_always && buf == header_buf)
-+ buf = start_buf;
-+ return buf;
-+}
-+
-+static char *print_binder_node(char *buf, char *end, struct binder_node *node)
-+{
-+ struct binder_ref *ref;
-+ struct hlist_node *pos;
-+ struct binder_work *w;
-+ int count;
-+
-+ count = 0;
-+ hlist_for_each_entry(ref, pos, &node->refs, node_entry)
-+ count++;
-+
-+ buf += snprintf(buf, end - buf,
-+ " node %d: u%p c%p hs %d hw %d ls %d lw %d "
-+ "is %d iw %d",
-+ node->debug_id, node->ptr, node->cookie,
-+ node->has_strong_ref, node->has_weak_ref,
-+ node->local_strong_refs, node->local_weak_refs,
-+ node->internal_strong_refs, count);
-+ if (buf >= end)
-+ return buf;
-+ if (count) {
-+ buf += snprintf(buf, end - buf, " proc");
-+ if (buf >= end)
-+ return buf;
-+ hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
-+ buf += snprintf(buf, end - buf, " %d", ref->proc->pid);
-+ if (buf >= end)
-+ return buf;
-+ }
-+ }
-+ buf += snprintf(buf, end - buf, "\n");
-+ list_for_each_entry(w, &node->async_todo, entry) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_work(buf, end, " ",
-+ " pending async transaction", w);
-+ }
-+ return buf;
-+}
-+
-+static char *print_binder_ref(char *buf, char *end, struct binder_ref *ref)
-+{
-+ buf += snprintf(buf, end - buf,
-+ " ref %d: desc %d %snode %d s %d w %d d %p\n",
-+ ref->debug_id, ref->desc,
-+ ref->node->proc ? "" : "dead ", ref->node->debug_id,
-+ ref->strong, ref->weak, ref->death);
-+ return buf;
-+}
-+
-+static char *print_binder_proc(char *buf, char *end,
-+ struct binder_proc *proc, int print_all)
-+{
-+ struct binder_work *w;
-+ struct rb_node *n;
-+ char *start_buf = buf;
-+ char *header_buf;
-+
-+ buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
-+ header_buf = buf;
-+
-+ for (n = rb_first(&proc->threads);
-+ n != NULL && buf < end;
-+ n = rb_next(n))
-+ buf = print_binder_thread(buf, end,
-+ rb_entry(n, struct binder_thread,
-+ rb_node), print_all);
-+ for (n = rb_first(&proc->nodes);
-+ n != NULL && buf < end;
-+ n = rb_next(n)) {
-+ struct binder_node *node = rb_entry(n, struct binder_node,
-+ rb_node);
-+ if (print_all || node->has_async_transaction)
-+ buf = print_binder_node(buf, end, node);
-+ }
-+ if (print_all) {
-+ for (n = rb_first(&proc->refs_by_desc);
-+ n != NULL && buf < end;
-+ n = rb_next(n))
-+ buf = print_binder_ref(buf, end,
-+ rb_entry(n, struct binder_ref,
-+ rb_node_desc));
-+ }
-+ for (n = rb_first(&proc->allocated_buffers);
-+ n != NULL && buf < end;
-+ n = rb_next(n))
-+ buf = print_binder_buffer(buf, end, " buffer",
-+ rb_entry(n, struct binder_buffer,
-+ rb_node));
-+ list_for_each_entry(w, &proc->todo, entry) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_work(buf, end, " ",
-+ " pending transaction", w);
-+ }
-+ list_for_each_entry(w, &proc->delivered_death, entry) {
-+ if (buf >= end)
-+ break;
-+ buf += snprintf(buf, end - buf,
-+ " has delivered dead binder\n");
-+ break;
-+ }
-+ if (!print_all && buf == header_buf)
-+ buf = start_buf;
-+ return buf;
-+}
-+
-+static const char *binder_return_strings[] = {
-+ "BR_ERROR",
-+ "BR_OK",
-+ "BR_TRANSACTION",
-+ "BR_REPLY",
-+ "BR_ACQUIRE_RESULT",
-+ "BR_DEAD_REPLY",
-+ "BR_TRANSACTION_COMPLETE",
-+ "BR_INCREFS",
-+ "BR_ACQUIRE",
-+ "BR_RELEASE",
-+ "BR_DECREFS",
-+ "BR_ATTEMPT_ACQUIRE",
-+ "BR_NOOP",
-+ "BR_SPAWN_LOOPER",
-+ "BR_FINISHED",
-+ "BR_DEAD_BINDER",
-+ "BR_CLEAR_DEATH_NOTIFICATION_DONE",
-+ "BR_FAILED_REPLY"
-+};
-+
-+static const char *binder_command_strings[] = {
-+ "BC_TRANSACTION",
-+ "BC_REPLY",
-+ "BC_ACQUIRE_RESULT",
-+ "BC_FREE_BUFFER",
-+ "BC_INCREFS",
-+ "BC_ACQUIRE",
-+ "BC_RELEASE",
-+ "BC_DECREFS",
-+ "BC_INCREFS_DONE",
-+ "BC_ACQUIRE_DONE",
-+ "BC_ATTEMPT_ACQUIRE",
-+ "BC_REGISTER_LOOPER",
-+ "BC_ENTER_LOOPER",
-+ "BC_EXIT_LOOPER",
-+ "BC_REQUEST_DEATH_NOTIFICATION",
-+ "BC_CLEAR_DEATH_NOTIFICATION",
-+ "BC_DEAD_BINDER_DONE"
-+};
-+
-+static const char *binder_objstat_strings[] = {
-+ "proc",
-+ "thread",
-+ "node",
-+ "ref",
-+ "death",
-+ "transaction",
-+ "transaction_complete"
-+};
-+
-+static char *print_binder_stats(char *buf, char *end, const char *prefix,
-+ struct binder_stats *stats)
-+{
-+ int i;
-+
-+ BUILD_BUG_ON(ARRAY_SIZE(stats->bc) !=
-+ ARRAY_SIZE(binder_command_strings));
-+ for (i = 0; i < ARRAY_SIZE(stats->bc); i++) {
-+ if (stats->bc[i])
-+ buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
-+ binder_command_strings[i],
-+ stats->bc[i]);
-+ if (buf >= end)
-+ return buf;
-+ }
-+
-+ BUILD_BUG_ON(ARRAY_SIZE(stats->br) !=
-+ ARRAY_SIZE(binder_return_strings));
-+ for (i = 0; i < ARRAY_SIZE(stats->br); i++) {
-+ if (stats->br[i])
-+ buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
-+ binder_return_strings[i], stats->br[i]);
-+ if (buf >= end)
-+ return buf;
-+ }
-+
-+ BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
-+ ARRAY_SIZE(binder_objstat_strings));
-+ BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
-+ ARRAY_SIZE(stats->obj_deleted));
-+ for (i = 0; i < ARRAY_SIZE(stats->obj_created); i++) {
-+ if (stats->obj_created[i] || stats->obj_deleted[i])
-+ buf += snprintf(buf, end - buf,
-+ "%s%s: active %d total %d\n", prefix,
-+ binder_objstat_strings[i],
-+ stats->obj_created[i] -
-+ stats->obj_deleted[i],
-+ stats->obj_created[i]);
-+ if (buf >= end)
-+ return buf;
-+ }
-+ return buf;
-+}
-+
-+static char *print_binder_proc_stats(char *buf, char *end,
-+ struct binder_proc *proc)
-+{
-+ struct binder_work *w;
-+ struct rb_node *n;
-+ int count, strong, weak;
-+
-+ buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
-+ if (buf >= end)
-+ return buf;
-+ count = 0;
-+ for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n))
-+ count++;
-+ buf += snprintf(buf, end - buf, " threads: %d\n", count);
-+ if (buf >= end)
-+ return buf;
-+ buf += snprintf(buf, end - buf, " requested threads: %d+%d/%d\n"
-+ " ready threads %d\n"
-+ " free async space %zd\n", proc->requested_threads,
-+ proc->requested_threads_started, proc->max_threads,
-+ proc->ready_threads, proc->free_async_space);
-+ if (buf >= end)
-+ return buf;
-+ count = 0;
-+ for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n))
-+ count++;
-+ buf += snprintf(buf, end - buf, " nodes: %d\n", count);
-+ if (buf >= end)
-+ return buf;
-+ count = 0;
-+ strong = 0;
-+ weak = 0;
-+ for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) {
-+ struct binder_ref *ref = rb_entry(n, struct binder_ref,
-+ rb_node_desc);
-+ count++;
-+ strong += ref->strong;
-+ weak += ref->weak;
-+ }
-+ buf += snprintf(buf, end - buf, " refs: %d s %d w %d\n",
-+ count, strong, weak);
-+ if (buf >= end)
-+ return buf;
-+
-+ count = 0;
-+ for (n = rb_first(&proc->allocated_buffers); n != NULL; n = rb_next(n))
-+ count++;
-+ buf += snprintf(buf, end - buf, " buffers: %d\n", count);
-+ if (buf >= end)
-+ return buf;
-+
-+ count = 0;
-+ list_for_each_entry(w, &proc->todo, entry) {
-+ switch (w->type) {
-+ case BINDER_WORK_TRANSACTION:
-+ count++;
-+ break;
-+ default:
-+ break;
-+ }
-+ }
-+ buf += snprintf(buf, end - buf, " pending transactions: %d\n", count);
-+ if (buf >= end)
-+ return buf;
-+
-+ buf = print_binder_stats(buf, end, " ", &proc->stats);
-+
-+ return buf;
-+}
-+
-+
-+static int binder_read_proc_state(char *page, char **start, off_t off,
-+ int count, int *eof, void *data)
-+{
-+ struct binder_proc *proc;
-+ struct hlist_node *pos;
-+ struct binder_node *node;
-+ int len = 0;
-+ char *buf = page;
-+ char *end = page + PAGE_SIZE;
-+ int do_lock = !binder_debug_no_lock;
-+
-+ if (off)
-+ return 0;
-+
-+ if (do_lock)
-+ mutex_lock(&binder_lock);
-+
-+ buf += snprintf(buf, end - buf, "binder state:\n");
-+
-+ if (!hlist_empty(&binder_dead_nodes))
-+ buf += snprintf(buf, end - buf, "dead nodes:\n");
-+ hlist_for_each_entry(node, pos, &binder_dead_nodes, dead_node) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_node(buf, end, node);
-+ }
-+
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_proc(buf, end, proc, 1);
-+ }
-+ if (do_lock)
-+ mutex_unlock(&binder_lock);
-+ if (buf > page + PAGE_SIZE)
-+ buf = page + PAGE_SIZE;
-+
-+ *start = page + off;
-+
-+ len = buf - page;
-+ if (len > off)
-+ len -= off;
-+ else
-+ len = 0;
-+
-+ return len < count ? len : count;
-+}
-+
-+static int binder_read_proc_stats(char *page, char **start, off_t off,
-+ int count, int *eof, void *data)
-+{
-+ struct binder_proc *proc;
-+ struct hlist_node *pos;
-+ int len = 0;
-+ char *p = page;
-+ int do_lock = !binder_debug_no_lock;
-+
-+ if (off)
-+ return 0;
-+
-+ if (do_lock)
-+ mutex_lock(&binder_lock);
-+
-+ p += snprintf(p, PAGE_SIZE, "binder stats:\n");
-+
-+ p = print_binder_stats(p, page + PAGE_SIZE, "", &binder_stats);
-+
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-+ if (p >= page + PAGE_SIZE)
-+ break;
-+ p = print_binder_proc_stats(p, page + PAGE_SIZE, proc);
-+ }
-+ if (do_lock)
-+ mutex_unlock(&binder_lock);
-+ if (p > page + PAGE_SIZE)
-+ p = page + PAGE_SIZE;
-+
-+ *start = page + off;
-+
-+ len = p - page;
-+ if (len > off)
-+ len -= off;
-+ else
-+ len = 0;
-+
-+ return len < count ? len : count;
-+}
-+
-+static int binder_read_proc_transactions(char *page, char **start, off_t off,
-+ int count, int *eof, void *data)
-+{
-+ struct binder_proc *proc;
-+ struct hlist_node *pos;
-+ int len = 0;
-+ char *buf = page;
-+ char *end = page + PAGE_SIZE;
-+ int do_lock = !binder_debug_no_lock;
-+
-+ if (off)
-+ return 0;
-+
-+ if (do_lock)
-+ mutex_lock(&binder_lock);
-+
-+ buf += snprintf(buf, end - buf, "binder transactions:\n");
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_proc(buf, end, proc, 0);
-+ }
-+ if (do_lock)
-+ mutex_unlock(&binder_lock);
-+ if (buf > page + PAGE_SIZE)
-+ buf = page + PAGE_SIZE;
-+
-+ *start = page + off;
-+
-+ len = buf - page;
-+ if (len > off)
-+ len -= off;
-+ else
-+ len = 0;
-+
-+ return len < count ? len : count;
-+}
-+
-+static int binder_read_proc_proc(char *page, char **start, off_t off,
-+ int count, int *eof, void *data)
-+{
-+ struct binder_proc *proc = data;
-+ int len = 0;
-+ char *p = page;
-+ int do_lock = !binder_debug_no_lock;
-+
-+ if (off)
-+ return 0;
-+
-+ if (do_lock)
-+ mutex_lock(&binder_lock);
-+ p += snprintf(p, PAGE_SIZE, "binder proc state:\n");
-+ p = print_binder_proc(p, page + PAGE_SIZE, proc, 1);
-+ if (do_lock)
-+ mutex_unlock(&binder_lock);
-+
-+ if (p > page + PAGE_SIZE)
-+ p = page + PAGE_SIZE;
-+ *start = page + off;
-+
-+ len = p - page;
-+ if (len > off)
-+ len -= off;
-+ else
-+ len = 0;
-+
-+ return len < count ? len : count;
-+}
-+
-+static char *print_binder_transaction_log_entry(char *buf, char *end,
-+ struct binder_transaction_log_entry *e)
-+{
-+ buf += snprintf(buf, end - buf,
-+ "%d: %s from %d:%d to %d:%d node %d handle %d "
-+ "size %d:%d\n",
-+ e->debug_id, (e->call_type == 2) ? "reply" :
-+ ((e->call_type == 1) ? "async" : "call "), e->from_proc,
-+ e->from_thread, e->to_proc, e->to_thread, e->to_node,
-+ e->target_handle, e->data_size, e->offsets_size);
-+ return buf;
-+}
-+
-+static int binder_read_proc_transaction_log(
-+ char *page, char **start, off_t off, int count, int *eof, void *data)
-+{
-+ struct binder_transaction_log *log = data;
-+ int len = 0;
-+ int i;
-+ char *buf = page;
-+ char *end = page + PAGE_SIZE;
-+
-+ if (off)
-+ return 0;
-+
-+ if (log->full) {
-+ for (i = log->next; i < ARRAY_SIZE(log->entry); i++) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_transaction_log_entry(buf, end,
-+ &log->entry[i]);
-+ }
-+ }
-+ for (i = 0; i < log->next; i++) {
-+ if (buf >= end)
-+ break;
-+ buf = print_binder_transaction_log_entry(buf, end,
-+ &log->entry[i]);
-+ }
-+
-+ *start = page + off;
-+
-+ len = buf - page;
-+ if (len > off)
-+ len -= off;
-+ else
-+ len = 0;
-+
-+ return len < count ? len : count;
-+}
-+
-+static const struct file_operations binder_fops = {
-+ .owner = THIS_MODULE,
-+ .poll = binder_poll,
-+ .unlocked_ioctl = binder_ioctl,
-+ .mmap = binder_mmap,
-+ .open = binder_open,
-+ .flush = binder_flush,
-+ .release = binder_release,
-+};
-+
-+static struct miscdevice binder_miscdev = {
-+ .minor = MISC_DYNAMIC_MINOR,
-+ .name = "binder",
-+ .fops = &binder_fops
-+};
-+
-+static int __init binder_init(void)
-+{
-+ int ret;
-+
-+ binder_proc_dir_entry_root = proc_mkdir("binder", NULL);
-+ if (binder_proc_dir_entry_root)
-+ binder_proc_dir_entry_proc = proc_mkdir("proc",
-+ binder_proc_dir_entry_root);
-+ ret = misc_register(&binder_miscdev);
-+ if (binder_proc_dir_entry_root) {
-+ create_proc_read_entry("state",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ binder_read_proc_state,
-+ NULL);
-+ create_proc_read_entry("stats",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ binder_read_proc_stats,
-+ NULL);
-+ create_proc_read_entry("transactions",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ binder_read_proc_transactions,
-+ NULL);
-+ create_proc_read_entry("transaction_log",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ binder_read_proc_transaction_log,
-+ &binder_transaction_log);
-+ create_proc_read_entry("failed_transaction_log",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ binder_read_proc_transaction_log,
-+ &binder_transaction_log_failed);
-+ }
-+ return ret;
-+}
-+
-+device_initcall(binder_init);
-+
-+MODULE_LICENSE("GPL v2");
-diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
-new file mode 100644
-index 0000000..863ae1a
---- /dev/null
-+++ b/drivers/staging/android/binder.h
-@@ -0,0 +1,330 @@
-+/*
-+ * Copyright (C) 2008 Google, Inc.
-+ *
-+ * Based on, but no longer compatible with, the original
-+ * OpenBinder.org binder driver interface, which is:
-+ *
-+ * Copyright (c) 2005 Palmsource, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#ifndef _LINUX_BINDER_H
-+#define _LINUX_BINDER_H
-+
-+#include <linux/ioctl.h>
-+
-+#define B_PACK_CHARS(c1, c2, c3, c4) \
-+ ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
-+#define B_TYPE_LARGE 0x85
-+
-+enum {
-+ BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
-+ BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
-+ BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
-+ BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
-+ BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
-+};
-+
-+enum {
-+ FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
-+ FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
-+};
-+
-+/*
-+ * This is the flattened representation of a Binder object for transfer
-+ * between processes. The 'offsets' supplied as part of a binder transaction
-+ * contains offsets into the data where these structures occur. The Binder
-+ * driver takes care of re-writing the structure type and data as it moves
-+ * between processes.
-+ */
-+struct flat_binder_object {
-+ /* 8 bytes for large_flat_header. */
-+ unsigned long type;
-+ unsigned long flags;
-+
-+ /* 8 bytes of data. */
-+ union {
-+ void *binder; /* local object */
-+ signed long handle; /* remote object */
-+ };
-+
-+ /* extra data associated with local object */
-+ void *cookie;
-+};
-+
-+/*
-+ * On 64-bit platforms where user code may run in 32-bits the driver must
-+ * translate the buffer (and local binder) addresses apropriately.
-+ */
-+
-+struct binder_write_read {
-+ signed long write_size; /* bytes to write */
-+ signed long write_consumed; /* bytes consumed by driver */
-+ unsigned long write_buffer;
-+ signed long read_size; /* bytes to read */
-+ signed long read_consumed; /* bytes consumed by driver */
-+ unsigned long read_buffer;
-+};
-+
-+/* Use with BINDER_VERSION, driver fills in fields. */
-+struct binder_version {
-+ /* driver protocol version -- increment with incompatible change */
-+ signed long protocol_version;
-+};
-+
-+/* This is the current protocol version. */
-+#define BINDER_CURRENT_PROTOCOL_VERSION 7
-+
-+#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
-+#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, int64_t)
-+#define BINDER_SET_MAX_THREADS _IOW('b', 5, size_t)
-+#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, int)
-+#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, int)
-+#define BINDER_THREAD_EXIT _IOW('b', 8, int)
-+#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
-+
-+/*
-+ * NOTE: Two special error codes you should check for when calling
-+ * in to the driver are:
-+ *
-+ * EINTR -- The operation has been interupted. This should be
-+ * handled by retrying the ioctl() until a different error code
-+ * is returned.
-+ *
-+ * ECONNREFUSED -- The driver is no longer accepting operations
-+ * from your process. That is, the process is being destroyed.
-+ * You should handle this by exiting from your process. Note
-+ * that once this error code is returned, all further calls to
-+ * the driver from any thread will return this same code.
-+ */
-+
-+enum transaction_flags {
-+ TF_ONE_WAY = 0x01, /* this is a one-way call: async, no return */
-+ TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
-+ TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
-+ TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
-+};
-+
-+struct binder_transaction_data {
-+ /* The first two are only used for bcTRANSACTION and brTRANSACTION,
-+ * identifying the target and contents of the transaction.
-+ */
-+ union {
-+ size_t handle; /* target descriptor of command transaction */
-+ void *ptr; /* target descriptor of return transaction */
-+ } target;
-+ void *cookie; /* target object cookie */
-+ unsigned int code; /* transaction command */
-+
-+ /* General information about the transaction. */
-+ unsigned int flags;
-+ pid_t sender_pid;
-+ uid_t sender_euid;
-+ size_t data_size; /* number of bytes of data */
-+ size_t offsets_size; /* number of bytes of offsets */
-+
-+ /* If this transaction is inline, the data immediately
-+ * follows here; otherwise, it ends with a pointer to
-+ * the data buffer.
-+ */
-+ union {
-+ struct {
-+ /* transaction data */
-+ const void *buffer;
-+ /* offsets from buffer to flat_binder_object structs */
-+ const void *offsets;
-+ } ptr;
-+ uint8_t buf[8];
-+ } data;
-+};
-+
-+struct binder_ptr_cookie {
-+ void *ptr;
-+ void *cookie;
-+};
-+
-+struct binder_pri_desc {
-+ int priority;
-+ int desc;
-+};
-+
-+struct binder_pri_ptr_cookie {
-+ int priority;
-+ void *ptr;
-+ void *cookie;
-+};
-+
-+enum BinderDriverReturnProtocol {
-+ BR_ERROR = _IOR('r', 0, int),
-+ /*
-+ * int: error code
-+ */
-+
-+ BR_OK = _IO('r', 1),
-+ /* No parameters! */
-+
-+ BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
-+ BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
-+ /*
-+ * binder_transaction_data: the received command.
-+ */
-+
-+ BR_ACQUIRE_RESULT = _IOR('r', 4, int),
-+ /*
-+ * not currently supported
-+ * int: 0 if the last bcATTEMPT_ACQUIRE was not successful.
-+ * Else the remote object has acquired a primary reference.
-+ */
-+
-+ BR_DEAD_REPLY = _IO('r', 5),
-+ /*
-+ * The target of the last transaction (either a bcTRANSACTION or
-+ * a bcATTEMPT_ACQUIRE) is no longer with us. No parameters.
-+ */
-+
-+ BR_TRANSACTION_COMPLETE = _IO('r', 6),
-+ /*
-+ * No parameters... always refers to the last transaction requested
-+ * (including replies). Note that this will be sent even for
-+ * asynchronous transactions.
-+ */
-+
-+ BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie),
-+ BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie),
-+ BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie),
-+ BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie),
-+ /*
-+ * void *: ptr to binder
-+ * void *: cookie for binder
-+ */
-+
-+ BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie),
-+ /*
-+ * not currently supported
-+ * int: priority
-+ * void *: ptr to binder
-+ * void *: cookie for binder
-+ */
-+
-+ BR_NOOP = _IO('r', 12),
-+ /*
-+ * No parameters. Do nothing and examine the next command. It exists
-+ * primarily so that we can replace it with a BR_SPAWN_LOOPER command.
-+ */
-+
-+ BR_SPAWN_LOOPER = _IO('r', 13),
-+ /*
-+ * No parameters. The driver has determined that a process has no
-+ * threads waiting to service incomming transactions. When a process
-+ * receives this command, it must spawn a new service thread and
-+ * register it via bcENTER_LOOPER.
-+ */
-+
-+ BR_FINISHED = _IO('r', 14),
-+ /*
-+ * not currently supported
-+ * stop threadpool thread
-+ */
-+
-+ BR_DEAD_BINDER = _IOR('r', 15, void *),
-+ /*
-+ * void *: cookie
-+ */
-+ BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, void *),
-+ /*
-+ * void *: cookie
-+ */
-+
-+ BR_FAILED_REPLY = _IO('r', 17),
-+ /*
-+ * The the last transaction (either a bcTRANSACTION or
-+ * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
-+ */
-+};
-+
-+enum BinderDriverCommandProtocol {
-+ BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
-+ BC_REPLY = _IOW('c', 1, struct binder_transaction_data),
-+ /*
-+ * binder_transaction_data: the sent command.
-+ */
-+
-+ BC_ACQUIRE_RESULT = _IOW('c', 2, int),
-+ /*
-+ * not currently supported
-+ * int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful.
-+ * Else you have acquired a primary reference on the object.
-+ */
-+
-+ BC_FREE_BUFFER = _IOW('c', 3, int),
-+ /*
-+ * void *: ptr to transaction data received on a read
-+ */
-+
-+ BC_INCREFS = _IOW('c', 4, int),
-+ BC_ACQUIRE = _IOW('c', 5, int),
-+ BC_RELEASE = _IOW('c', 6, int),
-+ BC_DECREFS = _IOW('c', 7, int),
-+ /*
-+ * int: descriptor
-+ */
-+
-+ BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie),
-+ BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie),
-+ /*
-+ * void *: ptr to binder
-+ * void *: cookie for binder
-+ */
-+
-+ BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc),
-+ /*
-+ * not currently supported
-+ * int: priority
-+ * int: descriptor
-+ */
-+
-+ BC_REGISTER_LOOPER = _IO('c', 11),
-+ /*
-+ * No parameters.
-+ * Register a spawned looper thread with the device.
-+ */
-+
-+ BC_ENTER_LOOPER = _IO('c', 12),
-+ BC_EXIT_LOOPER = _IO('c', 13),
-+ /*
-+ * No parameters.
-+ * These two commands are sent as an application-level thread
-+ * enters and exits the binder loop, respectively. They are
-+ * used so the binder can have an accurate count of the number
-+ * of looping threads it has available.
-+ */
-+
-+ BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_ptr_cookie),
-+ /*
-+ * void *: ptr to binder
-+ * void *: cookie
-+ */
-+
-+ BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_ptr_cookie),
-+ /*
-+ * void *: ptr to binder
-+ * void *: cookie
-+ */
-+
-+ BC_DEAD_BINDER_DONE = _IOW('c', 16, void *),
-+ /*
-+ * void *: cookie
-+ */
-+};
-+
-+#endif /* _LINUX_BINDER_H */
-+
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-new file mode 100644
-index 0000000..6c10b45
---- /dev/null
-+++ b/drivers/staging/android/logger.c
-@@ -0,0 +1,607 @@
-+/*
-+ * drivers/misc/logger.c
-+ *
-+ * A Logging Subsystem
-+ *
-+ * Copyright (C) 2007-2008 Google, Inc.
-+ *
-+ * Robert Love <rlove@google.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/fs.h>
-+#include <linux/miscdevice.h>
-+#include <linux/uaccess.h>
-+#include <linux/poll.h>
-+#include <linux/time.h>
-+#include "logger.h"
-+
-+#include <asm/ioctls.h>
-+
-+/*
-+ * struct logger_log - represents a specific log, such as 'main' or 'radio'
-+ *
-+ * This structure lives from module insertion until module removal, so it does
-+ * not need additional reference counting. The structure is protected by the
-+ * mutex 'mutex'.
-+ */
-+struct logger_log {
-+ unsigned char *buffer;/* the ring buffer itself */
-+ struct miscdevice misc; /* misc device representing the log */
-+ wait_queue_head_t wq; /* wait queue for readers */
-+ struct list_head readers; /* this log's readers */
-+ struct mutex mutex; /* mutex protecting buffer */
-+ size_t w_off; /* current write head offset */
-+ size_t head; /* new readers start here */
-+ size_t size; /* size of the log */
-+};
-+
-+/*
-+ * struct logger_reader - a logging device open for reading
-+ *
-+ * This object lives from open to release, so we don't need additional
-+ * reference counting. The structure is protected by log->mutex.
-+ */
-+struct logger_reader {
-+ struct logger_log *log; /* associated log */
-+ struct list_head list; /* entry in logger_log's list */
-+ size_t r_off; /* current read head offset */
-+};
-+
-+/* logger_offset - returns index 'n' into the log via (optimized) modulus */
-+#define logger_offset(n) ((n) & (log->size - 1))
-+
-+/*
-+ * file_get_log - Given a file structure, return the associated log
-+ *
-+ * This isn't aesthetic. We have several goals:
-+ *
-+ * 1) Need to quickly obtain the associated log during an I/O operation
-+ * 2) Readers need to maintain state (logger_reader)
-+ * 3) Writers need to be very fast (open() should be a near no-op)
-+ *
-+ * In the reader case, we can trivially go file->logger_reader->logger_log.
-+ * For a writer, we don't want to maintain a logger_reader, so we just go
-+ * file->logger_log. Thus what file->private_data points at depends on whether
-+ * or not the file was opened for reading. This function hides that dirtiness.
-+ */
-+static inline struct logger_log *file_get_log(struct file *file)
-+{
-+ if (file->f_mode & FMODE_READ) {
-+ struct logger_reader *reader = file->private_data;
-+ return reader->log;
-+ } else
-+ return file->private_data;
-+}
-+
-+/*
-+ * get_entry_len - Grabs the length of the payload of the next entry starting
-+ * from 'off'.
-+ *
-+ * Caller needs to hold log->mutex.
-+ */
-+static __u32 get_entry_len(struct logger_log *log, size_t off)
-+{
-+ __u16 val;
-+
-+ switch (log->size - off) {
-+ case 1:
-+ memcpy(&val, log->buffer + off, 1);
-+ memcpy(((char *) &val) + 1, log->buffer, 1);
-+ break;
-+ default:
-+ memcpy(&val, log->buffer + off, 2);
-+ }
-+
-+ return sizeof(struct logger_entry) + val;
-+}
-+
-+/*
-+ * do_read_log_to_user - reads exactly 'count' bytes from 'log' into the
-+ * user-space buffer 'buf'. Returns 'count' on success.
-+ *
-+ * Caller must hold log->mutex.
-+ */
-+static ssize_t do_read_log_to_user(struct logger_log *log,
-+ struct logger_reader *reader,
-+ char __user *buf,
-+ size_t count)
-+{
-+ size_t len;
-+
-+ /*
-+ * We read from the log in two disjoint operations. First, we read from
-+ * the current read head offset up to 'count' bytes or to the end of
-+ * the log, whichever comes first.
-+ */
-+ len = min(count, log->size - reader->r_off);
-+ if (copy_to_user(buf, log->buffer + reader->r_off, len))
-+ return -EFAULT;
-+
-+ /*
-+ * Second, we read any remaining bytes, starting back at the head of
-+ * the log.
-+ */
-+ if (count != len)
-+ if (copy_to_user(buf + len, log->buffer, count - len))
-+ return -EFAULT;
-+
-+ reader->r_off = logger_offset(reader->r_off + count);
-+
-+ return count;
-+}
-+
-+/*
-+ * logger_read - our log's read() method
-+ *
-+ * Behavior:
-+ *
-+ * - O_NONBLOCK works
-+ * - If there are no log entries to read, blocks until log is written to
-+ * - Atomically reads exactly one log entry
-+ *
-+ * Optimal read size is LOGGER_ENTRY_MAX_LEN. Will set errno to EINVAL if read
-+ * buffer is insufficient to hold next entry.
-+ */
-+static ssize_t logger_read(struct file *file, char __user *buf,
-+ size_t count, loff_t *pos)
-+{
-+ struct logger_reader *reader = file->private_data;
-+ struct logger_log *log = reader->log;
-+ ssize_t ret;
-+ DEFINE_WAIT(wait);
-+
-+start:
-+ while (1) {
-+ prepare_to_wait(&log->wq, &wait, TASK_INTERRUPTIBLE);
-+
-+ mutex_lock(&log->mutex);
-+ ret = (log->w_off == reader->r_off);
-+ mutex_unlock(&log->mutex);
-+ if (!ret)
-+ break;
-+
-+ if (file->f_flags & O_NONBLOCK) {
-+ ret = -EAGAIN;
-+ break;
-+ }
-+
-+ if (signal_pending(current)) {
-+ ret = -EINTR;
-+ break;
-+ }
-+
-+ schedule();
-+ }
-+
-+ finish_wait(&log->wq, &wait);
-+ if (ret)
-+ return ret;
-+
-+ mutex_lock(&log->mutex);
-+
-+ /* is there still something to read or did we race? */
-+ if (unlikely(log->w_off == reader->r_off)) {
-+ mutex_unlock(&log->mutex);
-+ goto start;
-+ }
-+
-+ /* get the size of the next entry */
-+ ret = get_entry_len(log, reader->r_off);
-+ if (count < ret) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ /* get exactly one entry from the log */
-+ ret = do_read_log_to_user(log, reader, buf, ret);
-+
-+out:
-+ mutex_unlock(&log->mutex);
-+
-+ return ret;
-+}
-+
-+/*
-+ * get_next_entry - return the offset of the first valid entry at least 'len'
-+ * bytes after 'off'.
-+ *
-+ * Caller must hold log->mutex.
-+ */
-+static size_t get_next_entry(struct logger_log *log, size_t off, size_t len)
-+{
-+ size_t count = 0;
-+
-+ do {
-+ size_t nr = get_entry_len(log, off);
-+ off = logger_offset(off + nr);
-+ count += nr;
-+ } while (count < len);
-+
-+ return off;
-+}
-+
-+/*
-+ * clock_interval - is a < c < b in mod-space? Put another way, does the line
-+ * from a to b cross c?
-+ */
-+static inline int clock_interval(size_t a, size_t b, size_t c)
-+{
-+ if (b < a) {
-+ if (a < c || b >= c)
-+ return 1;
-+ } else {
-+ if (a < c && b >= c)
-+ return 1;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * fix_up_readers - walk the list of all readers and "fix up" any who were
-+ * lapped by the writer; also do the same for the default "start head".
-+ * We do this by "pulling forward" the readers and start head to the first
-+ * entry after the new write head.
-+ *
-+ * The caller needs to hold log->mutex.
-+ */
-+static void fix_up_readers(struct logger_log *log, size_t len)
-+{
-+ size_t old = log->w_off;
-+ size_t new = logger_offset(old + len);
-+ struct logger_reader *reader;
-+
-+ if (clock_interval(old, new, log->head))
-+ log->head = get_next_entry(log, log->head, len);
-+
-+ list_for_each_entry(reader, &log->readers, list)
-+ if (clock_interval(old, new, reader->r_off))
-+ reader->r_off = get_next_entry(log, reader->r_off, len);
-+}
-+
-+/*
-+ * do_write_log - writes 'len' bytes from 'buf' to 'log'
-+ *
-+ * The caller needs to hold log->mutex.
-+ */
-+static void do_write_log(struct logger_log *log, const void *buf, size_t count)
-+{
-+ size_t len;
-+
-+ len = min(count, log->size - log->w_off);
-+ memcpy(log->buffer + log->w_off, buf, len);
-+
-+ if (count != len)
-+ memcpy(log->buffer, buf + len, count - len);
-+
-+ log->w_off = logger_offset(log->w_off + count);
-+
-+}
-+
-+/*
-+ * do_write_log_user - writes 'len' bytes from the user-space buffer 'buf' to
-+ * the log 'log'
-+ *
-+ * The caller needs to hold log->mutex.
-+ *
-+ * Returns 'count' on success, negative error code on failure.
-+ */
-+static ssize_t do_write_log_from_user(struct logger_log *log,
-+ const void __user *buf, size_t count)
-+{
-+ size_t len;
-+
-+ len = min(count, log->size - log->w_off);
-+ if (len && copy_from_user(log->buffer + log->w_off, buf, len))
-+ return -EFAULT;
-+
-+ if (count != len)
-+ if (copy_from_user(log->buffer, buf + len, count - len))
-+ return -EFAULT;
-+
-+ log->w_off = logger_offset(log->w_off + count);
-+
-+ return count;
-+}
-+
-+/*
-+ * logger_aio_write - our write method, implementing support for write(),
-+ * writev(), and aio_write(). Writes are our fast path, and we try to optimize
-+ * them above all else.
-+ */
-+ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov,
-+ unsigned long nr_segs, loff_t ppos)
-+{
-+ struct logger_log *log = file_get_log(iocb->ki_filp);
-+ size_t orig = log->w_off;
-+ struct logger_entry header;
-+ struct timespec now;
-+ ssize_t ret = 0;
-+
-+ now = current_kernel_time();
-+
-+ header.pid = current->tgid;
-+ header.tid = current->pid;
-+ header.sec = now.tv_sec;
-+ header.nsec = now.tv_nsec;
-+ header.len = min_t(size_t, iocb->ki_left, LOGGER_ENTRY_MAX_PAYLOAD);
-+
-+ /* null writes succeed, return zero */
-+ if (unlikely(!header.len))
-+ return 0;
-+
-+ mutex_lock(&log->mutex);
-+
-+ /*
-+ * Fix up any readers, pulling them forward to the first readable
-+ * entry after (what will be) the new write offset. We do this now
-+ * because if we partially fail, we can end up with clobbered log
-+ * entries that encroach on readable buffer.
-+ */
-+ fix_up_readers(log, sizeof(struct logger_entry) + header.len);
-+
-+ do_write_log(log, &header, sizeof(struct logger_entry));
-+
-+ while (nr_segs-- > 0) {
-+ size_t len;
-+ ssize_t nr;
-+
-+ /* figure out how much of this vector we can keep */
-+ len = min_t(size_t, iov->iov_len, header.len - ret);
-+
-+ /* write out this segment's payload */
-+ nr = do_write_log_from_user(log, iov->iov_base, len);
-+ if (unlikely(nr < 0)) {
-+ log->w_off = orig;
-+ mutex_unlock(&log->mutex);
-+ return nr;
-+ }
-+
-+ iov++;
-+ ret += nr;
-+ }
-+
-+ mutex_unlock(&log->mutex);
-+
-+ /* wake up any blocked readers */
-+ wake_up_interruptible(&log->wq);
-+
-+ return ret;
-+}
-+
-+static struct logger_log *get_log_from_minor(int);
-+
-+/*
-+ * logger_open - the log's open() file operation
-+ *
-+ * Note how near a no-op this is in the write-only case. Keep it that way!
-+ */
-+static int logger_open(struct inode *inode, struct file *file)
-+{
-+ struct logger_log *log;
-+ int ret;
-+
-+ ret = nonseekable_open(inode, file);
-+ if (ret)
-+ return ret;
-+
-+ log = get_log_from_minor(MINOR(inode->i_rdev));
-+ if (!log)
-+ return -ENODEV;
-+
-+ if (file->f_mode & FMODE_READ) {
-+ struct logger_reader *reader;
-+
-+ reader = kmalloc(sizeof(struct logger_reader), GFP_KERNEL);
-+ if (!reader)
-+ return -ENOMEM;
-+
-+ reader->log = log;
-+ INIT_LIST_HEAD(&reader->list);
-+
-+ mutex_lock(&log->mutex);
-+ reader->r_off = log->head;
-+ list_add_tail(&reader->list, &log->readers);
-+ mutex_unlock(&log->mutex);
-+
-+ file->private_data = reader;
-+ } else
-+ file->private_data = log;
-+
-+ return 0;
-+}
-+
-+/*
-+ * logger_release - the log's release file operation
-+ *
-+ * Note this is a total no-op in the write-only case. Keep it that way!
-+ */
-+static int logger_release(struct inode *ignored, struct file *file)
-+{
-+ if (file->f_mode & FMODE_READ) {
-+ struct logger_reader *reader = file->private_data;
-+ list_del(&reader->list);
-+ kfree(reader);
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * logger_poll - the log's poll file operation, for poll/select/epoll
-+ *
-+ * Note we always return POLLOUT, because you can always write() to the log.
-+ * Note also that, strictly speaking, a return value of POLLIN does not
-+ * guarantee that the log is readable without blocking, as there is a small
-+ * chance that the writer can lap the reader in the interim between poll()
-+ * returning and the read() request.
-+ */
-+static unsigned int logger_poll(struct file *file, poll_table *wait)
-+{
-+ struct logger_reader *reader;
-+ struct logger_log *log;
-+ unsigned int ret = POLLOUT | POLLWRNORM;
-+
-+ if (!(file->f_mode & FMODE_READ))
-+ return ret;
-+
-+ reader = file->private_data;
-+ log = reader->log;
-+
-+ poll_wait(file, &log->wq, wait);
-+
-+ mutex_lock(&log->mutex);
-+ if (log->w_off != reader->r_off)
-+ ret |= POLLIN | POLLRDNORM;
-+ mutex_unlock(&log->mutex);
-+
-+ return ret;
-+}
-+
-+static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-+{
-+ struct logger_log *log = file_get_log(file);
-+ struct logger_reader *reader;
-+ long ret = -ENOTTY;
-+
-+ mutex_lock(&log->mutex);
-+
-+ switch (cmd) {
-+ case LOGGER_GET_LOG_BUF_SIZE:
-+ ret = log->size;
-+ break;
-+ case LOGGER_GET_LOG_LEN:
-+ if (!(file->f_mode & FMODE_READ)) {
-+ ret = -EBADF;
-+ break;
-+ }
-+ reader = file->private_data;
-+ if (log->w_off >= reader->r_off)
-+ ret = log->w_off - reader->r_off;
-+ else
-+ ret = (log->size - reader->r_off) + log->w_off;
-+ break;
-+ case LOGGER_GET_NEXT_ENTRY_LEN:
-+ if (!(file->f_mode & FMODE_READ)) {
-+ ret = -EBADF;
-+ break;
-+ }
-+ reader = file->private_data;
-+ if (log->w_off != reader->r_off)
-+ ret = get_entry_len(log, reader->r_off);
-+ else
-+ ret = 0;
-+ break;
-+ case LOGGER_FLUSH_LOG:
-+ if (!(file->f_mode & FMODE_WRITE)) {
-+ ret = -EBADF;
-+ break;
-+ }
-+ list_for_each_entry(reader, &log->readers, list)
-+ reader->r_off = log->w_off;
-+ log->head = log->w_off;
-+ ret = 0;
-+ break;
-+ }
-+
-+ mutex_unlock(&log->mutex);
-+
-+ return ret;
-+}
-+
-+static const struct file_operations logger_fops = {
-+ .owner = THIS_MODULE,
-+ .read = logger_read,
-+ .aio_write = logger_aio_write,
-+ .poll = logger_poll,
-+ .unlocked_ioctl = logger_ioctl,
-+ .compat_ioctl = logger_ioctl,
-+ .open = logger_open,
-+ .release = logger_release,
-+};
-+
-+/*
-+ * Defines a log structure with name 'NAME' and a size of 'SIZE' bytes, which
-+ * must be a power of two, greater than LOGGER_ENTRY_MAX_LEN, and less than
-+ * LONG_MAX minus LOGGER_ENTRY_MAX_LEN.
-+ */
-+#define DEFINE_LOGGER_DEVICE(VAR, NAME, SIZE) \
-+static unsigned char _buf_ ## VAR[SIZE]; \
-+static struct logger_log VAR = { \
-+ .buffer = _buf_ ## VAR, \
-+ .misc = { \
-+ .minor = MISC_DYNAMIC_MINOR, \
-+ .name = NAME, \
-+ .fops = &logger_fops, \
-+ .parent = NULL, \
-+ }, \
-+ .wq = __WAIT_QUEUE_HEAD_INITIALIZER(VAR .wq), \
-+ .readers = LIST_HEAD_INIT(VAR .readers), \
-+ .mutex = __MUTEX_INITIALIZER(VAR .mutex), \
-+ .w_off = 0, \
-+ .head = 0, \
-+ .size = SIZE, \
-+};
-+
-+DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
-+DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
-+DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
-+
-+static struct logger_log *get_log_from_minor(int minor)
-+{
-+ if (log_main.misc.minor == minor)
-+ return &log_main;
-+ if (log_events.misc.minor == minor)
-+ return &log_events;
-+ if (log_radio.misc.minor == minor)
-+ return &log_radio;
-+ return NULL;
-+}
-+
-+static int __init init_log(struct logger_log *log)
-+{
-+ int ret;
-+
-+ ret = misc_register(&log->misc);
-+ if (unlikely(ret)) {
-+ printk(KERN_ERR "logger: failed to register misc "
-+ "device for log '%s'!\n", log->misc.name);
-+ return ret;
-+ }
-+
-+ printk(KERN_INFO "logger: created %luK log '%s'\n",
-+ (unsigned long) log->size >> 10, log->misc.name);
-+
-+ return 0;
-+}
-+
-+static int __init logger_init(void)
-+{
-+ int ret;
-+
-+ ret = init_log(&log_main);
-+ if (unlikely(ret))
-+ goto out;
-+
-+ ret = init_log(&log_events);
-+ if (unlikely(ret))
-+ goto out;
-+
-+ ret = init_log(&log_radio);
-+ if (unlikely(ret))
-+ goto out;
-+
-+out:
-+ return ret;
-+}
-+device_initcall(logger_init);
-diff --git a/drivers/staging/android/logger.h b/drivers/staging/android/logger.h
-new file mode 100644
-index 0000000..a562434
---- /dev/null
-+++ b/drivers/staging/android/logger.h
-@@ -0,0 +1,48 @@
-+/* include/linux/logger.h
-+ *
-+ * Copyright (C) 2007-2008 Google, Inc.
-+ * Author: Robert Love <rlove@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#ifndef _LINUX_LOGGER_H
-+#define _LINUX_LOGGER_H
-+
-+#include <linux/types.h>
-+#include <linux/ioctl.h>
-+
-+struct logger_entry {
-+ __u16 len; /* length of the payload */
-+ __u16 __pad; /* no matter what, we get 2 bytes of padding */
-+ __s32 pid; /* generating process's pid */
-+ __s32 tid; /* generating process's tid */
-+ __s32 sec; /* seconds since Epoch */
-+ __s32 nsec; /* nanoseconds */
-+ char msg[0]; /* the entry's payload */
-+};
-+
-+#define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */
-+#define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */
-+#define LOGGER_LOG_MAIN "log_main" /* everything else */
-+
-+#define LOGGER_ENTRY_MAX_LEN (4*1024)
-+#define LOGGER_ENTRY_MAX_PAYLOAD \
-+ (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))
-+
-+#define __LOGGERIO 0xAE
-+
-+#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */
-+#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */
-+#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */
-+#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */
-+
-+#endif /* _LINUX_LOGGER_H */
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-new file mode 100644
-index 0000000..935d281
---- /dev/null
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -0,0 +1,173 @@
-+/* drivers/misc/lowmemorykiller.c
-+ *
-+ * The lowmemorykiller driver lets user-space specify a set of memory thresholds
-+ * where processes with a range of oom_adj values will get killed. Specify the
-+ * minimum oom_adj values in /sys/module/lowmemorykiller/parameters/adj and the
-+ * number of free pages in /sys/module/lowmemorykiller/parameters/minfree. Both
-+ * files take a comma separated list of numbers in ascending order.
-+ *
-+ * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and
-+ * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill processes
-+ * with a oom_adj value of 8 or higher when the free memory drops below 4096 pages
-+ * and kill processes with a oom_adj value of 0 or higher when the free memory
-+ * drops below 1024 pages.
-+ *
-+ * The driver considers memory used for caches to be free, but if a large
-+ * percentage of the cached memory is locked this can be very inaccurate
-+ * and processes may not get killed until the normal oom killer is triggered.
-+ *
-+ * Copyright (C) 2007-2008 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/mm.h>
-+#include <linux/oom.h>
-+#include <linux/sched.h>
-+
-+static uint32_t lowmem_debug_level = 2;
-+static int lowmem_adj[6] = {
-+ 0,
-+ 1,
-+ 6,
-+ 12,
-+};
-+static int lowmem_adj_size = 4;
-+static size_t lowmem_minfree[6] = {
-+ 3 * 512, /* 6MB */
-+ 2 * 1024, /* 8MB */
-+ 4 * 1024, /* 16MB */
-+ 16 * 1024, /* 64MB */
-+};
-+static int lowmem_minfree_size = 4;
-+
-+#define lowmem_print(level, x...) \
-+ do { \
-+ if (lowmem_debug_level >= (level)) \
-+ printk(x); \
-+ } while (0)
-+
-+static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
-+{
-+ struct task_struct *p;
-+ struct task_struct *selected = NULL;
-+ int rem = 0;
-+ int tasksize;
-+ int i;
-+ int min_adj = OOM_ADJUST_MAX + 1;
-+ int selected_tasksize = 0;
-+ int selected_oom_adj;
-+ int array_size = ARRAY_SIZE(lowmem_adj);
-+ int other_free = global_page_state(NR_FREE_PAGES);
-+ int other_file = global_page_state(NR_FILE_PAGES);
-+
-+ if (lowmem_adj_size < array_size)
-+ array_size = lowmem_adj_size;
-+ if (lowmem_minfree_size < array_size)
-+ array_size = lowmem_minfree_size;
-+ for (i = 0; i < array_size; i++) {
-+ if (other_free < lowmem_minfree[i] &&
-+ other_file < lowmem_minfree[i]) {
-+ min_adj = lowmem_adj[i];
-+ break;
-+ }
-+ }
-+ if (nr_to_scan > 0)
-+ lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n",
-+ nr_to_scan, gfp_mask, other_free, other_file,
-+ min_adj);
-+ rem = global_page_state(NR_ACTIVE_ANON) +
-+ global_page_state(NR_ACTIVE_FILE) +
-+ global_page_state(NR_INACTIVE_ANON) +
-+ global_page_state(NR_INACTIVE_FILE);
-+ if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
-+ lowmem_print(5, "lowmem_shrink %d, %x, return %d\n",
-+ nr_to_scan, gfp_mask, rem);
-+ return rem;
-+ }
-+ selected_oom_adj = min_adj;
-+
-+ read_lock(&tasklist_lock);
-+ for_each_process(p) {
-+ struct mm_struct *mm;
-+ int oom_adj;
-+
-+ task_lock(p);
-+ mm = p->mm;
-+ if (!mm) {
-+ task_unlock(p);
-+ continue;
-+ }
-+ oom_adj = mm->oom_adj;
-+ if (oom_adj < min_adj) {
-+ task_unlock(p);
-+ continue;
-+ }
-+ tasksize = get_mm_rss(mm);
-+ task_unlock(p);
-+ if (tasksize <= 0)
-+ continue;
-+ if (selected) {
-+ if (oom_adj < selected_oom_adj)
-+ continue;
-+ if (oom_adj == selected_oom_adj &&
-+ tasksize <= selected_tasksize)
-+ continue;
-+ }
-+ selected = p;
-+ selected_tasksize = tasksize;
-+ selected_oom_adj = oom_adj;
-+ lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",
-+ p->pid, p->comm, oom_adj, tasksize);
-+ }
-+ if (selected) {
-+ lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
-+ selected->pid, selected->comm,
-+ selected_oom_adj, selected_tasksize);
-+ force_sig(SIGKILL, selected);
-+ rem -= selected_tasksize;
-+ }
-+ lowmem_print(4, "lowmem_shrink %d, %x, return %d\n",
-+ nr_to_scan, gfp_mask, rem);
-+ read_unlock(&tasklist_lock);
-+ return rem;
-+}
-+
-+static struct shrinker lowmem_shrinker = {
-+ .shrink = lowmem_shrink,
-+ .seeks = DEFAULT_SEEKS * 16
-+};
-+
-+static int __init lowmem_init(void)
-+{
-+ register_shrinker(&lowmem_shrinker);
-+ return 0;
-+}
-+
-+static void __exit lowmem_exit(void)
-+{
-+ unregister_shrinker(&lowmem_shrinker);
-+}
-+
-+module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
-+module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
-+ S_IRUGO | S_IWUSR);
-+module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
-+ S_IRUGO | S_IWUSR);
-+module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
-+
-+module_init(lowmem_init);
-+module_exit(lowmem_exit);
-+
-+MODULE_LICENSE("GPL");
-+
-diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
-new file mode 100644
-index 0000000..8f18a59
---- /dev/null
-+++ b/drivers/staging/android/ram_console.c
-@@ -0,0 +1,410 @@
-+/* drivers/android/ram_console.c
-+ *
-+ * Copyright (C) 2007-2008 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/console.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/proc_fs.h>
-+#include <linux/string.h>
-+#include <linux/uaccess.h>
-+#include <linux/io.h>
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+#include <linux/rslib.h>
-+#endif
-+
-+struct ram_console_buffer {
-+ uint32_t sig;
-+ uint32_t start;
-+ uint32_t size;
-+ uint8_t data[0];
-+};
-+
-+#define RAM_CONSOLE_SIG (0x43474244) /* DBGC */
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-+static char __initdata
-+ ram_console_old_log_init_buffer[CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE];
-+#endif
-+static char *ram_console_old_log;
-+static size_t ram_console_old_log_size;
-+
-+static struct ram_console_buffer *ram_console_buffer;
-+static size_t ram_console_buffer_size;
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+static char *ram_console_par_buffer;
-+static struct rs_control *ram_console_rs_decoder;
-+static int ram_console_corrected_bytes;
-+static int ram_console_bad_blocks;
-+#define ECC_BLOCK_SIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE
-+#define ECC_SIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE
-+#define ECC_SYMSIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE
-+#define ECC_POLY CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL
-+#endif
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+static void ram_console_encode_rs8(uint8_t *data, size_t len, uint8_t *ecc)
-+{
-+ int i;
-+ uint16_t par[ECC_SIZE];
-+ /* Initialize the parity buffer */
-+ memset(par, 0, sizeof(par));
-+ encode_rs8(ram_console_rs_decoder, data, len, par, 0);
-+ for (i = 0; i < ECC_SIZE; i++)
-+ ecc[i] = par[i];
-+}
-+
-+static int ram_console_decode_rs8(void *data, size_t len, uint8_t *ecc)
-+{
-+ int i;
-+ uint16_t par[ECC_SIZE];
-+ for (i = 0; i < ECC_SIZE; i++)
-+ par[i] = ecc[i];
-+ return decode_rs8(ram_console_rs_decoder, data, par, len,
-+ NULL, 0, NULL, 0, NULL);
-+}
-+#endif
-+
-+static void ram_console_update(const char *s, unsigned int count)
-+{
-+ struct ram_console_buffer *buffer = ram_console_buffer;
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ uint8_t *buffer_end = buffer->data + ram_console_buffer_size;
-+ uint8_t *block;
-+ uint8_t *par;
-+ int size = ECC_BLOCK_SIZE;
-+#endif
-+ memcpy(buffer->data + buffer->start, s, count);
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ block = buffer->data + (buffer->start & ~(ECC_BLOCK_SIZE - 1));
-+ par = ram_console_par_buffer +
-+ (buffer->start / ECC_BLOCK_SIZE) * ECC_SIZE;
-+ do {
-+ if (block + ECC_BLOCK_SIZE > buffer_end)
-+ size = buffer_end - block;
-+ ram_console_encode_rs8(block, size, par);
-+ block += ECC_BLOCK_SIZE;
-+ par += ECC_SIZE;
-+ } while (block < buffer->data + buffer->start + count);
-+#endif
-+}
-+
-+static void ram_console_update_header(void)
-+{
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ struct ram_console_buffer *buffer = ram_console_buffer;
-+ uint8_t *par;
-+ par = ram_console_par_buffer +
-+ DIV_ROUND_UP(ram_console_buffer_size, ECC_BLOCK_SIZE) * ECC_SIZE;
-+ ram_console_encode_rs8((uint8_t *)buffer, sizeof(*buffer), par);
-+#endif
-+}
-+
-+static void
-+ram_console_write(struct console *console, const char *s, unsigned int count)
-+{
-+ int rem;
-+ struct ram_console_buffer *buffer = ram_console_buffer;
-+
-+ if (count > ram_console_buffer_size) {
-+ s += count - ram_console_buffer_size;
-+ count = ram_console_buffer_size;
-+ }
-+ rem = ram_console_buffer_size - buffer->start;
-+ if (rem < count) {
-+ ram_console_update(s, rem);
-+ s += rem;
-+ count -= rem;
-+ buffer->start = 0;
-+ buffer->size = ram_console_buffer_size;
-+ }
-+ ram_console_update(s, count);
-+
-+ buffer->start += count;
-+ if (buffer->size < ram_console_buffer_size)
-+ buffer->size += count;
-+ ram_console_update_header();
-+}
-+
-+static struct console ram_console = {
-+ .name = "ram",
-+ .write = ram_console_write,
-+ .flags = CON_PRINTBUFFER | CON_ENABLED,
-+ .index = -1,
-+};
-+
-+static void __init
-+ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
-+{
-+ size_t old_log_size = buffer->size;
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ uint8_t *block;
-+ uint8_t *par;
-+ char strbuf[80];
-+ int strbuf_len;
-+
-+ block = buffer->data;
-+ par = ram_console_par_buffer;
-+ while (block < buffer->data + buffer->size) {
-+ int numerr;
-+ int size = ECC_BLOCK_SIZE;
-+ if (block + size > buffer->data + ram_console_buffer_size)
-+ size = buffer->data + ram_console_buffer_size - block;
-+ numerr = ram_console_decode_rs8(block, size, par);
-+ if (numerr > 0) {
-+#if 0
-+ printk(KERN_INFO "ram_console: error in block %p, %d\n",
-+ block, numerr);
-+#endif
-+ ram_console_corrected_bytes += numerr;
-+ } else if (numerr < 0) {
-+#if 0
-+ printk(KERN_INFO "ram_console: uncorrectable error in "
-+ "block %p\n", block);
-+#endif
-+ ram_console_bad_blocks++;
-+ }
-+ block += ECC_BLOCK_SIZE;
-+ par += ECC_SIZE;
-+ }
-+ if (ram_console_corrected_bytes || ram_console_bad_blocks)
-+ strbuf_len = snprintf(strbuf, sizeof(strbuf),
-+ "\n%d Corrected bytes, %d unrecoverable blocks\n",
-+ ram_console_corrected_bytes, ram_console_bad_blocks);
-+ else
-+ strbuf_len = snprintf(strbuf, sizeof(strbuf),
-+ "\nNo errors detected\n");
-+ if (strbuf_len >= sizeof(strbuf))
-+ strbuf_len = sizeof(strbuf) - 1;
-+ old_log_size += strbuf_len;
-+#endif
-+
-+ if (dest == NULL) {
-+ dest = kmalloc(old_log_size, GFP_KERNEL);
-+ if (dest == NULL) {
-+ printk(KERN_ERR
-+ "ram_console: failed to allocate buffer\n");
-+ return;
-+ }
-+ }
-+
-+ ram_console_old_log = dest;
-+ ram_console_old_log_size = old_log_size;
-+ memcpy(ram_console_old_log,
-+ &buffer->data[buffer->start], buffer->size - buffer->start);
-+ memcpy(ram_console_old_log + buffer->size - buffer->start,
-+ &buffer->data[0], buffer->start);
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ memcpy(ram_console_old_log + old_log_size - strbuf_len,
-+ strbuf, strbuf_len);
-+#endif
-+}
-+
-+static int __init ram_console_init(struct ram_console_buffer *buffer,
-+ size_t buffer_size, char *old_buf)
-+{
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ int numerr;
-+ uint8_t *par;
-+#endif
-+ ram_console_buffer = buffer;
-+ ram_console_buffer_size =
-+ buffer_size - sizeof(struct ram_console_buffer);
-+
-+ if (ram_console_buffer_size > buffer_size) {
-+ pr_err("ram_console: buffer %p, invalid size %zu, "
-+ "datasize %zu\n", buffer, buffer_size,
-+ ram_console_buffer_size);
-+ return 0;
-+ }
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-+ ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
-+ ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
-+
-+ if (ram_console_buffer_size > buffer_size) {
-+ pr_err("ram_console: buffer %p, invalid size %zu, "
-+ "non-ecc datasize %zu\n",
-+ buffer, buffer_size, ram_console_buffer_size);
-+ return 0;
-+ }
-+
-+ ram_console_par_buffer = buffer->data + ram_console_buffer_size;
-+
-+
-+ /* first consecutive root is 0
-+ * primitive element to generate roots = 1
-+ */
-+ ram_console_rs_decoder = init_rs(ECC_SYMSIZE, ECC_POLY, 0, 1, ECC_SIZE);
-+ if (ram_console_rs_decoder == NULL) {
-+ printk(KERN_INFO "ram_console: init_rs failed\n");
-+ return 0;
-+ }
-+
-+ ram_console_corrected_bytes = 0;
-+ ram_console_bad_blocks = 0;
-+
-+ par = ram_console_par_buffer +
-+ DIV_ROUND_UP(ram_console_buffer_size, ECC_BLOCK_SIZE) * ECC_SIZE;
-+
-+ numerr = ram_console_decode_rs8(buffer, sizeof(*buffer), par);
-+ if (numerr > 0) {
-+ printk(KERN_INFO "ram_console: error in header, %d\n", numerr);
-+ ram_console_corrected_bytes += numerr;
-+ } else if (numerr < 0) {
-+ printk(KERN_INFO
-+ "ram_console: uncorrectable error in header\n");
-+ ram_console_bad_blocks++;
-+ }
-+#endif
-+
-+ if (buffer->sig == RAM_CONSOLE_SIG) {
-+ if (buffer->size > ram_console_buffer_size
-+ || buffer->start > buffer->size)
-+ printk(KERN_INFO "ram_console: found existing invalid "
-+ "buffer, size %d, start %d\n",
-+ buffer->size, buffer->start);
-+ else {
-+ printk(KERN_INFO "ram_console: found existing buffer, "
-+ "size %d, start %d\n",
-+ buffer->size, buffer->start);
-+ ram_console_save_old(buffer, old_buf);
-+ }
-+ } else {
-+ printk(KERN_INFO "ram_console: no valid data in buffer "
-+ "(sig = 0x%08x)\n", buffer->sig);
-+ }
-+
-+ buffer->sig = RAM_CONSOLE_SIG;
-+ buffer->start = 0;
-+ buffer->size = 0;
-+
-+ register_console(&ram_console);
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
-+ console_verbose();
-+#endif
-+ return 0;
-+}
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-+static int __init ram_console_early_init(void)
-+{
-+ return ram_console_init((struct ram_console_buffer *)
-+ CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR,
-+ CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE,
-+ ram_console_old_log_init_buffer);
-+}
-+#else
-+static int ram_console_driver_probe(struct platform_device *pdev)
-+{
-+ struct resource *res = pdev->resource;
-+ size_t start;
-+ size_t buffer_size;
-+ void *buffer;
-+
-+ if (res == NULL || pdev->num_resources != 1 ||
-+ !(res->flags & IORESOURCE_MEM)) {
-+ printk(KERN_ERR "ram_console: invalid resource, %p %d flags "
-+ "%lx\n", res, pdev->num_resources, res ? res->flags : 0);
-+ return -ENXIO;
-+ }
-+ buffer_size = res->end - res->start + 1;
-+ start = res->start;
-+ printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n",
-+ start, buffer_size);
-+ buffer = ioremap(res->start, buffer_size);
-+ if (buffer == NULL) {
-+ printk(KERN_ERR "ram_console: failed to map memory\n");
-+ return -ENOMEM;
-+ }
-+
-+ return ram_console_init(buffer, buffer_size, NULL/* allocate */);
-+}
-+
-+static struct platform_driver ram_console_driver = {
-+ .probe = ram_console_driver_probe,
-+ .driver = {
-+ .name = "ram_console",
-+ },
-+};
-+
-+static int __init ram_console_module_init(void)
-+{
-+ int err;
-+ err = platform_driver_register(&ram_console_driver);
-+ return err;
-+}
-+#endif
-+
-+static ssize_t ram_console_read_old(struct file *file, char __user *buf,
-+ size_t len, loff_t *offset)
-+{
-+ loff_t pos = *offset;
-+ ssize_t count;
-+
-+ if (pos >= ram_console_old_log_size)
-+ return 0;
-+
-+ count = min(len, (size_t)(ram_console_old_log_size - pos));
-+ if (copy_to_user(buf, ram_console_old_log + pos, count))
-+ return -EFAULT;
-+
-+ *offset += count;
-+ return count;
-+}
-+
-+static const struct file_operations ram_console_file_ops = {
-+ .owner = THIS_MODULE,
-+ .read = ram_console_read_old,
-+};
-+
-+static int __init ram_console_late_init(void)
-+{
-+ struct proc_dir_entry *entry;
-+
-+ if (ram_console_old_log == NULL)
-+ return 0;
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-+ ram_console_old_log = kmalloc(ram_console_old_log_size, GFP_KERNEL);
-+ if (ram_console_old_log == NULL) {
-+ printk(KERN_ERR
-+ "ram_console: failed to allocate buffer for old log\n");
-+ ram_console_old_log_size = 0;
-+ return 0;
-+ }
-+ memcpy(ram_console_old_log,
-+ ram_console_old_log_init_buffer, ram_console_old_log_size);
-+#endif
-+ entry = create_proc_entry("last_kmsg", S_IFREG | S_IRUGO, NULL);
-+ if (!entry) {
-+ printk(KERN_ERR "ram_console: failed to create proc entry\n");
-+ kfree(ram_console_old_log);
-+ ram_console_old_log = NULL;
-+ return 0;
-+ }
-+
-+ entry->proc_fops = &ram_console_file_ops;
-+ entry->size = ram_console_old_log_size;
-+ return 0;
-+}
-+
-+#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-+console_initcall(ram_console_early_init);
-+#else
-+module_init(ram_console_module_init);
-+#endif
-+late_initcall(ram_console_late_init);
-+
-diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
-new file mode 100644
-index 0000000..be7cdaa
---- /dev/null
-+++ b/drivers/staging/android/timed_gpio.c
-@@ -0,0 +1,166 @@
-+/* drivers/misc/timed_gpio.c
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ * Author: Mike Lockwood <lockwood@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/hrtimer.h>
-+#include <linux/err.h>
-+#include <linux/gpio.h>
-+
-+#include "timed_output.h"
-+#include "timed_gpio.h"
-+
-+
-+struct timed_gpio_data {
-+ struct timed_output_dev dev;
-+ struct hrtimer timer;
-+ spinlock_t lock;
-+ unsigned gpio;
-+ int max_timeout;
-+ u8 active_low;
-+};
-+
-+static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer)
-+{
-+ struct timed_gpio_data *data =
-+ container_of(timer, struct timed_gpio_data, timer);
-+
-+ gpio_direction_output(data->gpio, data->active_low ? 1 : 0);
-+ return HRTIMER_NORESTART;
-+}
-+
-+static int gpio_get_time(struct timed_output_dev *dev)
-+{
-+ struct timed_gpio_data *data =
-+ container_of(dev, struct timed_gpio_data, dev);
-+
-+ if (hrtimer_active(&data->timer)) {
-+ ktime_t r = hrtimer_get_remaining(&data->timer);
-+ struct timeval t = ktime_to_timeval(r);
-+ return t.tv_sec * 1000 + t.tv_usec / 1000;
-+ } else
-+ return 0;
-+}
-+
-+static void gpio_enable(struct timed_output_dev *dev, int value)
-+{
-+ struct timed_gpio_data *data =
-+ container_of(dev, struct timed_gpio_data, dev);
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&data->lock, flags);
-+
-+ /* cancel previous timer and set GPIO according to value */
-+ hrtimer_cancel(&data->timer);
-+ gpio_direction_output(data->gpio, data->active_low ? !value : !!value);
-+
-+ if (value > 0) {
-+ if (value > data->max_timeout)
-+ value = data->max_timeout;
-+
-+ hrtimer_start(&data->timer,
-+ ktime_set(value / 1000, (value % 1000) * 1000000),
-+ HRTIMER_MODE_REL);
-+ }
-+
-+ spin_unlock_irqrestore(&data->lock, flags);
-+}
-+
-+static int timed_gpio_probe(struct platform_device *pdev)
-+{
-+ struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
-+ struct timed_gpio *cur_gpio;
-+ struct timed_gpio_data *gpio_data, *gpio_dat;
-+ int i, j, ret = 0;
-+
-+ if (!pdata)
-+ return -EBUSY;
-+
-+ gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios,
-+ GFP_KERNEL);
-+ if (!gpio_data)
-+ return -ENOMEM;
-+
-+ for (i = 0; i < pdata->num_gpios; i++) {
-+ cur_gpio = &pdata->gpios[i];
-+ gpio_dat = &gpio_data[i];
-+
-+ hrtimer_init(&gpio_dat->timer, CLOCK_MONOTONIC,
-+ HRTIMER_MODE_REL);
-+ gpio_dat->timer.function = gpio_timer_func;
-+ spin_lock_init(&gpio_dat->lock);
-+
-+ gpio_dat->dev.name = cur_gpio->name;
-+ gpio_dat->dev.get_time = gpio_get_time;
-+ gpio_dat->dev.enable = gpio_enable;
-+ ret = timed_output_dev_register(&gpio_dat->dev);
-+ if (ret < 0) {
-+ for (j = 0; j < i; j++)
-+ timed_output_dev_unregister(&gpio_data[i].dev);
-+ kfree(gpio_data);
-+ return ret;
-+ }
-+
-+ gpio_dat->gpio = cur_gpio->gpio;
-+ gpio_dat->max_timeout = cur_gpio->max_timeout;
-+ gpio_dat->active_low = cur_gpio->active_low;
-+ gpio_direction_output(gpio_dat->gpio, gpio_dat->active_low);
-+ }
-+
-+ platform_set_drvdata(pdev, gpio_data);
-+
-+ return 0;
-+}
-+
-+static int timed_gpio_remove(struct platform_device *pdev)
-+{
-+ struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
-+ struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
-+ int i;
-+
-+ for (i = 0; i < pdata->num_gpios; i++)
-+ timed_output_dev_unregister(&gpio_data[i].dev);
-+
-+ kfree(gpio_data);
-+
-+ return 0;
-+}
-+
-+static struct platform_driver timed_gpio_driver = {
-+ .probe = timed_gpio_probe,
-+ .remove = timed_gpio_remove,
-+ .driver = {
-+ .name = TIMED_GPIO_NAME,
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static int __init timed_gpio_init(void)
-+{
-+ return platform_driver_register(&timed_gpio_driver);
-+}
-+
-+static void __exit timed_gpio_exit(void)
-+{
-+ platform_driver_unregister(&timed_gpio_driver);
-+}
-+
-+module_init(timed_gpio_init);
-+module_exit(timed_gpio_exit);
-+
-+MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-+MODULE_DESCRIPTION("timed gpio driver");
-+MODULE_LICENSE("GPL");
-diff --git a/drivers/staging/android/timed_gpio.h b/drivers/staging/android/timed_gpio.h
-new file mode 100644
-index 0000000..a0e15f8
---- /dev/null
-+++ b/drivers/staging/android/timed_gpio.h
-@@ -0,0 +1,33 @@
-+/* include/linux/timed_gpio.h
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+*/
-+
-+#ifndef _LINUX_TIMED_GPIO_H
-+#define _LINUX_TIMED_GPIO_H
-+
-+#define TIMED_GPIO_NAME "timed-gpio"
-+
-+struct timed_gpio {
-+ const char *name;
-+ unsigned gpio;
-+ int max_timeout;
-+ u8 active_low;
-+};
-+
-+struct timed_gpio_platform_data {
-+ int num_gpios;
-+ struct timed_gpio *gpios;
-+};
-+
-+#endif
-diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
-new file mode 100644
-index 0000000..62e7918
---- /dev/null
-+++ b/drivers/staging/android/timed_output.c
-@@ -0,0 +1,121 @@
-+/* drivers/misc/timed_output.c
-+ *
-+ * Copyright (C) 2009 Google, Inc.
-+ * Author: Mike Lockwood <lockwood@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/types.h>
-+#include <linux/device.h>
-+#include <linux/fs.h>
-+#include <linux/err.h>
-+
-+#include "timed_output.h"
-+
-+static struct class *timed_output_class;
-+static atomic_t device_count;
-+
-+static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ struct timed_output_dev *tdev = dev_get_drvdata(dev);
-+ int remaining = tdev->get_time(tdev);
-+
-+ return sprintf(buf, "%d\n", remaining);
-+}
-+
-+static ssize_t enable_store(
-+ struct device *dev, struct device_attribute *attr,
-+ const char *buf, size_t size)
-+{
-+ struct timed_output_dev *tdev = dev_get_drvdata(dev);
-+ int value;
-+
-+ sscanf(buf, "%d", &value);
-+ tdev->enable(tdev, value);
-+
-+ return size;
-+}
-+
-+static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, enable_show, enable_store);
-+
-+static int create_timed_output_class(void)
-+{
-+ if (!timed_output_class) {
-+ timed_output_class = class_create(THIS_MODULE, "timed_output");
-+ if (IS_ERR(timed_output_class))
-+ return PTR_ERR(timed_output_class);
-+ atomic_set(&device_count, 0);
-+ }
-+
-+ return 0;
-+}
-+
-+int timed_output_dev_register(struct timed_output_dev *tdev)
-+{
-+ int ret;
-+
-+ if (!tdev || !tdev->name || !tdev->enable || !tdev->get_time)
-+ return -EINVAL;
-+
-+ ret = create_timed_output_class();
-+ if (ret < 0)
-+ return ret;
-+
-+ tdev->index = atomic_inc_return(&device_count);
-+ tdev->dev = device_create(timed_output_class, NULL,
-+ MKDEV(0, tdev->index), NULL, tdev->name);
-+ if (IS_ERR(tdev->dev))
-+ return PTR_ERR(tdev->dev);
-+
-+ ret = device_create_file(tdev->dev, &dev_attr_enable);
-+ if (ret < 0)
-+ goto err_create_file;
-+
-+ dev_set_drvdata(tdev->dev, tdev);
-+ tdev->state = 0;
-+ return 0;
-+
-+err_create_file:
-+ device_destroy(timed_output_class, MKDEV(0, tdev->index));
-+ printk(KERN_ERR "timed_output: Failed to register driver %s\n",
-+ tdev->name);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(timed_output_dev_register);
-+
-+void timed_output_dev_unregister(struct timed_output_dev *tdev)
-+{
-+ device_remove_file(tdev->dev, &dev_attr_enable);
-+ device_destroy(timed_output_class, MKDEV(0, tdev->index));
-+ dev_set_drvdata(tdev->dev, NULL);
-+}
-+EXPORT_SYMBOL_GPL(timed_output_dev_unregister);
-+
-+static int __init timed_output_init(void)
-+{
-+ return create_timed_output_class();
-+}
-+
-+static void __exit timed_output_exit(void)
-+{
-+ class_destroy(timed_output_class);
-+}
-+
-+module_init(timed_output_init);
-+module_exit(timed_output_exit);
-+
-+MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-+MODULE_DESCRIPTION("timed output class driver");
-+MODULE_LICENSE("GPL");
-diff --git a/drivers/staging/android/timed_output.h b/drivers/staging/android/timed_output.h
-new file mode 100644
-index 0000000..ec907ab
---- /dev/null
-+++ b/drivers/staging/android/timed_output.h
-@@ -0,0 +1,37 @@
-+/* include/linux/timed_output.h
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+*/
-+
-+#ifndef _LINUX_TIMED_OUTPUT_H
-+#define _LINUX_TIMED_OUTPUT_H
-+
-+struct timed_output_dev {
-+ const char *name;
-+
-+ /* enable the output and set the timer */
-+ void (*enable)(struct timed_output_dev *sdev, int timeout);
-+
-+ /* returns the current number of milliseconds remaining on the timer */
-+ int (*get_time)(struct timed_output_dev *sdev);
-+
-+ /* private data */
-+ struct device *dev;
-+ int index;
-+ int state;
-+};
-+
-+extern int timed_output_dev_register(struct timed_output_dev *dev);
-+extern void timed_output_dev_unregister(struct timed_output_dev *dev);
-+
-+#endif
diff --git a/patches.android/android-0002-staging-android-fix-build-issues.patch b/patches.android/android-0002-staging-android-fix-build-issues.patch
deleted file mode 100644
index 7761ae26d5c3e6..00000000000000
--- a/patches.android/android-0002-staging-android-fix-build-issues.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 23687af9317c9c01d4609667d3566af7f5e71e65 Mon Sep 17 00:00:00 2001
-From: Corentin Chary <corentincj@iksaif.net>
-Date: Sat, 28 Nov 2009 09:45:14 +0100
-Subject: staging/android: fix build issues
-Patch-mainline: HEAD
-Git-commit: 23687af9317c9c01d4609667d3566af7f5e71e65
-
-Signed-off-by: Corentin Chary <corentincj@iksaif.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-index 6c10b45..64cc2a1 100644
---- a/drivers/staging/android/logger.c
-+++ b/drivers/staging/android/logger.c
-@@ -17,6 +17,7 @@
- * GNU General Public License for more details.
- */
-
-+#include <linux/sched.h>
- #include <linux/module.h>
- #include <linux/fs.h>
- #include <linux/miscdevice.h>
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 935d281..32314e8 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -100,15 +100,17 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- read_lock(&tasklist_lock);
- for_each_process(p) {
- struct mm_struct *mm;
-+ struct signal_struct *sig;
- int oom_adj;
-
- task_lock(p);
- mm = p->mm;
-- if (!mm) {
-+ sig = p->signal;
-+ if (!mm || !sig) {
- task_unlock(p);
- continue;
- }
-- oom_adj = mm->oom_adj;
-+ oom_adj = sig->oom_adj;
- if (oom_adj < min_adj) {
- task_unlock(p);
- continue;
diff --git a/patches.android/android-0003-android-common-include-linux-slab.h.patch b/patches.android/android-0003-android-common-include-linux-slab.h.patch
deleted file mode 100644
index b31913061f90fb..00000000000000
--- a/patches.android/android-0003-android-common-include-linux-slab.h.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From c1b197ae67a201e404df9084cfd544eb8cb2e8a6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Tue, 20 Apr 2010 22:33:05 -0700
-Subject: android-common: include linux/slab.h
-Patch-mainline: HEAD
-Git-commit: c1b197ae67a201e404df9084cfd544eb8cb2e8a6
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
-index be7cdaa..3bfe6e0 100644
---- a/drivers/staging/android/timed_gpio.c
-+++ b/drivers/staging/android/timed_gpio.c
-@@ -16,6 +16,7 @@
-
- #include <linux/module.h>
- #include <linux/platform_device.h>
-+#include <linux/slab.h>
- #include <linux/hrtimer.h>
- #include <linux/err.h>
- #include <linux/gpio.h>
diff --git a/patches.android/android-0004-android-common-Fix-slab.h-includes-for-2.6.34-rc4.patch b/patches.android/android-0004-android-common-Fix-slab.h-includes-for-2.6.34-rc4.patch
deleted file mode 100644
index bad9b9bb105aa0..00000000000000
--- a/patches.android/android-0004-android-common-Fix-slab.h-includes-for-2.6.34-rc4.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From c11a166cd4c19664355e0e3d9c04cfa7ee4aa9f4 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Thu, 15 Apr 2010 15:21:51 -0700
-Subject: android-common: Fix slab.h includes for 2.6.34-rc4
-Patch-mainline: HEAD
-Git-commit: c11a166cd4c19664355e0e3d9c04cfa7ee4aa9f4
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 99010d4..3aec4530 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -31,6 +31,7 @@
- #include <linux/sched.h>
- #include <linux/uaccess.h>
- #include <linux/vmalloc.h>
-+#include <linux/slab.h>
-
- #include "binder.h"
-
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-index 64cc2a1..dd76564 100644
---- a/drivers/staging/android/logger.c
-+++ b/drivers/staging/android/logger.c
-@@ -23,6 +23,7 @@
- #include <linux/miscdevice.h>
- #include <linux/uaccess.h>
- #include <linux/poll.h>
-+#include <linux/slab.h>
- #include <linux/time.h>
- #include "logger.h"
-
diff --git a/patches.android/android-0005-Revert-Staging-android-mark-subsystem-as-broken.patch b/patches.android/android-0005-Revert-Staging-android-mark-subsystem-as-broken.patch
deleted file mode 100644
index 5fe607e7aee5d5..00000000000000
--- a/patches.android/android-0005-Revert-Staging-android-mark-subsystem-as-broken.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From e59bbb8ea3fb5794c09e48490a74b673aee4adc2 Mon Sep 17 00:00:00 2001
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Date: Wed, 30 Nov 2011 20:32:24 +0900
-Subject: Revert "Staging: android: mark subsystem as broken"
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: e59bbb8ea3fb5794c09e48490a74b673aee4adc2
-
-This reverts commit 2cdf99ce2b9418c9d7c5f907195cfac421375520.
-
-It now builds, so this can be reverted.
-
-Cc: Arve Hjønnevåg <arve@android.com>
-Cc: Brian Swetland <swetland@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index eb67563..2471949 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -2,7 +2,6 @@ menu "Android"
-
- config ANDROID
- bool "Android Drivers"
-- depends on BROKEN
- default N
- ---help---
- Enable support for various drivers needed on the Android platform
diff --git a/patches.android/android-0006-staging-android-ramconsole-Ensure-ramconsole-does-not-get-cl.patch b/patches.android/android-0006-staging-android-ramconsole-Ensure-ramconsole-does-not-get-cl.patch
deleted file mode 100644
index 5583d85cd99960..00000000000000
--- a/patches.android/android-0006-staging-android-ramconsole-Ensure-ramconsole-does-not-get-cl.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From fdfc8089429b58b4ac901926fe83fa85b0b7bfc1 Mon Sep 17 00:00:00 2001
-From: San Mehat <san@google.com>
-Date: Thu, 17 Sep 2009 14:27:41 -0700
-Subject: staging: android: ramconsole: Ensure ramconsole does not get
- cluttered by apanic threads
-Patch-mainline: HEAD
-Git-commit: fdfc8089429b58b4ac901926fe83fa85b0b7bfc1
-
-[Note, this is part of a patch from Sam, just the drivers/staging/
-portion, that adds a function that the apanic code calls, but the apanic
-code isn't here, so just include part of this to make merges and diffs
-easier and this keeps things self-contained - gregkh]
-
-Signed-off-by: San Mehat <san@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
-index 8f18a59..d735be4 100644
---- a/drivers/staging/android/ram_console.c
-+++ b/drivers/staging/android/ram_console.c
-@@ -146,6 +146,14 @@ static struct console ram_console = {
- .index = -1,
- };
-
-+void ram_console_enable_console(int enabled)
-+{
-+ if (enabled)
-+ ram_console.flags |= CON_ENABLED;
-+ else
-+ ram_console.flags &= ~CON_ENABLED;
-+}
-+
- static void __init
- ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
- {
diff --git a/patches.android/android-0007-Staging-android-ram_console-Start-ram-console-earlier.patch b/patches.android/android-0007-Staging-android-ram_console-Start-ram-console-earlier.patch
deleted file mode 100644
index 196de3821f3f75..00000000000000
--- a/patches.android/android-0007-Staging-android-ram_console-Start-ram-console-earlier.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 81057ec1ded5ddf15149c3b266f414c0fbde5530 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Thu, 17 Dec 2009 23:42:08 -0800
-Subject: Staging: android: ram_console: Start ram console earlier
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 81057ec1ded5ddf15149c3b266f414c0fbde5530
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
-index d735be4..53f736b 100644
---- a/drivers/staging/android/ram_console.c
-+++ b/drivers/staging/android/ram_console.c
-@@ -412,7 +412,7 @@ static int __init ram_console_late_init(void)
- #ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
- console_initcall(ram_console_early_init);
- #else
--module_init(ram_console_module_init);
-+postcore_initcall(ram_console_module_init);
- #endif
- late_initcall(ram_console_late_init);
-
diff --git a/patches.android/android-0008-Staging-android-timed_gpio-Request-gpios.patch b/patches.android/android-0008-Staging-android-timed_gpio-Request-gpios.patch
deleted file mode 100644
index 2ef7c1f6ee1079..00000000000000
--- a/patches.android/android-0008-Staging-android-timed_gpio-Request-gpios.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 0445f1548fc66a72f3b91cdbe8f26b120245efd1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Wed, 6 Jan 2010 17:17:33 -0800
-Subject: Staging: android: timed_gpio: Request gpios.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 0445f1548fc66a72f3b91cdbe8f26b120245efd1
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
-index 3bfe6e0..a64481c 100644
---- a/drivers/staging/android/timed_gpio.c
-+++ b/drivers/staging/android/timed_gpio.c
-@@ -107,10 +107,17 @@ static int timed_gpio_probe(struct platform_device *pdev)
- gpio_dat->dev.name = cur_gpio->name;
- gpio_dat->dev.get_time = gpio_get_time;
- gpio_dat->dev.enable = gpio_enable;
-- ret = timed_output_dev_register(&gpio_dat->dev);
-+ ret = gpio_request(cur_gpio->gpio, cur_gpio->name);
-+ if (ret >= 0) {
-+ ret = timed_output_dev_register(&gpio_dat->dev);
-+ if (ret < 0)
-+ gpio_free(cur_gpio->gpio);
-+ }
- if (ret < 0) {
-- for (j = 0; j < i; j++)
-+ for (j = 0; j < i; j++) {
- timed_output_dev_unregister(&gpio_data[i].dev);
-+ gpio_free(gpio_data[i].gpio);
-+ }
- kfree(gpio_data);
- return ret;
- }
-@@ -132,8 +139,10 @@ static int timed_gpio_remove(struct platform_device *pdev)
- struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
- int i;
-
-- for (i = 0; i < pdata->num_gpios; i++)
-+ for (i = 0; i < pdata->num_gpios; i++) {
- timed_output_dev_unregister(&gpio_data[i].dev);
-+ gpio_free(gpio_data[i].gpio);
-+ }
-
- kfree(gpio_data);
-
diff --git a/patches.android/android-0009-android-logger-Add-new-system-log-for-framework-system-log-m.patch b/patches.android/android-0009-android-logger-Add-new-system-log-for-framework-system-log-m.patch
deleted file mode 100644
index c4e4cf3f4c2284..00000000000000
--- a/patches.android/android-0009-android-logger-Add-new-system-log-for-framework-system-log-m.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 3537cdaa16205d2af7e1195276c786f22bada574 Mon Sep 17 00:00:00 2001
-From: San Mehat <san@google.com>
-Date: Tue, 23 Feb 2010 16:09:47 -0800
-Subject: android: logger: Add new system log for framework/system log
- messages
-Patch-mainline: HEAD
-Git-commit: 3537cdaa16205d2af7e1195276c786f22bada574
-
-Signed-off-by: San Mehat <san@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-index dd76564..531bdbe 100644
---- a/drivers/staging/android/logger.c
-+++ b/drivers/staging/android/logger.c
-@@ -558,6 +558,7 @@ static struct logger_log VAR = { \
- DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
- DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
- DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
-+DEFINE_LOGGER_DEVICE(log_system, LOGGER_LOG_SYSTEM, 64*1024)
-
- static struct logger_log *get_log_from_minor(int minor)
- {
-@@ -567,6 +568,8 @@ static struct logger_log *get_log_from_minor(int minor)
- return &log_events;
- if (log_radio.misc.minor == minor)
- return &log_radio;
-+ if (log_system.misc.minor == minor)
-+ return &log_system;
- return NULL;
- }
-
-@@ -603,6 +606,10 @@ static int __init logger_init(void)
- if (unlikely(ret))
- goto out;
-
-+ ret = init_log(&log_system);
-+ if (unlikely(ret))
-+ goto out;
-+
- out:
- return ret;
- }
-diff --git a/drivers/staging/android/logger.h b/drivers/staging/android/logger.h
-index a562434..2cb06e9 100644
---- a/drivers/staging/android/logger.h
-+++ b/drivers/staging/android/logger.h
-@@ -32,6 +32,7 @@ struct logger_entry {
-
- #define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */
- #define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */
-+#define LOGGER_LOG_SYSTEM "log_system" /* system/framework messages */
- #define LOGGER_LOG_MAIN "log_main" /* everything else */
-
- #define LOGGER_ENTRY_MAX_LEN (4*1024)
diff --git a/patches.android/android-0010-binder-Use-seq_file-for-debug-interface.patch b/patches.android/android-0010-binder-Use-seq_file-for-debug-interface.patch
deleted file mode 100644
index a05bb2ceaa5491..00000000000000
--- a/patches.android/android-0010-binder-Use-seq_file-for-debug-interface.patch
+++ /dev/null
@@ -1,835 +0,0 @@
-From 5249f4883045de494916db7b1a6d6e1e422e9a0b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Tue, 28 Apr 2009 20:57:50 -0700
-Subject: binder: Use seq_file for debug interface.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 5249f4883045de494916db7b1a6d6e1e422e9a0b
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 3aec4530..371232b 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -29,6 +29,7 @@
- #include <linux/proc_fs.h>
- #include <linux/rbtree.h>
- #include <linux/sched.h>
-+#include <linux/seq_file.h>
- #include <linux/uaccess.h>
- #include <linux/vmalloc.h>
- #include <linux/slab.h>
-@@ -48,8 +49,22 @@ static struct binder_node *binder_context_mgr_node;
- static uid_t binder_context_mgr_uid = -1;
- static int binder_last_id;
-
--static int binder_read_proc_proc(char *page, char **start, off_t off,
-- int count, int *eof, void *data);
-+#define BINDER_DEBUG_ENTRY(name) \
-+static int binder_##name##_open(struct inode *inode, struct file *file) \
-+{ \
-+ return single_open(file, binder_##name##_show, PDE(inode)->data); \
-+} \
-+\
-+static const struct file_operations binder_##name##_fops = { \
-+ .owner = THIS_MODULE, \
-+ .open = binder_##name##_open, \
-+ .read = seq_read, \
-+ .llseek = seq_lseek, \
-+ .release = single_release, \
-+}
-+
-+static int binder_proc_show(struct seq_file *m, void *unused);
-+BINDER_DEBUG_ENTRY(proc);
-
- /* This is only defined in include/asm-arm/sizes.h */
- #ifndef SZ_1K
-@@ -2880,9 +2895,9 @@ static int binder_open(struct inode *nodp, struct file *filp)
- char strbuf[11];
- snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
- remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
-- create_proc_read_entry(strbuf, S_IRUGO,
-- binder_proc_dir_entry_proc,
-- binder_read_proc_proc, proc);
-+ proc_create_data(strbuf, S_IRUGO,
-+ binder_proc_dir_entry_proc,
-+ &binder_proc_fops, proc);
- }
-
- return 0;
-@@ -3105,49 +3120,41 @@ binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
- mutex_unlock(&binder_deferred_lock);
- }
-
--static char *print_binder_transaction(char *buf, char *end, const char *prefix,
-- struct binder_transaction *t)
--{
-- buf += snprintf(buf, end - buf,
-- "%s %d: %p from %d:%d to %d:%d code %x "
-- "flags %x pri %ld r%d",
-- prefix, t->debug_id, t,
-- t->from ? t->from->proc->pid : 0,
-- t->from ? t->from->pid : 0,
-- t->to_proc ? t->to_proc->pid : 0,
-- t->to_thread ? t->to_thread->pid : 0,
-- t->code, t->flags, t->priority, t->need_reply);
-- if (buf >= end)
-- return buf;
-+static void print_binder_transaction(struct seq_file *m, const char *prefix,
-+ struct binder_transaction *t)
-+{
-+ seq_printf(m,
-+ "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d",
-+ prefix, t->debug_id, t,
-+ t->from ? t->from->proc->pid : 0,
-+ t->from ? t->from->pid : 0,
-+ t->to_proc ? t->to_proc->pid : 0,
-+ t->to_thread ? t->to_thread->pid : 0,
-+ t->code, t->flags, t->priority, t->need_reply);
- if (t->buffer == NULL) {
-- buf += snprintf(buf, end - buf, " buffer free\n");
-- return buf;
-- }
-- if (t->buffer->target_node) {
-- buf += snprintf(buf, end - buf, " node %d",
-- t->buffer->target_node->debug_id);
-- if (buf >= end)
-- return buf;
-+ seq_puts(m, " buffer free\n");
-+ return;
- }
-- buf += snprintf(buf, end - buf, " size %zd:%zd data %p\n",
-- t->buffer->data_size, t->buffer->offsets_size,
-- t->buffer->data);
-- return buf;
-+ if (t->buffer->target_node)
-+ seq_printf(m, " node %d",
-+ t->buffer->target_node->debug_id);
-+ seq_printf(m, " size %zd:%zd data %p\n",
-+ t->buffer->data_size, t->buffer->offsets_size,
-+ t->buffer->data);
- }
-
--static char *print_binder_buffer(char *buf, char *end, const char *prefix,
-- struct binder_buffer *buffer)
-+static void print_binder_buffer(struct seq_file *m, const char *prefix,
-+ struct binder_buffer *buffer)
- {
-- buf += snprintf(buf, end - buf, "%s %d: %p size %zd:%zd %s\n",
-- prefix, buffer->debug_id, buffer->data,
-- buffer->data_size, buffer->offsets_size,
-- buffer->transaction ? "active" : "delivered");
-- return buf;
-+ seq_printf(m, "%s %d: %p size %zd:%zd %s\n",
-+ prefix, buffer->debug_id, buffer->data,
-+ buffer->data_size, buffer->offsets_size,
-+ buffer->transaction ? "active" : "delivered");
- }
-
--static char *print_binder_work(char *buf, char *end, const char *prefix,
-- const char *transaction_prefix,
-- struct binder_work *w)
-+static void print_binder_work(struct seq_file *m, const char *prefix,
-+ const char *transaction_prefix,
-+ struct binder_work *w)
- {
- struct binder_node *node;
- struct binder_transaction *t;
-@@ -3155,79 +3162,65 @@ static char *print_binder_work(char *buf, char *end, const char *prefix,
- switch (w->type) {
- case BINDER_WORK_TRANSACTION:
- t = container_of(w, struct binder_transaction, work);
-- buf = print_binder_transaction(buf, end, transaction_prefix, t);
-+ print_binder_transaction(m, transaction_prefix, t);
- break;
- case BINDER_WORK_TRANSACTION_COMPLETE:
-- buf += snprintf(buf, end - buf,
-- "%stransaction complete\n", prefix);
-+ seq_printf(m, "%stransaction complete\n", prefix);
- break;
- case BINDER_WORK_NODE:
- node = container_of(w, struct binder_node, work);
-- buf += snprintf(buf, end - buf, "%snode work %d: u%p c%p\n",
-- prefix, node->debug_id, node->ptr,
-- node->cookie);
-+ seq_printf(m, "%snode work %d: u%p c%p\n",
-+ prefix, node->debug_id, node->ptr, node->cookie);
- break;
- case BINDER_WORK_DEAD_BINDER:
-- buf += snprintf(buf, end - buf, "%shas dead binder\n", prefix);
-+ seq_printf(m, "%shas dead binder\n", prefix);
- break;
- case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
-- buf += snprintf(buf, end - buf,
-- "%shas cleared dead binder\n", prefix);
-+ seq_printf(m, "%shas cleared dead binder\n", prefix);
- break;
- case BINDER_WORK_CLEAR_DEATH_NOTIFICATION:
-- buf += snprintf(buf, end - buf,
-- "%shas cleared death notification\n", prefix);
-+ seq_printf(m, "%shas cleared death notification\n", prefix);
- break;
- default:
-- buf += snprintf(buf, end - buf, "%sunknown work: type %d\n",
-- prefix, w->type);
-+ seq_printf(m, "%sunknown work: type %d\n", prefix, w->type);
- break;
- }
-- return buf;
- }
-
--static char *print_binder_thread(char *buf, char *end,
-- struct binder_thread *thread,
-- int print_always)
-+static void print_binder_thread(struct seq_file *m,
-+ struct binder_thread *thread,
-+ int print_always)
- {
- struct binder_transaction *t;
- struct binder_work *w;
-- char *start_buf = buf;
-- char *header_buf;
-+ size_t start_pos = m->count;
-+ size_t header_pos;
-
-- buf += snprintf(buf, end - buf, " thread %d: l %02x\n",
-- thread->pid, thread->looper);
-- header_buf = buf;
-+ seq_printf(m, " thread %d: l %02x\n", thread->pid, thread->looper);
-+ header_pos = m->count;
- t = thread->transaction_stack;
- while (t) {
-- if (buf >= end)
-- break;
- if (t->from == thread) {
-- buf = print_binder_transaction(buf, end,
-- " outgoing transaction", t);
-+ print_binder_transaction(m,
-+ " outgoing transaction", t);
- t = t->from_parent;
- } else if (t->to_thread == thread) {
-- buf = print_binder_transaction(buf, end,
-- " incoming transaction", t);
-+ print_binder_transaction(m,
-+ " incoming transaction", t);
- t = t->to_parent;
- } else {
-- buf = print_binder_transaction(buf, end,
-- " bad transaction", t);
-+ print_binder_transaction(m, " bad transaction", t);
- t = NULL;
- }
- }
- list_for_each_entry(w, &thread->todo, entry) {
-- if (buf >= end)
-- break;
-- buf = print_binder_work(buf, end, " ",
-- " pending transaction", w);
-+ print_binder_work(m, " ", " pending transaction", w);
- }
-- if (!print_always && buf == header_buf)
-- buf = start_buf;
-- return buf;
-+ if (!print_always && m->count == header_pos)
-+ m->count = start_pos;
- }
-
--static char *print_binder_node(char *buf, char *end, struct binder_node *node)
-+static void print_binder_node(struct seq_file *m, struct binder_node *node)
- {
- struct binder_ref *ref;
- struct hlist_node *pos;
-@@ -3238,100 +3231,67 @@ static char *print_binder_node(char *buf, char *end, struct binder_node *node)
- hlist_for_each_entry(ref, pos, &node->refs, node_entry)
- count++;
-
-- buf += snprintf(buf, end - buf,
-- " node %d: u%p c%p hs %d hw %d ls %d lw %d "
-- "is %d iw %d",
-- node->debug_id, node->ptr, node->cookie,
-- node->has_strong_ref, node->has_weak_ref,
-- node->local_strong_refs, node->local_weak_refs,
-- node->internal_strong_refs, count);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, " node %d: u%p c%p hs %d hw %d ls %d lw %d is %d iw %d",
-+ node->debug_id, node->ptr, node->cookie,
-+ node->has_strong_ref, node->has_weak_ref,
-+ node->local_strong_refs, node->local_weak_refs,
-+ node->internal_strong_refs, count);
- if (count) {
-- buf += snprintf(buf, end - buf, " proc");
-- if (buf >= end)
-- return buf;
-- hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
-- buf += snprintf(buf, end - buf, " %d", ref->proc->pid);
-- if (buf >= end)
-- return buf;
-- }
-+ seq_puts(m, " proc");
-+ hlist_for_each_entry(ref, pos, &node->refs, node_entry)
-+ seq_printf(m, " %d", ref->proc->pid);
- }
-- buf += snprintf(buf, end - buf, "\n");
-- list_for_each_entry(w, &node->async_todo, entry) {
-- if (buf >= end)
-- break;
-- buf = print_binder_work(buf, end, " ",
-- " pending async transaction", w);
-- }
-- return buf;
-+ seq_puts(m, "\n");
-+ list_for_each_entry(w, &node->async_todo, entry)
-+ print_binder_work(m, " ",
-+ " pending async transaction", w);
- }
-
--static char *print_binder_ref(char *buf, char *end, struct binder_ref *ref)
-+static void print_binder_ref(struct seq_file *m, struct binder_ref *ref)
- {
-- buf += snprintf(buf, end - buf,
-- " ref %d: desc %d %snode %d s %d w %d d %p\n",
-- ref->debug_id, ref->desc,
-- ref->node->proc ? "" : "dead ", ref->node->debug_id,
-- ref->strong, ref->weak, ref->death);
-- return buf;
-+ seq_printf(m, " ref %d: desc %d %snode %d s %d w %d d %p\n",
-+ ref->debug_id, ref->desc, ref->node->proc ? "" : "dead ",
-+ ref->node->debug_id, ref->strong, ref->weak, ref->death);
- }
-
--static char *print_binder_proc(char *buf, char *end,
-- struct binder_proc *proc, int print_all)
-+static void print_binder_proc(struct seq_file *m,
-+ struct binder_proc *proc, int print_all)
- {
- struct binder_work *w;
- struct rb_node *n;
-- char *start_buf = buf;
-- char *header_buf;
--
-- buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
-- header_buf = buf;
--
-- for (n = rb_first(&proc->threads);
-- n != NULL && buf < end;
-- n = rb_next(n))
-- buf = print_binder_thread(buf, end,
-- rb_entry(n, struct binder_thread,
-- rb_node), print_all);
-- for (n = rb_first(&proc->nodes);
-- n != NULL && buf < end;
-- n = rb_next(n)) {
-+ size_t start_pos = m->count;
-+ size_t header_pos;
-+
-+ seq_printf(m, "proc %d\n", proc->pid);
-+ header_pos = m->count;
-+
-+ for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n))
-+ print_binder_thread(m, rb_entry(n, struct binder_thread,
-+ rb_node), print_all);
-+ for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) {
- struct binder_node *node = rb_entry(n, struct binder_node,
- rb_node);
- if (print_all || node->has_async_transaction)
-- buf = print_binder_node(buf, end, node);
-+ print_binder_node(m, node);
- }
- if (print_all) {
- for (n = rb_first(&proc->refs_by_desc);
-- n != NULL && buf < end;
-+ n != NULL;
- n = rb_next(n))
-- buf = print_binder_ref(buf, end,
-- rb_entry(n, struct binder_ref,
-- rb_node_desc));
-- }
-- for (n = rb_first(&proc->allocated_buffers);
-- n != NULL && buf < end;
-- n = rb_next(n))
-- buf = print_binder_buffer(buf, end, " buffer",
-- rb_entry(n, struct binder_buffer,
-- rb_node));
-- list_for_each_entry(w, &proc->todo, entry) {
-- if (buf >= end)
-- break;
-- buf = print_binder_work(buf, end, " ",
-- " pending transaction", w);
-+ print_binder_ref(m, rb_entry(n, struct binder_ref,
-+ rb_node_desc));
- }
-+ for (n = rb_first(&proc->allocated_buffers); n != NULL; n = rb_next(n))
-+ print_binder_buffer(m, " buffer",
-+ rb_entry(n, struct binder_buffer, rb_node));
-+ list_for_each_entry(w, &proc->todo, entry)
-+ print_binder_work(m, " ", " pending transaction", w);
- list_for_each_entry(w, &proc->delivered_death, entry) {
-- if (buf >= end)
-- break;
-- buf += snprintf(buf, end - buf,
-- " has delivered dead binder\n");
-+ seq_puts(m, " has delivered dead binder\n");
- break;
- }
-- if (!print_all && buf == header_buf)
-- buf = start_buf;
-- return buf;
-+ if (!print_all && m->count == header_pos)
-+ m->count = start_pos;
- }
-
- static const char *binder_return_strings[] = {
-@@ -3385,79 +3345,61 @@ static const char *binder_objstat_strings[] = {
- "transaction_complete"
- };
-
--static char *print_binder_stats(char *buf, char *end, const char *prefix,
-- struct binder_stats *stats)
-+static void print_binder_stats(struct seq_file *m, const char *prefix,
-+ struct binder_stats *stats)
- {
- int i;
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->bc) !=
-- ARRAY_SIZE(binder_command_strings));
-+ ARRAY_SIZE(binder_command_strings));
- for (i = 0; i < ARRAY_SIZE(stats->bc); i++) {
- if (stats->bc[i])
-- buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
-- binder_command_strings[i],
-- stats->bc[i]);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, "%s%s: %d\n", prefix,
-+ binder_command_strings[i], stats->bc[i]);
- }
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->br) !=
-- ARRAY_SIZE(binder_return_strings));
-+ ARRAY_SIZE(binder_return_strings));
- for (i = 0; i < ARRAY_SIZE(stats->br); i++) {
- if (stats->br[i])
-- buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
-- binder_return_strings[i], stats->br[i]);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, "%s%s: %d\n", prefix,
-+ binder_return_strings[i], stats->br[i]);
- }
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
-- ARRAY_SIZE(binder_objstat_strings));
-+ ARRAY_SIZE(binder_objstat_strings));
- BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
-- ARRAY_SIZE(stats->obj_deleted));
-+ ARRAY_SIZE(stats->obj_deleted));
- for (i = 0; i < ARRAY_SIZE(stats->obj_created); i++) {
- if (stats->obj_created[i] || stats->obj_deleted[i])
-- buf += snprintf(buf, end - buf,
-- "%s%s: active %d total %d\n", prefix,
-- binder_objstat_strings[i],
-- stats->obj_created[i] -
-- stats->obj_deleted[i],
-- stats->obj_created[i]);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, "%s%s: active %d total %d\n", prefix,
-+ binder_objstat_strings[i],
-+ stats->obj_created[i] - stats->obj_deleted[i],
-+ stats->obj_created[i]);
- }
-- return buf;
- }
-
--static char *print_binder_proc_stats(char *buf, char *end,
-- struct binder_proc *proc)
-+static void print_binder_proc_stats(struct seq_file *m,
-+ struct binder_proc *proc)
- {
- struct binder_work *w;
- struct rb_node *n;
- int count, strong, weak;
-
-- buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, "proc %d\n", proc->pid);
- count = 0;
- for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n))
- count++;
-- buf += snprintf(buf, end - buf, " threads: %d\n", count);
-- if (buf >= end)
-- return buf;
-- buf += snprintf(buf, end - buf, " requested threads: %d+%d/%d\n"
-+ seq_printf(m, " threads: %d\n", count);
-+ seq_printf(m, " requested threads: %d+%d/%d\n"
- " ready threads %d\n"
- " free async space %zd\n", proc->requested_threads,
- proc->requested_threads_started, proc->max_threads,
- proc->ready_threads, proc->free_async_space);
-- if (buf >= end)
-- return buf;
- count = 0;
- for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n))
- count++;
-- buf += snprintf(buf, end - buf, " nodes: %d\n", count);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, " nodes: %d\n", count);
- count = 0;
- strong = 0;
- weak = 0;
-@@ -3468,17 +3410,12 @@ static char *print_binder_proc_stats(char *buf, char *end,
- strong += ref->strong;
- weak += ref->weak;
- }
-- buf += snprintf(buf, end - buf, " refs: %d s %d w %d\n",
-- count, strong, weak);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, " refs: %d s %d w %d\n", count, strong, weak);
-
- count = 0;
- for (n = rb_first(&proc->allocated_buffers); n != NULL; n = rb_next(n))
- count++;
-- buf += snprintf(buf, end - buf, " buffers: %d\n", count);
-- if (buf >= end)
-- return buf;
-+ seq_printf(m, " buffers: %d\n", count);
-
- count = 0;
- list_for_each_entry(w, &proc->todo, entry) {
-@@ -3490,222 +3427,110 @@ static char *print_binder_proc_stats(char *buf, char *end,
- break;
- }
- }
-- buf += snprintf(buf, end - buf, " pending transactions: %d\n", count);
-- if (buf >= end)
-- return buf;
--
-- buf = print_binder_stats(buf, end, " ", &proc->stats);
-+ seq_printf(m, " pending transactions: %d\n", count);
-
-- return buf;
-+ print_binder_stats(m, " ", &proc->stats);
- }
-
-
--static int binder_read_proc_state(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int binder_state_show(struct seq_file *m, void *unused)
- {
- struct binder_proc *proc;
- struct hlist_node *pos;
- struct binder_node *node;
-- int len = 0;
-- char *buf = page;
-- char *end = page + PAGE_SIZE;
- int do_lock = !binder_debug_no_lock;
-
-- if (off)
-- return 0;
--
- if (do_lock)
- mutex_lock(&binder_lock);
-
-- buf += snprintf(buf, end - buf, "binder state:\n");
-+ seq_puts(m, "binder state:\n");
-
- if (!hlist_empty(&binder_dead_nodes))
-- buf += snprintf(buf, end - buf, "dead nodes:\n");
-- hlist_for_each_entry(node, pos, &binder_dead_nodes, dead_node) {
-- if (buf >= end)
-- break;
-- buf = print_binder_node(buf, end, node);
-- }
-+ seq_puts(m, "dead nodes:\n");
-+ hlist_for_each_entry(node, pos, &binder_dead_nodes, dead_node)
-+ print_binder_node(m, node);
-
-- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-- if (buf >= end)
-- break;
-- buf = print_binder_proc(buf, end, proc, 1);
-- }
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
-+ print_binder_proc(m, proc, 1);
- if (do_lock)
- mutex_unlock(&binder_lock);
-- if (buf > page + PAGE_SIZE)
-- buf = page + PAGE_SIZE;
--
-- *start = page + off;
--
-- len = buf - page;
-- if (len > off)
-- len -= off;
-- else
-- len = 0;
--
-- return len < count ? len : count;
-+ return 0;
- }
-
--static int binder_read_proc_stats(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int binder_stats_show(struct seq_file *m, void *unused)
- {
- struct binder_proc *proc;
- struct hlist_node *pos;
-- int len = 0;
-- char *p = page;
- int do_lock = !binder_debug_no_lock;
-
-- if (off)
-- return 0;
--
- if (do_lock)
- mutex_lock(&binder_lock);
-
-- p += snprintf(p, PAGE_SIZE, "binder stats:\n");
-+ seq_puts(m, "binder stats:\n");
-
-- p = print_binder_stats(p, page + PAGE_SIZE, "", &binder_stats);
-+ print_binder_stats(m, "", &binder_stats);
-
-- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-- if (p >= page + PAGE_SIZE)
-- break;
-- p = print_binder_proc_stats(p, page + PAGE_SIZE, proc);
-- }
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
-+ print_binder_proc_stats(m, proc);
- if (do_lock)
- mutex_unlock(&binder_lock);
-- if (p > page + PAGE_SIZE)
-- p = page + PAGE_SIZE;
--
-- *start = page + off;
--
-- len = p - page;
-- if (len > off)
-- len -= off;
-- else
-- len = 0;
--
-- return len < count ? len : count;
-+ return 0;
- }
-
--static int binder_read_proc_transactions(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int binder_transactions_show(struct seq_file *m, void *unused)
- {
- struct binder_proc *proc;
- struct hlist_node *pos;
-- int len = 0;
-- char *buf = page;
-- char *end = page + PAGE_SIZE;
- int do_lock = !binder_debug_no_lock;
-
-- if (off)
-- return 0;
--
- if (do_lock)
- mutex_lock(&binder_lock);
-
-- buf += snprintf(buf, end - buf, "binder transactions:\n");
-- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
-- if (buf >= end)
-- break;
-- buf = print_binder_proc(buf, end, proc, 0);
-- }
-+ seq_puts(m, "binder transactions:\n");
-+ hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
-+ print_binder_proc(m, proc, 0);
- if (do_lock)
- mutex_unlock(&binder_lock);
-- if (buf > page + PAGE_SIZE)
-- buf = page + PAGE_SIZE;
--
-- *start = page + off;
--
-- len = buf - page;
-- if (len > off)
-- len -= off;
-- else
-- len = 0;
--
-- return len < count ? len : count;
-+ return 0;
- }
-
--static int binder_read_proc_proc(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int binder_proc_show(struct seq_file *m, void *unused)
- {
-- struct binder_proc *proc = data;
-- int len = 0;
-- char *p = page;
-+ struct binder_proc *proc = m->private;
- int do_lock = !binder_debug_no_lock;
-
-- if (off)
-- return 0;
--
- if (do_lock)
- mutex_lock(&binder_lock);
-- p += snprintf(p, PAGE_SIZE, "binder proc state:\n");
-- p = print_binder_proc(p, page + PAGE_SIZE, proc, 1);
-+ seq_puts(m, "binder proc state:\n");
-+ print_binder_proc(m, proc, 1);
- if (do_lock)
- mutex_unlock(&binder_lock);
--
-- if (p > page + PAGE_SIZE)
-- p = page + PAGE_SIZE;
-- *start = page + off;
--
-- len = p - page;
-- if (len > off)
-- len -= off;
-- else
-- len = 0;
--
-- return len < count ? len : count;
-+ return 0;
- }
-
--static char *print_binder_transaction_log_entry(char *buf, char *end,
-+static void print_binder_transaction_log_entry(struct seq_file *m,
- struct binder_transaction_log_entry *e)
- {
-- buf += snprintf(buf, end - buf,
-- "%d: %s from %d:%d to %d:%d node %d handle %d "
-- "size %d:%d\n",
-- e->debug_id, (e->call_type == 2) ? "reply" :
-- ((e->call_type == 1) ? "async" : "call "), e->from_proc,
-- e->from_thread, e->to_proc, e->to_thread, e->to_node,
-- e->target_handle, e->data_size, e->offsets_size);
-- return buf;
-+ seq_printf(m,
-+ "%d: %s from %d:%d to %d:%d node %d handle %d size %d:%d\n",
-+ e->debug_id, (e->call_type == 2) ? "reply" :
-+ ((e->call_type == 1) ? "async" : "call "), e->from_proc,
-+ e->from_thread, e->to_proc, e->to_thread, e->to_node,
-+ e->target_handle, e->data_size, e->offsets_size);
- }
-
--static int binder_read_proc_transaction_log(
-- char *page, char **start, off_t off, int count, int *eof, void *data)
-+static int binder_transaction_log_show(struct seq_file *m, void *unused)
- {
-- struct binder_transaction_log *log = data;
-- int len = 0;
-+ struct binder_transaction_log *log = m->private;
- int i;
-- char *buf = page;
-- char *end = page + PAGE_SIZE;
--
-- if (off)
-- return 0;
-
- if (log->full) {
-- for (i = log->next; i < ARRAY_SIZE(log->entry); i++) {
-- if (buf >= end)
-- break;
-- buf = print_binder_transaction_log_entry(buf, end,
-- &log->entry[i]);
-- }
-+ for (i = log->next; i < ARRAY_SIZE(log->entry); i++)
-+ print_binder_transaction_log_entry(m, &log->entry[i]);
- }
-- for (i = 0; i < log->next; i++) {
-- if (buf >= end)
-- break;
-- buf = print_binder_transaction_log_entry(buf, end,
-- &log->entry[i]);
-- }
--
-- *start = page + off;
--
-- len = buf - page;
-- if (len > off)
-- len -= off;
-- else
-- len = 0;
--
-- return len < count ? len : count;
-+ for (i = 0; i < log->next; i++)
-+ print_binder_transaction_log_entry(m, &log->entry[i]);
-+ return 0;
- }
-
- static const struct file_operations binder_fops = {
-@@ -3724,6 +3549,11 @@ static struct miscdevice binder_miscdev = {
- .fops = &binder_fops
- };
-
-+BINDER_DEBUG_ENTRY(state);
-+BINDER_DEBUG_ENTRY(stats);
-+BINDER_DEBUG_ENTRY(transactions);
-+BINDER_DEBUG_ENTRY(transaction_log);
-+
- static int __init binder_init(void)
- {
- int ret;
-@@ -3734,31 +3564,28 @@ static int __init binder_init(void)
- binder_proc_dir_entry_root);
- ret = misc_register(&binder_miscdev);
- if (binder_proc_dir_entry_root) {
-- create_proc_read_entry("state",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- binder_read_proc_state,
-- NULL);
-- create_proc_read_entry("stats",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- binder_read_proc_stats,
-- NULL);
-- create_proc_read_entry("transactions",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- binder_read_proc_transactions,
-- NULL);
-- create_proc_read_entry("transaction_log",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- binder_read_proc_transaction_log,
-- &binder_transaction_log);
-- create_proc_read_entry("failed_transaction_log",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- binder_read_proc_transaction_log,
-- &binder_transaction_log_failed);
-+ proc_create("state",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ &binder_state_fops);
-+ proc_create("stats",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ &binder_stats_fops);
-+ proc_create("transactions",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ &binder_transactions_fops);
-+ proc_create_data("transaction_log",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ &binder_transaction_log_fops,
-+ &binder_transaction_log);
-+ proc_create_data("failed_transaction_log",
-+ S_IRUGO,
-+ binder_proc_dir_entry_root,
-+ &binder_transaction_log_fops,
-+ &binder_transaction_log_failed);
- }
- return ret;
- }
diff --git a/patches.android/android-0011-staging-android-binder-Move-debugging-information-from-procf.patch b/patches.android/android-0011-staging-android-binder-Move-debugging-information-from-procf.patch
deleted file mode 100644
index 961982ec39ea5c..00000000000000
--- a/patches.android/android-0011-staging-android-binder-Move-debugging-information-from-procf.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 16b665543864904714f028b1d349f5d905f39afb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Tue, 28 Apr 2009 20:57:50 -0700
-Subject: staging: android: binder: Move debugging information from
- procfs to debugfs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 16b665543864904714f028b1d349f5d905f39afb
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 371232b..669e2a6 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -26,7 +26,7 @@
- #include <linux/mutex.h>
- #include <linux/nsproxy.h>
- #include <linux/poll.h>
--#include <linux/proc_fs.h>
-+#include <linux/debugfs.h>
- #include <linux/rbtree.h>
- #include <linux/sched.h>
- #include <linux/seq_file.h>
-@@ -43,8 +43,8 @@ static HLIST_HEAD(binder_procs);
- static HLIST_HEAD(binder_deferred_list);
- static HLIST_HEAD(binder_dead_nodes);
-
--static struct proc_dir_entry *binder_proc_dir_entry_root;
--static struct proc_dir_entry *binder_proc_dir_entry_proc;
-+static struct dentry *binder_debugfs_dir_entry_root;
-+static struct dentry *binder_debugfs_dir_entry_proc;
- static struct binder_node *binder_context_mgr_node;
- static uid_t binder_context_mgr_uid = -1;
- static int binder_last_id;
-@@ -52,7 +52,7 @@ static int binder_last_id;
- #define BINDER_DEBUG_ENTRY(name) \
- static int binder_##name##_open(struct inode *inode, struct file *file) \
- { \
-- return single_open(file, binder_##name##_show, PDE(inode)->data); \
-+ return single_open(file, binder_##name##_show, inode->i_private); \
- } \
- \
- static const struct file_operations binder_##name##_fops = { \
-@@ -310,6 +310,7 @@ struct binder_proc {
- int requested_threads_started;
- int ready_threads;
- long default_priority;
-+ struct dentry *debugfs_entry;
- };
-
- enum {
-@@ -2891,13 +2892,11 @@ static int binder_open(struct inode *nodp, struct file *filp)
- filp->private_data = proc;
- mutex_unlock(&binder_lock);
-
-- if (binder_proc_dir_entry_proc) {
-+ if (binder_debugfs_dir_entry_proc) {
- char strbuf[11];
- snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
-- remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
-- proc_create_data(strbuf, S_IRUGO,
-- binder_proc_dir_entry_proc,
-- &binder_proc_fops, proc);
-+ proc->debugfs_entry = debugfs_create_file(strbuf, S_IRUGO,
-+ binder_debugfs_dir_entry_proc, proc, &binder_proc_fops);
- }
-
- return 0;
-@@ -2934,12 +2933,7 @@ static void binder_deferred_flush(struct binder_proc *proc)
- static int binder_release(struct inode *nodp, struct file *filp)
- {
- struct binder_proc *proc = filp->private_data;
-- if (binder_proc_dir_entry_proc) {
-- char strbuf[11];
-- snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
-- remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
-- }
--
-+ debugfs_remove(proc->debugfs_entry);
- binder_defer_work(proc, BINDER_DEFERRED_RELEASE);
-
- return 0;
-@@ -3558,34 +3552,37 @@ static int __init binder_init(void)
- {
- int ret;
-
-- binder_proc_dir_entry_root = proc_mkdir("binder", NULL);
-- if (binder_proc_dir_entry_root)
-- binder_proc_dir_entry_proc = proc_mkdir("proc",
-- binder_proc_dir_entry_root);
-+ binder_debugfs_dir_entry_root = debugfs_create_dir("binder", NULL);
-+ if (binder_debugfs_dir_entry_root)
-+ binder_debugfs_dir_entry_proc = debugfs_create_dir("proc",
-+ binder_debugfs_dir_entry_root);
- ret = misc_register(&binder_miscdev);
-- if (binder_proc_dir_entry_root) {
-- proc_create("state",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- &binder_state_fops);
-- proc_create("stats",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- &binder_stats_fops);
-- proc_create("transactions",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- &binder_transactions_fops);
-- proc_create_data("transaction_log",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- &binder_transaction_log_fops,
-- &binder_transaction_log);
-- proc_create_data("failed_transaction_log",
-- S_IRUGO,
-- binder_proc_dir_entry_root,
-- &binder_transaction_log_fops,
-- &binder_transaction_log_failed);
-+ if (binder_debugfs_dir_entry_root) {
-+ debugfs_create_file("state",
-+ S_IRUGO,
-+ binder_debugfs_dir_entry_root,
-+ NULL,
-+ &binder_state_fops);
-+ debugfs_create_file("stats",
-+ S_IRUGO,
-+ binder_debugfs_dir_entry_root,
-+ NULL,
-+ &binder_stats_fops);
-+ debugfs_create_file("transactions",
-+ S_IRUGO,
-+ binder_debugfs_dir_entry_root,
-+ NULL,
-+ &binder_transactions_fops);
-+ debugfs_create_file("transaction_log",
-+ S_IRUGO,
-+ binder_debugfs_dir_entry_root,
-+ &binder_transaction_log,
-+ &binder_transaction_log_fops);
-+ debugfs_create_file("failed_transaction_log",
-+ S_IRUGO,
-+ binder_debugfs_dir_entry_root,
-+ &binder_transaction_log_failed,
-+ &binder_transaction_log_fops);
- }
- return ret;
- }
diff --git a/patches.android/android-0012-Staging-android-timed_gpio-Properly-discard-invalid-timeout-.patch b/patches.android/android-0012-Staging-android-timed_gpio-Properly-discard-invalid-timeout-.patch
deleted file mode 100644
index 3fa2971af38601..00000000000000
--- a/patches.android/android-0012-Staging-android-timed_gpio-Properly-discard-invalid-timeout-.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 8bfe15f3de0af92fd822b7475878bddc93fa490d Mon Sep 17 00:00:00 2001
-From: Mike Lockwood <lockwood@android.com>
-Date: Sat, 17 Apr 2010 12:01:35 -0400
-Subject: Staging: android: timed_gpio: Properly discard invalid
- timeout values.
-Patch-mainline: HEAD
-Git-commit: 8bfe15f3de0af92fd822b7475878bddc93fa490d
-
-The timed output device never previously checked the return value of sscanf,
-resulting in an uninitialized int being passed to enable() if input value
-was invalid.
-
-Signed-off-by: Mike Lockwood <lockwood@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
-index 62e7918..f373422 100644
---- a/drivers/staging/android/timed_output.c
-+++ b/drivers/staging/android/timed_output.c
-@@ -41,7 +41,9 @@ static ssize_t enable_store(
- struct timed_output_dev *tdev = dev_get_drvdata(dev);
- int value;
-
-- sscanf(buf, "%d", &value);
-+ if (sscanf(buf, "%d", &value) != 1)
-+ return -EINVAL;
-+
- tdev->enable(tdev, value);
-
- return size;
diff --git a/patches.android/android-0013-Staging-android-binder-Create-dedicated-workqueue-for-binder.patch b/patches.android/android-0013-Staging-android-binder-Create-dedicated-workqueue-for-binder.patch
deleted file mode 100644
index 69bb56fbb6c88a..00000000000000
--- a/patches.android/android-0013-Staging-android-binder-Create-dedicated-workqueue-for-binder.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 3c762a49b12073c96f6a55b4dfc8b6a2a45fedff Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Thu, 22 Apr 2010 15:53:23 -0700
-Subject: Staging: android: binder: Create dedicated workqueue for
- binder deferred work
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 3c762a49b12073c96f6a55b4dfc8b6a2a45fedff
-
-Some drivers flush the global workqueue when closed. This would deadlock if
-the last reference to the file was released from the binder.
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 669e2a6..6d6fe7b 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -48,6 +48,7 @@ static struct dentry *binder_debugfs_dir_entry_proc;
- static struct binder_node *binder_context_mgr_node;
- static uid_t binder_context_mgr_uid = -1;
- static int binder_last_id;
-+static struct workqueue_struct *binder_deferred_workqueue;
-
- #define BINDER_DEBUG_ENTRY(name) \
- static int binder_##name##_open(struct inode *inode, struct file *file) \
-@@ -3109,7 +3110,7 @@ binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
- if (hlist_unhashed(&proc->deferred_work_node)) {
- hlist_add_head(&proc->deferred_work_node,
- &binder_deferred_list);
-- schedule_work(&binder_deferred_work);
-+ queue_work(binder_deferred_workqueue, &binder_deferred_work);
- }
- mutex_unlock(&binder_deferred_lock);
- }
-@@ -3552,6 +3553,10 @@ static int __init binder_init(void)
- {
- int ret;
-
-+ binder_deferred_workqueue = create_singlethread_workqueue("binder");
-+ if (!binder_deferred_workqueue)
-+ return -ENOMEM;
-+
- binder_debugfs_dir_entry_root = debugfs_create_dir("binder", NULL);
- if (binder_debugfs_dir_entry_root)
- binder_debugfs_dir_entry_proc = debugfs_create_dir("proc",
diff --git a/patches.android/android-0014-staging-android-lowmemorykiller-Don-t-try-to-kill-the-same-p.patch b/patches.android/android-0014-staging-android-lowmemorykiller-Don-t-try-to-kill-the-same-p.patch
deleted file mode 100644
index 75be85a7c75dc9..00000000000000
--- a/patches.android/android-0014-staging-android-lowmemorykiller-Don-t-try-to-kill-the-same-p.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 4964cd41cd966502c1e0c5bc929ed15c175f8218 Mon Sep 17 00:00:00 2001
-From: San Mehat <san@google.com>
-Date: Mon, 26 Apr 2010 15:11:04 -0700
-Subject: staging: android: lowmemorykiller: Don't try to kill the
- same pid over and over
-Patch-mainline: HEAD
-Git-commit: 4964cd41cd966502c1e0c5bc929ed15c175f8218
-
- Under certain circumstances, a process can take awhile to
-handle a sig-kill (especially if it's in a scheduler group with
-a very low share ratio). When this occurs, lowmemkiller returns
-to vmscan indicating the process memory has been freed - even
-though the process is still waiting to die. Since the memory
-hasn't actually freed, lowmemkiller is called again shortly after,
-and picks the same process to die; regardless of the fact that
-it has already been 'scheduled' to die and the memory has already
-been reported to vmscan as having been freed.
-
- Solution is to check fatal_signal_pending() on the selected
-task, and if it's already pending destruction return; indicating
-to vmscan that no resources were freed on this pass.
-
-Signed-off-by: San Mehat <san@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 32314e8..8372178 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -133,6 +133,12 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- p->pid, p->comm, oom_adj, tasksize);
- }
- if (selected) {
-+ if (fatal_signal_pending(selected)) {
-+ pr_warning("process %d is suffering a slow death\n",
-+ selected->pid);
-+ read_unlock(&tasklist_lock);
-+ return rem;
-+ }
- lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
- selected->pid, selected->comm,
- selected_oom_adj, selected_tasksize);
diff --git a/patches.android/android-0015-staging-android-lowmemkiller-Substantially-reduce-overhead-d.patch b/patches.android/android-0015-staging-android-lowmemkiller-Substantially-reduce-overhead-d.patch
deleted file mode 100644
index 5f806128157363..00000000000000
--- a/patches.android/android-0015-staging-android-lowmemkiller-Substantially-reduce-overhead-d.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From 4755b72e261478b48337e0e54c8448cbea32c5c8 Mon Sep 17 00:00:00 2001
-From: San Mehat <san@google.com>
-Date: Wed, 5 May 2010 11:38:42 -0700
-Subject: staging: android: lowmemkiller: Substantially reduce
- overhead during reclaim
-Patch-mainline: HEAD
-Git-commit: 4755b72e261478b48337e0e54c8448cbea32c5c8
-
-This patch optimizes lowmemkiller to not do any work when it has an outstanding
-kill-request. This greatly reduces the pressure on the task_list lock
-(improving interactivity), as well as improving the vmscan performance
-when under heavy memory pressure (by up to 20x in tests).
-
-Note: For this enhancement to work, you need CONFIG_PROFILING
-
-Signed-off-by: San Mehat <san@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 8372178..4523093 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -34,6 +34,8 @@
- #include <linux/mm.h>
- #include <linux/oom.h>
- #include <linux/sched.h>
-+#include <linux/profile.h>
-+#include <linux/notifier.h>
-
- static uint32_t lowmem_debug_level = 2;
- static int lowmem_adj[6] = {
-@@ -51,12 +53,32 @@ static size_t lowmem_minfree[6] = {
- };
- static int lowmem_minfree_size = 4;
-
-+static struct task_struct *lowmem_deathpending;
-+
- #define lowmem_print(level, x...) \
- do { \
- if (lowmem_debug_level >= (level)) \
- printk(x); \
- } while (0)
-
-+static int
-+task_notify_func(struct notifier_block *self, unsigned long val, void *data);
-+
-+static struct notifier_block task_nb = {
-+ .notifier_call = task_notify_func,
-+};
-+
-+static int
-+task_notify_func(struct notifier_block *self, unsigned long val, void *data)
-+{
-+ struct task_struct *task = data;
-+ if (task == lowmem_deathpending) {
-+ lowmem_deathpending = NULL;
-+ task_handoff_unregister(&task_nb);
-+ }
-+ return NOTIFY_OK;
-+}
-+
- static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- {
- struct task_struct *p;
-@@ -71,6 +93,18 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- int other_free = global_page_state(NR_FREE_PAGES);
- int other_file = global_page_state(NR_FILE_PAGES);
-
-+ /*
-+ * If we already have a death outstanding, then
-+ * bail out right away; indicating to vmscan
-+ * that we have nothing further to offer on
-+ * this pass.
-+ *
-+ * Note: Currently you need CONFIG_PROFILING
-+ * for this to work correctly.
-+ */
-+ if (lowmem_deathpending)
-+ return 0;
-+
- if (lowmem_adj_size < array_size)
- array_size = lowmem_adj_size;
- if (lowmem_minfree_size < array_size)
-@@ -142,6 +176,15 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
- selected->pid, selected->comm,
- selected_oom_adj, selected_tasksize);
-+ /*
-+ * If CONFIG_PROFILING is off, then task_handoff_register()
-+ * is a nop. In that case we don't want to stall the killer
-+ * by setting lowmem_deathpending.
-+ */
-+#ifdef CONFIG_PROFILING
-+ lowmem_deathpending = selected;
-+ task_handoff_register(&task_nb);
-+#endif
- force_sig(SIGKILL, selected);
- rem -= selected_tasksize;
- }
diff --git a/patches.android/android-0016-staging-binder-Fix-memory-corruption-via-page-aliasing.patch b/patches.android/android-0016-staging-binder-Fix-memory-corruption-via-page-aliasing.patch
deleted file mode 100644
index dc17772c2bdccd..00000000000000
--- a/patches.android/android-0016-staging-binder-Fix-memory-corruption-via-page-aliasing.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 58526090ece3582516e62779739a7d665a74708c Mon Sep 17 00:00:00 2001
-From: Christopher Lais <chris+android@zenthought.org>
-Date: Sat, 1 May 2010 15:51:48 -0500
-Subject: staging: binder: Fix memory corruption via page aliasing
-Patch-mainline: HEAD
-Git-commit: 58526090ece3582516e62779739a7d665a74708c
-
-binder_deferred_release was not unmapping the page from the buffer
-before freeing it, causing memory corruption. This only happened
-when page(s) had not been freed by binder_update_page_range, which
-properly unmaps the pages.
-
-This only happens on architectures with VIPT aliasing.
-
-To reproduce, create a program which opens, mmaps, munmaps, then closes
-the binder very quickly. This should leave a page allocated when the
-binder is released. When binder_deferrred_release is called on the
-close, the page will remain mapped to the address in the linear
-proc->buffer. Later, we may map the same physical page to a different
-virtual address that has different coloring, and this may cause
-aliasing to occur.
-
-PAGE_POISONING will greatly increase your chances of noticing any
-problems.
-
-Signed-off-by: Christopher Lais <chris+android@zenthought.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 6d6fe7b..7491801 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -3036,11 +3036,14 @@ static void binder_deferred_release(struct binder_proc *proc)
- int i;
- for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
- if (proc->pages[i]) {
-+ void *page_addr = proc->buffer + i * PAGE_SIZE;
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder_release: %d: "
- "page %d at %p not freed\n",
- proc->pid, i,
-- proc->buffer + i * PAGE_SIZE);
-+ page_addr);
-+ unmap_kernel_range((unsigned long)page_addr,
-+ PAGE_SIZE);
- __free_page(proc->pages[i]);
- page_count++;
- }
diff --git a/patches.android/android-0017-staging-android-lowmemorykiller-Remove-bitrotted-codepath.patch b/patches.android/android-0017-staging-android-lowmemorykiller-Remove-bitrotted-codepath.patch
deleted file mode 100644
index 290c30bf9a87bf..00000000000000
--- a/patches.android/android-0017-staging-android-lowmemorykiller-Remove-bitrotted-codepath.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From eb943f6be011b33455b767880e13c34a2bb96a5e Mon Sep 17 00:00:00 2001
-From: San Mehat <san@google.com>
-Date: Thu, 6 May 2010 15:43:46 -0700
-Subject: staging: android: lowmemorykiller: Remove bitrotted codepath
-Patch-mainline: HEAD
-Git-commit: eb943f6be011b33455b767880e13c34a2bb96a5e
-
-Now that we're murder-synchronous, this code path will never be
-called (and if it does, it doesn't tell us anything useful other
-than we killed a task that was already being killed by somebody
-else but hadn't gotten its' signal yet)
-
-Signed-off-by: San Mehat <san@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 4523093..cf79eb9 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -167,12 +167,6 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
- p->pid, p->comm, oom_adj, tasksize);
- }
- if (selected) {
-- if (fatal_signal_pending(selected)) {
-- pr_warning("process %d is suffering a slow death\n",
-- selected->pid);
-- read_unlock(&tasklist_lock);
-- return rem;
-- }
- lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
- selected->pid, selected->comm,
- selected_oom_adj, selected_tasksize);
diff --git a/patches.android/android-0018-staging-android-lowmemorykiller-Update-arguments-of-shrinker.patch b/patches.android/android-0018-staging-android-lowmemorykiller-Update-arguments-of-shrinker.patch
deleted file mode 100644
index 71bfef441c3089..00000000000000
--- a/patches.android/android-0018-staging-android-lowmemorykiller-Update-arguments-of-shrinker.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 06a1074e1c789a777732f8c432d913b0fedb8ff5 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@google.com>
-Date: Sat, 21 Aug 2010 17:25:42 -0700
-Subject: staging: android: lowmemorykiller: Update arguments of
- shrinker for 2.6.35
-Patch-mainline: HEAD
-Git-commit: 06a1074e1c789a777732f8c432d913b0fedb8ff5
-
-Signed-off-by: Colin Cross <ccross@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index cf79eb9..93a1758 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -79,7 +79,7 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data)
- return NOTIFY_OK;
- }
-
--static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
-+static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- {
- struct task_struct *p;
- struct task_struct *selected = NULL;
diff --git a/patches.android/android-0019-staging-android-lowmemorykiller-Ignore-shmem-pages-in-page-c.patch b/patches.android/android-0019-staging-android-lowmemorykiller-Ignore-shmem-pages-in-page-c.patch
deleted file mode 100644
index 3d032787d3ee4f..00000000000000
--- a/patches.android/android-0019-staging-android-lowmemorykiller-Ignore-shmem-pages-in-page-c.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 71b2c82bdf67ab24716c536e10de436169d3574c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Tue, 23 Nov 2010 17:29:04 -0800
-Subject: staging: android: lowmemorykiller: Ignore shmem pages in
- page-cache
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 71b2c82bdf67ab24716c536e10de436169d3574c
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 93a1758..0ae08ad 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -91,7 +91,8 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- int selected_oom_adj;
- int array_size = ARRAY_SIZE(lowmem_adj);
- int other_free = global_page_state(NR_FREE_PAGES);
-- int other_file = global_page_state(NR_FILE_PAGES);
-+ int other_file = global_page_state(NR_FILE_PAGES) -
-+ global_page_state(NR_SHMEM);
-
- /*
- * If we already have a death outstanding, then
diff --git a/patches.android/android-0020-android-lowmemorykiller-Fix-arguments-to-lowmem_shrink.patch b/patches.android/android-0020-android-lowmemorykiller-Fix-arguments-to-lowmem_shrink.patch
deleted file mode 100644
index 0a31aeafa768f7..00000000000000
--- a/patches.android/android-0020-android-lowmemorykiller-Fix-arguments-to-lowmem_shrink.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From cae9bf11ef0d92875b222f994a2cfd723991435a Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Wed, 22 Jun 2011 16:05:47 -0700
-Subject: android: lowmemorykiller: Fix arguments to lowmem_shrink
-Patch-mainline: HEAD
-Git-commit: cae9bf11ef0d92875b222f994a2cfd723991435a
-
-The arguments to shrink functions have changed, update
-lowmem_shrink to match.
-
-Signed-off-by: Colin Cross <ccross@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 0ae08ad..4098bbb 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -79,7 +79,7 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data)
- return NOTIFY_OK;
- }
-
--static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
-+static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
- {
- struct task_struct *p;
- struct task_struct *selected = NULL;
-@@ -117,17 +117,17 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- break;
- }
- }
-- if (nr_to_scan > 0)
-- lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n",
-- nr_to_scan, gfp_mask, other_free, other_file,
-+ if (sc->nr_to_scan > 0)
-+ lowmem_print(3, "lowmem_shrink %lu, %x, ofree %d %d, ma %d\n",
-+ sc->nr_to_scan, sc->gfp_mask, other_free, other_file,
- min_adj);
- rem = global_page_state(NR_ACTIVE_ANON) +
- global_page_state(NR_ACTIVE_FILE) +
- global_page_state(NR_INACTIVE_ANON) +
- global_page_state(NR_INACTIVE_FILE);
-- if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
-- lowmem_print(5, "lowmem_shrink %d, %x, return %d\n",
-- nr_to_scan, gfp_mask, rem);
-+ if (sc->nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
-+ lowmem_print(5, "lowmem_shrink %lu, %x, return %d\n",
-+ sc->nr_to_scan, sc->gfp_mask, rem);
- return rem;
- }
- selected_oom_adj = min_adj;
-@@ -183,8 +183,8 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- force_sig(SIGKILL, selected);
- rem -= selected_tasksize;
- }
-- lowmem_print(4, "lowmem_shrink %d, %x, return %d\n",
-- nr_to_scan, gfp_mask, rem);
-+ lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n",
-+ sc->nr_to_scan, sc->gfp_mask, rem);
- read_unlock(&tasklist_lock);
- return rem;
- }
diff --git a/patches.android/android-0021-android-logger-bump-up-the-logger-buffer-sizes.patch b/patches.android/android-0021-android-logger-bump-up-the-logger-buffer-sizes.patch
deleted file mode 100644
index d1442539984ba6..00000000000000
--- a/patches.android/android-0021-android-logger-bump-up-the-logger-buffer-sizes.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 2b374956f3afee5857c85b073d726be11f4d2e9b Mon Sep 17 00:00:00 2001
-From: JP Abgrall <jpa@google.com>
-Date: Thu, 11 Aug 2011 21:33:35 -0700
-Subject: android: logger: bump up the logger buffer sizes
-Patch-mainline: HEAD
-Git-commit: 2b374956f3afee5857c85b073d726be11f4d2e9b
-
-(port from common android-2.6.39
- commit: 11430f16545205c614dd5bd58e4a7ee630fc0f9f)
-
-events: (no change, 256)
-main: 64 -> 256
-radio: 64 -> 256
-system: 64 -> 256
-
-Signed-off-by: JP Abgrall <jpa@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-index 531bdbe..fa76ce7 100644
---- a/drivers/staging/android/logger.c
-+++ b/drivers/staging/android/logger.c
-@@ -555,10 +555,10 @@ static struct logger_log VAR = { \
- .size = SIZE, \
- };
-
--DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
-+DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 256*1024)
- DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
--DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
--DEFINE_LOGGER_DEVICE(log_system, LOGGER_LOG_SYSTEM, 64*1024)
-+DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 256*1024)
-+DEFINE_LOGGER_DEVICE(log_system, LOGGER_LOG_SYSTEM, 256*1024)
-
- static struct logger_log *get_log_from_minor(int minor)
- {
diff --git a/patches.android/android-0022-staging-android-ram_console-pass-in-a-boot-info-string.patch b/patches.android/android-0022-staging-android-ram_console-pass-in-a-boot-info-string.patch
deleted file mode 100644
index 8d89238ab5ca3d..00000000000000
--- a/patches.android/android-0022-staging-android-ram_console-pass-in-a-boot-info-string.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From a6707f830e39ab5ef285d9155525eac5e500e55d Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Tue, 25 Oct 2011 14:31:58 -0700
-Subject: staging: android: ram_console: pass in a boot info string
-Patch-mainline: HEAD
-Git-commit: a6707f830e39ab5ef285d9155525eac5e500e55d
-
-Allow the board file to pass a boot info string through the
-platform data that is appended to the /proc/last_kmsg file.
-
-[moved the .h file to drivers/staging/android/ to be self-contained - gregkh]
-
-Signed-off-by: Colin Cross <ccross@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
-index 53f736b..6d4d679 100644
---- a/drivers/staging/android/ram_console.c
-+++ b/drivers/staging/android/ram_console.c
-@@ -21,6 +21,7 @@
- #include <linux/string.h>
- #include <linux/uaccess.h>
- #include <linux/io.h>
-+#include "ram_console.h"
-
- #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- #include <linux/rslib.h>
-@@ -155,14 +156,20 @@ void ram_console_enable_console(int enabled)
- }
-
- static void __init
--ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
-+ram_console_save_old(struct ram_console_buffer *buffer, const char *bootinfo,
-+ char *dest)
- {
- size_t old_log_size = buffer->size;
-+ size_t bootinfo_size = 0;
-+ size_t total_size = old_log_size;
-+ char *ptr;
-+ const char *bootinfo_label = "Boot info:\n";
-+
- #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- uint8_t *block;
- uint8_t *par;
- char strbuf[80];
-- int strbuf_len;
-+ int strbuf_len = 0;
-
- block = buffer->data;
- par = ram_console_par_buffer;
-@@ -197,11 +204,15 @@ ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
- "\nNo errors detected\n");
- if (strbuf_len >= sizeof(strbuf))
- strbuf_len = sizeof(strbuf) - 1;
-- old_log_size += strbuf_len;
-+ total_size += strbuf_len;
- #endif
-
-+ if (bootinfo)
-+ bootinfo_size = strlen(bootinfo) + strlen(bootinfo_label);
-+ total_size += bootinfo_size;
-+
- if (dest == NULL) {
-- dest = kmalloc(old_log_size, GFP_KERNEL);
-+ dest = kmalloc(total_size, GFP_KERNEL);
- if (dest == NULL) {
- printk(KERN_ERR
- "ram_console: failed to allocate buffer\n");
-@@ -210,19 +221,27 @@ ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
- }
-
- ram_console_old_log = dest;
-- ram_console_old_log_size = old_log_size;
-+ ram_console_old_log_size = total_size;
- memcpy(ram_console_old_log,
- &buffer->data[buffer->start], buffer->size - buffer->start);
- memcpy(ram_console_old_log + buffer->size - buffer->start,
- &buffer->data[0], buffer->start);
-+ ptr = ram_console_old_log + old_log_size;
- #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-- memcpy(ram_console_old_log + old_log_size - strbuf_len,
-- strbuf, strbuf_len);
-+ memcpy(ptr, strbuf, strbuf_len);
-+ ptr += strbuf_len;
- #endif
-+ if (bootinfo) {
-+ memcpy(ptr, bootinfo_label, strlen(bootinfo_label));
-+ ptr += strlen(bootinfo_label);
-+ memcpy(ptr, bootinfo, bootinfo_size);
-+ ptr += bootinfo_size;
-+ }
- }
-
- static int __init ram_console_init(struct ram_console_buffer *buffer,
-- size_t buffer_size, char *old_buf)
-+ size_t buffer_size, const char *bootinfo,
-+ char *old_buf)
- {
- #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- int numerr;
-@@ -289,7 +308,7 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
- printk(KERN_INFO "ram_console: found existing buffer, "
- "size %d, start %d\n",
- buffer->size, buffer->start);
-- ram_console_save_old(buffer, old_buf);
-+ ram_console_save_old(buffer, bootinfo, old_buf);
- }
- } else {
- printk(KERN_INFO "ram_console: no valid data in buffer "
-@@ -313,6 +332,7 @@ static int __init ram_console_early_init(void)
- return ram_console_init((struct ram_console_buffer *)
- CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR,
- CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE,
-+ NULL,
- ram_console_old_log_init_buffer);
- }
- #else
-@@ -322,6 +342,8 @@ static int ram_console_driver_probe(struct platform_device *pdev)
- size_t start;
- size_t buffer_size;
- void *buffer;
-+ const char *bootinfo = NULL;
-+ struct ram_console_platform_data *pdata = pdev->dev.platform_data;
-
- if (res == NULL || pdev->num_resources != 1 ||
- !(res->flags & IORESOURCE_MEM)) {
-@@ -339,7 +361,10 @@ static int ram_console_driver_probe(struct platform_device *pdev)
- return -ENOMEM;
- }
-
-- return ram_console_init(buffer, buffer_size, NULL/* allocate */);
-+ if (pdata)
-+ bootinfo = pdata->bootinfo;
-+
-+ return ram_console_init(buffer, buffer_size, bootinfo, NULL/* allocate */);
- }
-
- static struct platform_driver ram_console_driver = {
-diff --git a/drivers/staging/android/ram_console.h b/drivers/staging/android/ram_console.h
-new file mode 100644
-index 0000000..9f1125c
---- /dev/null
-+++ b/drivers/staging/android/ram_console.h
-@@ -0,0 +1,22 @@
-+/*
-+ * Copyright (C) 2010 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#ifndef _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_
-+#define _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_
-+
-+struct ram_console_platform_data {
-+ const char *bootinfo;
-+};
-+
-+#endif /* _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_ */
diff --git a/patches.android/android-0023-Staging-android-fixed-white-spaces-coding-style-issue-in-log.patch b/patches.android/android-0023-Staging-android-fixed-white-spaces-coding-style-issue-in-log.patch
deleted file mode 100644
index c0e6e6c61a6ab7..00000000000000
--- a/patches.android/android-0023-Staging-android-fixed-white-spaces-coding-style-issue-in-log.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 277cdd01d6e831e2168cb3f2c082eecd7fcaac06 Mon Sep 17 00:00:00 2001
-From: Marco Navarra <fromenglish@gmail.com>
-Date: Thu, 15 Dec 2011 17:57:48 +0100
-Subject: Staging: android: fixed white spaces coding style issue in
- logger.c
-Patch-mainline: HEAD
-Git-commit: 277cdd01d6e831e2168cb3f2c082eecd7fcaac06
-
-This patch fixes some space-before-tabs warnings found by checkpatch tool on the staging android driver file logger.c
-
-Signed-off-by: Marco Navarra <fromenglish@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
-index fa76ce7..ffc2d04 100644
---- a/drivers/staging/android/logger.c
-+++ b/drivers/staging/android/logger.c
-@@ -37,7 +37,7 @@
- * mutex 'mutex'.
- */
- struct logger_log {
-- unsigned char *buffer;/* the ring buffer itself */
-+ unsigned char *buffer;/* the ring buffer itself */
- struct miscdevice misc; /* misc device representing the log */
- wait_queue_head_t wq; /* wait queue for readers */
- struct list_head readers; /* this log's readers */
-@@ -67,9 +67,9 @@ struct logger_reader {
- *
- * This isn't aesthetic. We have several goals:
- *
-- * 1) Need to quickly obtain the associated log during an I/O operation
-- * 2) Readers need to maintain state (logger_reader)
-- * 3) Writers need to be very fast (open() should be a near no-op)
-+ * 1) Need to quickly obtain the associated log during an I/O operation
-+ * 2) Readers need to maintain state (logger_reader)
-+ * 3) Writers need to be very fast (open() should be a near no-op)
- *
- * In the reader case, we can trivially go file->logger_reader->logger_log.
- * For a writer, we don't want to maintain a logger_reader, so we just go
-@@ -147,9 +147,9 @@ static ssize_t do_read_log_to_user(struct logger_log *log,
- *
- * Behavior:
- *
-- * - O_NONBLOCK works
-- * - If there are no log entries to read, blocks until log is written to
-- * - Atomically reads exactly one log entry
-+ * - O_NONBLOCK works
-+ * - If there are no log entries to read, blocks until log is written to
-+ * - Atomically reads exactly one log entry
- *
- * Optimal read size is LOGGER_ENTRY_MAX_LEN. Will set errno to EINVAL if read
- * buffer is insufficient to hold next entry.
diff --git a/patches.android/android-0024-staging-android-switch-switch-class-and-GPIO-drivers.patch b/patches.android/android-0024-staging-android-switch-switch-class-and-GPIO-drivers.patch
deleted file mode 100644
index 3dde18bae7df19..00000000000000
--- a/patches.android/android-0024-staging-android-switch-switch-class-and-GPIO-drivers.patch
+++ /dev/null
@@ -1,499 +0,0 @@
-From e0f5bb9b3850bdd7907eda9eb923cd3f9d4358b8 Mon Sep 17 00:00:00 2001
-From: Mike Lockwood <lockwood@android.com>
-Date: Tue, 14 Oct 2008 12:50:16 -0400
-Subject: staging: android: switch: switch class and GPIO drivers.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: e0f5bb9b3850bdd7907eda9eb923cd3f9d4358b8
-
-This adds the Android switch driver code to the staging tree.
-
-[Note, this code was located in drivers/switch/ in the Android kernel
-releases, but as that api wasn't generally accepted, and the interface
-is working toward changing to the newly proposed extcon inteface, this
-driver was placed here until the extcon code is merged into mainline and
-the Android userspace code is converted over to using it. - gregkh]
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Mike Lockwood <lockwood@android.com>
-Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
-Cc: Kyungmin Park <kyungmin.park@samsung.com>
-Cc: Donggeun Kim <dg77.kim@samsung.com>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Cc: MyungJoo Ham <myungjoo.ham@gmail.com>
-Cc: Linus Walleij <linus.walleij@linaro.org>
-Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Cc: NeilBrown <neilb@suse.de>
-Cc: Morten CHRISTIANSEN <morten.christiansen@stericsson.com>
-Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Cc: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index 2471949..0712b18 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -90,6 +90,8 @@ config ANDROID_LOW_MEMORY_KILLER
- ---help---
- Register processes to be killed when memory is low
-
-+source "drivers/staging/android/switch/Kconfig"
-+
- endif # if ANDROID
-
- endmenu
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-index 8e057e6..36e32bc 100644
---- a/drivers/staging/android/Makefile
-+++ b/drivers/staging/android/Makefile
-@@ -4,3 +4,4 @@ obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
- obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
- obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
- obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
-+obj-$(CONFIG_ANDROID_SWITCH) += switch/
-diff --git a/drivers/staging/android/switch/Kconfig b/drivers/staging/android/switch/Kconfig
-new file mode 100644
-index 0000000..36846f6
---- /dev/null
-+++ b/drivers/staging/android/switch/Kconfig
-@@ -0,0 +1,11 @@
-+menuconfig ANDROID_SWITCH
-+ tristate "Android Switch class support"
-+ help
-+ Say Y here to enable Android switch class support. This allows
-+ monitoring switches by userspace via sysfs and uevent.
-+
-+config ANDROID_SWITCH_GPIO
-+ tristate "Android GPIO Switch support"
-+ depends on GENERIC_GPIO && ANDROID_SWITCH
-+ help
-+ Say Y here to enable GPIO based switch support.
-diff --git a/drivers/staging/android/switch/Makefile b/drivers/staging/android/switch/Makefile
-new file mode 100644
-index 0000000..d76bfdc
---- /dev/null
-+++ b/drivers/staging/android/switch/Makefile
-@@ -0,0 +1,4 @@
-+# Android Switch Class Driver
-+obj-$(CONFIG_ANDROID_SWITCH) += switch_class.o
-+obj-$(CONFIG_ANDROID_SWITCH_GPIO) += switch_gpio.o
-+
-diff --git a/drivers/staging/android/switch/switch.h b/drivers/staging/android/switch/switch.h
-new file mode 100644
-index 0000000..3e4c748
---- /dev/null
-+++ b/drivers/staging/android/switch/switch.h
-@@ -0,0 +1,53 @@
-+/*
-+ * Switch class driver
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ * Author: Mike Lockwood <lockwood@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+*/
-+
-+#ifndef __LINUX_SWITCH_H__
-+#define __LINUX_SWITCH_H__
-+
-+struct switch_dev {
-+ const char *name;
-+ struct device *dev;
-+ int index;
-+ int state;
-+
-+ ssize_t (*print_name)(struct switch_dev *sdev, char *buf);
-+ ssize_t (*print_state)(struct switch_dev *sdev, char *buf);
-+};
-+
-+struct gpio_switch_platform_data {
-+ const char *name;
-+ unsigned gpio;
-+
-+ /* if NULL, switch_dev.name will be printed */
-+ const char *name_on;
-+ const char *name_off;
-+ /* if NULL, "0" or "1" will be printed */
-+ const char *state_on;
-+ const char *state_off;
-+};
-+
-+extern int switch_dev_register(struct switch_dev *sdev);
-+extern void switch_dev_unregister(struct switch_dev *sdev);
-+
-+static inline int switch_get_state(struct switch_dev *sdev)
-+{
-+ return sdev->state;
-+}
-+
-+extern void switch_set_state(struct switch_dev *sdev, int state);
-+
-+#endif /* __LINUX_SWITCH_H__ */
-diff --git a/drivers/staging/android/switch/switch_class.c b/drivers/staging/android/switch/switch_class.c
-new file mode 100644
-index 0000000..7468044
---- /dev/null
-+++ b/drivers/staging/android/switch/switch_class.c
-@@ -0,0 +1,174 @@
-+/*
-+ * switch_class.c
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ * Author: Mike Lockwood <lockwood@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+*/
-+
-+#include <linux/module.h>
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/device.h>
-+#include <linux/fs.h>
-+#include <linux/err.h>
-+#include "switch.h"
-+
-+struct class *switch_class;
-+static atomic_t device_count;
-+
-+static ssize_t state_show(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ struct switch_dev *sdev = (struct switch_dev *)
-+ dev_get_drvdata(dev);
-+
-+ if (sdev->print_state) {
-+ int ret = sdev->print_state(sdev, buf);
-+ if (ret >= 0)
-+ return ret;
-+ }
-+ return sprintf(buf, "%d\n", sdev->state);
-+}
-+
-+static ssize_t name_show(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ struct switch_dev *sdev = (struct switch_dev *)
-+ dev_get_drvdata(dev);
-+
-+ if (sdev->print_name) {
-+ int ret = sdev->print_name(sdev, buf);
-+ if (ret >= 0)
-+ return ret;
-+ }
-+ return sprintf(buf, "%s\n", sdev->name);
-+}
-+
-+static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, state_show, NULL);
-+static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, name_show, NULL);
-+
-+void switch_set_state(struct switch_dev *sdev, int state)
-+{
-+ char name_buf[120];
-+ char state_buf[120];
-+ char *prop_buf;
-+ char *envp[3];
-+ int env_offset = 0;
-+ int length;
-+
-+ if (sdev->state != state) {
-+ sdev->state = state;
-+
-+ prop_buf = (char *)get_zeroed_page(GFP_KERNEL);
-+ if (prop_buf) {
-+ length = name_show(sdev->dev, NULL, prop_buf);
-+ if (length > 0) {
-+ if (prop_buf[length - 1] == '\n')
-+ prop_buf[length - 1] = 0;
-+ snprintf(name_buf, sizeof(name_buf),
-+ "SWITCH_NAME=%s", prop_buf);
-+ envp[env_offset++] = name_buf;
-+ }
-+ length = state_show(sdev->dev, NULL, prop_buf);
-+ if (length > 0) {
-+ if (prop_buf[length - 1] == '\n')
-+ prop_buf[length - 1] = 0;
-+ snprintf(state_buf, sizeof(state_buf),
-+ "SWITCH_STATE=%s", prop_buf);
-+ envp[env_offset++] = state_buf;
-+ }
-+ envp[env_offset] = NULL;
-+ kobject_uevent_env(&sdev->dev->kobj, KOBJ_CHANGE, envp);
-+ free_page((unsigned long)prop_buf);
-+ } else {
-+ printk(KERN_ERR "out of memory in switch_set_state\n");
-+ kobject_uevent(&sdev->dev->kobj, KOBJ_CHANGE);
-+ }
-+ }
-+}
-+EXPORT_SYMBOL_GPL(switch_set_state);
-+
-+static int create_switch_class(void)
-+{
-+ if (!switch_class) {
-+ switch_class = class_create(THIS_MODULE, "switch");
-+ if (IS_ERR(switch_class))
-+ return PTR_ERR(switch_class);
-+ atomic_set(&device_count, 0);
-+ }
-+
-+ return 0;
-+}
-+
-+int switch_dev_register(struct switch_dev *sdev)
-+{
-+ int ret;
-+
-+ if (!switch_class) {
-+ ret = create_switch_class();
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ sdev->index = atomic_inc_return(&device_count);
-+ sdev->dev = device_create(switch_class, NULL,
-+ MKDEV(0, sdev->index), NULL, sdev->name);
-+ if (IS_ERR(sdev->dev))
-+ return PTR_ERR(sdev->dev);
-+
-+ ret = device_create_file(sdev->dev, &dev_attr_state);
-+ if (ret < 0)
-+ goto err_create_file_1;
-+ ret = device_create_file(sdev->dev, &dev_attr_name);
-+ if (ret < 0)
-+ goto err_create_file_2;
-+
-+ dev_set_drvdata(sdev->dev, sdev);
-+ sdev->state = 0;
-+ return 0;
-+
-+err_create_file_2:
-+ device_remove_file(sdev->dev, &dev_attr_state);
-+err_create_file_1:
-+ device_destroy(switch_class, MKDEV(0, sdev->index));
-+ printk(KERN_ERR "switch: Failed to register driver %s\n", sdev->name);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(switch_dev_register);
-+
-+void switch_dev_unregister(struct switch_dev *sdev)
-+{
-+ device_remove_file(sdev->dev, &dev_attr_name);
-+ device_remove_file(sdev->dev, &dev_attr_state);
-+ device_destroy(switch_class, MKDEV(0, sdev->index));
-+ dev_set_drvdata(sdev->dev, NULL);
-+}
-+EXPORT_SYMBOL_GPL(switch_dev_unregister);
-+
-+static int __init switch_class_init(void)
-+{
-+ return create_switch_class();
-+}
-+
-+static void __exit switch_class_exit(void)
-+{
-+ class_destroy(switch_class);
-+}
-+
-+module_init(switch_class_init);
-+module_exit(switch_class_exit);
-+
-+MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-+MODULE_DESCRIPTION("Switch class driver");
-+MODULE_LICENSE("GPL");
-diff --git a/drivers/staging/android/switch/switch_gpio.c b/drivers/staging/android/switch/switch_gpio.c
-new file mode 100644
-index 0000000..6ba8d97
---- /dev/null
-+++ b/drivers/staging/android/switch/switch_gpio.c
-@@ -0,0 +1,172 @@
-+/*
-+ * switch_gpio.c
-+ *
-+ * Copyright (C) 2008 Google, Inc.
-+ * Author: Mike Lockwood <lockwood@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+*/
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/platform_device.h>
-+#include <linux/slab.h>
-+#include <linux/workqueue.h>
-+#include <linux/gpio.h>
-+#include "switch.h"
-+
-+struct gpio_switch_data {
-+ struct switch_dev sdev;
-+ unsigned gpio;
-+ const char *name_on;
-+ const char *name_off;
-+ const char *state_on;
-+ const char *state_off;
-+ int irq;
-+ struct work_struct work;
-+};
-+
-+static void gpio_switch_work(struct work_struct *work)
-+{
-+ int state;
-+ struct gpio_switch_data *data =
-+ container_of(work, struct gpio_switch_data, work);
-+
-+ state = gpio_get_value(data->gpio);
-+ switch_set_state(&data->sdev, state);
-+}
-+
-+static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
-+{
-+ struct gpio_switch_data *switch_data =
-+ (struct gpio_switch_data *)dev_id;
-+
-+ schedule_work(&switch_data->work);
-+ return IRQ_HANDLED;
-+}
-+
-+static ssize_t switch_gpio_print_state(struct switch_dev *sdev, char *buf)
-+{
-+ struct gpio_switch_data *switch_data =
-+ container_of(sdev, struct gpio_switch_data, sdev);
-+ const char *state;
-+ if (switch_get_state(sdev))
-+ state = switch_data->state_on;
-+ else
-+ state = switch_data->state_off;
-+
-+ if (state)
-+ return sprintf(buf, "%s\n", state);
-+ return -1;
-+}
-+
-+static int gpio_switch_probe(struct platform_device *pdev)
-+{
-+ struct gpio_switch_platform_data *pdata = pdev->dev.platform_data;
-+ struct gpio_switch_data *switch_data;
-+ int ret = 0;
-+
-+ if (!pdata)
-+ return -EBUSY;
-+
-+ switch_data = kzalloc(sizeof(struct gpio_switch_data), GFP_KERNEL);
-+ if (!switch_data)
-+ return -ENOMEM;
-+
-+ switch_data->sdev.name = pdata->name;
-+ switch_data->gpio = pdata->gpio;
-+ switch_data->name_on = pdata->name_on;
-+ switch_data->name_off = pdata->name_off;
-+ switch_data->state_on = pdata->state_on;
-+ switch_data->state_off = pdata->state_off;
-+ switch_data->sdev.print_state = switch_gpio_print_state;
-+
-+ ret = switch_dev_register(&switch_data->sdev);
-+ if (ret < 0)
-+ goto err_switch_dev_register;
-+
-+ ret = gpio_request(switch_data->gpio, pdev->name);
-+ if (ret < 0)
-+ goto err_request_gpio;
-+
-+ ret = gpio_direction_input(switch_data->gpio);
-+ if (ret < 0)
-+ goto err_set_gpio_input;
-+
-+ INIT_WORK(&switch_data->work, gpio_switch_work);
-+
-+ switch_data->irq = gpio_to_irq(switch_data->gpio);
-+ if (switch_data->irq < 0) {
-+ ret = switch_data->irq;
-+ goto err_detect_irq_num_failed;
-+ }
-+
-+ ret = request_irq(switch_data->irq, gpio_irq_handler,
-+ IRQF_TRIGGER_LOW, pdev->name, switch_data);
-+ if (ret < 0)
-+ goto err_request_irq;
-+
-+ /* Perform initial detection */
-+ gpio_switch_work(&switch_data->work);
-+
-+ return 0;
-+
-+err_request_irq:
-+err_detect_irq_num_failed:
-+err_set_gpio_input:
-+ gpio_free(switch_data->gpio);
-+err_request_gpio:
-+ switch_dev_unregister(&switch_data->sdev);
-+err_switch_dev_register:
-+ kfree(switch_data);
-+
-+ return ret;
-+}
-+
-+static int __devexit gpio_switch_remove(struct platform_device *pdev)
-+{
-+ struct gpio_switch_data *switch_data = platform_get_drvdata(pdev);
-+
-+ cancel_work_sync(&switch_data->work);
-+ gpio_free(switch_data->gpio);
-+ switch_dev_unregister(&switch_data->sdev);
-+ kfree(switch_data);
-+
-+ return 0;
-+}
-+
-+static struct platform_driver gpio_switch_driver = {
-+ .probe = gpio_switch_probe,
-+ .remove = __devexit_p(gpio_switch_remove),
-+ .driver = {
-+ .name = "switch-gpio",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static int __init gpio_switch_init(void)
-+{
-+ return platform_driver_register(&gpio_switch_driver);
-+}
-+
-+static void __exit gpio_switch_exit(void)
-+{
-+ platform_driver_unregister(&gpio_switch_driver);
-+}
-+
-+module_init(gpio_switch_init);
-+module_exit(gpio_switch_exit);
-+
-+MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-+MODULE_DESCRIPTION("GPIO Switch driver");
-+MODULE_LICENSE("GPL");
diff --git a/patches.android/android-0025-staging-android-switch-minor-code-formatting-cleanups.patch b/patches.android/android-0025-staging-android-switch-minor-code-formatting-cleanups.patch
deleted file mode 100644
index 97151bdb699c6b..00000000000000
--- a/patches.android/android-0025-staging-android-switch-minor-code-formatting-cleanups.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From c001dff0f6715813bdb8e978dc8c05416c01962b Mon Sep 17 00:00:00 2001
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Date: Fri, 16 Dec 2011 13:41:37 -0800
-Subject: staging: android: switch: minor code formatting cleanups
-Patch-mainline: HEAD
-Git-commit: c001dff0f6715813bdb8e978dc8c05416c01962b
-
-This fixes a number of minor space issues in the Android switch code.
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/switch/switch.h b/drivers/staging/android/switch/switch.h
-index 3e4c748..4fcb310 100644
---- a/drivers/staging/android/switch/switch.h
-+++ b/drivers/staging/android/switch/switch.h
-@@ -30,7 +30,7 @@ struct switch_dev {
-
- struct gpio_switch_platform_data {
- const char *name;
-- unsigned gpio;
-+ unsigned gpio;
-
- /* if NULL, switch_dev.name will be printed */
- const char *name_on;
-diff --git a/drivers/staging/android/switch/switch_gpio.c b/drivers/staging/android/switch/switch_gpio.c
-index 6ba8d97..38b2c2f 100644
---- a/drivers/staging/android/switch/switch_gpio.c
-+++ b/drivers/staging/android/switch/switch_gpio.c
-@@ -91,7 +91,7 @@ static int gpio_switch_probe(struct platform_device *pdev)
- switch_data->state_off = pdata->state_off;
- switch_data->sdev.print_state = switch_gpio_print_state;
-
-- ret = switch_dev_register(&switch_data->sdev);
-+ ret = switch_dev_register(&switch_data->sdev);
- if (ret < 0)
- goto err_switch_dev_register;
-
-@@ -126,7 +126,7 @@ err_detect_irq_num_failed:
- err_set_gpio_input:
- gpio_free(switch_data->gpio);
- err_request_gpio:
-- switch_dev_unregister(&switch_data->sdev);
-+ switch_dev_unregister(&switch_data->sdev);
- err_switch_dev_register:
- kfree(switch_data);
-
-@@ -139,7 +139,7 @@ static int __devexit gpio_switch_remove(struct platform_device *pdev)
-
- cancel_work_sync(&switch_data->work);
- gpio_free(switch_data->gpio);
-- switch_dev_unregister(&switch_data->sdev);
-+ switch_dev_unregister(&switch_data->sdev);
- kfree(switch_data);
-
- return 0;
diff --git a/patches.android/android-0026-staging-android-add-pmem-driver.patch b/patches.android/android-0026-staging-android-add-pmem-driver.patch
deleted file mode 100644
index 756606ca5a16be..00000000000000
--- a/patches.android/android-0026-staging-android-add-pmem-driver.patch
+++ /dev/null
@@ -1,1499 +0,0 @@
-From b6aba85c35baa7d08b7a601b30589bcae607d9e0 Mon Sep 17 00:00:00 2001
-From: Rebecca Schultz <rschultz@google.com>
-Date: Thu, 24 Jul 2008 11:22:53 -0700
-Subject: staging: android: add pmem driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: b6aba85c35baa7d08b7a601b30589bcae607d9e0
-
-This adds the Android pmem driver to the staging tree.
-
-[At this point in time, it is dependent on the ARM platform, due to some
-build issues that require it. - gregkh]
-
-Signed-off-by: Rebecca Schultz <rschultz@google.com>
-Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
-Signed-off-by: Dima Zavin <dima@android.com>
-Signed-off-by: Jamie Gennis <jgennis@google.com>
-Cc: Brian Swetland <swetland@google.com>
-Cc: Arve Hjønnevåg <arve@android.com>
-Cc: Colin Cross <ccross@android.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index 0712b18..6094fd6 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -90,6 +90,10 @@ config ANDROID_LOW_MEMORY_KILLER
- ---help---
- Register processes to be killed when memory is low
-
-+config ANDROID_PMEM
-+ bool "Android pmem allocator"
-+ depends on ARM
-+
- source "drivers/staging/android/switch/Kconfig"
-
- endif # if ANDROID
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-index 36e32bc..8fd7391 100644
---- a/drivers/staging/android/Makefile
-+++ b/drivers/staging/android/Makefile
-@@ -4,4 +4,5 @@ obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
- obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
- obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
- obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
-+obj-$(CONFIG_ANDROID_PMEM) += pmem.o
- obj-$(CONFIG_ANDROID_SWITCH) += switch/
-diff --git a/drivers/staging/android/android_pmem.h b/drivers/staging/android/android_pmem.h
-new file mode 100644
-index 0000000..f633621
---- /dev/null
-+++ b/drivers/staging/android/android_pmem.h
-@@ -0,0 +1,93 @@
-+/* include/linux/android_pmem.h
-+ *
-+ * Copyright (C) 2007 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#ifndef _ANDROID_PMEM_H_
-+#define _ANDROID_PMEM_H_
-+
-+#define PMEM_IOCTL_MAGIC 'p'
-+#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, unsigned int)
-+#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, unsigned int)
-+#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, unsigned int)
-+#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, unsigned int)
-+/* This ioctl will allocate pmem space, backing the file, it will fail
-+ * if the file already has an allocation, pass it the len as the argument
-+ * to the ioctl */
-+#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
-+/* This will connect a one pmem file to another, pass the file that is already
-+ * backed in memory as the argument to the ioctl
-+ */
-+#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
-+/* Returns the total size of the pmem region it is sent to as a pmem_region
-+ * struct (with offset set to 0).
-+ */
-+#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
-+#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
-+
-+struct android_pmem_platform_data
-+{
-+ const char* name;
-+ /* starting physical address of memory region */
-+ unsigned long start;
-+ /* size of memory region */
-+ unsigned long size;
-+ /* set to indicate the region should not be managed with an allocator */
-+ unsigned no_allocator;
-+ /* set to indicate maps of this region should be cached, if a mix of
-+ * cached and uncached is desired, set this and open the device with
-+ * O_SYNC to get an uncached region */
-+ unsigned cached;
-+ /* The MSM7k has bits to enable a write buffer in the bus controller*/
-+ unsigned buffered;
-+};
-+
-+struct pmem_region {
-+ unsigned long offset;
-+ unsigned long len;
-+};
-+
-+#ifdef CONFIG_ANDROID_PMEM
-+int is_pmem_file(struct file *file);
-+int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
-+ unsigned long *end, struct file **filp);
-+int get_pmem_user_addr(struct file *file, unsigned long *start,
-+ unsigned long *end);
-+void put_pmem_file(struct file* file);
-+void flush_pmem_file(struct file *file, unsigned long start, unsigned long len);
-+int pmem_setup(struct android_pmem_platform_data *pdata,
-+ long (*ioctl)(struct file *, unsigned int, unsigned long),
-+ int (*release)(struct inode *, struct file *));
-+int pmem_remap(struct pmem_region *region, struct file *file,
-+ unsigned operation);
-+
-+#else
-+static inline int is_pmem_file(struct file *file) { return 0; }
-+static inline int get_pmem_file(int fd, unsigned long *start,
-+ unsigned long *vstart, unsigned long *end,
-+ struct file **filp) { return -ENOSYS; }
-+static inline int get_pmem_user_addr(struct file *file, unsigned long *start,
-+ unsigned long *end) { return -ENOSYS; }
-+static inline void put_pmem_file(struct file* file) { return; }
-+static inline void flush_pmem_file(struct file *file, unsigned long start,
-+ unsigned long len) { return; }
-+static inline int pmem_setup(struct android_pmem_platform_data *pdata,
-+ long (*ioctl)(struct file *, unsigned int, unsigned long),
-+ int (*release)(struct inode *, struct file *)) { return -ENOSYS; }
-+
-+static inline int pmem_remap(struct pmem_region *region, struct file *file,
-+ unsigned operation) { return -ENOSYS; }
-+#endif
-+
-+#endif //_ANDROID_PPP_H_
-+
-diff --git a/drivers/staging/android/pmem.c b/drivers/staging/android/pmem.c
-new file mode 100644
-index 0000000..7d97032
---- /dev/null
-+++ b/drivers/staging/android/pmem.c
-@@ -0,0 +1,1345 @@
-+/* pmem.c
-+ *
-+ * Copyright (C) 2007 Google, Inc.
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/miscdevice.h>
-+#include <linux/platform_device.h>
-+#include <linux/fs.h>
-+#include <linux/file.h>
-+#include <linux/mm.h>
-+#include <linux/list.h>
-+#include <linux/mutex.h>
-+#include <linux/debugfs.h>
-+#include <linux/mempolicy.h>
-+#include <linux/sched.h>
-+#include <asm/io.h>
-+#include <asm/uaccess.h>
-+#include <asm/cacheflush.h>
-+#include "android_pmem.h"
-+
-+#define PMEM_MAX_DEVICES 10
-+#define PMEM_MAX_ORDER 128
-+#define PMEM_MIN_ALLOC PAGE_SIZE
-+
-+#define PMEM_DEBUG 1
-+
-+/* indicates that a refernce to this file has been taken via get_pmem_file,
-+ * the file should not be released until put_pmem_file is called */
-+#define PMEM_FLAGS_BUSY 0x1
-+/* indicates that this is a suballocation of a larger master range */
-+#define PMEM_FLAGS_CONNECTED 0x1 << 1
-+/* indicates this is a master and not a sub allocation and that it is mmaped */
-+#define PMEM_FLAGS_MASTERMAP 0x1 << 2
-+/* submap and unsubmap flags indicate:
-+ * 00: subregion has never been mmaped
-+ * 10: subregion has been mmaped, reference to the mm was taken
-+ * 11: subretion has ben released, refernece to the mm still held
-+ * 01: subretion has been released, reference to the mm has been released
-+ */
-+#define PMEM_FLAGS_SUBMAP 0x1 << 3
-+#define PMEM_FLAGS_UNSUBMAP 0x1 << 4
-+
-+
-+struct pmem_data {
-+ /* in alloc mode: an index into the bitmap
-+ * in no_alloc mode: the size of the allocation */
-+ int index;
-+ /* see flags above for descriptions */
-+ unsigned int flags;
-+ /* protects this data field, if the mm_mmap sem will be held at the
-+ * same time as this sem, the mm sem must be taken first (as this is
-+ * the order for vma_open and vma_close ops */
-+ struct rw_semaphore sem;
-+ /* info about the mmaping process */
-+ struct vm_area_struct *vma;
-+ /* task struct of the mapping process */
-+ struct task_struct *task;
-+ /* process id of teh mapping process */
-+ pid_t pid;
-+ /* file descriptor of the master */
-+ int master_fd;
-+ /* file struct of the master */
-+ struct file *master_file;
-+ /* a list of currently available regions if this is a suballocation */
-+ struct list_head region_list;
-+ /* a linked list of data so we can access them for debugging */
-+ struct list_head list;
-+#if PMEM_DEBUG
-+ int ref;
-+#endif
-+};
-+
-+struct pmem_bits {
-+ unsigned allocated:1; /* 1 if allocated, 0 if free */
-+ unsigned order:7; /* size of the region in pmem space */
-+};
-+
-+struct pmem_region_node {
-+ struct pmem_region region;
-+ struct list_head list;
-+};
-+
-+#define PMEM_DEBUG_MSGS 0
-+#if PMEM_DEBUG_MSGS
-+#define DLOG(fmt,args...) \
-+ do { printk(KERN_INFO "[%s:%s:%d] "fmt, __FILE__, __func__, __LINE__, \
-+ ##args); } \
-+ while (0)
-+#else
-+#define DLOG(x...) do {} while (0)
-+#endif
-+
-+struct pmem_info {
-+ struct miscdevice dev;
-+ /* physical start address of the remaped pmem space */
-+ unsigned long base;
-+ /* vitual start address of the remaped pmem space */
-+ unsigned char __iomem *vbase;
-+ /* total size of the pmem space */
-+ unsigned long size;
-+ /* number of entries in the pmem space */
-+ unsigned long num_entries;
-+ /* pfn of the garbage page in memory */
-+ unsigned long garbage_pfn;
-+ /* index of the garbage page in the pmem space */
-+ int garbage_index;
-+ /* the bitmap for the region indicating which entries are allocated
-+ * and which are free */
-+ struct pmem_bits *bitmap;
-+ /* indicates the region should not be managed with an allocator */
-+ unsigned no_allocator;
-+ /* indicates maps of this region should be cached, if a mix of
-+ * cached and uncached is desired, set this and open the device with
-+ * O_SYNC to get an uncached region */
-+ unsigned cached;
-+ unsigned buffered;
-+ /* in no_allocator mode the first mapper gets the whole space and sets
-+ * this flag */
-+ unsigned allocated;
-+ /* for debugging, creates a list of pmem file structs, the
-+ * data_list_lock should be taken before pmem_data->sem if both are
-+ * needed */
-+ struct mutex data_list_lock;
-+ struct list_head data_list;
-+ /* pmem_sem protects the bitmap array
-+ * a write lock should be held when modifying entries in bitmap
-+ * a read lock should be held when reading data from bits or
-+ * dereferencing a pointer into bitmap
-+ *
-+ * pmem_data->sem protects the pmem data of a particular file
-+ * Many of the function that require the pmem_data->sem have a non-
-+ * locking version for when the caller is already holding that sem.
-+ *
-+ * IF YOU TAKE BOTH LOCKS TAKE THEM IN THIS ORDER:
-+ * down(pmem_data->sem) => down(bitmap_sem)
-+ */
-+ struct rw_semaphore bitmap_sem;
-+
-+ long (*ioctl)(struct file *, unsigned int, unsigned long);
-+ int (*release)(struct inode *, struct file *);
-+};
-+
-+static struct pmem_info pmem[PMEM_MAX_DEVICES];
-+static int id_count;
-+
-+#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
-+#define PMEM_ORDER(id, index) pmem[id].bitmap[index].order
-+#define PMEM_BUDDY_INDEX(id, index) (index ^ (1 << PMEM_ORDER(id, index)))
-+#define PMEM_NEXT_INDEX(id, index) (index + (1 << PMEM_ORDER(id, index)))
-+#define PMEM_OFFSET(index) (index * PMEM_MIN_ALLOC)
-+#define PMEM_START_ADDR(id, index) (PMEM_OFFSET(index) + pmem[id].base)
-+#define PMEM_LEN(id, index) ((1 << PMEM_ORDER(id, index)) * PMEM_MIN_ALLOC)
-+#define PMEM_END_ADDR(id, index) (PMEM_START_ADDR(id, index) + \
-+ PMEM_LEN(id, index))
-+#define PMEM_START_VADDR(id, index) (PMEM_OFFSET(id, index) + pmem[id].vbase)
-+#define PMEM_END_VADDR(id, index) (PMEM_START_VADDR(id, index) + \
-+ PMEM_LEN(id, index))
-+#define PMEM_REVOKED(data) (data->flags & PMEM_FLAGS_REVOKED)
-+#define PMEM_IS_PAGE_ALIGNED(addr) (!((addr) & (~PAGE_MASK)))
-+#define PMEM_IS_SUBMAP(data) ((data->flags & PMEM_FLAGS_SUBMAP) && \
-+ (!(data->flags & PMEM_FLAGS_UNSUBMAP)))
-+
-+static int pmem_release(struct inode *, struct file *);
-+static int pmem_mmap(struct file *, struct vm_area_struct *);
-+static int pmem_open(struct inode *, struct file *);
-+static long pmem_ioctl(struct file *, unsigned int, unsigned long);
-+
-+struct file_operations pmem_fops = {
-+ .release = pmem_release,
-+ .mmap = pmem_mmap,
-+ .open = pmem_open,
-+ .unlocked_ioctl = pmem_ioctl,
-+};
-+
-+static int get_id(struct file *file)
-+{
-+ return MINOR(file->f_dentry->d_inode->i_rdev);
-+}
-+
-+int is_pmem_file(struct file *file)
-+{
-+ int id;
-+
-+ if (unlikely(!file || !file->f_dentry || !file->f_dentry->d_inode))
-+ return 0;
-+ id = get_id(file);
-+ if (unlikely(id >= PMEM_MAX_DEVICES))
-+ return 0;
-+ if (unlikely(file->f_dentry->d_inode->i_rdev !=
-+ MKDEV(MISC_MAJOR, pmem[id].dev.minor)))
-+ return 0;
-+ return 1;
-+}
-+
-+static int has_allocation(struct file *file)
-+{
-+ struct pmem_data *data;
-+ /* check is_pmem_file first if not accessed via pmem_file_ops */
-+
-+ if (unlikely(!file->private_data))
-+ return 0;
-+ data = (struct pmem_data *)file->private_data;
-+ if (unlikely(data->index < 0))
-+ return 0;
-+ return 1;
-+}
-+
-+static int is_master_owner(struct file *file)
-+{
-+ struct file *master_file;
-+ struct pmem_data *data;
-+ int put_needed, ret = 0;
-+
-+ if (!is_pmem_file(file) || !has_allocation(file))
-+ return 0;
-+ data = (struct pmem_data *)file->private_data;
-+ if (PMEM_FLAGS_MASTERMAP & data->flags)
-+ return 1;
-+ master_file = fget_light(data->master_fd, &put_needed);
-+ if (master_file && data->master_file == master_file)
-+ ret = 1;
-+ fput_light(master_file, put_needed);
-+ return ret;
-+}
-+
-+static int pmem_free(int id, int index)
-+{
-+ /* caller should hold the write lock on pmem_sem! */
-+ int buddy, curr = index;
-+ DLOG("index %d\n", index);
-+
-+ if (pmem[id].no_allocator) {
-+ pmem[id].allocated = 0;
-+ return 0;
-+ }
-+ /* clean up the bitmap, merging any buddies */
-+ pmem[id].bitmap[curr].allocated = 0;
-+ /* find a slots buddy Buddy# = Slot# ^ (1 << order)
-+ * if the buddy is also free merge them
-+ * repeat until the buddy is not free or end of the bitmap is reached
-+ */
-+ do {
-+ buddy = PMEM_BUDDY_INDEX(id, curr);
-+ if (PMEM_IS_FREE(id, buddy) &&
-+ PMEM_ORDER(id, buddy) == PMEM_ORDER(id, curr)) {
-+ PMEM_ORDER(id, buddy)++;
-+ PMEM_ORDER(id, curr)++;
-+ curr = min(buddy, curr);
-+ } else {
-+ break;
-+ }
-+ } while (curr < pmem[id].num_entries);
-+
-+ return 0;
-+}
-+
-+static void pmem_revoke(struct file *file, struct pmem_data *data);
-+
-+static int pmem_release(struct inode *inode, struct file *file)
-+{
-+ struct pmem_data *data = (struct pmem_data *)file->private_data;
-+ struct pmem_region_node *region_node;
-+ struct list_head *elt, *elt2;
-+ int id = get_id(file), ret = 0;
-+
-+
-+ mutex_lock(&pmem[id].data_list_lock);
-+ /* if this file is a master, revoke all the memory in the connected
-+ * files */
-+ if (PMEM_FLAGS_MASTERMAP & data->flags) {
-+ struct pmem_data *sub_data;
-+ list_for_each(elt, &pmem[id].data_list) {
-+ sub_data = list_entry(elt, struct pmem_data, list);
-+ down_read(&sub_data->sem);
-+ if (PMEM_IS_SUBMAP(sub_data) &&
-+ file == sub_data->master_file) {
-+ up_read(&sub_data->sem);
-+ pmem_revoke(file, sub_data);
-+ } else
-+ up_read(&sub_data->sem);
-+ }
-+ }
-+ list_del(&data->list);
-+ mutex_unlock(&pmem[id].data_list_lock);
-+
-+
-+ down_write(&data->sem);
-+
-+ /* if its not a conencted file and it has an allocation, free it */
-+ if (!(PMEM_FLAGS_CONNECTED & data->flags) && has_allocation(file)) {
-+ down_write(&pmem[id].bitmap_sem);
-+ ret = pmem_free(id, data->index);
-+ up_write(&pmem[id].bitmap_sem);
-+ }
-+
-+ /* if this file is a submap (mapped, connected file), downref the
-+ * task struct */
-+ if (PMEM_FLAGS_SUBMAP & data->flags)
-+ if (data->task) {
-+ put_task_struct(data->task);
-+ data->task = NULL;
-+ }
-+
-+ file->private_data = NULL;
-+
-+ list_for_each_safe(elt, elt2, &data->region_list) {
-+ region_node = list_entry(elt, struct pmem_region_node, list);
-+ list_del(elt);
-+ kfree(region_node);
-+ }
-+ BUG_ON(!list_empty(&data->region_list));
-+
-+ up_write(&data->sem);
-+ kfree(data);
-+ if (pmem[id].release)
-+ ret = pmem[id].release(inode, file);
-+
-+ return ret;
-+}
-+
-+static int pmem_open(struct inode *inode, struct file *file)
-+{
-+ struct pmem_data *data;
-+ int id = get_id(file);
-+ int ret = 0;
-+
-+ DLOG("current %u file %p(%d)\n", current->pid, file, file_count(file));
-+ /* setup file->private_data to indicate its unmapped */
-+ /* you can only open a pmem device one time */
-+ if (file->private_data != NULL)
-+ return -1;
-+ data = kmalloc(sizeof(struct pmem_data), GFP_KERNEL);
-+ if (!data) {
-+ printk("pmem: unable to allocate memory for pmem metadata.");
-+ return -1;
-+ }
-+ data->flags = 0;
-+ data->index = -1;
-+ data->task = NULL;
-+ data->vma = NULL;
-+ data->pid = 0;
-+ data->master_file = NULL;
-+#if PMEM_DEBUG
-+ data->ref = 0;
-+#endif
-+ INIT_LIST_HEAD(&data->region_list);
-+ init_rwsem(&data->sem);
-+
-+ file->private_data = data;
-+ INIT_LIST_HEAD(&data->list);
-+
-+ mutex_lock(&pmem[id].data_list_lock);
-+ list_add(&data->list, &pmem[id].data_list);
-+ mutex_unlock(&pmem[id].data_list_lock);
-+ return ret;
-+}
-+
-+static unsigned long pmem_order(unsigned long len)
-+{
-+ int i;
-+
-+ len = (len + PMEM_MIN_ALLOC - 1)/PMEM_MIN_ALLOC;
-+ len--;
-+ for (i = 0; i < sizeof(len)*8; i++)
-+ if (len >> i == 0)
-+ break;
-+ return i;
-+}
-+
-+static int pmem_allocate(int id, unsigned long len)
-+{
-+ /* caller should hold the write lock on pmem_sem! */
-+ /* return the corresponding pdata[] entry */
-+ int curr = 0;
-+ int end = pmem[id].num_entries;
-+ int best_fit = -1;
-+ unsigned long order = pmem_order(len);
-+
-+ if (pmem[id].no_allocator) {
-+ DLOG("no allocator");
-+ if ((len > pmem[id].size) || pmem[id].allocated)
-+ return -1;
-+ pmem[id].allocated = 1;
-+ return len;
-+ }
-+
-+ if (order > PMEM_MAX_ORDER)
-+ return -1;
-+ DLOG("order %lx\n", order);
-+
-+ /* look through the bitmap:
-+ * if you find a free slot of the correct order use it
-+ * otherwise, use the best fit (smallest with size > order) slot
-+ */
-+ while (curr < end) {
-+ if (PMEM_IS_FREE(id, curr)) {
-+ if (PMEM_ORDER(id, curr) == (unsigned char)order) {
-+ /* set the not free bit and clear others */
-+ best_fit = curr;
-+ break;
-+ }
-+ if (PMEM_ORDER(id, curr) > (unsigned char)order &&
-+ (best_fit < 0 ||
-+ PMEM_ORDER(id, curr) < PMEM_ORDER(id, best_fit)))
-+ best_fit = curr;
-+ }
-+ curr = PMEM_NEXT_INDEX(id, curr);
-+ }
-+
-+ /* if best_fit < 0, there are no suitable slots,
-+ * return an error
-+ */
-+ if (best_fit < 0) {
-+ printk("pmem: no space left to allocate!\n");
-+ return -1;
-+ }
-+
-+ /* now partition the best fit:
-+ * split the slot into 2 buddies of order - 1
-+ * repeat until the slot is of the correct order
-+ */
-+ while (PMEM_ORDER(id, best_fit) > (unsigned char)order) {
-+ int buddy;
-+ PMEM_ORDER(id, best_fit) -= 1;
-+ buddy = PMEM_BUDDY_INDEX(id, best_fit);
-+ PMEM_ORDER(id, buddy) = PMEM_ORDER(id, best_fit);
-+ }
-+ pmem[id].bitmap[best_fit].allocated = 1;
-+ return best_fit;
-+}
-+
-+static pgprot_t pmem_access_prot(struct file *file, pgprot_t vma_prot)
-+{
-+ int id = get_id(file);
-+#ifdef pgprot_noncached
-+ if (pmem[id].cached == 0 || file->f_flags & O_SYNC)
-+ return pgprot_noncached(vma_prot);
-+#endif
-+#ifdef pgprot_ext_buffered
-+ else if (pmem[id].buffered)
-+ return pgprot_ext_buffered(vma_prot);
-+#endif
-+ return vma_prot;
-+}
-+
-+static unsigned long pmem_start_addr(int id, struct pmem_data *data)
-+{
-+ if (pmem[id].no_allocator)
-+ return PMEM_START_ADDR(id, 0);
-+ else
-+ return PMEM_START_ADDR(id, data->index);
-+
-+}
-+
-+static void *pmem_start_vaddr(int id, struct pmem_data *data)
-+{
-+ return pmem_start_addr(id, data) - pmem[id].base + pmem[id].vbase;
-+}
-+
-+static unsigned long pmem_len(int id, struct pmem_data *data)
-+{
-+ if (pmem[id].no_allocator)
-+ return data->index;
-+ else
-+ return PMEM_LEN(id, data->index);
-+}
-+
-+static int pmem_map_garbage(int id, struct vm_area_struct *vma,
-+ struct pmem_data *data, unsigned long offset,
-+ unsigned long len)
-+{
-+ int i, garbage_pages = len >> PAGE_SHIFT;
-+
-+ vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP | VM_SHARED | VM_WRITE;
-+ for (i = 0; i < garbage_pages; i++) {
-+ if (vm_insert_pfn(vma, vma->vm_start + offset + (i * PAGE_SIZE),
-+ pmem[id].garbage_pfn))
-+ return -EAGAIN;
-+ }
-+ return 0;
-+}
-+
-+static int pmem_unmap_pfn_range(int id, struct vm_area_struct *vma,
-+ struct pmem_data *data, unsigned long offset,
-+ unsigned long len)
-+{
-+ int garbage_pages;
-+ DLOG("unmap offset %lx len %lx\n", offset, len);
-+
-+ BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
-+
-+ garbage_pages = len >> PAGE_SHIFT;
-+ zap_page_range(vma, vma->vm_start + offset, len, NULL);
-+ pmem_map_garbage(id, vma, data, offset, len);
-+ return 0;
-+}
-+
-+static int pmem_map_pfn_range(int id, struct vm_area_struct *vma,
-+ struct pmem_data *data, unsigned long offset,
-+ unsigned long len)
-+{
-+ DLOG("map offset %lx len %lx\n", offset, len);
-+ BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_start));
-+ BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_end));
-+ BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
-+ BUG_ON(!PMEM_IS_PAGE_ALIGNED(offset));
-+
-+ if (io_remap_pfn_range(vma, vma->vm_start + offset,
-+ (pmem_start_addr(id, data) + offset) >> PAGE_SHIFT,
-+ len, vma->vm_page_prot)) {
-+ return -EAGAIN;
-+ }
-+ return 0;
-+}
-+
-+static int pmem_remap_pfn_range(int id, struct vm_area_struct *vma,
-+ struct pmem_data *data, unsigned long offset,
-+ unsigned long len)
-+{
-+ /* hold the mm semp for the vma you are modifying when you call this */
-+ BUG_ON(!vma);
-+ zap_page_range(vma, vma->vm_start + offset, len, NULL);
-+ return pmem_map_pfn_range(id, vma, data, offset, len);
-+}
-+
-+static void pmem_vma_open(struct vm_area_struct *vma)
-+{
-+ struct file *file = vma->vm_file;
-+ struct pmem_data *data = file->private_data;
-+ int id = get_id(file);
-+ /* this should never be called as we don't support copying pmem
-+ * ranges via fork */
-+ BUG_ON(!has_allocation(file));
-+ down_write(&data->sem);
-+ /* remap the garbage pages, forkers don't get access to the data */
-+ pmem_unmap_pfn_range(id, vma, data, 0, vma->vm_start - vma->vm_end);
-+ up_write(&data->sem);
-+}
-+
-+static void pmem_vma_close(struct vm_area_struct *vma)
-+{
-+ struct file *file = vma->vm_file;
-+ struct pmem_data *data = file->private_data;
-+
-+ DLOG("current %u ppid %u file %p count %d\n", current->pid,
-+ current->parent->pid, file, file_count(file));
-+ if (unlikely(!is_pmem_file(file) || !has_allocation(file))) {
-+ printk(KERN_WARNING "pmem: something is very wrong, you are "
-+ "closing a vm backing an allocation that doesn't "
-+ "exist!\n");
-+ return;
-+ }
-+ down_write(&data->sem);
-+ if (data->vma == vma) {
-+ data->vma = NULL;
-+ if ((data->flags & PMEM_FLAGS_CONNECTED) &&
-+ (data->flags & PMEM_FLAGS_SUBMAP))
-+ data->flags |= PMEM_FLAGS_UNSUBMAP;
-+ }
-+ /* the kernel is going to free this vma now anyway */
-+ up_write(&data->sem);
-+}
-+
-+static struct vm_operations_struct vm_ops = {
-+ .open = pmem_vma_open,
-+ .close = pmem_vma_close,
-+};
-+
-+static int pmem_mmap(struct file *file, struct vm_area_struct *vma)
-+{
-+ struct pmem_data *data;
-+ int index;
-+ unsigned long vma_size = vma->vm_end - vma->vm_start;
-+ int ret = 0, id = get_id(file);
-+
-+ if (vma->vm_pgoff || !PMEM_IS_PAGE_ALIGNED(vma_size)) {
-+#if PMEM_DEBUG
-+ printk(KERN_ERR "pmem: mmaps must be at offset zero, aligned"
-+ " and a multiple of pages_size.\n");
-+#endif
-+ return -EINVAL;
-+ }
-+
-+ data = (struct pmem_data *)file->private_data;
-+ down_write(&data->sem);
-+ /* check this file isn't already mmaped, for submaps check this file
-+ * has never been mmaped */
-+ if ((data->flags & PMEM_FLAGS_SUBMAP) ||
-+ (data->flags & PMEM_FLAGS_UNSUBMAP)) {
-+#if PMEM_DEBUG
-+ printk(KERN_ERR "pmem: you can only mmap a pmem file once, "
-+ "this file is already mmaped. %x\n", data->flags);
-+#endif
-+ ret = -EINVAL;
-+ goto error;
-+ }
-+ /* if file->private_data == unalloced, alloc*/
-+ if (data && data->index == -1) {
-+ down_write(&pmem[id].bitmap_sem);
-+ index = pmem_allocate(id, vma->vm_end - vma->vm_start);
-+ up_write(&pmem[id].bitmap_sem);
-+ data->index = index;
-+ }
-+ /* either no space was available or an error occured */
-+ if (!has_allocation(file)) {
-+ ret = -EINVAL;
-+ printk("pmem: could not find allocation for map.\n");
-+ goto error;
-+ }
-+
-+ if (pmem_len(id, data) < vma_size) {
-+#if PMEM_DEBUG
-+ printk(KERN_WARNING "pmem: mmap size [%lu] does not match"
-+ "size of backing region [%lu].\n", vma_size,
-+ pmem_len(id, data));
-+#endif
-+ ret = -EINVAL;
-+ goto error;
-+ }
-+
-+ vma->vm_pgoff = pmem_start_addr(id, data) >> PAGE_SHIFT;
-+ vma->vm_page_prot = pmem_access_prot(file, vma->vm_page_prot);
-+
-+ if (data->flags & PMEM_FLAGS_CONNECTED) {
-+ struct pmem_region_node *region_node;
-+ struct list_head *elt;
-+ if (pmem_map_garbage(id, vma, data, 0, vma_size)) {
-+ printk("pmem: mmap failed in kernel!\n");
-+ ret = -EAGAIN;
-+ goto error;
-+ }
-+ list_for_each(elt, &data->region_list) {
-+ region_node = list_entry(elt, struct pmem_region_node,
-+ list);
-+ DLOG("remapping file: %p %lx %lx\n", file,
-+ region_node->region.offset,
-+ region_node->region.len);
-+ if (pmem_remap_pfn_range(id, vma, data,
-+ region_node->region.offset,
-+ region_node->region.len)) {
-+ ret = -EAGAIN;
-+ goto error;
-+ }
-+ }
-+ data->flags |= PMEM_FLAGS_SUBMAP;
-+ get_task_struct(current->group_leader);
-+ data->task = current->group_leader;
-+ data->vma = vma;
-+#if PMEM_DEBUG
-+ data->pid = current->pid;
-+#endif
-+ DLOG("submmapped file %p vma %p pid %u\n", file, vma,
-+ current->pid);
-+ } else {
-+ if (pmem_map_pfn_range(id, vma, data, 0, vma_size)) {
-+ printk(KERN_INFO "pmem: mmap failed in kernel!\n");
-+ ret = -EAGAIN;
-+ goto error;
-+ }
-+ data->flags |= PMEM_FLAGS_MASTERMAP;
-+ data->pid = current->pid;
-+ }
-+ vma->vm_ops = &vm_ops;
-+error:
-+ up_write(&data->sem);
-+ return ret;
-+}
-+
-+/* the following are the api for accessing pmem regions by other drivers
-+ * from inside the kernel */
-+int get_pmem_user_addr(struct file *file, unsigned long *start,
-+ unsigned long *len)
-+{
-+ struct pmem_data *data;
-+ if (!is_pmem_file(file) || !has_allocation(file)) {
-+#if PMEM_DEBUG
-+ printk(KERN_INFO "pmem: requested pmem data from invalid"
-+ "file.\n");
-+#endif
-+ return -1;
-+ }
-+ data = (struct pmem_data *)file->private_data;
-+ down_read(&data->sem);
-+ if (data->vma) {
-+ *start = data->vma->vm_start;
-+ *len = data->vma->vm_end - data->vma->vm_start;
-+ } else {
-+ *start = 0;
-+ *len = 0;
-+ }
-+ up_read(&data->sem);
-+ return 0;
-+}
-+
-+int get_pmem_addr(struct file *file, unsigned long *start,
-+ unsigned long *vstart, unsigned long *len)
-+{
-+ struct pmem_data *data;
-+ int id;
-+
-+ if (!is_pmem_file(file) || !has_allocation(file)) {
-+ return -1;
-+ }
-+
-+ data = (struct pmem_data *)file->private_data;
-+ if (data->index == -1) {
-+#if PMEM_DEBUG
-+ printk(KERN_INFO "pmem: requested pmem data from file with no "
-+ "allocation.\n");
-+ return -1;
-+#endif
-+ }
-+ id = get_id(file);
-+
-+ down_read(&data->sem);
-+ *start = pmem_start_addr(id, data);
-+ *len = pmem_len(id, data);
-+ *vstart = (unsigned long)pmem_start_vaddr(id, data);
-+ up_read(&data->sem);
-+#if PMEM_DEBUG
-+ down_write(&data->sem);
-+ data->ref++;
-+ up_write(&data->sem);
-+#endif
-+ return 0;
-+}
-+
-+int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
-+ unsigned long *len, struct file **filp)
-+{
-+ struct file *file;
-+
-+ file = fget(fd);
-+ if (unlikely(file == NULL)) {
-+ printk(KERN_INFO "pmem: requested data from file descriptor "
-+ "that doesn't exist.");
-+ return -1;
-+ }
-+
-+ if (get_pmem_addr(file, start, vstart, len))
-+ goto end;
-+
-+ if (filp)
-+ *filp = file;
-+ return 0;
-+end:
-+ fput(file);
-+ return -1;
-+}
-+
-+void put_pmem_file(struct file *file)
-+{
-+ struct pmem_data *data;
-+ int id;
-+
-+ if (!is_pmem_file(file))
-+ return;
-+ id = get_id(file);
-+ data = (struct pmem_data *)file->private_data;
-+#if PMEM_DEBUG
-+ down_write(&data->sem);
-+ if (data->ref == 0) {
-+ printk("pmem: pmem_put > pmem_get %s (pid %d)\n",
-+ pmem[id].dev.name, data->pid);
-+ BUG();
-+ }
-+ data->ref--;
-+ up_write(&data->sem);
-+#endif
-+ fput(file);
-+}
-+
-+void flush_pmem_file(struct file *file, unsigned long offset, unsigned long len)
-+{
-+ struct pmem_data *data;
-+ int id;
-+ void *vaddr;
-+ struct pmem_region_node *region_node;
-+ struct list_head *elt;
-+ void *flush_start, *flush_end;
-+
-+ if (!is_pmem_file(file) || !has_allocation(file)) {
-+ return;
-+ }
-+
-+ id = get_id(file);
-+ data = (struct pmem_data *)file->private_data;
-+ if (!pmem[id].cached || file->f_flags & O_SYNC)
-+ return;
-+
-+ down_read(&data->sem);
-+ vaddr = pmem_start_vaddr(id, data);
-+ /* if this isn't a submmapped file, flush the whole thing */
-+ if (unlikely(!(data->flags & PMEM_FLAGS_CONNECTED))) {
-+ dmac_flush_range(vaddr, vaddr + pmem_len(id, data));
-+ goto end;
-+ }
-+ /* otherwise, flush the region of the file we are drawing */
-+ list_for_each(elt, &data->region_list) {
-+ region_node = list_entry(elt, struct pmem_region_node, list);
-+ if ((offset >= region_node->region.offset) &&
-+ ((offset + len) <= (region_node->region.offset +
-+ region_node->region.len))) {
-+ flush_start = vaddr + region_node->region.offset;
-+ flush_end = flush_start + region_node->region.len;
-+ dmac_flush_range(flush_start, flush_end);
-+ break;
-+ }
-+ }
-+end:
-+ up_read(&data->sem);
-+}
-+
-+static int pmem_connect(unsigned long connect, struct file *file)
-+{
-+ struct pmem_data *data = (struct pmem_data *)file->private_data;
-+ struct pmem_data *src_data;
-+ struct file *src_file;
-+ int ret = 0, put_needed;
-+
-+ down_write(&data->sem);
-+ /* retrieve the src file and check it is a pmem file with an alloc */
-+ src_file = fget_light(connect, &put_needed);
-+ DLOG("connect %p to %p\n", file, src_file);
-+ if (!src_file) {
-+ printk("pmem: src file not found!\n");
-+ ret = -EINVAL;
-+ goto err_no_file;
-+ }
-+ if (unlikely(!is_pmem_file(src_file) || !has_allocation(src_file))) {
-+ printk(KERN_INFO "pmem: src file is not a pmem file or has no "
-+ "alloc!\n");
-+ ret = -EINVAL;
-+ goto err_bad_file;
-+ }
-+ src_data = (struct pmem_data *)src_file->private_data;
-+
-+ if (has_allocation(file) && (data->index != src_data->index)) {
-+ printk("pmem: file is already mapped but doesn't match this"
-+ " src_file!\n");
-+ ret = -EINVAL;
-+ goto err_bad_file;
-+ }
-+ data->index = src_data->index;
-+ data->flags |= PMEM_FLAGS_CONNECTED;
-+ data->master_fd = connect;
-+ data->master_file = src_file;
-+
-+err_bad_file:
-+ fput_light(src_file, put_needed);
-+err_no_file:
-+ up_write(&data->sem);
-+ return ret;
-+}
-+
-+static void pmem_unlock_data_and_mm(struct pmem_data *data,
-+ struct mm_struct *mm)
-+{
-+ up_write(&data->sem);
-+ if (mm != NULL) {
-+ up_write(&mm->mmap_sem);
-+ mmput(mm);
-+ }
-+}
-+
-+static int pmem_lock_data_and_mm(struct file *file, struct pmem_data *data,
-+ struct mm_struct **locked_mm)
-+{
-+ int ret = 0;
-+ struct mm_struct *mm = NULL;
-+ *locked_mm = NULL;
-+lock_mm:
-+ down_read(&data->sem);
-+ if (PMEM_IS_SUBMAP(data)) {
-+ mm = get_task_mm(data->task);
-+ if (!mm) {
-+#if PMEM_DEBUG
-+ printk("pmem: can't remap task is gone!\n");
-+#endif
-+ up_read(&data->sem);
-+ return -1;
-+ }
-+ }
-+ up_read(&data->sem);
-+
-+ if (mm)
-+ down_write(&mm->mmap_sem);
-+
-+ down_write(&data->sem);
-+ /* check that the file didn't get mmaped before we could take the
-+ * data sem, this should be safe b/c you can only submap each file
-+ * once */
-+ if (PMEM_IS_SUBMAP(data) && !mm) {
-+ pmem_unlock_data_and_mm(data, mm);
-+ up_write(&data->sem);
-+ goto lock_mm;
-+ }
-+ /* now check that vma.mm is still there, it could have been
-+ * deleted by vma_close before we could get the data->sem */
-+ if ((data->flags & PMEM_FLAGS_UNSUBMAP) && (mm != NULL)) {
-+ /* might as well release this */
-+ if (data->flags & PMEM_FLAGS_SUBMAP) {
-+ put_task_struct(data->task);
-+ data->task = NULL;
-+ /* lower the submap flag to show the mm is gone */
-+ data->flags &= ~(PMEM_FLAGS_SUBMAP);
-+ }
-+ pmem_unlock_data_and_mm(data, mm);
-+ return -1;
-+ }
-+ *locked_mm = mm;
-+ return ret;
-+}
-+
-+int pmem_remap(struct pmem_region *region, struct file *file,
-+ unsigned operation)
-+{
-+ int ret;
-+ struct pmem_region_node *region_node;
-+ struct mm_struct *mm = NULL;
-+ struct list_head *elt, *elt2;
-+ int id = get_id(file);
-+ struct pmem_data *data = (struct pmem_data *)file->private_data;
-+
-+ /* pmem region must be aligned on a page boundry */
-+ if (unlikely(!PMEM_IS_PAGE_ALIGNED(region->offset) ||
-+ !PMEM_IS_PAGE_ALIGNED(region->len))) {
-+#if PMEM_DEBUG
-+ printk("pmem: request for unaligned pmem suballocation "
-+ "%lx %lx\n", region->offset, region->len);
-+#endif
-+ return -EINVAL;
-+ }
-+
-+ /* if userspace requests a region of len 0, there's nothing to do */
-+ if (region->len == 0)
-+ return 0;
-+
-+ /* lock the mm and data */
-+ ret = pmem_lock_data_and_mm(file, data, &mm);
-+ if (ret)
-+ return 0;
-+
-+ /* only the owner of the master file can remap the client fds
-+ * that back in it */
-+ if (!is_master_owner(file)) {
-+#if PMEM_DEBUG
-+ printk("pmem: remap requested from non-master process\n");
-+#endif
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+
-+ /* check that the requested range is within the src allocation */
-+ if (unlikely((region->offset > pmem_len(id, data)) ||
-+ (region->len > pmem_len(id, data)) ||
-+ (region->offset + region->len > pmem_len(id, data)))) {
-+#if PMEM_DEBUG
-+ printk(KERN_INFO "pmem: suballoc doesn't fit in src_file!\n");
-+#endif
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+
-+ if (operation == PMEM_MAP) {
-+ region_node = kmalloc(sizeof(struct pmem_region_node),
-+ GFP_KERNEL);
-+ if (!region_node) {
-+ ret = -ENOMEM;
-+#if PMEM_DEBUG
-+ printk(KERN_INFO "No space to allocate metadata!");
-+#endif
-+ goto err;
-+ }
-+ region_node->region = *region;
-+ list_add(&region_node->list, &data->region_list);
-+ } else if (operation == PMEM_UNMAP) {
-+ int found = 0;
-+ list_for_each_safe(elt, elt2, &data->region_list) {
-+ region_node = list_entry(elt, struct pmem_region_node,
-+ list);
-+ if (region->len == 0 ||
-+ (region_node->region.offset == region->offset &&
-+ region_node->region.len == region->len)) {
-+ list_del(elt);
-+ kfree(region_node);
-+ found = 1;
-+ }
-+ }
-+ if (!found) {
-+#if PMEM_DEBUG
-+ printk("pmem: Unmap region does not map any mapped "
-+ "region!");
-+#endif
-+ ret = -EINVAL;
-+ goto err;
-+ }
-+ }
-+
-+ if (data->vma && PMEM_IS_SUBMAP(data)) {
-+ if (operation == PMEM_MAP)
-+ ret = pmem_remap_pfn_range(id, data->vma, data,
-+ region->offset, region->len);
-+ else if (operation == PMEM_UNMAP)
-+ ret = pmem_unmap_pfn_range(id, data->vma, data,
-+ region->offset, region->len);
-+ }
-+
-+err:
-+ pmem_unlock_data_and_mm(data, mm);
-+ return ret;
-+}
-+
-+static void pmem_revoke(struct file *file, struct pmem_data *data)
-+{
-+ struct pmem_region_node *region_node;
-+ struct list_head *elt, *elt2;
-+ struct mm_struct *mm = NULL;
-+ int id = get_id(file);
-+ int ret = 0;
-+
-+ data->master_file = NULL;
-+ ret = pmem_lock_data_and_mm(file, data, &mm);
-+ /* if lock_data_and_mm fails either the task that mapped the fd, or
-+ * the vma that mapped it have already gone away, nothing more
-+ * needs to be done */
-+ if (ret)
-+ return;
-+ /* unmap everything */
-+ /* delete the regions and region list nothing is mapped any more */
-+ if (data->vma)
-+ list_for_each_safe(elt, elt2, &data->region_list) {
-+ region_node = list_entry(elt, struct pmem_region_node,
-+ list);
-+ pmem_unmap_pfn_range(id, data->vma, data,
-+ region_node->region.offset,
-+ region_node->region.len);
-+ list_del(elt);
-+ kfree(region_node);
-+ }
-+ /* delete the master file */
-+ pmem_unlock_data_and_mm(data, mm);
-+}
-+
-+static void pmem_get_size(struct pmem_region *region, struct file *file)
-+{
-+ struct pmem_data *data = (struct pmem_data *)file->private_data;
-+ int id = get_id(file);
-+
-+ if (!has_allocation(file)) {
-+ region->offset = 0;
-+ region->len = 0;
-+ return;
-+ } else {
-+ region->offset = pmem_start_addr(id, data);
-+ region->len = pmem_len(id, data);
-+ }
-+ DLOG("offset %lx len %lx\n", region->offset, region->len);
-+}
-+
-+
-+static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-+{
-+ struct pmem_data *data;
-+ int id = get_id(file);
-+
-+ switch (cmd) {
-+ case PMEM_GET_PHYS:
-+ {
-+ struct pmem_region region;
-+ DLOG("get_phys\n");
-+ if (!has_allocation(file)) {
-+ region.offset = 0;
-+ region.len = 0;
-+ } else {
-+ data = (struct pmem_data *)file->private_data;
-+ region.offset = pmem_start_addr(id, data);
-+ region.len = pmem_len(id, data);
-+ }
-+ printk(KERN_INFO "pmem: request for physical address of pmem region "
-+ "from process %d.\n", current->pid);
-+ if (copy_to_user((void __user *)arg, &region,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ break;
-+ }
-+ case PMEM_MAP:
-+ {
-+ struct pmem_region region;
-+ if (copy_from_user(&region, (void __user *)arg,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ data = (struct pmem_data *)file->private_data;
-+ return pmem_remap(&region, file, PMEM_MAP);
-+ }
-+ break;
-+ case PMEM_UNMAP:
-+ {
-+ struct pmem_region region;
-+ if (copy_from_user(&region, (void __user *)arg,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ data = (struct pmem_data *)file->private_data;
-+ return pmem_remap(&region, file, PMEM_UNMAP);
-+ break;
-+ }
-+ case PMEM_GET_SIZE:
-+ {
-+ struct pmem_region region;
-+ DLOG("get_size\n");
-+ pmem_get_size(&region, file);
-+ if (copy_to_user((void __user *)arg, &region,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ break;
-+ }
-+ case PMEM_GET_TOTAL_SIZE:
-+ {
-+ struct pmem_region region;
-+ DLOG("get total size\n");
-+ region.offset = 0;
-+ get_id(file);
-+ region.len = pmem[id].size;
-+ if (copy_to_user((void __user *)arg, &region,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ break;
-+ }
-+ case PMEM_ALLOCATE:
-+ {
-+ if (has_allocation(file))
-+ return -EINVAL;
-+ data = (struct pmem_data *)file->private_data;
-+ data->index = pmem_allocate(id, arg);
-+ break;
-+ }
-+ case PMEM_CONNECT:
-+ DLOG("connect\n");
-+ return pmem_connect(arg, file);
-+ break;
-+ case PMEM_CACHE_FLUSH:
-+ {
-+ struct pmem_region region;
-+ DLOG("flush\n");
-+ if (copy_from_user(&region, (void __user *)arg,
-+ sizeof(struct pmem_region)))
-+ return -EFAULT;
-+ flush_pmem_file(file, region.offset, region.len);
-+ break;
-+ }
-+ default:
-+ if (pmem[id].ioctl)
-+ return pmem[id].ioctl(file, cmd, arg);
-+ return -EINVAL;
-+ }
-+ return 0;
-+}
-+
-+#if PMEM_DEBUG
-+static ssize_t debug_open(struct inode *inode, struct file *file)
-+{
-+ file->private_data = inode->i_private;
-+ return 0;
-+}
-+
-+static ssize_t debug_read(struct file *file, char __user *buf, size_t count,
-+ loff_t *ppos)
-+{
-+ struct list_head *elt, *elt2;
-+ struct pmem_data *data;
-+ struct pmem_region_node *region_node;
-+ int id = (int)file->private_data;
-+ const int debug_bufmax = 4096;
-+ static char buffer[4096];
-+ int n = 0;
-+
-+ DLOG("debug open\n");
-+ n = scnprintf(buffer, debug_bufmax,
-+ "pid #: mapped regions (offset, len) (offset,len)...\n");
-+
-+ mutex_lock(&pmem[id].data_list_lock);
-+ list_for_each(elt, &pmem[id].data_list) {
-+ data = list_entry(elt, struct pmem_data, list);
-+ down_read(&data->sem);
-+ n += scnprintf(buffer + n, debug_bufmax - n, "pid %u:",
-+ data->pid);
-+ list_for_each(elt2, &data->region_list) {
-+ region_node = list_entry(elt2, struct pmem_region_node,
-+ list);
-+ n += scnprintf(buffer + n, debug_bufmax - n,
-+ "(%lx,%lx) ",
-+ region_node->region.offset,
-+ region_node->region.len);
-+ }
-+ n += scnprintf(buffer + n, debug_bufmax - n, "\n");
-+ up_read(&data->sem);
-+ }
-+ mutex_unlock(&pmem[id].data_list_lock);
-+
-+ n++;
-+ buffer[n] = 0;
-+ return simple_read_from_buffer(buf, count, ppos, buffer, n);
-+}
-+
-+static struct file_operations debug_fops = {
-+ .read = debug_read,
-+ .open = debug_open,
-+};
-+#endif
-+
-+#if 0
-+static struct miscdevice pmem_dev = {
-+ .name = "pmem",
-+ .fops = &pmem_fops,
-+};
-+#endif
-+
-+int pmem_setup(struct android_pmem_platform_data *pdata,
-+ long (*ioctl)(struct file *, unsigned int, unsigned long),
-+ int (*release)(struct inode *, struct file *))
-+{
-+ int err = 0;
-+ int i, index = 0;
-+ int id = id_count;
-+ id_count++;
-+
-+ pmem[id].no_allocator = pdata->no_allocator;
-+ pmem[id].cached = pdata->cached;
-+ pmem[id].buffered = pdata->buffered;
-+ pmem[id].base = pdata->start;
-+ pmem[id].size = pdata->size;
-+ pmem[id].ioctl = ioctl;
-+ pmem[id].release = release;
-+ init_rwsem(&pmem[id].bitmap_sem);
-+ mutex_init(&pmem[id].data_list_lock);
-+ INIT_LIST_HEAD(&pmem[id].data_list);
-+ pmem[id].dev.name = pdata->name;
-+ pmem[id].dev.minor = id;
-+ pmem[id].dev.fops = &pmem_fops;
-+ printk(KERN_INFO "%s: %d init\n", pdata->name, pdata->cached);
-+
-+ err = misc_register(&pmem[id].dev);
-+ if (err) {
-+ printk(KERN_ALERT "Unable to register pmem driver!\n");
-+ goto err_cant_register_device;
-+ }
-+ pmem[id].num_entries = pmem[id].size / PMEM_MIN_ALLOC;
-+
-+ pmem[id].bitmap = kmalloc(pmem[id].num_entries *
-+ sizeof(struct pmem_bits), GFP_KERNEL);
-+ if (!pmem[id].bitmap)
-+ goto err_no_mem_for_metadata;
-+
-+ memset(pmem[id].bitmap, 0, sizeof(struct pmem_bits) *
-+ pmem[id].num_entries);
-+
-+ for (i = sizeof(pmem[id].num_entries) * 8 - 1; i >= 0; i--) {
-+ if ((pmem[id].num_entries) & 1<<i) {
-+ PMEM_ORDER(id, index) = i;
-+ index = PMEM_NEXT_INDEX(id, index);
-+ }
-+ }
-+
-+ if (pmem[id].cached)
-+ pmem[id].vbase = ioremap_cached(pmem[id].base,
-+ pmem[id].size);
-+#ifdef ioremap_ext_buffered
-+ else if (pmem[id].buffered)
-+ pmem[id].vbase = ioremap_ext_buffered(pmem[id].base,
-+ pmem[id].size);
-+#endif
-+ else
-+ pmem[id].vbase = ioremap(pmem[id].base, pmem[id].size);
-+
-+ if (pmem[id].vbase == 0)
-+ goto error_cant_remap;
-+
-+ pmem[id].garbage_pfn = page_to_pfn(alloc_page(GFP_KERNEL));
-+ if (pmem[id].no_allocator)
-+ pmem[id].allocated = 0;
-+
-+#if PMEM_DEBUG
-+ debugfs_create_file(pdata->name, S_IFREG | S_IRUGO, NULL, (void *)id,
-+ &debug_fops);
-+#endif
-+ return 0;
-+error_cant_remap:
-+ kfree(pmem[id].bitmap);
-+err_no_mem_for_metadata:
-+ misc_deregister(&pmem[id].dev);
-+err_cant_register_device:
-+ return -1;
-+}
-+
-+static int pmem_probe(struct platform_device *pdev)
-+{
-+ struct android_pmem_platform_data *pdata;
-+
-+ if (!pdev || !pdev->dev.platform_data) {
-+ printk(KERN_ALERT "Unable to probe pmem!\n");
-+ return -1;
-+ }
-+ pdata = pdev->dev.platform_data;
-+ return pmem_setup(pdata, NULL, NULL);
-+}
-+
-+
-+static int pmem_remove(struct platform_device *pdev)
-+{
-+ int id = pdev->id;
-+ __free_page(pfn_to_page(pmem[id].garbage_pfn));
-+ misc_deregister(&pmem[id].dev);
-+ return 0;
-+}
-+
-+static struct platform_driver pmem_driver = {
-+ .probe = pmem_probe,
-+ .remove = pmem_remove,
-+ .driver = { .name = "android_pmem" }
-+};
-+
-+
-+static int __init pmem_init(void)
-+{
-+ return platform_driver_register(&pmem_driver);
-+}
-+
-+static void __exit pmem_exit(void)
-+{
-+ platform_driver_unregister(&pmem_driver);
-+}
-+
-+module_init(pmem_init);
-+module_exit(pmem_exit);
-+
diff --git a/patches.android/android-0027-ashmem-Anonymous-shared-memory-subsystem.patch b/patches.android/android-0027-ashmem-Anonymous-shared-memory-subsystem.patch
deleted file mode 100644
index 1d3f83365c6f3a..00000000000000
--- a/patches.android/android-0027-ashmem-Anonymous-shared-memory-subsystem.patch
+++ /dev/null
@@ -1,829 +0,0 @@
-From 11980c2ac4ccfad21a5f8ee9e12059f1e687bb40 Mon Sep 17 00:00:00 2001
-From: Robert Love <rlove@google.com>
-Date: Tue, 20 Dec 2011 16:49:48 -0800
-Subject: ashmem: Anonymous shared memory subsystem
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 11980c2ac4ccfad21a5f8ee9e12059f1e687bb40
-
-The anonymous shared memory (ashmem) subsystem provides a
-Unix-y,file-based shared memory interface to user-space. It
-works like anonymous memory (e.g. mmapping fd=0) except if
-you share the file descriptor via the usual means, you will
-share the mapping. The shared memory can be accessed via both
-mmap or file I/O. The backing store is a simple shmem file.
-
-Additionally, ashmem introduces the concept of page pinning.
-Pinned pages (the default) behave like any anonymous memory.
-Unpinned pages are available to the kernel for eviction during
-VM pressure. When repinning the pages, the return value
-instructs user-space as to any eviction. In this manner,
-user-space processes may implement caching and similar
-resource management that efficiently integrates with kernel
-memory management.
-
-Signed-off-by: Robert Love <rlove@google.com>
-
-ashmem: Don't install fault handler for private mmaps.
-
-Ashmem is used to create named private heaps. If this heap is backed
-by a tmpfs file it will allocate two pages for every page touched.
-In 2.6.27, the extra page would later be freed, but 2.6.29 does not
-scan anonymous pages when running without swap so the memory is not
-freed while the file is referenced. This change changes the behavior
-of private ashmem mmaps to match /dev/zero instead tmpfs.
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-
-ashmem: Add common prefix to name reported in /proc/pid/maps
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-
-ashmem: don't require a page aligned size
-
-This makes ashmem more similar to shmem and mmap, by
-not requiring the specified size to be page aligned,
-instead rounding it internally as needed.
-
-Signed-off-by: Marco Nelissen <marcone@android.com>
-[jstultz: Improved commit subject and included patch description
-from rlove. Also moved ashmem files to staging dir, and reworked
-code to avoid touching mm/shmem.c while we're in staging.]
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index 6094fd6..becf711 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -12,6 +12,15 @@ config ANDROID_BINDER_IPC
- bool "Android Binder IPC Driver"
- default n
-
-+config ASHMEM
-+ bool "Enable the Anonymous Shared Memory Subsystem"
-+ default n
-+ depends on SHMEM || TINY_SHMEM
-+ help
-+ The ashmem subsystem is a new shared memory allocator, similar to
-+ POSIX SHM but with different behavior and sporting a simpler
-+ file-based API.
-+
- config ANDROID_LOGGER
- tristate "Android log driver"
- default n
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-index 8fd7391..eaed1ff 100644
---- a/drivers/staging/android/Makefile
-+++ b/drivers/staging/android/Makefile
-@@ -1,4 +1,5 @@
- obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o
-+obj-$(CONFIG_ASHMEM) += ashmem.o
- obj-$(CONFIG_ANDROID_LOGGER) += logger.o
- obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
- obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-new file mode 100644
-index 0000000..5775c6c
---- /dev/null
-+++ b/drivers/staging/android/ashmem.c
-@@ -0,0 +1,678 @@
-+/* mm/ashmem.c
-+**
-+** Anonymous Shared Memory Subsystem, ashmem
-+**
-+** Copyright (C) 2008 Google, Inc.
-+**
-+** Robert Love <rlove@google.com>
-+**
-+** This software is licensed under the terms of the GNU General Public
-+** License version 2, as published by the Free Software Foundation, and
-+** may be copied, distributed, and modified under those terms.
-+**
-+** This program is distributed in the hope that it will be useful,
-+** but WITHOUT ANY WARRANTY; without even the implied warranty of
-+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+** GNU General Public License for more details.
-+*/
-+
-+#include <linux/module.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+#include <linux/miscdevice.h>
-+#include <linux/security.h>
-+#include <linux/mm.h>
-+#include <linux/mman.h>
-+#include <linux/uaccess.h>
-+#include <linux/personality.h>
-+#include <linux/bitops.h>
-+#include <linux/mutex.h>
-+#include <linux/shmem_fs.h>
-+#include "ashmem.h"
-+
-+#define ASHMEM_NAME_PREFIX "dev/ashmem/"
-+#define ASHMEM_NAME_PREFIX_LEN (sizeof(ASHMEM_NAME_PREFIX) - 1)
-+#define ASHMEM_FULL_NAME_LEN (ASHMEM_NAME_LEN + ASHMEM_NAME_PREFIX_LEN)
-+
-+/*
-+ * ashmem_area - anonymous shared memory area
-+ * Lifecycle: From our parent file's open() until its release()
-+ * Locking: Protected by `ashmem_mutex'
-+ * Big Note: Mappings do NOT pin this structure; it dies on close()
-+ */
-+struct ashmem_area {
-+ char name[ASHMEM_FULL_NAME_LEN];/* optional name for /proc/pid/maps */
-+ struct list_head unpinned_list; /* list of all ashmem areas */
-+ struct file *file; /* the shmem-based backing file */
-+ size_t size; /* size of the mapping, in bytes */
-+ unsigned long prot_mask; /* allowed prot bits, as vm_flags */
-+};
-+
-+/*
-+ * ashmem_range - represents an interval of unpinned (evictable) pages
-+ * Lifecycle: From unpin to pin
-+ * Locking: Protected by `ashmem_mutex'
-+ */
-+struct ashmem_range {
-+ struct list_head lru; /* entry in LRU list */
-+ struct list_head unpinned; /* entry in its area's unpinned list */
-+ struct ashmem_area *asma; /* associated area */
-+ size_t pgstart; /* starting page, inclusive */
-+ size_t pgend; /* ending page, inclusive */
-+ unsigned int purged; /* ASHMEM_NOT or ASHMEM_WAS_PURGED */
-+};
-+
-+/* LRU list of unpinned pages, protected by ashmem_mutex */
-+static LIST_HEAD(ashmem_lru_list);
-+
-+/* Count of pages on our LRU list, protected by ashmem_mutex */
-+static unsigned long lru_count;
-+
-+/*
-+ * ashmem_mutex - protects the list of and each individual ashmem_area
-+ *
-+ * Lock Ordering: ashmex_mutex -> i_mutex -> i_alloc_sem
-+ */
-+static DEFINE_MUTEX(ashmem_mutex);
-+
-+static struct kmem_cache *ashmem_area_cachep __read_mostly;
-+static struct kmem_cache *ashmem_range_cachep __read_mostly;
-+
-+#define range_size(range) \
-+ ((range)->pgend - (range)->pgstart + 1)
-+
-+#define range_on_lru(range) \
-+ ((range)->purged == ASHMEM_NOT_PURGED)
-+
-+#define page_range_subsumes_range(range, start, end) \
-+ (((range)->pgstart >= (start)) && ((range)->pgend <= (end)))
-+
-+#define page_range_subsumed_by_range(range, start, end) \
-+ (((range)->pgstart <= (start)) && ((range)->pgend >= (end)))
-+
-+#define page_in_range(range, page) \
-+ (((range)->pgstart <= (page)) && ((range)->pgend >= (page)))
-+
-+#define page_range_in_range(range, start, end) \
-+ (page_in_range(range, start) || page_in_range(range, end) || \
-+ page_range_subsumes_range(range, start, end))
-+
-+#define range_before_page(range, page) \
-+ ((range)->pgend < (page))
-+
-+#define PROT_MASK (PROT_EXEC | PROT_READ | PROT_WRITE)
-+
-+static inline void lru_add(struct ashmem_range *range)
-+{
-+ list_add_tail(&range->lru, &ashmem_lru_list);
-+ lru_count += range_size(range);
-+}
-+
-+static inline void lru_del(struct ashmem_range *range)
-+{
-+ list_del(&range->lru);
-+ lru_count -= range_size(range);
-+}
-+
-+/*
-+ * range_alloc - allocate and initialize a new ashmem_range structure
-+ *
-+ * 'asma' - associated ashmem_area
-+ * 'prev_range' - the previous ashmem_range in the sorted asma->unpinned list
-+ * 'purged' - initial purge value (ASMEM_NOT_PURGED or ASHMEM_WAS_PURGED)
-+ * 'start' - starting page, inclusive
-+ * 'end' - ending page, inclusive
-+ *
-+ * Caller must hold ashmem_mutex.
-+ */
-+static int range_alloc(struct ashmem_area *asma,
-+ struct ashmem_range *prev_range, unsigned int purged,
-+ size_t start, size_t end)
-+{
-+ struct ashmem_range *range;
-+
-+ range = kmem_cache_zalloc(ashmem_range_cachep, GFP_KERNEL);
-+ if (unlikely(!range))
-+ return -ENOMEM;
-+
-+ range->asma = asma;
-+ range->pgstart = start;
-+ range->pgend = end;
-+ range->purged = purged;
-+
-+ list_add_tail(&range->unpinned, &prev_range->unpinned);
-+
-+ if (range_on_lru(range))
-+ lru_add(range);
-+
-+ return 0;
-+}
-+
-+static void range_del(struct ashmem_range *range)
-+{
-+ list_del(&range->unpinned);
-+ if (range_on_lru(range))
-+ lru_del(range);
-+ kmem_cache_free(ashmem_range_cachep, range);
-+}
-+
-+/*
-+ * range_shrink - shrinks a range
-+ *
-+ * Caller must hold ashmem_mutex.
-+ */
-+static inline void range_shrink(struct ashmem_range *range,
-+ size_t start, size_t end)
-+{
-+ size_t pre = range_size(range);
-+
-+ range->pgstart = start;
-+ range->pgend = end;
-+
-+ if (range_on_lru(range))
-+ lru_count -= pre - range_size(range);
-+}
-+
-+static int ashmem_open(struct inode *inode, struct file *file)
-+{
-+ struct ashmem_area *asma;
-+ int ret;
-+
-+ ret = nonseekable_open(inode, file);
-+ if (unlikely(ret))
-+ return ret;
-+
-+ asma = kmem_cache_zalloc(ashmem_area_cachep, GFP_KERNEL);
-+ if (unlikely(!asma))
-+ return -ENOMEM;
-+
-+ INIT_LIST_HEAD(&asma->unpinned_list);
-+ memcpy(asma->name, ASHMEM_NAME_PREFIX, ASHMEM_NAME_PREFIX_LEN);
-+ asma->prot_mask = PROT_MASK;
-+ file->private_data = asma;
-+
-+ return 0;
-+}
-+
-+static int ashmem_release(struct inode *ignored, struct file *file)
-+{
-+ struct ashmem_area *asma = file->private_data;
-+ struct ashmem_range *range, *next;
-+
-+ mutex_lock(&ashmem_mutex);
-+ list_for_each_entry_safe(range, next, &asma->unpinned_list, unpinned)
-+ range_del(range);
-+ mutex_unlock(&ashmem_mutex);
-+
-+ if (asma->file)
-+ fput(asma->file);
-+ kmem_cache_free(ashmem_area_cachep, asma);
-+
-+ return 0;
-+}
-+
-+static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
-+{
-+ struct ashmem_area *asma = file->private_data;
-+ int ret = 0;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ /* user needs to SET_SIZE before mapping */
-+ if (unlikely(!asma->size)) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ /* requested protection bits must match our allowed protection mask */
-+ if (unlikely((vma->vm_flags & ~asma->prot_mask) & PROT_MASK)) {
-+ ret = -EPERM;
-+ goto out;
-+ }
-+
-+ if (!asma->file) {
-+ char *name = ASHMEM_NAME_DEF;
-+ struct file *vmfile;
-+
-+ if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0')
-+ name = asma->name;
-+
-+ /* ... and allocate the backing shmem file */
-+ vmfile = shmem_file_setup(name, asma->size, vma->vm_flags);
-+ if (unlikely(IS_ERR(vmfile))) {
-+ ret = PTR_ERR(vmfile);
-+ goto out;
-+ }
-+ asma->file = vmfile;
-+ }
-+ get_file(asma->file);
-+
-+ /*
-+ * XXX - Reworked to use shmem_zero_setup() instead of
-+ * shmem_set_file while we're in staging. -jstultz
-+ */
-+ if (vma->vm_flags & VM_SHARED) {
-+ ret = shmem_zero_setup(vma);
-+ if (ret) {
-+ fput(asma->file);
-+ goto out;
-+ }
-+ }
-+
-+ if (vma->vm_file)
-+ fput(vma->vm_file);
-+ vma->vm_file = asma->file;
-+ vma->vm_flags |= VM_CAN_NONLINEAR;
-+
-+out:
-+ mutex_unlock(&ashmem_mutex);
-+ return ret;
-+}
-+
-+/*
-+ * ashmem_shrink - our cache shrinker, called from mm/vmscan.c :: shrink_slab
-+ *
-+ * 'nr_to_scan' is the number of objects (pages) to prune, or 0 to query how
-+ * many objects (pages) we have in total.
-+ *
-+ * 'gfp_mask' is the mask of the allocation that got us into this mess.
-+ *
-+ * Return value is the number of objects (pages) remaining, or -1 if we cannot
-+ * proceed without risk of deadlock (due to gfp_mask).
-+ *
-+ * We approximate LRU via least-recently-unpinned, jettisoning unpinned partial
-+ * chunks of ashmem regions LRU-wise one-at-a-time until we hit 'nr_to_scan'
-+ * pages freed.
-+ */
-+static int ashmem_shrink(int nr_to_scan, gfp_t gfp_mask)
-+{
-+ struct ashmem_range *range, *next;
-+
-+ /* We might recurse into filesystem code, so bail out if necessary */
-+ if (nr_to_scan && !(gfp_mask & __GFP_FS))
-+ return -1;
-+ if (!nr_to_scan)
-+ return lru_count;
-+
-+ mutex_lock(&ashmem_mutex);
-+ list_for_each_entry_safe(range, next, &ashmem_lru_list, lru) {
-+ struct inode *inode = range->asma->file->f_dentry->d_inode;
-+ loff_t start = range->pgstart * PAGE_SIZE;
-+ loff_t end = (range->pgend + 1) * PAGE_SIZE - 1;
-+
-+ vmtruncate_range(inode, start, end);
-+ range->purged = ASHMEM_WAS_PURGED;
-+ lru_del(range);
-+
-+ nr_to_scan -= range_size(range);
-+ if (nr_to_scan <= 0)
-+ break;
-+ }
-+ mutex_unlock(&ashmem_mutex);
-+
-+ return lru_count;
-+}
-+
-+static struct shrinker ashmem_shrinker = {
-+ .shrink = ashmem_shrink,
-+ .seeks = DEFAULT_SEEKS * 4,
-+};
-+
-+static int set_prot_mask(struct ashmem_area *asma, unsigned long prot)
-+{
-+ int ret = 0;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ /* the user can only remove, not add, protection bits */
-+ if (unlikely((asma->prot_mask & prot) != prot)) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ /* does the application expect PROT_READ to imply PROT_EXEC? */
-+ if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
-+ prot |= PROT_EXEC;
-+
-+ asma->prot_mask = prot;
-+
-+out:
-+ mutex_unlock(&ashmem_mutex);
-+ return ret;
-+}
-+
-+static int set_name(struct ashmem_area *asma, void __user *name)
-+{
-+ int ret = 0;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ /* cannot change an existing mapping's name */
-+ if (unlikely(asma->file)) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ if (unlikely(copy_from_user(asma->name + ASHMEM_NAME_PREFIX_LEN,
-+ name, ASHMEM_NAME_LEN)))
-+ ret = -EFAULT;
-+ asma->name[ASHMEM_FULL_NAME_LEN-1] = '\0';
-+
-+out:
-+ mutex_unlock(&ashmem_mutex);
-+
-+ return ret;
-+}
-+
-+static int get_name(struct ashmem_area *asma, void __user *name)
-+{
-+ int ret = 0;
-+
-+ mutex_lock(&ashmem_mutex);
-+ if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0') {
-+ size_t len;
-+
-+ /*
-+ * Copying only `len', instead of ASHMEM_NAME_LEN, bytes
-+ * prevents us from revealing one user's stack to another.
-+ */
-+ len = strlen(asma->name + ASHMEM_NAME_PREFIX_LEN) + 1;
-+ if (unlikely(copy_to_user(name,
-+ asma->name + ASHMEM_NAME_PREFIX_LEN, len)))
-+ ret = -EFAULT;
-+ } else {
-+ if (unlikely(copy_to_user(name, ASHMEM_NAME_DEF,
-+ sizeof(ASHMEM_NAME_DEF))))
-+ ret = -EFAULT;
-+ }
-+ mutex_unlock(&ashmem_mutex);
-+
-+ return ret;
-+}
-+
-+/*
-+ * ashmem_pin - pin the given ashmem region, returning whether it was
-+ * previously purged (ASHMEM_WAS_PURGED) or not (ASHMEM_NOT_PURGED).
-+ *
-+ * Caller must hold ashmem_mutex.
-+ */
-+static int ashmem_pin(struct ashmem_area *asma, size_t pgstart, size_t pgend)
-+{
-+ struct ashmem_range *range, *next;
-+ int ret = ASHMEM_NOT_PURGED;
-+
-+ list_for_each_entry_safe(range, next, &asma->unpinned_list, unpinned) {
-+ /* moved past last applicable page; we can short circuit */
-+ if (range_before_page(range, pgstart))
-+ break;
-+
-+ /*
-+ * The user can ask us to pin pages that span multiple ranges,
-+ * or to pin pages that aren't even unpinned, so this is messy.
-+ *
-+ * Four cases:
-+ * 1. The requested range subsumes an existing range, so we
-+ * just remove the entire matching range.
-+ * 2. The requested range overlaps the start of an existing
-+ * range, so we just update that range.
-+ * 3. The requested range overlaps the end of an existing
-+ * range, so we just update that range.
-+ * 4. The requested range punches a hole in an existing range,
-+ * so we have to update one side of the range and then
-+ * create a new range for the other side.
-+ */
-+ if (page_range_in_range(range, pgstart, pgend)) {
-+ ret |= range->purged;
-+
-+ /* Case #1: Easy. Just nuke the whole thing. */
-+ if (page_range_subsumes_range(range, pgstart, pgend)) {
-+ range_del(range);
-+ continue;
-+ }
-+
-+ /* Case #2: We overlap from the start, so adjust it */
-+ if (range->pgstart >= pgstart) {
-+ range_shrink(range, pgend + 1, range->pgend);
-+ continue;
-+ }
-+
-+ /* Case #3: We overlap from the rear, so adjust it */
-+ if (range->pgend <= pgend) {
-+ range_shrink(range, range->pgstart, pgstart-1);
-+ continue;
-+ }
-+
-+ /*
-+ * Case #4: We eat a chunk out of the middle. A bit
-+ * more complicated, we allocate a new range for the
-+ * second half and adjust the first chunk's endpoint.
-+ */
-+ range_alloc(asma, range, range->purged,
-+ pgend + 1, range->pgend);
-+ range_shrink(range, range->pgstart, pgstart - 1);
-+ break;
-+ }
-+ }
-+
-+ return ret;
-+}
-+
-+/*
-+ * ashmem_unpin - unpin the given range of pages. Returns zero on success.
-+ *
-+ * Caller must hold ashmem_mutex.
-+ */
-+static int ashmem_unpin(struct ashmem_area *asma, size_t pgstart, size_t pgend)
-+{
-+ struct ashmem_range *range, *next;
-+ unsigned int purged = ASHMEM_NOT_PURGED;
-+
-+restart:
-+ list_for_each_entry_safe(range, next, &asma->unpinned_list, unpinned) {
-+ /* short circuit: this is our insertion point */
-+ if (range_before_page(range, pgstart))
-+ break;
-+
-+ /*
-+ * The user can ask us to unpin pages that are already entirely
-+ * or partially pinned. We handle those two cases here.
-+ */
-+ if (page_range_subsumed_by_range(range, pgstart, pgend))
-+ return 0;
-+ if (page_range_in_range(range, pgstart, pgend)) {
-+ pgstart = min_t(size_t, range->pgstart, pgstart),
-+ pgend = max_t(size_t, range->pgend, pgend);
-+ purged |= range->purged;
-+ range_del(range);
-+ goto restart;
-+ }
-+ }
-+
-+ return range_alloc(asma, range, purged, pgstart, pgend);
-+}
-+
-+/*
-+ * ashmem_get_pin_status - Returns ASHMEM_IS_UNPINNED if _any_ pages in the
-+ * given interval are unpinned and ASHMEM_IS_PINNED otherwise.
-+ *
-+ * Caller must hold ashmem_mutex.
-+ */
-+static int ashmem_get_pin_status(struct ashmem_area *asma, size_t pgstart,
-+ size_t pgend)
-+{
-+ struct ashmem_range *range;
-+ int ret = ASHMEM_IS_PINNED;
-+
-+ list_for_each_entry(range, &asma->unpinned_list, unpinned) {
-+ if (range_before_page(range, pgstart))
-+ break;
-+ if (page_range_in_range(range, pgstart, pgend)) {
-+ ret = ASHMEM_IS_UNPINNED;
-+ break;
-+ }
-+ }
-+
-+ return ret;
-+}
-+
-+static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
-+ void __user *p)
-+{
-+ struct ashmem_pin pin;
-+ size_t pgstart, pgend;
-+ int ret = -EINVAL;
-+
-+ if (unlikely(!asma->file))
-+ return -EINVAL;
-+
-+ if (unlikely(copy_from_user(&pin, p, sizeof(pin))))
-+ return -EFAULT;
-+
-+ /* per custom, you can pass zero for len to mean "everything onward" */
-+ if (!pin.len)
-+ pin.len = PAGE_ALIGN(asma->size) - pin.offset;
-+
-+ if (unlikely((pin.offset | pin.len) & ~PAGE_MASK))
-+ return -EINVAL;
-+
-+ if (unlikely(((__u32) -1) - pin.offset < pin.len))
-+ return -EINVAL;
-+
-+ if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len))
-+ return -EINVAL;
-+
-+ pgstart = pin.offset / PAGE_SIZE;
-+ pgend = pgstart + (pin.len / PAGE_SIZE) - 1;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ switch (cmd) {
-+ case ASHMEM_PIN:
-+ ret = ashmem_pin(asma, pgstart, pgend);
-+ break;
-+ case ASHMEM_UNPIN:
-+ ret = ashmem_unpin(asma, pgstart, pgend);
-+ break;
-+ case ASHMEM_GET_PIN_STATUS:
-+ ret = ashmem_get_pin_status(asma, pgstart, pgend);
-+ break;
-+ }
-+
-+ mutex_unlock(&ashmem_mutex);
-+
-+ return ret;
-+}
-+
-+static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-+{
-+ struct ashmem_area *asma = file->private_data;
-+ long ret = -ENOTTY;
-+
-+ switch (cmd) {
-+ case ASHMEM_SET_NAME:
-+ ret = set_name(asma, (void __user *) arg);
-+ break;
-+ case ASHMEM_GET_NAME:
-+ ret = get_name(asma, (void __user *) arg);
-+ break;
-+ case ASHMEM_SET_SIZE:
-+ ret = -EINVAL;
-+ if (!asma->file) {
-+ ret = 0;
-+ asma->size = (size_t) arg;
-+ }
-+ break;
-+ case ASHMEM_GET_SIZE:
-+ ret = asma->size;
-+ break;
-+ case ASHMEM_SET_PROT_MASK:
-+ ret = set_prot_mask(asma, arg);
-+ break;
-+ case ASHMEM_GET_PROT_MASK:
-+ ret = asma->prot_mask;
-+ break;
-+ case ASHMEM_PIN:
-+ case ASHMEM_UNPIN:
-+ case ASHMEM_GET_PIN_STATUS:
-+ ret = ashmem_pin_unpin(asma, cmd, (void __user *) arg);
-+ break;
-+ case ASHMEM_PURGE_ALL_CACHES:
-+ ret = -EPERM;
-+ if (capable(CAP_SYS_ADMIN)) {
-+ ret = ashmem_shrink(0, GFP_KERNEL);
-+ ashmem_shrink(ret, GFP_KERNEL);
-+ }
-+ break;
-+ }
-+
-+ return ret;
-+}
-+
-+static struct file_operations ashmem_fops = {
-+ .owner = THIS_MODULE,
-+ .open = ashmem_open,
-+ .release = ashmem_release,
-+ .mmap = ashmem_mmap,
-+ .unlocked_ioctl = ashmem_ioctl,
-+ .compat_ioctl = ashmem_ioctl,
-+};
-+
-+static struct miscdevice ashmem_misc = {
-+ .minor = MISC_DYNAMIC_MINOR,
-+ .name = "ashmem",
-+ .fops = &ashmem_fops,
-+};
-+
-+static int __init ashmem_init(void)
-+{
-+ int ret;
-+
-+ ashmem_area_cachep = kmem_cache_create("ashmem_area_cache",
-+ sizeof(struct ashmem_area),
-+ 0, 0, NULL);
-+ if (unlikely(!ashmem_area_cachep)) {
-+ printk(KERN_ERR "ashmem: failed to create slab cache\n");
-+ return -ENOMEM;
-+ }
-+
-+ ashmem_range_cachep = kmem_cache_create("ashmem_range_cache",
-+ sizeof(struct ashmem_range),
-+ 0, 0, NULL);
-+ if (unlikely(!ashmem_range_cachep)) {
-+ printk(KERN_ERR "ashmem: failed to create slab cache\n");
-+ return -ENOMEM;
-+ }
-+
-+ ret = misc_register(&ashmem_misc);
-+ if (unlikely(ret)) {
-+ printk(KERN_ERR "ashmem: failed to register misc device!\n");
-+ return ret;
-+ }
-+
-+ register_shrinker(&ashmem_shrinker);
-+
-+ printk(KERN_INFO "ashmem: initialized\n");
-+
-+ return 0;
-+}
-+
-+static void __exit ashmem_exit(void)
-+{
-+ int ret;
-+
-+ unregister_shrinker(&ashmem_shrinker);
-+
-+ ret = misc_deregister(&ashmem_misc);
-+ if (unlikely(ret))
-+ printk(KERN_ERR "ashmem: failed to unregister misc device!\n");
-+
-+ kmem_cache_destroy(ashmem_range_cachep);
-+ kmem_cache_destroy(ashmem_area_cachep);
-+
-+ printk(KERN_INFO "ashmem: unloaded\n");
-+}
-+
-+module_init(ashmem_init);
-+module_exit(ashmem_exit);
-+
-+MODULE_LICENSE("GPL");
-diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
-new file mode 100644
-index 0000000..1976b10
---- /dev/null
-+++ b/drivers/staging/android/ashmem.h
-@@ -0,0 +1,48 @@
-+/*
-+ * include/linux/ashmem.h
-+ *
-+ * Copyright 2008 Google Inc.
-+ * Author: Robert Love
-+ *
-+ * This file is dual licensed. It may be redistributed and/or modified
-+ * under the terms of the Apache 2.0 License OR version 2 of the GNU
-+ * General Public License.
-+ */
-+
-+#ifndef _LINUX_ASHMEM_H
-+#define _LINUX_ASHMEM_H
-+
-+#include <linux/limits.h>
-+#include <linux/ioctl.h>
-+
-+#define ASHMEM_NAME_LEN 256
-+
-+#define ASHMEM_NAME_DEF "dev/ashmem"
-+
-+/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */
-+#define ASHMEM_NOT_PURGED 0
-+#define ASHMEM_WAS_PURGED 1
-+
-+/* Return values from ASHMEM_GET_PIN_STATUS: Is the mapping pinned? */
-+#define ASHMEM_IS_UNPINNED 0
-+#define ASHMEM_IS_PINNED 1
-+
-+struct ashmem_pin {
-+ __u32 offset; /* offset into region, in bytes, page-aligned */
-+ __u32 len; /* length forward from offset, in bytes, page-aligned */
-+};
-+
-+#define __ASHMEMIOC 0x77
-+
-+#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
-+#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
-+#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
-+#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
-+#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
-+#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
-+#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
-+#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
-+#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
-+#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
-+
-+#endif /* _LINUX_ASHMEM_H */
diff --git a/patches.android/android-0028-ashmem-Implement-read-2-in-ashmem-driver.patch b/patches.android/android-0028-ashmem-Implement-read-2-in-ashmem-driver.patch
deleted file mode 100644
index 0fb2f666019e0d..00000000000000
--- a/patches.android/android-0028-ashmem-Implement-read-2-in-ashmem-driver.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 853ca7ae292f9c4809e1e42914e81453eaa15367 Mon Sep 17 00:00:00 2001
-From: Bjorn Bringert <bringert@android.com>
-Date: Tue, 20 Dec 2011 16:49:49 -0800
-Subject: ashmem: Implement read(2) in ashmem driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 853ca7ae292f9c4809e1e42914e81453eaa15367
-
-Signed-off-by: Bjorn Bringert <bringert@android.com>
-[jstultz: Tweaked commit subject]
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 5775c6c..6f1a0bb 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -211,6 +211,32 @@ static int ashmem_release(struct inode *ignored, struct file *file)
- return 0;
- }
-
-+static ssize_t ashmem_read(struct file *file, char __user *buf,
-+ size_t len, loff_t *pos)
-+{
-+ struct ashmem_area *asma = file->private_data;
-+ int ret = 0;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ /* If size is not set, or set to 0, always return EOF. */
-+ if (asma->size == 0) {
-+ goto out;
-+ }
-+
-+ if (!asma->file) {
-+ ret = -EBADF;
-+ goto out;
-+ }
-+
-+ ret = asma->file->f_op->read(asma->file, buf, len, pos);
-+
-+out:
-+ mutex_unlock(&ashmem_mutex);
-+ return ret;
-+}
-+
-+
- static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
- {
- struct ashmem_area *asma = file->private_data;
-@@ -612,6 +638,7 @@ static struct file_operations ashmem_fops = {
- .owner = THIS_MODULE,
- .open = ashmem_open,
- .release = ashmem_release,
-+ .read = ashmem_read,
- .mmap = ashmem_mmap,
- .unlocked_ioctl = ashmem_ioctl,
- .compat_ioctl = ashmem_ioctl,
diff --git a/patches.android/android-0029-ashmem-Fix-ASHMEM_SET_PROT_MASK.patch b/patches.android/android-0029-ashmem-Fix-ASHMEM_SET_PROT_MASK.patch
deleted file mode 100644
index d5b5e96f96fe96..00000000000000
--- a/patches.android/android-0029-ashmem-Fix-ASHMEM_SET_PROT_MASK.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 56f76fc68492af718fff88927bc296635d634b78 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Tue, 20 Dec 2011 16:49:50 -0800
-Subject: ashmem: Fix ASHMEM_SET_PROT_MASK.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 56f76fc68492af718fff88927bc296635d634b78
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 6f1a0bb..0b923b0 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -236,6 +236,13 @@ out:
- return ret;
- }
-
-+static inline unsigned long
-+calc_vm_may_flags(unsigned long prot)
-+{
-+ return _calc_vm_trans(prot, PROT_READ, VM_MAYREAD ) |
-+ _calc_vm_trans(prot, PROT_WRITE, VM_MAYWRITE) |
-+ _calc_vm_trans(prot, PROT_EXEC, VM_MAYEXEC);
-+}
-
- static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
- {
-@@ -251,10 +258,12 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
- }
-
- /* requested protection bits must match our allowed protection mask */
-- if (unlikely((vma->vm_flags & ~asma->prot_mask) & PROT_MASK)) {
-+ if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) &
-+ calc_vm_prot_bits(PROT_MASK))) {
- ret = -EPERM;
- goto out;
- }
-+ vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
-
- if (!asma->file) {
- char *name = ASHMEM_NAME_DEF;
diff --git a/patches.android/android-0030-ashmem-Update-arguments-of-shrinker-for-2.6.35.patch b/patches.android/android-0030-ashmem-Update-arguments-of-shrinker-for-2.6.35.patch
deleted file mode 100644
index 2bab0eb486f288..00000000000000
--- a/patches.android/android-0030-ashmem-Update-arguments-of-shrinker-for-2.6.35.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 1d3f8f2da1c28709a3c494f3872b89c871906b2d Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@google.com>
-Date: Tue, 20 Dec 2011 16:49:51 -0800
-Subject: ashmem: Update arguments of shrinker for 2.6.35
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 1d3f8f2da1c28709a3c494f3872b89c871906b2d
-
-Signed-off-by: Colin Cross <ccross@google.com>
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 0b923b0..40c3dc8 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -319,7 +319,7 @@ out:
- * chunks of ashmem regions LRU-wise one-at-a-time until we hit 'nr_to_scan'
- * pages freed.
- */
--static int ashmem_shrink(int nr_to_scan, gfp_t gfp_mask)
-+static int ashmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- {
- struct ashmem_range *range, *next;
-
-@@ -634,8 +634,8 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- case ASHMEM_PURGE_ALL_CACHES:
- ret = -EPERM;
- if (capable(CAP_SYS_ADMIN)) {
-- ret = ashmem_shrink(0, GFP_KERNEL);
-- ashmem_shrink(ret, GFP_KERNEL);
-+ ret = ashmem_shrink(&ashmem_shrinker, 0, GFP_KERNEL);
-+ ashmem_shrink(&ashmem_shrinker, ret, GFP_KERNEL);
- }
- break;
- }
diff --git a/patches.android/android-0031-ashmem-Support-lseek-2-in-ashmem-driver.patch b/patches.android/android-0031-ashmem-Support-lseek-2-in-ashmem-driver.patch
deleted file mode 100644
index 024b4ad954a555..00000000000000
--- a/patches.android/android-0031-ashmem-Support-lseek-2-in-ashmem-driver.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 5154b93b8eceb57bdab4e77030bf21ead15b42e4 Mon Sep 17 00:00:00 2001
-From: Bjorn Bringert <bringert@android.com>
-Date: Tue, 20 Dec 2011 16:49:52 -0800
-Subject: ashmem: Support lseek(2) in ashmem driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 5154b93b8eceb57bdab4e77030bf21ead15b42e4
-
-Signed-off-by: Bjorn Bringert <bringert@android.com>
-[jstultz: tweaked commit subject]
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 40c3dc8..777e2b2 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -178,7 +178,7 @@ static int ashmem_open(struct inode *inode, struct file *file)
- struct ashmem_area *asma;
- int ret;
-
-- ret = nonseekable_open(inode, file);
-+ ret = generic_file_open(inode, file);
- if (unlikely(ret))
- return ret;
-
-@@ -230,6 +230,42 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
- }
-
- ret = asma->file->f_op->read(asma->file, buf, len, pos);
-+ if (ret < 0) {
-+ goto out;
-+ }
-+
-+ /** Update backing file pos, since f_ops->read() doesn't */
-+ asma->file->f_pos = *pos;
-+
-+out:
-+ mutex_unlock(&ashmem_mutex);
-+ return ret;
-+}
-+
-+static loff_t ashmem_llseek(struct file *file, loff_t offset, int origin)
-+{
-+ struct ashmem_area *asma = file->private_data;
-+ int ret;
-+
-+ mutex_lock(&ashmem_mutex);
-+
-+ if (asma->size == 0) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ if (!asma->file) {
-+ ret = -EBADF;
-+ goto out;
-+ }
-+
-+ ret = asma->file->f_op->llseek(asma->file, offset, origin);
-+ if (ret < 0) {
-+ goto out;
-+ }
-+
-+ /** Copy f_pos from backing file, since f_ops->llseek() sets it */
-+ file->f_pos = asma->file->f_pos;
-
- out:
- mutex_unlock(&ashmem_mutex);
-@@ -648,6 +684,7 @@ static struct file_operations ashmem_fops = {
- .open = ashmem_open,
- .release = ashmem_release,
- .read = ashmem_read,
-+ .llseek = ashmem_llseek,
- .mmap = ashmem_mmap,
- .unlocked_ioctl = ashmem_ioctl,
- .compat_ioctl = ashmem_ioctl,
diff --git a/patches.android/android-0032-ashmem-Fix-arguments-to-ashmem_shrink.patch b/patches.android/android-0032-ashmem-Fix-arguments-to-ashmem_shrink.patch
deleted file mode 100644
index 2403d5d4505214..00000000000000
--- a/patches.android/android-0032-ashmem-Fix-arguments-to-ashmem_shrink.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 33e8fc463eeec29227282e4bd2082f5928d629a5 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Tue, 20 Dec 2011 16:49:53 -0800
-Subject: ashmem: Fix arguments to ashmem_shrink
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 33e8fc463eeec29227282e4bd2082f5928d629a5
-
-The arguments to shrink functions have changed, update
-ashmem_shrink to match.
-
-Signed-off-by: Colin Cross <ccross@android.com>
-[jstultz: tweaked commit subject]
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 777e2b2..a78ba21 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -355,14 +355,14 @@ out:
- * chunks of ashmem regions LRU-wise one-at-a-time until we hit 'nr_to_scan'
- * pages freed.
- */
--static int ashmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
-+static int ashmem_shrink(struct shrinker *s, struct shrink_control *sc)
- {
- struct ashmem_range *range, *next;
-
- /* We might recurse into filesystem code, so bail out if necessary */
-- if (nr_to_scan && !(gfp_mask & __GFP_FS))
-+ if (sc->nr_to_scan && !(sc->gfp_mask & __GFP_FS))
- return -1;
-- if (!nr_to_scan)
-+ if (!sc->nr_to_scan)
- return lru_count;
-
- mutex_lock(&ashmem_mutex);
-@@ -375,8 +375,8 @@ static int ashmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
- range->purged = ASHMEM_WAS_PURGED;
- lru_del(range);
-
-- nr_to_scan -= range_size(range);
-- if (nr_to_scan <= 0)
-+ sc->nr_to_scan -= range_size(range);
-+ if (sc->nr_to_scan <= 0)
- break;
- }
- mutex_unlock(&ashmem_mutex);
-@@ -670,8 +670,13 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- case ASHMEM_PURGE_ALL_CACHES:
- ret = -EPERM;
- if (capable(CAP_SYS_ADMIN)) {
-- ret = ashmem_shrink(&ashmem_shrinker, 0, GFP_KERNEL);
-- ashmem_shrink(&ashmem_shrinker, ret, GFP_KERNEL);
-+ struct shrink_control sc = {
-+ .gfp_mask = GFP_KERNEL,
-+ .nr_to_scan = 0,
-+ };
-+ ret = ashmem_shrink(&ashmem_shrinker, &sc);
-+ sc.nr_to_scan = ret;
-+ ashmem_shrink(&ashmem_shrinker, &sc);
- }
- break;
- }
diff --git a/patches.android/android-0033-ashmem-Whitespace-cleanups.patch b/patches.android/android-0033-ashmem-Whitespace-cleanups.patch
deleted file mode 100644
index 37b2a421710d19..00000000000000
--- a/patches.android/android-0033-ashmem-Whitespace-cleanups.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From 1efb34394a694b458d66f25072318c375e22afe2 Mon Sep 17 00:00:00 2001
-From: John Stultz <john.stultz@linaro.org>
-Date: Tue, 20 Dec 2011 16:49:54 -0800
-Subject: ashmem: Whitespace cleanups
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 1efb34394a694b458d66f25072318c375e22afe2
-
-Fixes checkpatch warnings with the ashmem.c file
-
-CC: Brian Swetland <swetland@google.com>
-CC: Colin Cross <ccross@android.com>
-CC: Arve Hjønnevåg <arve@android.com>
-CC: Dima Zavin <dima@android.com>
-CC: Robert Love <rlove@google.com>
-Signed-off-by: John Stultz <john.stultz@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index a78ba21..99052bf 100644
---- a/drivers/staging/android/ashmem.c
-+++ b/drivers/staging/android/ashmem.c
-@@ -41,11 +41,11 @@
- * Big Note: Mappings do NOT pin this structure; it dies on close()
- */
- struct ashmem_area {
-- char name[ASHMEM_FULL_NAME_LEN];/* optional name for /proc/pid/maps */
-- struct list_head unpinned_list; /* list of all ashmem areas */
-- struct file *file; /* the shmem-based backing file */
-- size_t size; /* size of the mapping, in bytes */
-- unsigned long prot_mask; /* allowed prot bits, as vm_flags */
-+ char name[ASHMEM_FULL_NAME_LEN]; /* optional name in /proc/pid/maps */
-+ struct list_head unpinned_list; /* list of all ashmem areas */
-+ struct file *file; /* the shmem-based backing file */
-+ size_t size; /* size of the mapping, in bytes */
-+ unsigned long prot_mask; /* allowed prot bits, as vm_flags */
- };
-
- /*
-@@ -79,26 +79,26 @@ static struct kmem_cache *ashmem_area_cachep __read_mostly;
- static struct kmem_cache *ashmem_range_cachep __read_mostly;
-
- #define range_size(range) \
-- ((range)->pgend - (range)->pgstart + 1)
-+ ((range)->pgend - (range)->pgstart + 1)
-
- #define range_on_lru(range) \
-- ((range)->purged == ASHMEM_NOT_PURGED)
-+ ((range)->purged == ASHMEM_NOT_PURGED)
-
- #define page_range_subsumes_range(range, start, end) \
-- (((range)->pgstart >= (start)) && ((range)->pgend <= (end)))
-+ (((range)->pgstart >= (start)) && ((range)->pgend <= (end)))
-
- #define page_range_subsumed_by_range(range, start, end) \
-- (((range)->pgstart <= (start)) && ((range)->pgend >= (end)))
-+ (((range)->pgstart <= (start)) && ((range)->pgend >= (end)))
-
- #define page_in_range(range, page) \
-- (((range)->pgstart <= (page)) && ((range)->pgend >= (page)))
-+ (((range)->pgstart <= (page)) && ((range)->pgend >= (page)))
-
- #define page_range_in_range(range, start, end) \
-- (page_in_range(range, start) || page_in_range(range, end) || \
-- page_range_subsumes_range(range, start, end))
-+ (page_in_range(range, start) || page_in_range(range, end) || \
-+ page_range_subsumes_range(range, start, end))
-
- #define range_before_page(range, page) \
-- ((range)->pgend < (page))
-+ ((range)->pgend < (page))
-
- #define PROT_MASK (PROT_EXEC | PROT_READ | PROT_WRITE)
-
-@@ -220,9 +220,8 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
- mutex_lock(&ashmem_mutex);
-
- /* If size is not set, or set to 0, always return EOF. */
-- if (asma->size == 0) {
-+ if (asma->size == 0)
- goto out;
-- }
-
- if (!asma->file) {
- ret = -EBADF;
-@@ -230,9 +229,8 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
- }
-
- ret = asma->file->f_op->read(asma->file, buf, len, pos);
-- if (ret < 0) {
-+ if (ret < 0)
- goto out;
-- }
-
- /** Update backing file pos, since f_ops->read() doesn't */
- asma->file->f_pos = *pos;
-@@ -260,9 +258,8 @@ static loff_t ashmem_llseek(struct file *file, loff_t offset, int origin)
- }
-
- ret = asma->file->f_op->llseek(asma->file, offset, origin);
-- if (ret < 0) {
-+ if (ret < 0)
- goto out;
-- }
-
- /** Copy f_pos from backing file, since f_ops->llseek() sets it */
- file->f_pos = asma->file->f_pos;
-@@ -272,10 +269,9 @@ out:
- return ret;
- }
-
--static inline unsigned long
--calc_vm_may_flags(unsigned long prot)
-+static inline unsigned long calc_vm_may_flags(unsigned long prot)
- {
-- return _calc_vm_trans(prot, PROT_READ, VM_MAYREAD ) |
-+ return _calc_vm_trans(prot, PROT_READ, VM_MAYREAD) |
- _calc_vm_trans(prot, PROT_WRITE, VM_MAYWRITE) |
- _calc_vm_trans(prot, PROT_EXEC, VM_MAYEXEC);
- }
-@@ -295,7 +291,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
-
- /* requested protection bits must match our allowed protection mask */
- if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) &
-- calc_vm_prot_bits(PROT_MASK))) {
-+ calc_vm_prot_bits(PROT_MASK))) {
- ret = -EPERM;
- goto out;
- }
-@@ -688,8 +684,8 @@ static struct file_operations ashmem_fops = {
- .owner = THIS_MODULE,
- .open = ashmem_open,
- .release = ashmem_release,
-- .read = ashmem_read,
-- .llseek = ashmem_llseek,
-+ .read = ashmem_read,
-+ .llseek = ashmem_llseek,
- .mmap = ashmem_mmap,
- .unlocked_ioctl = ashmem_ioctl,
- .compat_ioctl = ashmem_ioctl,
diff --git a/patches.android/android-0034-Staging-android-fixed-a-space-warning-in-binder.h.patch b/patches.android/android-0034-Staging-android-fixed-a-space-warning-in-binder.h.patch
deleted file mode 100644
index 35c9eefb7875d0..00000000000000
--- a/patches.android/android-0034-Staging-android-fixed-a-space-warning-in-binder.h.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 29b858471b266be7e56b69cfcee7ba94d9427dd3 Mon Sep 17 00:00:00 2001
-From: Marco Navarra <fromenglish@gmail.com>
-Date: Thu, 22 Dec 2011 13:27:07 +0100
-Subject: Staging: android: fixed a space warning in binder.h
-Patch-mainline: HEAD
-Git-commit: 29b858471b266be7e56b69cfcee7ba94d9427dd3
-
-This patch fixes a simple tab-space warning in binder.h found by checkpatch tool
-
-Signed-off-by: Marco Navarra <fromenglish@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
-index 863ae1a..25ab6f2 100644
---- a/drivers/staging/android/binder.h
-+++ b/drivers/staging/android/binder.h
-@@ -84,7 +84,7 @@ struct binder_version {
- /* This is the current protocol version. */
- #define BINDER_CURRENT_PROTOCOL_VERSION 7
-
--#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
-+#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
- #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, int64_t)
- #define BINDER_SET_MAX_THREADS _IOW('b', 5, size_t)
- #define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, int)
diff --git a/patches.android/android-0035-Staging-android-fixed-80-characters-warnings-in-lowmemorykil.patch b/patches.android/android-0035-Staging-android-fixed-80-characters-warnings-in-lowmemorykil.patch
deleted file mode 100644
index 1e595ca4516c7b..00000000000000
--- a/patches.android/android-0035-Staging-android-fixed-80-characters-warnings-in-lowmemorykil.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 3bf5d65f4324510231cf33e5d75654f4fb1d1892 Mon Sep 17 00:00:00 2001
-From: Marco Navarra <fromenglish@gmail.com>
-Date: Thu, 22 Dec 2011 13:28:23 +0100
-Subject: Staging: android: fixed 80 characters warnings in
- lowmemorykiller.c
-Patch-mainline: HEAD
-Git-commit: 3bf5d65f4324510231cf33e5d75654f4fb1d1892
-
-This patch fixes some 80 chatacters limit warnings in the lowmemorykiller.c file
-
-Signed-off-by: Marco Navarra <fromenglish@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 4098bbb..2d8d2b7 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -7,10 +7,10 @@
- * files take a comma separated list of numbers in ascending order.
- *
- * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and
-- * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill processes
-- * with a oom_adj value of 8 or higher when the free memory drops below 4096 pages
-- * and kill processes with a oom_adj value of 0 or higher when the free memory
-- * drops below 1024 pages.
-+ * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill
-+ * processes with a oom_adj value of 8 or higher when the free memory drops
-+ * below 4096 pages and kill processes with a oom_adj value of 0 or higher
-+ * when the free memory drops below 1024 pages.
- *
- * The driver considers memory used for caches to be free, but if a large
- * percentage of the cached memory is locked this can be very inaccurate
-@@ -119,8 +119,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
- }
- if (sc->nr_to_scan > 0)
- lowmem_print(3, "lowmem_shrink %lu, %x, ofree %d %d, ma %d\n",
-- sc->nr_to_scan, sc->gfp_mask, other_free, other_file,
-- min_adj);
-+ sc->nr_to_scan, sc->gfp_mask, other_free,
-+ other_file, min_adj);
- rem = global_page_state(NR_ACTIVE_ANON) +
- global_page_state(NR_ACTIVE_FILE) +
- global_page_state(NR_INACTIVE_ANON) +
diff --git a/patches.android/android-0036-Staging-android-binder-Don-t-call-dump_stack-in-binder_vma_o.patch b/patches.android/android-0036-Staging-android-binder-Don-t-call-dump_stack-in-binder_vma_o.patch
deleted file mode 100644
index 376f336fad16b2..00000000000000
--- a/patches.android/android-0036-Staging-android-binder-Don-t-call-dump_stack-in-binder_vma_o.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 3c1b86f17068cf6476fb2d022b9c8b44dedea2e5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Fri, 20 Jan 2012 19:56:21 -0800
-Subject: Staging: android: binder: Don't call dump_stack in
- binder_vma_open
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: 3c1b86f17068cf6476fb2d022b9c8b44dedea2e5
-
-If user-space partially unmaps the driver, binder_vma_open
-would dump the kernel stack. This is not a kernel bug however
-and will be treated as if the whole area was unmapped once
-binder_vma_close gets called.
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Cc: stable <stable@vger.kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 7491801..48cf27c 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -2759,7 +2759,6 @@ static void binder_vma_open(struct vm_area_struct *vma)
- proc->pid, vma->vm_start, vma->vm_end,
- (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
- (unsigned long)pgprot_val(vma->vm_page_prot));
-- dump_stack();
- }
-
- static void binder_vma_close(struct vm_area_struct *vma)
diff --git a/patches.android/android-0037-Staging-android-Remove-pmem-driver.patch b/patches.android/android-0037-Staging-android-Remove-pmem-driver.patch
deleted file mode 100644
index 6c4e119fbafeec..00000000000000
--- a/patches.android/android-0037-Staging-android-Remove-pmem-driver.patch
+++ /dev/null
@@ -1,1490 +0,0 @@
-From b0d017e80e9f4e6b37e699b9a944646e64deb473 Mon Sep 17 00:00:00 2001
-From: Shuah Khan <shuahkhan@gmail.com>
-Date: Fri, 27 Jan 2012 11:40:10 -0700
-Subject: Staging: android: Remove pmem driver
-Patch-mainline: HEAD
-Git-commit: b0d017e80e9f4e6b37e699b9a944646e64deb473
-
-Addroid pmem driver is no longer used in any of the Android products.
-This patch removes pmem driver from Android staging area
-
-Reference: https://lkml.org/lkml/2012/1/23/183
-
-Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index becf711..94cb2ac 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -99,10 +99,6 @@ config ANDROID_LOW_MEMORY_KILLER
- ---help---
- Register processes to be killed when memory is low
-
--config ANDROID_PMEM
-- bool "Android pmem allocator"
-- depends on ARM
--
- source "drivers/staging/android/switch/Kconfig"
-
- endif # if ANDROID
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-index eaed1ff..5fcc24f 100644
---- a/drivers/staging/android/Makefile
-+++ b/drivers/staging/android/Makefile
-@@ -5,5 +5,4 @@ obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
- obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
- obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
- obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
--obj-$(CONFIG_ANDROID_PMEM) += pmem.o
- obj-$(CONFIG_ANDROID_SWITCH) += switch/
-diff --git a/drivers/staging/android/android_pmem.h b/drivers/staging/android/android_pmem.h
-deleted file mode 100644
-index f633621..0000000
---- a/drivers/staging/android/android_pmem.h
-+++ /dev/null
-@@ -1,93 +0,0 @@
--/* include/linux/android_pmem.h
-- *
-- * Copyright (C) 2007 Google, Inc.
-- *
-- * This software is licensed under the terms of the GNU General Public
-- * License version 2, as published by the Free Software Foundation, and
-- * may be copied, distributed, and modified under those terms.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- */
--
--#ifndef _ANDROID_PMEM_H_
--#define _ANDROID_PMEM_H_
--
--#define PMEM_IOCTL_MAGIC 'p'
--#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, unsigned int)
--#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, unsigned int)
--#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, unsigned int)
--#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, unsigned int)
--/* This ioctl will allocate pmem space, backing the file, it will fail
-- * if the file already has an allocation, pass it the len as the argument
-- * to the ioctl */
--#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
--/* This will connect a one pmem file to another, pass the file that is already
-- * backed in memory as the argument to the ioctl
-- */
--#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
--/* Returns the total size of the pmem region it is sent to as a pmem_region
-- * struct (with offset set to 0).
-- */
--#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
--#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
--
--struct android_pmem_platform_data
--{
-- const char* name;
-- /* starting physical address of memory region */
-- unsigned long start;
-- /* size of memory region */
-- unsigned long size;
-- /* set to indicate the region should not be managed with an allocator */
-- unsigned no_allocator;
-- /* set to indicate maps of this region should be cached, if a mix of
-- * cached and uncached is desired, set this and open the device with
-- * O_SYNC to get an uncached region */
-- unsigned cached;
-- /* The MSM7k has bits to enable a write buffer in the bus controller*/
-- unsigned buffered;
--};
--
--struct pmem_region {
-- unsigned long offset;
-- unsigned long len;
--};
--
--#ifdef CONFIG_ANDROID_PMEM
--int is_pmem_file(struct file *file);
--int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
-- unsigned long *end, struct file **filp);
--int get_pmem_user_addr(struct file *file, unsigned long *start,
-- unsigned long *end);
--void put_pmem_file(struct file* file);
--void flush_pmem_file(struct file *file, unsigned long start, unsigned long len);
--int pmem_setup(struct android_pmem_platform_data *pdata,
-- long (*ioctl)(struct file *, unsigned int, unsigned long),
-- int (*release)(struct inode *, struct file *));
--int pmem_remap(struct pmem_region *region, struct file *file,
-- unsigned operation);
--
--#else
--static inline int is_pmem_file(struct file *file) { return 0; }
--static inline int get_pmem_file(int fd, unsigned long *start,
-- unsigned long *vstart, unsigned long *end,
-- struct file **filp) { return -ENOSYS; }
--static inline int get_pmem_user_addr(struct file *file, unsigned long *start,
-- unsigned long *end) { return -ENOSYS; }
--static inline void put_pmem_file(struct file* file) { return; }
--static inline void flush_pmem_file(struct file *file, unsigned long start,
-- unsigned long len) { return; }
--static inline int pmem_setup(struct android_pmem_platform_data *pdata,
-- long (*ioctl)(struct file *, unsigned int, unsigned long),
-- int (*release)(struct inode *, struct file *)) { return -ENOSYS; }
--
--static inline int pmem_remap(struct pmem_region *region, struct file *file,
-- unsigned operation) { return -ENOSYS; }
--#endif
--
--#endif //_ANDROID_PPP_H_
--
-diff --git a/drivers/staging/android/pmem.c b/drivers/staging/android/pmem.c
-deleted file mode 100644
-index 7d97032..0000000
---- a/drivers/staging/android/pmem.c
-+++ /dev/null
-@@ -1,1345 +0,0 @@
--/* pmem.c
-- *
-- * Copyright (C) 2007 Google, Inc.
-- *
-- * This software is licensed under the terms of the GNU General Public
-- * License version 2, as published by the Free Software Foundation, and
-- * may be copied, distributed, and modified under those terms.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- */
--
--#include <linux/miscdevice.h>
--#include <linux/platform_device.h>
--#include <linux/fs.h>
--#include <linux/file.h>
--#include <linux/mm.h>
--#include <linux/list.h>
--#include <linux/mutex.h>
--#include <linux/debugfs.h>
--#include <linux/mempolicy.h>
--#include <linux/sched.h>
--#include <asm/io.h>
--#include <asm/uaccess.h>
--#include <asm/cacheflush.h>
--#include "android_pmem.h"
--
--#define PMEM_MAX_DEVICES 10
--#define PMEM_MAX_ORDER 128
--#define PMEM_MIN_ALLOC PAGE_SIZE
--
--#define PMEM_DEBUG 1
--
--/* indicates that a refernce to this file has been taken via get_pmem_file,
-- * the file should not be released until put_pmem_file is called */
--#define PMEM_FLAGS_BUSY 0x1
--/* indicates that this is a suballocation of a larger master range */
--#define PMEM_FLAGS_CONNECTED 0x1 << 1
--/* indicates this is a master and not a sub allocation and that it is mmaped */
--#define PMEM_FLAGS_MASTERMAP 0x1 << 2
--/* submap and unsubmap flags indicate:
-- * 00: subregion has never been mmaped
-- * 10: subregion has been mmaped, reference to the mm was taken
-- * 11: subretion has ben released, refernece to the mm still held
-- * 01: subretion has been released, reference to the mm has been released
-- */
--#define PMEM_FLAGS_SUBMAP 0x1 << 3
--#define PMEM_FLAGS_UNSUBMAP 0x1 << 4
--
--
--struct pmem_data {
-- /* in alloc mode: an index into the bitmap
-- * in no_alloc mode: the size of the allocation */
-- int index;
-- /* see flags above for descriptions */
-- unsigned int flags;
-- /* protects this data field, if the mm_mmap sem will be held at the
-- * same time as this sem, the mm sem must be taken first (as this is
-- * the order for vma_open and vma_close ops */
-- struct rw_semaphore sem;
-- /* info about the mmaping process */
-- struct vm_area_struct *vma;
-- /* task struct of the mapping process */
-- struct task_struct *task;
-- /* process id of teh mapping process */
-- pid_t pid;
-- /* file descriptor of the master */
-- int master_fd;
-- /* file struct of the master */
-- struct file *master_file;
-- /* a list of currently available regions if this is a suballocation */
-- struct list_head region_list;
-- /* a linked list of data so we can access them for debugging */
-- struct list_head list;
--#if PMEM_DEBUG
-- int ref;
--#endif
--};
--
--struct pmem_bits {
-- unsigned allocated:1; /* 1 if allocated, 0 if free */
-- unsigned order:7; /* size of the region in pmem space */
--};
--
--struct pmem_region_node {
-- struct pmem_region region;
-- struct list_head list;
--};
--
--#define PMEM_DEBUG_MSGS 0
--#if PMEM_DEBUG_MSGS
--#define DLOG(fmt,args...) \
-- do { printk(KERN_INFO "[%s:%s:%d] "fmt, __FILE__, __func__, __LINE__, \
-- ##args); } \
-- while (0)
--#else
--#define DLOG(x...) do {} while (0)
--#endif
--
--struct pmem_info {
-- struct miscdevice dev;
-- /* physical start address of the remaped pmem space */
-- unsigned long base;
-- /* vitual start address of the remaped pmem space */
-- unsigned char __iomem *vbase;
-- /* total size of the pmem space */
-- unsigned long size;
-- /* number of entries in the pmem space */
-- unsigned long num_entries;
-- /* pfn of the garbage page in memory */
-- unsigned long garbage_pfn;
-- /* index of the garbage page in the pmem space */
-- int garbage_index;
-- /* the bitmap for the region indicating which entries are allocated
-- * and which are free */
-- struct pmem_bits *bitmap;
-- /* indicates the region should not be managed with an allocator */
-- unsigned no_allocator;
-- /* indicates maps of this region should be cached, if a mix of
-- * cached and uncached is desired, set this and open the device with
-- * O_SYNC to get an uncached region */
-- unsigned cached;
-- unsigned buffered;
-- /* in no_allocator mode the first mapper gets the whole space and sets
-- * this flag */
-- unsigned allocated;
-- /* for debugging, creates a list of pmem file structs, the
-- * data_list_lock should be taken before pmem_data->sem if both are
-- * needed */
-- struct mutex data_list_lock;
-- struct list_head data_list;
-- /* pmem_sem protects the bitmap array
-- * a write lock should be held when modifying entries in bitmap
-- * a read lock should be held when reading data from bits or
-- * dereferencing a pointer into bitmap
-- *
-- * pmem_data->sem protects the pmem data of a particular file
-- * Many of the function that require the pmem_data->sem have a non-
-- * locking version for when the caller is already holding that sem.
-- *
-- * IF YOU TAKE BOTH LOCKS TAKE THEM IN THIS ORDER:
-- * down(pmem_data->sem) => down(bitmap_sem)
-- */
-- struct rw_semaphore bitmap_sem;
--
-- long (*ioctl)(struct file *, unsigned int, unsigned long);
-- int (*release)(struct inode *, struct file *);
--};
--
--static struct pmem_info pmem[PMEM_MAX_DEVICES];
--static int id_count;
--
--#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
--#define PMEM_ORDER(id, index) pmem[id].bitmap[index].order
--#define PMEM_BUDDY_INDEX(id, index) (index ^ (1 << PMEM_ORDER(id, index)))
--#define PMEM_NEXT_INDEX(id, index) (index + (1 << PMEM_ORDER(id, index)))
--#define PMEM_OFFSET(index) (index * PMEM_MIN_ALLOC)
--#define PMEM_START_ADDR(id, index) (PMEM_OFFSET(index) + pmem[id].base)
--#define PMEM_LEN(id, index) ((1 << PMEM_ORDER(id, index)) * PMEM_MIN_ALLOC)
--#define PMEM_END_ADDR(id, index) (PMEM_START_ADDR(id, index) + \
-- PMEM_LEN(id, index))
--#define PMEM_START_VADDR(id, index) (PMEM_OFFSET(id, index) + pmem[id].vbase)
--#define PMEM_END_VADDR(id, index) (PMEM_START_VADDR(id, index) + \
-- PMEM_LEN(id, index))
--#define PMEM_REVOKED(data) (data->flags & PMEM_FLAGS_REVOKED)
--#define PMEM_IS_PAGE_ALIGNED(addr) (!((addr) & (~PAGE_MASK)))
--#define PMEM_IS_SUBMAP(data) ((data->flags & PMEM_FLAGS_SUBMAP) && \
-- (!(data->flags & PMEM_FLAGS_UNSUBMAP)))
--
--static int pmem_release(struct inode *, struct file *);
--static int pmem_mmap(struct file *, struct vm_area_struct *);
--static int pmem_open(struct inode *, struct file *);
--static long pmem_ioctl(struct file *, unsigned int, unsigned long);
--
--struct file_operations pmem_fops = {
-- .release = pmem_release,
-- .mmap = pmem_mmap,
-- .open = pmem_open,
-- .unlocked_ioctl = pmem_ioctl,
--};
--
--static int get_id(struct file *file)
--{
-- return MINOR(file->f_dentry->d_inode->i_rdev);
--}
--
--int is_pmem_file(struct file *file)
--{
-- int id;
--
-- if (unlikely(!file || !file->f_dentry || !file->f_dentry->d_inode))
-- return 0;
-- id = get_id(file);
-- if (unlikely(id >= PMEM_MAX_DEVICES))
-- return 0;
-- if (unlikely(file->f_dentry->d_inode->i_rdev !=
-- MKDEV(MISC_MAJOR, pmem[id].dev.minor)))
-- return 0;
-- return 1;
--}
--
--static int has_allocation(struct file *file)
--{
-- struct pmem_data *data;
-- /* check is_pmem_file first if not accessed via pmem_file_ops */
--
-- if (unlikely(!file->private_data))
-- return 0;
-- data = (struct pmem_data *)file->private_data;
-- if (unlikely(data->index < 0))
-- return 0;
-- return 1;
--}
--
--static int is_master_owner(struct file *file)
--{
-- struct file *master_file;
-- struct pmem_data *data;
-- int put_needed, ret = 0;
--
-- if (!is_pmem_file(file) || !has_allocation(file))
-- return 0;
-- data = (struct pmem_data *)file->private_data;
-- if (PMEM_FLAGS_MASTERMAP & data->flags)
-- return 1;
-- master_file = fget_light(data->master_fd, &put_needed);
-- if (master_file && data->master_file == master_file)
-- ret = 1;
-- fput_light(master_file, put_needed);
-- return ret;
--}
--
--static int pmem_free(int id, int index)
--{
-- /* caller should hold the write lock on pmem_sem! */
-- int buddy, curr = index;
-- DLOG("index %d\n", index);
--
-- if (pmem[id].no_allocator) {
-- pmem[id].allocated = 0;
-- return 0;
-- }
-- /* clean up the bitmap, merging any buddies */
-- pmem[id].bitmap[curr].allocated = 0;
-- /* find a slots buddy Buddy# = Slot# ^ (1 << order)
-- * if the buddy is also free merge them
-- * repeat until the buddy is not free or end of the bitmap is reached
-- */
-- do {
-- buddy = PMEM_BUDDY_INDEX(id, curr);
-- if (PMEM_IS_FREE(id, buddy) &&
-- PMEM_ORDER(id, buddy) == PMEM_ORDER(id, curr)) {
-- PMEM_ORDER(id, buddy)++;
-- PMEM_ORDER(id, curr)++;
-- curr = min(buddy, curr);
-- } else {
-- break;
-- }
-- } while (curr < pmem[id].num_entries);
--
-- return 0;
--}
--
--static void pmem_revoke(struct file *file, struct pmem_data *data);
--
--static int pmem_release(struct inode *inode, struct file *file)
--{
-- struct pmem_data *data = (struct pmem_data *)file->private_data;
-- struct pmem_region_node *region_node;
-- struct list_head *elt, *elt2;
-- int id = get_id(file), ret = 0;
--
--
-- mutex_lock(&pmem[id].data_list_lock);
-- /* if this file is a master, revoke all the memory in the connected
-- * files */
-- if (PMEM_FLAGS_MASTERMAP & data->flags) {
-- struct pmem_data *sub_data;
-- list_for_each(elt, &pmem[id].data_list) {
-- sub_data = list_entry(elt, struct pmem_data, list);
-- down_read(&sub_data->sem);
-- if (PMEM_IS_SUBMAP(sub_data) &&
-- file == sub_data->master_file) {
-- up_read(&sub_data->sem);
-- pmem_revoke(file, sub_data);
-- } else
-- up_read(&sub_data->sem);
-- }
-- }
-- list_del(&data->list);
-- mutex_unlock(&pmem[id].data_list_lock);
--
--
-- down_write(&data->sem);
--
-- /* if its not a conencted file and it has an allocation, free it */
-- if (!(PMEM_FLAGS_CONNECTED & data->flags) && has_allocation(file)) {
-- down_write(&pmem[id].bitmap_sem);
-- ret = pmem_free(id, data->index);
-- up_write(&pmem[id].bitmap_sem);
-- }
--
-- /* if this file is a submap (mapped, connected file), downref the
-- * task struct */
-- if (PMEM_FLAGS_SUBMAP & data->flags)
-- if (data->task) {
-- put_task_struct(data->task);
-- data->task = NULL;
-- }
--
-- file->private_data = NULL;
--
-- list_for_each_safe(elt, elt2, &data->region_list) {
-- region_node = list_entry(elt, struct pmem_region_node, list);
-- list_del(elt);
-- kfree(region_node);
-- }
-- BUG_ON(!list_empty(&data->region_list));
--
-- up_write(&data->sem);
-- kfree(data);
-- if (pmem[id].release)
-- ret = pmem[id].release(inode, file);
--
-- return ret;
--}
--
--static int pmem_open(struct inode *inode, struct file *file)
--{
-- struct pmem_data *data;
-- int id = get_id(file);
-- int ret = 0;
--
-- DLOG("current %u file %p(%d)\n", current->pid, file, file_count(file));
-- /* setup file->private_data to indicate its unmapped */
-- /* you can only open a pmem device one time */
-- if (file->private_data != NULL)
-- return -1;
-- data = kmalloc(sizeof(struct pmem_data), GFP_KERNEL);
-- if (!data) {
-- printk("pmem: unable to allocate memory for pmem metadata.");
-- return -1;
-- }
-- data->flags = 0;
-- data->index = -1;
-- data->task = NULL;
-- data->vma = NULL;
-- data->pid = 0;
-- data->master_file = NULL;
--#if PMEM_DEBUG
-- data->ref = 0;
--#endif
-- INIT_LIST_HEAD(&data->region_list);
-- init_rwsem(&data->sem);
--
-- file->private_data = data;
-- INIT_LIST_HEAD(&data->list);
--
-- mutex_lock(&pmem[id].data_list_lock);
-- list_add(&data->list, &pmem[id].data_list);
-- mutex_unlock(&pmem[id].data_list_lock);
-- return ret;
--}
--
--static unsigned long pmem_order(unsigned long len)
--{
-- int i;
--
-- len = (len + PMEM_MIN_ALLOC - 1)/PMEM_MIN_ALLOC;
-- len--;
-- for (i = 0; i < sizeof(len)*8; i++)
-- if (len >> i == 0)
-- break;
-- return i;
--}
--
--static int pmem_allocate(int id, unsigned long len)
--{
-- /* caller should hold the write lock on pmem_sem! */
-- /* return the corresponding pdata[] entry */
-- int curr = 0;
-- int end = pmem[id].num_entries;
-- int best_fit = -1;
-- unsigned long order = pmem_order(len);
--
-- if (pmem[id].no_allocator) {
-- DLOG("no allocator");
-- if ((len > pmem[id].size) || pmem[id].allocated)
-- return -1;
-- pmem[id].allocated = 1;
-- return len;
-- }
--
-- if (order > PMEM_MAX_ORDER)
-- return -1;
-- DLOG("order %lx\n", order);
--
-- /* look through the bitmap:
-- * if you find a free slot of the correct order use it
-- * otherwise, use the best fit (smallest with size > order) slot
-- */
-- while (curr < end) {
-- if (PMEM_IS_FREE(id, curr)) {
-- if (PMEM_ORDER(id, curr) == (unsigned char)order) {
-- /* set the not free bit and clear others */
-- best_fit = curr;
-- break;
-- }
-- if (PMEM_ORDER(id, curr) > (unsigned char)order &&
-- (best_fit < 0 ||
-- PMEM_ORDER(id, curr) < PMEM_ORDER(id, best_fit)))
-- best_fit = curr;
-- }
-- curr = PMEM_NEXT_INDEX(id, curr);
-- }
--
-- /* if best_fit < 0, there are no suitable slots,
-- * return an error
-- */
-- if (best_fit < 0) {
-- printk("pmem: no space left to allocate!\n");
-- return -1;
-- }
--
-- /* now partition the best fit:
-- * split the slot into 2 buddies of order - 1
-- * repeat until the slot is of the correct order
-- */
-- while (PMEM_ORDER(id, best_fit) > (unsigned char)order) {
-- int buddy;
-- PMEM_ORDER(id, best_fit) -= 1;
-- buddy = PMEM_BUDDY_INDEX(id, best_fit);
-- PMEM_ORDER(id, buddy) = PMEM_ORDER(id, best_fit);
-- }
-- pmem[id].bitmap[best_fit].allocated = 1;
-- return best_fit;
--}
--
--static pgprot_t pmem_access_prot(struct file *file, pgprot_t vma_prot)
--{
-- int id = get_id(file);
--#ifdef pgprot_noncached
-- if (pmem[id].cached == 0 || file->f_flags & O_SYNC)
-- return pgprot_noncached(vma_prot);
--#endif
--#ifdef pgprot_ext_buffered
-- else if (pmem[id].buffered)
-- return pgprot_ext_buffered(vma_prot);
--#endif
-- return vma_prot;
--}
--
--static unsigned long pmem_start_addr(int id, struct pmem_data *data)
--{
-- if (pmem[id].no_allocator)
-- return PMEM_START_ADDR(id, 0);
-- else
-- return PMEM_START_ADDR(id, data->index);
--
--}
--
--static void *pmem_start_vaddr(int id, struct pmem_data *data)
--{
-- return pmem_start_addr(id, data) - pmem[id].base + pmem[id].vbase;
--}
--
--static unsigned long pmem_len(int id, struct pmem_data *data)
--{
-- if (pmem[id].no_allocator)
-- return data->index;
-- else
-- return PMEM_LEN(id, data->index);
--}
--
--static int pmem_map_garbage(int id, struct vm_area_struct *vma,
-- struct pmem_data *data, unsigned long offset,
-- unsigned long len)
--{
-- int i, garbage_pages = len >> PAGE_SHIFT;
--
-- vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP | VM_SHARED | VM_WRITE;
-- for (i = 0; i < garbage_pages; i++) {
-- if (vm_insert_pfn(vma, vma->vm_start + offset + (i * PAGE_SIZE),
-- pmem[id].garbage_pfn))
-- return -EAGAIN;
-- }
-- return 0;
--}
--
--static int pmem_unmap_pfn_range(int id, struct vm_area_struct *vma,
-- struct pmem_data *data, unsigned long offset,
-- unsigned long len)
--{
-- int garbage_pages;
-- DLOG("unmap offset %lx len %lx\n", offset, len);
--
-- BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
--
-- garbage_pages = len >> PAGE_SHIFT;
-- zap_page_range(vma, vma->vm_start + offset, len, NULL);
-- pmem_map_garbage(id, vma, data, offset, len);
-- return 0;
--}
--
--static int pmem_map_pfn_range(int id, struct vm_area_struct *vma,
-- struct pmem_data *data, unsigned long offset,
-- unsigned long len)
--{
-- DLOG("map offset %lx len %lx\n", offset, len);
-- BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_start));
-- BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_end));
-- BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
-- BUG_ON(!PMEM_IS_PAGE_ALIGNED(offset));
--
-- if (io_remap_pfn_range(vma, vma->vm_start + offset,
-- (pmem_start_addr(id, data) + offset) >> PAGE_SHIFT,
-- len, vma->vm_page_prot)) {
-- return -EAGAIN;
-- }
-- return 0;
--}
--
--static int pmem_remap_pfn_range(int id, struct vm_area_struct *vma,
-- struct pmem_data *data, unsigned long offset,
-- unsigned long len)
--{
-- /* hold the mm semp for the vma you are modifying when you call this */
-- BUG_ON(!vma);
-- zap_page_range(vma, vma->vm_start + offset, len, NULL);
-- return pmem_map_pfn_range(id, vma, data, offset, len);
--}
--
--static void pmem_vma_open(struct vm_area_struct *vma)
--{
-- struct file *file = vma->vm_file;
-- struct pmem_data *data = file->private_data;
-- int id = get_id(file);
-- /* this should never be called as we don't support copying pmem
-- * ranges via fork */
-- BUG_ON(!has_allocation(file));
-- down_write(&data->sem);
-- /* remap the garbage pages, forkers don't get access to the data */
-- pmem_unmap_pfn_range(id, vma, data, 0, vma->vm_start - vma->vm_end);
-- up_write(&data->sem);
--}
--
--static void pmem_vma_close(struct vm_area_struct *vma)
--{
-- struct file *file = vma->vm_file;
-- struct pmem_data *data = file->private_data;
--
-- DLOG("current %u ppid %u file %p count %d\n", current->pid,
-- current->parent->pid, file, file_count(file));
-- if (unlikely(!is_pmem_file(file) || !has_allocation(file))) {
-- printk(KERN_WARNING "pmem: something is very wrong, you are "
-- "closing a vm backing an allocation that doesn't "
-- "exist!\n");
-- return;
-- }
-- down_write(&data->sem);
-- if (data->vma == vma) {
-- data->vma = NULL;
-- if ((data->flags & PMEM_FLAGS_CONNECTED) &&
-- (data->flags & PMEM_FLAGS_SUBMAP))
-- data->flags |= PMEM_FLAGS_UNSUBMAP;
-- }
-- /* the kernel is going to free this vma now anyway */
-- up_write(&data->sem);
--}
--
--static struct vm_operations_struct vm_ops = {
-- .open = pmem_vma_open,
-- .close = pmem_vma_close,
--};
--
--static int pmem_mmap(struct file *file, struct vm_area_struct *vma)
--{
-- struct pmem_data *data;
-- int index;
-- unsigned long vma_size = vma->vm_end - vma->vm_start;
-- int ret = 0, id = get_id(file);
--
-- if (vma->vm_pgoff || !PMEM_IS_PAGE_ALIGNED(vma_size)) {
--#if PMEM_DEBUG
-- printk(KERN_ERR "pmem: mmaps must be at offset zero, aligned"
-- " and a multiple of pages_size.\n");
--#endif
-- return -EINVAL;
-- }
--
-- data = (struct pmem_data *)file->private_data;
-- down_write(&data->sem);
-- /* check this file isn't already mmaped, for submaps check this file
-- * has never been mmaped */
-- if ((data->flags & PMEM_FLAGS_SUBMAP) ||
-- (data->flags & PMEM_FLAGS_UNSUBMAP)) {
--#if PMEM_DEBUG
-- printk(KERN_ERR "pmem: you can only mmap a pmem file once, "
-- "this file is already mmaped. %x\n", data->flags);
--#endif
-- ret = -EINVAL;
-- goto error;
-- }
-- /* if file->private_data == unalloced, alloc*/
-- if (data && data->index == -1) {
-- down_write(&pmem[id].bitmap_sem);
-- index = pmem_allocate(id, vma->vm_end - vma->vm_start);
-- up_write(&pmem[id].bitmap_sem);
-- data->index = index;
-- }
-- /* either no space was available or an error occured */
-- if (!has_allocation(file)) {
-- ret = -EINVAL;
-- printk("pmem: could not find allocation for map.\n");
-- goto error;
-- }
--
-- if (pmem_len(id, data) < vma_size) {
--#if PMEM_DEBUG
-- printk(KERN_WARNING "pmem: mmap size [%lu] does not match"
-- "size of backing region [%lu].\n", vma_size,
-- pmem_len(id, data));
--#endif
-- ret = -EINVAL;
-- goto error;
-- }
--
-- vma->vm_pgoff = pmem_start_addr(id, data) >> PAGE_SHIFT;
-- vma->vm_page_prot = pmem_access_prot(file, vma->vm_page_prot);
--
-- if (data->flags & PMEM_FLAGS_CONNECTED) {
-- struct pmem_region_node *region_node;
-- struct list_head *elt;
-- if (pmem_map_garbage(id, vma, data, 0, vma_size)) {
-- printk("pmem: mmap failed in kernel!\n");
-- ret = -EAGAIN;
-- goto error;
-- }
-- list_for_each(elt, &data->region_list) {
-- region_node = list_entry(elt, struct pmem_region_node,
-- list);
-- DLOG("remapping file: %p %lx %lx\n", file,
-- region_node->region.offset,
-- region_node->region.len);
-- if (pmem_remap_pfn_range(id, vma, data,
-- region_node->region.offset,
-- region_node->region.len)) {
-- ret = -EAGAIN;
-- goto error;
-- }
-- }
-- data->flags |= PMEM_FLAGS_SUBMAP;
-- get_task_struct(current->group_leader);
-- data->task = current->group_leader;
-- data->vma = vma;
--#if PMEM_DEBUG
-- data->pid = current->pid;
--#endif
-- DLOG("submmapped file %p vma %p pid %u\n", file, vma,
-- current->pid);
-- } else {
-- if (pmem_map_pfn_range(id, vma, data, 0, vma_size)) {
-- printk(KERN_INFO "pmem: mmap failed in kernel!\n");
-- ret = -EAGAIN;
-- goto error;
-- }
-- data->flags |= PMEM_FLAGS_MASTERMAP;
-- data->pid = current->pid;
-- }
-- vma->vm_ops = &vm_ops;
--error:
-- up_write(&data->sem);
-- return ret;
--}
--
--/* the following are the api for accessing pmem regions by other drivers
-- * from inside the kernel */
--int get_pmem_user_addr(struct file *file, unsigned long *start,
-- unsigned long *len)
--{
-- struct pmem_data *data;
-- if (!is_pmem_file(file) || !has_allocation(file)) {
--#if PMEM_DEBUG
-- printk(KERN_INFO "pmem: requested pmem data from invalid"
-- "file.\n");
--#endif
-- return -1;
-- }
-- data = (struct pmem_data *)file->private_data;
-- down_read(&data->sem);
-- if (data->vma) {
-- *start = data->vma->vm_start;
-- *len = data->vma->vm_end - data->vma->vm_start;
-- } else {
-- *start = 0;
-- *len = 0;
-- }
-- up_read(&data->sem);
-- return 0;
--}
--
--int get_pmem_addr(struct file *file, unsigned long *start,
-- unsigned long *vstart, unsigned long *len)
--{
-- struct pmem_data *data;
-- int id;
--
-- if (!is_pmem_file(file) || !has_allocation(file)) {
-- return -1;
-- }
--
-- data = (struct pmem_data *)file->private_data;
-- if (data->index == -1) {
--#if PMEM_DEBUG
-- printk(KERN_INFO "pmem: requested pmem data from file with no "
-- "allocation.\n");
-- return -1;
--#endif
-- }
-- id = get_id(file);
--
-- down_read(&data->sem);
-- *start = pmem_start_addr(id, data);
-- *len = pmem_len(id, data);
-- *vstart = (unsigned long)pmem_start_vaddr(id, data);
-- up_read(&data->sem);
--#if PMEM_DEBUG
-- down_write(&data->sem);
-- data->ref++;
-- up_write(&data->sem);
--#endif
-- return 0;
--}
--
--int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
-- unsigned long *len, struct file **filp)
--{
-- struct file *file;
--
-- file = fget(fd);
-- if (unlikely(file == NULL)) {
-- printk(KERN_INFO "pmem: requested data from file descriptor "
-- "that doesn't exist.");
-- return -1;
-- }
--
-- if (get_pmem_addr(file, start, vstart, len))
-- goto end;
--
-- if (filp)
-- *filp = file;
-- return 0;
--end:
-- fput(file);
-- return -1;
--}
--
--void put_pmem_file(struct file *file)
--{
-- struct pmem_data *data;
-- int id;
--
-- if (!is_pmem_file(file))
-- return;
-- id = get_id(file);
-- data = (struct pmem_data *)file->private_data;
--#if PMEM_DEBUG
-- down_write(&data->sem);
-- if (data->ref == 0) {
-- printk("pmem: pmem_put > pmem_get %s (pid %d)\n",
-- pmem[id].dev.name, data->pid);
-- BUG();
-- }
-- data->ref--;
-- up_write(&data->sem);
--#endif
-- fput(file);
--}
--
--void flush_pmem_file(struct file *file, unsigned long offset, unsigned long len)
--{
-- struct pmem_data *data;
-- int id;
-- void *vaddr;
-- struct pmem_region_node *region_node;
-- struct list_head *elt;
-- void *flush_start, *flush_end;
--
-- if (!is_pmem_file(file) || !has_allocation(file)) {
-- return;
-- }
--
-- id = get_id(file);
-- data = (struct pmem_data *)file->private_data;
-- if (!pmem[id].cached || file->f_flags & O_SYNC)
-- return;
--
-- down_read(&data->sem);
-- vaddr = pmem_start_vaddr(id, data);
-- /* if this isn't a submmapped file, flush the whole thing */
-- if (unlikely(!(data->flags & PMEM_FLAGS_CONNECTED))) {
-- dmac_flush_range(vaddr, vaddr + pmem_len(id, data));
-- goto end;
-- }
-- /* otherwise, flush the region of the file we are drawing */
-- list_for_each(elt, &data->region_list) {
-- region_node = list_entry(elt, struct pmem_region_node, list);
-- if ((offset >= region_node->region.offset) &&
-- ((offset + len) <= (region_node->region.offset +
-- region_node->region.len))) {
-- flush_start = vaddr + region_node->region.offset;
-- flush_end = flush_start + region_node->region.len;
-- dmac_flush_range(flush_start, flush_end);
-- break;
-- }
-- }
--end:
-- up_read(&data->sem);
--}
--
--static int pmem_connect(unsigned long connect, struct file *file)
--{
-- struct pmem_data *data = (struct pmem_data *)file->private_data;
-- struct pmem_data *src_data;
-- struct file *src_file;
-- int ret = 0, put_needed;
--
-- down_write(&data->sem);
-- /* retrieve the src file and check it is a pmem file with an alloc */
-- src_file = fget_light(connect, &put_needed);
-- DLOG("connect %p to %p\n", file, src_file);
-- if (!src_file) {
-- printk("pmem: src file not found!\n");
-- ret = -EINVAL;
-- goto err_no_file;
-- }
-- if (unlikely(!is_pmem_file(src_file) || !has_allocation(src_file))) {
-- printk(KERN_INFO "pmem: src file is not a pmem file or has no "
-- "alloc!\n");
-- ret = -EINVAL;
-- goto err_bad_file;
-- }
-- src_data = (struct pmem_data *)src_file->private_data;
--
-- if (has_allocation(file) && (data->index != src_data->index)) {
-- printk("pmem: file is already mapped but doesn't match this"
-- " src_file!\n");
-- ret = -EINVAL;
-- goto err_bad_file;
-- }
-- data->index = src_data->index;
-- data->flags |= PMEM_FLAGS_CONNECTED;
-- data->master_fd = connect;
-- data->master_file = src_file;
--
--err_bad_file:
-- fput_light(src_file, put_needed);
--err_no_file:
-- up_write(&data->sem);
-- return ret;
--}
--
--static void pmem_unlock_data_and_mm(struct pmem_data *data,
-- struct mm_struct *mm)
--{
-- up_write(&data->sem);
-- if (mm != NULL) {
-- up_write(&mm->mmap_sem);
-- mmput(mm);
-- }
--}
--
--static int pmem_lock_data_and_mm(struct file *file, struct pmem_data *data,
-- struct mm_struct **locked_mm)
--{
-- int ret = 0;
-- struct mm_struct *mm = NULL;
-- *locked_mm = NULL;
--lock_mm:
-- down_read(&data->sem);
-- if (PMEM_IS_SUBMAP(data)) {
-- mm = get_task_mm(data->task);
-- if (!mm) {
--#if PMEM_DEBUG
-- printk("pmem: can't remap task is gone!\n");
--#endif
-- up_read(&data->sem);
-- return -1;
-- }
-- }
-- up_read(&data->sem);
--
-- if (mm)
-- down_write(&mm->mmap_sem);
--
-- down_write(&data->sem);
-- /* check that the file didn't get mmaped before we could take the
-- * data sem, this should be safe b/c you can only submap each file
-- * once */
-- if (PMEM_IS_SUBMAP(data) && !mm) {
-- pmem_unlock_data_and_mm(data, mm);
-- up_write(&data->sem);
-- goto lock_mm;
-- }
-- /* now check that vma.mm is still there, it could have been
-- * deleted by vma_close before we could get the data->sem */
-- if ((data->flags & PMEM_FLAGS_UNSUBMAP) && (mm != NULL)) {
-- /* might as well release this */
-- if (data->flags & PMEM_FLAGS_SUBMAP) {
-- put_task_struct(data->task);
-- data->task = NULL;
-- /* lower the submap flag to show the mm is gone */
-- data->flags &= ~(PMEM_FLAGS_SUBMAP);
-- }
-- pmem_unlock_data_and_mm(data, mm);
-- return -1;
-- }
-- *locked_mm = mm;
-- return ret;
--}
--
--int pmem_remap(struct pmem_region *region, struct file *file,
-- unsigned operation)
--{
-- int ret;
-- struct pmem_region_node *region_node;
-- struct mm_struct *mm = NULL;
-- struct list_head *elt, *elt2;
-- int id = get_id(file);
-- struct pmem_data *data = (struct pmem_data *)file->private_data;
--
-- /* pmem region must be aligned on a page boundry */
-- if (unlikely(!PMEM_IS_PAGE_ALIGNED(region->offset) ||
-- !PMEM_IS_PAGE_ALIGNED(region->len))) {
--#if PMEM_DEBUG
-- printk("pmem: request for unaligned pmem suballocation "
-- "%lx %lx\n", region->offset, region->len);
--#endif
-- return -EINVAL;
-- }
--
-- /* if userspace requests a region of len 0, there's nothing to do */
-- if (region->len == 0)
-- return 0;
--
-- /* lock the mm and data */
-- ret = pmem_lock_data_and_mm(file, data, &mm);
-- if (ret)
-- return 0;
--
-- /* only the owner of the master file can remap the client fds
-- * that back in it */
-- if (!is_master_owner(file)) {
--#if PMEM_DEBUG
-- printk("pmem: remap requested from non-master process\n");
--#endif
-- ret = -EINVAL;
-- goto err;
-- }
--
-- /* check that the requested range is within the src allocation */
-- if (unlikely((region->offset > pmem_len(id, data)) ||
-- (region->len > pmem_len(id, data)) ||
-- (region->offset + region->len > pmem_len(id, data)))) {
--#if PMEM_DEBUG
-- printk(KERN_INFO "pmem: suballoc doesn't fit in src_file!\n");
--#endif
-- ret = -EINVAL;
-- goto err;
-- }
--
-- if (operation == PMEM_MAP) {
-- region_node = kmalloc(sizeof(struct pmem_region_node),
-- GFP_KERNEL);
-- if (!region_node) {
-- ret = -ENOMEM;
--#if PMEM_DEBUG
-- printk(KERN_INFO "No space to allocate metadata!");
--#endif
-- goto err;
-- }
-- region_node->region = *region;
-- list_add(&region_node->list, &data->region_list);
-- } else if (operation == PMEM_UNMAP) {
-- int found = 0;
-- list_for_each_safe(elt, elt2, &data->region_list) {
-- region_node = list_entry(elt, struct pmem_region_node,
-- list);
-- if (region->len == 0 ||
-- (region_node->region.offset == region->offset &&
-- region_node->region.len == region->len)) {
-- list_del(elt);
-- kfree(region_node);
-- found = 1;
-- }
-- }
-- if (!found) {
--#if PMEM_DEBUG
-- printk("pmem: Unmap region does not map any mapped "
-- "region!");
--#endif
-- ret = -EINVAL;
-- goto err;
-- }
-- }
--
-- if (data->vma && PMEM_IS_SUBMAP(data)) {
-- if (operation == PMEM_MAP)
-- ret = pmem_remap_pfn_range(id, data->vma, data,
-- region->offset, region->len);
-- else if (operation == PMEM_UNMAP)
-- ret = pmem_unmap_pfn_range(id, data->vma, data,
-- region->offset, region->len);
-- }
--
--err:
-- pmem_unlock_data_and_mm(data, mm);
-- return ret;
--}
--
--static void pmem_revoke(struct file *file, struct pmem_data *data)
--{
-- struct pmem_region_node *region_node;
-- struct list_head *elt, *elt2;
-- struct mm_struct *mm = NULL;
-- int id = get_id(file);
-- int ret = 0;
--
-- data->master_file = NULL;
-- ret = pmem_lock_data_and_mm(file, data, &mm);
-- /* if lock_data_and_mm fails either the task that mapped the fd, or
-- * the vma that mapped it have already gone away, nothing more
-- * needs to be done */
-- if (ret)
-- return;
-- /* unmap everything */
-- /* delete the regions and region list nothing is mapped any more */
-- if (data->vma)
-- list_for_each_safe(elt, elt2, &data->region_list) {
-- region_node = list_entry(elt, struct pmem_region_node,
-- list);
-- pmem_unmap_pfn_range(id, data->vma, data,
-- region_node->region.offset,
-- region_node->region.len);
-- list_del(elt);
-- kfree(region_node);
-- }
-- /* delete the master file */
-- pmem_unlock_data_and_mm(data, mm);
--}
--
--static void pmem_get_size(struct pmem_region *region, struct file *file)
--{
-- struct pmem_data *data = (struct pmem_data *)file->private_data;
-- int id = get_id(file);
--
-- if (!has_allocation(file)) {
-- region->offset = 0;
-- region->len = 0;
-- return;
-- } else {
-- region->offset = pmem_start_addr(id, data);
-- region->len = pmem_len(id, data);
-- }
-- DLOG("offset %lx len %lx\n", region->offset, region->len);
--}
--
--
--static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
--{
-- struct pmem_data *data;
-- int id = get_id(file);
--
-- switch (cmd) {
-- case PMEM_GET_PHYS:
-- {
-- struct pmem_region region;
-- DLOG("get_phys\n");
-- if (!has_allocation(file)) {
-- region.offset = 0;
-- region.len = 0;
-- } else {
-- data = (struct pmem_data *)file->private_data;
-- region.offset = pmem_start_addr(id, data);
-- region.len = pmem_len(id, data);
-- }
-- printk(KERN_INFO "pmem: request for physical address of pmem region "
-- "from process %d.\n", current->pid);
-- if (copy_to_user((void __user *)arg, &region,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- break;
-- }
-- case PMEM_MAP:
-- {
-- struct pmem_region region;
-- if (copy_from_user(&region, (void __user *)arg,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- data = (struct pmem_data *)file->private_data;
-- return pmem_remap(&region, file, PMEM_MAP);
-- }
-- break;
-- case PMEM_UNMAP:
-- {
-- struct pmem_region region;
-- if (copy_from_user(&region, (void __user *)arg,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- data = (struct pmem_data *)file->private_data;
-- return pmem_remap(&region, file, PMEM_UNMAP);
-- break;
-- }
-- case PMEM_GET_SIZE:
-- {
-- struct pmem_region region;
-- DLOG("get_size\n");
-- pmem_get_size(&region, file);
-- if (copy_to_user((void __user *)arg, &region,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- break;
-- }
-- case PMEM_GET_TOTAL_SIZE:
-- {
-- struct pmem_region region;
-- DLOG("get total size\n");
-- region.offset = 0;
-- get_id(file);
-- region.len = pmem[id].size;
-- if (copy_to_user((void __user *)arg, &region,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- break;
-- }
-- case PMEM_ALLOCATE:
-- {
-- if (has_allocation(file))
-- return -EINVAL;
-- data = (struct pmem_data *)file->private_data;
-- data->index = pmem_allocate(id, arg);
-- break;
-- }
-- case PMEM_CONNECT:
-- DLOG("connect\n");
-- return pmem_connect(arg, file);
-- break;
-- case PMEM_CACHE_FLUSH:
-- {
-- struct pmem_region region;
-- DLOG("flush\n");
-- if (copy_from_user(&region, (void __user *)arg,
-- sizeof(struct pmem_region)))
-- return -EFAULT;
-- flush_pmem_file(file, region.offset, region.len);
-- break;
-- }
-- default:
-- if (pmem[id].ioctl)
-- return pmem[id].ioctl(file, cmd, arg);
-- return -EINVAL;
-- }
-- return 0;
--}
--
--#if PMEM_DEBUG
--static ssize_t debug_open(struct inode *inode, struct file *file)
--{
-- file->private_data = inode->i_private;
-- return 0;
--}
--
--static ssize_t debug_read(struct file *file, char __user *buf, size_t count,
-- loff_t *ppos)
--{
-- struct list_head *elt, *elt2;
-- struct pmem_data *data;
-- struct pmem_region_node *region_node;
-- int id = (int)file->private_data;
-- const int debug_bufmax = 4096;
-- static char buffer[4096];
-- int n = 0;
--
-- DLOG("debug open\n");
-- n = scnprintf(buffer, debug_bufmax,
-- "pid #: mapped regions (offset, len) (offset,len)...\n");
--
-- mutex_lock(&pmem[id].data_list_lock);
-- list_for_each(elt, &pmem[id].data_list) {
-- data = list_entry(elt, struct pmem_data, list);
-- down_read(&data->sem);
-- n += scnprintf(buffer + n, debug_bufmax - n, "pid %u:",
-- data->pid);
-- list_for_each(elt2, &data->region_list) {
-- region_node = list_entry(elt2, struct pmem_region_node,
-- list);
-- n += scnprintf(buffer + n, debug_bufmax - n,
-- "(%lx,%lx) ",
-- region_node->region.offset,
-- region_node->region.len);
-- }
-- n += scnprintf(buffer + n, debug_bufmax - n, "\n");
-- up_read(&data->sem);
-- }
-- mutex_unlock(&pmem[id].data_list_lock);
--
-- n++;
-- buffer[n] = 0;
-- return simple_read_from_buffer(buf, count, ppos, buffer, n);
--}
--
--static struct file_operations debug_fops = {
-- .read = debug_read,
-- .open = debug_open,
--};
--#endif
--
--#if 0
--static struct miscdevice pmem_dev = {
-- .name = "pmem",
-- .fops = &pmem_fops,
--};
--#endif
--
--int pmem_setup(struct android_pmem_platform_data *pdata,
-- long (*ioctl)(struct file *, unsigned int, unsigned long),
-- int (*release)(struct inode *, struct file *))
--{
-- int err = 0;
-- int i, index = 0;
-- int id = id_count;
-- id_count++;
--
-- pmem[id].no_allocator = pdata->no_allocator;
-- pmem[id].cached = pdata->cached;
-- pmem[id].buffered = pdata->buffered;
-- pmem[id].base = pdata->start;
-- pmem[id].size = pdata->size;
-- pmem[id].ioctl = ioctl;
-- pmem[id].release = release;
-- init_rwsem(&pmem[id].bitmap_sem);
-- mutex_init(&pmem[id].data_list_lock);
-- INIT_LIST_HEAD(&pmem[id].data_list);
-- pmem[id].dev.name = pdata->name;
-- pmem[id].dev.minor = id;
-- pmem[id].dev.fops = &pmem_fops;
-- printk(KERN_INFO "%s: %d init\n", pdata->name, pdata->cached);
--
-- err = misc_register(&pmem[id].dev);
-- if (err) {
-- printk(KERN_ALERT "Unable to register pmem driver!\n");
-- goto err_cant_register_device;
-- }
-- pmem[id].num_entries = pmem[id].size / PMEM_MIN_ALLOC;
--
-- pmem[id].bitmap = kmalloc(pmem[id].num_entries *
-- sizeof(struct pmem_bits), GFP_KERNEL);
-- if (!pmem[id].bitmap)
-- goto err_no_mem_for_metadata;
--
-- memset(pmem[id].bitmap, 0, sizeof(struct pmem_bits) *
-- pmem[id].num_entries);
--
-- for (i = sizeof(pmem[id].num_entries) * 8 - 1; i >= 0; i--) {
-- if ((pmem[id].num_entries) & 1<<i) {
-- PMEM_ORDER(id, index) = i;
-- index = PMEM_NEXT_INDEX(id, index);
-- }
-- }
--
-- if (pmem[id].cached)
-- pmem[id].vbase = ioremap_cached(pmem[id].base,
-- pmem[id].size);
--#ifdef ioremap_ext_buffered
-- else if (pmem[id].buffered)
-- pmem[id].vbase = ioremap_ext_buffered(pmem[id].base,
-- pmem[id].size);
--#endif
-- else
-- pmem[id].vbase = ioremap(pmem[id].base, pmem[id].size);
--
-- if (pmem[id].vbase == 0)
-- goto error_cant_remap;
--
-- pmem[id].garbage_pfn = page_to_pfn(alloc_page(GFP_KERNEL));
-- if (pmem[id].no_allocator)
-- pmem[id].allocated = 0;
--
--#if PMEM_DEBUG
-- debugfs_create_file(pdata->name, S_IFREG | S_IRUGO, NULL, (void *)id,
-- &debug_fops);
--#endif
-- return 0;
--error_cant_remap:
-- kfree(pmem[id].bitmap);
--err_no_mem_for_metadata:
-- misc_deregister(&pmem[id].dev);
--err_cant_register_device:
-- return -1;
--}
--
--static int pmem_probe(struct platform_device *pdev)
--{
-- struct android_pmem_platform_data *pdata;
--
-- if (!pdev || !pdev->dev.platform_data) {
-- printk(KERN_ALERT "Unable to probe pmem!\n");
-- return -1;
-- }
-- pdata = pdev->dev.platform_data;
-- return pmem_setup(pdata, NULL, NULL);
--}
--
--
--static int pmem_remove(struct platform_device *pdev)
--{
-- int id = pdev->id;
-- __free_page(pfn_to_page(pmem[id].garbage_pfn));
-- misc_deregister(&pmem[id].dev);
-- return 0;
--}
--
--static struct platform_driver pmem_driver = {
-- .probe = pmem_probe,
-- .remove = pmem_remove,
-- .driver = { .name = "android_pmem" }
--};
--
--
--static int __init pmem_init(void)
--{
-- return platform_driver_register(&pmem_driver);
--}
--
--static void __exit pmem_exit(void)
--{
-- platform_driver_unregister(&pmem_driver);
--}
--
--module_init(pmem_init);
--module_exit(pmem_exit);
--
diff --git a/patches.android/android-0038-Staging-android-binder-Fix-crashes-when-sharing-a-binder-fil.patch b/patches.android/android-0038-Staging-android-binder-Fix-crashes-when-sharing-a-binder-fil.patch
deleted file mode 100644
index c4ce228223e807..00000000000000
--- a/patches.android/android-0038-Staging-android-binder-Fix-crashes-when-sharing-a-binder-fil.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From bd1eff9741af27378b241b347041c724bb28e857 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Wed, 1 Feb 2012 15:29:13 -0800
-Subject: Staging: android: binder: Fix crashes when sharing a binder
- file between processes
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: bd1eff9741af27378b241b347041c724bb28e857
-
-Opening the binder driver and sharing the file returned with
-other processes (e.g. by calling fork) can crash the kernel.
-Prevent these crashes with the following changes:
-- Add a mutex to protect against two processes mmapping the
- same binder_proc.
-- After locking mmap_sem, check that the vma we want to access
- (still) points to the same mm_struct.
-- Use proc->tsk instead of current to get the files struct since
- this is where we get the rlimit from.
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Cc: stable <stable@vger.kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
-diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
-index 48cf27c..f0b7e66 100644
---- a/drivers/staging/android/binder.c
-+++ b/drivers/staging/android/binder.c
-@@ -38,6 +38,7 @@
-
- static DEFINE_MUTEX(binder_lock);
- static DEFINE_MUTEX(binder_deferred_lock);
-+static DEFINE_MUTEX(binder_mmap_lock);
-
- static HLIST_HEAD(binder_procs);
- static HLIST_HEAD(binder_deferred_list);
-@@ -632,6 +633,11 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
- if (mm) {
- down_write(&mm->mmap_sem);
- vma = proc->vma;
-+ if (vma && mm != vma->vm_mm) {
-+ pr_err("binder: %d: vma mm and task mm mismatch\n",
-+ proc->pid);
-+ vma = NULL;
-+ }
- }
-
- if (allocate == 0)
-@@ -2802,6 +2808,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
- }
- vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
-
-+ mutex_lock(&binder_mmap_lock);
- if (proc->buffer) {
- ret = -EBUSY;
- failure_string = "already mapped";
-@@ -2816,6 +2823,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
- }
- proc->buffer = area->addr;
- proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
-+ mutex_unlock(&binder_mmap_lock);
-
- #ifdef CONFIG_CPU_CACHE_VIPT
- if (cache_is_vipt_aliasing()) {
-@@ -2848,7 +2856,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
- binder_insert_free_buffer(proc, buffer);
- proc->free_async_space = proc->buffer_size / 2;
- barrier();
-- proc->files = get_files_struct(current);
-+ proc->files = get_files_struct(proc->tsk);
- proc->vma = vma;
-
- /*printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p\n",
-@@ -2859,10 +2867,12 @@ err_alloc_small_buf_failed:
- kfree(proc->pages);
- proc->pages = NULL;
- err_alloc_pages_failed:
-+ mutex_lock(&binder_mmap_lock);
- vfree(proc->buffer);
- proc->buffer = NULL;
- err_get_vm_area_failed:
- err_already_mapped:
-+ mutex_unlock(&binder_mmap_lock);
- err_bad_arg:
- printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n",
- proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
diff --git a/patches.android/android-0039-staging-android-lowmemorykiller-Don-t-wait-more-than-one-sec.patch b/patches.android/android-0039-staging-android-lowmemorykiller-Don-t-wait-more-than-one-sec.patch
deleted file mode 100644
index bbec644e3d58c1..00000000000000
--- a/patches.android/android-0039-staging-android-lowmemorykiller-Don-t-wait-more-than-one-sec.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From e5d7965f88a3755b2d0c54768a17032ab3a72819 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
-Date: Fri, 13 Jan 2012 22:21:25 +0400
-Subject: staging: android: lowmemorykiller: Don't wait more than one
- second for a process to die
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Patch-mainline: HEAD
-Git-commit: e5d7965f88a3755b2d0c54768a17032ab3a72819
-
-If a process forked and the child process was killed by the
-lowmemorykiller, the lowmemory killer would be disabled until
-the parent process reaped the child or it died itself.
-
-Signed-off-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 2d8d2b7..efc7dc1 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -54,6 +54,7 @@ static size_t lowmem_minfree[6] = {
- static int lowmem_minfree_size = 4;
-
- static struct task_struct *lowmem_deathpending;
-+static unsigned long lowmem_deathpending_timeout;
-
- #define lowmem_print(level, x...) \
- do { \
-@@ -103,7 +104,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
- * Note: Currently you need CONFIG_PROFILING
- * for this to work correctly.
- */
-- if (lowmem_deathpending)
-+ if (lowmem_deathpending &&
-+ time_before_eq(jiffies, lowmem_deathpending_timeout))
- return 0;
-
- if (lowmem_adj_size < array_size)
-@@ -178,6 +180,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
- */
- #ifdef CONFIG_PROFILING
- lowmem_deathpending = selected;
-+ lowmem_deathpending_timeout = jiffies + HZ;
- task_handoff_register(&task_nb);
- #endif
- force_sig(SIGKILL, selected);
diff --git a/patches.android/android-0040-staging-android-ram_console-Don-t-build-on-arches-w-o-iorema.patch b/patches.android/android-0040-staging-android-ram_console-Don-t-build-on-arches-w-o-iorema.patch
deleted file mode 100644
index 36ee8811930c79..00000000000000
--- a/patches.android/android-0040-staging-android-ram_console-Don-t-build-on-arches-w-o-iorema.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 203209ef77e4d5f0ee729557b09770bce0c2d251 Mon Sep 17 00:00:00 2001
-From: Anton Vorontsov <anton.vorontsov@linaro.org>
-Date: Tue, 7 Feb 2012 09:13:27 +0400
-Subject: staging: android/ram_console: Don't build on arches w/o
- ioremap
-Patch-mainline: HEAD
-Git-commit: 203209ef77e4d5f0ee729557b09770bce0c2d251
-
-This patch fixes UML build:
-
- CC drivers/staging/android/ram_console.o
- drivers/staging/android/ram_console.c: In function
- 'ram_console_driver_probe':
- drivers/staging/android/ram_console.c:358:2: error: implicit declaration
- of function 'ioremap' [-Werror=implicit-function-declaration]
- cc1: some warnings being treated as errors
- make[3]: *** [drivers/staging/android/ram_console.o] Error 1
-
-Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index 94cb2ac..fef3580 100644
---- a/drivers/staging/android/Kconfig
-+++ b/drivers/staging/android/Kconfig
-@@ -27,6 +27,7 @@ config ANDROID_LOGGER
-
- config ANDROID_RAM_CONSOLE
- bool "Android RAM buffer console"
-+ depends on !S390 && !UML
- default n
-
- config ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
diff --git a/patches.android/staging-android-add-the-code-back-to-the-build.patch b/patches.android/staging-android-add-the-code-back-to-the-build.patch
deleted file mode 100644
index 0c861b9d39f840..00000000000000
--- a/patches.android/staging-android-add-the-code-back-to-the-build.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From f4dc23861d9da89cfb5d2b0c5b3c96c115842a6c Mon Sep 17 00:00:00 2001
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Date: Wed, 30 Nov 2011 20:33:10 +0900
-Subject: [PATCH] Staging: android: add the code back to the build
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-It builds, so ship it!
-
-Cc: Arve Hjønnevåg <arve@android.com>
-Cc: Brian Swetland <swetland@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/staging/Kconfig | 2 ++
- drivers/staging/Makefile | 2 ++
- 2 files changed, 4 insertions(+)
-
---- a/drivers/staging/Kconfig
-+++ b/drivers/staging/Kconfig
-@@ -160,4 +160,6 @@ source "drivers/staging/mei/Kconfig"
-
- source "drivers/staging/nvec/Kconfig"
-
-+source "drivers/staging/android/Kconfig"
-+
- endif # STAGING
---- a/drivers/staging/Makefile
-+++ b/drivers/staging/Makefile
-@@ -71,3 +71,5 @@ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_R
- obj-$(CONFIG_DRM_PSB) += gma500/
- obj-$(CONFIG_INTEL_MEI) += mei/
- obj-$(CONFIG_MFD_NVEC) += nvec/
-+obj-$(CONFIG_ANDROID) += android/
-+
diff --git a/patches.armadillo800eva/0001-module.h-split-out-the-EXPORT_SYMBOL-into-export.h.patch b/patches.armadillo800eva/0001-module.h-split-out-the-EXPORT_SYMBOL-into-export.h.patch
deleted file mode 100644
index eae58477b86ed3..00000000000000
--- a/patches.armadillo800eva/0001-module.h-split-out-the-EXPORT_SYMBOL-into-export.h.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-From b85971d89c5269f427fe46aa9336f2f18cf82b8e Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Mon, 23 May 2011 14:11:39 -0400
-Subject: module.h: split out the EXPORT_SYMBOL into export.h
-
-A lot of files pull in module.h when all they are really
-looking for is the basic EXPORT_SYMBOL functionality. The
-recent data from Ingo[1] shows that this is one of several
-instances that has a significant impact on compile times,
-and it should be targeted for factoring out (as done here).
-
-Note that several commonly used header files in include/*
-directly include <linux/module.h> themselves (some 34 of them!)
-The most commonly used ones of these will have to be made
-independent of module.h before the full benefit of this change
-can be realized.
-
-We also transition THIS_MODULE from module.h to export.h,
-since there are lots of files with subsystem structs that
-in turn will have a struct module *owner and only be doing:
-
- .owner = THIS_MODULE;
-
-and absolutely nothing else modular. So, we also want to have
-the THIS_MODULE definition present in the lightweight header.
-
-[1] https://lkml.org/lkml/2011/5/23/76
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit f50169324df4ad942e544386d136216c8617636a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/export.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
- include/linux/module.h | 68 +-----------------------------------
- 2 files changed, 90 insertions(+), 67 deletions(-)
- create mode 100644 include/linux/export.h
-
-diff --git a/include/linux/export.h b/include/linux/export.h
-new file mode 100644
-index 0000000..696c0f4
---- /dev/null
-+++ b/include/linux/export.h
-@@ -0,0 +1,89 @@
-+#ifndef _LINUX_EXPORT_H
-+#define _LINUX_EXPORT_H
-+/*
-+ * Export symbols from the kernel to modules. Forked from module.h
-+ * to reduce the amount of pointless cruft we feed to gcc when only
-+ * exporting a simple symbol or two.
-+ *
-+ * If you feel the need to add #include <linux/foo.h> to this file
-+ * then you are doing something wrong and should go away silently.
-+ */
-+
-+/* Some toolchains use a `_' prefix for all user symbols. */
-+#ifdef CONFIG_SYMBOL_PREFIX
-+#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
-+#else
-+#define MODULE_SYMBOL_PREFIX ""
-+#endif
-+
-+struct kernel_symbol
-+{
-+ unsigned long value;
-+ const char *name;
-+};
-+
-+#ifdef MODULE
-+extern struct module __this_module;
-+#define THIS_MODULE (&__this_module)
-+#else
-+#define THIS_MODULE ((struct module *)0)
-+#endif
-+
-+#ifdef CONFIG_MODULES
-+
-+#ifndef __GENKSYMS__
-+#ifdef CONFIG_MODVERSIONS
-+/* Mark the CRC weak since genksyms apparently decides not to
-+ * generate a checksums for some symbols */
-+#define __CRC_SYMBOL(sym, sec) \
-+ extern void *__crc_##sym __attribute__((weak)); \
-+ static const unsigned long __kcrctab_##sym \
-+ __used \
-+ __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
-+ = (unsigned long) &__crc_##sym;
-+#else
-+#define __CRC_SYMBOL(sym, sec)
-+#endif
-+
-+/* For every exported symbol, place a struct in the __ksymtab section */
-+#define __EXPORT_SYMBOL(sym, sec) \
-+ extern typeof(sym) sym; \
-+ __CRC_SYMBOL(sym, sec) \
-+ static const char __kstrtab_##sym[] \
-+ __attribute__((section("__ksymtab_strings"), aligned(1))) \
-+ = MODULE_SYMBOL_PREFIX #sym; \
-+ static const struct kernel_symbol __ksymtab_##sym \
-+ __used \
-+ __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
-+ = { (unsigned long)&sym, __kstrtab_##sym }
-+
-+#define EXPORT_SYMBOL(sym) \
-+ __EXPORT_SYMBOL(sym, "")
-+
-+#define EXPORT_SYMBOL_GPL(sym) \
-+ __EXPORT_SYMBOL(sym, "_gpl")
-+
-+#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
-+ __EXPORT_SYMBOL(sym, "_gpl_future")
-+
-+#ifdef CONFIG_UNUSED_SYMBOLS
-+#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
-+#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
-+#else
-+#define EXPORT_UNUSED_SYMBOL(sym)
-+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
-+#endif
-+
-+#endif /* __GENKSYMS__ */
-+
-+#else /* !CONFIG_MODULES... */
-+
-+#define EXPORT_SYMBOL(sym)
-+#define EXPORT_SYMBOL_GPL(sym)
-+#define EXPORT_SYMBOL_GPL_FUTURE(sym)
-+#define EXPORT_UNUSED_SYMBOL(sym)
-+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
-+
-+#endif /* CONFIG_MODULES */
-+
-+#endif /* _LINUX_EXPORT_H */
-diff --git a/include/linux/module.h b/include/linux/module.h
-index d9ca2d5..e91cc65 100644
---- a/include/linux/module.h
-+++ b/include/linux/module.h
-@@ -16,6 +16,7 @@
- #include <linux/kobject.h>
- #include <linux/moduleparam.h>
- #include <linux/tracepoint.h>
-+#include <linux/export.h>
-
- #include <linux/percpu.h>
- #include <asm/module.h>
-@@ -25,21 +26,8 @@
- /* Not Yet Implemented */
- #define MODULE_SUPPORTED_DEVICE(name)
-
--/* Some toolchains use a `_' prefix for all user symbols. */
--#ifdef CONFIG_SYMBOL_PREFIX
--#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
--#else
--#define MODULE_SYMBOL_PREFIX ""
--#endif
--
- #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
-
--struct kernel_symbol
--{
-- unsigned long value;
-- const char *name;
--};
--
- struct modversion_info
- {
- unsigned long crc;
-@@ -96,11 +84,8 @@ void trim_init_extable(struct module *m);
- extern const struct gtype##_id __mod_##gtype##_table \
- __attribute__ ((unused, alias(__stringify(name))))
-
--extern struct module __this_module;
--#define THIS_MODULE (&__this_module)
- #else /* !MODULE */
- #define MODULE_GENERIC_TABLE(gtype,name)
--#define THIS_MODULE ((struct module *)0)
- #endif
-
- /* Generic info of form tag = "info" */
-@@ -216,52 +201,6 @@ struct module_use {
- struct module *source, *target;
- };
-
--#ifndef __GENKSYMS__
--#ifdef CONFIG_MODVERSIONS
--/* Mark the CRC weak since genksyms apparently decides not to
-- * generate a checksums for some symbols */
--#define __CRC_SYMBOL(sym, sec) \
-- extern void *__crc_##sym __attribute__((weak)); \
-- static const unsigned long __kcrctab_##sym \
-- __used \
-- __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
-- = (unsigned long) &__crc_##sym;
--#else
--#define __CRC_SYMBOL(sym, sec)
--#endif
--
--/* For every exported symbol, place a struct in the __ksymtab section */
--#define __EXPORT_SYMBOL(sym, sec) \
-- extern typeof(sym) sym; \
-- __CRC_SYMBOL(sym, sec) \
-- static const char __kstrtab_##sym[] \
-- __attribute__((section("__ksymtab_strings"), aligned(1))) \
-- = MODULE_SYMBOL_PREFIX #sym; \
-- static const struct kernel_symbol __ksymtab_##sym \
-- __used \
-- __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
-- = { (unsigned long)&sym, __kstrtab_##sym }
--
--#define EXPORT_SYMBOL(sym) \
-- __EXPORT_SYMBOL(sym, "")
--
--#define EXPORT_SYMBOL_GPL(sym) \
-- __EXPORT_SYMBOL(sym, "_gpl")
--
--#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
-- __EXPORT_SYMBOL(sym, "_gpl_future")
--
--
--#ifdef CONFIG_UNUSED_SYMBOLS
--#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
--#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
--#else
--#define EXPORT_UNUSED_SYMBOL(sym)
--#define EXPORT_UNUSED_SYMBOL_GPL(sym)
--#endif
--
--#endif
--
- enum module_state
- {
- MODULE_STATE_LIVE,
-@@ -582,11 +521,6 @@ extern void module_update_tracepoints(void);
- extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
-
- #else /* !CONFIG_MODULES... */
--#define EXPORT_SYMBOL(sym)
--#define EXPORT_SYMBOL_GPL(sym)
--#define EXPORT_SYMBOL_GPL_FUTURE(sym)
--#define EXPORT_UNUSED_SYMBOL(sym)
--#define EXPORT_UNUSED_SYMBOL_GPL(sym)
-
- /* Given an address, look for it in the exception tables. */
- static inline const struct exception_table_entry *
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0002-arm-Add-export.h-to-ARM-specific-files-as-required.patch b/patches.armadillo800eva/0002-arm-Add-export.h-to-ARM-specific-files-as-required.patch
deleted file mode 100644
index ed49702aec16aa..00000000000000
--- a/patches.armadillo800eva/0002-arm-Add-export.h-to-ARM-specific-files-as-required.patch
+++ /dev/null
@@ -1,460 +0,0 @@
-From 37e7a4e1eddd663a2c5fddaabf80598f204fea62 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 31 Jul 2011 16:17:29 -0400
-Subject: arm: Add export.h to ARM specific files as required.
-
-These files all make use of one of the EXPORT_SYMBOL variants
-or the THIS_MODULE macro. So they will need <linux/export.h>
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit dc28094b905a872f8884f1f1c48ca86b3b78583a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/it8152.c | 1 +
- arch/arm/common/scoop.c | 1 +
- arch/arm/mach-at91/cpuidle.c | 1 +
- arch/arm/mach-davinci/board-dm644x-evm.c | 1 +
- arch/arm/mach-davinci/board-dm646x-evm.c | 1 +
- arch/arm/mach-davinci/cpufreq.c | 1 +
- arch/arm/mach-davinci/cpuidle.c | 1 +
- arch/arm/mach-ep93xx/core.c | 1 +
- arch/arm/mach-exynos4/dev-sysmmu.c | 1 +
- arch/arm/mach-iop13xx/pci.c | 1 +
- arch/arm/mach-ixp2000/core.c | 1 +
- arch/arm/mach-ixp4xx/common-pci.c | 1 +
- arch/arm/mach-ixp4xx/common.c | 1 +
- arch/arm/mach-kirkwood/cpuidle.c | 1 +
- arch/arm/mach-msm/io.c | 1 +
- arch/arm/mach-netx/xc.c | 1 +
- arch/arm/mach-omap1/board-ams-delta.c | 1 +
- arch/arm/mach-omap1/board-sx1.c | 1 +
- arch/arm/mach-omap1/board-voiceblue.c | 1 +
- arch/arm/mach-omap2/board-omap3evm.c | 1 +
- arch/arm/mach-omap2/pm.c | 1 +
- arch/arm/mach-omap2/prcm.c | 1 +
- arch/arm/mach-omap2/usb-tusb6010.c | 1 +
- arch/arm/mach-omap2/voltage.c | 1 +
- arch/arm/mach-pxa/poodle.c | 1 +
- arch/arm/mach-pxa/trizeps4.c | 1 +
- arch/arm/mach-s3c2410/mach-h1940.c | 1 +
- arch/arm/mach-s3c64xx/dev-audio.c | 1 +
- arch/arm/mach-shmobile/clock.c | 1 +
- arch/arm/mach-tegra/pcie.c | 1 +
- arch/arm/mm/init.c | 1 +
- arch/arm/plat-iop/gpio.c | 1 +
- arch/arm/plat-iop/time.c | 1 +
- arch/arm/plat-omap/clock.c | 1 +
- 34 files changed, 34 insertions(+)
-
-diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
-index 7a21927..f8524ac 100644
---- a/arch/arm/common/it8152.c
-+++ b/arch/arm/common/it8152.c
-@@ -25,6 +25,7 @@
- #include <linux/ioport.h>
- #include <linux/irq.h>
- #include <linux/io.h>
-+#include <linux/export.h>
-
- #include <asm/mach/pci.h>
- #include <asm/hardware/it8152.h>
-diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
-index c11af1e..67685fd 100644
---- a/arch/arm/common/scoop.c
-+++ b/arch/arm/common/scoop.c
-@@ -15,6 +15,7 @@
- #include <linux/string.h>
- #include <linux/slab.h>
- #include <linux/platform_device.h>
-+#include <linux/export.h>
- #include <linux/io.h>
- #include <asm/gpio.h>
- #include <asm/hardware/scoop.h>
-diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
-index 1cfeac1..f474272 100644
---- a/arch/arm/mach-at91/cpuidle.c
-+++ b/arch/arm/mach-at91/cpuidle.c
-@@ -19,6 +19,7 @@
- #include <linux/cpuidle.h>
- #include <asm/proc-fns.h>
- #include <linux/io.h>
-+#include <linux/export.h>
-
- #include "pm.h"
-
-diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
-index 556bbd4..6b1760f 100644
---- a/arch/arm/mach-davinci/board-dm644x-evm.c
-+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
-@@ -23,6 +23,7 @@
- #include <linux/phy.h>
- #include <linux/clk.h>
- #include <linux/videodev2.h>
-+#include <linux/export.h>
-
- #include <media/tvp514x.h>
-
-diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
-index 3cdd237..f28a884 100644
---- a/arch/arm/mach-davinci/board-dm646x-evm.c
-+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
-@@ -31,6 +31,7 @@
- #include <linux/mtd/nand.h>
- #include <linux/mtd/partitions.h>
- #include <linux/clk.h>
-+#include <linux/export.h>
-
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
-diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
-index 41669ec..5bba707 100644
---- a/arch/arm/mach-davinci/cpufreq.c
-+++ b/arch/arm/mach-davinci/cpufreq.c
-@@ -24,6 +24,7 @@
- #include <linux/err.h>
- #include <linux/clk.h>
- #include <linux/platform_device.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <mach/cpufreq.h>
-diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
-index bd59f31..85cc399 100644
---- a/arch/arm/mach-davinci/cpuidle.c
-+++ b/arch/arm/mach-davinci/cpuidle.c
-@@ -16,6 +16,7 @@
- #include <linux/platform_device.h>
- #include <linux/cpuidle.h>
- #include <linux/io.h>
-+#include <linux/export.h>
- #include <asm/proc-fns.h>
-
- #include <mach/cpuidle.h>
-diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
-index 6659a0d..a946b20 100644
---- a/arch/arm/mach-ep93xx/core.c
-+++ b/arch/arm/mach-ep93xx/core.c
-@@ -33,6 +33,7 @@
- #include <linux/i2c.h>
- #include <linux/i2c-gpio.h>
- #include <linux/spi/spi.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <mach/fb.h>
-diff --git a/arch/arm/mach-exynos4/dev-sysmmu.c b/arch/arm/mach-exynos4/dev-sysmmu.c
-index 3b7cae0..781563f 100644
---- a/arch/arm/mach-exynos4/dev-sysmmu.c
-+++ b/arch/arm/mach-exynos4/dev-sysmmu.c
-@@ -12,6 +12,7 @@
-
- #include <linux/platform_device.h>
- #include <linux/dma-mapping.h>
-+#include <linux/export.h>
-
- #include <mach/map.h>
- #include <mach/irqs.h>
-diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
-index ba3dae3..0de7ad2 100644
---- a/arch/arm/mach-iop13xx/pci.c
-+++ b/arch/arm/mach-iop13xx/pci.c
-@@ -21,6 +21,7 @@
- #include <linux/slab.h>
- #include <linux/delay.h>
- #include <linux/jiffies.h>
-+#include <linux/export.h>
- #include <asm/irq.h>
- #include <mach/hardware.h>
- #include <asm/sizes.h>
-diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
-index 4068166..276391e 100644
---- a/arch/arm/mach-ixp2000/core.c
-+++ b/arch/arm/mach-ixp2000/core.c
-@@ -25,6 +25,7 @@
- #include <linux/bitops.h>
- #include <linux/serial_8250.h>
- #include <linux/mm.h>
-+#include <linux/export.h>
-
- #include <asm/types.h>
- #include <asm/setup.h>
-diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
-index e9a5893..98bebd1 100644
---- a/arch/arm/mach-ixp4xx/common-pci.c
-+++ b/arch/arm/mach-ixp4xx/common-pci.c
-@@ -26,6 +26,7 @@
- #include <linux/delay.h>
- #include <linux/device.h>
- #include <linux/io.h>
-+#include <linux/export.h>
- #include <asm/dma-mapping.h>
-
- #include <asm/cputype.h>
-diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
-index 0777257..b86a005 100644
---- a/arch/arm/mach-ixp4xx/common.c
-+++ b/arch/arm/mach-ixp4xx/common.c
-@@ -28,6 +28,7 @@
- #include <linux/clocksource.h>
- #include <linux/clockchips.h>
- #include <linux/io.h>
-+#include <linux/export.h>
-
- #include <mach/udc.h>
- #include <mach/hardware.h>
-diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
-index f68d33f..864e569 100644
---- a/arch/arm/mach-kirkwood/cpuidle.c
-+++ b/arch/arm/mach-kirkwood/cpuidle.c
-@@ -18,6 +18,7 @@
- #include <linux/platform_device.h>
- #include <linux/cpuidle.h>
- #include <linux/io.h>
-+#include <linux/export.h>
- #include <asm/proc-fns.h>
- #include <mach/kirkwood.h>
-
-diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
-index cec6ed1..8bf34bc 100644
---- a/arch/arm/mach-msm/io.c
-+++ b/arch/arm/mach-msm/io.c
-@@ -20,6 +20,7 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/io.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <asm/page.h>
-diff --git a/arch/arm/mach-netx/xc.c b/arch/arm/mach-netx/xc.c
-index f009b54..e4cfb7e 100644
---- a/arch/arm/mach-netx/xc.c
-+++ b/arch/arm/mach-netx/xc.c
-@@ -23,6 +23,7 @@
- #include <linux/mutex.h>
- #include <linux/slab.h>
- #include <linux/io.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <mach/irqs.h>
-diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
-index f49ce85..be8fe81 100644
---- a/arch/arm/mach-omap1/board-ams-delta.c
-+++ b/arch/arm/mach-omap1/board-ams-delta.c
-@@ -19,6 +19,7 @@
- #include <linux/leds.h>
- #include <linux/platform_device.h>
- #include <linux/serial_8250.h>
-+#include <linux/export.h>
-
- #include <media/soc_camera.h>
-
-diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
-index 0ad781d..63c550c 100644
---- a/arch/arm/mach-omap1/board-sx1.c
-+++ b/arch/arm/mach-omap1/board-sx1.c
-@@ -26,6 +26,7 @@
- #include <linux/types.h>
- #include <linux/i2c.h>
- #include <linux/errno.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <asm/mach-types.h>
-diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
-index 65d2420..f2e5eed 100644
---- a/arch/arm/mach-omap1/board-voiceblue.c
-+++ b/arch/arm/mach-omap1/board-voiceblue.c
-@@ -24,6 +24,7 @@
- #include <linux/serial_8250.h>
- #include <linux/serial_reg.h>
- #include <linux/smc91x.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <mach/system.h>
-diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
-index b4d4346..0661686 100644
---- a/arch/arm/mach-omap2/board-omap3evm.c
-+++ b/arch/arm/mach-omap2/board-omap3evm.c
-@@ -34,6 +34,7 @@
- #include <linux/regulator/fixed.h>
- #include <linux/regulator/machine.h>
- #include <linux/mmc/host.h>
-+#include <linux/export.h>
-
- #include <mach/hardware.h>
- #include <asm/mach-types.h>
-diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
-index 49486f5..39ce26c 100644
---- a/arch/arm/mach-omap2/pm.c
-+++ b/arch/arm/mach-omap2/pm.c
-@@ -14,6 +14,7 @@
- #include <linux/io.h>
- #include <linux/err.h>
- #include <linux/opp.h>
-+#include <linux/export.h>
-
- #include <plat/omap-pm.h>
- #include <plat/omap_device.h>
-diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
-index 6be1438..1a5054e 100644
---- a/arch/arm/mach-omap2/prcm.c
-+++ b/arch/arm/mach-omap2/prcm.c
-@@ -23,6 +23,7 @@
- #include <linux/clk.h>
- #include <linux/io.h>
- #include <linux/delay.h>
-+#include <linux/export.h>
-
- #include <mach/system.h>
- #include <plat/common.h>
-diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
-index 8dd26b7..d7f4a00 100644
---- a/arch/arm/mach-omap2/usb-tusb6010.c
-+++ b/arch/arm/mach-omap2/usb-tusb6010.c
-@@ -13,6 +13,7 @@
- #include <linux/delay.h>
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
-+#include <linux/export.h>
-
- #include <linux/usb/musb.h>
-
-diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
-index 9ef3789..e964cfd 100644
---- a/arch/arm/mach-omap2/voltage.c
-+++ b/arch/arm/mach-omap2/voltage.c
-@@ -23,6 +23,7 @@
- #include <linux/io.h>
- #include <linux/clk.h>
- #include <linux/err.h>
-+#include <linux/export.h>
- #include <linux/debugfs.h>
- #include <linux/slab.h>
-
-diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
-index 16d14fd..46db441 100644
---- a/arch/arm/mach-pxa/poodle.c
-+++ b/arch/arm/mach-pxa/poodle.c
-@@ -16,6 +16,7 @@
- */
- #include <linux/kernel.h>
- #include <linux/init.h>
-+#include <linux/export.h>
- #include <linux/platform_device.h>
- #include <linux/fb.h>
- #include <linux/pm.h>
-diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
-index 687417a..3f1a258 100644
---- a/arch/arm/mach-pxa/trizeps4.c
-+++ b/arch/arm/mach-pxa/trizeps4.c
-@@ -16,6 +16,7 @@
- #include <linux/kernel.h>
- #include <linux/platform_device.h>
- #include <linux/interrupt.h>
-+#include <linux/export.h>
- #include <linux/sched.h>
- #include <linux/bitops.h>
- #include <linux/fb.h>
-diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
-index 2a2fa06..810a992 100644
---- a/arch/arm/mach-s3c2410/mach-h1940.c
-+++ b/arch/arm/mach-s3c2410/mach-h1940.c
-@@ -35,6 +35,7 @@
- #include <video/platform_lcd.h>
-
- #include <linux/mmc/host.h>
-+#include <linux/export.h>
-
- #include <asm/mach/arch.h>
- #include <asm/mach/map.h>
-diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
-index cad6702..93470b1 100644
---- a/arch/arm/mach-s3c64xx/dev-audio.c
-+++ b/arch/arm/mach-s3c64xx/dev-audio.c
-@@ -13,6 +13,7 @@
- #include <linux/platform_device.h>
- #include <linux/dma-mapping.h>
- #include <linux/gpio.h>
-+#include <linux/export.h>
-
- #include <mach/irqs.h>
- #include <mach/map.h>
-diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c
-index 6b7c7c4..31654d7 100644
---- a/arch/arm/mach-shmobile/clock.c
-+++ b/arch/arm/mach-shmobile/clock.c
-@@ -22,6 +22,7 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/sh_clk.h>
-+#include <linux/export.h>
-
- int __init clk_init(void)
- {
-diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
-index 2941212..c75df9c 100644
---- a/arch/arm/mach-tegra/pcie.c
-+++ b/arch/arm/mach-tegra/pcie.c
-@@ -32,6 +32,7 @@
- #include <linux/irq.h>
- #include <linux/clk.h>
- #include <linux/delay.h>
-+#include <linux/export.h>
-
- #include <asm/sizes.h>
- #include <asm/mach/pci.h>
-diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index 4a4eba5..e038b49 100644
---- a/arch/arm/mm/init.c
-+++ b/arch/arm/mm/init.c
-@@ -13,6 +13,7 @@
- #include <linux/init.h>
- #include <linux/bootmem.h>
- #include <linux/mman.h>
-+#include <linux/export.h>
- #include <linux/nodemask.h>
- #include <linux/initrd.h>
- #include <linux/of_fdt.h>
-diff --git a/arch/arm/plat-iop/gpio.c b/arch/arm/plat-iop/gpio.c
-index 640e498..e4de9be 100644
---- a/arch/arm/plat-iop/gpio.c
-+++ b/arch/arm/plat-iop/gpio.c
-@@ -15,6 +15,7 @@
- #include <linux/types.h>
- #include <linux/errno.h>
- #include <linux/gpio.h>
-+#include <linux/export.h>
- #include <asm/hardware/iop3xx.h>
-
- void gpio_line_config(int line, int direction)
-diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
-index 7cdc516..568dd02 100644
---- a/arch/arm/plat-iop/time.c
-+++ b/arch/arm/plat-iop/time.c
-@@ -22,6 +22,7 @@
- #include <linux/io.h>
- #include <linux/clocksource.h>
- #include <linux/clockchips.h>
-+#include <linux/export.h>
- #include <mach/hardware.h>
- #include <asm/irq.h>
- #include <asm/sched_clock.h>
-diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
-index c9122dd..4910bc0 100644
---- a/arch/arm/plat-omap/clock.c
-+++ b/arch/arm/plat-omap/clock.c
-@@ -14,6 +14,7 @@
- #include <linux/init.h>
- #include <linux/list.h>
- #include <linux/errno.h>
-+#include <linux/export.h>
- #include <linux/err.h>
- #include <linux/string.h>
- #include <linux/clk.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0003-ARM-mach-shmobile-cpuidle-single-global-and-last_sta.patch b/patches.armadillo800eva/0003-ARM-mach-shmobile-cpuidle-single-global-and-last_sta.patch
deleted file mode 100644
index 4ee713f15b2915..00000000000000
--- a/patches.armadillo800eva/0003-ARM-mach-shmobile-cpuidle-single-global-and-last_sta.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 5682eb0543203ca520e407300fb8a1c0a39bfeaf Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Fri, 11 Nov 2011 14:01:30 +0900
-Subject: ARM: mach-shmobile: cpuidle single/global and last_state fixes
-
-The following commits break cpuidle on SH-Mobile ARM:
-
-46bcfad cpuidle: Single/Global registration of idle states
-e978aa7 cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
-
-This patch remedies these issues by up-porting the SH-Mobile
-code to fit with the above introduced framework changes.
-
-It is worth noting that the new code becomes significantly cleaner,
-so these framework changes are very welcome. At the same time this
-breakage could probably have been avoided by grepping for "last_state"
-and "cpuidle_register_driver".
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b73b5c493ac001870bd9faf565a61908c82f52d8)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/cpuidle.c | 52 ++++++++++++--------------
- arch/arm/mach-shmobile/include/mach/common.h | 4 +-
- arch/arm/mach-shmobile/pm-sh7372.c | 14 +++----
- 3 files changed, 30 insertions(+), 40 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
-index 2e44f11..1b23342 100644
---- a/arch/arm/mach-shmobile/cpuidle.c
-+++ b/arch/arm/mach-shmobile/cpuidle.c
-@@ -26,65 +26,59 @@ void (*shmobile_cpuidle_modes[CPUIDLE_STATE_MAX])(void) = {
- };
-
- static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ struct cpuidle_driver *drv,
-+ int index)
- {
- ktime_t before, after;
-- int requested_state = state - &dev->states[0];
-
-- dev->last_state = &dev->states[requested_state];
- before = ktime_get();
-
- local_irq_disable();
- local_fiq_disable();
-
-- shmobile_cpuidle_modes[requested_state]();
-+ shmobile_cpuidle_modes[index]();
-
- local_irq_enable();
- local_fiq_enable();
-
- after = ktime_get();
-- return ktime_to_ns(ktime_sub(after, before)) >> 10;
-+ dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;
-+
-+ return index;
- }
-
- static struct cpuidle_device shmobile_cpuidle_dev;
- static struct cpuidle_driver shmobile_cpuidle_driver = {
- .name = "shmobile_cpuidle",
- .owner = THIS_MODULE,
-+ .states[0] = {
-+ .name = "C1",
-+ .desc = "WFI",
-+ .exit_latency = 1,
-+ .target_residency = 1 * 2,
-+ .flags = CPUIDLE_FLAG_TIME_VALID,
-+ },
-+ .safe_state_index = 0, /* C1 */
-+ .state_count = 1,
- };
-
--void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
-+void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
-
- static int shmobile_cpuidle_init(void)
- {
- struct cpuidle_device *dev = &shmobile_cpuidle_dev;
-- struct cpuidle_state *state;
-+ struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
- int i;
-
-- cpuidle_register_driver(&shmobile_cpuidle_driver);
--
-- for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
-- dev->states[i].name[0] = '\0';
-- dev->states[i].desc[0] = '\0';
-- dev->states[i].enter = shmobile_cpuidle_enter;
-- }
--
-- i = CPUIDLE_DRIVER_STATE_START;
--
-- state = &dev->states[i++];
-- snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
-- strncpy(state->desc, "WFI", CPUIDLE_DESC_LEN);
-- state->exit_latency = 1;
-- state->target_residency = 1 * 2;
-- state->power_usage = 3;
-- state->flags = 0;
-- state->flags |= CPUIDLE_FLAG_TIME_VALID;
--
-- dev->safe_state = state;
-- dev->state_count = i;
-+ for (i = 0; i < CPUIDLE_STATE_MAX; i++)
-+ drv->states[i].enter = shmobile_cpuidle_enter;
-
- if (shmobile_cpuidle_setup)
-- shmobile_cpuidle_setup(dev);
-+ shmobile_cpuidle_setup(drv);
-+
-+ cpuidle_register_driver(drv);
-
-+ dev->state_count = drv->state_count;
- cpuidle_register_device(dev);
-
- return 0;
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index 06aecb3..37c05ac 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -9,9 +9,9 @@ extern int clk_init(void);
- extern void shmobile_handle_irq_intc(struct pt_regs *);
- extern void shmobile_handle_irq_gic(struct pt_regs *);
- extern struct platform_suspend_ops shmobile_suspend_ops;
--struct cpuidle_device;
-+struct cpuidle_driver;
- extern void (*shmobile_cpuidle_modes[])(void);
--extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
-+extern void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
-
- extern void sh7367_init_irq(void);
- extern void sh7367_add_early_devices(void);
-diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
-index 8e4aadf..b516069 100644
---- a/arch/arm/mach-shmobile/pm-sh7372.c
-+++ b/arch/arm/mach-shmobile/pm-sh7372.c
-@@ -52,22 +52,18 @@ static void sh7372_enter_core_standby(void)
- }
-
- #ifdef CONFIG_CPU_IDLE
--static void sh7372_cpuidle_setup(struct cpuidle_device *dev)
-+static void sh7372_cpuidle_setup(struct cpuidle_driver *dev)
- {
-- struct cpuidle_state *state;
-- int i = dev->state_count;
-+ struct cpuidle_state *state = &drv->states[drv->state_count];
-
-- state = &dev->states[i];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
- strncpy(state->desc, "Core Standby Mode", CPUIDLE_DESC_LEN);
- state->exit_latency = 10;
- state->target_residency = 20 + 10;
-- state->power_usage = 1; /* perhaps not */
-- state->flags = 0;
-- state->flags |= CPUIDLE_FLAG_TIME_VALID;
-- shmobile_cpuidle_modes[i] = sh7372_enter_core_standby;
-+ state->flags = CPUIDLE_FLAG_TIME_VALID;
-+ shmobile_cpuidle_modes[drv->state_count] = sh7372_enter_core_standby;
-
-- dev->state_count = i + 1;
-+ drv->state_count++;
- }
-
- static void sh7372_cpuidle_init(void)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0004-ARM-entry-re-allocate-registers-in-irq-entry-assembl.patch b/patches.armadillo800eva/0004-ARM-entry-re-allocate-registers-in-irq-entry-assembl.patch
deleted file mode 100644
index a5b8cf3d73a6ae..00000000000000
--- a/patches.armadillo800eva/0004-ARM-entry-re-allocate-registers-in-irq-entry-assembl.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 0f8d4eb817d031882d348f61acdab92be7863533 Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Sun, 26 Jun 2011 10:34:02 +0100
-Subject: ARM: entry: re-allocate registers in irq entry assembly macros
-
-This avoids the irq entry assembly corrupting r5, thereby allowing it
-to be preserved through to the svc exit code.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit d9600c99c549732a501cb727157800623a06175d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/entry-macro-multi.S | 14 +++++++-------
- arch/arm/kernel/entry-armv.S | 10 +++++-----
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/arch/arm/include/asm/entry-macro-multi.S b/arch/arm/include/asm/entry-macro-multi.S
-index 2da8547..2f1e209 100644
---- a/arch/arm/include/asm/entry-macro-multi.S
-+++ b/arch/arm/include/asm/entry-macro-multi.S
-@@ -4,8 +4,8 @@
- * Interrupt handling. Preserves r7, r8, r9
- */
- .macro arch_irq_handler_default
-- get_irqnr_preamble r5, lr
--1: get_irqnr_and_base r0, r6, r5, lr
-+ get_irqnr_preamble r6, lr
-+1: get_irqnr_and_base r0, r2, r6, lr
- movne r1, sp
- @
- @ routine called with r0 = irq number, r1 = struct pt_regs *
-@@ -17,17 +17,17 @@
- /*
- * XXX
- *
-- * this macro assumes that irqstat (r6) and base (r5) are
-+ * this macro assumes that irqstat (r2) and base (r6) are
- * preserved from get_irqnr_and_base above
- */
-- ALT_SMP(test_for_ipi r0, r6, r5, lr)
-+ ALT_SMP(test_for_ipi r0, r2, r6, lr)
- ALT_UP_B(9997f)
- movne r1, sp
- adrne lr, BSYM(1b)
- bne do_IPI
-
- #ifdef CONFIG_LOCAL_TIMERS
-- test_for_ltirq r0, r6, r5, lr
-+ test_for_ltirq r0, r2, r6, lr
- movne r0, sp
- adrne lr, BSYM(1b)
- bne do_local_timer
-@@ -40,7 +40,7 @@
- .align 5
- .global \symbol_name
- \symbol_name:
-- mov r4, lr
-+ mov r8, lr
- arch_irq_handler_default
-- mov pc, r4
-+ mov pc, r8
- .endm
-diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
-index 90c62cd..f901c4a 100644
---- a/arch/arm/kernel/entry-armv.S
-+++ b/arch/arm/kernel/entry-armv.S
-@@ -29,16 +29,16 @@
- #include <asm/entry-macro-multi.S>
-
- /*
-- * Interrupt handling. Preserves r7, r8, r9
-+ * Interrupt handling.
- */
- .macro irq_handler
- #ifdef CONFIG_MULTI_IRQ_HANDLER
-- ldr r5, =handle_arch_irq
-+ ldr r1, =handle_arch_irq
- mov r0, sp
-- ldr r5, [r5]
-+ ldr r1, [r1]
- adr lr, BSYM(9997f)
-- teq r5, #0
-- movne pc, r5
-+ teq r1, #0
-+ movne pc, r1
- #endif
- arch_irq_handler_default
- 9997:
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0005-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch b/patches.armadillo800eva/0005-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
deleted file mode 100644
index a980580f7c0b2a..00000000000000
--- a/patches.armadillo800eva/0005-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 3411576376a113c3a7616495508d3219b18f90d4 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 21:41:30 +0900
-Subject: ARM: mach-shmobile: rename clk_init() to shmobile_clk_init()
-
-Rename clk_init() to shmobile_clk_init() to avoid a potential
-future name space collision with the common clock framework.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6b6a4c067cefe04eb0a0e7d1cace16ae727c6295)
-
-Conflicts:
-
- arch/arm/mach-shmobile/clock-r8a7740.c
- arch/arm/mach-shmobile/clock-r8a7779.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh7367.c | 2 +-
- arch/arm/mach-shmobile/clock-sh7372.c | 2 +-
- arch/arm/mach-shmobile/clock-sh7377.c | 2 +-
- arch/arm/mach-shmobile/clock-sh73a0.c | 2 +-
- arch/arm/mach-shmobile/clock.c | 2 +-
- arch/arm/mach-shmobile/include/mach/common.h | 2 +-
- 6 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
-index 6b186ae..414a3e7 100644
---- a/arch/arm/mach-shmobile/clock-sh7367.c
-+++ b/arch/arm/mach-shmobile/clock-sh7367.c
-@@ -352,7 +352,7 @@ void __init sh7367_clock_init(void)
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
-- clk_init();
-+ shmobile_clk_init();
- else
- panic("failed to setup sh7367 clocks\n");
- }
-diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
-index c0800d8..24e0cac 100644
---- a/arch/arm/mach-shmobile/clock-sh7372.c
-+++ b/arch/arm/mach-shmobile/clock-sh7372.c
-@@ -696,7 +696,7 @@ void __init sh7372_clock_init(void)
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
-- clk_init();
-+ shmobile_clk_init();
- else
- panic("failed to setup sh7372 clocks\n");
-
-diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c
-index 9594246..b88ebd8 100644
---- a/arch/arm/mach-shmobile/clock-sh7377.c
-+++ b/arch/arm/mach-shmobile/clock-sh7377.c
-@@ -363,7 +363,7 @@ void __init sh7377_clock_init(void)
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
-- clk_init();
-+ shmobile_clk_init();
- else
- panic("failed to setup sh7377 clocks\n");
- }
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index bcacb1e..8d4b5db 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -399,7 +399,7 @@ void __init sh73a0_clock_init(void)
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
-- clk_init();
-+ shmobile_clk_init();
- else
- panic("failed to setup sh73a0 clocks\n");
- }
-diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c
-index 31654d7..e816ca9 100644
---- a/arch/arm/mach-shmobile/clock.c
-+++ b/arch/arm/mach-shmobile/clock.c
-@@ -24,7 +24,7 @@
- #include <linux/sh_clk.h>
- #include <linux/export.h>
-
--int __init clk_init(void)
-+int __init shmobile_clk_init(void)
- {
- /* Kick the child clocks.. */
- recalculate_root_clocks();
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index 37c05ac..df9c771 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -5,7 +5,7 @@ extern struct sys_timer shmobile_timer;
- extern void shmobile_setup_console(void);
- extern void shmobile_secondary_vector(void);
- struct clk;
--extern int clk_init(void);
-+extern int shmobile_clk_init(void);
- extern void shmobile_handle_irq_intc(struct pt_regs *);
- extern void shmobile_handle_irq_gic(struct pt_regs *);
- extern struct platform_suspend_ops shmobile_suspend_ops;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0006-ARM-mach-shmobile-add-shmobile_earlytimer_init.patch b/patches.armadillo800eva/0006-ARM-mach-shmobile-add-shmobile_earlytimer_init.patch
deleted file mode 100644
index f889bb411954b2..00000000000000
--- a/patches.armadillo800eva/0006-ARM-mach-shmobile-add-shmobile_earlytimer_init.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 6b04d564a5743c0c719fb3f78e1c41332a23f911 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 6 Mar 2012 17:36:14 +0900
-Subject: ARM: mach-shmobile: add shmobile_earlytimer_init()
-
-Add shmobile_earlytimer_init() that can be used to
-enable the earlytimer probing from the SoC code.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 08ad42fb7702ee2968b5b837e245ca8fd2175223)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/common.h | 1 +
- arch/arm/mach-shmobile/timer.c | 7 ++++++-
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index df9c771..0e37fd5 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -1,6 +1,7 @@
- #ifndef __ARCH_MACH_COMMON_H
- #define __ARCH_MACH_COMMON_H
-
-+extern void shmobile_earlytimer_init(void);
- extern struct sys_timer shmobile_timer;
- extern void shmobile_setup_console(void);
- extern void shmobile_secondary_vector(void);
-diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
-index 895794b..e510643 100644
---- a/arch/arm/mach-shmobile/timer.c
-+++ b/arch/arm/mach-shmobile/timer.c
-@@ -36,11 +36,16 @@ static void __init shmobile_late_time_init(void)
- early_platform_driver_probe("earlytimer", 2, 0);
- }
-
--static void __init shmobile_timer_init(void)
-+void __init shmobile_earlytimer_init(void)
- {
- late_time_init = shmobile_late_time_init;
- }
-
-+static void __init shmobile_timer_init(void)
-+{
-+ shmobile_earlytimer_init();
-+}
-+
- struct sys_timer shmobile_timer = {
- .init = shmobile_timer_init,
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0007-ARM-mach-shmobile-default-to-no-earlytimer.patch b/patches.armadillo800eva/0007-ARM-mach-shmobile-default-to-no-earlytimer.patch
deleted file mode 100644
index cc1fc147983323..00000000000000
--- a/patches.armadillo800eva/0007-ARM-mach-shmobile-default-to-no-earlytimer.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 7a7be0a20ac8e4a536f3797e98bd46ffb9b396ab Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 6 Mar 2012 17:37:09 +0900
-Subject: ARM: mach-shmobile: default to no earlytimer
-
-Now when all SoCs and boards are converted to use
-shmobile_earlytimer_init(), change the default behavior
-of shmobile_timer.init() from using early timer to
-do nothing which is suitable for upcoming DT support.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2854903ad1329d09d7ec35639fff0949e45d496d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/timer.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
-index e510643..be1ad70 100644
---- a/arch/arm/mach-shmobile/timer.c
-+++ b/arch/arm/mach-shmobile/timer.c
-@@ -43,7 +43,6 @@ void __init shmobile_earlytimer_init(void)
-
- static void __init shmobile_timer_init(void)
- {
-- shmobile_earlytimer_init();
- }
-
- struct sys_timer shmobile_timer = {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0008-ARM-shmobile-Consolidate-time-keeping-and-irq-enable.patch b/patches.armadillo800eva/0008-ARM-shmobile-Consolidate-time-keeping-and-irq-enable.patch
deleted file mode 100644
index 69f358a6e20d76..00000000000000
--- a/patches.armadillo800eva/0008-ARM-shmobile-Consolidate-time-keeping-and-irq-enable.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From bfff9fdccdee8f8073db730e3de9f6a44506cae3 Mon Sep 17 00:00:00 2001
-From: Robert Lee <rob.lee@linaro.org>
-Date: Tue, 20 Mar 2012 15:22:48 -0500
-Subject: ARM: shmobile: Consolidate time keeping and irq enable
-
-Enable core cpuidle timekeeping and irq enabling and remove that
-handling from this code.
-
-Signed-off-by: Robert Lee <rob.lee@linaro.org>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-Acked-by: Jean Pihet <j-pihet@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit ee807dd89c0003a5cc0ec961132cd83542e5c30c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/cpuidle.c | 31 +++++++------------------------
- 1 file changed, 7 insertions(+), 24 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
-index 1b23342..ca23b20 100644
---- a/arch/arm/mach-shmobile/cpuidle.c
-+++ b/arch/arm/mach-shmobile/cpuidle.c
-@@ -14,6 +14,7 @@
- #include <linux/module.h>
- #include <linux/err.h>
- #include <asm/system.h>
-+#include <asm/cpuidle.h>
- #include <asm/io.h>
-
- static void shmobile_enter_wfi(void)
-@@ -29,37 +30,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
- struct cpuidle_driver *drv,
- int index)
- {
-- ktime_t before, after;
--
-- before = ktime_get();
--
-- local_irq_disable();
-- local_fiq_disable();
--
- shmobile_cpuidle_modes[index]();
-
-- local_irq_enable();
-- local_fiq_enable();
--
-- after = ktime_get();
-- dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;
--
- return index;
- }
-
- static struct cpuidle_device shmobile_cpuidle_dev;
- static struct cpuidle_driver shmobile_cpuidle_driver = {
-- .name = "shmobile_cpuidle",
-- .owner = THIS_MODULE,
-- .states[0] = {
-- .name = "C1",
-- .desc = "WFI",
-- .exit_latency = 1,
-- .target_residency = 1 * 2,
-- .flags = CPUIDLE_FLAG_TIME_VALID,
-- },
-- .safe_state_index = 0, /* C1 */
-- .state_count = 1,
-+ .name = "shmobile_cpuidle",
-+ .owner = THIS_MODULE,
-+ .en_core_tk_irqen = 1,
-+ .states[0] = ARM_CPUIDLE_WFI_STATE,
-+ .safe_state_index = 0, /* C1 */
-+ .state_count = 1,
- };
-
- void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0009-sh-pfc-get_config_reg-shift-clean-up.patch b/patches.armadillo800eva/0009-sh-pfc-get_config_reg-shift-clean-up.patch
deleted file mode 100644
index caefc059337bf6..00000000000000
--- a/patches.armadillo800eva/0009-sh-pfc-get_config_reg-shift-clean-up.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 811361798c18763f34b352aebd167eaf01a30b86 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 17 Oct 2011 18:01:19 +0900
-Subject: sh: pfc: get_config_reg() shift clean up
-
-Clean up the f_width shift code in get_config_reg().
-
-Reported-by: Ryusuke Sakato <ryusuke.sakato.bx@renesas.com>
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit c63bcc6ff135397b38cdb510c173e4a6629cede5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index 75934e3..de5e3d6 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -217,7 +217,7 @@ static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
-
- if (!r_width)
- break;
-- for (n = 0; n < (r_width / f_width) * 1 << f_width; n++) {
-+ for (n = 0; n < (r_width / f_width) * (1 << f_width); n++) {
- if (config_reg->enum_ids[n] == enum_id) {
- *crp = config_reg;
- *indexp = n;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0010-sh-pfc-Remove-unused-gpio_in_use-member.patch b/patches.armadillo800eva/0010-sh-pfc-Remove-unused-gpio_in_use-member.patch
deleted file mode 100644
index efd5b8a0dcf76f..00000000000000
--- a/patches.armadillo800eva/0010-sh-pfc-Remove-unused-gpio_in_use-member.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 3d57900896786b299b6a2e7a3c0514f8b74063dc Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 28 Sep 2011 16:47:06 +0900
-Subject: sh: pfc: Remove unused gpio_in_use member
-
-Remove unused member gpio_in_use from struct pinmux_info.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 2854aedd05255f3142167f4ac715ab67ee569004)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/sh_pfc.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 30cae70..12f3519 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -87,7 +87,6 @@ struct pinmux_info {
- pinmux_enum_t *gpio_data;
- unsigned int gpio_data_size;
-
-- unsigned long *gpio_in_use;
- struct gpio_chip chip;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0011-sh-pfc-Add-GPIO-IRQ-support.patch b/patches.armadillo800eva/0011-sh-pfc-Add-GPIO-IRQ-support.patch
deleted file mode 100644
index 84d4066256f6f9..00000000000000
--- a/patches.armadillo800eva/0011-sh-pfc-Add-GPIO-IRQ-support.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 8baa9a6e15ed242d3900b8c0caff14f85a0d3f8a Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 28 Sep 2011 16:50:58 +0900
-Subject: sh: pfc: Add GPIO IRQ support
-
-Add GPIO IRQ support to the shared PFC code in drivers/sh/pfc.c
-
-The enums pointed out by a certain GPIO will be matched against
-a table for IRQ to enum mappings.
-
-Only the shared PFC code is updated by this patch. SoC specific
-changes are also needed to allow platforms to make use of this
-feature.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit ad2a8e7ea4128af984a98537b1b9484722b6b4bb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 27 +++++++++++++++++++++++++++
- include/linux/sh_pfc.h | 11 +++++++++++
- 2 files changed, 38 insertions(+)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index de5e3d6..e67fe17 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -577,6 +577,32 @@ static void sh_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
- sh_gpio_set_value(chip_to_pinmux(chip), offset, value);
- }
-
-+static int sh_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
-+{
-+ struct pinmux_info *gpioc = chip_to_pinmux(chip);
-+ pinmux_enum_t enum_id;
-+ pinmux_enum_t *enum_ids;
-+ int i, k, pos;
-+
-+ pos = 0;
-+ enum_id = 0;
-+ while (1) {
-+ pos = get_gpio_enum_id(gpioc, offset, pos, &enum_id);
-+ if (pos <= 0 || !enum_id)
-+ break;
-+
-+ for (i = 0; i < gpioc->gpio_irq_size; i++) {
-+ enum_ids = gpioc->gpio_irq[i].enum_ids;
-+ for (k = 0; enum_ids[k]; k++) {
-+ if (enum_ids[k] == enum_id)
-+ return gpioc->gpio_irq[i].irq;
-+ }
-+ }
-+ }
-+
-+ return -ENOSYS;
-+}
-+
- int register_pinmux(struct pinmux_info *pip)
- {
- struct gpio_chip *chip = &pip->chip;
-@@ -592,6 +618,7 @@ int register_pinmux(struct pinmux_info *pip)
- chip->get = sh_gpio_get;
- chip->direction_output = sh_gpio_direction_output;
- chip->set = sh_gpio_set;
-+ chip->to_irq = sh_gpio_to_irq;
-
- WARN_ON(pip->first_gpio != 0); /* needs testing */
-
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 12f3519..bc8c920 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -61,6 +61,14 @@ struct pinmux_data_reg {
- .reg = r, .reg_width = r_width, \
- .enum_ids = (pinmux_enum_t [r_width]) \
-
-+struct pinmux_irq {
-+ int irq;
-+ pinmux_enum_t *enum_ids;
-+};
-+
-+#define PINMUX_IRQ(irq_nr, ids...) \
-+ { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } } \
-+
- struct pinmux_range {
- pinmux_enum_t begin;
- pinmux_enum_t end;
-@@ -87,6 +95,9 @@ struct pinmux_info {
- pinmux_enum_t *gpio_data;
- unsigned int gpio_data_size;
-
-+ struct pinmux_irq *gpio_irq;
-+ unsigned int gpio_irq_size;
-+
- struct gpio_chip chip;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0012-ARM-mach-shmobile-move-helper-macro-PORT_DATA_xx-to-.patch b/patches.armadillo800eva/0012-ARM-mach-shmobile-move-helper-macro-PORT_DATA_xx-to-.patch
deleted file mode 100644
index 211d8ab21c0598..00000000000000
--- a/patches.armadillo800eva/0012-ARM-mach-shmobile-move-helper-macro-PORT_DATA_xx-to-.patch
+++ /dev/null
@@ -1,443 +0,0 @@
-From 18177d90d34aaeb37d44df01b374cc2d5419e832 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:45:23 -0800
-Subject: ARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.h
-
-This patch move PORT_DATA_xx helper macro to sh_pfc.h.
-and pfc-sh7372.c used it
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit bd8d0cbaa00883c84741b98264f8318cdade9c71)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-sh7367.c | 35 ------
- arch/arm/mach-shmobile/pfc-sh7372.c | 214 +++++++++++++++++++----------------
- arch/arm/mach-shmobile/pfc-sh7377.c | 39 -------
- arch/arm/mach-shmobile/pfc-sh73a0.c | 39 -------
- include/linux/sh_pfc.h | 36 ++++++
- 5 files changed, 151 insertions(+), 212 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
-index 128555e..2518116 100644
---- a/arch/arm/mach-shmobile/pfc-sh7367.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
-@@ -327,41 +327,6 @@ enum {
- PINMUX_MARK_END,
- };
-
--#define PORT_DATA_I(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
--
--#define PORT_DATA_I_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--#define PORT_DATA_I_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--#define PORT_DATA_I_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
--#define PORT_DATA_O(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
--
--#define PORT_DATA_IO(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN)
--
--#define PORT_DATA_IO_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--#define PORT_DATA_IO_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--#define PORT_DATA_IO_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
--
- static pinmux_enum_t pinmux_data[] = {
-
- /* specify valid pin states for each pin in GPIO mode */
-diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
-index 9c265da..34d6d76 100644
---- a/arch/arm/mach-shmobile/pfc-sh7372.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
-@@ -381,108 +381,124 @@ enum {
- PINMUX_MARK_END,
- };
-
--/* PORT_DATA_I_PD(nr) */
--#define _I___D(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--/* PORT_DATA_I_PU(nr) */
--#define _I__U_(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--/* PORT_DATA_I_PU_PD(nr) */
--#define _I__UD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
--/* PORT_DATA_O(nr) */
--#define __O___(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
--
--/* PORT_DATA_IO(nr) */
--#define _IO___(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN)
--
--/* PORT_DATA_IO_PD(nr) */
--#define _IO__D(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--/* PORT_DATA_IO_PU(nr) */
--#define _IO_U_(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--/* PORT_DATA_IO_PU_PD(nr) */
--#define _IO_UD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
--
- static pinmux_enum_t pinmux_data[] = {
-
- /* specify valid pin states for each pin in GPIO mode */
--
-- _IO__D(0), _IO__D(1), __O___(2), _I___D(3), _I___D(4),
-- _I___D(5), _IO_UD(6), _I___D(7), _IO__D(8), __O___(9),
--
-- __O___(10), __O___(11), _IO_UD(12), _IO__D(13), _IO__D(14),
-- __O___(15), _IO__D(16), _IO__D(17), _I___D(18), _IO___(19),
--
-- _IO___(20), _IO___(21), _IO___(22), _IO___(23), _IO___(24),
-- _IO___(25), _IO___(26), _IO___(27), _IO___(28), _IO___(29),
--
-- _IO___(30), _IO___(31), _IO___(32), _IO___(33), _IO___(34),
-- _IO___(35), _IO___(36), _IO___(37), _IO___(38), _IO___(39),
--
-- _IO___(40), _IO___(41), _IO___(42), _IO___(43), _IO___(44),
-- _IO___(45), _IO_U_(46), _IO_U_(47), _IO_U_(48), _IO_U_(49),
--
-- _IO_U_(50), _IO_U_(51), _IO_U_(52), _IO_U_(53), _IO_U_(54),
-- _IO_U_(55), _IO_U_(56), _IO_U_(57), _IO_U_(58), _IO_U_(59),
--
-- _IO_U_(60), _IO_U_(61), _IO___(62), __O___(63), __O___(64),
-- _IO_U_(65), __O___(66), _IO_U_(67), __O___(68), _IO___(69), /*66?*/
--
-- _IO___(70), _IO___(71), __O___(72), _I__U_(73), _I__UD(74),
-- _IO_UD(75), _IO_UD(76), _IO_UD(77), _IO_UD(78), _IO_UD(79),
--
-- _IO_UD(80), _IO_UD(81), _IO_UD(82), _IO_UD(83), _IO_UD(84),
-- _IO_UD(85), _IO_UD(86), _IO_UD(87), _IO_UD(88), _IO_UD(89),
--
-- _IO_UD(90), _IO_UD(91), _IO_UD(92), _IO_UD(93), _IO_UD(94),
-- _IO_UD(95), _IO_U_(96), _IO_UD(97), _IO_UD(98), __O___(99), /*99?*/
--
-- _IO__D(100), _IO__D(101), _IO__D(102), _IO__D(103), _IO__D(104),
-- _IO__D(105), _IO_U_(106), _IO_U_(107), _IO_U_(108), _IO_U_(109),
--
-- _IO_U_(110), _IO_U_(111), _IO__D(112), _IO__D(113), _IO_U_(114),
-- _IO_U_(115), _IO_U_(116), _IO_U_(117), _IO_U_(118), _IO_U_(119),
--
-- _IO_U_(120), _IO__D(121), _IO__D(122), _IO__D(123), _IO__D(124),
-- _IO__D(125), _IO__D(126), _IO__D(127), _IO__D(128), _IO_UD(129),
--
-- _IO_UD(130), _IO_UD(131), _IO_UD(132), _IO_UD(133), _IO_UD(134),
-- _IO_UD(135), _IO__D(136), _IO__D(137), _IO__D(138), _IO__D(139),
--
-- _IO__D(140), _IO__D(141), _IO__D(142), _IO_UD(143), _IO__D(144),
-- _IO__D(145), _IO__D(146), _IO__D(147), _IO__D(148), _IO__D(149),
--
-- _IO__D(150), _IO__D(151), _IO_UD(152), _I___D(153), _IO_UD(154),
-- _I___D(155), _IO__D(156), _IO__D(157), _I___D(158), _IO__D(159),
--
-- __O___(160), _IO__D(161), _IO__D(162), _IO__D(163), _I___D(164),
-- _IO__D(165), _I___D(166), _I___D(167), _I___D(168), _I___D(169),
--
-- _I___D(170), __O___(171), _IO_UD(172), _IO_UD(173), _IO_UD(174),
-- _IO_UD(175), _IO_UD(176), _IO_UD(177), _IO_UD(178), __O___(179),
--
-- _IO_UD(180), _IO_UD(181), _IO_UD(182), _IO_UD(183), _IO_UD(184),
-- __O___(185), _IO_UD(186), _IO_UD(187), _IO_UD(188), _IO_UD(189),
--
-- _IO_UD(190),
-+ PORT_DATA_IO_PD(0), PORT_DATA_IO_PD(1),
-+ PORT_DATA_O(2), PORT_DATA_I_PD(3),
-+ PORT_DATA_I_PD(4), PORT_DATA_I_PD(5),
-+ PORT_DATA_IO_PU_PD(6), PORT_DATA_I_PD(7),
-+ PORT_DATA_IO_PD(8), PORT_DATA_O(9),
-+
-+ PORT_DATA_O(10), PORT_DATA_O(11),
-+ PORT_DATA_IO_PU_PD(12), PORT_DATA_IO_PD(13),
-+ PORT_DATA_IO_PD(14), PORT_DATA_O(15),
-+ PORT_DATA_IO_PD(16), PORT_DATA_IO_PD(17),
-+ PORT_DATA_I_PD(18), PORT_DATA_IO(19),
-+
-+ PORT_DATA_IO(20), PORT_DATA_IO(21),
-+ PORT_DATA_IO(22), PORT_DATA_IO(23),
-+ PORT_DATA_IO(24), PORT_DATA_IO(25),
-+ PORT_DATA_IO(26), PORT_DATA_IO(27),
-+ PORT_DATA_IO(28), PORT_DATA_IO(29),
-+
-+ PORT_DATA_IO(30), PORT_DATA_IO(31),
-+ PORT_DATA_IO(32), PORT_DATA_IO(33),
-+ PORT_DATA_IO(34), PORT_DATA_IO(35),
-+ PORT_DATA_IO(36), PORT_DATA_IO(37),
-+ PORT_DATA_IO(38), PORT_DATA_IO(39),
-+
-+ PORT_DATA_IO(40), PORT_DATA_IO(41),
-+ PORT_DATA_IO(42), PORT_DATA_IO(43),
-+ PORT_DATA_IO(44), PORT_DATA_IO(45),
-+ PORT_DATA_IO_PU(46), PORT_DATA_IO_PU(47),
-+ PORT_DATA_IO_PU(48), PORT_DATA_IO_PU(49),
-+
-+ PORT_DATA_IO_PU(50), PORT_DATA_IO_PU(51),
-+ PORT_DATA_IO_PU(52), PORT_DATA_IO_PU(53),
-+ PORT_DATA_IO_PU(54), PORT_DATA_IO_PU(55),
-+ PORT_DATA_IO_PU(56), PORT_DATA_IO_PU(57),
-+ PORT_DATA_IO_PU(58), PORT_DATA_IO_PU(59),
-+
-+ PORT_DATA_IO_PU(60), PORT_DATA_IO_PU(61),
-+ PORT_DATA_IO(62), PORT_DATA_O(63),
-+ PORT_DATA_O(64), PORT_DATA_IO_PU(65),
-+ PORT_DATA_O(66), PORT_DATA_IO_PU(67), /*66?*/
-+ PORT_DATA_O(68), PORT_DATA_IO(69),
-+
-+ PORT_DATA_IO(70), PORT_DATA_IO(71),
-+ PORT_DATA_O(72), PORT_DATA_I_PU(73),
-+ PORT_DATA_I_PU_PD(74), PORT_DATA_IO_PU_PD(75),
-+ PORT_DATA_IO_PU_PD(76), PORT_DATA_IO_PU_PD(77),
-+ PORT_DATA_IO_PU_PD(78), PORT_DATA_IO_PU_PD(79),
-+
-+ PORT_DATA_IO_PU_PD(80), PORT_DATA_IO_PU_PD(81),
-+ PORT_DATA_IO_PU_PD(82), PORT_DATA_IO_PU_PD(83),
-+ PORT_DATA_IO_PU_PD(84), PORT_DATA_IO_PU_PD(85),
-+ PORT_DATA_IO_PU_PD(86), PORT_DATA_IO_PU_PD(87),
-+ PORT_DATA_IO_PU_PD(88), PORT_DATA_IO_PU_PD(89),
-+
-+ PORT_DATA_IO_PU_PD(90), PORT_DATA_IO_PU_PD(91),
-+ PORT_DATA_IO_PU_PD(92), PORT_DATA_IO_PU_PD(93),
-+ PORT_DATA_IO_PU_PD(94), PORT_DATA_IO_PU_PD(95),
-+ PORT_DATA_IO_PU(96), PORT_DATA_IO_PU_PD(97),
-+ PORT_DATA_IO_PU_PD(98), PORT_DATA_O(99), /*99?*/
-+
-+ PORT_DATA_IO_PD(100), PORT_DATA_IO_PD(101),
-+ PORT_DATA_IO_PD(102), PORT_DATA_IO_PD(103),
-+ PORT_DATA_IO_PD(104), PORT_DATA_IO_PD(105),
-+ PORT_DATA_IO_PU(106), PORT_DATA_IO_PU(107),
-+ PORT_DATA_IO_PU(108), PORT_DATA_IO_PU(109),
-+
-+ PORT_DATA_IO_PU(110), PORT_DATA_IO_PU(111),
-+ PORT_DATA_IO_PD(112), PORT_DATA_IO_PD(113),
-+ PORT_DATA_IO_PU(114), PORT_DATA_IO_PU(115),
-+ PORT_DATA_IO_PU(116), PORT_DATA_IO_PU(117),
-+ PORT_DATA_IO_PU(118), PORT_DATA_IO_PU(119),
-+
-+ PORT_DATA_IO_PU(120), PORT_DATA_IO_PD(121),
-+ PORT_DATA_IO_PD(122), PORT_DATA_IO_PD(123),
-+ PORT_DATA_IO_PD(124), PORT_DATA_IO_PD(125),
-+ PORT_DATA_IO_PD(126), PORT_DATA_IO_PD(127),
-+ PORT_DATA_IO_PD(128), PORT_DATA_IO_PU_PD(129),
-+
-+ PORT_DATA_IO_PU_PD(130), PORT_DATA_IO_PU_PD(131),
-+ PORT_DATA_IO_PU_PD(132), PORT_DATA_IO_PU_PD(133),
-+ PORT_DATA_IO_PU_PD(134), PORT_DATA_IO_PU_PD(135),
-+ PORT_DATA_IO_PD(136), PORT_DATA_IO_PD(137),
-+ PORT_DATA_IO_PD(138), PORT_DATA_IO_PD(139),
-+
-+ PORT_DATA_IO_PD(140), PORT_DATA_IO_PD(141),
-+ PORT_DATA_IO_PD(142), PORT_DATA_IO_PU_PD(143),
-+ PORT_DATA_IO_PD(144), PORT_DATA_IO_PD(145),
-+ PORT_DATA_IO_PD(146), PORT_DATA_IO_PD(147),
-+ PORT_DATA_IO_PD(148), PORT_DATA_IO_PD(149),
-+
-+ PORT_DATA_IO_PD(150), PORT_DATA_IO_PD(151),
-+ PORT_DATA_IO_PU_PD(152), PORT_DATA_I_PD(153),
-+ PORT_DATA_IO_PU_PD(154), PORT_DATA_I_PD(155),
-+ PORT_DATA_IO_PD(156), PORT_DATA_IO_PD(157),
-+ PORT_DATA_I_PD(158), PORT_DATA_IO_PD(159),
-+
-+ PORT_DATA_O(160), PORT_DATA_IO_PD(161),
-+ PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163),
-+ PORT_DATA_I_PD(164), PORT_DATA_IO_PD(165),
-+ PORT_DATA_I_PD(166), PORT_DATA_I_PD(167),
-+ PORT_DATA_I_PD(168), PORT_DATA_I_PD(169),
-+
-+ PORT_DATA_I_PD(170), PORT_DATA_O(171),
-+ PORT_DATA_IO_PU_PD(172), PORT_DATA_IO_PU_PD(173),
-+ PORT_DATA_IO_PU_PD(174), PORT_DATA_IO_PU_PD(175),
-+ PORT_DATA_IO_PU_PD(176), PORT_DATA_IO_PU_PD(177),
-+ PORT_DATA_IO_PU_PD(178), PORT_DATA_O(179),
-+
-+ PORT_DATA_IO_PU_PD(180), PORT_DATA_IO_PU_PD(181),
-+ PORT_DATA_IO_PU_PD(182), PORT_DATA_IO_PU_PD(183),
-+ PORT_DATA_IO_PU_PD(184), PORT_DATA_O(185),
-+ PORT_DATA_IO_PU_PD(186), PORT_DATA_IO_PU_PD(187),
-+ PORT_DATA_IO_PU_PD(188), PORT_DATA_IO_PU_PD(189),
-+
-+ PORT_DATA_IO_PU_PD(190),
-
- /* IRQ */
- PINMUX_DATA(IRQ0_6_MARK, PORT6_FN0, MSEL1CR_0_0),
-diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
-index 613e684..e4c7018 100644
---- a/arch/arm/mach-shmobile/pfc-sh7377.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
-@@ -360,45 +360,6 @@ enum {
- PINMUX_MARK_END,
- };
-
--#define PORT_DATA_I(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
--
--#define PORT_DATA_I_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--#define PORT_DATA_I_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--#define PORT_DATA_I_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, \
-- PORT##nr##_IN_PU)
--
--#define PORT_DATA_O(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT)
--
--#define PORT_DATA_IO(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN)
--
--#define PORT_DATA_IO_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PD)
--
--#define PORT_DATA_IO_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PU)
--
--#define PORT_DATA_IO_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
- static pinmux_enum_t pinmux_data[] = {
- /* specify valid pin states for each pin in GPIO mode */
- /* 55-1 (GPIO) */
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index 3eed44e..37467ab 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -503,45 +503,6 @@ enum {
- PINMUX_MARK_END,
- };
-
--#define PORT_DATA_I(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
--
--#define PORT_DATA_I_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD)
--
--#define PORT_DATA_I_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PU)
--
--#define PORT_DATA_I_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_IN, PORT##nr##_IN_PD, \
-- PORT##nr##_IN_PU)
--
--#define PORT_DATA_O(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT)
--
--#define PORT_DATA_IO(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN)
--
--#define PORT_DATA_IO_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PD)
--
--#define PORT_DATA_IO_PU(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PU)
--
--#define PORT_DATA_IO_PU_PD(nr) \
-- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-- PORT##nr##_OUT, PORT##nr##_IN, \
-- PORT##nr##_IN_PD, PORT##nr##_IN_PU)
--
- static pinmux_enum_t pinmux_data[] = {
- /* specify valid pin states for each pin in GPIO mode */
-
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index bc8c920..5585f28 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -104,4 +104,40 @@ struct pinmux_info {
- int register_pinmux(struct pinmux_info *pip);
- int unregister_pinmux(struct pinmux_info *pip);
-
-+/* helper macro for pinmux_enum_t */
-+#define PORT_DATA_I(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
-+
-+#define PORT_DATA_I_PD(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-+ PORT##nr##_IN, PORT##nr##_IN_PD)
-+
-+#define PORT_DATA_I_PU(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-+ PORT##nr##_IN, PORT##nr##_IN_PU)
-+
-+#define PORT_DATA_I_PU_PD(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
-+ PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
-+
-+#define PORT_DATA_O(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
-+
-+#define PORT_DATA_IO(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-+ PORT##nr##_IN)
-+
-+#define PORT_DATA_IO_PD(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-+ PORT##nr##_IN, PORT##nr##_IN_PD)
-+
-+#define PORT_DATA_IO_PU(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-+ PORT##nr##_IN, PORT##nr##_IN_PU)
-+
-+#define PORT_DATA_IO_PU_PD(nr) \
-+ PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
-+ PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
-+
-+
- #endif /* __SH_PFC_H */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0013-ARM-mach-shmobile-move-helper-macro-PORT_xx-to-sh_pf.patch b/patches.armadillo800eva/0013-ARM-mach-shmobile-move-helper-macro-PORT_xx-to-sh_pf.patch
deleted file mode 100644
index 66c1744c4a4964..00000000000000
--- a/patches.armadillo800eva/0013-ARM-mach-shmobile-move-helper-macro-PORT_xx-to-sh_pf.patch
+++ /dev/null
@@ -1,509 +0,0 @@
-From d97e47700f5315b5636f66afb3bf50c1310def2f Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:45:33 -0800
-Subject: ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h
-
-This patch moves PORT_xx helper macro to sh_pfc.h,
-and it expects CPU_ALL_PORT() macro for each CPU
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 972c3fb69cd1cd8d549b8a06ce42611eab405c20)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-sh7367.c | 71 ++++++++---------------
- arch/arm/mach-shmobile/pfc-sh7372.c | 32 +++--------
- arch/arm/mach-shmobile/pfc-sh7377.c | 103 +++++++++++++--------------------
- arch/arm/mach-shmobile/pfc-sh73a0.c | 108 +++++++++++++++--------------------
- include/linux/sh_pfc.h | 23 ++++++++
- 5 files changed, 140 insertions(+), 197 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
-index 2518116..32fbf02 100644
---- a/arch/arm/mach-shmobile/pfc-sh7367.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
-@@ -21,68 +21,49 @@
- #include <linux/gpio.h>
- #include <mach/sh7367.h>
-
--#define _1(fn, pfx, sfx) fn(pfx, sfx)
--
--#define _10(fn, pfx, sfx) \
-- _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
-- _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
-- _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
-- _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
-- _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
--
--#define _90(fn, pfx, sfx) \
-- _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
-- _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
-- _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
-- _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
-- _10(fn, pfx##9, sfx)
--
--#define _273(fn, pfx, sfx) \
-- _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
-- _10(fn, pfx##10, sfx), _90(fn, pfx##1, sfx), \
-- _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
-- _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
-- _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
-- _10(fn, pfx##26, sfx), _1(fn, pfx##270, sfx), \
-- _1(fn, pfx##271, sfx), _1(fn, pfx##272, sfx)
--
--#define _PORT(pfx, sfx) pfx##_##sfx
--#define PORT_273(str) _273(_PORT, PORT, str)
-+#define CPU_ALL_PORT(fn, pfx, sfx) \
-+ PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
-+ PORT_10(fn, pfx##10, sfx), PORT_90(fn, pfx##1, sfx), \
-+ PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \
-+ PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \
-+ PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \
-+ PORT_10(fn, pfx##26, sfx), PORT_1(fn, pfx##270, sfx), \
-+ PORT_1(fn, pfx##271, sfx), PORT_1(fn, pfx##272, sfx)
-
- enum {
- PINMUX_RESERVED = 0,
-
- PINMUX_DATA_BEGIN,
-- PORT_273(DATA), /* PORT0_DATA -> PORT272_DATA */
-+ PORT_ALL(DATA), /* PORT0_DATA -> PORT272_DATA */
- PINMUX_DATA_END,
-
- PINMUX_INPUT_BEGIN,
-- PORT_273(IN), /* PORT0_IN -> PORT272_IN */
-+ PORT_ALL(IN), /* PORT0_IN -> PORT272_IN */
- PINMUX_INPUT_END,
-
- PINMUX_INPUT_PULLUP_BEGIN,
-- PORT_273(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */
-+ PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */
- PINMUX_INPUT_PULLUP_END,
-
- PINMUX_INPUT_PULLDOWN_BEGIN,
-- PORT_273(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */
-+ PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */
- PINMUX_INPUT_PULLDOWN_END,
-
- PINMUX_OUTPUT_BEGIN,
-- PORT_273(OUT), /* PORT0_OUT -> PORT272_OUT */
-+ PORT_ALL(OUT), /* PORT0_OUT -> PORT272_OUT */
- PINMUX_OUTPUT_END,
-
- PINMUX_FUNCTION_BEGIN,
-- PORT_273(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */
-- PORT_273(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */
-- PORT_273(FN0), /* PORT0_FN0 -> PORT272_FN0 */
-- PORT_273(FN1), /* PORT0_FN1 -> PORT272_FN1 */
-- PORT_273(FN2), /* PORT0_FN2 -> PORT272_FN2 */
-- PORT_273(FN3), /* PORT0_FN3 -> PORT272_FN3 */
-- PORT_273(FN4), /* PORT0_FN4 -> PORT272_FN4 */
-- PORT_273(FN5), /* PORT0_FN5 -> PORT272_FN5 */
-- PORT_273(FN6), /* PORT0_FN6 -> PORT272_FN6 */
-- PORT_273(FN7), /* PORT0_FN7 -> PORT272_FN7 */
-+ PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */
-+ PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */
-+ PORT_ALL(FN0), /* PORT0_FN0 -> PORT272_FN0 */
-+ PORT_ALL(FN1), /* PORT0_FN1 -> PORT272_FN1 */
-+ PORT_ALL(FN2), /* PORT0_FN2 -> PORT272_FN2 */
-+ PORT_ALL(FN3), /* PORT0_FN3 -> PORT272_FN3 */
-+ PORT_ALL(FN4), /* PORT0_FN4 -> PORT272_FN4 */
-+ PORT_ALL(FN5), /* PORT0_FN5 -> PORT272_FN5 */
-+ PORT_ALL(FN6), /* PORT0_FN6 -> PORT272_FN6 */
-+ PORT_ALL(FN7), /* PORT0_FN7 -> PORT272_FN7 */
-
- MSELBCR_MSEL2_1, MSELBCR_MSEL2_0,
- PINMUX_FUNCTION_END,
-@@ -1063,13 +1044,9 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(DIVLOCK_MARK, PORT272_FN1),
- };
-
--#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
--#define GPIO_PORT_273() _273(_GPIO_PORT, , unused)
--#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
--
- static struct pinmux_gpio pinmux_gpios[] = {
- /* 49-1 -> 49-6 (GPIO) */
-- GPIO_PORT_273(),
-+ GPIO_PORT_ALL(),
-
- /* Special Pull-up / Pull-down Functions */
- GPIO_FN(PORT48_KEYIN0_PU), GPIO_FN(PORT49_KEYIN1_PU),
-diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
-index 34d6d76..4b43626 100644
---- a/arch/arm/mach-shmobile/pfc-sh7372.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
-@@ -25,27 +25,13 @@
- #include <linux/gpio.h>
- #include <mach/sh7372.h>
-
--#define _1(fn, pfx, sfx) fn(pfx, sfx)
--
--#define _10(fn, pfx, sfx) \
-- _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
-- _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
-- _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
-- _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
-- _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
--
--#define _80(fn, pfx, sfx) \
-- _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
-- _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
-- _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
-- _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx)
--
--#define _190(fn, pfx, sfx) \
-- _10(fn, pfx, sfx), _80(fn, pfx, sfx), _10(fn, pfx##9, sfx), \
-- _10(fn, pfx##10, sfx), _80(fn, pfx##1, sfx), _1(fn, pfx##190, sfx)
--
--#define _PORT(pfx, sfx) pfx##_##sfx
--#define PORT_ALL(str) _190(_PORT, PORT, str)
-+#define CPU_ALL_PORT(fn, pfx, sfx) \
-+ PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
-+ PORT_10(fn, pfx##10, sfx), PORT_10(fn, pfx##11, sfx), \
-+ PORT_10(fn, pfx##12, sfx), PORT_10(fn, pfx##13, sfx), \
-+ PORT_10(fn, pfx##14, sfx), PORT_10(fn, pfx##15, sfx), \
-+ PORT_10(fn, pfx##16, sfx), PORT_10(fn, pfx##17, sfx), \
-+ PORT_10(fn, pfx##18, sfx), PORT_1(fn, pfx##190, sfx)
-
- enum {
- PINMUX_RESERVED = 0,
-@@ -942,10 +928,6 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1),
- };
-
--#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
--#define GPIO_PORT_ALL() _190(_GPIO_PORT, , unused)
--#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
--
- static struct pinmux_gpio pinmux_gpios[] = {
-
- /* PORT */
-diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
-index e4c7018..fb3cfd3 100644
---- a/arch/arm/mach-shmobile/pfc-sh7377.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
-@@ -22,84 +22,65 @@
- #include <linux/gpio.h>
- #include <mach/sh7377.h>
-
--#define _1(fn, pfx, sfx) fn(pfx, sfx)
--
--#define _10(fn, pfx, sfx) \
-- _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
-- _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
-- _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
-- _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
-- _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
--
--#define _90(fn, pfx, sfx) \
-- _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
-- _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
-- _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
-- _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
-- _10(fn, pfx##9, sfx)
--
--#define _265(fn, pfx, sfx) \
-- _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
-- _10(fn, pfx##10, sfx), \
-- _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \
-- _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \
-- _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \
-- _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \
-- _1(fn, pfx##118, sfx), \
-- _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \
-- _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \
-- _10(fn, pfx##15, sfx), \
-- _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \
-- _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \
-- _1(fn, pfx##164, sfx), \
-- _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \
-- _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \
-- _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \
-- _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \
-- _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
-- _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
-- _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
-- _1(fn, pfx##260, sfx), _1(fn, pfx##261, sfx), \
-- _1(fn, pfx##262, sfx), _1(fn, pfx##263, sfx), \
-- _1(fn, pfx##264, sfx)
--
--#define _PORT(pfx, sfx) pfx##_##sfx
--#define PORT_265(str) _265(_PORT, PORT, str)
-+#define CPU_ALL_PORT(fn, pfx, sfx) \
-+ PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
-+ PORT_10(fn, pfx##10, sfx), \
-+ PORT_1(fn, pfx##110, sfx), PORT_1(fn, pfx##111, sfx), \
-+ PORT_1(fn, pfx##112, sfx), PORT_1(fn, pfx##113, sfx), \
-+ PORT_1(fn, pfx##114, sfx), PORT_1(fn, pfx##115, sfx), \
-+ PORT_1(fn, pfx##116, sfx), PORT_1(fn, pfx##117, sfx), \
-+ PORT_1(fn, pfx##118, sfx), \
-+ PORT_1(fn, pfx##128, sfx), PORT_1(fn, pfx##129, sfx), \
-+ PORT_10(fn, pfx##13, sfx), PORT_10(fn, pfx##14, sfx), \
-+ PORT_10(fn, pfx##15, sfx), \
-+ PORT_1(fn, pfx##160, sfx), PORT_1(fn, pfx##161, sfx), \
-+ PORT_1(fn, pfx##162, sfx), PORT_1(fn, pfx##163, sfx), \
-+ PORT_1(fn, pfx##164, sfx), \
-+ PORT_1(fn, pfx##192, sfx), PORT_1(fn, pfx##193, sfx), \
-+ PORT_1(fn, pfx##194, sfx), PORT_1(fn, pfx##195, sfx), \
-+ PORT_1(fn, pfx##196, sfx), PORT_1(fn, pfx##197, sfx), \
-+ PORT_1(fn, pfx##198, sfx), PORT_1(fn, pfx##199, sfx), \
-+ PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \
-+ PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \
-+ PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \
-+ PORT_1(fn, pfx##260, sfx), PORT_1(fn, pfx##261, sfx), \
-+ PORT_1(fn, pfx##262, sfx), PORT_1(fn, pfx##263, sfx), \
-+ PORT_1(fn, pfx##264, sfx)
-
- enum {
- PINMUX_RESERVED = 0,
-
- PINMUX_DATA_BEGIN,
-- PORT_265(DATA), /* PORT0_DATA -> PORT264_DATA */
-+ PORT_ALL(DATA), /* PORT0_DATA -> PORT264_DATA */
- PINMUX_DATA_END,
-
- PINMUX_INPUT_BEGIN,
-- PORT_265(IN), /* PORT0_IN -> PORT264_IN */
-+ PORT_ALL(IN), /* PORT0_IN -> PORT264_IN */
- PINMUX_INPUT_END,
-
- PINMUX_INPUT_PULLUP_BEGIN,
-- PORT_265(IN_PU), /* PORT0_IN_PU -> PORT264_IN_PU */
-+ PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT264_IN_PU */
- PINMUX_INPUT_PULLUP_END,
-
- PINMUX_INPUT_PULLDOWN_BEGIN,
-- PORT_265(IN_PD), /* PORT0_IN_PD -> PORT264_IN_PD */
-+ PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT264_IN_PD */
- PINMUX_INPUT_PULLDOWN_END,
-
- PINMUX_OUTPUT_BEGIN,
-- PORT_265(OUT), /* PORT0_OUT -> PORT264_OUT */
-+ PORT_ALL(OUT), /* PORT0_OUT -> PORT264_OUT */
- PINMUX_OUTPUT_END,
-
- PINMUX_FUNCTION_BEGIN,
-- PORT_265(FN_IN), /* PORT0_FN_IN -> PORT264_FN_IN */
-- PORT_265(FN_OUT), /* PORT0_FN_OUT -> PORT264_FN_OUT */
-- PORT_265(FN0), /* PORT0_FN0 -> PORT264_FN0 */
-- PORT_265(FN1), /* PORT0_FN1 -> PORT264_FN1 */
-- PORT_265(FN2), /* PORT0_FN2 -> PORT264_FN2 */
-- PORT_265(FN3), /* PORT0_FN3 -> PORT264_FN3 */
-- PORT_265(FN4), /* PORT0_FN4 -> PORT264_FN4 */
-- PORT_265(FN5), /* PORT0_FN5 -> PORT264_FN5 */
-- PORT_265(FN6), /* PORT0_FN6 -> PORT264_FN6 */
-- PORT_265(FN7), /* PORT0_FN7 -> PORT264_FN7 */
-+ PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT264_FN_IN */
-+ PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT264_FN_OUT */
-+ PORT_ALL(FN0), /* PORT0_FN0 -> PORT264_FN0 */
-+ PORT_ALL(FN1), /* PORT0_FN1 -> PORT264_FN1 */
-+ PORT_ALL(FN2), /* PORT0_FN2 -> PORT264_FN2 */
-+ PORT_ALL(FN3), /* PORT0_FN3 -> PORT264_FN3 */
-+ PORT_ALL(FN4), /* PORT0_FN4 -> PORT264_FN4 */
-+ PORT_ALL(FN5), /* PORT0_FN5 -> PORT264_FN5 */
-+ PORT_ALL(FN6), /* PORT0_FN6 -> PORT264_FN6 */
-+ PORT_ALL(FN7), /* PORT0_FN7 -> PORT264_FN7 */
-
- MSELBCR_MSEL17_1, MSELBCR_MSEL17_0,
- MSELBCR_MSEL16_1, MSELBCR_MSEL16_0,
-@@ -1039,13 +1020,9 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(RESETOUTS_MARK, PORT264_FN1),
- };
-
--#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
--#define GPIO_PORT_265() _265(_GPIO_PORT, , unused)
--#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
--
- static struct pinmux_gpio pinmux_gpios[] = {
- /* 55-1 -> 55-5 (GPIO) */
-- GPIO_PORT_265(),
-+ GPIO_PORT_ALL(),
-
- /* Special Pull-up / Pull-down Functions */
- GPIO_FN(PORT66_KEYIN0_PU), GPIO_FN(PORT67_KEYIN1_PU),
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index 37467ab..9d68569 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -23,83 +23,71 @@
- #include <linux/gpio.h>
- #include <mach/sh73a0.h>
-
--#define _1(fn, pfx, sfx) fn(pfx, sfx)
--
--#define _10(fn, pfx, sfx) \
-- _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
-- _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
-- _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
-- _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
-- _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
--
--#define _310(fn, pfx, sfx) \
-- _10(fn, pfx, sfx), _10(fn, pfx##1, sfx), \
-- _10(fn, pfx##2, sfx), _10(fn, pfx##3, sfx), \
-- _10(fn, pfx##4, sfx), _10(fn, pfx##5, sfx), \
-- _10(fn, pfx##6, sfx), _10(fn, pfx##7, sfx), \
-- _10(fn, pfx##8, sfx), _10(fn, pfx##9, sfx), \
-- _10(fn, pfx##10, sfx), \
-- _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \
-- _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \
-- _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \
-- _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \
-- _1(fn, pfx##118, sfx), \
-- _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \
-- _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \
-- _10(fn, pfx##15, sfx), \
-- _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \
-- _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \
-- _1(fn, pfx##164, sfx), \
-- _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \
-- _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \
-- _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \
-- _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \
-- _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
-- _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
-- _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
-- _10(fn, pfx##26, sfx), _10(fn, pfx##27, sfx), \
-- _1(fn, pfx##280, sfx), _1(fn, pfx##281, sfx), \
-- _1(fn, pfx##282, sfx), \
-- _1(fn, pfx##288, sfx), _1(fn, pfx##289, sfx), \
-- _10(fn, pfx##29, sfx), _10(fn, pfx##30, sfx)
--
--#define _PORT(pfx, sfx) pfx##_##sfx
--#define PORT_310(str) _310(_PORT, PORT, str)
-+#define CPU_ALL_PORT(fn, pfx, sfx) \
-+ PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
-+ PORT_10(fn, pfx##2, sfx), PORT_10(fn, pfx##3, sfx), \
-+ PORT_10(fn, pfx##4, sfx), PORT_10(fn, pfx##5, sfx), \
-+ PORT_10(fn, pfx##6, sfx), PORT_10(fn, pfx##7, sfx), \
-+ PORT_10(fn, pfx##8, sfx), PORT_10(fn, pfx##9, sfx), \
-+ PORT_10(fn, pfx##10, sfx), \
-+ PORT_1(fn, pfx##110, sfx), PORT_1(fn, pfx##111, sfx), \
-+ PORT_1(fn, pfx##112, sfx), PORT_1(fn, pfx##113, sfx), \
-+ PORT_1(fn, pfx##114, sfx), PORT_1(fn, pfx##115, sfx), \
-+ PORT_1(fn, pfx##116, sfx), PORT_1(fn, pfx##117, sfx), \
-+ PORT_1(fn, pfx##118, sfx), \
-+ PORT_1(fn, pfx##128, sfx), PORT_1(fn, pfx##129, sfx), \
-+ PORT_10(fn, pfx##13, sfx), PORT_10(fn, pfx##14, sfx), \
-+ PORT_10(fn, pfx##15, sfx), \
-+ PORT_1(fn, pfx##160, sfx), PORT_1(fn, pfx##161, sfx), \
-+ PORT_1(fn, pfx##162, sfx), PORT_1(fn, pfx##163, sfx), \
-+ PORT_1(fn, pfx##164, sfx), \
-+ PORT_1(fn, pfx##192, sfx), PORT_1(fn, pfx##193, sfx), \
-+ PORT_1(fn, pfx##194, sfx), PORT_1(fn, pfx##195, sfx), \
-+ PORT_1(fn, pfx##196, sfx), PORT_1(fn, pfx##197, sfx), \
-+ PORT_1(fn, pfx##198, sfx), PORT_1(fn, pfx##199, sfx), \
-+ PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \
-+ PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \
-+ PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \
-+ PORT_10(fn, pfx##26, sfx), PORT_10(fn, pfx##27, sfx), \
-+ PORT_1(fn, pfx##280, sfx), PORT_1(fn, pfx##281, sfx), \
-+ PORT_1(fn, pfx##282, sfx), \
-+ PORT_1(fn, pfx##288, sfx), PORT_1(fn, pfx##289, sfx), \
-+ PORT_10(fn, pfx##29, sfx), PORT_10(fn, pfx##30, sfx)
-
- enum {
- PINMUX_RESERVED = 0,
-
- PINMUX_DATA_BEGIN,
-- PORT_310(DATA), /* PORT0_DATA -> PORT309_DATA */
-+ PORT_ALL(DATA), /* PORT0_DATA -> PORT309_DATA */
- PINMUX_DATA_END,
-
- PINMUX_INPUT_BEGIN,
-- PORT_310(IN), /* PORT0_IN -> PORT309_IN */
-+ PORT_ALL(IN), /* PORT0_IN -> PORT309_IN */
- PINMUX_INPUT_END,
-
- PINMUX_INPUT_PULLUP_BEGIN,
-- PORT_310(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */
-+ PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */
- PINMUX_INPUT_PULLUP_END,
-
- PINMUX_INPUT_PULLDOWN_BEGIN,
-- PORT_310(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */
-+ PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */
- PINMUX_INPUT_PULLDOWN_END,
-
- PINMUX_OUTPUT_BEGIN,
-- PORT_310(OUT), /* PORT0_OUT -> PORT309_OUT */
-+ PORT_ALL(OUT), /* PORT0_OUT -> PORT309_OUT */
- PINMUX_OUTPUT_END,
-
- PINMUX_FUNCTION_BEGIN,
-- PORT_310(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */
-- PORT_310(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */
-- PORT_310(FN0), /* PORT0_FN0 -> PORT309_FN0 */
-- PORT_310(FN1), /* PORT0_FN1 -> PORT309_FN1 */
-- PORT_310(FN2), /* PORT0_FN2 -> PORT309_FN2 */
-- PORT_310(FN3), /* PORT0_FN3 -> PORT309_FN3 */
-- PORT_310(FN4), /* PORT0_FN4 -> PORT309_FN4 */
-- PORT_310(FN5), /* PORT0_FN5 -> PORT309_FN5 */
-- PORT_310(FN6), /* PORT0_FN6 -> PORT309_FN6 */
-- PORT_310(FN7), /* PORT0_FN7 -> PORT309_FN7 */
-+ PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */
-+ PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */
-+ PORT_ALL(FN0), /* PORT0_FN0 -> PORT309_FN0 */
-+ PORT_ALL(FN1), /* PORT0_FN1 -> PORT309_FN1 */
-+ PORT_ALL(FN2), /* PORT0_FN2 -> PORT309_FN2 */
-+ PORT_ALL(FN3), /* PORT0_FN3 -> PORT309_FN3 */
-+ PORT_ALL(FN4), /* PORT0_FN4 -> PORT309_FN4 */
-+ PORT_ALL(FN5), /* PORT0_FN5 -> PORT309_FN5 */
-+ PORT_ALL(FN6), /* PORT0_FN6 -> PORT309_FN6 */
-+ PORT_ALL(FN7), /* PORT0_FN7 -> PORT309_FN7 */
-
- MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1,
- MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1,
-@@ -1493,12 +1481,8 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(FSIAISLD_PU_MARK, PORT55_FN1, PORT55_IN_PU),
- };
-
--#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
--#define GPIO_PORT_310() _310(_GPIO_PORT, , unused)
--#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
--
- static struct pinmux_gpio pinmux_gpios[] = {
-- GPIO_PORT_310(),
-+ GPIO_PORT_ALL(),
-
- /* Table 25-1 (Functions 0-7) */
- GPIO_FN(VBUS_0),
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 5585f28..5f6322a 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -104,6 +104,29 @@ struct pinmux_info {
- int register_pinmux(struct pinmux_info *pip);
- int unregister_pinmux(struct pinmux_info *pip);
-
-+/* helper macro for port */
-+#define PORT_1(fn, pfx, sfx) fn(pfx, sfx)
-+
-+#define PORT_10(fn, pfx, sfx) \
-+ PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \
-+ PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \
-+ PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \
-+ PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \
-+ PORT_1(fn, pfx##8, sfx), PORT_1(fn, pfx##9, sfx)
-+
-+#define PORT_90(fn, pfx, sfx) \
-+ PORT_10(fn, pfx##1, sfx), PORT_10(fn, pfx##2, sfx), \
-+ PORT_10(fn, pfx##3, sfx), PORT_10(fn, pfx##4, sfx), \
-+ PORT_10(fn, pfx##5, sfx), PORT_10(fn, pfx##6, sfx), \
-+ PORT_10(fn, pfx##7, sfx), PORT_10(fn, pfx##8, sfx), \
-+ PORT_10(fn, pfx##9, sfx)
-+
-+#define _PORT_ALL(pfx, sfx) pfx##_##sfx
-+#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
-+#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str)
-+#define GPIO_PORT_ALL() CPU_ALL_PORT(_GPIO_PORT, , unused)
-+#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
-+
- /* helper macro for pinmux_enum_t */
- #define PORT_DATA_I(nr) \
- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0014-ARM-mach-shmobile-move-helper-macro-PORTCR-to-sh_pfc.patch b/patches.armadillo800eva/0014-ARM-mach-shmobile-move-helper-macro-PORTCR-to-sh_pfc.patch
deleted file mode 100644
index c35159a483e15e..00000000000000
--- a/patches.armadillo800eva/0014-ARM-mach-shmobile-move-helper-macro-PORTCR-to-sh_pfc.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From 7ba3680133620f65d0c5edb2ebcdd1bc744a724c Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:45:43 -0800
-Subject: ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.h
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 9b49139b34a66907662e0be8efe79316dc63f8e0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-sh7367.c | 16 ----------------
- arch/arm/mach-shmobile/pfc-sh7372.c | 16 ----------------
- arch/arm/mach-shmobile/pfc-sh7377.c | 17 -----------------
- arch/arm/mach-shmobile/pfc-sh73a0.c | 12 ------------
- include/linux/sh_pfc.h | 17 +++++++++++++++++
- 5 files changed, 17 insertions(+), 61 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
-index 32fbf02..e6e5246 100644
---- a/arch/arm/mach-shmobile/pfc-sh7367.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
-@@ -1287,22 +1287,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(DIVLOCK),
- };
-
--/* helper for top 4 bits in PORTnCR */
--#define PCRH(in, in_pd, in_pu, out) \
-- 0, (out), (in), 0, \
-- 0, 0, 0, 0, \
-- 0, 0, (in_pd), 0, \
-- 0, 0, (in_pu), 0
--
--#define PORTCR(nr, reg) \
-- { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
-- PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
-- PORT##nr##_IN_PU, PORT##nr##_OUT), \
-- PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
-- PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
-- PORT##nr##_FN6, PORT##nr##_FN7 } \
-- }
--
- static struct pinmux_cfg_reg pinmux_config_regs[] = {
- PORTCR(0, 0xe6050000), /* PORT0CR */
- PORTCR(1, 0xe6050001), /* PORT1CR */
-diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
-index 4b43626..1bd6585 100644
---- a/arch/arm/mach-shmobile/pfc-sh7372.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
-@@ -1199,22 +1199,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(SDENC_DV_CLKI),
- };
-
--/* helper for top 4 bits in PORTnCR */
--#define PCRH(in, in_pd, in_pu, out) \
-- 0, (out), (in), 0, \
-- 0, 0, 0, 0, \
-- 0, 0, (in_pd), 0, \
-- 0, 0, (in_pu), 0
--
--#define PORTCR(nr, reg) \
-- { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
-- PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
-- PORT##nr##_IN_PU, PORT##nr##_OUT), \
-- PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
-- PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
-- PORT##nr##_FN6, PORT##nr##_FN7 } \
-- }
--
- static struct pinmux_cfg_reg pinmux_config_regs[] = {
- PORTCR(0, 0xE6051000), /* PORT0CR */
- PORTCR(1, 0xE6051001), /* PORT1CR */
-diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
-index fb3cfd3..2f10511 100644
---- a/arch/arm/mach-shmobile/pfc-sh7377.c
-+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
-@@ -1300,23 +1300,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(RESETOUTS),
- };
-
--/* helper for top 4 bits in PORTnCR */
--#define PCRH(in, in_pd, in_pu, out) \
-- 0, (out), (in), 0, \
-- 0, 0, 0, 0, \
-- 0, 0, (in_pd), 0, \
-- 0, 0, (in_pu), 0
--
--#define PORTCR(nr, reg) \
-- { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
-- PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
-- PORT##nr##_IN_PU, PORT##nr##_OUT), \
-- PORT##nr##_FN0, PORT##nr##_FN1, \
-- PORT##nr##_FN2, PORT##nr##_FN3, \
-- PORT##nr##_FN4, PORT##nr##_FN5, \
-- PORT##nr##_FN6, PORT##nr##_FN7 } \
-- }
--
- static struct pinmux_cfg_reg pinmux_config_regs[] = {
- PORTCR(0, 0xe6050000), /* PORT0CR */
- PORTCR(1, 0xe6050001), /* PORT1CR */
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index 9d68569..d8915c6 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -2139,18 +2139,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(FSIAISLD_PU),
- };
-
--#define PORTCR(nr, reg) \
-- { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
-- 0, \
-- /*0001*/ PORT##nr##_OUT , \
-- /*0010*/ PORT##nr##_IN , 0, 0, 0, 0, 0, 0, 0, \
-- /*1010*/ PORT##nr##_IN_PD, 0, 0, 0, \
-- /*1110*/ PORT##nr##_IN_PU, 0, \
-- PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
-- PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
-- PORT##nr##_FN6, PORT##nr##_FN7, 0, 0, 0, 0, 0, 0, 0, 0 } \
-- }
--
- static struct pinmux_cfg_reg pinmux_config_regs[] = {
- PORTCR(0, 0xe6050000), /* PORT0CR */
- PORTCR(1, 0xe6050001), /* PORT1CR */
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 5f6322a..8446789 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -162,5 +162,22 @@ int unregister_pinmux(struct pinmux_info *pip);
- PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
- PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
-
-+/* helper macro for top 4 bits in PORTnCR */
-+#define _PCRH(in, in_pd, in_pu, out) \
-+ 0, (out), (in), 0, \
-+ 0, 0, 0, 0, \
-+ 0, 0, (in_pd), 0, \
-+ 0, 0, (in_pu), 0
-+
-+#define PORTCR(nr, reg) \
-+ { \
-+ PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
-+ _PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
-+ PORT##nr##_IN_PU, PORT##nr##_OUT), \
-+ PORT##nr##_FN0, PORT##nr##_FN1, \
-+ PORT##nr##_FN2, PORT##nr##_FN3, \
-+ PORT##nr##_FN4, PORT##nr##_FN5, \
-+ PORT##nr##_FN6, PORT##nr##_FN7 } \
-+ }
-
- #endif /* __SH_PFC_H */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0015-sh-pfc-ioremap-support.patch b/patches.armadillo800eva/0015-sh-pfc-ioremap-support.patch
deleted file mode 100644
index 2d2b930cdb0b9f..00000000000000
--- a/patches.armadillo800eva/0015-sh-pfc-ioremap-support.patch
+++ /dev/null
@@ -1,350 +0,0 @@
-From 4fb7ac69b4e065f02ccada9a8ebe1fc11ca9c4e6 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Fri, 9 Dec 2011 12:14:27 +0900
-Subject: sh: pfc: ioremap() support
-
-Add support for non-entity mapped PFC registers through
-the use of struct resource and ioremap()/iounmap().
-
-The PFC main data structure gets updated with a pointer
-to a struct resources array that point out all register
-windows used by the PFC instance. The register definitions
-are kept as physical addresses but the PFC code will do
-transparent conversion into virtual addresses whenever
-register windows are specified using with struct resource.
-
-To introduce as little performance penalty as possible the
-virtual address of each data register is cached in memory.
-The virtual address of each configuration register is however
-calculated during run time. This because the configuration
-is considered slow path so focus is instead put on keeping
-memory foot print as small as possible.
-
-The PFC register access code is in this patch updated from
-__raw_readN() / __raw_writeN() into ioreadN() / iowriteN().
-
-This patch is needed to support the PFC block in r8a7779.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b0e10211cba1629e2e534ca9cb3d87cfc7e389ea)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 137 +++++++++++++++++++++++++++++++++++++++---------
- include/linux/sh_pfc.h | 11 ++++
- 2 files changed, 124 insertions(+), 24 deletions(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index e67fe17..e7d127a 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -19,6 +19,75 @@
- #include <linux/irq.h>
- #include <linux/bitops.h>
- #include <linux/gpio.h>
-+#include <linux/slab.h>
-+#include <linux/ioport.h>
-+
-+static void pfc_iounmap(struct pinmux_info *pip)
-+{
-+ int k;
-+
-+ for (k = 0; k < pip->num_resources; k++)
-+ if (pip->window[k].virt)
-+ iounmap(pip->window[k].virt);
-+
-+ kfree(pip->window);
-+ pip->window = NULL;
-+}
-+
-+static int pfc_ioremap(struct pinmux_info *pip)
-+{
-+ struct resource *res;
-+ int k;
-+
-+ if (!pip->num_resources)
-+ return 0;
-+
-+ pip->window = kzalloc(pip->num_resources * sizeof(*pip->window),
-+ GFP_NOWAIT);
-+ if (!pip->window)
-+ goto err1;
-+
-+ for (k = 0; k < pip->num_resources; k++) {
-+ res = pip->resource + k;
-+ WARN_ON(resource_type(res) != IORESOURCE_MEM);
-+ pip->window[k].phys = res->start;
-+ pip->window[k].size = resource_size(res);
-+ pip->window[k].virt = ioremap_nocache(res->start,
-+ resource_size(res));
-+ if (!pip->window[k].virt)
-+ goto err2;
-+ }
-+
-+ return 0;
-+
-+err2:
-+ pfc_iounmap(pip);
-+err1:
-+ return -1;
-+}
-+
-+static void __iomem *pfc_phys_to_virt(struct pinmux_info *pip,
-+ unsigned long address)
-+{
-+ struct pfc_window *window;
-+ int k;
-+
-+ /* scan through physical windows and convert address */
-+ for (k = 0; k < pip->num_resources; k++) {
-+ window = pip->window + k;
-+
-+ if (address < window->phys)
-+ continue;
-+
-+ if (address >= (window->phys + window->size))
-+ continue;
-+
-+ return window->virt + (address - window->phys);
-+ }
-+
-+ /* no windows defined, register must be 1:1 mapped virt:phys */
-+ return (void __iomem *)address;
-+}
-
- static int enum_in_range(pinmux_enum_t enum_id, struct pinmux_range *r)
- {
-@@ -31,35 +100,35 @@ static int enum_in_range(pinmux_enum_t enum_id, struct pinmux_range *r)
- return 1;
- }
-
--static unsigned long gpio_read_raw_reg(unsigned long reg,
-+static unsigned long gpio_read_raw_reg(void __iomem *mapped_reg,
- unsigned long reg_width)
- {
- switch (reg_width) {
- case 8:
-- return __raw_readb(reg);
-+ return ioread8(mapped_reg);
- case 16:
-- return __raw_readw(reg);
-+ return ioread16(mapped_reg);
- case 32:
-- return __raw_readl(reg);
-+ return ioread32(mapped_reg);
- }
-
- BUG();
- return 0;
- }
-
--static void gpio_write_raw_reg(unsigned long reg,
-+static void gpio_write_raw_reg(void __iomem *mapped_reg,
- unsigned long reg_width,
- unsigned long data)
- {
- switch (reg_width) {
- case 8:
-- __raw_writeb(data, reg);
-+ iowrite8(data, mapped_reg);
- return;
- case 16:
-- __raw_writew(data, reg);
-+ iowrite16(data, mapped_reg);
- return;
- case 32:
-- __raw_writel(data, reg);
-+ iowrite32(data, mapped_reg);
- return;
- }
-
-@@ -82,11 +151,12 @@ static void gpio_write_bit(struct pinmux_data_reg *dr,
- else
- clear_bit(pos, &dr->reg_shadow);
-
-- gpio_write_raw_reg(dr->reg, dr->reg_width, dr->reg_shadow);
-+ gpio_write_raw_reg(dr->mapped_reg, dr->reg_width, dr->reg_shadow);
- }
-
--static int gpio_read_reg(unsigned long reg, unsigned long reg_width,
-- unsigned long field_width, unsigned long in_pos)
-+static int gpio_read_reg(void __iomem *mapped_reg, unsigned long reg_width,
-+ unsigned long field_width, unsigned long in_pos,
-+ unsigned long reg)
- {
- unsigned long data, mask, pos;
-
-@@ -98,13 +168,13 @@ static int gpio_read_reg(unsigned long reg, unsigned long reg_width,
- "r_width = %ld, f_width = %ld\n",
- reg, pos, reg_width, field_width);
-
-- data = gpio_read_raw_reg(reg, reg_width);
-+ data = gpio_read_raw_reg(mapped_reg, reg_width);
- return (data >> pos) & mask;
- }
-
--static void gpio_write_reg(unsigned long reg, unsigned long reg_width,
-+static void gpio_write_reg(void __iomem *mapped_reg, unsigned long reg_width,
- unsigned long field_width, unsigned long in_pos,
-- unsigned long value)
-+ unsigned long value, unsigned long reg)
- {
- unsigned long mask, pos;
-
-@@ -120,13 +190,13 @@ static void gpio_write_reg(unsigned long reg, unsigned long reg_width,
-
- switch (reg_width) {
- case 8:
-- __raw_writeb((__raw_readb(reg) & mask) | value, reg);
-+ iowrite8((ioread8(mapped_reg) & mask) | value, mapped_reg);
- break;
- case 16:
-- __raw_writew((__raw_readw(reg) & mask) | value, reg);
-+ iowrite16((ioread16(mapped_reg) & mask) | value, mapped_reg);
- break;
- case 32:
-- __raw_writel((__raw_readl(reg) & mask) | value, reg);
-+ iowrite32((ioread32(mapped_reg) & mask) | value, mapped_reg);
- break;
- }
- }
-@@ -147,6 +217,8 @@ static int setup_data_reg(struct pinmux_info *gpioc, unsigned gpio)
- if (!data_reg->reg_width)
- break;
-
-+ data_reg->mapped_reg = pfc_phys_to_virt(gpioc, data_reg->reg);
-+
- for (n = 0; n < data_reg->reg_width; n++) {
- if (data_reg->enum_ids[n] == gpiop->enum_id) {
- gpiop->flags &= ~PINMUX_FLAG_DREG;
-@@ -179,7 +251,8 @@ static void setup_data_regs(struct pinmux_info *gpioc)
- if (!drp->reg_width)
- break;
-
-- drp->reg_shadow = gpio_read_raw_reg(drp->reg, drp->reg_width);
-+ drp->reg_shadow = gpio_read_raw_reg(drp->mapped_reg,
-+ drp->reg_width);
- k++;
- }
- }
-@@ -266,12 +339,16 @@ static void write_config_reg(struct pinmux_info *gpioc,
- int index)
- {
- unsigned long ncomb, pos, value;
-+ void __iomem *mapped_reg;
-
- ncomb = 1 << crp->field_width;
- pos = index / ncomb;
- value = index % ncomb;
-
-- gpio_write_reg(crp->reg, crp->reg_width, crp->field_width, pos, value);
-+ mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-+
-+ gpio_write_reg(mapped_reg, crp->reg_width, crp->field_width,
-+ pos, value, crp->reg);
- }
-
- static int check_config_reg(struct pinmux_info *gpioc,
-@@ -279,13 +356,16 @@ static int check_config_reg(struct pinmux_info *gpioc,
- int index)
- {
- unsigned long ncomb, pos, value;
-+ void __iomem *mapped_reg;
-
- ncomb = 1 << crp->field_width;
- pos = index / ncomb;
- value = index % ncomb;
-
-- if (gpio_read_reg(crp->reg, crp->reg_width,
-- crp->field_width, pos) == value)
-+ mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-+
-+ if (gpio_read_reg(mapped_reg, crp->reg_width,
-+ crp->field_width, pos, crp->reg) == value)
- return 0;
-
- return -1;
-@@ -564,7 +644,7 @@ static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
- if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
- return -EINVAL;
-
-- return gpio_read_reg(dr->reg, dr->reg_width, 1, bit);
-+ return gpio_read_reg(dr->mapped_reg, dr->reg_width, 1, bit, dr->reg);
- }
-
- static int sh_gpio_get(struct gpio_chip *chip, unsigned offset)
-@@ -606,10 +686,15 @@ static int sh_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
- int register_pinmux(struct pinmux_info *pip)
- {
- struct gpio_chip *chip = &pip->chip;
-+ int ret;
-
- pr_info("%s handling gpio %d -> %d\n",
- pip->name, pip->first_gpio, pip->last_gpio);
-
-+ ret = pfc_ioremap(pip);
-+ if (ret < 0)
-+ return ret;
-+
- setup_data_regs(pip);
-
- chip->request = sh_gpio_request;
-@@ -627,12 +712,16 @@ int register_pinmux(struct pinmux_info *pip)
- chip->base = pip->first_gpio;
- chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1;
-
-- return gpiochip_add(chip);
-+ ret = gpiochip_add(chip);
-+ if (ret < 0)
-+ pfc_iounmap(pip);
-+
-+ return ret;
- }
-
- int unregister_pinmux(struct pinmux_info *pip)
- {
- pr_info("%s deregistering\n", pip->name);
--
-+ pfc_iounmap(pip);
- return gpiochip_remove(&pip->chip);
- }
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 8446789..91666a5 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -55,6 +55,7 @@ struct pinmux_cfg_reg {
- struct pinmux_data_reg {
- unsigned long reg, reg_width, reg_shadow;
- pinmux_enum_t *enum_ids;
-+ void __iomem *mapped_reg;
- };
-
- #define PINMUX_DATA_REG(name, r, r_width) \
-@@ -75,6 +76,12 @@ struct pinmux_range {
- pinmux_enum_t force;
- };
-
-+struct pfc_window {
-+ phys_addr_t phys;
-+ void __iomem *virt;
-+ unsigned long size;
-+};
-+
- struct pinmux_info {
- char *name;
- pinmux_enum_t reserved_id;
-@@ -98,6 +105,10 @@ struct pinmux_info {
- struct pinmux_irq *gpio_irq;
- unsigned int gpio_irq_size;
-
-+ struct resource *resource;
-+ unsigned int num_resources;
-+ struct pfc_window *window;
-+
- struct gpio_chip chip;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0016-sh-pfc-Add-gpio_read_bit-for-data-register-access.patch b/patches.armadillo800eva/0016-sh-pfc-Add-gpio_read_bit-for-data-register-access.patch
deleted file mode 100644
index 87df55096c476c..00000000000000
--- a/patches.armadillo800eva/0016-sh-pfc-Add-gpio_read_bit-for-data-register-access.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From d378246a650f3297ce7639fcc56ba76a510d0b6d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 14 Dec 2011 01:00:37 +0900
-Subject: sh: pfc: Add gpio_read_bit() for data register access
-
-Introduce gpio_read_bit() for data register read access
-and modify sh_gpio_get_value() to make use of the new
-function instead of gpio_read_reg(). The purpose of
-this change is to update the code to only use the
-gpio_read_reg() function for config register access.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 92554d97c6dcc448afd56f96bbe933998868be74)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index e7d127a..cfca0aa 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -135,6 +135,19 @@ static void gpio_write_raw_reg(void __iomem *mapped_reg,
- BUG();
- }
-
-+static int gpio_read_bit(struct pinmux_data_reg *dr,
-+ unsigned long in_pos)
-+{
-+ unsigned long pos;
-+
-+ pos = dr->reg_width - (in_pos + 1);
-+
-+ pr_debug("read_bit: addr = %lx, pos = %ld, "
-+ "r_width = %ld\n", dr->reg, pos, dr->reg_width);
-+
-+ return (gpio_read_raw_reg(dr->mapped_reg, dr->reg_width) >> pos) & 1;
-+}
-+
- static void gpio_write_bit(struct pinmux_data_reg *dr,
- unsigned long in_pos, unsigned long value)
- {
-@@ -644,7 +657,7 @@ static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
- if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
- return -EINVAL;
-
-- return gpio_read_reg(dr->mapped_reg, dr->reg_width, 1, bit, dr->reg);
-+ return gpio_read_bit(dr, bit);
- }
-
- static int sh_gpio_get(struct gpio_chip *chip, unsigned offset)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0017-sh-pfc-Convert-index-to-field-and-value-pair.patch b/patches.armadillo800eva/0017-sh-pfc-Convert-index-to-field-and-value-pair.patch
deleted file mode 100644
index cbc135cbfc7b8d..00000000000000
--- a/patches.armadillo800eva/0017-sh-pfc-Convert-index-to-field-and-value-pair.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 07bd1464d6c99fc50ed64a6f29bbd23ad868528f Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 14 Dec 2011 01:00:46 +0900
-Subject: sh: pfc: Convert index to field and value pair
-
-Update the way the PFC code is passing bitfield
-selection between configure register functions.
-
-Convert the code from using index only to bitfield
-number and selected value. First step towards future
-variable bitfield width support.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit ad4a07ff8da7147b391f1ff0034f313a8b9da9e5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 45 ++++++++++++++++++---------------------------
- 1 file changed, 18 insertions(+), 27 deletions(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index cfca0aa..41e7c8f 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -287,7 +287,8 @@ static int get_data_reg(struct pinmux_info *gpioc, unsigned gpio,
- }
-
- static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
-- struct pinmux_cfg_reg **crp, int *indexp,
-+ struct pinmux_cfg_reg **crp,
-+ int *fieldp, int *valuep,
- unsigned long **cntp)
- {
- struct pinmux_cfg_reg *config_reg;
-@@ -306,7 +307,8 @@ static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
- for (n = 0; n < (r_width / f_width) * (1 << f_width); n++) {
- if (config_reg->enum_ids[n] == enum_id) {
- *crp = config_reg;
-- *indexp = n;
-+ *fieldp = n / (1 << f_width);
-+ *valuep = n % (1 << f_width);
- *cntp = &config_reg->cnt[n / (1 << f_width)];
- return 0;
- }
-@@ -349,36 +351,22 @@ static int get_gpio_enum_id(struct pinmux_info *gpioc, unsigned gpio,
-
- static void write_config_reg(struct pinmux_info *gpioc,
- struct pinmux_cfg_reg *crp,
-- int index)
-+ int field, int value)
- {
-- unsigned long ncomb, pos, value;
-- void __iomem *mapped_reg;
--
-- ncomb = 1 << crp->field_width;
-- pos = index / ncomb;
-- value = index % ncomb;
--
-- mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-+ void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-
- gpio_write_reg(mapped_reg, crp->reg_width, crp->field_width,
-- pos, value, crp->reg);
-+ field, value, crp->reg);
- }
-
- static int check_config_reg(struct pinmux_info *gpioc,
- struct pinmux_cfg_reg *crp,
-- int index)
-+ int field, int value)
- {
-- unsigned long ncomb, pos, value;
-- void __iomem *mapped_reg;
--
-- ncomb = 1 << crp->field_width;
-- pos = index / ncomb;
-- value = index % ncomb;
--
-- mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-+ void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
-
- if (gpio_read_reg(mapped_reg, crp->reg_width,
-- crp->field_width, pos, crp->reg) == value)
-+ crp->field_width, field, crp->reg) == value)
- return 0;
-
- return -1;
-@@ -392,7 +380,7 @@ static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
- struct pinmux_cfg_reg *cr = NULL;
- pinmux_enum_t enum_id;
- struct pinmux_range *range;
-- int in_range, pos, index;
-+ int in_range, pos, field, value;
- unsigned long *cntp;
-
- switch (pinmux_type) {
-@@ -423,7 +411,8 @@ static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
-
- pos = 0;
- enum_id = 0;
-- index = 0;
-+ field = 0;
-+ value = 0;
- while (1) {
- pos = get_gpio_enum_id(gpioc, gpio, pos, &enum_id);
- if (pos <= 0)
-@@ -470,17 +459,19 @@ static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
- if (!in_range)
- continue;
-
-- if (get_config_reg(gpioc, enum_id, &cr, &index, &cntp) != 0)
-+ if (get_config_reg(gpioc, enum_id, &cr,
-+ &field, &value, &cntp) != 0)
- goto out_err;
-
- switch (cfg_mode) {
- case GPIO_CFG_DRYRUN:
-- if (!*cntp || !check_config_reg(gpioc, cr, index))
-+ if (!*cntp || !check_config_reg(gpioc, cr,
-+ field, value))
- continue;
- break;
-
- case GPIO_CFG_REQ:
-- write_config_reg(gpioc, cr, index);
-+ write_config_reg(gpioc, cr, field, value);
- *cntp = *cntp + 1;
- break;
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0018-sh-pfc-Add-config_reg_helper-function.patch b/patches.armadillo800eva/0018-sh-pfc-Add-config_reg_helper-function.patch
deleted file mode 100644
index 33006ebed79500..00000000000000
--- a/patches.armadillo800eva/0018-sh-pfc-Add-config_reg_helper-function.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From 1ff569d694245d09213108a6cfb69b405c1afeb3 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 14 Dec 2011 01:00:55 +0900
-Subject: sh: pfc: Add config_reg_helper() function
-
-Add a helper function for shared config reg access
-calculations. This allows us to reduce the amount
-of duplicated code, and at the same time prepare
-for a common place for future variable bitwidth
-config reg support.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 18925e118b3b4d55b45711218cd3c3c4360e5cd1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 76 +++++++++++++++++++++++-------------------------------
- 1 file changed, 32 insertions(+), 44 deletions(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index 41e7c8f..5481d19 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -167,41 +167,52 @@ static void gpio_write_bit(struct pinmux_data_reg *dr,
- gpio_write_raw_reg(dr->mapped_reg, dr->reg_width, dr->reg_shadow);
- }
-
--static int gpio_read_reg(void __iomem *mapped_reg, unsigned long reg_width,
-- unsigned long field_width, unsigned long in_pos,
-- unsigned long reg)
-+static void config_reg_helper(struct pinmux_info *gpioc,
-+ struct pinmux_cfg_reg *crp,
-+ unsigned long in_pos,
-+ void __iomem **mapped_regp,
-+ unsigned long *maskp,
-+ unsigned long *posp)
- {
-- unsigned long data, mask, pos;
-+ *mapped_regp = pfc_phys_to_virt(gpioc, crp->reg);
-
-- data = 0;
-- mask = (1 << field_width) - 1;
-- pos = reg_width - ((in_pos + 1) * field_width);
-+ *maskp = (1 << crp->field_width) - 1;
-+ *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
-+}
-+
-+static int read_config_reg(struct pinmux_info *gpioc,
-+ struct pinmux_cfg_reg *crp,
-+ unsigned long field)
-+{
-+ void __iomem *mapped_reg;
-+ unsigned long mask, pos;
-+
-+ config_reg_helper(gpioc, crp, field, &mapped_reg, &mask, &pos);
-
-- pr_debug("read_reg: addr = %lx, pos = %ld, "
-+ pr_debug("read_reg: addr = %lx, field = %ld, "
- "r_width = %ld, f_width = %ld\n",
-- reg, pos, reg_width, field_width);
-+ crp->reg, field, crp->reg_width, crp->field_width);
-
-- data = gpio_read_raw_reg(mapped_reg, reg_width);
-- return (data >> pos) & mask;
-+ return (gpio_read_raw_reg(mapped_reg, crp->reg_width) >> pos) & mask;
- }
-
--static void gpio_write_reg(void __iomem *mapped_reg, unsigned long reg_width,
-- unsigned long field_width, unsigned long in_pos,
-- unsigned long value, unsigned long reg)
-+static void write_config_reg(struct pinmux_info *gpioc,
-+ struct pinmux_cfg_reg *crp,
-+ unsigned long field, unsigned long value)
- {
-+ void __iomem *mapped_reg;
- unsigned long mask, pos;
-
-- mask = (1 << field_width) - 1;
-- pos = reg_width - ((in_pos + 1) * field_width);
-+ config_reg_helper(gpioc, crp, field, &mapped_reg, &mask, &pos);
-
-- pr_debug("write_reg addr = %lx, value = %ld, pos = %ld, "
-+ pr_debug("write_reg addr = %lx, value = %ld, field = %ld, "
- "r_width = %ld, f_width = %ld\n",
-- reg, value, pos, reg_width, field_width);
-+ crp->reg, value, field, crp->reg_width, crp->field_width);
-
- mask = ~(mask << pos);
- value = value << pos;
-
-- switch (reg_width) {
-+ switch (crp->reg_width) {
- case 8:
- iowrite8((ioread8(mapped_reg) & mask) | value, mapped_reg);
- break;
-@@ -349,29 +360,6 @@ static int get_gpio_enum_id(struct pinmux_info *gpioc, unsigned gpio,
- return -1;
- }
-
--static void write_config_reg(struct pinmux_info *gpioc,
-- struct pinmux_cfg_reg *crp,
-- int field, int value)
--{
-- void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
--
-- gpio_write_reg(mapped_reg, crp->reg_width, crp->field_width,
-- field, value, crp->reg);
--}
--
--static int check_config_reg(struct pinmux_info *gpioc,
-- struct pinmux_cfg_reg *crp,
-- int field, int value)
--{
-- void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
--
-- if (gpio_read_reg(mapped_reg, crp->reg_width,
-- crp->field_width, field, crp->reg) == value)
-- return 0;
--
-- return -1;
--}
--
- enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
-
- static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
-@@ -465,8 +453,8 @@ static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
-
- switch (cfg_mode) {
- case GPIO_CFG_DRYRUN:
-- if (!*cntp || !check_config_reg(gpioc, cr,
-- field, value))
-+ if (!*cntp ||
-+ (read_config_reg(gpioc, cr, field) != value))
- continue;
- break;
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0019-sh-pfc-Variable-bitfield-width-config-register-suppo.patch b/patches.armadillo800eva/0019-sh-pfc-Variable-bitfield-width-config-register-suppo.patch
deleted file mode 100644
index f29ef5273821b2..00000000000000
--- a/patches.armadillo800eva/0019-sh-pfc-Variable-bitfield-width-config-register-suppo.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From 0326f83e93ea7731f457acdbc3280bb69e3c0e78 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 14 Dec 2011 01:01:05 +0900
-Subject: sh: pfc: Variable bitfield width config register support
-
-Add support for variable config reg hardware by adding
-the macro PINMUX_CFG_REG_VAR(). The width of each bitfield
-needs to be passed to the macro, and the correct space must
-be consumed by each bitfield in the enum table following the
-macro. Data registers still need to have fixed bitfields.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit f78a26f55b2438c439609fc90b473f7f08f5b697)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 44 +++++++++++++++++++++++++++++++++-----------
- include/linux/sh_pfc.h | 9 ++++++++-
- 2 files changed, 41 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index 5481d19..f975f4a 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -174,10 +174,19 @@ static void config_reg_helper(struct pinmux_info *gpioc,
- unsigned long *maskp,
- unsigned long *posp)
- {
-+ int k;
-+
- *mapped_regp = pfc_phys_to_virt(gpioc, crp->reg);
-
-- *maskp = (1 << crp->field_width) - 1;
-- *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
-+ if (crp->field_width) {
-+ *maskp = (1 << crp->field_width) - 1;
-+ *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
-+ } else {
-+ *maskp = (1 << crp->var_field_width[in_pos]) - 1;
-+ *posp = crp->reg_width;
-+ for (k = 0; k <= in_pos; k++)
-+ *posp -= crp->var_field_width[k];
-+ }
- }
-
- static int read_config_reg(struct pinmux_info *gpioc,
-@@ -303,8 +312,8 @@ static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
- unsigned long **cntp)
- {
- struct pinmux_cfg_reg *config_reg;
-- unsigned long r_width, f_width;
-- int k, n;
-+ unsigned long r_width, f_width, curr_width, ncomb;
-+ int k, m, n, pos, bit_pos;
-
- k = 0;
- while (1) {
-@@ -315,14 +324,27 @@ static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
-
- if (!r_width)
- break;
-- for (n = 0; n < (r_width / f_width) * (1 << f_width); n++) {
-- if (config_reg->enum_ids[n] == enum_id) {
-- *crp = config_reg;
-- *fieldp = n / (1 << f_width);
-- *valuep = n % (1 << f_width);
-- *cntp = &config_reg->cnt[n / (1 << f_width)];
-- return 0;
-+
-+ pos = 0;
-+ m = 0;
-+ for (bit_pos = 0; bit_pos < r_width; bit_pos += curr_width) {
-+ if (f_width)
-+ curr_width = f_width;
-+ else
-+ curr_width = config_reg->var_field_width[m];
-+
-+ ncomb = 1 << curr_width;
-+ for (n = 0; n < ncomb; n++) {
-+ if (config_reg->enum_ids[pos + n] == enum_id) {
-+ *crp = config_reg;
-+ *fieldp = m;
-+ *valuep = n;
-+ *cntp = &config_reg->cnt[m];
-+ return 0;
-+ }
- }
-+ pos += ncomb;
-+ m++;
- }
- k++;
- }
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 91666a5..84538c4 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -45,12 +45,19 @@ struct pinmux_cfg_reg {
- unsigned long reg, reg_width, field_width;
- unsigned long *cnt;
- pinmux_enum_t *enum_ids;
-+ unsigned long *var_field_width;
- };
-
- #define PINMUX_CFG_REG(name, r, r_width, f_width) \
- .reg = r, .reg_width = r_width, .field_width = f_width, \
- .cnt = (unsigned long [r_width / f_width]) {}, \
-- .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \
-+ .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)])
-+
-+#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \
-+ .reg = r, .reg_width = r_width, \
-+ .cnt = (unsigned long [r_width]) {}, \
-+ .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \
-+ .enum_ids = (pinmux_enum_t [])
-
- struct pinmux_data_reg {
- unsigned long reg, reg_width, reg_shadow;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0020-sh-pfc-Unlock-register-support.patch b/patches.armadillo800eva/0020-sh-pfc-Unlock-register-support.patch
deleted file mode 100644
index 0508aa0a862f3d..00000000000000
--- a/patches.armadillo800eva/0020-sh-pfc-Unlock-register-support.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 6749dc26121059478d004099fd6e17334cfe4523 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 14 Dec 2011 01:01:14 +0900
-Subject: sh: pfc: Unlock register support
-
-Add PFC support for a 32-bit unlock register. Needed to
-drive the r8a7779 PFC that comes with a funky PMMR register.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit e499ada829cf769ac6f16627cd9f09b855a7fd6d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/pfc.c | 22 ++++++++++------------
- include/linux/sh_pfc.h | 2 ++
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
-index f975f4a..522c6c4 100644
---- a/drivers/sh/pfc.c
-+++ b/drivers/sh/pfc.c
-@@ -210,7 +210,7 @@ static void write_config_reg(struct pinmux_info *gpioc,
- unsigned long field, unsigned long value)
- {
- void __iomem *mapped_reg;
-- unsigned long mask, pos;
-+ unsigned long mask, pos, data;
-
- config_reg_helper(gpioc, crp, field, &mapped_reg, &mask, &pos);
-
-@@ -221,17 +221,15 @@ static void write_config_reg(struct pinmux_info *gpioc,
- mask = ~(mask << pos);
- value = value << pos;
-
-- switch (crp->reg_width) {
-- case 8:
-- iowrite8((ioread8(mapped_reg) & mask) | value, mapped_reg);
-- break;
-- case 16:
-- iowrite16((ioread16(mapped_reg) & mask) | value, mapped_reg);
-- break;
-- case 32:
-- iowrite32((ioread32(mapped_reg) & mask) | value, mapped_reg);
-- break;
-- }
-+ data = gpio_read_raw_reg(mapped_reg, crp->reg_width);
-+ data &= mask;
-+ data |= value;
-+
-+ if (gpioc->unlock_reg)
-+ gpio_write_raw_reg(pfc_phys_to_virt(gpioc, gpioc->unlock_reg),
-+ 32, ~data);
-+
-+ gpio_write_raw_reg(mapped_reg, crp->reg_width, data);
- }
-
- static int setup_data_reg(struct pinmux_info *gpioc, unsigned gpio)
-diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
-index 84538c4..5c15aed 100644
---- a/include/linux/sh_pfc.h
-+++ b/include/linux/sh_pfc.h
-@@ -116,6 +116,8 @@ struct pinmux_info {
- unsigned int num_resources;
- struct pfc_window *window;
-
-+ unsigned long unlock_reg;
-+
- struct gpio_chip chip;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0021-ARM-mach-shmobile-Break-out-INTC-IRQ-code.patch b/patches.armadillo800eva/0021-ARM-mach-shmobile-Break-out-INTC-IRQ-code.patch
deleted file mode 100644
index 59195515f28073..00000000000000
--- a/patches.armadillo800eva/0021-ARM-mach-shmobile-Break-out-INTC-IRQ-code.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-From e861be67e97d0646794cd5d478b3b25019a73543 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 12 Oct 2011 16:21:00 +0900
-Subject: ARM: mach-shmobile: Break out INTC IRQ code
-
-Add INTC_IRQ_PINS_16() and INTC_IRQ_PINS_32() to mach/intc.h.
-These macros define 16 or 32 external IRQ pins on a certain
-memory base address. Can be used with INTCA or INTCS.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit d6e15eefcb334deac3e877fce80ace3b91b0ab69)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/intc.h | 195 ++++++++++++++++++++++++++++
- 1 file changed, 195 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/include/mach/intc.h
-
-diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/include/mach/intc.h
-new file mode 100644
-index 0000000..1cd8b36
---- /dev/null
-+++ b/arch/arm/mach-shmobile/include/mach/intc.h
-@@ -0,0 +1,195 @@
-+#ifndef __ASM_MACH_INTC_H
-+#define __ASM_MACH_INTC_H
-+#include <linux/sh_intc.h>
-+
-+#define INTC_IRQ_PINS_ENUM_16L(p) \
-+ p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3, \
-+ p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7, \
-+ p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11, \
-+ p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15
-+
-+#define INTC_IRQ_PINS_ENUM_16H(p) \
-+ p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19, \
-+ p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23, \
-+ p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27, \
-+ p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31
-+
-+#define INTC_IRQ_PINS_VECT_16L(p, vect) \
-+ vect(p ## _IRQ0, 0x0200), vect(p ## _IRQ1, 0x0220), \
-+ vect(p ## _IRQ2, 0x0240), vect(p ## _IRQ3, 0x0260), \
-+ vect(p ## _IRQ4, 0x0280), vect(p ## _IRQ5, 0x02a0), \
-+ vect(p ## _IRQ6, 0x02c0), vect(p ## _IRQ7, 0x02e0), \
-+ vect(p ## _IRQ8, 0x0300), vect(p ## _IRQ9, 0x0320), \
-+ vect(p ## _IRQ10, 0x0340), vect(p ## _IRQ11, 0x0360), \
-+ vect(p ## _IRQ12, 0x0380), vect(p ## _IRQ13, 0x03a0), \
-+ vect(p ## _IRQ14, 0x03c0), vect(p ## _IRQ15, 0x03e0)
-+
-+#define INTC_IRQ_PINS_VECT_16H(p, vect) \
-+ vect(p ## _IRQ16, 0x3200), vect(p ## _IRQ17, 0x3220), \
-+ vect(p ## _IRQ18, 0x3240), vect(p ## _IRQ19, 0x3260), \
-+ vect(p ## _IRQ20, 0x3280), vect(p ## _IRQ21, 0x32a0), \
-+ vect(p ## _IRQ22, 0x32c0), vect(p ## _IRQ23, 0x32e0), \
-+ vect(p ## _IRQ24, 0x3300), vect(p ## _IRQ25, 0x3320), \
-+ vect(p ## _IRQ26, 0x3340), vect(p ## _IRQ27, 0x3360), \
-+ vect(p ## _IRQ28, 0x3380), vect(p ## _IRQ29, 0x33a0), \
-+ vect(p ## _IRQ30, 0x33c0), vect(p ## _IRQ31, 0x33e0)
-+
-+#define INTC_IRQ_PINS_MASK_16L(p, base) \
-+ { base + 0x40, base + 0x60, 8, /* INTMSK00A / INTMSKCLR00A */ \
-+ { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3, \
-+ p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } }, \
-+ { base + 0x44, base + 0x64, 8, /* INTMSK10A / INTMSKCLR10A */ \
-+ { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11, \
-+ p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-+
-+#define INTC_IRQ_PINS_MASK_16H(p, base) \
-+ { base + 0x48, base + 0x68, 8, /* INTMSK20A / INTMSKCLR20A */ \
-+ { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19, \
-+ p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } }, \
-+ { base + 0x4c, base + 0x6c, 8, /* INTMSK30A / INTMSKCLR30A */ \
-+ { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27, \
-+ p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-+
-+#define INTC_IRQ_PINS_PRIO_16L(p, base) \
-+ { base + 0x10, 0, 32, 4, /* INTPRI00A */ \
-+ { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3, \
-+ p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } }, \
-+ { base + 0x14, 0, 32, 4, /* INTPRI10A */ \
-+ { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11, \
-+ p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-+
-+#define INTC_IRQ_PINS_PRIO_16H(p, base) \
-+ { base + 0x18, 0, 32, 4, /* INTPRI20A */ \
-+ { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19, \
-+ p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } }, \
-+ { base + 0x1c, 0, 32, 4, /* INTPRI30A */ \
-+ { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27, \
-+ p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-+
-+#define INTC_IRQ_PINS_SENSE_16L(p, base) \
-+ { base + 0x00, 32, 4, /* ICR1A */ \
-+ { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3, \
-+ p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } }, \
-+ { base + 0x04, 32, 4, /* ICR2A */ \
-+ { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11, \
-+ p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-+
-+#define INTC_IRQ_PINS_SENSE_16H(p, base) \
-+ { base + 0x08, 32, 4, /* ICR3A */ \
-+ { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19, \
-+ p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } }, \
-+ { base + 0x0c, 32, 4, /* ICR4A */ \
-+ { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27, \
-+ p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-+
-+#define INTC_IRQ_PINS_ACK_16L(p, base) \
-+ { base + 0x20, 0, 8, /* INTREQ00A */ \
-+ { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3, \
-+ p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } }, \
-+ { base + 0x24, 0, 8, /* INTREQ10A */ \
-+ { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11, \
-+ p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-+
-+#define INTC_IRQ_PINS_ACK_16H(p, base) \
-+ { base + 0x28, 0, 8, /* INTREQ20A */ \
-+ { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19, \
-+ p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } }, \
-+ { base + 0x2c, 0, 8, /* INTREQ30A */ \
-+ { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27, \
-+ p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-+
-+#define INTC_IRQ_PINS_16(p, base, vect, str) \
-+ \
-+static struct resource p ## _resources[] __initdata = { \
-+ [0] = { \
-+ .start = base, \
-+ .end = base + 0x64, \
-+ .flags = IORESOURCE_MEM, \
-+ }, \
-+}; \
-+ \
-+enum { \
-+ p ## _UNUSED = 0, \
-+ INTC_IRQ_PINS_ENUM_16L(p), \
-+}; \
-+ \
-+static struct intc_vect p ## _vectors[] __initdata = { \
-+ INTC_IRQ_PINS_VECT_16L(p, vect), \
-+}; \
-+ \
-+static struct intc_mask_reg p ## _mask_registers[] __initdata = { \
-+ INTC_IRQ_PINS_MASK_16L(p, base), \
-+}; \
-+ \
-+static struct intc_prio_reg p ## _prio_registers[] __initdata = { \
-+ INTC_IRQ_PINS_PRIO_16L(p, base), \
-+}; \
-+ \
-+static struct intc_sense_reg p ## _sense_registers[] __initdata = { \
-+ INTC_IRQ_PINS_SENSE_16L(p, base), \
-+}; \
-+ \
-+static struct intc_mask_reg p ## _ack_registers[] __initdata = { \
-+ INTC_IRQ_PINS_ACK_16L(p, base), \
-+}; \
-+ \
-+static struct intc_desc p ## _desc __initdata = { \
-+ .name = str, \
-+ .resource = p ## _resources, \
-+ .num_resources = ARRAY_SIZE(p ## _resources), \
-+ .hw = INTC_HW_DESC(p ## _vectors, NULL, \
-+ p ## _mask_registers, p ## _prio_registers, \
-+ p ## _sense_registers, p ## _ack_registers) \
-+}
-+
-+#define INTC_IRQ_PINS_32(p, base, vect, str) \
-+ \
-+static struct resource p ## _resources[] __initdata = { \
-+ [0] = { \
-+ .start = base, \
-+ .end = base + 0x6c, \
-+ .flags = IORESOURCE_MEM, \
-+ }, \
-+}; \
-+ \
-+enum { \
-+ p ## _UNUSED = 0, \
-+ INTC_IRQ_PINS_ENUM_16L(p), \
-+ INTC_IRQ_PINS_ENUM_16H(p), \
-+}; \
-+ \
-+static struct intc_vect p ## _vectors[] __initdata = { \
-+ INTC_IRQ_PINS_VECT_16L(p, vect), \
-+ INTC_IRQ_PINS_VECT_16H(p, vect), \
-+}; \
-+ \
-+static struct intc_mask_reg p ## _mask_registers[] __initdata = { \
-+ INTC_IRQ_PINS_MASK_16L(p, base), \
-+ INTC_IRQ_PINS_MASK_16H(p, base), \
-+}; \
-+ \
-+static struct intc_prio_reg p ## _prio_registers[] __initdata = { \
-+ INTC_IRQ_PINS_PRIO_16L(p, base), \
-+ INTC_IRQ_PINS_PRIO_16H(p, base), \
-+}; \
-+ \
-+static struct intc_sense_reg p ## _sense_registers[] __initdata = { \
-+ INTC_IRQ_PINS_SENSE_16L(p, base), \
-+ INTC_IRQ_PINS_SENSE_16H(p, base), \
-+}; \
-+ \
-+static struct intc_mask_reg p ## _ack_registers[] __initdata = { \
-+ INTC_IRQ_PINS_ACK_16L(p, base), \
-+ INTC_IRQ_PINS_ACK_16H(p, base), \
-+}; \
-+ \
-+static struct intc_desc p ## _desc __initdata = { \
-+ .name = str, \
-+ .resource = p ## _resources, \
-+ .num_resources = ARRAY_SIZE(p ## _resources), \
-+ .hw = INTC_HW_DESC(p ## _vectors, NULL, \
-+ p ## _mask_registers, p ## _prio_registers, \
-+ p ## _sense_registers, p ## _ack_registers) \
-+}
-+
-+#endif /* __ASM_MACH_INTC_H */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0022-sh-intc-enable-both-edges-GPIO-interrupts-on-sh7372.patch b/patches.armadillo800eva/0022-sh-intc-enable-both-edges-GPIO-interrupts-on-sh7372.patch
deleted file mode 100644
index 171f0784a3ff8b..00000000000000
--- a/patches.armadillo800eva/0022-sh-intc-enable-both-edges-GPIO-interrupts-on-sh7372.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 2348ecf8f9c27a15eaa50e0df57d1626d3913ad4 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Fri, 15 Jul 2011 10:58:55 +0000
-Subject: sh: intc: enable both edges GPIO interrupts on sh7372
-
-IRQ-capable GPIOs on sh7372 can be configured to produce interrupts on
-both edges.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 9a14a92c939aea1aaf27f5ad37b26b235acc2a65)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index f33e2dd..33b2ed4 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -186,6 +186,9 @@ static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
- !defined(CONFIG_CPU_SUBTYPE_SH7709)
- [IRQ_TYPE_LEVEL_HIGH] = VALID(3),
- #endif
-+#if defined(CONFIG_ARCH_SH7372)
-+ [IRQ_TYPE_EDGE_BOTH] = VALID(4),
-+#endif
- };
-
- static int intc_set_type(struct irq_data *data, unsigned int type)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0023-sh-intc-Add-IRQ-trigger-bit-field-check.patch b/patches.armadillo800eva/0023-sh-intc-Add-IRQ-trigger-bit-field-check.patch
deleted file mode 100644
index 573787d277e81f..00000000000000
--- a/patches.armadillo800eva/0023-sh-intc-Add-IRQ-trigger-bit-field-check.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 3187b8ff897a3181b941621878f72fb6ee219b34 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 17 Oct 2011 17:59:54 +0900
-Subject: sh: intc: Add IRQ trigger bit field check
-
-R-Mobile SoCs such as sh73a0 include PINT blocks in INTC
-that come with 2-bit IRQ trigger support. Add code to make
-sure the bit width is checked so 4-bit only modes like for
-instance EDGE_BOTH will fail for PINT.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 52e3124f248e9ada990cd2aeafe250a53713c6f0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index 33b2ed4..e0ada37 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -202,11 +202,16 @@ static int intc_set_type(struct irq_data *data, unsigned int type)
- if (!value)
- return -EINVAL;
-
-+ value &= ~SENSE_VALID_FLAG;
-+
- ihp = intc_find_irq(d->sense, d->nr_sense, irq);
- if (ihp) {
-+ /* PINT has 2-bit sense registers, should fail on EDGE_BOTH */
-+ if (value >= (1 << _INTC_WIDTH(ihp->handle)))
-+ return -EINVAL;
-+
- addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0);
-- intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle,
-- value & ~SENSE_VALID_FLAG);
-+ intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value);
- }
-
- return 0;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0024-sh-userimask.c-needs-linux-stat.h.patch b/patches.armadillo800eva/0024-sh-userimask.c-needs-linux-stat.h.patch
deleted file mode 100644
index 5c9d14e7f6b49f..00000000000000
--- a/patches.armadillo800eva/0024-sh-userimask.c-needs-linux-stat.h.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 8a11831bfe1cfac1af9f51759cdf9e7033b05a02 Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Tue, 4 Oct 2011 10:17:21 +0900
-Subject: sh: userimask.c needs linux/stat.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This fix the problem that S_IRUSR and S_IWUSR are not solved in userimask.c.
-
------
-CC drivers/usb/host/r8a66597-hcd.o
-drivers/sh/intc/userimask.c:57: error: ‘S_IRUSR’ undeclared here (not in a function)
-drivers/sh/intc/userimask.c:57: error: ‘S_IWUSR’ undeclared here (not in a function)
-CC drivers/watchdog/shwdt.o
------
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a102a0888799d389c033fe22db3f1e153390fcc5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/userimask.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
-index e32304b..56bf933 100644
---- a/drivers/sh/intc/userimask.c
-+++ b/drivers/sh/intc/userimask.c
-@@ -13,6 +13,7 @@
- #include <linux/sysdev.h>
- #include <linux/init.h>
- #include <linux/io.h>
-+#include <linux/stat.h>
- #include <asm/sizes.h>
- #include "internals.h"
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0025-sh-fix-implicit-use-of-stat.h-in-arch-sh-specific-fi.patch b/patches.armadillo800eva/0025-sh-fix-implicit-use-of-stat.h-in-arch-sh-specific-fi.patch
deleted file mode 100644
index d59cf058669ee8..00000000000000
--- a/patches.armadillo800eva/0025-sh-fix-implicit-use-of-stat.h-in-arch-sh-specific-fi.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 9efd02e76527f0bd54f13c5c10aa02dee83a5de1 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 31 Jul 2011 17:40:26 -0400
-Subject: sh: fix implicit use of stat.h in arch/sh specific files
-
-To fix:
-
-arch/sh/drivers/dma/dma-sysfs.c:45:8: error: 'S_IRUGO' undeclared here (not in a function)
-arch/sh/drivers/dma/dma-sysfs.c:75:8: error: 'S_IWUSR' undeclared here (not in a function)
-make[4]: *** [arch/sh/drivers/dma/dma-sysfs.o] Error 1
-
-drivers/sh/intc/core.c:449: error: 'S_IRUGO' undeclared here (not in a function)
-make[5]: *** [drivers/sh/intc/core.o] Error 1
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 0c43871b4036444b8734d06ab9ec0bb9046aada4)
-
-Conflicts:
-
- arch/sh/drivers/dma/dma-sysfs.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/core.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index c6ca115..f892529 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -22,6 +22,7 @@
- #include <linux/irq.h>
- #include <linux/io.h>
- #include <linux/slab.h>
-+#include <linux/stat.h>
- #include <linux/interrupt.h>
- #include <linux/sh_intc.h>
- #include <linux/sysdev.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0026-sh-Add-module.h-to-arch-sh-specific-files-as-require.patch b/patches.armadillo800eva/0026-sh-Add-module.h-to-arch-sh-specific-files-as-require.patch
deleted file mode 100644
index b4e336afec0e1c..00000000000000
--- a/patches.armadillo800eva/0026-sh-Add-module.h-to-arch-sh-specific-files-as-require.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From d3a14f95c6aec6919dce9359f0e4f31aa5364976 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 31 Jul 2011 19:18:02 -0400
-Subject: sh: Add module.h to arch/sh specific files as required.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit db4e83957f961f9053282409c5062c6baef857a4)
-
-Conflicts:
-
- drivers/sh/maple/maple.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/dynamic.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/sh/intc/dynamic.c b/drivers/sh/intc/dynamic.c
-index a3677c9..5fea1ee 100644
---- a/drivers/sh/intc/dynamic.c
-+++ b/drivers/sh/intc/dynamic.c
-@@ -14,6 +14,7 @@
- #include <linux/irq.h>
- #include <linux/bitmap.h>
- #include <linux/spinlock.h>
-+#include <linux/module.h>
- #include "internals.h" /* only for activate_irq() damage.. */
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0027-sh-Add-export.h-to-arch-sh-specific-files-as-require.patch b/patches.armadillo800eva/0027-sh-Add-export.h-to-arch-sh-specific-files-as-require.patch
deleted file mode 100644
index 2b3196a709de58..00000000000000
--- a/patches.armadillo800eva/0027-sh-Add-export.h-to-arch-sh-specific-files-as-require.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 93b6afc62d174759ab0f9ebf5539fed48c9e3973 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 31 Jul 2011 19:20:02 -0400
-Subject: sh: Add export.h to arch/sh specific files as required.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit f7be345515ab6d5c3a0973bb2b32510fcb7c0481)
-
-Conflicts:
-
- arch/sh/drivers/pci/pci.c
- arch/sh/kernel/cpu/shmobile/cpuidle.c
- arch/sh/kernel/perf_event.c
- arch/sh/kernel/topology.c
- arch/sh/mm/init.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/core.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index f892529..8b7a141 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -30,6 +30,7 @@
- #include <linux/list.h>
- #include <linux/spinlock.h>
- #include <linux/radix-tree.h>
-+#include <linux/export.h>
- #include "internals.h"
-
- LIST_HEAD(intc_list);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0028-drivers-sh-Add-export.h-for-EXPORT_SYMBOL-to-intc-vi.patch b/patches.armadillo800eva/0028-drivers-sh-Add-export.h-for-EXPORT_SYMBOL-to-intc-vi.patch
deleted file mode 100644
index b7b7deec6348e2..00000000000000
--- a/patches.armadillo800eva/0028-drivers-sh-Add-export.h-for-EXPORT_SYMBOL-to-intc-vi.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From e92a630648d73850796db1c5fedece4937699378 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 10 Jul 2011 12:57:12 -0400
-Subject: drivers/sh: Add export.h for EXPORT_SYMBOL to intc/virq.c
-
-This is exporting symbols and will fail to build once we remove
-the implicit presence of module.h
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 07c92739455520541c22f6529683467aa3058b7c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/virq.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c
-index 1e6e2d0..c7ec49f 100644
---- a/drivers/sh/intc/virq.c
-+++ b/drivers/sh/intc/virq.c
-@@ -14,6 +14,7 @@
- #include <linux/list.h>
- #include <linux/radix-tree.h>
- #include <linux/spinlock.h>
-+#include <linux/export.h>
- #include "internals.h"
-
- static struct intc_map_entry intc_irq_xlate[NR_IRQS];
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0029-driver-core-implement-sysdev-functionality-for-regul.patch b/patches.armadillo800eva/0029-driver-core-implement-sysdev-functionality-for-regul.patch
deleted file mode 100644
index 3f767707ec7fe2..00000000000000
--- a/patches.armadillo800eva/0029-driver-core-implement-sysdev-functionality-for-regul.patch
+++ /dev/null
@@ -1,892 +0,0 @@
-From 3a44eab5cb01520d708aa6316ac636e02af5eda4 Mon Sep 17 00:00:00 2001
-From: Kay Sievers <kay.sievers@vrfy.org>
-Date: Wed, 14 Dec 2011 14:29:38 -0800
-Subject: driver-core: implement 'sysdev' functionality for regular devices
- and buses
-
-All sysdev classes and sysdev devices will converted to regular devices
-and buses to properly hook userspace into the event processing.
-
-There is no interesting difference between a 'sysdev' and 'device' which
-would justify to roll an entire own subsystem with different userspace
-export semantics. Userspace relies on events and generic sysfs subsystem
-infrastructure from sysdev devices, which are currently not properly
-available.
-
-Every converted sysdev class will create a regular device with the class
-name in /sys/devices/system and all registered devices will becom a children
-of theses devices.
-
-For compatibility reasons, the sysdev class-wide attributes are created
-at this parent device. (Do not copy that logic for anything new, subsystem-
-wide properties belong to the subsystem, not to some fake parent device
-created in /sys/devices.)
-
-Every sysdev driver is implemented as a simple subsystem interface now,
-and no longer called a driver.
-
-After all sysdev classes are ported to regular driver core entities, the
-sysdev implementation will be entirely removed from the kernel.
-
-Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit ca22e56debc57b47c422b749c93217ba62644be2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
-(cherry picked from commit c74f76e28635bb48b4c70ef51faa36d6aa19ef2f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/base.h | 12 +-
- drivers/base/bus.c | 293 ++++++++++++++++++++++++++++++++++++++++++++----
- drivers/base/class.c | 14 +--
- drivers/base/core.c | 85 +++++++++++---
- drivers/base/init.c | 1 -
- drivers/base/sys.c | 10 +-
- include/linux/device.h | 78 ++++++++++++-
- 7 files changed, 431 insertions(+), 62 deletions(-)
-
-diff --git a/drivers/base/base.h b/drivers/base/base.h
-index a34dca0..9798835 100644
---- a/drivers/base/base.h
-+++ b/drivers/base/base.h
-@@ -3,7 +3,9 @@
- * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure.
- *
- * @subsys - the struct kset that defines this subsystem
-- * @devices_kset - the list of devices associated
-+ * @devices_kset - the subsystem's 'devices' directory
-+ * @interfaces - list of subsystem interfaces associated
-+ * @mutex - protect the devices, and interfaces lists.
- *
- * @drivers_kset - the list of drivers associated
- * @klist_devices - the klist to iterate over the @devices_kset
-@@ -13,10 +15,8 @@
- * @bus - pointer back to the struct bus_type that this structure is associated
- * with.
- *
-- * @class_interfaces - list of class_interfaces associated
- * @glue_dirs - "glue" directory to put in-between the parent device to
- * avoid namespace conflicts
-- * @class_mutex - mutex to protect the children, devices, and interfaces lists.
- * @class - pointer back to the struct class that this structure is associated
- * with.
- *
-@@ -27,6 +27,8 @@
- struct subsys_private {
- struct kset subsys;
- struct kset *devices_kset;
-+ struct list_head interfaces;
-+ struct mutex mutex;
-
- struct kset *drivers_kset;
- struct klist klist_devices;
-@@ -35,9 +37,7 @@ struct subsys_private {
- unsigned int drivers_autoprobe:1;
- struct bus_type *bus;
-
-- struct list_head class_interfaces;
- struct kset glue_dirs;
-- struct mutex class_mutex;
- struct class *class;
- };
- #define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj)
-@@ -93,7 +93,6 @@ extern int hypervisor_init(void);
- static inline int hypervisor_init(void) { return 0; }
- #endif
- extern int platform_bus_init(void);
--extern int system_bus_init(void);
- extern int cpu_dev_init(void);
-
- extern int bus_add_device(struct device *dev);
-@@ -115,6 +114,7 @@ extern char *make_class_name(const char *name, struct kobject *kobj);
-
- extern int devres_release_all(struct device *dev);
-
-+/* /sys/devices directory */
- extern struct kset *devices_kset;
-
- #if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS)
-diff --git a/drivers/base/bus.c b/drivers/base/bus.c
-index 000e7b2..99dc592 100644
---- a/drivers/base/bus.c
-+++ b/drivers/base/bus.c
-@@ -16,9 +16,14 @@
- #include <linux/slab.h>
- #include <linux/init.h>
- #include <linux/string.h>
-+#include <linux/mutex.h>
- #include "base.h"
- #include "power/power.h"
-
-+/* /sys/devices/system */
-+/* FIXME: make static after drivers/base/sys.c is deleted */
-+struct kset *system_kset;
-+
- #define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr)
-
- /*
-@@ -360,6 +365,47 @@ struct device *bus_find_device_by_name(struct bus_type *bus,
- }
- EXPORT_SYMBOL_GPL(bus_find_device_by_name);
-
-+/**
-+ * subsys_find_device_by_id - find a device with a specific enumeration number
-+ * @subsys: subsystem
-+ * @id: index 'id' in struct device
-+ * @hint: device to check first
-+ *
-+ * Check the hint's next object and if it is a match return it directly,
-+ * otherwise, fall back to a full list search. Either way a reference for
-+ * the returned object is taken.
-+ */
-+struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id,
-+ struct device *hint)
-+{
-+ struct klist_iter i;
-+ struct device *dev;
-+
-+ if (!subsys)
-+ return NULL;
-+
-+ if (hint) {
-+ klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus);
-+ dev = next_device(&i);
-+ if (dev && dev->id == id && get_device(dev)) {
-+ klist_iter_exit(&i);
-+ return dev;
-+ }
-+ klist_iter_exit(&i);
-+ }
-+
-+ klist_iter_init_node(&subsys->p->klist_devices, &i, NULL);
-+ while ((dev = next_device(&i))) {
-+ if (dev->id == id && get_device(dev)) {
-+ klist_iter_exit(&i);
-+ return dev;
-+ }
-+ }
-+ klist_iter_exit(&i);
-+ return NULL;
-+}
-+EXPORT_SYMBOL_GPL(subsys_find_device_by_id);
-+
- static struct device_driver *next_driver(struct klist_iter *i)
- {
- struct klist_node *n = klist_next(i);
-@@ -487,38 +533,59 @@ out_put:
- void bus_probe_device(struct device *dev)
- {
- struct bus_type *bus = dev->bus;
-+ struct subsys_interface *sif;
- int ret;
-
-- if (bus && bus->p->drivers_autoprobe) {
-+ if (!bus)
-+ return;
-+
-+ if (bus->p->drivers_autoprobe) {
- ret = device_attach(dev);
- WARN_ON(ret < 0);
- }
-+
-+ mutex_lock(&bus->p->mutex);
-+ list_for_each_entry(sif, &bus->p->interfaces, node)
-+ if (sif->add_dev)
-+ sif->add_dev(dev, sif);
-+ mutex_unlock(&bus->p->mutex);
- }
-
- /**
- * bus_remove_device - remove device from bus
- * @dev: device to be removed
- *
-- * - Remove symlink from bus's directory.
-+ * - Remove device from all interfaces.
-+ * - Remove symlink from bus' directory.
- * - Delete device from bus's list.
- * - Detach from its driver.
- * - Drop reference taken in bus_add_device().
- */
- void bus_remove_device(struct device *dev)
- {
-- if (dev->bus) {
-- sysfs_remove_link(&dev->kobj, "subsystem");
-- sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
-- dev_name(dev));
-- device_remove_attrs(dev->bus, dev);
-- if (klist_node_attached(&dev->p->knode_bus))
-- klist_del(&dev->p->knode_bus);
--
-- pr_debug("bus: '%s': remove device %s\n",
-- dev->bus->name, dev_name(dev));
-- device_release_driver(dev);
-- bus_put(dev->bus);
-- }
-+ struct bus_type *bus = dev->bus;
-+ struct subsys_interface *sif;
-+
-+ if (!bus)
-+ return;
-+
-+ mutex_lock(&bus->p->mutex);
-+ list_for_each_entry(sif, &bus->p->interfaces, node)
-+ if (sif->remove_dev)
-+ sif->remove_dev(dev, sif);
-+ mutex_unlock(&bus->p->mutex);
-+
-+ sysfs_remove_link(&dev->kobj, "subsystem");
-+ sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
-+ dev_name(dev));
-+ device_remove_attrs(dev->bus, dev);
-+ if (klist_node_attached(&dev->p->knode_bus))
-+ klist_del(&dev->p->knode_bus);
-+
-+ pr_debug("bus: '%s': remove device %s\n",
-+ dev->bus->name, dev_name(dev));
-+ device_release_driver(dev);
-+ bus_put(dev->bus);
- }
-
- static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv)
-@@ -847,14 +914,14 @@ static ssize_t bus_uevent_store(struct bus_type *bus,
- static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store);
-
- /**
-- * bus_register - register a bus with the system.
-+ * __bus_register - register a driver-core subsystem
- * @bus: bus.
- *
- * Once we have that, we registered the bus with the kobject
- * infrastructure, then register the children subsystems it has:
-- * the devices and drivers that belong to the bus.
-+ * the devices and drivers that belong to the subsystem.
- */
--int bus_register(struct bus_type *bus)
-+int __bus_register(struct bus_type *bus, struct lock_class_key *key)
- {
- int retval;
- struct subsys_private *priv;
-@@ -898,6 +965,8 @@ int bus_register(struct bus_type *bus)
- goto bus_drivers_fail;
- }
-
-+ INIT_LIST_HEAD(&priv->interfaces);
-+ __mutex_init(&priv->mutex, "subsys mutex", key);
- klist_init(&priv->klist_devices, klist_devices_get, klist_devices_put);
- klist_init(&priv->klist_drivers, NULL, NULL);
-
-@@ -927,7 +996,7 @@ out:
- bus->p = NULL;
- return retval;
- }
--EXPORT_SYMBOL_GPL(bus_register);
-+EXPORT_SYMBOL_GPL(__bus_register);
-
- /**
- * bus_unregister - remove a bus from the system
-@@ -939,6 +1008,8 @@ EXPORT_SYMBOL_GPL(bus_register);
- void bus_unregister(struct bus_type *bus)
- {
- pr_debug("bus: '%s': unregistering\n", bus->name);
-+ if (bus->dev_root)
-+ device_unregister(bus->dev_root);
- bus_remove_attrs(bus);
- remove_probe_files(bus);
- kset_unregister(bus->p->drivers_kset);
-@@ -1028,10 +1099,194 @@ void bus_sort_breadthfirst(struct bus_type *bus,
- }
- EXPORT_SYMBOL_GPL(bus_sort_breadthfirst);
-
-+/**
-+ * subsys_dev_iter_init - initialize subsys device iterator
-+ * @iter: subsys iterator to initialize
-+ * @subsys: the subsys we wanna iterate over
-+ * @start: the device to start iterating from, if any
-+ * @type: device_type of the devices to iterate over, NULL for all
-+ *
-+ * Initialize subsys iterator @iter such that it iterates over devices
-+ * of @subsys. If @start is set, the list iteration will start there,
-+ * otherwise if it is NULL, the iteration starts at the beginning of
-+ * the list.
-+ */
-+void subsys_dev_iter_init(struct subsys_dev_iter *iter, struct bus_type *subsys,
-+ struct device *start, const struct device_type *type)
-+{
-+ struct klist_node *start_knode = NULL;
-+
-+ if (start)
-+ start_knode = &start->p->knode_bus;
-+ klist_iter_init_node(&subsys->p->klist_devices, &iter->ki, start_knode);
-+ iter->type = type;
-+}
-+EXPORT_SYMBOL_GPL(subsys_dev_iter_init);
-+
-+/**
-+ * subsys_dev_iter_next - iterate to the next device
-+ * @iter: subsys iterator to proceed
-+ *
-+ * Proceed @iter to the next device and return it. Returns NULL if
-+ * iteration is complete.
-+ *
-+ * The returned device is referenced and won't be released till
-+ * iterator is proceed to the next device or exited. The caller is
-+ * free to do whatever it wants to do with the device including
-+ * calling back into subsys code.
-+ */
-+struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
-+{
-+ struct klist_node *knode;
-+ struct device *dev;
-+
-+ for (;;) {
-+ knode = klist_next(&iter->ki);
-+ if (!knode)
-+ return NULL;
-+ dev = container_of(knode, struct device_private, knode_bus)->device;
-+ if (!iter->type || iter->type == dev->type)
-+ return dev;
-+ }
-+}
-+EXPORT_SYMBOL_GPL(subsys_dev_iter_next);
-+
-+/**
-+ * subsys_dev_iter_exit - finish iteration
-+ * @iter: subsys iterator to finish
-+ *
-+ * Finish an iteration. Always call this function after iteration is
-+ * complete whether the iteration ran till the end or not.
-+ */
-+void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
-+{
-+ klist_iter_exit(&iter->ki);
-+}
-+EXPORT_SYMBOL_GPL(subsys_dev_iter_exit);
-+
-+int subsys_interface_register(struct subsys_interface *sif)
-+{
-+ struct bus_type *subsys;
-+ struct subsys_dev_iter iter;
-+ struct device *dev;
-+
-+ if (!sif || !sif->subsys)
-+ return -ENODEV;
-+
-+ subsys = bus_get(sif->subsys);
-+ if (!subsys)
-+ return -EINVAL;
-+
-+ mutex_lock(&subsys->p->mutex);
-+ list_add_tail(&sif->node, &subsys->p->interfaces);
-+ if (sif->add_dev) {
-+ subsys_dev_iter_init(&iter, subsys, NULL, NULL);
-+ while ((dev = subsys_dev_iter_next(&iter)))
-+ sif->add_dev(dev, sif);
-+ subsys_dev_iter_exit(&iter);
-+ }
-+ mutex_unlock(&subsys->p->mutex);
-+
-+ return 0;
-+}
-+EXPORT_SYMBOL_GPL(subsys_interface_register);
-+
-+void subsys_interface_unregister(struct subsys_interface *sif)
-+{
-+ struct bus_type *subsys = sif->subsys;
-+ struct subsys_dev_iter iter;
-+ struct device *dev;
-+
-+ if (!sif)
-+ return;
-+
-+ mutex_lock(&subsys->p->mutex);
-+ list_del_init(&sif->node);
-+ if (sif->remove_dev) {
-+ subsys_dev_iter_init(&iter, subsys, NULL, NULL);
-+ while ((dev = subsys_dev_iter_next(&iter)))
-+ sif->remove_dev(dev, sif);
-+ subsys_dev_iter_exit(&iter);
-+ }
-+ mutex_unlock(&subsys->p->mutex);
-+
-+ bus_put(subsys);
-+}
-+EXPORT_SYMBOL_GPL(subsys_interface_unregister);
-+
-+static void system_root_device_release(struct device *dev)
-+{
-+ kfree(dev);
-+}
-+/**
-+ * subsys_system_register - register a subsystem at /sys/devices/system/
-+ * @subsys - system subsystem
-+ * @groups - default attributes for the root device
-+ *
-+ * All 'system' subsystems have a /sys/devices/system/<name> root device
-+ * with the name of the subsystem. The root device can carry subsystem-
-+ * wide attributes. All registered devices are below this single root
-+ * device and are named after the subsystem with a simple enumeration
-+ * number appended. The registered devices are not explicitely named;
-+ * only 'id' in the device needs to be set.
-+ *
-+ * Do not use this interface for anything new, it exists for compatibility
-+ * with bad ideas only. New subsystems should use plain subsystems; and
-+ * add the subsystem-wide attributes should be added to the subsystem
-+ * directory itself and not some create fake root-device placed in
-+ * /sys/devices/system/<name>.
-+ */
-+int subsys_system_register(struct bus_type *subsys,
-+ const struct attribute_group **groups)
-+{
-+ struct device *dev;
-+ int err;
-+
-+ err = bus_register(subsys);
-+ if (err < 0)
-+ return err;
-+
-+ dev = kzalloc(sizeof(struct device), GFP_KERNEL);
-+ if (!dev) {
-+ err = -ENOMEM;
-+ goto err_dev;
-+ }
-+
-+ err = dev_set_name(dev, "%s", subsys->name);
-+ if (err < 0)
-+ goto err_name;
-+
-+ dev->kobj.parent = &system_kset->kobj;
-+ dev->groups = groups;
-+ dev->release = system_root_device_release;
-+
-+ err = device_register(dev);
-+ if (err < 0)
-+ goto err_dev_reg;
-+
-+ subsys->dev_root = dev;
-+ return 0;
-+
-+err_dev_reg:
-+ put_device(dev);
-+ dev = NULL;
-+err_name:
-+ kfree(dev);
-+err_dev:
-+ bus_unregister(subsys);
-+ return err;
-+}
-+EXPORT_SYMBOL_GPL(subsys_system_register);
-+
- int __init buses_init(void)
- {
- bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL);
- if (!bus_kset)
- return -ENOMEM;
-+
-+ system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
-+ if (!system_kset)
-+ return -ENOMEM;
-+
- return 0;
- }
-diff --git a/drivers/base/class.c b/drivers/base/class.c
-index 4f1df2e..7dd06d7 100644
---- a/drivers/base/class.c
-+++ b/drivers/base/class.c
-@@ -171,9 +171,9 @@ int __class_register(struct class *cls, struct lock_class_key *key)
- if (!cp)
- return -ENOMEM;
- klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put);
-- INIT_LIST_HEAD(&cp->class_interfaces);
-+ INIT_LIST_HEAD(&cp->interfaces);
- kset_init(&cp->glue_dirs);
-- __mutex_init(&cp->class_mutex, "struct class mutex", key);
-+ __mutex_init(&cp->mutex, "subsys mutex", key);
- error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
- if (error) {
- kfree(cp);
-@@ -447,15 +447,15 @@ int class_interface_register(struct class_interface *class_intf)
- if (!parent)
- return -EINVAL;
-
-- mutex_lock(&parent->p->class_mutex);
-- list_add_tail(&class_intf->node, &parent->p->class_interfaces);
-+ mutex_lock(&parent->p->mutex);
-+ list_add_tail(&class_intf->node, &parent->p->interfaces);
- if (class_intf->add_dev) {
- class_dev_iter_init(&iter, parent, NULL, NULL);
- while ((dev = class_dev_iter_next(&iter)))
- class_intf->add_dev(dev, class_intf);
- class_dev_iter_exit(&iter);
- }
-- mutex_unlock(&parent->p->class_mutex);
-+ mutex_unlock(&parent->p->mutex);
-
- return 0;
- }
-@@ -469,7 +469,7 @@ void class_interface_unregister(struct class_interface *class_intf)
- if (!parent)
- return;
-
-- mutex_lock(&parent->p->class_mutex);
-+ mutex_lock(&parent->p->mutex);
- list_del_init(&class_intf->node);
- if (class_intf->remove_dev) {
- class_dev_iter_init(&iter, parent, NULL, NULL);
-@@ -477,7 +477,7 @@ void class_interface_unregister(struct class_interface *class_intf)
- class_intf->remove_dev(dev, class_intf);
- class_dev_iter_exit(&iter);
- }
-- mutex_unlock(&parent->p->class_mutex);
-+ mutex_unlock(&parent->p->mutex);
-
- class_put(parent);
- }
-diff --git a/drivers/base/core.c b/drivers/base/core.c
-index d13851c..25f4192 100644
---- a/drivers/base/core.c
-+++ b/drivers/base/core.c
-@@ -118,6 +118,56 @@ static const struct sysfs_ops dev_sysfs_ops = {
- .store = dev_attr_store,
- };
-
-+#define to_ext_attr(x) container_of(x, struct dev_ext_attribute, attr)
-+
-+ssize_t device_store_ulong(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t size)
-+{
-+ struct dev_ext_attribute *ea = to_ext_attr(attr);
-+ char *end;
-+ unsigned long new = simple_strtoul(buf, &end, 0);
-+ if (end == buf)
-+ return -EINVAL;
-+ *(unsigned long *)(ea->var) = new;
-+ /* Always return full write size even if we didn't consume all */
-+ return size;
-+}
-+EXPORT_SYMBOL_GPL(device_store_ulong);
-+
-+ssize_t device_show_ulong(struct device *dev,
-+ struct device_attribute *attr,
-+ char *buf)
-+{
-+ struct dev_ext_attribute *ea = to_ext_attr(attr);
-+ return snprintf(buf, PAGE_SIZE, "%lx\n", *(unsigned long *)(ea->var));
-+}
-+EXPORT_SYMBOL_GPL(device_show_ulong);
-+
-+ssize_t device_store_int(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t size)
-+{
-+ struct dev_ext_attribute *ea = to_ext_attr(attr);
-+ char *end;
-+ long new = simple_strtol(buf, &end, 0);
-+ if (end == buf || new > INT_MAX || new < INT_MIN)
-+ return -EINVAL;
-+ *(int *)(ea->var) = new;
-+ /* Always return full write size even if we didn't consume all */
-+ return size;
-+}
-+EXPORT_SYMBOL_GPL(device_store_int);
-+
-+ssize_t device_show_int(struct device *dev,
-+ struct device_attribute *attr,
-+ char *buf)
-+{
-+ struct dev_ext_attribute *ea = to_ext_attr(attr);
-+
-+ return snprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var));
-+}
-+EXPORT_SYMBOL_GPL(device_show_int);
-
- /**
- * device_release - free device structure.
-@@ -464,7 +514,7 @@ static ssize_t show_dev(struct device *dev, struct device_attribute *attr,
- static struct device_attribute devt_attr =
- __ATTR(dev, S_IRUGO, show_dev, NULL);
-
--/* kset to create /sys/devices/ */
-+/* /sys/devices/ */
- struct kset *devices_kset;
-
- /**
-@@ -711,6 +761,10 @@ static struct kobject *get_device_parent(struct device *dev,
- return k;
- }
-
-+ /* subsystems can specify a default root directory for their devices */
-+ if (!parent && dev->bus && dev->bus->dev_root)
-+ return &dev->bus->dev_root->kobj;
-+
- if (parent)
- return &parent->kobj;
- return NULL;
-@@ -731,14 +785,6 @@ static void cleanup_device_parent(struct device *dev)
- cleanup_glue_dir(dev, dev->kobj.parent);
- }
-
--static void setup_parent(struct device *dev, struct device *parent)
--{
-- struct kobject *kobj;
-- kobj = get_device_parent(dev, parent);
-- if (kobj)
-- dev->kobj.parent = kobj;
--}
--
- static int device_add_class_symlinks(struct device *dev)
- {
- int error;
-@@ -891,6 +937,7 @@ int device_private_init(struct device *dev)
- int device_add(struct device *dev)
- {
- struct device *parent = NULL;
-+ struct kobject *kobj;
- struct class_interface *class_intf;
- int error = -EINVAL;
-
-@@ -914,6 +961,10 @@ int device_add(struct device *dev)
- dev->init_name = NULL;
- }
-
-+ /* subsystems can specify simple device enumeration */
-+ if (!dev_name(dev) && dev->bus && dev->bus->dev_name)
-+ dev_set_name(dev, "%s%u", dev->bus->dev_name, dev->id);
-+
- if (!dev_name(dev)) {
- error = -EINVAL;
- goto name_error;
-@@ -922,7 +973,9 @@ int device_add(struct device *dev)
- pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
-
- parent = get_device(dev->parent);
-- setup_parent(dev, parent);
-+ kobj = get_device_parent(dev, parent);
-+ if (kobj)
-+ dev->kobj.parent = kobj;
-
- /* use parent numa_node */
- if (parent)
-@@ -982,17 +1035,17 @@ int device_add(struct device *dev)
- &parent->p->klist_children);
-
- if (dev->class) {
-- mutex_lock(&dev->class->p->class_mutex);
-+ mutex_lock(&dev->class->p->mutex);
- /* tie the class to the device */
- klist_add_tail(&dev->knode_class,
- &dev->class->p->klist_devices);
-
- /* notify any interfaces that the device is here */
- list_for_each_entry(class_intf,
-- &dev->class->p->class_interfaces, node)
-+ &dev->class->p->interfaces, node)
- if (class_intf->add_dev)
- class_intf->add_dev(dev, class_intf);
-- mutex_unlock(&dev->class->p->class_mutex);
-+ mutex_unlock(&dev->class->p->mutex);
- }
- done:
- put_device(dev);
-@@ -1107,15 +1160,15 @@ void device_del(struct device *dev)
- if (dev->class) {
- device_remove_class_symlinks(dev);
-
-- mutex_lock(&dev->class->p->class_mutex);
-+ mutex_lock(&dev->class->p->mutex);
- /* notify any interfaces that the device is now gone */
- list_for_each_entry(class_intf,
-- &dev->class->p->class_interfaces, node)
-+ &dev->class->p->interfaces, node)
- if (class_intf->remove_dev)
- class_intf->remove_dev(dev, class_intf);
- /* remove the device from the class list */
- klist_del(&dev->knode_class);
-- mutex_unlock(&dev->class->p->class_mutex);
-+ mutex_unlock(&dev->class->p->mutex);
- }
- device_remove_file(dev, &uevent_attr);
- device_remove_attrs(dev);
-diff --git a/drivers/base/init.c b/drivers/base/init.c
-index c8a934e..c16f0b8 100644
---- a/drivers/base/init.c
-+++ b/drivers/base/init.c
-@@ -31,7 +31,6 @@ void __init driver_init(void)
- * core core pieces.
- */
- platform_bus_init();
-- system_bus_init();
- cpu_dev_init();
- memory_dev_init();
- }
-diff --git a/drivers/base/sys.c b/drivers/base/sys.c
-index 9dff77b..409f5ce 100644
---- a/drivers/base/sys.c
-+++ b/drivers/base/sys.c
-@@ -126,7 +126,7 @@ void sysdev_class_remove_file(struct sysdev_class *c,
- }
- EXPORT_SYMBOL_GPL(sysdev_class_remove_file);
-
--static struct kset *system_kset;
-+extern struct kset *system_kset;
-
- int sysdev_class_register(struct sysdev_class *cls)
- {
-@@ -331,14 +331,6 @@ void sysdev_unregister(struct sys_device *sysdev)
- EXPORT_SYMBOL_GPL(sysdev_register);
- EXPORT_SYMBOL_GPL(sysdev_unregister);
-
--int __init system_bus_init(void)
--{
-- system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
-- if (!system_kset)
-- return -ENOMEM;
-- return 0;
--}
--
- #define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr)
-
- ssize_t sysdev_store_ulong(struct sys_device *sysdev,
-diff --git a/include/linux/device.h b/include/linux/device.h
-index e4f62d8..0aa0b62 100644
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -51,6 +51,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
- * struct bus_type - The bus type of the device
- *
- * @name: The name of the bus.
-+ * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id).
-+ * @dev_root: Default device to use as the parent.
- * @bus_attrs: Default attributes of the bus.
- * @dev_attrs: Default attributes of the devices on the bus.
- * @drv_attrs: Default attributes of the device drivers on the bus.
-@@ -81,6 +83,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
- */
- struct bus_type {
- const char *name;
-+ const char *dev_name;
-+ struct device *dev_root;
- struct bus_attribute *bus_attrs;
- struct device_attribute *dev_attrs;
- struct driver_attribute *drv_attrs;
-@@ -99,12 +103,30 @@ struct bus_type {
- struct subsys_private *p;
- };
-
--extern int __must_check bus_register(struct bus_type *bus);
-+/* This is a #define to keep the compiler from merging different
-+ * instances of the __key variable */
-+#define bus_register(subsys) \
-+({ \
-+ static struct lock_class_key __key; \
-+ __bus_register(subsys, &__key); \
-+})
-+extern int __must_check __bus_register(struct bus_type *bus,
-+ struct lock_class_key *key);
- extern void bus_unregister(struct bus_type *bus);
-
- extern int __must_check bus_rescan_devices(struct bus_type *bus);
-
- /* iterator helpers for buses */
-+struct subsys_dev_iter {
-+ struct klist_iter ki;
-+ const struct device_type *type;
-+};
-+void subsys_dev_iter_init(struct subsys_dev_iter *iter,
-+ struct bus_type *subsys,
-+ struct device *start,
-+ const struct device_type *type);
-+struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
-+void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
-
- int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
- int (*fn)(struct device *dev, void *data));
-@@ -114,10 +136,10 @@ struct device *bus_find_device(struct bus_type *bus, struct device *start,
- struct device *bus_find_device_by_name(struct bus_type *bus,
- struct device *start,
- const char *name);
--
-+struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
-+ struct device *hint);
- int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
- void *data, int (*fn)(struct device_driver *, void *));
--
- void bus_sort_breadthfirst(struct bus_type *bus,
- int (*compare)(const struct device *a,
- const struct device *b));
-@@ -249,6 +271,33 @@ struct device *driver_find_device(struct device_driver *drv,
- int (*match)(struct device *dev, void *data));
-
- /**
-+ * struct subsys_interface - interfaces to device functions
-+ * @name name of the device function
-+ * @subsystem subsytem of the devices to attach to
-+ * @node the list of functions registered at the subsystem
-+ * @add device hookup to device function handler
-+ * @remove device hookup to device function handler
-+ *
-+ * Simple interfaces attached to a subsystem. Multiple interfaces can
-+ * attach to a subsystem and its devices. Unlike drivers, they do not
-+ * exclusively claim or control devices. Interfaces usually represent
-+ * a specific functionality of a subsystem/class of devices.
-+ */
-+struct subsys_interface {
-+ const char *name;
-+ struct bus_type *subsys;
-+ struct list_head node;
-+ int (*add_dev)(struct device *dev, struct subsys_interface *sif);
-+ int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
-+};
-+
-+int subsys_interface_register(struct subsys_interface *sif);
-+void subsys_interface_unregister(struct subsys_interface *sif);
-+
-+int subsys_system_register(struct bus_type *subsys,
-+ const struct attribute_group **groups);
-+
-+/**
- * struct class - device classes
- * @name: Name of the class.
- * @owner: The module owner.
-@@ -429,8 +478,28 @@ struct device_attribute {
- const char *buf, size_t count);
- };
-
-+struct dev_ext_attribute {
-+ struct device_attribute attr;
-+ void *var;
-+};
-+
-+ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
-+ char *buf);
-+ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
-+ const char *buf, size_t count);
-+ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
-+ char *buf);
-+ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
-+ const char *buf, size_t count);
-+
- #define DEVICE_ATTR(_name, _mode, _show, _store) \
--struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
-+ struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
-+#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
-+ struct dev_ext_attribute dev_attr_##_name = \
-+ { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
-+#define DEVICE_INT_ATTR(_name, _mode, _var) \
-+ struct dev_ext_attribute dev_attr_##_name = \
-+ { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
-
- extern int __must_check device_create_file(struct device *device,
- const struct device_attribute *entry);
-@@ -591,6 +660,7 @@ struct device {
- struct device_node *of_node; /* associated device tree node */
-
- dev_t devt; /* dev_t, creates the sysfs "dev" */
-+ u32 id; /* device instance */
-
- spinlock_t devres_lock;
- struct list_head devres_head;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0030-sh-intc-Allow-triggering-on-both-edges-for-ARM-SoCs.patch b/patches.armadillo800eva/0030-sh-intc-Allow-triggering-on-both-edges-for-ARM-SoCs.patch
deleted file mode 100644
index ec13f1f4925a56..00000000000000
--- a/patches.armadillo800eva/0030-sh-intc-Allow-triggering-on-both-edges-for-ARM-SoCs.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 5550b1a3a4608fddc90dcb515bf6d37d2b583444 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 12 Oct 2011 16:21:08 +0900
-Subject: sh: intc: Allow triggering on both edges for ARM SoCs
-
-Enable IRQ_TYPE_EDGE_BOTH on all R/SH-Mobile ARM SoCs.
-This hardware feature is supported by sh7367, sh7377,
-sh7372 and sh73a0.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 7d377b170ae0d4df7692f50c9609bea385fe87cc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index e0ada37..7b246ef 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -186,7 +186,7 @@ static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
- !defined(CONFIG_CPU_SUBTYPE_SH7709)
- [IRQ_TYPE_LEVEL_HIGH] = VALID(3),
- #endif
--#if defined(CONFIG_ARCH_SH7372)
-+#if defined(CONFIG_ARM) /* all recent SH-Mobile / R-Mobile ARM support this */
- [IRQ_TYPE_EDGE_BOTH] = VALID(4),
- #endif
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0031-sh-intc-convert-sysdev_class-to-a-regular-subsystem.patch b/patches.armadillo800eva/0031-sh-intc-convert-sysdev_class-to-a-regular-subsystem.patch
deleted file mode 100644
index 18a9257da60825..00000000000000
--- a/patches.armadillo800eva/0031-sh-intc-convert-sysdev_class-to-a-regular-subsystem.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-From 8d126bb8929dba08753fdc1acb217f20a3c4ae43 Mon Sep 17 00:00:00 2001
-From: Kay Sievers <kay.sievers@vrfy.org>
-Date: Wed, 21 Dec 2011 15:09:52 -0800
-Subject: sh: intc - convert sysdev_class to a regular subsystem
-
-After all sysdev classes are ported to regular driver core entities, the
-sysdev implementation will be entirely removed from the kernel.
-
-Cc: Paul Mundt <lethal@linux-sh.org>
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit f4e73bfcd9cca0b64cc8096175852936fb1d111f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/core.c | 29 +++++++++++++++--------------
- drivers/sh/intc/internals.h | 6 +++---
- drivers/sh/intc/userimask.c | 16 ++++++++--------
- 3 files changed, 26 insertions(+), 25 deletions(-)
-
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index 8b7a141..e85512d 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -25,7 +25,7 @@
- #include <linux/stat.h>
- #include <linux/interrupt.h>
- #include <linux/sh_intc.h>
--#include <linux/sysdev.h>
-+#include <linux/device.h>
- #include <linux/syscore_ops.h>
- #include <linux/list.h>
- #include <linux/spinlock.h>
-@@ -434,46 +434,47 @@ struct syscore_ops intc_syscore_ops = {
- .resume = intc_resume,
- };
-
--struct sysdev_class intc_sysdev_class = {
-+struct bus_type intc_subsys = {
- .name = "intc",
-+ .dev_name = "intc",
- };
-
- static ssize_t
--show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
-+show_intc_name(struct device *dev, struct device_attribute *attr, char *buf)
- {
- struct intc_desc_int *d;
-
-- d = container_of(dev, struct intc_desc_int, sysdev);
-+ d = container_of(dev, struct intc_desc_int, dev);
-
- return sprintf(buf, "%s\n", d->chip.name);
- }
-
--static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL);
-+static DEVICE_ATTR(name, S_IRUGO, show_intc_name, NULL);
-
--static int __init register_intc_sysdevs(void)
-+static int __init register_intc_devs(void)
- {
- struct intc_desc_int *d;
- int error;
-
- register_syscore_ops(&intc_syscore_ops);
-
-- error = sysdev_class_register(&intc_sysdev_class);
-+ error = subsys_system_register(&intc_subsys, NULL);
- if (!error) {
- list_for_each_entry(d, &intc_list, list) {
-- d->sysdev.id = d->index;
-- d->sysdev.cls = &intc_sysdev_class;
-- error = sysdev_register(&d->sysdev);
-+ d->dev.id = d->index;
-+ d->dev.bus = &intc_subsys;
-+ error = device_register(&d->dev);
- if (error == 0)
-- error = sysdev_create_file(&d->sysdev,
-- &attr_name);
-+ error = device_create_file(&d->dev,
-+ &dev_attr_name);
- if (error)
- break;
- }
- }
-
- if (error)
-- pr_err("sysdev registration error\n");
-+ pr_err("device registration error\n");
-
- return error;
- }
--device_initcall(register_intc_sysdevs);
-+device_initcall(register_intc_devs);
-diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
-index 5b93485..1c2722e 100644
---- a/drivers/sh/intc/internals.h
-+++ b/drivers/sh/intc/internals.h
-@@ -4,7 +4,7 @@
- #include <linux/kernel.h>
- #include <linux/types.h>
- #include <linux/radix-tree.h>
--#include <linux/sysdev.h>
-+#include <linux/device.h>
-
- #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \
- ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \
-@@ -51,7 +51,7 @@ struct intc_subgroup_entry {
-
- struct intc_desc_int {
- struct list_head list;
-- struct sys_device sysdev;
-+ struct device dev;
- struct radix_tree_root tree;
- raw_spinlock_t lock;
- unsigned int index;
-@@ -157,7 +157,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle);
- extern struct list_head intc_list;
- extern raw_spinlock_t intc_big_lock;
- extern unsigned int nr_intc_controllers;
--extern struct sysdev_class intc_sysdev_class;
-+extern struct bus_type intc_subsys;
-
- unsigned int intc_get_dfl_prio_level(void);
- unsigned int intc_get_prio_level(unsigned int irq);
-diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
-index 56bf933..e649cea 100644
---- a/drivers/sh/intc/userimask.c
-+++ b/drivers/sh/intc/userimask.c
-@@ -10,7 +10,7 @@
- #define pr_fmt(fmt) "intc: " fmt
-
- #include <linux/errno.h>
--#include <linux/sysdev.h>
-+#include <linux/device.h>
- #include <linux/init.h>
- #include <linux/io.h>
- #include <linux/stat.h>
-@@ -20,15 +20,15 @@
- static void __iomem *uimask;
-
- static ssize_t
--show_intc_userimask(struct sysdev_class *cls,
-- struct sysdev_class_attribute *attr, char *buf)
-+show_intc_userimask(struct device *dev,
-+ struct device_attribute *attr, char *buf)
- {
- return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf);
- }
-
- static ssize_t
--store_intc_userimask(struct sysdev_class *cls,
-- struct sysdev_class_attribute *attr,
-+store_intc_userimask(struct device *dev,
-+ struct device_attribute *attr,
- const char *buf, size_t count)
- {
- unsigned long level;
-@@ -55,8 +55,8 @@ store_intc_userimask(struct sysdev_class *cls,
- return count;
- }
-
--static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR,
-- show_intc_userimask, store_intc_userimask);
-+static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR,
-+ show_intc_userimask, store_intc_userimask);
-
-
- static int __init userimask_sysdev_init(void)
-@@ -64,7 +64,7 @@ static int __init userimask_sysdev_init(void)
- if (unlikely(!uimask))
- return -ENXIO;
-
-- return sysdev_class_create_file(&intc_sysdev_class, &attr_userimask);
-+ return device_create_file(intc_subsys.dev_root, &dev_attr_userimask);
- }
- late_initcall(userimask_sysdev_init);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0032-PM-shmobile-Don-t-include-SH7372-s-INTCS-in-syscore-.patch b/patches.armadillo800eva/0032-PM-shmobile-Don-t-include-SH7372-s-INTCS-in-syscore-.patch
deleted file mode 100644
index e7a2221556cda6..00000000000000
--- a/patches.armadillo800eva/0032-PM-shmobile-Don-t-include-SH7372-s-INTCS-in-syscore-.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 7e0208976896549c601b52ee1125ab1e5c036841 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 23 Dec 2011 01:23:30 +0100
-Subject: PM / shmobile: Don't include SH7372's INTCS in syscore
- suspend/resume
-
-Since the SH7372's INTCS in included into syscore suspend/resume,
-which causes the chip to be accessed when PM domains have been
-turned off during system suspend, the A4R domain containing the
-INTCS has to stay on during system sleep, which is suboptimal
-from the power consumption point of view.
-
-For this reason, add a new INTC flag, skip_syscore_suspend, to mark
-the INTCS for intc_suspend() and intc_resume(), so that they don't
-touch it. This allows the A4R domain to be turned off during
-system suspend and the INTCS state is resrored during system
-resume by the A4R's "power on" code.
-
-Suggested-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit 0f966d74cf77a9140a025464a287e1d2fee8a1fc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/intc-sh7372.c | 1 +
- drivers/sh/intc/core.c | 8 ++++++++
- drivers/sh/intc/internals.h | 1 +
- include/linux/sh_intc.h | 1 +
- 4 files changed, 11 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
-index 3b28743..1d4c332 100644
---- a/arch/arm/mach-shmobile/intc-sh7372.c
-+++ b/arch/arm/mach-shmobile/intc-sh7372.c
-@@ -593,6 +593,7 @@ static struct resource intcs_resources[] __initdata = {
- static struct intc_desc intcs_desc __initdata = {
- .name = "sh7372-intcs",
- .force_enable = ENABLED_INTCS,
-+ .skip_syscore_suspend = true,
- .resource = intcs_resources,
- .num_resources = ARRAY_SIZE(intcs_resources),
- .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index e85512d..e53e449 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -354,6 +354,8 @@ int __init register_intc_controller(struct intc_desc *desc)
- if (desc->force_enable)
- intc_enable_disable_enum(desc, d, desc->force_enable, 1);
-
-+ d->skip_suspend = desc->skip_syscore_suspend;
-+
- nr_intc_controllers++;
-
- return 0;
-@@ -386,6 +388,9 @@ static int intc_suspend(void)
- list_for_each_entry(d, &intc_list, list) {
- int irq;
-
-+ if (d->skip_suspend)
-+ continue;
-+
- /* enable wakeup irqs belonging to this intc controller */
- for_each_active_irq(irq) {
- struct irq_data *data;
-@@ -409,6 +414,9 @@ static void intc_resume(void)
- list_for_each_entry(d, &intc_list, list) {
- int irq;
-
-+ if (d->skip_suspend)
-+ continue;
-+
- for_each_active_irq(irq) {
- struct irq_data *data;
- struct irq_chip *chip;
-diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
-index 1c2722e..b0e9155 100644
---- a/drivers/sh/intc/internals.h
-+++ b/drivers/sh/intc/internals.h
-@@ -67,6 +67,7 @@ struct intc_desc_int {
- struct intc_window *window;
- unsigned int nr_windows;
- struct irq_chip chip;
-+ bool skip_suspend;
- };
-
-
-diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
-index 5812fef..b160645 100644
---- a/include/linux/sh_intc.h
-+++ b/include/linux/sh_intc.h
-@@ -95,6 +95,7 @@ struct intc_desc {
- unsigned int num_resources;
- intc_enum force_enable;
- intc_enum force_disable;
-+ bool skip_syscore_suspend;
- struct intc_hw_desc hw;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0033-sh-intc-unify-evt2irq-irq2evt-macros-for-sh-and-arm.patch b/patches.armadillo800eva/0033-sh-intc-unify-evt2irq-irq2evt-macros-for-sh-and-arm.patch
deleted file mode 100644
index dee5878f0e23a5..00000000000000
--- a/patches.armadillo800eva/0033-sh-intc-unify-evt2irq-irq2evt-macros-for-sh-and-arm.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From ebb93e3de0af2a5240e6e427ed43bd74d8220da3 Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Tue, 17 Jan 2012 11:20:23 -0600
-Subject: sh: intc: unify evt2irq/irq2evt macros for sh and arm
-
-Move evt2irq and irq2evt macros definitions out of sh and arm includes
-into a common location.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-(cherry picked from commit 7f1e76370b717be264f0af54719182a96fb8f36d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 4 ++++
- arch/arm/mach-shmobile/include/mach/irqs.h | 6 ++----
- arch/sh/include/asm/irq.h | 11 -----------
- include/linux/sh_intc.h | 11 +++++++++++
- 4 files changed, 17 insertions(+), 15 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 0c8f6cf..5dc5393 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -71,6 +71,10 @@ config MACH_MACKEREL
-
- comment "SH-Mobile System Configuration"
-
-+config CPU_HAS_INTEVT
-+ bool
-+ default y
-+
- menu "Memory configuration"
-
- config MEMORY_START
-diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
-index dcb714f..828807d 100644
---- a/arch/arm/mach-shmobile/include/mach/irqs.h
-+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
-@@ -1,15 +1,13 @@
- #ifndef __ASM_MACH_IRQS_H
- #define __ASM_MACH_IRQS_H
-
-+#include <linux/sh_intc.h>
-+
- #define NR_IRQS 1024
-
- /* GIC */
- #define gic_spi(nr) ((nr) + 32)
-
--/* INTCA */
--#define evt2irq(evt) (((evt) >> 5) - 16)
--#define irq2evt(irq) (((irq) + 16) << 5)
--
- /* INTCS */
- #define INTCS_VECT_BASE 0x2200
- #define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect))
-diff --git a/arch/sh/include/asm/irq.h b/arch/sh/include/asm/irq.h
-index 45d08b6..2a62017 100644
---- a/arch/sh/include/asm/irq.h
-+++ b/arch/sh/include/asm/irq.h
-@@ -21,17 +21,6 @@
- #define NO_IRQ_IGNORE ((unsigned int)-1)
-
- /*
-- * Convert back and forth between INTEVT and IRQ values.
-- */
--#ifdef CONFIG_CPU_HAS_INTEVT
--#define evt2irq(evt) (((evt) >> 5) - 16)
--#define irq2evt(irq) (((irq) + 16) << 5)
--#else
--#define evt2irq(evt) (evt)
--#define irq2evt(irq) (irq)
--#endif
--
--/*
- * Simple Mask Register Support
- */
- extern void make_maskreg_irq(unsigned int irq);
-diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
-index b160645..e1a2ac5 100644
---- a/include/linux/sh_intc.h
-+++ b/include/linux/sh_intc.h
-@@ -3,6 +3,17 @@
-
- #include <linux/ioport.h>
-
-+/*
-+ * Convert back and forth between INTEVT and IRQ values.
-+ */
-+#ifdef CONFIG_CPU_HAS_INTEVT
-+#define evt2irq(evt) (((evt) >> 5) - 16)
-+#define irq2evt(irq) (((irq) + 16) << 5)
-+#else
-+#define evt2irq(evt) (evt)
-+#define irq2evt(irq) (irq)
-+#endif
-+
- typedef unsigned char intc_enum;
-
- struct intc_vect {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0034-sh-intc-Make-global-intc-controller-counter-static.patch b/patches.armadillo800eva/0034-sh-intc-Make-global-intc-controller-counter-static.patch
deleted file mode 100644
index 73fdf1f06fe874..00000000000000
--- a/patches.armadillo800eva/0034-sh-intc-Make-global-intc-controller-counter-static.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 244c93c2981f90963867b50a8ab5abd6d2206c02 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 24 Jan 2012 14:07:18 +0900
-Subject: sh: intc: Make global intc controller counter static.
-
-No need to expose this globally since it's only used for core accounting.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 5fbebcbdb3730666c0d1d22021a90d8483fc8e02)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/core.c | 2 +-
- drivers/sh/intc/internals.h | 1 -
- 2 files changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index e53e449..c64690d 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -35,7 +35,7 @@
-
- LIST_HEAD(intc_list);
- DEFINE_RAW_SPINLOCK(intc_big_lock);
--unsigned int nr_intc_controllers;
-+static unsigned int nr_intc_controllers;
-
- /*
- * Default priority level
-diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
-index b0e9155..422b72d 100644
---- a/drivers/sh/intc/internals.h
-+++ b/drivers/sh/intc/internals.h
-@@ -157,7 +157,6 @@ void _intc_enable(struct irq_data *data, unsigned long handle);
- /* core.c */
- extern struct list_head intc_list;
- extern raw_spinlock_t intc_big_lock;
--extern unsigned int nr_intc_controllers;
- extern struct bus_type intc_subsys;
-
- unsigned int intc_get_dfl_prio_level(void);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0035-genirq-Add-IRQCHIP_SKIP_SET_WAKE-flag.patch b/patches.armadillo800eva/0035-genirq-Add-IRQCHIP_SKIP_SET_WAKE-flag.patch
deleted file mode 100644
index b2be35f6aeded5..00000000000000
--- a/patches.armadillo800eva/0035-genirq-Add-IRQCHIP_SKIP_SET_WAKE-flag.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 50a1e187e9f7fda82dcdcc323fc794b6c233cea2 Mon Sep 17 00:00:00 2001
-From: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Date: Fri, 9 Sep 2011 13:59:35 +0530
-Subject: genirq: Add IRQCHIP_SKIP_SET_WAKE flag
-
-Some irq chips need the irq_set_wake() functionality, but do not
-require a irq_set_wake() callback. Instead of forcing an empty
-callback to be implemented add a flag which notes this fact. Check for
-the flag in set_irq_wake_real() and return success when set.
-
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit 60f96b41f71d2a13d1c0a457b8b77958f77142d1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/irq.h | 2 ++
- kernel/irq/manage.c | 3 +++
- 2 files changed, 5 insertions(+)
-
-diff --git a/include/linux/irq.h b/include/linux/irq.h
-index baa397e..094c211 100644
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -334,12 +334,14 @@ struct irq_chip {
- * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
- * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks
- * when irq enabled
-+ * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
- */
- enum {
- IRQCHIP_SET_TYPE_MASKED = (1 << 0),
- IRQCHIP_EOI_IF_HANDLED = (1 << 1),
- IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
- IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
-+ IRQCHIP_SKIP_SET_WAKE = (1 << 4),
- };
-
- /* This include will go away once we isolated irq_desc usage to core code */
-diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
-index df8136f..bbc6a35 100644
---- a/kernel/irq/manage.c
-+++ b/kernel/irq/manage.c
-@@ -467,6 +467,9 @@ static int set_irq_wake_real(unsigned int irq, unsigned int on)
- struct irq_desc *desc = irq_to_desc(irq);
- int ret = -ENXIO;
-
-+ if (irq_desc_get_chip(desc)->flags & IRQCHIP_SKIP_SET_WAKE)
-+ return 0;
-+
- if (desc->irq_data.chip->irq_set_wake)
- ret = desc->irq_data.chip->irq_set_wake(&desc->irq_data, on);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0036-sh-intc-Prefer-IRQCHIP_SKIP_SET_WAKE-over-a-dummy-se.patch b/patches.armadillo800eva/0036-sh-intc-Prefer-IRQCHIP_SKIP_SET_WAKE-over-a-dummy-se.patch
deleted file mode 100644
index 95b94958c5fe36..00000000000000
--- a/patches.armadillo800eva/0036-sh-intc-Prefer-IRQCHIP_SKIP_SET_WAKE-over-a-dummy-se.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 75ffa33fd0ae04b4c8a3c7684934993ae1c9a4af Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 24 Jan 2012 14:54:10 +0900
-Subject: sh: intc: Prefer IRQCHIP_SKIP_SET_WAKE over a dummy set_wake
- callback.
-
-It's possible to use IRQCHIP_SKIP_SET_WAKE to get the behaviour that
-we're after, without having to bother with a dummy ->set_wake() callback
-for the IRQ chip.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 5bbda4e4aca4591c85ee53dea157ca5fc9a23306)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index 7b246ef..3679645 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -58,11 +58,6 @@ static void intc_disable(struct irq_data *data)
- }
- }
-
--static int intc_set_wake(struct irq_data *data, unsigned int on)
--{
-- return 0; /* allow wakeup, but setup hardware in intc_suspend() */
--}
--
- #ifdef CONFIG_SMP
- /*
- * This is held with the irq desc lock held, so we don't require any
-@@ -225,8 +220,8 @@ struct irq_chip intc_irq_chip = {
- .irq_disable = intc_disable,
- .irq_shutdown = intc_disable,
- .irq_set_type = intc_set_type,
-- .irq_set_wake = intc_set_wake,
- #ifdef CONFIG_SMP
- .irq_set_affinity = intc_set_affinity,
- #endif
-+ .flags = IRQCHIP_SKIP_SET_WAKE,
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0037-sh-intc-Kill-off-superfluous-irq_shutdown-hooking.patch b/patches.armadillo800eva/0037-sh-intc-Kill-off-superfluous-irq_shutdown-hooking.patch
deleted file mode 100644
index 65638e676efbdd..00000000000000
--- a/patches.armadillo800eva/0037-sh-intc-Kill-off-superfluous-irq_shutdown-hooking.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 2b12bb0269cb912d1a28d026e64d9f3d217529b3 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 24 Jan 2012 15:38:57 +0900
-Subject: sh: intc: Kill off superfluous irq_shutdown hooking.
-
-This already gets handled via disable, as per the notes in linux/irq.h.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 29775df10f02f614db870ff4acaf0b07dbed1547)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index 3679645..d90cb7e 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -218,7 +218,6 @@ struct irq_chip intc_irq_chip = {
- .irq_mask_ack = intc_mask_ack,
- .irq_enable = intc_enable,
- .irq_disable = intc_disable,
-- .irq_shutdown = intc_disable,
- .irq_set_type = intc_set_type,
- #ifdef CONFIG_SMP
- .irq_set_affinity = intc_set_affinity,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0038-sh-intc-Use-IRQ_SET_MASK_OK_NOCOPY-for-intc_set_affi.patch b/patches.armadillo800eva/0038-sh-intc-Use-IRQ_SET_MASK_OK_NOCOPY-for-intc_set_affi.patch
deleted file mode 100644
index 7a520be80c991b..00000000000000
--- a/patches.armadillo800eva/0038-sh-intc-Use-IRQ_SET_MASK_OK_NOCOPY-for-intc_set_affi.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From a0cf2545f99677aff9d787a55ed16cd6aca479ba Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 24 Jan 2012 16:55:57 +0900
-Subject: sh: intc: Use IRQ_SET_MASK_OK_NOCOPY for intc_set_affinity.
-
-intc_set_affinity() updates the cpumask in place, so there's no need for
-the upper layer to do this itself.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 30377642138aadeef35a31c2f90dba0b6fa7b91a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index d90cb7e..db10adf 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -73,7 +73,7 @@ static int intc_set_affinity(struct irq_data *data,
-
- cpumask_copy(data->affinity, cpumask);
-
-- return 0;
-+ return IRQ_SET_MASK_OK_NOCOPY;
- }
- #endif
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0039-sh-intc-optimize-intc-IRQ-lookup.patch b/patches.armadillo800eva/0039-sh-intc-optimize-intc-IRQ-lookup.patch
deleted file mode 100644
index 5679c638fc891e..00000000000000
--- a/patches.armadillo800eva/0039-sh-intc-optimize-intc-IRQ-lookup.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From 61a82ab6b88ee55c811cecf0868713c3387e3ca3 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 24 Jan 2012 17:41:55 +0900
-Subject: sh: intc: optimize intc IRQ lookup
-
-This ensures that the sense/prio lists are sorted at registration time,
-enabling us to use a simple binary search for an optimized lookup
-(something that had been on the TODO for some time).
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b59f9f9775e643435bba76e30e59e47c19c56dee)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/chip.c | 27 ++++++---------------------
- drivers/sh/intc/core.c | 9 ++++++++-
- drivers/sh/intc/internals.h | 8 ++++++++
- 3 files changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
-index db10adf..012df26 100644
---- a/drivers/sh/intc/chip.c
-+++ b/drivers/sh/intc/chip.c
-@@ -2,13 +2,14 @@
- * IRQ chip definitions for INTC IRQs.
- *
- * Copyright (C) 2007, 2008 Magnus Damm
-- * Copyright (C) 2009, 2010 Paul Mundt
-+ * Copyright (C) 2009 - 2012 Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
- #include <linux/cpumask.h>
-+#include <linux/bsearch.h>
- #include <linux/io.h>
- #include "internals.h"
-
-@@ -117,28 +118,12 @@ static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp,
- unsigned int nr_hp,
- unsigned int irq)
- {
-- int i;
--
-- /*
-- * this doesn't scale well, but...
-- *
-- * this function should only be used for cerain uncommon
-- * operations such as intc_set_priority() and intc_set_type()
-- * and in those rare cases performance doesn't matter that much.
-- * keeping the memory footprint low is more important.
-- *
-- * one rather simple way to speed this up and still keep the
-- * memory footprint down is to make sure the array is sorted
-- * and then perform a bisect to lookup the irq.
-- */
-- for (i = 0; i < nr_hp; i++) {
-- if ((hp + i)->irq != irq)
-- continue;
-+ struct intc_handle_int key;
-
-- return hp + i;
-- }
-+ key.irq = irq;
-+ key.handle = 0;
-
-- return NULL;
-+ return bsearch(&key, hp, nr_hp, sizeof(*hp), intc_handle_int_cmp);
- }
-
- int intc_set_priority(unsigned int irq, unsigned int prio)
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index c64690d..8e1fcd5 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -2,7 +2,7 @@
- * Shared interrupt handling code for IPR and INTC2 types of IRQs.
- *
- * Copyright (C) 2007, 2008 Magnus Damm
-- * Copyright (C) 2009, 2010 Paul Mundt
-+ * Copyright (C) 2009 - 2012 Paul Mundt
- *
- * Based on intc2.c and ipr.c
- *
-@@ -31,6 +31,7 @@
- #include <linux/spinlock.h>
- #include <linux/radix-tree.h>
- #include <linux/export.h>
-+#include <linux/sort.h>
- #include "internals.h"
-
- LIST_HEAD(intc_list);
-@@ -267,6 +268,9 @@ int __init register_intc_controller(struct intc_desc *desc)
- k += save_reg(d, k, hw->prio_regs[i].set_reg, smp);
- k += save_reg(d, k, hw->prio_regs[i].clr_reg, smp);
- }
-+
-+ sort(d->prio, hw->nr_prio_regs, sizeof(*d->prio),
-+ intc_handle_int_cmp, NULL);
- }
-
- if (hw->sense_regs) {
-@@ -277,6 +281,9 @@ int __init register_intc_controller(struct intc_desc *desc)
-
- for (i = 0; i < hw->nr_sense_regs; i++)
- k += save_reg(d, k, hw->sense_regs[i].reg, 0);
-+
-+ sort(d->sense, hw->nr_sense_regs, sizeof(*d->sense),
-+ intc_handle_int_cmp, NULL);
- }
-
- if (hw->subgroups)
-diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
-index 422b72d..f034a97 100644
---- a/drivers/sh/intc/internals.h
-+++ b/drivers/sh/intc/internals.h
-@@ -108,6 +108,14 @@ static inline void activate_irq(int irq)
- #endif
- }
-
-+static inline int intc_handle_int_cmp(const void *a, const void *b)
-+{
-+ const struct intc_handle_int *_a = a;
-+ const struct intc_handle_int *_b = b;
-+
-+ return _a->irq - _b->irq;
-+}
-+
- /* access.c */
- extern unsigned long
- (*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0040-sh-intc-remove-dependency-on-NR_IRQS.patch b/patches.armadillo800eva/0040-sh-intc-remove-dependency-on-NR_IRQS.patch
deleted file mode 100644
index 38872ef01485c0..00000000000000
--- a/patches.armadillo800eva/0040-sh-intc-remove-dependency-on-NR_IRQS.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From f6e4e54e9b72195a1a6e84e2e3a779db164c8f60 Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Tue, 17 Jan 2012 13:10:25 -0600
-Subject: sh: intc: remove dependency on NR_IRQS
-
-SH intc has a compile time dependency on NR_IRQS. Make this dependency a
-local define so that shmobile (and ARM in general) can have run-time
-NR_IRQS setting.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-(cherry picked from commit 0f55239348aa85021d8bf8b63d84a796fcc142a4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/balancing.c | 2 +-
- drivers/sh/intc/core.c | 2 +-
- drivers/sh/intc/handle.c | 2 +-
- drivers/sh/intc/virq.c | 2 +-
- include/linux/sh_intc.h | 6 ++++++
- 5 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/sh/intc/balancing.c b/drivers/sh/intc/balancing.c
-index cec7a96..bc78080 100644
---- a/drivers/sh/intc/balancing.c
-+++ b/drivers/sh/intc/balancing.c
-@@ -9,7 +9,7 @@
- */
- #include "internals.h"
-
--static unsigned long dist_handle[NR_IRQS];
-+static unsigned long dist_handle[INTC_NR_IRQS];
-
- void intc_balancing_enable(unsigned int irq)
- {
-diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
-index 8e1fcd5..7e562cc 100644
---- a/drivers/sh/intc/core.c
-+++ b/drivers/sh/intc/core.c
-@@ -43,7 +43,7 @@ static unsigned int nr_intc_controllers;
- * - this needs to be at least 2 for 5-bit priorities on 7780
- */
- static unsigned int default_prio_level = 2; /* 2 - 16 */
--static unsigned int intc_prio_level[NR_IRQS]; /* for now */
-+static unsigned int intc_prio_level[INTC_NR_IRQS]; /* for now */
-
- unsigned int intc_get_dfl_prio_level(void)
- {
-diff --git a/drivers/sh/intc/handle.c b/drivers/sh/intc/handle.c
-index 057ce56..f461d53 100644
---- a/drivers/sh/intc/handle.c
-+++ b/drivers/sh/intc/handle.c
-@@ -13,7 +13,7 @@
- #include <linux/spinlock.h>
- #include "internals.h"
-
--static unsigned long ack_handle[NR_IRQS];
-+static unsigned long ack_handle[INTC_NR_IRQS];
-
- static intc_enum __init intc_grp_id(struct intc_desc *desc,
- intc_enum enum_id)
-diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c
-index c7ec49f..93cec21 100644
---- a/drivers/sh/intc/virq.c
-+++ b/drivers/sh/intc/virq.c
-@@ -17,7 +17,7 @@
- #include <linux/export.h>
- #include "internals.h"
-
--static struct intc_map_entry intc_irq_xlate[NR_IRQS];
-+static struct intc_map_entry intc_irq_xlate[INTC_NR_IRQS];
-
- struct intc_virq_list {
- unsigned int irq;
-diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
-index e1a2ac5..6aed080 100644
---- a/include/linux/sh_intc.h
-+++ b/include/linux/sh_intc.h
-@@ -3,6 +3,12 @@
-
- #include <linux/ioport.h>
-
-+#ifdef CONFIG_SUPERH
-+#define INTC_NR_IRQS 512
-+#else
-+#define INTC_NR_IRQS 1024
-+#endif
-+
- /*
- * Convert back and forth between INTEVT and IRQ values.
- */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0041-sh-intc-Fix-up-section-mismatch-for-intc_ack_data.patch b/patches.armadillo800eva/0041-sh-intc-Fix-up-section-mismatch-for-intc_ack_data.patch
deleted file mode 100644
index 6623ab8a059219..00000000000000
--- a/patches.armadillo800eva/0041-sh-intc-Fix-up-section-mismatch-for-intc_ack_data.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c71a753d25dfdfde9288975e60f6390570bcdd2d Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 29 Mar 2012 00:28:19 +0900
-Subject: sh: intc: Fix up section mismatch for intc_ack_data
-
-intc_ack_data is flagged as __init when it shouldn't be, causing section
-mismatches in non-init paths like intc_set_ack_handle():
-
-WARNING: drivers/built-in.o(.text+0x5d760):
-Section mismatch in reference from the function
-intc_set_ack_handle() to the function .init.text:intc_ack_data()
-The function intc_set_ack_handle()
-references the function __init intc_ack_data().
-This is often because intc_set_ack_handle lacks a __init
-annotation or the annotation of intc_ack_data is wrong.
-
-Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b448d6adf733cc130339685531940f28902f2b75)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/intc/handle.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/sh/intc/handle.c b/drivers/sh/intc/handle.c
-index f461d53..7863a44 100644
---- a/drivers/sh/intc/handle.c
-+++ b/drivers/sh/intc/handle.c
-@@ -172,9 +172,8 @@ intc_get_prio_handle(struct intc_desc *desc, struct intc_desc_int *d,
- return 0;
- }
-
--static unsigned int __init intc_ack_data(struct intc_desc *desc,
-- struct intc_desc_int *d,
-- intc_enum enum_id)
-+static unsigned int intc_ack_data(struct intc_desc *desc,
-+ struct intc_desc_int *d, intc_enum enum_id)
- {
- struct intc_mask_reg *mr = desc->hw.ack_regs;
- unsigned int i, j, fn, mode;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0042-drivers-sh-late-disabling-of-clocks-V2.patch b/patches.armadillo800eva/0042-drivers-sh-late-disabling-of-clocks-V2.patch
deleted file mode 100644
index 0422cfe3656fcc..00000000000000
--- a/patches.armadillo800eva/0042-drivers-sh-late-disabling-of-clocks-V2.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From ac77c0529d45314d4fa2e56fc1607a228e0acedf Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 21 Jun 2011 07:55:12 +0000
-Subject: drivers: sh: late disabling of clocks V2
-
-This V2 patch changes the clock disabling behavior during boot.
-Two different changes are made:
-
-1) Delay disabling of clocks until late in the boot process.
- This fixes an existing issue where in-use clocks without
- software reference are disabled by mistake during boot.
- One example of this is the handling of the Mackerel serial
- console output that shares clock with the I2C controller.
-
-2) Write out the "disabled" state to the hardware for clocks
- that not have been used by the kernel. In other words,
- make sure so far unused clocks actually get turned off.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 794d78fea51504bad3880d14f354a9847f318f25)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/core.c | 27 ++++++++++++++++++++++++++-
- 1 file changed, 26 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index 7e9c399..ebeaa9e 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -34,6 +34,9 @@ static LIST_HEAD(clock_list);
- static DEFINE_SPINLOCK(clock_lock);
- static DEFINE_MUTEX(clock_list_sem);
-
-+/* clock disable operations are not passed on to hardware during boot */
-+static int allow_disable;
-+
- void clk_rate_table_build(struct clk *clk,
- struct cpufreq_frequency_table *freq_table,
- int nr_freqs,
-@@ -228,7 +231,7 @@ static void __clk_disable(struct clk *clk)
- return;
-
- if (!(--clk->usecount)) {
-- if (likely(clk->ops && clk->ops->disable))
-+ if (likely(allow_disable && clk->ops && clk->ops->disable))
- clk->ops->disable(clk);
- if (likely(clk->parent))
- __clk_disable(clk->parent);
-@@ -747,3 +750,25 @@ err_out:
- return err;
- }
- late_initcall(clk_debugfs_init);
-+
-+static int __init clk_late_init(void)
-+{
-+ unsigned long flags;
-+ struct clk *clk;
-+
-+ /* disable all clocks with zero use count */
-+ mutex_lock(&clock_list_sem);
-+ spin_lock_irqsave(&clock_lock, flags);
-+
-+ list_for_each_entry(clk, &clock_list, node)
-+ if (!clk->usecount && clk->ops && clk->ops->disable)
-+ clk->ops->disable(clk);
-+
-+ /* from now on allow clock disable operations */
-+ allow_disable = 1;
-+
-+ spin_unlock_irqrestore(&clock_lock, flags);
-+ mutex_unlock(&clock_list_sem);
-+ return 0;
-+}
-+late_initcall(clk_late_init);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0043-sh-clkfwk-Convert-to-IS_ERR_OR_NULL.patch b/patches.armadillo800eva/0043-sh-clkfwk-Convert-to-IS_ERR_OR_NULL.patch
deleted file mode 100644
index cb0f1cdb804a5d..00000000000000
--- a/patches.armadillo800eva/0043-sh-clkfwk-Convert-to-IS_ERR_OR_NULL.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d6aec47736b767c45be4c88daa8312fe8be7223b Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 24 Jun 2011 17:35:40 +0900
-Subject: sh: clkfwk: Convert to IS_ERR_OR_NULL.
-
-Trivial cleanup.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 225ca45c3c64964163ea1fa85e2081af85956eed)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/core.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index ebeaa9e..229ad09 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -396,7 +396,7 @@ int clk_register(struct clk *clk)
- {
- int ret;
-
-- if (clk == NULL || IS_ERR(clk))
-+ if (IS_ERR_OR_NULL(clk))
- return -EINVAL;
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0044-sh-move-CLKDEV_xxx_ID-macro-to-sh_clk.h.patch b/patches.armadillo800eva/0044-sh-move-CLKDEV_xxx_ID-macro-to-sh_clk.h.patch
deleted file mode 100644
index 166240ecab2144..00000000000000
--- a/patches.armadillo800eva/0044-sh-move-CLKDEV_xxx_ID-macro-to-sh_clk.h.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-From 8cb8f6ca3df19dffae930308e5ccc76ff11686f7 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 6 Jul 2011 02:54:11 +0000
-Subject: sh: move CLKDEV_xxx_ID macro to sh_clk.h
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 1522043bf73ef0e9e61dc512a0f3cdbec1cbf89f)
-
-Conflicts:
-
- arch/sh/kernel/cpu/sh4a/clock-sh7343.c
- arch/sh/kernel/cpu/sh4a/clock-sh7366.c
- arch/sh/kernel/cpu/sh4a/clock-sh7722.c
- arch/sh/kernel/cpu/sh4a/clock-sh7723.c
- arch/sh/kernel/cpu/sh4a/clock-sh7724.c
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c
- arch/sh/kernel/cpu/sh4a/clock-sh7785.c
- arch/sh/kernel/cpu/sh4a/clock-sh7786.c
- arch/sh/kernel/cpu/sh4a/clock-shx3.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh7367.c | 3 ---
- arch/arm/mach-shmobile/clock-sh7372.c | 4 ----
- arch/arm/mach-shmobile/clock-sh7377.c | 3 ---
- arch/arm/mach-shmobile/clock-sh73a0.c | 4 ----
- arch/sh/boards/mach-highlander/setup.c | 2 --
- arch/sh/kernel/cpu/clock-cpg.c | 2 --
- arch/sh/kernel/cpu/sh4/clock-sh4-202.c | 2 --
- arch/sh/kernel/cpu/sh4a/clock-sh7763.c | 2 --
- arch/sh/kernel/cpu/sh4a/clock-sh7780.c | 2 --
- include/linux/sh_clk.h | 4 ++++
- 10 files changed, 4 insertions(+), 24 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
-index 414a3e7..fb85a38 100644
---- a/arch/arm/mach-shmobile/clock-sh7367.c
-+++ b/arch/arm/mach-shmobile/clock-sh7367.c
-@@ -259,9 +259,6 @@ static struct clk mstp_clks[MSTP_NR] = {
- [CMMSTP003] = MSTP(&r_clk, CMMSTPCR0, 3, 0), /* KEYSC */
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("r_clk", &r_clk),
-diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
-index 24e0cac..84ba36f 100644
---- a/arch/arm/mach-shmobile/clock-sh7372.c
-+++ b/arch/arm/mach-shmobile/clock-sh7372.c
-@@ -561,10 +561,6 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
--#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk),
-diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c
-index b88ebd8..5f1e325 100644
---- a/arch/arm/mach-shmobile/clock-sh7377.c
-+++ b/arch/arm/mach-shmobile/clock-sh7377.c
-@@ -267,9 +267,6 @@ static struct clk mstp_clks[] = {
- [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("r_clk", &r_clk),
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 8d4b5db..c4bef73 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -306,10 +306,6 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
--#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("r_clk", &r_clk),
-diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
-index 87618c9..74b8db1 100644
---- a/arch/sh/boards/mach-highlander/setup.c
-+++ b/arch/sh/boards/mach-highlander/setup.c
-@@ -335,8 +335,6 @@ static struct clk *r7780rp_clocks[] = {
- &ivdr_clk,
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("ivdr_clk", &ivdr_clk),
-diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
-index 8f63a26..f59b1f3 100644
---- a/arch/sh/kernel/cpu/clock-cpg.c
-+++ b/arch/sh/kernel/cpu/clock-cpg.c
-@@ -35,8 +35,6 @@ static struct clk *onchip_clocks[] = {
- &cpu_clk,
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("master_clk", &master_clk),
-diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
-index 3f6f8e9..f4e262a 100644
---- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
-+++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
-@@ -147,8 +147,6 @@ static struct clk *sh4202_onchip_clocks[] = {
- &sh4202_shoc_clk,
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("emi_clk", &sh4202_emi_clk),
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
-index 599630f..2d4c7fd 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
-@@ -91,8 +91,6 @@ static struct clk *sh7763_onchip_clocks[] = {
- &sh7763_shyway_clk,
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("shyway_clk", &sh7763_shyway_clk),
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
-index 8894926..3b53348 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
-@@ -97,8 +97,6 @@ static struct clk *sh7780_onchip_clocks[] = {
- &sh7780_shyway_clk,
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("shyway_clk", &sh7780_shyway_clk),
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index 9a52f72..3ccf186 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
- int sh_clk_div6_register(struct clk *clks, int nr);
- int sh_clk_div6_reparent_register(struct clk *clks, int nr);
-
-+#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
-+#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
-+#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
-+
- #endif /* __SH_CLOCK_H */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0045-switch-assorted-clock-drivers-to-debugfs_remove_recu.patch b/patches.armadillo800eva/0045-switch-assorted-clock-drivers-to-debugfs_remove_recu.patch
deleted file mode 100644
index 81ae421a2a1f05..00000000000000
--- a/patches.armadillo800eva/0045-switch-assorted-clock-drivers-to-debugfs_remove_recu.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-From 8ecbe6b16788ab61bc6fccd8eac8985ccc3cee11 Mon Sep 17 00:00:00 2001
-From: Al Viro <viro@zeniv.linux.org.uk>
-Date: Sat, 16 Jul 2011 12:37:57 -0400
-Subject: switch assorted clock drivers to debugfs_remove_recursive()
-
-Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-(cherry picked from commit 12520c438f48113593130d210eba821a532c893b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-tegra/clock.c | 7 ++-----
- arch/arm/mach-ux500/clock.c | 20 +++-----------------
- arch/arm/plat-omap/clock.c | 6 ++----
- arch/arm/plat-samsung/clock.c | 7 ++-----
- arch/arm/plat-spear/clock.c | 7 ++-----
- drivers/sh/clk/core.c | 7 ++-----
- 6 files changed, 13 insertions(+), 41 deletions(-)
-
-diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
-index e028320..f8d41ff 100644
---- a/arch/arm/mach-tegra/clock.c
-+++ b/arch/arm/mach-tegra/clock.c
-@@ -585,7 +585,7 @@ static const struct file_operations possible_parents_fops = {
-
- static int clk_debugfs_register_one(struct clk *c)
- {
-- struct dentry *d, *child, *child_tmp;
-+ struct dentry *d;
-
- d = debugfs_create_dir(c->name, clk_debugfs_root);
- if (!d)
-@@ -614,10 +614,7 @@ static int clk_debugfs_register_one(struct clk *c)
- return 0;
-
- err_out:
-- d = c->dent;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(c->dent);
-+ debugfs_remove_recursive(c->dent);
- return -ENOMEM;
- }
-
-diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
-index 32ce908..1d8509d 100644
---- a/arch/arm/mach-ux500/clock.c
-+++ b/arch/arm/mach-ux500/clock.c
-@@ -635,7 +635,7 @@ static const struct file_operations set_rate_fops = {
- static struct dentry *clk_debugfs_register_dir(struct clk *c,
- struct dentry *p_dentry)
- {
-- struct dentry *d, *clk_d, *child, *child_tmp;
-+ struct dentry *d, *clk_d;
- char s[255];
- char *p = s;
-
-@@ -666,24 +666,10 @@ static struct dentry *clk_debugfs_register_dir(struct clk *c,
- return clk_d;
-
- err_out:
-- d = clk_d;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(clk_d);
-+ debugfs_remove_recursive(clk_d);
- return NULL;
- }
-
--static void clk_debugfs_remove_dir(struct dentry *cdentry)
--{
-- struct dentry *d, *child, *child_tmp;
--
-- d = cdentry;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(cdentry);
-- return ;
--}
--
- static int clk_debugfs_register_one(struct clk *c)
- {
- struct clk *pa = c->parent_periph;
-@@ -700,7 +686,7 @@ static int clk_debugfs_register_one(struct clk *c)
- c->dent_bus = clk_debugfs_register_dir(c,
- bpa->dent_bus ? bpa->dent_bus : bpa->dent);
- if ((!c->dent_bus) && (c->dent)) {
-- clk_debugfs_remove_dir(c->dent);
-+ debugfs_remove_recursive(c->dent);
- c->dent = NULL;
- return -ENOMEM;
- }
-diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
-index 4910bc0..b85f628 100644
---- a/arch/arm/plat-omap/clock.c
-+++ b/arch/arm/plat-omap/clock.c
-@@ -481,7 +481,7 @@ static struct dentry *clk_debugfs_root;
- static int clk_debugfs_register_one(struct clk *c)
- {
- int err;
-- struct dentry *d, *child, *child_tmp;
-+ struct dentry *d;
- struct clk *pa = c->parent;
- char s[255];
- char *p = s;
-@@ -511,9 +511,7 @@ static int clk_debugfs_register_one(struct clk *c)
-
- err_out:
- d = c->dent;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(c->dent);
-+ debugfs_remove_recursive(c->dent);
- return err;
- }
-
-diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
-index 7728928..0c9f95d 100644
---- a/arch/arm/plat-samsung/clock.c
-+++ b/arch/arm/plat-samsung/clock.c
-@@ -458,7 +458,7 @@ static struct dentry *clk_debugfs_root;
- static int clk_debugfs_register_one(struct clk *c)
- {
- int err;
-- struct dentry *d, *child, *child_tmp;
-+ struct dentry *d;
- struct clk *pa = c->parent;
- char s[255];
- char *p = s;
-@@ -488,10 +488,7 @@ static int clk_debugfs_register_one(struct clk *c)
- return 0;
-
- err_out:
-- d = c->dent;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(c->dent);
-+ debugfs_remove_recursive(c->dent);
- return err;
- }
-
-diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c
-index 6fa474c..67dd003 100644
---- a/arch/arm/plat-spear/clock.c
-+++ b/arch/arm/plat-spear/clock.c
-@@ -916,7 +916,7 @@ static struct dentry *clk_debugfs_root;
- static int clk_debugfs_register_one(struct clk *c)
- {
- int err;
-- struct dentry *d, *child;
-+ struct dentry *d;
- struct clk *pa = c->pclk;
- char s[255];
- char *p = s;
-@@ -951,10 +951,7 @@ static int clk_debugfs_register_one(struct clk *c)
- return 0;
-
- err_out:
-- d = c->dent;
-- list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(c->dent);
-+ debugfs_remove_recursive(c->dent);
- return err;
- }
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index 229ad09..dc8d022 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -673,7 +673,7 @@ static struct dentry *clk_debugfs_root;
- static int clk_debugfs_register_one(struct clk *c)
- {
- int err;
-- struct dentry *d, *child, *child_tmp;
-+ struct dentry *d;
- struct clk *pa = c->parent;
- char s[255];
- char *p = s;
-@@ -702,10 +702,7 @@ static int clk_debugfs_register_one(struct clk *c)
- return 0;
-
- err_out:
-- d = c->dentry;
-- list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
-- debugfs_remove(child);
-- debugfs_remove(c->dentry);
-+ debugfs_remove_recursive(c->dentry);
- return err;
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0046-sh-clkfwk-add-clk_rate_mult_range_round.patch b/patches.armadillo800eva/0046-sh-clkfwk-add-clk_rate_mult_range_round.patch
deleted file mode 100644
index 19c474bdcf4736..00000000000000
--- a/patches.armadillo800eva/0046-sh-clkfwk-add-clk_rate_mult_range_round.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 7464212984b7f9d2c2d3d08a0fa78b07cf2d2295 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 19 Sep 2011 18:51:13 -0700
-Subject: sh: clkfwk: add clk_rate_mult_range_round()
-
-This provides a clk_rate_mult_range_round() helper for use by some of the
-CPG PLL ranged multipliers, following the same approach as used by the
-div ranges.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit dd2c0ca1b153b555c09fd8e08f6842e12cf8e87b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/core.c | 20 ++++++++++++++++++++
- include/linux/sh_clk.h | 3 +++
- 2 files changed, 23 insertions(+)
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index dc8d022..352036b 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -173,6 +173,26 @@ long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
- return clk_rate_round_helper(&div_range_round);
- }
-
-+static long clk_rate_mult_range_iter(unsigned int pos,
-+ struct clk_rate_round_data *rounder)
-+{
-+ return clk_get_rate(rounder->arg) * pos;
-+}
-+
-+long clk_rate_mult_range_round(struct clk *clk, unsigned int mult_min,
-+ unsigned int mult_max, unsigned long rate)
-+{
-+ struct clk_rate_round_data mult_range_round = {
-+ .min = mult_min,
-+ .max = mult_max,
-+ .func = clk_rate_mult_range_iter,
-+ .arg = clk_get_parent(clk),
-+ .rate = rate,
-+ };
-+
-+ return clk_rate_round_helper(&mult_range_round);
-+}
-+
- int clk_rate_table_find(struct clk *clk,
- struct cpufreq_frequency_table *freq_table,
- unsigned long rate)
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index 3ccf186..9237c29 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -94,6 +94,9 @@ int clk_rate_table_find(struct clk *clk,
- long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
- unsigned int div_max, unsigned long rate);
-
-+long clk_rate_mult_range_round(struct clk *clk, unsigned int mult_min,
-+ unsigned int mult_max, unsigned long rate);
-+
- long clk_round_parent(struct clk *clk, unsigned long target,
- unsigned long *best_freq, unsigned long *parent_freq,
- unsigned int div_min, unsigned int div_max);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0047-sh-clkfwk-Kill-off-remaining-debugfs-cruft.patch b/patches.armadillo800eva/0047-sh-clkfwk-Kill-off-remaining-debugfs-cruft.patch
deleted file mode 100644
index 3fa80812ef5248..00000000000000
--- a/patches.armadillo800eva/0047-sh-clkfwk-Kill-off-remaining-debugfs-cruft.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From 5c5ed4b6eae9439a0dc51d26269cfcd99261b06d Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 11 Nov 2011 16:11:41 +0900
-Subject: sh: clkfwk: Kill off remaining debugfs cruft.
-
-Now that all of the named string association with clocks has been
-migrated to clkdev lookups there's no meaningful named topology that can
-be constructed for a debugfs tree view. Get rid of the left over bits,
-and shrink struct clk a bit in the process.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 79e7066415a8b12adbeacc41b3dc44423534b8be)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/core.c | 87 ------------------------------------------------
- include/linux/sh_clk.h | 1 -
- 2 files changed, 88 deletions(-)
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index 352036b..db257a3 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -25,7 +25,6 @@
- #include <linux/seq_file.h>
- #include <linux/err.h>
- #include <linux/io.h>
--#include <linux/debugfs.h>
- #include <linux/cpufreq.h>
- #include <linux/clk.h>
- #include <linux/sh_clk.h>
-@@ -225,9 +224,6 @@ int clk_reparent(struct clk *child, struct clk *parent)
- list_add(&child->sibling, &parent->children);
- child->parent = parent;
-
-- /* now do the debugfs renaming to reattach the child
-- to the proper parent */
--
- return 0;
- }
-
-@@ -685,89 +681,6 @@ static int __init clk_syscore_init(void)
- subsys_initcall(clk_syscore_init);
- #endif
-
--/*
-- * debugfs support to trace clock tree hierarchy and attributes
-- */
--static struct dentry *clk_debugfs_root;
--
--static int clk_debugfs_register_one(struct clk *c)
--{
-- int err;
-- struct dentry *d;
-- struct clk *pa = c->parent;
-- char s[255];
-- char *p = s;
--
-- p += sprintf(p, "%p", c);
-- d = debugfs_create_dir(s, pa ? pa->dentry : clk_debugfs_root);
-- if (!d)
-- return -ENOMEM;
-- c->dentry = d;
--
-- d = debugfs_create_u8("usecount", S_IRUGO, c->dentry, (u8 *)&c->usecount);
-- if (!d) {
-- err = -ENOMEM;
-- goto err_out;
-- }
-- d = debugfs_create_u32("rate", S_IRUGO, c->dentry, (u32 *)&c->rate);
-- if (!d) {
-- err = -ENOMEM;
-- goto err_out;
-- }
-- d = debugfs_create_x32("flags", S_IRUGO, c->dentry, (u32 *)&c->flags);
-- if (!d) {
-- err = -ENOMEM;
-- goto err_out;
-- }
-- return 0;
--
--err_out:
-- debugfs_remove_recursive(c->dentry);
-- return err;
--}
--
--static int clk_debugfs_register(struct clk *c)
--{
-- int err;
-- struct clk *pa = c->parent;
--
-- if (pa && !pa->dentry) {
-- err = clk_debugfs_register(pa);
-- if (err)
-- return err;
-- }
--
-- if (!c->dentry) {
-- err = clk_debugfs_register_one(c);
-- if (err)
-- return err;
-- }
-- return 0;
--}
--
--static int __init clk_debugfs_init(void)
--{
-- struct clk *c;
-- struct dentry *d;
-- int err;
--
-- d = debugfs_create_dir("clock", NULL);
-- if (!d)
-- return -ENOMEM;
-- clk_debugfs_root = d;
--
-- list_for_each_entry(c, &clock_list, node) {
-- err = clk_debugfs_register(c);
-- if (err)
-- goto err_out;
-- }
-- return 0;
--err_out:
-- debugfs_remove_recursive(clk_debugfs_root);
-- return err;
--}
--late_initcall(clk_debugfs_init);
--
- static int __init clk_late_init(void)
- {
- unsigned long flags;
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index 9237c29..a20831c 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -52,7 +52,6 @@ struct clk {
-
- unsigned long arch_flags;
- void *priv;
-- struct dentry *dentry;
- struct clk_mapping *mapping;
- struct cpufreq_frequency_table *freq_table;
- unsigned int nr_freqs;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0048-sh-clkfwk-setup-clock-parent-from-current-register-v.patch b/patches.armadillo800eva/0048-sh-clkfwk-setup-clock-parent-from-current-register-v.patch
deleted file mode 100644
index ca3a93b2e05cf2..00000000000000
--- a/patches.armadillo800eva/0048-sh-clkfwk-setup-clock-parent-from-current-register-v.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 98e40d27dae7c4cff546a17ce221677fcf629f77 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 21 Nov 2011 21:33:18 -0800
-Subject: sh: clkfwk: setup clock parent from current register value
-
-Some clocks can select its parent clock by CPG register.
-But it might have been modified by boot-loader or something.
-This patch removed fixed initial parent clock,
-and setup it from their current register settings.
-It works on div6 reparent clocks for now.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 56242a1fc595d158eddefbb4d6d76e82c2535f55)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh7372.c | 6 +++---
- arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 4 ++--
- drivers/sh/clk/cpg.c | 35 ++++++++++++++++++++++++++++++++
- include/linux/sh_clk.h | 9 +++++---
- 4 files changed, 46 insertions(+), 8 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
-index 84ba36f..e116a95 100644
---- a/arch/arm/mach-shmobile/clock-sh7372.c
-+++ b/arch/arm/mach-shmobile/clock-sh7372.c
-@@ -411,11 +411,11 @@ static struct clk *fsibckcr_parent[] = {
- };
-
- static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
-- [DIV6_HDMI] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, HDMICKCR, 0,
-+ [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0,
- hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2),
-- [DIV6_FSIA] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, FSIACKCR, 0,
-+ [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0,
- fsiackcr_parent, ARRAY_SIZE(fsiackcr_parent), 6, 2),
-- [DIV6_FSIB] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, FSIBCKCR, 0,
-+ [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0,
- fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2),
- };
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
-index d08fa95..3a4b76c 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
-@@ -189,9 +189,9 @@ static struct clk *fclkbcr_parent[] = {
- };
-
- static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
-- [DIV6_FA] = SH_CLK_DIV6_EXT(&div3_clk, FCLKACR, 0,
-+ [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0,
- fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2),
-- [DIV6_FB] = SH_CLK_DIV6_EXT(&div3_clk, FCLKBCR, 0,
-+ [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0,
- fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2),
- };
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index 82dd6fb..5e4301b 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -167,6 +167,38 @@ static struct clk_ops sh_clk_div6_reparent_clk_ops = {
- .set_parent = sh_clk_div6_set_parent,
- };
-
-+static int __init sh_clk_init_parent(struct clk *clk)
-+{
-+ u32 val;
-+
-+ if (clk->parent)
-+ return 0;
-+
-+ if (!clk->parent_table || !clk->parent_num)
-+ return 0;
-+
-+ if (!clk->src_width) {
-+ pr_err("sh_clk_init_parent: cannot select parent clock\n");
-+ return -EINVAL;
-+ }
-+
-+ val = (__raw_readl(clk->enable_reg) >> clk->src_shift);
-+ val &= (1 << clk->src_width) - 1;
-+
-+ if (val >= clk->parent_num) {
-+ pr_err("sh_clk_init_parent: parent table size failed\n");
-+ return -EINVAL;
-+ }
-+
-+ clk->parent = clk->parent_table[val];
-+ if (!clk->parent) {
-+ pr_err("sh_clk_init_parent: unable to set parent");
-+ return -EINVAL;
-+ }
-+
-+ return 0;
-+}
-+
- static int __init sh_clk_div6_register_ops(struct clk *clks, int nr,
- struct clk_ops *ops)
- {
-@@ -190,6 +222,9 @@ static int __init sh_clk_div6_register_ops(struct clk *clks, int nr,
- clkp->ops = ops;
- clkp->freq_table = freq_table + (k * freq_table_size);
- clkp->freq_table[nr_divs].frequency = CPUFREQ_TABLE_END;
-+ ret = sh_clk_init_parent(clkp);
-+ if (ret < 0)
-+ break;
-
- ret = clk_register(clkp);
- }
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index a20831c..e834304 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -131,10 +131,9 @@ int sh_clk_div4_enable_register(struct clk *clks, int nr,
- int sh_clk_div4_reparent_register(struct clk *clks, int nr,
- struct clk_div4_table *table);
-
--#define SH_CLK_DIV6_EXT(_parent, _reg, _flags, _parents, \
-+#define SH_CLK_DIV6_EXT(_reg, _flags, _parents, \
- _num_parents, _src_shift, _src_width) \
- { \
-- .parent = _parent, \
- .enable_reg = (void __iomem *)_reg, \
- .flags = _flags, \
- .parent_table = _parents, \
-@@ -144,7 +143,11 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
- }
-
- #define SH_CLK_DIV6(_parent, _reg, _flags) \
-- SH_CLK_DIV6_EXT(_parent, _reg, _flags, NULL, 0, 0, 0)
-+{ \
-+ .parent = _parent, \
-+ .enable_reg = (void __iomem *)_reg, \
-+ .flags = _flags, \
-+}
-
- int sh_clk_div6_register(struct clk *clks, int nr);
- int sh_clk_div6_reparent_register(struct clk *clks, int nr);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0049-sh-extend-clock-struct-with-mapped_reg-member.patch b/patches.armadillo800eva/0049-sh-extend-clock-struct-with-mapped_reg-member.patch
deleted file mode 100644
index a360d3d3fbc55d..00000000000000
--- a/patches.armadillo800eva/0049-sh-extend-clock-struct-with-mapped_reg-member.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 4e6b2a45eda3e4eb6f569d0dd46589b62f29ff5b Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 8 Dec 2011 22:58:54 +0900
-Subject: sh: extend clock struct with mapped_reg member
-
-Add a "mapped_reg" member to struct clk and use that
-to keep the ioremapped register based on enable_reg.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit eda2030a5b60bb818f062adacbcfb6fd2d366fb9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/core.c | 9 +++++++--
- include/linux/sh_clk.h | 1 +
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
-index db257a3..7715de2 100644
---- a/drivers/sh/clk/core.c
-+++ b/drivers/sh/clk/core.c
-@@ -355,7 +355,7 @@ static int clk_establish_mapping(struct clk *clk)
- */
- if (!clk->parent) {
- clk->mapping = &dummy_mapping;
-- return 0;
-+ goto out;
- }
-
- /*
-@@ -384,6 +384,9 @@ static int clk_establish_mapping(struct clk *clk)
- }
-
- clk->mapping = mapping;
-+out:
-+ clk->mapped_reg = clk->mapping->base;
-+ clk->mapped_reg += (phys_addr_t)clk->enable_reg - clk->mapping->phys;
- return 0;
- }
-
-@@ -402,10 +405,12 @@ static void clk_teardown_mapping(struct clk *clk)
-
- /* Nothing to do */
- if (mapping == &dummy_mapping)
-- return;
-+ goto out;
-
- kref_put(&mapping->ref, clk_destroy_mapping);
- clk->mapping = NULL;
-+out:
-+ clk->mapped_reg = NULL;
- }
-
- int clk_register(struct clk *clk)
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index e834304..54341d8 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -49,6 +49,7 @@ struct clk {
-
- void __iomem *enable_reg;
- unsigned int enable_bit;
-+ void __iomem *mapped_reg;
-
- unsigned long arch_flags;
- void *priv;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0050-sh-use-ioread32-iowrite32-and-mapped_reg-for-mstp32.patch b/patches.armadillo800eva/0050-sh-use-ioread32-iowrite32-and-mapped_reg-for-mstp32.patch
deleted file mode 100644
index 3f8bb6df4e6cfa..00000000000000
--- a/patches.armadillo800eva/0050-sh-use-ioread32-iowrite32-and-mapped_reg-for-mstp32.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From ac1c87d981dc955e1fc47efb6e1ef9e721478c6d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 8 Dec 2011 22:59:03 +0900
-Subject: sh: use ioread32/iowrite32 and mapped_reg for mstp32
-
-Convert the CPG MSTP32 helper code to use the new mapped_reg
-together with ioread32() and iowrite32().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b3ab82b3eb191ad2cd8110cb5de0afb790337000)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index 5e4301b..ed8bc70 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -15,15 +15,15 @@
-
- static int sh_clk_mstp32_enable(struct clk *clk)
- {
-- __raw_writel(__raw_readl(clk->enable_reg) & ~(1 << clk->enable_bit),
-- clk->enable_reg);
-+ iowrite32(ioread32(clk->mapped_reg) & ~(1 << clk->enable_bit),
-+ clk->mapped_reg);
- return 0;
- }
-
- static void sh_clk_mstp32_disable(struct clk *clk)
- {
-- __raw_writel(__raw_readl(clk->enable_reg) | (1 << clk->enable_bit),
-- clk->enable_reg);
-+ iowrite32(ioread32(clk->mapped_reg) | (1 << clk->enable_bit),
-+ clk->mapped_reg);
- }
-
- static struct clk_ops sh_clk_mstp32_clk_ops = {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0051-sh-use-ioread32-iowrite32-and-mapped_reg-for-div4.patch b/patches.armadillo800eva/0051-sh-use-ioread32-iowrite32-and-mapped_reg-for-div4.patch
deleted file mode 100644
index 8ea658640c997a..00000000000000
--- a/patches.armadillo800eva/0051-sh-use-ioread32-iowrite32-and-mapped_reg-for-div4.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From a6c833e8b5ddaab4228fe180e6ef9903b58b1868 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 8 Dec 2011 22:59:13 +0900
-Subject: sh: use ioread32/iowrite32 and mapped_reg for div4
-
-Convert the CPG DIV4 helper code to use the new mapped_reg
-together with ioread32() and iowrite32().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 0e027376f896e5dda293ffc8e6e7332d26d2ffc4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index ed8bc70..e4a2edf 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -252,7 +252,7 @@ static unsigned long sh_clk_div4_recalc(struct clk *clk)
- clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
- table, &clk->arch_flags);
-
-- idx = (__raw_readl(clk->enable_reg) >> clk->enable_bit) & 0x000f;
-+ idx = (ioread32(clk->mapped_reg) >> clk->enable_bit) & 0x000f;
-
- return clk->freq_table[idx].frequency;
- }
-@@ -270,15 +270,15 @@ static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
- */
-
- if (parent->flags & CLK_ENABLE_ON_INIT)
-- value = __raw_readl(clk->enable_reg) & ~(1 << 7);
-+ value = ioread32(clk->mapped_reg) & ~(1 << 7);
- else
-- value = __raw_readl(clk->enable_reg) | (1 << 7);
-+ value = ioread32(clk->mapped_reg) | (1 << 7);
-
- ret = clk_reparent(clk, parent);
- if (ret < 0)
- return ret;
-
-- __raw_writel(value, clk->enable_reg);
-+ iowrite32(value, clk->mapped_reg);
-
- /* Rebiuld the frequency table */
- clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
-@@ -295,10 +295,10 @@ static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate)
- if (idx < 0)
- return idx;
-
-- value = __raw_readl(clk->enable_reg);
-+ value = ioread32(clk->mapped_reg);
- value &= ~(0xf << clk->enable_bit);
- value |= (idx << clk->enable_bit);
-- __raw_writel(value, clk->enable_reg);
-+ iowrite32(value, clk->mapped_reg);
-
- if (d4t->kick)
- d4t->kick(clk);
-@@ -308,13 +308,13 @@ static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate)
-
- static int sh_clk_div4_enable(struct clk *clk)
- {
-- __raw_writel(__raw_readl(clk->enable_reg) & ~(1 << 8), clk->enable_reg);
-+ iowrite32(ioread32(clk->mapped_reg) & ~(1 << 8), clk->mapped_reg);
- return 0;
- }
-
- static void sh_clk_div4_disable(struct clk *clk)
- {
-- __raw_writel(__raw_readl(clk->enable_reg) | (1 << 8), clk->enable_reg);
-+ iowrite32(ioread32(clk->mapped_reg) | (1 << 8), clk->mapped_reg);
- }
-
- static struct clk_ops sh_clk_div4_clk_ops = {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0052-sh-use-ioread32-iowrite32-and-mapped_reg-for-div6.patch b/patches.armadillo800eva/0052-sh-use-ioread32-iowrite32-and-mapped_reg-for-div6.patch
deleted file mode 100644
index 6cd546440e8c2f..00000000000000
--- a/patches.armadillo800eva/0052-sh-use-ioread32-iowrite32-and-mapped_reg-for-div6.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 23a236a9fb89e2c59949843d44388d483d598558 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 8 Dec 2011 22:59:22 +0900
-Subject: sh: use ioread32/iowrite32 and mapped_reg for div6
-
-Convert the CPG DIV6 helper code to use the new mapped_reg
-together with ioread32() and iowrite32().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 2dacb97d9269e303ed761937a0e9db8711515e08)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index e4a2edf..a0d8faa 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -72,7 +72,7 @@ static unsigned long sh_clk_div6_recalc(struct clk *clk)
- clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
- table, NULL);
-
-- idx = __raw_readl(clk->enable_reg) & 0x003f;
-+ idx = ioread32(clk->mapped_reg) & 0x003f;
-
- return clk->freq_table[idx].frequency;
- }
-@@ -98,10 +98,10 @@ static int sh_clk_div6_set_parent(struct clk *clk, struct clk *parent)
- if (ret < 0)
- return ret;
-
-- value = __raw_readl(clk->enable_reg) &
-+ value = ioread32(clk->mapped_reg) &
- ~(((1 << clk->src_width) - 1) << clk->src_shift);
-
-- __raw_writel(value | (i << clk->src_shift), clk->enable_reg);
-+ iowrite32(value | (i << clk->src_shift), clk->mapped_reg);
-
- /* Rebuild the frequency table */
- clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
-@@ -119,10 +119,10 @@ static int sh_clk_div6_set_rate(struct clk *clk, unsigned long rate)
- if (idx < 0)
- return idx;
-
-- value = __raw_readl(clk->enable_reg);
-+ value = ioread32(clk->mapped_reg);
- value &= ~0x3f;
- value |= idx;
-- __raw_writel(value, clk->enable_reg);
-+ iowrite32(value, clk->mapped_reg);
- return 0;
- }
-
-@@ -133,9 +133,9 @@ static int sh_clk_div6_enable(struct clk *clk)
-
- ret = sh_clk_div6_set_rate(clk, clk->rate);
- if (ret == 0) {
-- value = __raw_readl(clk->enable_reg);
-+ value = ioread32(clk->mapped_reg);
- value &= ~0x100; /* clear stop bit to enable clock */
-- __raw_writel(value, clk->enable_reg);
-+ iowrite32(value, clk->mapped_reg);
- }
- return ret;
- }
-@@ -144,10 +144,10 @@ static void sh_clk_div6_disable(struct clk *clk)
- {
- unsigned long value;
-
-- value = __raw_readl(clk->enable_reg);
-+ value = ioread32(clk->mapped_reg);
- value |= 0x100; /* stop clock */
- value |= 0x3f; /* VDIV bits must be non-zero, overwrite divider */
-- __raw_writel(value, clk->enable_reg);
-+ iowrite32(value, clk->mapped_reg);
- }
-
- static struct clk_ops sh_clk_div6_clk_ops = {
-@@ -182,7 +182,7 @@ static int __init sh_clk_init_parent(struct clk *clk)
- return -EINVAL;
- }
-
-- val = (__raw_readl(clk->enable_reg) >> clk->src_shift);
-+ val = (ioread32(clk->mapped_reg) >> clk->src_shift);
- val &= (1 << clk->src_width) - 1;
-
- if (val >= clk->parent_num) {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0053-sh-clkfwk-sh_clk_init_parent-should-be-called-after-.patch b/patches.armadillo800eva/0053-sh-clkfwk-sh_clk_init_parent-should-be-called-after-.patch
deleted file mode 100644
index 78eef5fe26e74e..00000000000000
--- a/patches.armadillo800eva/0053-sh-clkfwk-sh_clk_init_parent-should-be-called-after-.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 5e231164bb186fd4b9630626ebeaed78da2e2f4a Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 11 Dec 2011 19:02:09 -0800
-Subject: sh: clkfwk: sh_clk_init_parent() should be called after
- clk_register()
-
-sh_clk_init_parent() are using clk->mapped_reg
-which is mapped in clk_register()
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 7784f4da1a1b8b2519e008551fc4f69713451f89)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index a0d8faa..45fee36 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -222,11 +222,11 @@ static int __init sh_clk_div6_register_ops(struct clk *clks, int nr,
- clkp->ops = ops;
- clkp->freq_table = freq_table + (k * freq_table_size);
- clkp->freq_table[nr_divs].frequency = CPUFREQ_TABLE_END;
-- ret = sh_clk_init_parent(clkp);
-+ ret = clk_register(clkp);
- if (ret < 0)
- break;
-
-- ret = clk_register(clkp);
-+ ret = sh_clk_init_parent(clkp);
- }
-
- return ret;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0054-sh-clkfwk-bugfix-use-clk_reparent-for-div6-clocks.patch b/patches.armadillo800eva/0054-sh-clkfwk-bugfix-use-clk_reparent-for-div6-clocks.patch
deleted file mode 100644
index 7e90e62696681e..00000000000000
--- a/patches.armadillo800eva/0054-sh-clkfwk-bugfix-use-clk_reparent-for-div6-clocks.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7f39fac87a1c14c1d6b6321423f9d10157a3132a Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 19 Jan 2012 01:00:40 -0800
-Subject: sh: clkfwk: bugfix: use clk_reparent() for div6 clocks
-
-Various problems will happen if clk parent was set up directly.
-it should use clk_reparent()
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 64dea57588f49736c2a7778292f3967c7984ab94)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index 45fee36..92d314a 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -190,7 +190,7 @@ static int __init sh_clk_init_parent(struct clk *clk)
- return -EINVAL;
- }
-
-- clk->parent = clk->parent_table[val];
-+ clk_reparent(clk, clk->parent_table[val]);
- if (!clk->parent) {
- pr_err("sh_clk_init_parent: unable to set parent");
- return -EINVAL;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0055-sh-introduce-sh_clk_ops-in-parallel-with-clk_ops.patch b/patches.armadillo800eva/0055-sh-introduce-sh_clk_ops-in-parallel-with-clk_ops.patch
deleted file mode 100644
index 0e42b025d39091..00000000000000
--- a/patches.armadillo800eva/0055-sh-introduce-sh_clk_ops-in-parallel-with-clk_ops.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 195e6b5d4719d699278545f9127975f41b7ce8e9 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 22:16:13 +0900
-Subject: sh: introduce sh_clk_ops in parallel with clk_ops
-
-Introduce sh_clk_ops in parallel with clk_ops.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e34828298ec542294f4b798606ee73e462d322f5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/sh_clk.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
-index 54341d8..706c005 100644
---- a/include/linux/sh_clk.h
-+++ b/include/linux/sh_clk.h
-@@ -18,6 +18,8 @@ struct clk_mapping {
- struct kref ref;
- };
-
-+#define sh_clk_ops clk_ops
-+
- struct clk_ops {
- #ifdef CONFIG_SH_CLK_CPG_LEGACY
- void (*init)(struct clk *clk);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0056-sh-convert-cpg-code-to-sh_clk_ops.patch b/patches.armadillo800eva/0056-sh-convert-cpg-code-to-sh_clk_ops.patch
deleted file mode 100644
index eee6997aba00c2..00000000000000
--- a/patches.armadillo800eva/0056-sh-convert-cpg-code-to-sh_clk_ops.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From d26f5a57a1cd5703436d60947b543038e5c71677 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 22:16:21 +0900
-Subject: sh: convert cpg code to sh_clk_ops
-
-Convert the CPG code to use sh_clk_ops.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a0ec360f6b83146fa4ba1a681bdd751382f9f90e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/clk/cpg.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
-index 92d314a..91b6d52 100644
---- a/drivers/sh/clk/cpg.c
-+++ b/drivers/sh/clk/cpg.c
-@@ -26,7 +26,7 @@ static void sh_clk_mstp32_disable(struct clk *clk)
- clk->mapped_reg);
- }
-
--static struct clk_ops sh_clk_mstp32_clk_ops = {
-+static struct sh_clk_ops sh_clk_mstp32_clk_ops = {
- .enable = sh_clk_mstp32_enable,
- .disable = sh_clk_mstp32_disable,
- .recalc = followparent_recalc,
-@@ -150,7 +150,7 @@ static void sh_clk_div6_disable(struct clk *clk)
- iowrite32(value, clk->mapped_reg);
- }
-
--static struct clk_ops sh_clk_div6_clk_ops = {
-+static struct sh_clk_ops sh_clk_div6_clk_ops = {
- .recalc = sh_clk_div6_recalc,
- .round_rate = sh_clk_div_round_rate,
- .set_rate = sh_clk_div6_set_rate,
-@@ -158,7 +158,7 @@ static struct clk_ops sh_clk_div6_clk_ops = {
- .disable = sh_clk_div6_disable,
- };
-
--static struct clk_ops sh_clk_div6_reparent_clk_ops = {
-+static struct sh_clk_ops sh_clk_div6_reparent_clk_ops = {
- .recalc = sh_clk_div6_recalc,
- .round_rate = sh_clk_div_round_rate,
- .set_rate = sh_clk_div6_set_rate,
-@@ -200,7 +200,7 @@ static int __init sh_clk_init_parent(struct clk *clk)
- }
-
- static int __init sh_clk_div6_register_ops(struct clk *clks, int nr,
-- struct clk_ops *ops)
-+ struct sh_clk_ops *ops)
- {
- struct clk *clkp;
- void *freq_table;
-@@ -317,13 +317,13 @@ static void sh_clk_div4_disable(struct clk *clk)
- iowrite32(ioread32(clk->mapped_reg) | (1 << 8), clk->mapped_reg);
- }
-
--static struct clk_ops sh_clk_div4_clk_ops = {
-+static struct sh_clk_ops sh_clk_div4_clk_ops = {
- .recalc = sh_clk_div4_recalc,
- .set_rate = sh_clk_div4_set_rate,
- .round_rate = sh_clk_div_round_rate,
- };
-
--static struct clk_ops sh_clk_div4_enable_clk_ops = {
-+static struct sh_clk_ops sh_clk_div4_enable_clk_ops = {
- .recalc = sh_clk_div4_recalc,
- .set_rate = sh_clk_div4_set_rate,
- .round_rate = sh_clk_div_round_rate,
-@@ -331,7 +331,7 @@ static struct clk_ops sh_clk_div4_enable_clk_ops = {
- .disable = sh_clk_div4_disable,
- };
-
--static struct clk_ops sh_clk_div4_reparent_clk_ops = {
-+static struct sh_clk_ops sh_clk_div4_reparent_clk_ops = {
- .recalc = sh_clk_div4_recalc,
- .set_rate = sh_clk_div4_set_rate,
- .round_rate = sh_clk_div_round_rate,
-@@ -341,7 +341,7 @@ static struct clk_ops sh_clk_div4_reparent_clk_ops = {
- };
-
- static int __init sh_clk_div4_register_ops(struct clk *clks, int nr,
-- struct clk_div4_table *table, struct clk_ops *ops)
-+ struct clk_div4_table *table, struct sh_clk_ops *ops)
- {
- struct clk *clkp;
- void *freq_table;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0057-ARM-mach-shmobile-R-Mobile-A1-support.patch b/patches.armadillo800eva/0057-ARM-mach-shmobile-R-Mobile-A1-support.patch
deleted file mode 100644
index d767cf01177a60..00000000000000
--- a/patches.armadillo800eva/0057-ARM-mach-shmobile-R-Mobile-A1-support.patch
+++ /dev/null
@@ -1,1378 +0,0 @@
-From daca17b2fcb739100c4d73867f3142238a7b1f29 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:45:52 -0800
-Subject: ARM: mach-shmobile: R-Mobile A1 support.
-
-This adds preliminary support for the R8A7740 (R-Mobile A1) CPU
-
-Timer, serial, gic, clock are supported at this point.
-This patch is based on v0.1 manual
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 6c01ba445cecb2d8085cf0b5a6ddfb170ad22616)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 7 +
- arch/arm/mach-shmobile/Makefile | 2 +
- arch/arm/mach-shmobile/clock-r8a7740.c | 378 ++++++++++++++++
- arch/arm/mach-shmobile/include/mach/common.h | 6 +
- arch/arm/mach-shmobile/include/mach/r8a7740.h | 584 +++++++++++++++++++++++++
- arch/arm/mach-shmobile/intc-r8a7740.c | 45 ++
- arch/arm/mach-shmobile/setup-r8a7740.c | 246 +++++++++++
- drivers/tty/serial/sh-sci.h | 4 +-
- 8 files changed, 1271 insertions(+), 1 deletion(-)
- create mode 100644 arch/arm/mach-shmobile/clock-r8a7740.c
- create mode 100644 arch/arm/mach-shmobile/include/mach/r8a7740.h
- create mode 100644 arch/arm/mach-shmobile/intc-r8a7740.c
- create mode 100644 arch/arm/mach-shmobile/setup-r8a7740.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 5dc5393..2ce88de 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -27,6 +27,13 @@ config ARCH_SH73A0
- select ARCH_WANT_OPTIONAL_GPIOLIB
- select ARM_GIC
-
-+config ARCH_R8A7740
-+ bool "R-Mobile A1 (R8A77400)"
-+ select CPU_V7
-+ select SH_CLK_CPG
-+ select ARCH_WANT_OPTIONAL_GPIOLIB
-+ select ARM_GIC
-+
- comment "SH-Mobile Board Type"
-
- config MACH_G3EVM
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index 612b270..fdbae05 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -10,6 +10,7 @@ obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
- obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o
- obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
- obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
-+obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
-
- # SMP objects
- smp-y := platsmp.o headsmp.o
-@@ -29,6 +30,7 @@ obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
- obj-$(CONFIG_ARCH_SH7377) += entry-intc.o
- obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
- obj-$(CONFIG_ARCH_SH73A0) += entry-gic.o
-+obj-$(CONFIG_ARCH_R8A7740) += entry-gic.o
-
- # PM objects
- obj-$(CONFIG_SUSPEND) += suspend.o
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-new file mode 100644
-index 0000000..5bb02f2
---- /dev/null
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -0,0 +1,378 @@
-+/*
-+ * R8A7740 processor support
-+ *
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+#include <linux/sh_clk.h>
-+#include <linux/clkdev.h>
-+#include <mach/common.h>
-+#include <mach/r8a7740.h>
-+
-+/*
-+ * | MDx | XTAL1/EXTAL1 | System | EXTALR |
-+ * Clock |-------+-----------------+ clock | 32.768 | RCLK
-+ * Mode | 2/1/0 | src MHz | source | KHz | source
-+ * -------+-------+-----------------+-----------+--------+----------
-+ * 0 | 0 0 0 | External 20~50 | XTAL1 | O | EXTALR
-+ * 1 | 0 0 1 | Crystal 20~30 | XTAL1 | O | EXTALR
-+ * 2 | 0 1 0 | External 40~50 | XTAL1 / 2 | O | EXTALR
-+ * 3 | 0 1 1 | Crystal 40~50 | XTAL1 / 2 | O | EXTALR
-+ * 4 | 1 0 0 | External 20~50 | XTAL1 | x | XTAL1 / 1024
-+ * 5 | 1 0 1 | Crystal 20~30 | XTAL1 | x | XTAL1 / 1024
-+ * 6 | 1 1 0 | External 40~50 | XTAL1 / 2 | x | XTAL1 / 2048
-+ * 7 | 1 1 1 | Crystal 40~50 | XTAL1 / 2 | x | XTAL1 / 2048
-+ */
-+
-+/* CPG registers */
-+#define FRQCRA 0xe6150000
-+#define FRQCRB 0xe6150004
-+#define FRQCRC 0xe61500e0
-+#define PLLC01CR 0xe6150028
-+
-+#define SUBCKCR 0xe6150080
-+
-+#define MSTPSR0 0xe6150030
-+#define MSTPSR1 0xe6150038
-+#define MSTPSR2 0xe6150040
-+#define MSTPSR3 0xe6150048
-+#define MSTPSR4 0xe615004c
-+#define SMSTPCR0 0xe6150130
-+#define SMSTPCR1 0xe6150134
-+#define SMSTPCR2 0xe6150138
-+#define SMSTPCR3 0xe615013c
-+#define SMSTPCR4 0xe6150140
-+
-+/* Fixed 32 KHz root clock from EXTALR pin */
-+static struct clk extalr_clk = {
-+ .rate = 32768,
-+};
-+
-+/*
-+ * 25MHz default rate for the EXTAL1 root input clock.
-+ * If needed, reset this with clk_set_rate() from the platform code.
-+ */
-+static struct clk extal1_clk = {
-+ .rate = 25000000,
-+};
-+
-+/*
-+ * 48MHz default rate for the EXTAL2 root input clock.
-+ * If needed, reset this with clk_set_rate() from the platform code.
-+ */
-+static struct clk extal2_clk = {
-+ .rate = 48000000,
-+};
-+
-+/*
-+ * 27MHz default rate for the DV_CLKI root input clock.
-+ * If needed, reset this with clk_set_rate() from the platform code.
-+ */
-+static struct clk dv_clk = {
-+ .rate = 27000000,
-+};
-+
-+static unsigned long div_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate / (int)(clk->priv);
-+}
-+
-+static struct clk_ops div_clk_ops = {
-+ .recalc = div_recalc,
-+};
-+
-+/* extal1 / 2 */
-+static struct clk extal1_div2_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)2,
-+ .parent = &extal1_clk,
-+};
-+
-+/* extal1 / 1024 */
-+static struct clk extal1_div1024_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)1024,
-+ .parent = &extal1_clk,
-+};
-+
-+/* extal1 / 2 / 1024 */
-+static struct clk extal1_div2048_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)1024,
-+ .parent = &extal1_div2_clk,
-+};
-+
-+/* extal2 / 2 */
-+static struct clk extal2_div2_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)2,
-+ .parent = &extal2_clk,
-+};
-+
-+static struct clk_ops followparent_clk_ops = {
-+ .recalc = followparent_recalc,
-+};
-+
-+/* Main clock */
-+static struct clk system_clk = {
-+ .ops = &followparent_clk_ops,
-+};
-+
-+static struct clk system_div2_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)2,
-+ .parent = &system_clk,
-+};
-+
-+/* r_clk */
-+static struct clk r_clk = {
-+ .ops = &followparent_clk_ops,
-+};
-+
-+/* PLLC0/PLLC1 */
-+static unsigned long pllc01_recalc(struct clk *clk)
-+{
-+ unsigned long mult = 1;
-+
-+ if (__raw_readl(PLLC01CR) & (1 << 14))
-+ mult = ((__raw_readl(clk->enable_reg) >> 24) & 0x7f) + 1;
-+
-+ return clk->parent->rate * mult;
-+}
-+
-+static struct clk_ops pllc01_clk_ops = {
-+ .recalc = pllc01_recalc,
-+};
-+
-+static struct clk pllc0_clk = {
-+ .ops = &pllc01_clk_ops,
-+ .flags = CLK_ENABLE_ON_INIT,
-+ .parent = &system_clk,
-+ .enable_reg = (void __iomem *)FRQCRC,
-+};
-+
-+static struct clk pllc1_clk = {
-+ .ops = &pllc01_clk_ops,
-+ .flags = CLK_ENABLE_ON_INIT,
-+ .parent = &system_div2_clk,
-+ .enable_reg = (void __iomem *)FRQCRA,
-+};
-+
-+/* PLLC1 / 2 */
-+static struct clk pllc1_div2_clk = {
-+ .ops = &div_clk_ops,
-+ .priv = (void *)2,
-+ .parent = &pllc1_clk,
-+};
-+
-+struct clk *main_clks[] = {
-+ &extalr_clk,
-+ &extal1_clk,
-+ &extal2_clk,
-+ &extal1_div2_clk,
-+ &extal1_div1024_clk,
-+ &extal1_div2048_clk,
-+ &extal2_div2_clk,
-+ &dv_clk,
-+ &system_clk,
-+ &system_div2_clk,
-+ &r_clk,
-+ &pllc0_clk,
-+ &pllc1_clk,
-+ &pllc1_div2_clk,
-+};
-+
-+static void div4_kick(struct clk *clk)
-+{
-+ unsigned long value;
-+
-+ /* set KICK bit in FRQCRB to update hardware setting */
-+ value = __raw_readl(FRQCRB);
-+ value |= (1 << 31);
-+ __raw_writel(value, FRQCRB);
-+}
-+
-+static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
-+ 24, 32, 36, 48, 0, 72, 96, 0 };
-+
-+static struct clk_div_mult_table div4_div_mult_table = {
-+ .divisors = divisors,
-+ .nr_divisors = ARRAY_SIZE(divisors),
-+};
-+
-+static struct clk_div4_table div4_table = {
-+ .div_mult_table = &div4_div_mult_table,
-+ .kick = div4_kick,
-+};
-+
-+enum {
-+ DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP,
-+ DIV4_HPP, DIV4_S, DIV4_ZB, DIV4_M3, DIV4_CP,
-+ DIV4_NR
-+};
-+
-+struct clk div4_clks[DIV4_NR] = {
-+ [DIV4_I] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT),
-+ [DIV4_ZG] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT),
-+ [DIV4_B] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT),
-+ [DIV4_M1] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT),
-+ [DIV4_HP] = SH_CLK_DIV4(&pllc1_clk, FRQCRB, 4, 0x6fff, 0),
-+ [DIV4_HPP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 20, 0x6fff, 0),
-+ [DIV4_S] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 12, 0x6fff, 0),
-+ [DIV4_ZB] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 8, 0x6fff, 0),
-+ [DIV4_M3] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 4, 0x6fff, 0),
-+ [DIV4_CP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 0, 0x6fff, 0),
-+};
-+
-+enum {
-+ DIV6_SUB,
-+ DIV6_NR
-+};
-+
-+static struct clk div6_clks[DIV6_NR] = {
-+ [DIV6_SUB] = SH_CLK_DIV6(&pllc1_div2_clk, SUBCKCR, 0),
-+};
-+
-+enum {
-+ MSTP125,
-+ MSTP116, MSTP111,
-+
-+ MSTP230,
-+ MSTP222,
-+ MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-+
-+ MSTP329, MSTP323,
-+
-+ MSTP_NR
-+};
-+
-+static struct clk mstp_clks[MSTP_NR] = {
-+ [MSTP125] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */
-+ [MSTP116] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */
-+ [MSTP111] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 11, 0), /* TMU1 */
-+
-+ [MSTP230] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 30, 0), /* SCIFA6 */
-+ [MSTP222] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 22, 0), /* SCIFA7 */
-+ [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
-+ [MSTP206] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
-+ [MSTP204] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
-+ [MSTP203] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
-+ [MSTP202] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
-+ [MSTP201] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
-+ [MSTP200] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
-+
-+ [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
-+ [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
-+};
-+
-+static struct clk_lookup lookups[] = {
-+ /* main clocks */
-+ CLKDEV_CON_ID("extalr", &extalr_clk),
-+ CLKDEV_CON_ID("extal1", &extal1_clk),
-+ CLKDEV_CON_ID("extal2", &extal2_clk),
-+ CLKDEV_CON_ID("extal1_div2", &extal1_div2_clk),
-+ CLKDEV_CON_ID("extal1_div1024", &extal1_div1024_clk),
-+ CLKDEV_CON_ID("extal1_div2048", &extal1_div2048_clk),
-+ CLKDEV_CON_ID("extal2_div2", &extal2_div2_clk),
-+ CLKDEV_CON_ID("dv_clk", &dv_clk),
-+ CLKDEV_CON_ID("system_clk", &system_clk),
-+ CLKDEV_CON_ID("system_div2_clk", &system_div2_clk),
-+ CLKDEV_CON_ID("r_clk", &r_clk),
-+ CLKDEV_CON_ID("pllc0_clk", &pllc0_clk),
-+ CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
-+ CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
-+
-+ /* DIV4 clocks */
-+ CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
-+ CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]),
-+ CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
-+ CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]),
-+ CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
-+ CLKDEV_CON_ID("hpp_clk", &div4_clks[DIV4_HPP]),
-+ CLKDEV_CON_ID("s_clk", &div4_clks[DIV4_S]),
-+ CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
-+ CLKDEV_CON_ID("m3_clk", &div4_clks[DIV4_M3]),
-+ CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
-+
-+ /* DIV6 clocks */
-+ CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
-+
-+ /* MSTP32 clocks */
-+ CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]),
-+ CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]),
-+ CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]),
-+
-+ CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]),
-+ CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]),
-+ CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]),
-+ CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
-+ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
-+ CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]),
-+ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]),
-+
-+ CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]),
-+ CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]),
-+
-+ CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
-+ CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
-+};
-+
-+void __init r8a7740_clock_init(u8 md_ck)
-+{
-+ int k, ret = 0;
-+
-+ /* detect system clock parent */
-+ if (md_ck & MD_CK1)
-+ system_clk.parent = &extal1_div2_clk;
-+ else
-+ system_clk.parent = &extal1_clk;
-+
-+ /* detect RCLK parent */
-+ switch (md_ck & (MD_CK2 | MD_CK1)) {
-+ case MD_CK2 | MD_CK1:
-+ r_clk.parent = &extal1_div2048_clk;
-+ break;
-+ case MD_CK2:
-+ r_clk.parent = &extal1_div1024_clk;
-+ break;
-+ case MD_CK1:
-+ default:
-+ r_clk.parent = &extalr_clk;
-+ break;
-+ }
-+
-+ for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
-+ ret = clk_register(main_clks[k]);
-+
-+ if (!ret)
-+ ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
-+
-+ if (!ret)
-+ ret = sh_clk_div6_register(div6_clks, DIV6_NR);
-+
-+ if (!ret)
-+ ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
-+
-+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-+
-+ if (!ret)
-+ clk_init();
-+ else
-+ panic("failed to setup r8a7740 clocks\n");
-+}
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index 0e37fd5..d821f63 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -54,4 +54,10 @@ extern void sh73a0_secondary_init(unsigned int cpu);
- extern int sh73a0_boot_secondary(unsigned int cpu);
- extern void sh73a0_smp_prepare_cpus(void);
-
-+extern void r8a7740_init_irq(void);
-+extern void r8a7740_add_early_devices(void);
-+extern void r8a7740_add_standard_devices(void);
-+extern void r8a7740_clock_init(u8 md_ck);
-+extern void r8a7740_pinmux_init(void);
-+
- #endif /* __ARCH_MACH_COMMON_H */
-diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
-new file mode 100644
-index 0000000..9d447ab
---- /dev/null
-+++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
-@@ -0,0 +1,584 @@
-+/*
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+#ifndef __ASM_R8A7740_H__
-+#define __ASM_R8A7740_H__
-+
-+/*
-+ * MD_CKx pin
-+ */
-+#define MD_CK2 (1 << 2)
-+#define MD_CK1 (1 << 1)
-+#define MD_CK0 (1 << 0)
-+
-+/*
-+ * Pin Function Controller:
-+ * GPIO_FN_xx - GPIO used to select pin function
-+ * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
-+ */
-+enum {
-+ /* PORT */
-+ GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
-+ GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
-+
-+ GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
-+ GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
-+
-+ GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
-+ GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
-+
-+ GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
-+ GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
-+
-+ GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
-+ GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
-+
-+ GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
-+ GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
-+
-+ GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
-+ GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
-+
-+ GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
-+ GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
-+
-+ GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
-+ GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
-+
-+ GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
-+ GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
-+
-+ GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
-+ GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
-+
-+ GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
-+ GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
-+
-+ GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
-+ GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
-+
-+ GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
-+ GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
-+
-+ GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
-+ GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
-+
-+ GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
-+ GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
-+
-+ GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
-+ GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
-+
-+ GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
-+ GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
-+
-+ GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
-+ GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
-+
-+ GPIO_PORT190, GPIO_PORT191, GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
-+ GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
-+
-+ GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
-+ GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
-+
-+ GPIO_PORT210, GPIO_PORT211,
-+
-+ /* IRQ */
-+ GPIO_FN_IRQ0_PORT2, GPIO_FN_IRQ0_PORT13,
-+ GPIO_FN_IRQ1,
-+ GPIO_FN_IRQ2_PORT11, GPIO_FN_IRQ2_PORT12,
-+ GPIO_FN_IRQ3_PORT10, GPIO_FN_IRQ3_PORT14,
-+ GPIO_FN_IRQ4_PORT15, GPIO_FN_IRQ4_PORT172,
-+ GPIO_FN_IRQ5_PORT0, GPIO_FN_IRQ5_PORT1,
-+ GPIO_FN_IRQ6_PORT121, GPIO_FN_IRQ6_PORT173,
-+ GPIO_FN_IRQ7_PORT120, GPIO_FN_IRQ7_PORT209,
-+ GPIO_FN_IRQ8,
-+ GPIO_FN_IRQ9_PORT118, GPIO_FN_IRQ9_PORT210,
-+ GPIO_FN_IRQ10,
-+ GPIO_FN_IRQ11,
-+ GPIO_FN_IRQ12_PORT42, GPIO_FN_IRQ12_PORT97,
-+ GPIO_FN_IRQ13_PORT64, GPIO_FN_IRQ13_PORT98,
-+ GPIO_FN_IRQ14_PORT63, GPIO_FN_IRQ14_PORT99,
-+ GPIO_FN_IRQ15_PORT62, GPIO_FN_IRQ15_PORT100,
-+ GPIO_FN_IRQ16_PORT68, GPIO_FN_IRQ16_PORT211,
-+ GPIO_FN_IRQ17,
-+ GPIO_FN_IRQ18,
-+ GPIO_FN_IRQ19,
-+ GPIO_FN_IRQ20,
-+ GPIO_FN_IRQ21,
-+ GPIO_FN_IRQ22,
-+ GPIO_FN_IRQ23,
-+ GPIO_FN_IRQ24,
-+ GPIO_FN_IRQ25,
-+ GPIO_FN_IRQ26_PORT58, GPIO_FN_IRQ26_PORT81,
-+ GPIO_FN_IRQ27_PORT57, GPIO_FN_IRQ27_PORT168,
-+ GPIO_FN_IRQ28_PORT56, GPIO_FN_IRQ28_PORT169,
-+ GPIO_FN_IRQ29_PORT50, GPIO_FN_IRQ29_PORT170,
-+ GPIO_FN_IRQ30_PORT49, GPIO_FN_IRQ30_PORT171,
-+ GPIO_FN_IRQ31_PORT41, GPIO_FN_IRQ31_PORT167,
-+
-+ /* Function */
-+
-+ /* DBGT */
-+ GPIO_FN_DBGMDT2, GPIO_FN_DBGMDT1, GPIO_FN_DBGMDT0,
-+ GPIO_FN_DBGMD10, GPIO_FN_DBGMD11, GPIO_FN_DBGMD20,
-+ GPIO_FN_DBGMD21,
-+
-+ /* FSI */
-+ GPIO_FN_FSIAISLD_PORT0, /* FSIAISLD Port 0/5 */
-+ GPIO_FN_FSIAISLD_PORT5,
-+ GPIO_FN_FSIASPDIF_PORT9, /* FSIASPDIF Port 9/18 */
-+ GPIO_FN_FSIASPDIF_PORT18,
-+ GPIO_FN_FSIAOSLD1, GPIO_FN_FSIAOSLD2,
-+ GPIO_FN_FSIAOLR, GPIO_FN_FSIAOBT,
-+ GPIO_FN_FSIAOSLD, GPIO_FN_FSIAOMC,
-+ GPIO_FN_FSIACK, GPIO_FN_FSIAILR,
-+ GPIO_FN_FSIAIBT,
-+
-+ /* FMSI */
-+ GPIO_FN_FMSISLD_PORT1, /* FMSISLD Port 1/6 */
-+ GPIO_FN_FMSISLD_PORT6,
-+ GPIO_FN_FMSIILR, GPIO_FN_FMSIIBT,
-+ GPIO_FN_FMSIOLR, GPIO_FN_FMSIOBT,
-+ GPIO_FN_FMSICK, GPIO_FN_FMSOILR,
-+ GPIO_FN_FMSOIBT, GPIO_FN_FMSOOLR,
-+ GPIO_FN_FMSOOBT, GPIO_FN_FMSOSLD,
-+ GPIO_FN_FMSOCK,
-+
-+ /* SCIFA0 */
-+ GPIO_FN_SCIFA0_SCK, GPIO_FN_SCIFA0_CTS,
-+ GPIO_FN_SCIFA0_RTS, GPIO_FN_SCIFA0_RXD,
-+ GPIO_FN_SCIFA0_TXD,
-+
-+ /* SCIFA1 */
-+ GPIO_FN_SCIFA1_CTS, GPIO_FN_SCIFA1_SCK,
-+ GPIO_FN_SCIFA1_RXD, GPIO_FN_SCIFA1_TXD,
-+ GPIO_FN_SCIFA1_RTS,
-+
-+ /* SCIFA2 */
-+ GPIO_FN_SCIFA2_SCK_PORT22, /* SCIFA2_SCK Port 22/199 */
-+ GPIO_FN_SCIFA2_SCK_PORT199,
-+ GPIO_FN_SCIFA2_RXD, GPIO_FN_SCIFA2_TXD,
-+ GPIO_FN_SCIFA2_CTS, GPIO_FN_SCIFA2_RTS,
-+
-+ /* SCIFA3 */
-+ GPIO_FN_SCIFA3_RTS_PORT105, /* MSEL5CR_8_0 */
-+ GPIO_FN_SCIFA3_SCK_PORT116,
-+ GPIO_FN_SCIFA3_CTS_PORT117,
-+ GPIO_FN_SCIFA3_RXD_PORT174,
-+ GPIO_FN_SCIFA3_TXD_PORT175,
-+
-+ GPIO_FN_SCIFA3_RTS_PORT161, /* MSEL5CR_8_1 */
-+ GPIO_FN_SCIFA3_SCK_PORT158,
-+ GPIO_FN_SCIFA3_CTS_PORT162,
-+ GPIO_FN_SCIFA3_RXD_PORT159,
-+ GPIO_FN_SCIFA3_TXD_PORT160,
-+
-+ /* SCIFA4 */
-+ GPIO_FN_SCIFA4_RXD_PORT12, /* MSEL5CR[12:11] = 00 */
-+ GPIO_FN_SCIFA4_TXD_PORT13,
-+
-+ GPIO_FN_SCIFA4_RXD_PORT204, /* MSEL5CR[12:11] = 01 */
-+ GPIO_FN_SCIFA4_TXD_PORT203,
-+
-+ GPIO_FN_SCIFA4_RXD_PORT94, /* MSEL5CR[12:11] = 10 */
-+ GPIO_FN_SCIFA4_TXD_PORT93,
-+
-+ GPIO_FN_SCIFA4_SCK_PORT21, /* SCIFA4_SCK Port 21/205 */
-+ GPIO_FN_SCIFA4_SCK_PORT205,
-+
-+ /* SCIFA5 */
-+ GPIO_FN_SCIFA5_TXD_PORT20, /* MSEL5CR[15:14] = 00 */
-+ GPIO_FN_SCIFA5_RXD_PORT10,
-+
-+ GPIO_FN_SCIFA5_RXD_PORT207, /* MSEL5CR[15:14] = 01 */
-+ GPIO_FN_SCIFA5_TXD_PORT208,
-+
-+ GPIO_FN_SCIFA5_TXD_PORT91, /* MSEL5CR[15:14] = 10 */
-+ GPIO_FN_SCIFA5_RXD_PORT92,
-+
-+ GPIO_FN_SCIFA5_SCK_PORT23, /* SCIFA5_SCK Port 23/206 */
-+ GPIO_FN_SCIFA5_SCK_PORT206,
-+
-+ /* SCIFA6 */
-+ GPIO_FN_SCIFA6_SCK, GPIO_FN_SCIFA6_RXD, GPIO_FN_SCIFA6_TXD,
-+
-+ /* SCIFA7 */
-+ GPIO_FN_SCIFA7_TXD, GPIO_FN_SCIFA7_RXD,
-+
-+ /* SCIFAB */
-+ GPIO_FN_SCIFB_SCK_PORT190, /* MSEL5CR_17_0 */
-+ GPIO_FN_SCIFB_RXD_PORT191,
-+ GPIO_FN_SCIFB_TXD_PORT192,
-+ GPIO_FN_SCIFB_RTS_PORT186,
-+ GPIO_FN_SCIFB_CTS_PORT187,
-+
-+ GPIO_FN_SCIFB_SCK_PORT2, /* MSEL5CR_17_1 */
-+ GPIO_FN_SCIFB_RXD_PORT3,
-+ GPIO_FN_SCIFB_TXD_PORT4,
-+ GPIO_FN_SCIFB_RTS_PORT172,
-+ GPIO_FN_SCIFB_CTS_PORT173,
-+
-+ /* LCD0 */
-+ GPIO_FN_LCDC0_SELECT,
-+ GPIO_FN_LCD0_D0, GPIO_FN_LCD0_D1, GPIO_FN_LCD0_D2,
-+ GPIO_FN_LCD0_D3, GPIO_FN_LCD0_D4, GPIO_FN_LCD0_D5,
-+ GPIO_FN_LCD0_D6, GPIO_FN_LCD0_D7, GPIO_FN_LCD0_D8,
-+ GPIO_FN_LCD0_D9, GPIO_FN_LCD0_D10, GPIO_FN_LCD0_D11,
-+ GPIO_FN_LCD0_D12, GPIO_FN_LCD0_D13, GPIO_FN_LCD0_D14,
-+ GPIO_FN_LCD0_D15, GPIO_FN_LCD0_D16, GPIO_FN_LCD0_D17,
-+ GPIO_FN_LCD0_DON, GPIO_FN_LCD0_VCPWC, GPIO_FN_LCD0_VEPWC,
-+
-+ GPIO_FN_LCD0_DCK, GPIO_FN_LCD0_VSYN, /* for RGB */
-+ GPIO_FN_LCD0_HSYN, GPIO_FN_LCD0_DISP, /* for RGB */
-+
-+ GPIO_FN_LCD0_WR, GPIO_FN_LCD0_RD, /* for SYS */
-+ GPIO_FN_LCD0_CS, GPIO_FN_LCD0_RS, /* for SYS */
-+
-+ GPIO_FN_LCD0_D18_PORT163, GPIO_FN_LCD0_D19_PORT162,
-+ GPIO_FN_LCD0_D20_PORT161, GPIO_FN_LCD0_D21_PORT158,
-+ GPIO_FN_LCD0_D22_PORT160, GPIO_FN_LCD0_D23_PORT159,
-+ GPIO_FN_LCD0_LCLK_PORT165, /* MSEL5CR_6_1 */
-+
-+ GPIO_FN_LCD0_D18_PORT40, GPIO_FN_LCD0_D19_PORT4,
-+ GPIO_FN_LCD0_D20_PORT3, GPIO_FN_LCD0_D21_PORT2,
-+ GPIO_FN_LCD0_D22_PORT0, GPIO_FN_LCD0_D23_PORT1,
-+ GPIO_FN_LCD0_LCLK_PORT102, /* MSEL5CR_6_0 */
-+
-+ /* LCD1 */
-+ GPIO_FN_LCDC1_SELECT,
-+ GPIO_FN_LCD1_D0, GPIO_FN_LCD1_D1, GPIO_FN_LCD1_D2,
-+ GPIO_FN_LCD1_D3, GPIO_FN_LCD1_D4, GPIO_FN_LCD1_D5,
-+ GPIO_FN_LCD1_D6, GPIO_FN_LCD1_D7, GPIO_FN_LCD1_D8,
-+ GPIO_FN_LCD1_D9, GPIO_FN_LCD1_D10, GPIO_FN_LCD1_D11,
-+ GPIO_FN_LCD1_D12, GPIO_FN_LCD1_D13, GPIO_FN_LCD1_D14,
-+ GPIO_FN_LCD1_D15, GPIO_FN_LCD1_D16, GPIO_FN_LCD1_D17,
-+ GPIO_FN_LCD1_D18, GPIO_FN_LCD1_D19, GPIO_FN_LCD1_D20,
-+ GPIO_FN_LCD1_D21, GPIO_FN_LCD1_D22, GPIO_FN_LCD1_D23,
-+ GPIO_FN_LCD1_DON, GPIO_FN_LCD1_VCPWC,
-+ GPIO_FN_LCD1_LCLK, GPIO_FN_LCD1_VEPWC,
-+
-+ GPIO_FN_LCD1_DCK, GPIO_FN_LCD1_VSYN, /* for RGB */
-+ GPIO_FN_LCD1_HSYN, GPIO_FN_LCD1_DISP, /* for RGB */
-+
-+ GPIO_FN_LCD1_WR, GPIO_FN_LCD1_RD, /* for SYS */
-+ GPIO_FN_LCD1_CS, GPIO_FN_LCD1_RS, /* for SYS */
-+
-+ /* RSPI */
-+ GPIO_FN_RSPI_SSL0_A, GPIO_FN_RSPI_SSL1_A,
-+ GPIO_FN_RSPI_SSL2_A, GPIO_FN_RSPI_SSL3_A,
-+ GPIO_FN_RSPI_MOSI_A, GPIO_FN_RSPI_MISO_A,
-+ GPIO_FN_RSPI_CK_A,
-+
-+ /* VIO CKO */
-+ GPIO_FN_VIO_CKO1,
-+ GPIO_FN_VIO_CKO2,
-+ GPIO_FN_VIO_CKO_1,
-+ GPIO_FN_VIO_CKO,
-+
-+ /* VIO0 */
-+ GPIO_FN_VIO0_D0, GPIO_FN_VIO0_D1, GPIO_FN_VIO0_D2,
-+ GPIO_FN_VIO0_D3, GPIO_FN_VIO0_D4, GPIO_FN_VIO0_D5,
-+ GPIO_FN_VIO0_D6, GPIO_FN_VIO0_D7, GPIO_FN_VIO0_D8,
-+ GPIO_FN_VIO0_D9, GPIO_FN_VIO0_D10, GPIO_FN_VIO0_D11,
-+ GPIO_FN_VIO0_D12, GPIO_FN_VIO0_VD, GPIO_FN_VIO0_HD,
-+ GPIO_FN_VIO0_CLK, GPIO_FN_VIO0_FIELD,
-+
-+ GPIO_FN_VIO0_D13_PORT26, /* MSEL5CR_27_0 */
-+ GPIO_FN_VIO0_D14_PORT25,
-+ GPIO_FN_VIO0_D15_PORT24,
-+
-+ GPIO_FN_VIO0_D13_PORT22, /* MSEL5CR_27_1 */
-+ GPIO_FN_VIO0_D14_PORT95,
-+ GPIO_FN_VIO0_D15_PORT96,
-+
-+ /* VIO1 */
-+ GPIO_FN_VIO1_D0, GPIO_FN_VIO1_D1, GPIO_FN_VIO1_D2,
-+ GPIO_FN_VIO1_D3, GPIO_FN_VIO1_D4, GPIO_FN_VIO1_D5,
-+ GPIO_FN_VIO1_D6, GPIO_FN_VIO1_D7, GPIO_FN_VIO1_VD,
-+ GPIO_FN_VIO1_HD, GPIO_FN_VIO1_CLK, GPIO_FN_VIO1_FIELD,
-+
-+ /* TPU0 */
-+ GPIO_FN_TPU0TO0, GPIO_FN_TPU0TO1,
-+ GPIO_FN_TPU0TO3,
-+ GPIO_FN_TPU0TO2_PORT66, /* TPU0TO2 Port 66/202 */
-+ GPIO_FN_TPU0TO2_PORT202,
-+
-+ /* SSP1 0 */
-+ GPIO_FN_STP0_IPD0, GPIO_FN_STP0_IPD1, GPIO_FN_STP0_IPD2,
-+ GPIO_FN_STP0_IPD3, GPIO_FN_STP0_IPD4, GPIO_FN_STP0_IPD5,
-+ GPIO_FN_STP0_IPD6, GPIO_FN_STP0_IPD7, GPIO_FN_STP0_IPEN,
-+ GPIO_FN_STP0_IPCLK, GPIO_FN_STP0_IPSYNC,
-+
-+ /* SSP1 1 */
-+ GPIO_FN_STP1_IPD1, GPIO_FN_STP1_IPD2, GPIO_FN_STP1_IPD3,
-+ GPIO_FN_STP1_IPD4, GPIO_FN_STP1_IPD5, GPIO_FN_STP1_IPD6,
-+ GPIO_FN_STP1_IPD7, GPIO_FN_STP1_IPCLK, GPIO_FN_STP1_IPSYNC,
-+
-+ GPIO_FN_STP1_IPD0_PORT186, /* MSEL5CR_23_0 */
-+ GPIO_FN_STP1_IPEN_PORT187,
-+
-+ GPIO_FN_STP1_IPD0_PORT194, /* MSEL5CR_23_1 */
-+ GPIO_FN_STP1_IPEN_PORT193,
-+
-+ /* SIM */
-+ GPIO_FN_SIM_RST, GPIO_FN_SIM_CLK,
-+ GPIO_FN_SIM_D_PORT22, /* SIM_D Port 22/199 */
-+ GPIO_FN_SIM_D_PORT199,
-+
-+ /* SDHI0 */
-+ GPIO_FN_SDHI0_D0, GPIO_FN_SDHI0_D1, GPIO_FN_SDHI0_D2,
-+ GPIO_FN_SDHI0_D3, GPIO_FN_SDHI0_CD, GPIO_FN_SDHI0_WP,
-+ GPIO_FN_SDHI0_CMD, GPIO_FN_SDHI0_CLK,
-+
-+ /* SDHI1 */
-+ GPIO_FN_SDHI1_D0, GPIO_FN_SDHI1_D1, GPIO_FN_SDHI1_D2,
-+ GPIO_FN_SDHI1_D3, GPIO_FN_SDHI1_CD, GPIO_FN_SDHI1_WP,
-+ GPIO_FN_SDHI1_CMD, GPIO_FN_SDHI1_CLK,
-+
-+ /* SDHI2 */
-+ GPIO_FN_SDHI2_D0, GPIO_FN_SDHI2_D1, GPIO_FN_SDHI2_D2,
-+ GPIO_FN_SDHI2_D3, GPIO_FN_SDHI2_CLK, GPIO_FN_SDHI2_CMD,
-+
-+ GPIO_FN_SDHI2_CD_PORT24, /* MSEL5CR_19_0 */
-+ GPIO_FN_SDHI2_WP_PORT25,
-+
-+ GPIO_FN_SDHI2_WP_PORT177, /* MSEL5CR_19_1 */
-+ GPIO_FN_SDHI2_CD_PORT202,
-+
-+ /* MSIOF2 */
-+ GPIO_FN_MSIOF2_TXD, GPIO_FN_MSIOF2_RXD, GPIO_FN_MSIOF2_TSCK,
-+ GPIO_FN_MSIOF2_SS2, GPIO_FN_MSIOF2_TSYNC, GPIO_FN_MSIOF2_SS1,
-+ GPIO_FN_MSIOF2_MCK1, GPIO_FN_MSIOF2_MCK0, GPIO_FN_MSIOF2_RSYNC,
-+ GPIO_FN_MSIOF2_RSCK,
-+
-+ /* KEYSC */
-+ GPIO_FN_KEYIN4, GPIO_FN_KEYIN5,
-+ GPIO_FN_KEYIN6, GPIO_FN_KEYIN7,
-+ GPIO_FN_KEYOUT0, GPIO_FN_KEYOUT1, GPIO_FN_KEYOUT2,
-+ GPIO_FN_KEYOUT3, GPIO_FN_KEYOUT4, GPIO_FN_KEYOUT5,
-+ GPIO_FN_KEYOUT6, GPIO_FN_KEYOUT7,
-+
-+ GPIO_FN_KEYIN0_PORT43, /* MSEL4CR_18_0 */
-+ GPIO_FN_KEYIN1_PORT44,
-+ GPIO_FN_KEYIN2_PORT45,
-+ GPIO_FN_KEYIN3_PORT46,
-+
-+ GPIO_FN_KEYIN0_PORT58, /* MSEL4CR_18_1 */
-+ GPIO_FN_KEYIN1_PORT57,
-+ GPIO_FN_KEYIN2_PORT56,
-+ GPIO_FN_KEYIN3_PORT55,
-+
-+ /* VOU */
-+ GPIO_FN_DV_D0, GPIO_FN_DV_D1, GPIO_FN_DV_D2, GPIO_FN_DV_D3,
-+ GPIO_FN_DV_D4, GPIO_FN_DV_D5, GPIO_FN_DV_D6, GPIO_FN_DV_D7,
-+ GPIO_FN_DV_D8, GPIO_FN_DV_D9, GPIO_FN_DV_D10, GPIO_FN_DV_D11,
-+ GPIO_FN_DV_D12, GPIO_FN_DV_D13, GPIO_FN_DV_D14, GPIO_FN_DV_D15,
-+ GPIO_FN_DV_CLK,
-+ GPIO_FN_DV_VSYNC,
-+ GPIO_FN_DV_HSYNC,
-+
-+ /* MEMC */
-+ GPIO_FN_MEMC_AD0, GPIO_FN_MEMC_AD1, GPIO_FN_MEMC_AD2,
-+ GPIO_FN_MEMC_AD3, GPIO_FN_MEMC_AD4, GPIO_FN_MEMC_AD5,
-+ GPIO_FN_MEMC_AD6, GPIO_FN_MEMC_AD7, GPIO_FN_MEMC_AD8,
-+ GPIO_FN_MEMC_AD9, GPIO_FN_MEMC_AD10, GPIO_FN_MEMC_AD11,
-+ GPIO_FN_MEMC_AD12, GPIO_FN_MEMC_AD13, GPIO_FN_MEMC_AD14,
-+ GPIO_FN_MEMC_AD15, GPIO_FN_MEMC_CS0, GPIO_FN_MEMC_INT,
-+ GPIO_FN_MEMC_NWE, GPIO_FN_MEMC_NOE,
-+
-+ GPIO_FN_MEMC_CS1, /* MSEL4CR_6_0 */
-+ GPIO_FN_MEMC_ADV,
-+ GPIO_FN_MEMC_WAIT,
-+ GPIO_FN_MEMC_BUSCLK,
-+
-+ GPIO_FN_MEMC_A1, /* MSEL4CR_6_1 */
-+ GPIO_FN_MEMC_DREQ0,
-+ GPIO_FN_MEMC_DREQ1,
-+ GPIO_FN_MEMC_A0,
-+
-+ /* MMC */
-+ GPIO_FN_MMC0_D0_PORT68, GPIO_FN_MMC0_D1_PORT69,
-+ GPIO_FN_MMC0_D2_PORT70, GPIO_FN_MMC0_D3_PORT71,
-+ GPIO_FN_MMC0_D4_PORT72, GPIO_FN_MMC0_D5_PORT73,
-+ GPIO_FN_MMC0_D6_PORT74, GPIO_FN_MMC0_D7_PORT75,
-+ GPIO_FN_MMC0_CLK_PORT66,
-+ GPIO_FN_MMC0_CMD_PORT67, /* MSEL4CR_15_0 */
-+
-+ GPIO_FN_MMC1_D0_PORT149, GPIO_FN_MMC1_D1_PORT148,
-+ GPIO_FN_MMC1_D2_PORT147, GPIO_FN_MMC1_D3_PORT146,
-+ GPIO_FN_MMC1_D4_PORT145, GPIO_FN_MMC1_D5_PORT144,
-+ GPIO_FN_MMC1_D6_PORT143, GPIO_FN_MMC1_D7_PORT142,
-+ GPIO_FN_MMC1_CLK_PORT103,
-+ GPIO_FN_MMC1_CMD_PORT104, /* MSEL4CR_15_1 */
-+
-+ /* MSIOF0 */
-+ GPIO_FN_MSIOF0_SS1, GPIO_FN_MSIOF0_SS2,
-+ GPIO_FN_MSIOF0_RXD, GPIO_FN_MSIOF0_TXD,
-+ GPIO_FN_MSIOF0_MCK0, GPIO_FN_MSIOF0_MCK1,
-+ GPIO_FN_MSIOF0_RSYNC, GPIO_FN_MSIOF0_RSCK,
-+ GPIO_FN_MSIOF0_TSCK, GPIO_FN_MSIOF0_TSYNC,
-+
-+ /* MSIOF1 */
-+ GPIO_FN_MSIOF1_RSCK, GPIO_FN_MSIOF1_RSYNC,
-+ GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
-+
-+ GPIO_FN_MSIOF1_SS2_PORT116, GPIO_FN_MSIOF1_SS1_PORT117,
-+ GPIO_FN_MSIOF1_RXD_PORT118, GPIO_FN_MSIOF1_TXD_PORT119,
-+ GPIO_FN_MSIOF1_TSYNC_PORT120,
-+ GPIO_FN_MSIOF1_TSCK_PORT121, /* MSEL4CR_10_0 */
-+
-+ GPIO_FN_MSIOF1_SS1_PORT67, GPIO_FN_MSIOF1_TSCK_PORT72,
-+ GPIO_FN_MSIOF1_TSYNC_PORT73, GPIO_FN_MSIOF1_TXD_PORT74,
-+ GPIO_FN_MSIOF1_RXD_PORT75,
-+ GPIO_FN_MSIOF1_SS2_PORT202, /* MSEL4CR_10_1 */
-+
-+ /* GPIO */
-+ GPIO_FN_GPO0, GPIO_FN_GPI0,
-+ GPIO_FN_GPO1, GPIO_FN_GPI1,
-+
-+ /* USB0 */
-+ GPIO_FN_USB0_OCI, GPIO_FN_USB0_PPON, GPIO_FN_VBUS,
-+
-+ /* USB1 */
-+ GPIO_FN_USB1_OCI, GPIO_FN_USB1_PPON,
-+
-+ /* BBIF1 */
-+ GPIO_FN_BBIF1_RXD, GPIO_FN_BBIF1_TXD, GPIO_FN_BBIF1_TSYNC,
-+ GPIO_FN_BBIF1_TSCK, GPIO_FN_BBIF1_RSCK, GPIO_FN_BBIF1_RSYNC,
-+ GPIO_FN_BBIF1_FLOW, GPIO_FN_BBIF1_RX_FLOW_N,
-+
-+ /* BBIF2 */
-+ GPIO_FN_BBIF2_TXD2_PORT5, /* MSEL5CR_0_0 */
-+ GPIO_FN_BBIF2_RXD2_PORT60,
-+ GPIO_FN_BBIF2_TSYNC2_PORT6,
-+ GPIO_FN_BBIF2_TSCK2_PORT59,
-+
-+ GPIO_FN_BBIF2_RXD2_PORT90, /* MSEL5CR_0_1 */
-+ GPIO_FN_BBIF2_TXD2_PORT183,
-+ GPIO_FN_BBIF2_TSCK2_PORT89,
-+ GPIO_FN_BBIF2_TSYNC2_PORT184,
-+
-+ /* BSC / FLCTL / PCMCIA */
-+ GPIO_FN_CS0, GPIO_FN_CS2, GPIO_FN_CS4,
-+ GPIO_FN_CS5B, GPIO_FN_CS6A,
-+ GPIO_FN_CS5A_PORT105, /* CS5A PORT 19/105 */
-+ GPIO_FN_CS5A_PORT19,
-+ GPIO_FN_IOIS16, /* ? */
-+
-+ GPIO_FN_A0, GPIO_FN_A1, GPIO_FN_A2, GPIO_FN_A3,
-+ GPIO_FN_A4_FOE, /* share with FLCTL */
-+ GPIO_FN_A5_FCDE, /* share with FLCTL */
-+ GPIO_FN_A6, GPIO_FN_A7, GPIO_FN_A8, GPIO_FN_A9,
-+ GPIO_FN_A10, GPIO_FN_A11, GPIO_FN_A12, GPIO_FN_A13,
-+ GPIO_FN_A14, GPIO_FN_A15, GPIO_FN_A16, GPIO_FN_A17,
-+ GPIO_FN_A18, GPIO_FN_A19, GPIO_FN_A20, GPIO_FN_A21,
-+ GPIO_FN_A22, GPIO_FN_A23, GPIO_FN_A24, GPIO_FN_A25,
-+ GPIO_FN_A26,
-+
-+ GPIO_FN_D0_NAF0, GPIO_FN_D1_NAF1, /* share with FLCTL */
-+ GPIO_FN_D2_NAF2, GPIO_FN_D3_NAF3, /* share with FLCTL */
-+ GPIO_FN_D4_NAF4, GPIO_FN_D5_NAF5, /* share with FLCTL */
-+ GPIO_FN_D6_NAF6, GPIO_FN_D7_NAF7, /* share with FLCTL */
-+ GPIO_FN_D8_NAF8, GPIO_FN_D9_NAF9, /* share with FLCTL */
-+ GPIO_FN_D10_NAF10, GPIO_FN_D11_NAF11, /* share with FLCTL */
-+ GPIO_FN_D12_NAF12, GPIO_FN_D13_NAF13, /* share with FLCTL */
-+ GPIO_FN_D14_NAF14, GPIO_FN_D15_NAF15, /* share with FLCTL */
-+
-+ GPIO_FN_D16, GPIO_FN_D17, GPIO_FN_D18, GPIO_FN_D19,
-+ GPIO_FN_D20, GPIO_FN_D21, GPIO_FN_D22, GPIO_FN_D23,
-+ GPIO_FN_D24, GPIO_FN_D25, GPIO_FN_D26, GPIO_FN_D27,
-+ GPIO_FN_D28, GPIO_FN_D29, GPIO_FN_D30, GPIO_FN_D31,
-+
-+ GPIO_FN_WE0_FWE, /* share with FLCTL */
-+ GPIO_FN_WE1,
-+ GPIO_FN_WE2_ICIORD, /* share with PCMCIA */
-+ GPIO_FN_WE3_ICIOWR, /* share with PCMCIA */
-+ GPIO_FN_CKO, GPIO_FN_BS, GPIO_FN_RDWR,
-+ GPIO_FN_RD_FSC, /* share with FLCTL */
-+ GPIO_FN_WAIT_PORT177, /* WAIT Port 90/177 */
-+ GPIO_FN_WAIT_PORT90,
-+
-+ GPIO_FN_FCE0, GPIO_FN_FCE1, GPIO_FN_FRB, /* FLCTL */
-+
-+ /* IRDA */
-+ GPIO_FN_IRDA_FIRSEL, GPIO_FN_IRDA_IN, GPIO_FN_IRDA_OUT,
-+
-+ /* ATAPI */
-+ GPIO_FN_IDE_D0, GPIO_FN_IDE_D1, GPIO_FN_IDE_D2,
-+ GPIO_FN_IDE_D3, GPIO_FN_IDE_D4, GPIO_FN_IDE_D5,
-+ GPIO_FN_IDE_D6, GPIO_FN_IDE_D7, GPIO_FN_IDE_D8,
-+ GPIO_FN_IDE_D9, GPIO_FN_IDE_D10, GPIO_FN_IDE_D11,
-+ GPIO_FN_IDE_D12, GPIO_FN_IDE_D13, GPIO_FN_IDE_D14,
-+ GPIO_FN_IDE_D15, GPIO_FN_IDE_A0, GPIO_FN_IDE_A1,
-+ GPIO_FN_IDE_A2, GPIO_FN_IDE_CS0, GPIO_FN_IDE_CS1,
-+ GPIO_FN_IDE_IOWR, GPIO_FN_IDE_IORD, GPIO_FN_IDE_IORDY,
-+ GPIO_FN_IDE_INT, GPIO_FN_IDE_RST, GPIO_FN_IDE_DIRECTION,
-+ GPIO_FN_IDE_EXBUF_ENB, GPIO_FN_IDE_IODACK, GPIO_FN_IDE_IODREQ,
-+
-+ /* RMII */
-+ GPIO_FN_RMII_CRS_DV, GPIO_FN_RMII_RX_ER, GPIO_FN_RMII_RXD0,
-+ GPIO_FN_RMII_RXD1, GPIO_FN_RMII_TX_EN, GPIO_FN_RMII_TXD0,
-+ GPIO_FN_RMII_MDC, GPIO_FN_RMII_TXD1, GPIO_FN_RMII_MDIO,
-+ GPIO_FN_RMII_REF50CK, /* for RMII */
-+ GPIO_FN_RMII_REF125CK, /* for GMII */
-+
-+ /* GEther */
-+ GPIO_FN_ET_TX_CLK, GPIO_FN_ET_TX_EN, GPIO_FN_ET_ETXD0,
-+ GPIO_FN_ET_ETXD1, GPIO_FN_ET_ETXD2, GPIO_FN_ET_ETXD3,
-+ GPIO_FN_ET_ETXD4, GPIO_FN_ET_ETXD5, /* for GEther */
-+ GPIO_FN_ET_ETXD6, GPIO_FN_ET_ETXD7, /* for GEther */
-+ GPIO_FN_ET_COL, GPIO_FN_ET_TX_ER,
-+ GPIO_FN_ET_RX_CLK, GPIO_FN_ET_RX_DV,
-+ GPIO_FN_ET_ERXD0, GPIO_FN_ET_ERXD1,
-+ GPIO_FN_ET_ERXD2, GPIO_FN_ET_ERXD3,
-+ GPIO_FN_ET_ERXD4, GPIO_FN_ET_ERXD5, /* for GEther */
-+ GPIO_FN_ET_ERXD6, GPIO_FN_ET_ERXD7, /* for GEther */
-+ GPIO_FN_ET_RX_ER, GPIO_FN_ET_CRS,
-+ GPIO_FN_ET_MDC, GPIO_FN_ET_MDIO,
-+ GPIO_FN_ET_LINK, GPIO_FN_ET_PHY_INT,
-+ GPIO_FN_ET_WOL, GPIO_FN_ET_GTX_CLK,
-+
-+ /* DMA0 */
-+ GPIO_FN_DREQ0, GPIO_FN_DACK0,
-+
-+ /* DMA1 */
-+ GPIO_FN_DREQ1, GPIO_FN_DACK1,
-+
-+ /* SYSC */
-+ GPIO_FN_RESETOUTS,
-+ GPIO_FN_RESETP_PULLUP,
-+ GPIO_FN_RESETP_PLAIN,
-+
-+ /* SDENC */
-+ GPIO_FN_SDENC_CPG,
-+ GPIO_FN_SDENC_DV_CLKI,
-+
-+ /* IRREM */
-+ GPIO_FN_IROUT,
-+
-+ /* DEBUG */
-+ GPIO_FN_EDEBGREQ_PULLDOWN,
-+ GPIO_FN_EDEBGREQ_PULLUP,
-+
-+ GPIO_FN_TRACEAUD_FROM_VIO,
-+ GPIO_FN_TRACEAUD_FROM_LCDC0,
-+ GPIO_FN_TRACEAUD_FROM_MEMC,
-+};
-+
-+#endif /* __ASM_R8A7740_H__ */
-diff --git a/arch/arm/mach-shmobile/intc-r8a7740.c b/arch/arm/mach-shmobile/intc-r8a7740.c
-new file mode 100644
-index 0000000..c62a205
---- /dev/null
-+++ b/arch/arm/mach-shmobile/intc-r8a7740.c
-@@ -0,0 +1,45 @@
-+/*
-+ * R8A7740 processor support
-+ *
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+#include <linux/irq.h>
-+#include <linux/io.h>
-+#include <asm/hardware/gic.h>
-+
-+#define INTA_CTRL 0xe605807c
-+
-+static int r8a7740_set_wake(struct irq_data *data, unsigned int on)
-+{
-+ return 0; /* always allow wakeup */
-+}
-+
-+void __init r8a7740_init_irq(void)
-+{
-+ void __iomem *gic_dist_base = __io(0xf0001000);
-+ void __iomem *gic_cpu_base = __io(0xf0000000);
-+
-+ /*
-+ * Change INT_SEL INTCA->GIC
-+ * (on GPIO)
-+ */
-+ __raw_writel(__raw_readl(INTA_CTRL) & ~(1 << 1), INTA_CTRL);
-+
-+ gic_init(0, 29, gic_dist_base, gic_cpu_base);
-+ gic_arch_extn.irq_set_wake = r8a7740_set_wake;
-+}
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-new file mode 100644
-index 0000000..5548518
---- /dev/null
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -0,0 +1,246 @@
-+/*
-+ * R8A7740 processor support
-+ *
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/serial_sci.h>
-+#include <linux/sh_timer.h>
-+#include <mach/r8a7740.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-+
-+/* SCIFA0 */
-+static struct plat_sci_port scif0_platform_data = {
-+ .mapbase = 0xe6c40000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(100)),
-+};
-+
-+static struct platform_device scif0_device = {
-+ .name = "sh-sci",
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &scif0_platform_data,
-+ },
-+};
-+
-+/* SCIFA1 */
-+static struct plat_sci_port scif1_platform_data = {
-+ .mapbase = 0xe6c50000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(101)),
-+};
-+
-+static struct platform_device scif1_device = {
-+ .name = "sh-sci",
-+ .id = 1,
-+ .dev = {
-+ .platform_data = &scif1_platform_data,
-+ },
-+};
-+
-+/* SCIFA2 */
-+static struct plat_sci_port scif2_platform_data = {
-+ .mapbase = 0xe6c60000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(102)),
-+};
-+
-+static struct platform_device scif2_device = {
-+ .name = "sh-sci",
-+ .id = 2,
-+ .dev = {
-+ .platform_data = &scif2_platform_data,
-+ },
-+};
-+
-+/* SCIFA3 */
-+static struct plat_sci_port scif3_platform_data = {
-+ .mapbase = 0xe6c70000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(103)),
-+};
-+
-+static struct platform_device scif3_device = {
-+ .name = "sh-sci",
-+ .id = 3,
-+ .dev = {
-+ .platform_data = &scif3_platform_data,
-+ },
-+};
-+
-+/* SCIFA4 */
-+static struct plat_sci_port scif4_platform_data = {
-+ .mapbase = 0xe6c80000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(104)),
-+};
-+
-+static struct platform_device scif4_device = {
-+ .name = "sh-sci",
-+ .id = 4,
-+ .dev = {
-+ .platform_data = &scif4_platform_data,
-+ },
-+};
-+
-+/* SCIFA5 */
-+static struct plat_sci_port scif5_platform_data = {
-+ .mapbase = 0xe6cb0000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(105)),
-+};
-+
-+static struct platform_device scif5_device = {
-+ .name = "sh-sci",
-+ .id = 5,
-+ .dev = {
-+ .platform_data = &scif5_platform_data,
-+ },
-+};
-+
-+/* SCIFA6 */
-+static struct plat_sci_port scif6_platform_data = {
-+ .mapbase = 0xe6cc0000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(106)),
-+};
-+
-+static struct platform_device scif6_device = {
-+ .name = "sh-sci",
-+ .id = 6,
-+ .dev = {
-+ .platform_data = &scif6_platform_data,
-+ },
-+};
-+
-+/* SCIFA7 */
-+static struct plat_sci_port scif7_platform_data = {
-+ .mapbase = 0xe6cd0000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFA,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(107)),
-+};
-+
-+static struct platform_device scif7_device = {
-+ .name = "sh-sci",
-+ .id = 7,
-+ .dev = {
-+ .platform_data = &scif7_platform_data,
-+ },
-+};
-+
-+/* SCIFB */
-+static struct plat_sci_port scifb_platform_data = {
-+ .mapbase = 0xe6c30000,
-+ .flags = UPF_BOOT_AUTOCONF,
-+ .scscr = SCSCR_RE | SCSCR_TE,
-+ .scbrr_algo_id = SCBRR_ALGO_4,
-+ .type = PORT_SCIFB,
-+ .irqs = SCIx_IRQ_MUXED(gic_spi(108)),
-+};
-+
-+static struct platform_device scifb_device = {
-+ .name = "sh-sci",
-+ .id = 8,
-+ .dev = {
-+ .platform_data = &scifb_platform_data,
-+ },
-+};
-+
-+/* CMT */
-+static struct sh_timer_config cmt10_platform_data = {
-+ .name = "CMT10",
-+ .channel_offset = 0x10,
-+ .timer_bit = 0,
-+ .clockevent_rating = 125,
-+ .clocksource_rating = 125,
-+};
-+
-+static struct resource cmt10_resources[] = {
-+ [0] = {
-+ .name = "CMT10",
-+ .start = 0xe6138010,
-+ .end = 0xe613801b,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = gic_spi(58),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device cmt10_device = {
-+ .name = "sh_cmt",
-+ .id = 10,
-+ .dev = {
-+ .platform_data = &cmt10_platform_data,
-+ },
-+ .resource = cmt10_resources,
-+ .num_resources = ARRAY_SIZE(cmt10_resources),
-+};
-+
-+static struct platform_device *r8a7740_early_devices[] __initdata = {
-+ &scif0_device,
-+ &scif1_device,
-+ &scif2_device,
-+ &scif3_device,
-+ &scif4_device,
-+ &scif5_device,
-+ &scif6_device,
-+ &scif7_device,
-+ &scifb_device,
-+ &cmt10_device,
-+};
-+
-+void __init r8a7740_add_standard_devices(void)
-+{
-+ platform_add_devices(r8a7740_early_devices,
-+ ARRAY_SIZE(r8a7740_early_devices));
-+}
-+
-+void __init r8a7740_add_early_devices(void)
-+{
-+ early_platform_add_devices(r8a7740_early_devices,
-+ ARRAY_SIZE(r8a7740_early_devices));
-+}
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index b04d937..1bb7130 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -172,7 +172,9 @@
- defined(CONFIG_ARCH_SH73A0) || \
- defined(CONFIG_ARCH_SH7367) || \
- defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372)
-+ defined(CONFIG_ARCH_SH7372) || \
-+ defined(CONFIG_ARCH_R8A7740)
-+
- # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc)
- # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73)
- # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0058-ARM-mach-shmobile-r8a7740-add-PFC-support.patch b/patches.armadillo800eva/0058-ARM-mach-shmobile-r8a7740-add-PFC-support.patch
deleted file mode 100644
index a1467cab10783b..00000000000000
--- a/patches.armadillo800eva/0058-ARM-mach-shmobile-r8a7740-add-PFC-support.patch
+++ /dev/null
@@ -1,2602 +0,0 @@
-From 4aae9084b4e456530984ae916fcd3c21f81c3e9b Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:46:08 -0800
-Subject: ARM: mach-shmobile: r8a7740: add PFC support.
-
-This adds PFC support for the R8A7740 (R-Mobile A1) CPU
-This patch is based on v0.1 manual
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 5ade0672f2a2142de216ca705692c9d3238ee650)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/pfc-r8a7740.c | 2562 ++++++++++++++++++++++++++++++++++
- 2 files changed, 2563 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/pfc-r8a7740.c
-
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index fdbae05..8c2067d 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -24,6 +24,7 @@ pfc-$(CONFIG_ARCH_SH7367) += pfc-sh7367.o
- pfc-$(CONFIG_ARCH_SH7377) += pfc-sh7377.o
- pfc-$(CONFIG_ARCH_SH7372) += pfc-sh7372.o
- pfc-$(CONFIG_ARCH_SH73A0) += pfc-sh73a0.o
-+pfc-$(CONFIG_ARCH_R8A7740) += pfc-r8a7740.o
-
- # IRQ objects
- obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
-diff --git a/arch/arm/mach-shmobile/pfc-r8a7740.c b/arch/arm/mach-shmobile/pfc-r8a7740.c
-new file mode 100644
-index 0000000..a4fff69
---- /dev/null
-+++ b/arch/arm/mach-shmobile/pfc-r8a7740.c
-@@ -0,0 +1,2562 @@
-+/*
-+ * R8A7740 processor support
-+ *
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; version 2 of the
-+ * License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/gpio.h>
-+#include <mach/r8a7740.h>
-+
-+#define CPU_ALL_PORT(fn, pfx, sfx) \
-+ PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
-+ PORT_10(fn, pfx##10, sfx), PORT_90(fn, pfx##1, sfx), \
-+ PORT_10(fn, pfx##20, sfx), \
-+ PORT_1(fn, pfx##210, sfx), PORT_1(fn, pfx##211, sfx)
-+
-+enum {
-+ PINMUX_RESERVED = 0,
-+
-+ /* PORT0_DATA -> PORT211_DATA */
-+ PINMUX_DATA_BEGIN,
-+ PORT_ALL(DATA),
-+ PINMUX_DATA_END,
-+
-+ /* PORT0_IN -> PORT211_IN */
-+ PINMUX_INPUT_BEGIN,
-+ PORT_ALL(IN),
-+ PINMUX_INPUT_END,
-+
-+ /* PORT0_IN_PU -> PORT211_IN_PU */
-+ PINMUX_INPUT_PULLUP_BEGIN,
-+ PORT_ALL(IN_PU),
-+ PINMUX_INPUT_PULLUP_END,
-+
-+ /* PORT0_IN_PD -> PORT211_IN_PD */
-+ PINMUX_INPUT_PULLDOWN_BEGIN,
-+ PORT_ALL(IN_PD),
-+ PINMUX_INPUT_PULLDOWN_END,
-+
-+ /* PORT0_OUT -> PORT211_OUT */
-+ PINMUX_OUTPUT_BEGIN,
-+ PORT_ALL(OUT),
-+ PINMUX_OUTPUT_END,
-+
-+ PINMUX_FUNCTION_BEGIN,
-+ PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT211_FN_IN */
-+ PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT211_FN_OUT */
-+ PORT_ALL(FN0), /* PORT0_FN0 -> PORT211_FN0 */
-+ PORT_ALL(FN1), /* PORT0_FN1 -> PORT211_FN1 */
-+ PORT_ALL(FN2), /* PORT0_FN2 -> PORT211_FN2 */
-+ PORT_ALL(FN3), /* PORT0_FN3 -> PORT211_FN3 */
-+ PORT_ALL(FN4), /* PORT0_FN4 -> PORT211_FN4 */
-+ PORT_ALL(FN5), /* PORT0_FN5 -> PORT211_FN5 */
-+ PORT_ALL(FN6), /* PORT0_FN6 -> PORT211_FN6 */
-+ PORT_ALL(FN7), /* PORT0_FN7 -> PORT211_FN7 */
-+
-+ MSEL1CR_31_0, MSEL1CR_31_1,
-+ MSEL1CR_30_0, MSEL1CR_30_1,
-+ MSEL1CR_29_0, MSEL1CR_29_1,
-+ MSEL1CR_28_0, MSEL1CR_28_1,
-+ MSEL1CR_27_0, MSEL1CR_27_1,
-+ MSEL1CR_26_0, MSEL1CR_26_1,
-+ MSEL1CR_16_0, MSEL1CR_16_1,
-+ MSEL1CR_15_0, MSEL1CR_15_1,
-+ MSEL1CR_14_0, MSEL1CR_14_1,
-+ MSEL1CR_13_0, MSEL1CR_13_1,
-+ MSEL1CR_12_0, MSEL1CR_12_1,
-+ MSEL1CR_9_0, MSEL1CR_9_1,
-+ MSEL1CR_7_0, MSEL1CR_7_1,
-+ MSEL1CR_6_0, MSEL1CR_6_1,
-+ MSEL1CR_5_0, MSEL1CR_5_1,
-+ MSEL1CR_4_0, MSEL1CR_4_1,
-+ MSEL1CR_3_0, MSEL1CR_3_1,
-+ MSEL1CR_2_0, MSEL1CR_2_1,
-+ MSEL1CR_0_0, MSEL1CR_0_1,
-+
-+ MSEL3CR_15_0, MSEL3CR_15_1, /* Trace / Debug ? */
-+ MSEL3CR_6_0, MSEL3CR_6_1,
-+
-+ MSEL4CR_19_0, MSEL4CR_19_1,
-+ MSEL4CR_18_0, MSEL4CR_18_1,
-+ MSEL4CR_15_0, MSEL4CR_15_1,
-+ MSEL4CR_10_0, MSEL4CR_10_1,
-+ MSEL4CR_6_0, MSEL4CR_6_1,
-+ MSEL4CR_4_0, MSEL4CR_4_1,
-+ MSEL4CR_1_0, MSEL4CR_1_1,
-+
-+ MSEL5CR_31_0, MSEL5CR_31_1, /* irq/fiq output */
-+ MSEL5CR_30_0, MSEL5CR_30_1,
-+ MSEL5CR_29_0, MSEL5CR_29_1,
-+ MSEL5CR_27_0, MSEL5CR_27_1,
-+ MSEL5CR_25_0, MSEL5CR_25_1,
-+ MSEL5CR_23_0, MSEL5CR_23_1,
-+ MSEL5CR_21_0, MSEL5CR_21_1,
-+ MSEL5CR_19_0, MSEL5CR_19_1,
-+ MSEL5CR_17_0, MSEL5CR_17_1,
-+ MSEL5CR_15_0, MSEL5CR_15_1,
-+ MSEL5CR_14_0, MSEL5CR_14_1,
-+ MSEL5CR_13_0, MSEL5CR_13_1,
-+ MSEL5CR_12_0, MSEL5CR_12_1,
-+ MSEL5CR_11_0, MSEL5CR_11_1,
-+ MSEL5CR_10_0, MSEL5CR_10_1,
-+ MSEL5CR_8_0, MSEL5CR_8_1,
-+ MSEL5CR_7_0, MSEL5CR_7_1,
-+ MSEL5CR_6_0, MSEL5CR_6_1,
-+ MSEL5CR_5_0, MSEL5CR_5_1,
-+ MSEL5CR_4_0, MSEL5CR_4_1,
-+ MSEL5CR_3_0, MSEL5CR_3_1,
-+ MSEL5CR_2_0, MSEL5CR_2_1,
-+ MSEL5CR_0_0, MSEL5CR_0_1,
-+ PINMUX_FUNCTION_END,
-+
-+ PINMUX_MARK_BEGIN,
-+
-+ /* IRQ */
-+ IRQ0_PORT2_MARK, IRQ0_PORT13_MARK,
-+ IRQ1_MARK,
-+ IRQ2_PORT11_MARK, IRQ2_PORT12_MARK,
-+ IRQ3_PORT10_MARK, IRQ3_PORT14_MARK,
-+ IRQ4_PORT15_MARK, IRQ4_PORT172_MARK,
-+ IRQ5_PORT0_MARK, IRQ5_PORT1_MARK,
-+ IRQ6_PORT121_MARK, IRQ6_PORT173_MARK,
-+ IRQ7_PORT120_MARK, IRQ7_PORT209_MARK,
-+ IRQ8_MARK,
-+ IRQ9_PORT118_MARK, IRQ9_PORT210_MARK,
-+ IRQ10_MARK,
-+ IRQ11_MARK,
-+ IRQ12_PORT42_MARK, IRQ12_PORT97_MARK,
-+ IRQ13_PORT64_MARK, IRQ13_PORT98_MARK,
-+ IRQ14_PORT63_MARK, IRQ14_PORT99_MARK,
-+ IRQ15_PORT62_MARK, IRQ15_PORT100_MARK,
-+ IRQ16_PORT68_MARK, IRQ16_PORT211_MARK,
-+ IRQ17_MARK,
-+ IRQ18_MARK,
-+ IRQ19_MARK,
-+ IRQ20_MARK,
-+ IRQ21_MARK,
-+ IRQ22_MARK,
-+ IRQ23_MARK,
-+ IRQ24_MARK,
-+ IRQ25_MARK,
-+ IRQ26_PORT58_MARK, IRQ26_PORT81_MARK,
-+ IRQ27_PORT57_MARK, IRQ27_PORT168_MARK,
-+ IRQ28_PORT56_MARK, IRQ28_PORT169_MARK,
-+ IRQ29_PORT50_MARK, IRQ29_PORT170_MARK,
-+ IRQ30_PORT49_MARK, IRQ30_PORT171_MARK,
-+ IRQ31_PORT41_MARK, IRQ31_PORT167_MARK,
-+
-+ /* Function */
-+
-+ /* DBGT */
-+ DBGMDT2_MARK, DBGMDT1_MARK, DBGMDT0_MARK,
-+ DBGMD10_MARK, DBGMD11_MARK, DBGMD20_MARK,
-+ DBGMD21_MARK,
-+
-+ /* FSI */
-+ FSIAISLD_PORT0_MARK, /* FSIAISLD Port 0/5 */
-+ FSIAISLD_PORT5_MARK,
-+ FSIASPDIF_PORT9_MARK, /* FSIASPDIF Port 9/18 */
-+ FSIASPDIF_PORT18_MARK,
-+ FSIAOSLD1_MARK, FSIAOSLD2_MARK, FSIAOLR_MARK,
-+ FSIAOBT_MARK, FSIAOSLD_MARK, FSIAOMC_MARK,
-+ FSIACK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
-+
-+ /* FMSI */
-+ FMSISLD_PORT1_MARK, /* FMSISLD Port 1/6 */
-+ FMSISLD_PORT6_MARK,
-+ FMSIILR_MARK, FMSIIBT_MARK, FMSIOLR_MARK, FMSIOBT_MARK,
-+ FMSICK_MARK, FMSOILR_MARK, FMSOIBT_MARK, FMSOOLR_MARK,
-+ FMSOOBT_MARK, FMSOSLD_MARK, FMSOCK_MARK,
-+
-+ /* SCIFA0 */
-+ SCIFA0_SCK_MARK, SCIFA0_CTS_MARK, SCIFA0_RTS_MARK,
-+ SCIFA0_RXD_MARK, SCIFA0_TXD_MARK,
-+
-+ /* SCIFA1 */
-+ SCIFA1_CTS_MARK, SCIFA1_SCK_MARK, SCIFA1_RXD_MARK,
-+ SCIFA1_TXD_MARK, SCIFA1_RTS_MARK,
-+
-+ /* SCIFA2 */
-+ SCIFA2_SCK_PORT22_MARK, /* SCIFA2_SCK Port 22/199 */
-+ SCIFA2_SCK_PORT199_MARK,
-+ SCIFA2_RXD_MARK, SCIFA2_TXD_MARK,
-+ SCIFA2_CTS_MARK, SCIFA2_RTS_MARK,
-+
-+ /* SCIFA3 */
-+ SCIFA3_RTS_PORT105_MARK, /* MSEL5CR_8_0 */
-+ SCIFA3_SCK_PORT116_MARK,
-+ SCIFA3_CTS_PORT117_MARK,
-+ SCIFA3_RXD_PORT174_MARK,
-+ SCIFA3_TXD_PORT175_MARK,
-+
-+ SCIFA3_RTS_PORT161_MARK, /* MSEL5CR_8_1 */
-+ SCIFA3_SCK_PORT158_MARK,
-+ SCIFA3_CTS_PORT162_MARK,
-+ SCIFA3_RXD_PORT159_MARK,
-+ SCIFA3_TXD_PORT160_MARK,
-+
-+ /* SCIFA4 */
-+ SCIFA4_RXD_PORT12_MARK, /* MSEL5CR[12:11] = 00 */
-+ SCIFA4_TXD_PORT13_MARK,
-+
-+ SCIFA4_RXD_PORT204_MARK, /* MSEL5CR[12:11] = 01 */
-+ SCIFA4_TXD_PORT203_MARK,
-+
-+ SCIFA4_RXD_PORT94_MARK, /* MSEL5CR[12:11] = 10 */
-+ SCIFA4_TXD_PORT93_MARK,
-+
-+ SCIFA4_SCK_PORT21_MARK, /* SCIFA4_SCK Port 21/205 */
-+ SCIFA4_SCK_PORT205_MARK,
-+
-+ /* SCIFA5 */
-+ SCIFA5_TXD_PORT20_MARK, /* MSEL5CR[15:14] = 00 */
-+ SCIFA5_RXD_PORT10_MARK,
-+
-+ SCIFA5_RXD_PORT207_MARK, /* MSEL5CR[15:14] = 01 */
-+ SCIFA5_TXD_PORT208_MARK,
-+
-+ SCIFA5_TXD_PORT91_MARK, /* MSEL5CR[15:14] = 10 */
-+ SCIFA5_RXD_PORT92_MARK,
-+
-+ SCIFA5_SCK_PORT23_MARK, /* SCIFA5_SCK Port 23/206 */
-+ SCIFA5_SCK_PORT206_MARK,
-+
-+ /* SCIFA6 */
-+ SCIFA6_SCK_MARK, SCIFA6_RXD_MARK, SCIFA6_TXD_MARK,
-+
-+ /* SCIFA7 */
-+ SCIFA7_TXD_MARK, SCIFA7_RXD_MARK,
-+
-+ /* SCIFAB */
-+ SCIFB_SCK_PORT190_MARK, /* MSEL5CR_17_0 */
-+ SCIFB_RXD_PORT191_MARK,
-+ SCIFB_TXD_PORT192_MARK,
-+ SCIFB_RTS_PORT186_MARK,
-+ SCIFB_CTS_PORT187_MARK,
-+
-+ SCIFB_SCK_PORT2_MARK, /* MSEL5CR_17_1 */
-+ SCIFB_RXD_PORT3_MARK,
-+ SCIFB_TXD_PORT4_MARK,
-+ SCIFB_RTS_PORT172_MARK,
-+ SCIFB_CTS_PORT173_MARK,
-+
-+ /* LCD0 */
-+ LCDC0_SELECT_MARK,
-+
-+ LCD0_D0_MARK, LCD0_D1_MARK, LCD0_D2_MARK, LCD0_D3_MARK,
-+ LCD0_D4_MARK, LCD0_D5_MARK, LCD0_D6_MARK, LCD0_D7_MARK,
-+ LCD0_D8_MARK, LCD0_D9_MARK, LCD0_D10_MARK, LCD0_D11_MARK,
-+ LCD0_D12_MARK, LCD0_D13_MARK, LCD0_D14_MARK, LCD0_D15_MARK,
-+ LCD0_D16_MARK, LCD0_D17_MARK,
-+ LCD0_DON_MARK, LCD0_VCPWC_MARK, LCD0_VEPWC_MARK,
-+ LCD0_DCK_MARK, LCD0_VSYN_MARK, /* for RGB */
-+ LCD0_HSYN_MARK, LCD0_DISP_MARK, /* for RGB */
-+ LCD0_WR_MARK, LCD0_RD_MARK, /* for SYS */
-+ LCD0_CS_MARK, LCD0_RS_MARK, /* for SYS */
-+
-+ LCD0_D21_PORT158_MARK, LCD0_D23_PORT159_MARK, /* MSEL5CR_6_1 */
-+ LCD0_D22_PORT160_MARK, LCD0_D20_PORT161_MARK,
-+ LCD0_D19_PORT162_MARK, LCD0_D18_PORT163_MARK,
-+ LCD0_LCLK_PORT165_MARK,
-+
-+ LCD0_D18_PORT40_MARK, LCD0_D22_PORT0_MARK, /* MSEL5CR_6_0 */
-+ LCD0_D23_PORT1_MARK, LCD0_D21_PORT2_MARK,
-+ LCD0_D20_PORT3_MARK, LCD0_D19_PORT4_MARK,
-+ LCD0_LCLK_PORT102_MARK,
-+
-+ /* LCD1 */
-+ LCDC1_SELECT_MARK,
-+
-+ LCD1_D0_MARK, LCD1_D1_MARK, LCD1_D2_MARK, LCD1_D3_MARK,
-+ LCD1_D4_MARK, LCD1_D5_MARK, LCD1_D6_MARK, LCD1_D7_MARK,
-+ LCD1_D8_MARK, LCD1_D9_MARK, LCD1_D10_MARK, LCD1_D11_MARK,
-+ LCD1_D12_MARK, LCD1_D13_MARK, LCD1_D14_MARK, LCD1_D15_MARK,
-+ LCD1_D16_MARK, LCD1_D17_MARK, LCD1_D18_MARK, LCD1_D19_MARK,
-+ LCD1_D20_MARK, LCD1_D21_MARK, LCD1_D22_MARK, LCD1_D23_MARK,
-+ LCD1_DON_MARK, LCD1_VCPWC_MARK,
-+ LCD1_LCLK_MARK, LCD1_VEPWC_MARK,
-+
-+ LCD1_DCK_MARK, LCD1_VSYN_MARK, /* for RGB */
-+ LCD1_HSYN_MARK, LCD1_DISP_MARK, /* for RGB */
-+ LCD1_RS_MARK, LCD1_CS_MARK, /* for SYS */
-+ LCD1_RD_MARK, LCD1_WR_MARK, /* for SYS */
-+
-+ /* RSPI */
-+ RSPI_SSL0_A_MARK, RSPI_SSL1_A_MARK, RSPI_SSL2_A_MARK,
-+ RSPI_SSL3_A_MARK, RSPI_CK_A_MARK, RSPI_MOSI_A_MARK,
-+ RSPI_MISO_A_MARK,
-+
-+ /* VIO CKO */
-+ VIO_CKO1_MARK, /* needs fixup */
-+ VIO_CKO2_MARK,
-+ VIO_CKO_1_MARK,
-+ VIO_CKO_MARK,
-+
-+ /* VIO0 */
-+ VIO0_D0_MARK, VIO0_D1_MARK, VIO0_D2_MARK, VIO0_D3_MARK,
-+ VIO0_D4_MARK, VIO0_D5_MARK, VIO0_D6_MARK, VIO0_D7_MARK,
-+ VIO0_D8_MARK, VIO0_D9_MARK, VIO0_D10_MARK, VIO0_D11_MARK,
-+ VIO0_D12_MARK, VIO0_VD_MARK, VIO0_HD_MARK, VIO0_CLK_MARK,
-+ VIO0_FIELD_MARK,
-+
-+ VIO0_D13_PORT26_MARK, /* MSEL5CR_27_0 */
-+ VIO0_D14_PORT25_MARK,
-+ VIO0_D15_PORT24_MARK,
-+
-+ VIO0_D13_PORT22_MARK, /* MSEL5CR_27_1 */
-+ VIO0_D14_PORT95_MARK,
-+ VIO0_D15_PORT96_MARK,
-+
-+ /* VIO1 */
-+ VIO1_D0_MARK, VIO1_D1_MARK, VIO1_D2_MARK, VIO1_D3_MARK,
-+ VIO1_D4_MARK, VIO1_D5_MARK, VIO1_D6_MARK, VIO1_D7_MARK,
-+ VIO1_VD_MARK, VIO1_HD_MARK, VIO1_CLK_MARK, VIO1_FIELD_MARK,
-+
-+ /* TPU0 */
-+ TPU0TO0_MARK, TPU0TO1_MARK, TPU0TO3_MARK,
-+ TPU0TO2_PORT66_MARK, /* TPU0TO2 Port 66/202 */
-+ TPU0TO2_PORT202_MARK,
-+
-+ /* SSP1 0 */
-+ STP0_IPD0_MARK, STP0_IPD1_MARK, STP0_IPD2_MARK, STP0_IPD3_MARK,
-+ STP0_IPD4_MARK, STP0_IPD5_MARK, STP0_IPD6_MARK, STP0_IPD7_MARK,
-+ STP0_IPEN_MARK, STP0_IPCLK_MARK, STP0_IPSYNC_MARK,
-+
-+ /* SSP1 1 */
-+ STP1_IPD1_MARK, STP1_IPD2_MARK, STP1_IPD3_MARK, STP1_IPD4_MARK,
-+ STP1_IPD5_MARK, STP1_IPD6_MARK, STP1_IPD7_MARK, STP1_IPCLK_MARK,
-+ STP1_IPSYNC_MARK,
-+
-+ STP1_IPD0_PORT186_MARK, /* MSEL5CR_23_0 */
-+ STP1_IPEN_PORT187_MARK,
-+
-+ STP1_IPD0_PORT194_MARK, /* MSEL5CR_23_1 */
-+ STP1_IPEN_PORT193_MARK,
-+
-+ /* SIM */
-+ SIM_RST_MARK, SIM_CLK_MARK,
-+ SIM_D_PORT22_MARK, /* SIM_D Port 22/199 */
-+ SIM_D_PORT199_MARK,
-+
-+ /* SDHI0 */
-+ SDHI0_D0_MARK, SDHI0_D1_MARK, SDHI0_D2_MARK, SDHI0_D3_MARK,
-+ SDHI0_CD_MARK, SDHI0_WP_MARK, SDHI0_CMD_MARK, SDHI0_CLK_MARK,
-+
-+ /* SDHI1 */
-+ SDHI1_D0_MARK, SDHI1_D1_MARK, SDHI1_D2_MARK, SDHI1_D3_MARK,
-+ SDHI1_CD_MARK, SDHI1_WP_MARK, SDHI1_CMD_MARK, SDHI1_CLK_MARK,
-+
-+ /* SDHI2 */
-+ SDHI2_D0_MARK, SDHI2_D1_MARK, SDHI2_D2_MARK, SDHI2_D3_MARK,
-+ SDHI2_CLK_MARK, SDHI2_CMD_MARK,
-+
-+ SDHI2_CD_PORT24_MARK, /* MSEL5CR_19_0 */
-+ SDHI2_WP_PORT25_MARK,
-+
-+ SDHI2_WP_PORT177_MARK, /* MSEL5CR_19_1 */
-+ SDHI2_CD_PORT202_MARK,
-+
-+ /* MSIOF2 */
-+ MSIOF2_TXD_MARK, MSIOF2_RXD_MARK, MSIOF2_TSCK_MARK,
-+ MSIOF2_SS2_MARK, MSIOF2_TSYNC_MARK, MSIOF2_SS1_MARK,
-+ MSIOF2_MCK1_MARK, MSIOF2_MCK0_MARK, MSIOF2_RSYNC_MARK,
-+ MSIOF2_RSCK_MARK,
-+
-+ /* KEYSC */
-+ KEYIN4_MARK, KEYIN5_MARK, KEYIN6_MARK, KEYIN7_MARK,
-+ KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
-+ KEYOUT4_MARK, KEYOUT5_MARK, KEYOUT6_MARK, KEYOUT7_MARK,
-+
-+ KEYIN0_PORT43_MARK, /* MSEL4CR_18_0 */
-+ KEYIN1_PORT44_MARK,
-+ KEYIN2_PORT45_MARK,
-+ KEYIN3_PORT46_MARK,
-+
-+ KEYIN0_PORT58_MARK, /* MSEL4CR_18_1 */
-+ KEYIN1_PORT57_MARK,
-+ KEYIN2_PORT56_MARK,
-+ KEYIN3_PORT55_MARK,
-+
-+ /* VOU */
-+ DV_D0_MARK, DV_D1_MARK, DV_D2_MARK, DV_D3_MARK,
-+ DV_D4_MARK, DV_D5_MARK, DV_D6_MARK, DV_D7_MARK,
-+ DV_D8_MARK, DV_D9_MARK, DV_D10_MARK, DV_D11_MARK,
-+ DV_D12_MARK, DV_D13_MARK, DV_D14_MARK, DV_D15_MARK,
-+ DV_CLK_MARK, DV_VSYNC_MARK, DV_HSYNC_MARK,
-+
-+ /* MEMC */
-+ MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK, MEMC_AD3_MARK,
-+ MEMC_AD4_MARK, MEMC_AD5_MARK, MEMC_AD6_MARK, MEMC_AD7_MARK,
-+ MEMC_AD8_MARK, MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
-+ MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK, MEMC_AD15_MARK,
-+ MEMC_CS0_MARK, MEMC_INT_MARK, MEMC_NWE_MARK, MEMC_NOE_MARK,
-+
-+ MEMC_CS1_MARK, /* MSEL4CR_6_0 */
-+ MEMC_ADV_MARK,
-+ MEMC_WAIT_MARK,
-+ MEMC_BUSCLK_MARK,
-+
-+ MEMC_A1_MARK, /* MSEL4CR_6_1 */
-+ MEMC_DREQ0_MARK,
-+ MEMC_DREQ1_MARK,
-+ MEMC_A0_MARK,
-+
-+ /* MMC */
-+ MMC0_D0_PORT68_MARK, MMC0_D1_PORT69_MARK, MMC0_D2_PORT70_MARK,
-+ MMC0_D3_PORT71_MARK, MMC0_D4_PORT72_MARK, MMC0_D5_PORT73_MARK,
-+ MMC0_D6_PORT74_MARK, MMC0_D7_PORT75_MARK, MMC0_CLK_PORT66_MARK,
-+ MMC0_CMD_PORT67_MARK, /* MSEL4CR_15_0 */
-+
-+ MMC1_D0_PORT149_MARK, MMC1_D1_PORT148_MARK, MMC1_D2_PORT147_MARK,
-+ MMC1_D3_PORT146_MARK, MMC1_D4_PORT145_MARK, MMC1_D5_PORT144_MARK,
-+ MMC1_D6_PORT143_MARK, MMC1_D7_PORT142_MARK, MMC1_CLK_PORT103_MARK,
-+ MMC1_CMD_PORT104_MARK, /* MSEL4CR_15_1 */
-+
-+ /* MSIOF0 */
-+ MSIOF0_SS1_MARK, MSIOF0_SS2_MARK, MSIOF0_RXD_MARK,
-+ MSIOF0_TXD_MARK, MSIOF0_MCK0_MARK, MSIOF0_MCK1_MARK,
-+ MSIOF0_RSYNC_MARK, MSIOF0_RSCK_MARK, MSIOF0_TSCK_MARK,
-+ MSIOF0_TSYNC_MARK,
-+
-+ /* MSIOF1 */
-+ MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
-+ MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
-+
-+ MSIOF1_SS2_PORT116_MARK, MSIOF1_SS1_PORT117_MARK,
-+ MSIOF1_RXD_PORT118_MARK, MSIOF1_TXD_PORT119_MARK,
-+ MSIOF1_TSYNC_PORT120_MARK,
-+ MSIOF1_TSCK_PORT121_MARK, /* MSEL4CR_10_0 */
-+
-+ MSIOF1_SS1_PORT67_MARK, MSIOF1_TSCK_PORT72_MARK,
-+ MSIOF1_TSYNC_PORT73_MARK, MSIOF1_TXD_PORT74_MARK,
-+ MSIOF1_RXD_PORT75_MARK,
-+ MSIOF1_SS2_PORT202_MARK, /* MSEL4CR_10_1 */
-+
-+ /* GPIO */
-+ GPO0_MARK, GPI0_MARK, GPO1_MARK, GPI1_MARK,
-+
-+ /* USB0 */
-+ USB0_OCI_MARK, USB0_PPON_MARK, VBUS_MARK,
-+
-+ /* USB1 */
-+ USB1_OCI_MARK, USB1_PPON_MARK,
-+
-+ /* BBIF1 */
-+ BBIF1_RXD_MARK, BBIF1_TXD_MARK, BBIF1_TSYNC_MARK,
-+ BBIF1_TSCK_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
-+ BBIF1_FLOW_MARK, BBIF1_RX_FLOW_N_MARK,
-+
-+ /* BBIF2 */
-+ BBIF2_TXD2_PORT5_MARK, /* MSEL5CR_0_0 */
-+ BBIF2_RXD2_PORT60_MARK,
-+ BBIF2_TSYNC2_PORT6_MARK,
-+ BBIF2_TSCK2_PORT59_MARK,
-+
-+ BBIF2_RXD2_PORT90_MARK, /* MSEL5CR_0_1 */
-+ BBIF2_TXD2_PORT183_MARK,
-+ BBIF2_TSCK2_PORT89_MARK,
-+ BBIF2_TSYNC2_PORT184_MARK,
-+
-+ /* BSC / FLCTL / PCMCIA */
-+ CS0_MARK, CS2_MARK, CS4_MARK,
-+ CS5B_MARK, CS6A_MARK,
-+ CS5A_PORT105_MARK, /* CS5A PORT 19/105 */
-+ CS5A_PORT19_MARK,
-+ IOIS16_MARK, /* ? */
-+
-+ A0_MARK, A1_MARK, A2_MARK, A3_MARK,
-+ A4_FOE_MARK, /* share with FLCTL */
-+ A5_FCDE_MARK, /* share with FLCTL */
-+ A6_MARK, A7_MARK, A8_MARK, A9_MARK,
-+ A10_MARK, A11_MARK, A12_MARK, A13_MARK,
-+ A14_MARK, A15_MARK, A16_MARK, A17_MARK,
-+ A18_MARK, A19_MARK, A20_MARK, A21_MARK,
-+ A22_MARK, A23_MARK, A24_MARK, A25_MARK,
-+ A26_MARK,
-+
-+ D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, /* share with FLCTL */
-+ D3_NAF3_MARK, D4_NAF4_MARK, D5_NAF5_MARK, /* share with FLCTL */
-+ D6_NAF6_MARK, D7_NAF7_MARK, D8_NAF8_MARK, /* share with FLCTL */
-+ D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK, /* share with FLCTL */
-+ D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, /* share with FLCTL */
-+ D15_NAF15_MARK, /* share with FLCTL */
-+ D16_MARK, D17_MARK, D18_MARK, D19_MARK,
-+ D20_MARK, D21_MARK, D22_MARK, D23_MARK,
-+ D24_MARK, D25_MARK, D26_MARK, D27_MARK,
-+ D28_MARK, D29_MARK, D30_MARK, D31_MARK,
-+
-+ WE0_FWE_MARK, /* share with FLCTL */
-+ WE1_MARK,
-+ WE2_ICIORD_MARK, /* share with PCMCIA */
-+ WE3_ICIOWR_MARK, /* share with PCMCIA */
-+ CKO_MARK, BS_MARK, RDWR_MARK,
-+ RD_FSC_MARK, /* share with FLCTL */
-+ WAIT_PORT177_MARK, /* WAIT Port 90/177 */
-+ WAIT_PORT90_MARK,
-+
-+ FCE0_MARK, FCE1_MARK, FRB_MARK, /* FLCTL */
-+
-+ /* IRDA */
-+ IRDA_FIRSEL_MARK, IRDA_IN_MARK, IRDA_OUT_MARK,
-+
-+ /* ATAPI */
-+ IDE_D0_MARK, IDE_D1_MARK, IDE_D2_MARK, IDE_D3_MARK,
-+ IDE_D4_MARK, IDE_D5_MARK, IDE_D6_MARK, IDE_D7_MARK,
-+ IDE_D8_MARK, IDE_D9_MARK, IDE_D10_MARK, IDE_D11_MARK,
-+ IDE_D12_MARK, IDE_D13_MARK, IDE_D14_MARK, IDE_D15_MARK,
-+ IDE_A0_MARK, IDE_A1_MARK, IDE_A2_MARK, IDE_CS0_MARK,
-+ IDE_CS1_MARK, IDE_IOWR_MARK, IDE_IORD_MARK, IDE_IORDY_MARK,
-+ IDE_INT_MARK, IDE_RST_MARK, IDE_DIRECTION_MARK,
-+ IDE_EXBUF_ENB_MARK, IDE_IODACK_MARK, IDE_IODREQ_MARK,
-+
-+ /* RMII */
-+ RMII_CRS_DV_MARK, RMII_RX_ER_MARK, RMII_RXD0_MARK,
-+ RMII_RXD1_MARK, RMII_TX_EN_MARK, RMII_TXD0_MARK,
-+ RMII_MDC_MARK, RMII_TXD1_MARK, RMII_MDIO_MARK,
-+ RMII_REF50CK_MARK, /* for RMII */
-+ RMII_REF125CK_MARK, /* for GMII */
-+
-+ /* GEther */
-+ ET_TX_CLK_MARK, ET_TX_EN_MARK, ET_ETXD0_MARK, ET_ETXD1_MARK,
-+ ET_ETXD2_MARK, ET_ETXD3_MARK,
-+ ET_ETXD4_MARK, ET_ETXD5_MARK, /* for GEther */
-+ ET_ETXD6_MARK, ET_ETXD7_MARK, /* for GEther */
-+ ET_COL_MARK, ET_TX_ER_MARK, ET_RX_CLK_MARK, ET_RX_DV_MARK,
-+ ET_ERXD0_MARK, ET_ERXD1_MARK, ET_ERXD2_MARK, ET_ERXD3_MARK,
-+ ET_ERXD4_MARK, ET_ERXD5_MARK, /* for GEther */
-+ ET_ERXD6_MARK, ET_ERXD7_MARK, /* for GEther */
-+ ET_RX_ER_MARK, ET_CRS_MARK, ET_MDC_MARK, ET_MDIO_MARK,
-+ ET_LINK_MARK, ET_PHY_INT_MARK, ET_WOL_MARK, ET_GTX_CLK_MARK,
-+
-+ /* DMA0 */
-+ DREQ0_MARK, DACK0_MARK,
-+
-+ /* DMA1 */
-+ DREQ1_MARK, DACK1_MARK,
-+
-+ /* SYSC */
-+ RESETOUTS_MARK, RESETP_PULLUP_MARK, RESETP_PLAIN_MARK,
-+
-+ /* IRREM */
-+ IROUT_MARK,
-+
-+ /* SDENC */
-+ SDENC_CPG_MARK, SDENC_DV_CLKI_MARK,
-+
-+ /* DEBUG */
-+ EDEBGREQ_PULLUP_MARK, /* for JTAG */
-+ EDEBGREQ_PULLDOWN_MARK,
-+
-+ TRACEAUD_FROM_VIO_MARK, /* for TRACE/AUD */
-+ TRACEAUD_FROM_LCDC0_MARK,
-+ TRACEAUD_FROM_MEMC_MARK,
-+
-+ PINMUX_MARK_END,
-+};
-+
-+static pinmux_enum_t pinmux_data[] = {
-+ /* specify valid pin states for each pin in GPIO mode */
-+
-+ /* I/O and Pull U/D */
-+ PORT_DATA_IO_PD(0), PORT_DATA_IO_PD(1),
-+ PORT_DATA_IO_PD(2), PORT_DATA_IO_PD(3),
-+ PORT_DATA_IO_PD(4), PORT_DATA_IO_PD(5),
-+ PORT_DATA_IO_PD(6), PORT_DATA_IO(7),
-+ PORT_DATA_IO(8), PORT_DATA_IO(9),
-+
-+ PORT_DATA_IO_PD(10), PORT_DATA_IO_PD(11),
-+ PORT_DATA_IO_PD(12), PORT_DATA_IO_PU_PD(13),
-+ PORT_DATA_IO_PD(14), PORT_DATA_IO_PD(15),
-+ PORT_DATA_IO_PD(16), PORT_DATA_IO_PD(17),
-+ PORT_DATA_IO(18), PORT_DATA_IO_PU(19),
-+
-+ PORT_DATA_IO_PU_PD(20), PORT_DATA_IO_PD(21),
-+ PORT_DATA_IO_PU_PD(22), PORT_DATA_IO(23),
-+ PORT_DATA_IO_PU(24), PORT_DATA_IO_PU(25),
-+ PORT_DATA_IO_PU(26), PORT_DATA_IO_PU(27),
-+ PORT_DATA_IO_PU(28), PORT_DATA_IO_PU(29),
-+
-+ PORT_DATA_IO_PU(30), PORT_DATA_IO_PD(31),
-+ PORT_DATA_IO_PD(32), PORT_DATA_IO_PD(33),
-+ PORT_DATA_IO_PD(34), PORT_DATA_IO_PU(35),
-+ PORT_DATA_IO_PU(36), PORT_DATA_IO_PD(37),
-+ PORT_DATA_IO_PU(38), PORT_DATA_IO_PD(39),
-+
-+ PORT_DATA_IO_PU_PD(40), PORT_DATA_IO_PD(41),
-+ PORT_DATA_IO_PD(42), PORT_DATA_IO_PU_PD(43),
-+ PORT_DATA_IO_PU_PD(44), PORT_DATA_IO_PU_PD(45),
-+ PORT_DATA_IO_PU_PD(46), PORT_DATA_IO_PU_PD(47),
-+ PORT_DATA_IO_PU_PD(48), PORT_DATA_IO_PU_PD(49),
-+
-+ PORT_DATA_IO_PU_PD(50), PORT_DATA_IO_PD(51),
-+ PORT_DATA_IO_PD(52), PORT_DATA_IO_PD(53),
-+ PORT_DATA_IO_PD(54), PORT_DATA_IO_PU_PD(55),
-+ PORT_DATA_IO_PU_PD(56), PORT_DATA_IO_PU_PD(57),
-+ PORT_DATA_IO_PU_PD(58), PORT_DATA_IO_PU_PD(59),
-+
-+ PORT_DATA_IO_PU_PD(60), PORT_DATA_IO_PD(61),
-+ PORT_DATA_IO_PD(62), PORT_DATA_IO_PD(63),
-+ PORT_DATA_IO_PD(64), PORT_DATA_IO_PD(65),
-+ PORT_DATA_IO_PU_PD(66), PORT_DATA_IO_PU_PD(67),
-+ PORT_DATA_IO_PU_PD(68), PORT_DATA_IO_PU_PD(69),
-+
-+ PORT_DATA_IO_PU_PD(70), PORT_DATA_IO_PU_PD(71),
-+ PORT_DATA_IO_PU_PD(72), PORT_DATA_IO_PU_PD(73),
-+ PORT_DATA_IO_PU_PD(74), PORT_DATA_IO_PU_PD(75),
-+ PORT_DATA_IO_PU_PD(76), PORT_DATA_IO_PU_PD(77),
-+ PORT_DATA_IO_PU_PD(78), PORT_DATA_IO_PU_PD(79),
-+
-+ PORT_DATA_IO_PU_PD(80), PORT_DATA_IO_PU_PD(81),
-+ PORT_DATA_IO(82), PORT_DATA_IO_PU_PD(83),
-+ PORT_DATA_IO(84), PORT_DATA_IO_PD(85),
-+ PORT_DATA_IO_PD(86), PORT_DATA_IO_PD(87),
-+ PORT_DATA_IO_PD(88), PORT_DATA_IO_PD(89),
-+
-+ PORT_DATA_IO_PD(90), PORT_DATA_IO_PU_PD(91),
-+ PORT_DATA_IO_PU_PD(92), PORT_DATA_IO_PU_PD(93),
-+ PORT_DATA_IO_PU_PD(94), PORT_DATA_IO_PU_PD(95),
-+ PORT_DATA_IO_PU_PD(96), PORT_DATA_IO_PU_PD(97),
-+ PORT_DATA_IO_PU_PD(98), PORT_DATA_IO_PU_PD(99),
-+
-+ PORT_DATA_IO_PU_PD(100), PORT_DATA_IO(101),
-+ PORT_DATA_IO_PU(102), PORT_DATA_IO_PU_PD(103),
-+ PORT_DATA_IO_PU(104), PORT_DATA_IO_PU(105),
-+ PORT_DATA_IO_PU_PD(106), PORT_DATA_IO(107),
-+ PORT_DATA_IO(108), PORT_DATA_IO(109),
-+
-+ PORT_DATA_IO(110), PORT_DATA_IO(111),
-+ PORT_DATA_IO(112), PORT_DATA_IO(113),
-+ PORT_DATA_IO_PU_PD(114), PORT_DATA_IO(115),
-+ PORT_DATA_IO_PD(116), PORT_DATA_IO_PD(117),
-+ PORT_DATA_IO_PD(118), PORT_DATA_IO_PD(119),
-+
-+ PORT_DATA_IO_PD(120), PORT_DATA_IO_PD(121),
-+ PORT_DATA_IO_PD(122), PORT_DATA_IO_PD(123),
-+ PORT_DATA_IO_PD(124), PORT_DATA_IO(125),
-+ PORT_DATA_IO(126), PORT_DATA_IO(127),
-+ PORT_DATA_IO(128), PORT_DATA_IO(129),
-+
-+ PORT_DATA_IO(130), PORT_DATA_IO(131),
-+ PORT_DATA_IO(132), PORT_DATA_IO(133),
-+ PORT_DATA_IO(134), PORT_DATA_IO(135),
-+ PORT_DATA_IO(136), PORT_DATA_IO(137),
-+ PORT_DATA_IO(138), PORT_DATA_IO(139),
-+
-+ PORT_DATA_IO(140), PORT_DATA_IO(141),
-+ PORT_DATA_IO_PU(142), PORT_DATA_IO_PU(143),
-+ PORT_DATA_IO_PU(144), PORT_DATA_IO_PU(145),
-+ PORT_DATA_IO_PU(146), PORT_DATA_IO_PU(147),
-+ PORT_DATA_IO_PU(148), PORT_DATA_IO_PU(149),
-+
-+ PORT_DATA_IO_PU(150), PORT_DATA_IO_PU(151),
-+ PORT_DATA_IO_PU(152), PORT_DATA_IO_PU(153),
-+ PORT_DATA_IO_PU(154), PORT_DATA_IO_PU(155),
-+ PORT_DATA_IO_PU(156), PORT_DATA_IO_PU(157),
-+ PORT_DATA_IO_PD(158), PORT_DATA_IO_PD(159),
-+
-+ PORT_DATA_IO_PU_PD(160), PORT_DATA_IO_PD(161),
-+ PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163),
-+ PORT_DATA_IO_PD(164), PORT_DATA_IO_PD(165),
-+ PORT_DATA_IO_PU(166), PORT_DATA_IO_PU(167),
-+ PORT_DATA_IO_PU(168), PORT_DATA_IO_PU(169),
-+
-+ PORT_DATA_IO_PU(170), PORT_DATA_IO_PU(171),
-+ PORT_DATA_IO_PD(172), PORT_DATA_IO_PD(173),
-+ PORT_DATA_IO_PD(174), PORT_DATA_IO_PD(175),
-+ PORT_DATA_IO_PU(176), PORT_DATA_IO_PU_PD(177),
-+ PORT_DATA_IO_PU(178), PORT_DATA_IO_PD(179),
-+
-+ PORT_DATA_IO_PD(180), PORT_DATA_IO_PU(181),
-+ PORT_DATA_IO_PU(182), PORT_DATA_IO(183),
-+ PORT_DATA_IO_PD(184), PORT_DATA_IO_PD(185),
-+ PORT_DATA_IO_PD(186), PORT_DATA_IO_PD(187),
-+ PORT_DATA_IO_PD(188), PORT_DATA_IO_PD(189),
-+
-+ PORT_DATA_IO_PD(190), PORT_DATA_IO_PD(191),
-+ PORT_DATA_IO_PD(192), PORT_DATA_IO_PU_PD(193),
-+ PORT_DATA_IO_PU_PD(194), PORT_DATA_IO_PD(195),
-+ PORT_DATA_IO_PU_PD(196), PORT_DATA_IO_PD(197),
-+ PORT_DATA_IO_PU_PD(198), PORT_DATA_IO_PU_PD(199),
-+
-+ PORT_DATA_IO_PU_PD(200), PORT_DATA_IO_PU(201),
-+ PORT_DATA_IO_PU_PD(202), PORT_DATA_IO(203),
-+ PORT_DATA_IO_PU_PD(204), PORT_DATA_IO_PU_PD(205),
-+ PORT_DATA_IO_PU_PD(206), PORT_DATA_IO_PU_PD(207),
-+ PORT_DATA_IO_PU_PD(208), PORT_DATA_IO_PD(209),
-+
-+ PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
-+
-+ /* Port0 */
-+ PINMUX_DATA(DBGMDT2_MARK, PORT0_FN1),
-+ PINMUX_DATA(FSIAISLD_PORT0_MARK, PORT0_FN2, MSEL5CR_3_0),
-+ PINMUX_DATA(FSIAOSLD1_MARK, PORT0_FN3),
-+ PINMUX_DATA(LCD0_D22_PORT0_MARK, PORT0_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(SCIFA7_RXD_MARK, PORT0_FN6),
-+ PINMUX_DATA(LCD1_D4_MARK, PORT0_FN7),
-+ PINMUX_DATA(IRQ5_PORT0_MARK, PORT0_FN0, MSEL1CR_5_0),
-+
-+ /* Port1 */
-+ PINMUX_DATA(DBGMDT1_MARK, PORT1_FN1),
-+ PINMUX_DATA(FMSISLD_PORT1_MARK, PORT1_FN2, MSEL5CR_5_0),
-+ PINMUX_DATA(FSIAOSLD2_MARK, PORT1_FN3),
-+ PINMUX_DATA(LCD0_D23_PORT1_MARK, PORT1_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(SCIFA7_TXD_MARK, PORT1_FN6),
-+ PINMUX_DATA(LCD1_D3_MARK, PORT1_FN7),
-+ PINMUX_DATA(IRQ5_PORT1_MARK, PORT1_FN0, MSEL1CR_5_1),
-+
-+ /* Port2 */
-+ PINMUX_DATA(DBGMDT0_MARK, PORT2_FN1),
-+ PINMUX_DATA(SCIFB_SCK_PORT2_MARK, PORT2_FN2, MSEL5CR_17_1),
-+ PINMUX_DATA(LCD0_D21_PORT2_MARK, PORT2_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(LCD1_D2_MARK, PORT2_FN7),
-+ PINMUX_DATA(IRQ0_PORT2_MARK, PORT2_FN0, MSEL1CR_0_1),
-+
-+ /* Port3 */
-+ PINMUX_DATA(DBGMD21_MARK, PORT3_FN1),
-+ PINMUX_DATA(SCIFB_RXD_PORT3_MARK, PORT3_FN2, MSEL5CR_17_1),
-+ PINMUX_DATA(LCD0_D20_PORT3_MARK, PORT3_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(LCD1_D1_MARK, PORT3_FN7),
-+
-+ /* Port4 */
-+ PINMUX_DATA(DBGMD20_MARK, PORT4_FN1),
-+ PINMUX_DATA(SCIFB_TXD_PORT4_MARK, PORT4_FN2, MSEL5CR_17_1),
-+ PINMUX_DATA(LCD0_D19_PORT4_MARK, PORT4_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(LCD1_D0_MARK, PORT4_FN7),
-+
-+ /* Port5 */
-+ PINMUX_DATA(DBGMD11_MARK, PORT5_FN1),
-+ PINMUX_DATA(BBIF2_TXD2_PORT5_MARK, PORT5_FN2, MSEL5CR_0_0),
-+ PINMUX_DATA(FSIAISLD_PORT5_MARK, PORT5_FN4, MSEL5CR_3_1),
-+ PINMUX_DATA(RSPI_SSL0_A_MARK, PORT5_FN6),
-+ PINMUX_DATA(LCD1_VCPWC_MARK, PORT5_FN7),
-+
-+ /* Port6 */
-+ PINMUX_DATA(DBGMD10_MARK, PORT6_FN1),
-+ PINMUX_DATA(BBIF2_TSYNC2_PORT6_MARK, PORT6_FN2, MSEL5CR_0_0),
-+ PINMUX_DATA(FMSISLD_PORT6_MARK, PORT6_FN4, MSEL5CR_5_1),
-+ PINMUX_DATA(RSPI_SSL1_A_MARK, PORT6_FN6),
-+ PINMUX_DATA(LCD1_VEPWC_MARK, PORT6_FN7),
-+
-+ /* Port7 */
-+ PINMUX_DATA(FSIAOLR_MARK, PORT7_FN1),
-+
-+ /* Port8 */
-+ PINMUX_DATA(FSIAOBT_MARK, PORT8_FN1),
-+
-+ /* Port9 */
-+ PINMUX_DATA(FSIAOSLD_MARK, PORT9_FN1),
-+ PINMUX_DATA(FSIASPDIF_PORT9_MARK, PORT9_FN2, MSEL5CR_4_0),
-+
-+ /* Port10 */
-+ PINMUX_DATA(FSIAOMC_MARK, PORT10_FN1),
-+ PINMUX_DATA(SCIFA5_RXD_PORT10_MARK, PORT10_FN3, MSEL5CR_14_0, MSEL5CR_15_0),
-+ PINMUX_DATA(IRQ3_PORT10_MARK, PORT10_FN0, MSEL1CR_3_0),
-+
-+ /* Port11 */
-+ PINMUX_DATA(FSIACK_MARK, PORT11_FN1),
-+ PINMUX_DATA(IRQ2_PORT11_MARK, PORT11_FN0, MSEL1CR_2_0),
-+
-+ /* Port12 */
-+ PINMUX_DATA(FSIAILR_MARK, PORT12_FN1),
-+ PINMUX_DATA(SCIFA4_RXD_PORT12_MARK, PORT12_FN2, MSEL5CR_12_0, MSEL5CR_11_0),
-+ PINMUX_DATA(LCD1_RS_MARK, PORT12_FN6),
-+ PINMUX_DATA(LCD1_DISP_MARK, PORT12_FN7),
-+ PINMUX_DATA(IRQ2_PORT12_MARK, PORT12_FN0, MSEL1CR_2_1),
-+
-+ /* Port13 */
-+ PINMUX_DATA(FSIAIBT_MARK, PORT13_FN1),
-+ PINMUX_DATA(SCIFA4_TXD_PORT13_MARK, PORT13_FN2, MSEL5CR_12_0, MSEL5CR_11_0),
-+ PINMUX_DATA(LCD1_RD_MARK, PORT13_FN7),
-+ PINMUX_DATA(IRQ0_PORT13_MARK, PORT13_FN0, MSEL1CR_0_0),
-+
-+ /* Port14 */
-+ PINMUX_DATA(FMSOILR_MARK, PORT14_FN1),
-+ PINMUX_DATA(FMSIILR_MARK, PORT14_FN2),
-+ PINMUX_DATA(VIO_CKO1_MARK, PORT14_FN3),
-+ PINMUX_DATA(LCD1_D23_MARK, PORT14_FN7),
-+ PINMUX_DATA(IRQ3_PORT14_MARK, PORT14_FN0, MSEL1CR_3_1),
-+
-+ /* Port15 */
-+ PINMUX_DATA(FMSOIBT_MARK, PORT15_FN1),
-+ PINMUX_DATA(FMSIIBT_MARK, PORT15_FN2),
-+ PINMUX_DATA(VIO_CKO2_MARK, PORT15_FN3),
-+ PINMUX_DATA(LCD1_D22_MARK, PORT15_FN7),
-+ PINMUX_DATA(IRQ4_PORT15_MARK, PORT15_FN0, MSEL1CR_4_0),
-+
-+ /* Port16 */
-+ PINMUX_DATA(FMSOOLR_MARK, PORT16_FN1),
-+ PINMUX_DATA(FMSIOLR_MARK, PORT16_FN2),
-+
-+ /* Port17 */
-+ PINMUX_DATA(FMSOOBT_MARK, PORT17_FN1),
-+ PINMUX_DATA(FMSIOBT_MARK, PORT17_FN2),
-+
-+ /* Port18 */
-+ PINMUX_DATA(FMSOSLD_MARK, PORT18_FN1),
-+ PINMUX_DATA(FSIASPDIF_PORT18_MARK, PORT18_FN2, MSEL5CR_4_1),
-+
-+ /* Port19 */
-+ PINMUX_DATA(FMSICK_MARK, PORT19_FN1),
-+ PINMUX_DATA(CS5A_PORT19_MARK, PORT19_FN7, MSEL5CR_2_1),
-+ PINMUX_DATA(IRQ10_MARK, PORT19_FN0),
-+
-+ /* Port20 */
-+ PINMUX_DATA(FMSOCK_MARK, PORT20_FN1),
-+ PINMUX_DATA(SCIFA5_TXD_PORT20_MARK, PORT20_FN3, MSEL5CR_15_0, MSEL5CR_14_0),
-+ PINMUX_DATA(IRQ1_MARK, PORT20_FN0),
-+
-+ /* Port21 */
-+ PINMUX_DATA(SCIFA1_CTS_MARK, PORT21_FN1),
-+ PINMUX_DATA(SCIFA4_SCK_PORT21_MARK, PORT21_FN2, MSEL5CR_10_0),
-+ PINMUX_DATA(TPU0TO1_MARK, PORT21_FN4),
-+ PINMUX_DATA(VIO1_FIELD_MARK, PORT21_FN5),
-+ PINMUX_DATA(STP0_IPD5_MARK, PORT21_FN6),
-+ PINMUX_DATA(LCD1_D10_MARK, PORT21_FN7),
-+
-+ /* Port22 */
-+ PINMUX_DATA(SCIFA2_SCK_PORT22_MARK, PORT22_FN1, MSEL5CR_7_0),
-+ PINMUX_DATA(SIM_D_PORT22_MARK, PORT22_FN4, MSEL5CR_21_0),
-+ PINMUX_DATA(VIO0_D13_PORT22_MARK, PORT22_FN7, MSEL5CR_27_1),
-+
-+ /* Port23 */
-+ PINMUX_DATA(SCIFA1_RTS_MARK, PORT23_FN1),
-+ PINMUX_DATA(SCIFA5_SCK_PORT23_MARK, PORT23_FN3, MSEL5CR_13_0),
-+ PINMUX_DATA(TPU0TO0_MARK, PORT23_FN4),
-+ PINMUX_DATA(VIO_CKO_1_MARK, PORT23_FN5),
-+ PINMUX_DATA(STP0_IPD2_MARK, PORT23_FN6),
-+ PINMUX_DATA(LCD1_D7_MARK, PORT23_FN7),
-+
-+ /* Port24 */
-+ PINMUX_DATA(VIO0_D15_PORT24_MARK, PORT24_FN1, MSEL5CR_27_0),
-+ PINMUX_DATA(VIO1_D7_MARK, PORT24_FN5),
-+ PINMUX_DATA(SCIFA6_SCK_MARK, PORT24_FN6),
-+ PINMUX_DATA(SDHI2_CD_PORT24_MARK, PORT24_FN7, MSEL5CR_19_0),
-+
-+ /* Port25 */
-+ PINMUX_DATA(VIO0_D14_PORT25_MARK, PORT25_FN1, MSEL5CR_27_0),
-+ PINMUX_DATA(VIO1_D6_MARK, PORT25_FN5),
-+ PINMUX_DATA(SCIFA6_RXD_MARK, PORT25_FN6),
-+ PINMUX_DATA(SDHI2_WP_PORT25_MARK, PORT25_FN7, MSEL5CR_19_0),
-+
-+ /* Port26 */
-+ PINMUX_DATA(VIO0_D13_PORT26_MARK, PORT26_FN1, MSEL5CR_27_0),
-+ PINMUX_DATA(VIO1_D5_MARK, PORT26_FN5),
-+ PINMUX_DATA(SCIFA6_TXD_MARK, PORT26_FN6),
-+
-+ /* Port27 - Port39 Function */
-+ PINMUX_DATA(VIO0_D7_MARK, PORT27_FN1),
-+ PINMUX_DATA(VIO0_D6_MARK, PORT28_FN1),
-+ PINMUX_DATA(VIO0_D5_MARK, PORT29_FN1),
-+ PINMUX_DATA(VIO0_D4_MARK, PORT30_FN1),
-+ PINMUX_DATA(VIO0_D3_MARK, PORT31_FN1),
-+ PINMUX_DATA(VIO0_D2_MARK, PORT32_FN1),
-+ PINMUX_DATA(VIO0_D1_MARK, PORT33_FN1),
-+ PINMUX_DATA(VIO0_D0_MARK, PORT34_FN1),
-+ PINMUX_DATA(VIO0_CLK_MARK, PORT35_FN1),
-+ PINMUX_DATA(VIO_CKO_MARK, PORT36_FN1),
-+ PINMUX_DATA(VIO0_HD_MARK, PORT37_FN1),
-+ PINMUX_DATA(VIO0_FIELD_MARK, PORT38_FN1),
-+ PINMUX_DATA(VIO0_VD_MARK, PORT39_FN1),
-+
-+ /* Port38 IRQ */
-+ PINMUX_DATA(IRQ25_MARK, PORT38_FN0),
-+
-+ /* Port40 */
-+ PINMUX_DATA(LCD0_D18_PORT40_MARK, PORT40_FN4, MSEL5CR_6_0),
-+ PINMUX_DATA(RSPI_CK_A_MARK, PORT40_FN6),
-+ PINMUX_DATA(LCD1_LCLK_MARK, PORT40_FN7),
-+
-+ /* Port41 */
-+ PINMUX_DATA(LCD0_D17_MARK, PORT41_FN1),
-+ PINMUX_DATA(MSIOF2_SS1_MARK, PORT41_FN2),
-+ PINMUX_DATA(IRQ31_PORT41_MARK, PORT41_FN0, MSEL1CR_31_1),
-+
-+ /* Port42 */
-+ PINMUX_DATA(LCD0_D16_MARK, PORT42_FN1),
-+ PINMUX_DATA(MSIOF2_MCK1_MARK, PORT42_FN2),
-+ PINMUX_DATA(IRQ12_PORT42_MARK, PORT42_FN0, MSEL1CR_12_1),
-+
-+ /* Port43 */
-+ PINMUX_DATA(LCD0_D15_MARK, PORT43_FN1),
-+ PINMUX_DATA(MSIOF2_MCK0_MARK, PORT43_FN2),
-+ PINMUX_DATA(KEYIN0_PORT43_MARK, PORT43_FN3, MSEL4CR_18_0),
-+ PINMUX_DATA(DV_D15_MARK, PORT43_FN6),
-+
-+ /* Port44 */
-+ PINMUX_DATA(LCD0_D14_MARK, PORT44_FN1),
-+ PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT44_FN2),
-+ PINMUX_DATA(KEYIN1_PORT44_MARK, PORT44_FN3, MSEL4CR_18_0),
-+ PINMUX_DATA(DV_D14_MARK, PORT44_FN6),
-+
-+ /* Port45 */
-+ PINMUX_DATA(LCD0_D13_MARK, PORT45_FN1),
-+ PINMUX_DATA(MSIOF2_RSCK_MARK, PORT45_FN2),
-+ PINMUX_DATA(KEYIN2_PORT45_MARK, PORT45_FN3, MSEL4CR_18_0),
-+ PINMUX_DATA(DV_D13_MARK, PORT45_FN6),
-+
-+ /* Port46 */
-+ PINMUX_DATA(LCD0_D12_MARK, PORT46_FN1),
-+ PINMUX_DATA(KEYIN3_PORT46_MARK, PORT46_FN3, MSEL4CR_18_0),
-+ PINMUX_DATA(DV_D12_MARK, PORT46_FN6),
-+
-+ /* Port47 */
-+ PINMUX_DATA(LCD0_D11_MARK, PORT47_FN1),
-+ PINMUX_DATA(KEYIN4_MARK, PORT47_FN3),
-+ PINMUX_DATA(DV_D11_MARK, PORT47_FN6),
-+
-+ /* Port48 */
-+ PINMUX_DATA(LCD0_D10_MARK, PORT48_FN1),
-+ PINMUX_DATA(KEYIN5_MARK, PORT48_FN3),
-+ PINMUX_DATA(DV_D10_MARK, PORT48_FN6),
-+
-+ /* Port49 */
-+ PINMUX_DATA(LCD0_D9_MARK, PORT49_FN1),
-+ PINMUX_DATA(KEYIN6_MARK, PORT49_FN3),
-+ PINMUX_DATA(DV_D9_MARK, PORT49_FN6),
-+ PINMUX_DATA(IRQ30_PORT49_MARK, PORT49_FN0, MSEL1CR_30_1),
-+
-+ /* Port50 */
-+ PINMUX_DATA(LCD0_D8_MARK, PORT50_FN1),
-+ PINMUX_DATA(KEYIN7_MARK, PORT50_FN3),
-+ PINMUX_DATA(DV_D8_MARK, PORT50_FN6),
-+ PINMUX_DATA(IRQ29_PORT50_MARK, PORT50_FN0, MSEL1CR_29_1),
-+
-+ /* Port51 */
-+ PINMUX_DATA(LCD0_D7_MARK, PORT51_FN1),
-+ PINMUX_DATA(KEYOUT0_MARK, PORT51_FN3),
-+ PINMUX_DATA(DV_D7_MARK, PORT51_FN6),
-+
-+ /* Port52 */
-+ PINMUX_DATA(LCD0_D6_MARK, PORT52_FN1),
-+ PINMUX_DATA(KEYOUT1_MARK, PORT52_FN3),
-+ PINMUX_DATA(DV_D6_MARK, PORT52_FN6),
-+
-+ /* Port53 */
-+ PINMUX_DATA(LCD0_D5_MARK, PORT53_FN1),
-+ PINMUX_DATA(KEYOUT2_MARK, PORT53_FN3),
-+ PINMUX_DATA(DV_D5_MARK, PORT53_FN6),
-+
-+ /* Port54 */
-+ PINMUX_DATA(LCD0_D4_MARK, PORT54_FN1),
-+ PINMUX_DATA(KEYOUT3_MARK, PORT54_FN3),
-+ PINMUX_DATA(DV_D4_MARK, PORT54_FN6),
-+
-+ /* Port55 */
-+ PINMUX_DATA(LCD0_D3_MARK, PORT55_FN1),
-+ PINMUX_DATA(KEYOUT4_MARK, PORT55_FN3),
-+ PINMUX_DATA(KEYIN3_PORT55_MARK, PORT55_FN4, MSEL4CR_18_1),
-+ PINMUX_DATA(DV_D3_MARK, PORT55_FN6),
-+
-+ /* Port56 */
-+ PINMUX_DATA(LCD0_D2_MARK, PORT56_FN1),
-+ PINMUX_DATA(KEYOUT5_MARK, PORT56_FN3),
-+ PINMUX_DATA(KEYIN2_PORT56_MARK, PORT56_FN4, MSEL4CR_18_1),
-+ PINMUX_DATA(DV_D2_MARK, PORT56_FN6),
-+ PINMUX_DATA(IRQ28_PORT56_MARK, PORT56_FN0, MSEL1CR_28_1),
-+
-+ /* Port57 */
-+ PINMUX_DATA(LCD0_D1_MARK, PORT57_FN1),
-+ PINMUX_DATA(KEYOUT6_MARK, PORT57_FN3),
-+ PINMUX_DATA(KEYIN1_PORT57_MARK, PORT57_FN4, MSEL4CR_18_1),
-+ PINMUX_DATA(DV_D1_MARK, PORT57_FN6),
-+ PINMUX_DATA(IRQ27_PORT57_MARK, PORT57_FN0, MSEL1CR_27_1),
-+
-+ /* Port58 */
-+ PINMUX_DATA(LCD0_D0_MARK, PORT58_FN1),
-+ PINMUX_DATA(KEYOUT7_MARK, PORT58_FN3),
-+ PINMUX_DATA(KEYIN0_PORT58_MARK, PORT58_FN4, MSEL4CR_18_1),
-+ PINMUX_DATA(DV_D0_MARK, PORT58_FN6),
-+ PINMUX_DATA(IRQ26_PORT58_MARK, PORT58_FN0, MSEL1CR_26_1),
-+
-+ /* Port59 */
-+ PINMUX_DATA(LCD0_VCPWC_MARK, PORT59_FN1),
-+ PINMUX_DATA(BBIF2_TSCK2_PORT59_MARK, PORT59_FN2, MSEL5CR_0_0),
-+ PINMUX_DATA(RSPI_MOSI_A_MARK, PORT59_FN6),
-+
-+ /* Port60 */
-+ PINMUX_DATA(LCD0_VEPWC_MARK, PORT60_FN1),
-+ PINMUX_DATA(BBIF2_RXD2_PORT60_MARK, PORT60_FN2, MSEL5CR_0_0),
-+ PINMUX_DATA(RSPI_MISO_A_MARK, PORT60_FN6),
-+
-+ /* Port61 */
-+ PINMUX_DATA(LCD0_DON_MARK, PORT61_FN1),
-+ PINMUX_DATA(MSIOF2_TXD_MARK, PORT61_FN2),
-+
-+ /* Port62 */
-+ PINMUX_DATA(LCD0_DCK_MARK, PORT62_FN1),
-+ PINMUX_DATA(LCD0_WR_MARK, PORT62_FN4),
-+ PINMUX_DATA(DV_CLK_MARK, PORT62_FN6),
-+ PINMUX_DATA(IRQ15_PORT62_MARK, PORT62_FN0, MSEL1CR_15_1),
-+
-+ /* Port63 */
-+ PINMUX_DATA(LCD0_VSYN_MARK, PORT63_FN1),
-+ PINMUX_DATA(DV_VSYNC_MARK, PORT63_FN6),
-+ PINMUX_DATA(IRQ14_PORT63_MARK, PORT63_FN0, MSEL1CR_14_1),
-+
-+ /* Port64 */
-+ PINMUX_DATA(LCD0_HSYN_MARK, PORT64_FN1),
-+ PINMUX_DATA(LCD0_CS_MARK, PORT64_FN4),
-+ PINMUX_DATA(DV_HSYNC_MARK, PORT64_FN6),
-+ PINMUX_DATA(IRQ13_PORT64_MARK, PORT64_FN0, MSEL1CR_13_1),
-+
-+ /* Port65 */
-+ PINMUX_DATA(LCD0_DISP_MARK, PORT65_FN1),
-+ PINMUX_DATA(MSIOF2_TSCK_MARK, PORT65_FN2),
-+ PINMUX_DATA(LCD0_RS_MARK, PORT65_FN4),
-+
-+ /* Port66 */
-+ PINMUX_DATA(MEMC_INT_MARK, PORT66_FN1),
-+ PINMUX_DATA(TPU0TO2_PORT66_MARK, PORT66_FN3, MSEL5CR_25_0),
-+ PINMUX_DATA(MMC0_CLK_PORT66_MARK, PORT66_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(SDHI1_CLK_MARK, PORT66_FN6),
-+
-+ /* Port67 - Port73 Function1 */
-+ PINMUX_DATA(MEMC_CS0_MARK, PORT67_FN1),
-+ PINMUX_DATA(MEMC_AD8_MARK, PORT68_FN1),
-+ PINMUX_DATA(MEMC_AD9_MARK, PORT69_FN1),
-+ PINMUX_DATA(MEMC_AD10_MARK, PORT70_FN1),
-+ PINMUX_DATA(MEMC_AD11_MARK, PORT71_FN1),
-+ PINMUX_DATA(MEMC_AD12_MARK, PORT72_FN1),
-+ PINMUX_DATA(MEMC_AD13_MARK, PORT73_FN1),
-+
-+ /* Port67 - Port73 Function2 */
-+ PINMUX_DATA(MSIOF1_SS1_PORT67_MARK, PORT67_FN2, MSEL4CR_10_1),
-+ PINMUX_DATA(MSIOF1_RSCK_MARK, PORT68_FN2),
-+ PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT69_FN2),
-+ PINMUX_DATA(MSIOF1_MCK0_MARK, PORT70_FN2),
-+ PINMUX_DATA(MSIOF1_MCK1_MARK, PORT71_FN2),
-+ PINMUX_DATA(MSIOF1_TSCK_PORT72_MARK, PORT72_FN2, MSEL4CR_10_1),
-+ PINMUX_DATA(MSIOF1_TSYNC_PORT73_MARK, PORT73_FN2, MSEL4CR_10_1),
-+
-+ /* Port67 - Port73 Function4 */
-+ PINMUX_DATA(MMC0_CMD_PORT67_MARK, PORT67_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D0_PORT68_MARK, PORT68_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D1_PORT69_MARK, PORT69_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D2_PORT70_MARK, PORT70_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D3_PORT71_MARK, PORT71_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D4_PORT72_MARK, PORT72_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(MMC0_D5_PORT73_MARK, PORT73_FN4, MSEL4CR_15_0),
-+
-+ /* Port67 - Port73 Function6 */
-+ PINMUX_DATA(SDHI1_CMD_MARK, PORT67_FN6),
-+ PINMUX_DATA(SDHI1_D0_MARK, PORT68_FN6),
-+ PINMUX_DATA(SDHI1_D1_MARK, PORT69_FN6),
-+ PINMUX_DATA(SDHI1_D2_MARK, PORT70_FN6),
-+ PINMUX_DATA(SDHI1_D3_MARK, PORT71_FN6),
-+ PINMUX_DATA(SDHI1_CD_MARK, PORT72_FN6),
-+ PINMUX_DATA(SDHI1_WP_MARK, PORT73_FN6),
-+
-+ /* Port67 - Port71 IRQ */
-+ PINMUX_DATA(IRQ20_MARK, PORT67_FN0),
-+ PINMUX_DATA(IRQ16_PORT68_MARK, PORT68_FN0, MSEL1CR_16_0),
-+ PINMUX_DATA(IRQ17_MARK, PORT69_FN0),
-+ PINMUX_DATA(IRQ18_MARK, PORT70_FN0),
-+ PINMUX_DATA(IRQ19_MARK, PORT71_FN0),
-+
-+ /* Port74 */
-+ PINMUX_DATA(MEMC_AD14_MARK, PORT74_FN1),
-+ PINMUX_DATA(MSIOF1_TXD_PORT74_MARK, PORT74_FN2, MSEL4CR_10_1),
-+ PINMUX_DATA(MMC0_D6_PORT74_MARK, PORT74_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(STP1_IPD7_MARK, PORT74_FN6),
-+ PINMUX_DATA(LCD1_D21_MARK, PORT74_FN7),
-+
-+ /* Port75 */
-+ PINMUX_DATA(MEMC_AD15_MARK, PORT75_FN1),
-+ PINMUX_DATA(MSIOF1_RXD_PORT75_MARK, PORT75_FN2, MSEL4CR_10_1),
-+ PINMUX_DATA(MMC0_D7_PORT75_MARK, PORT75_FN4, MSEL4CR_15_0),
-+ PINMUX_DATA(STP1_IPD6_MARK, PORT75_FN6),
-+ PINMUX_DATA(LCD1_D20_MARK, PORT75_FN7),
-+
-+ /* Port76 - Port80 Function */
-+ PINMUX_DATA(SDHI0_CMD_MARK, PORT76_FN1),
-+ PINMUX_DATA(SDHI0_D0_MARK, PORT77_FN1),
-+ PINMUX_DATA(SDHI0_D1_MARK, PORT78_FN1),
-+ PINMUX_DATA(SDHI0_D2_MARK, PORT79_FN1),
-+ PINMUX_DATA(SDHI0_D3_MARK, PORT80_FN1),
-+
-+ /* Port81 */
-+ PINMUX_DATA(SDHI0_CD_MARK, PORT81_FN1),
-+ PINMUX_DATA(IRQ26_PORT81_MARK, PORT81_FN0, MSEL1CR_26_0),
-+
-+ /* Port82 - Port88 Function */
-+ PINMUX_DATA(SDHI0_CLK_MARK, PORT82_FN1),
-+ PINMUX_DATA(SDHI0_WP_MARK, PORT83_FN1),
-+ PINMUX_DATA(RESETOUTS_MARK, PORT84_FN1),
-+ PINMUX_DATA(USB0_PPON_MARK, PORT85_FN1),
-+ PINMUX_DATA(USB0_OCI_MARK, PORT86_FN1),
-+ PINMUX_DATA(USB1_PPON_MARK, PORT87_FN1),
-+ PINMUX_DATA(USB1_OCI_MARK, PORT88_FN1),
-+
-+ /* Port89 */
-+ PINMUX_DATA(DREQ0_MARK, PORT89_FN1),
-+ PINMUX_DATA(BBIF2_TSCK2_PORT89_MARK, PORT89_FN2, MSEL5CR_0_1),
-+ PINMUX_DATA(RSPI_SSL3_A_MARK, PORT89_FN6),
-+
-+ /* Port90 */
-+ PINMUX_DATA(DACK0_MARK, PORT90_FN1),
-+ PINMUX_DATA(BBIF2_RXD2_PORT90_MARK, PORT90_FN2, MSEL5CR_0_1),
-+ PINMUX_DATA(RSPI_SSL2_A_MARK, PORT90_FN6),
-+ PINMUX_DATA(WAIT_PORT90_MARK, PORT90_FN7, MSEL5CR_2_1),
-+
-+ /* Port91 */
-+ PINMUX_DATA(MEMC_AD0_MARK, PORT91_FN1),
-+ PINMUX_DATA(BBIF1_RXD_MARK, PORT91_FN2),
-+ PINMUX_DATA(SCIFA5_TXD_PORT91_MARK, PORT91_FN3, MSEL5CR_15_1, MSEL5CR_14_0),
-+ PINMUX_DATA(LCD1_D5_MARK, PORT91_FN7),
-+
-+ /* Port92 */
-+ PINMUX_DATA(MEMC_AD1_MARK, PORT92_FN1),
-+ PINMUX_DATA(BBIF1_TSYNC_MARK, PORT92_FN2),
-+ PINMUX_DATA(SCIFA5_RXD_PORT92_MARK, PORT92_FN3, MSEL5CR_15_1, MSEL5CR_14_0),
-+ PINMUX_DATA(STP0_IPD1_MARK, PORT92_FN6),
-+ PINMUX_DATA(LCD1_D6_MARK, PORT92_FN7),
-+
-+ /* Port93 */
-+ PINMUX_DATA(MEMC_AD2_MARK, PORT93_FN1),
-+ PINMUX_DATA(BBIF1_TSCK_MARK, PORT93_FN2),
-+ PINMUX_DATA(SCIFA4_TXD_PORT93_MARK, PORT93_FN3, MSEL5CR_12_1, MSEL5CR_11_0),
-+ PINMUX_DATA(STP0_IPD3_MARK, PORT93_FN6),
-+ PINMUX_DATA(LCD1_D8_MARK, PORT93_FN7),
-+
-+ /* Port94 */
-+ PINMUX_DATA(MEMC_AD3_MARK, PORT94_FN1),
-+ PINMUX_DATA(BBIF1_TXD_MARK, PORT94_FN2),
-+ PINMUX_DATA(SCIFA4_RXD_PORT94_MARK, PORT94_FN3, MSEL5CR_12_1, MSEL5CR_11_0),
-+ PINMUX_DATA(STP0_IPD4_MARK, PORT94_FN6),
-+ PINMUX_DATA(LCD1_D9_MARK, PORT94_FN7),
-+
-+ /* Port95 */
-+ PINMUX_DATA(MEMC_CS1_MARK, PORT95_FN1, MSEL4CR_6_0),
-+ PINMUX_DATA(MEMC_A1_MARK, PORT95_FN1, MSEL4CR_6_1),
-+
-+ PINMUX_DATA(SCIFA2_CTS_MARK, PORT95_FN2),
-+ PINMUX_DATA(SIM_RST_MARK, PORT95_FN4),
-+ PINMUX_DATA(VIO0_D14_PORT95_MARK, PORT95_FN7, MSEL5CR_27_1),
-+ PINMUX_DATA(IRQ22_MARK, PORT95_FN0),
-+
-+ /* Port96 */
-+ PINMUX_DATA(MEMC_ADV_MARK, PORT96_FN1, MSEL4CR_6_0),
-+ PINMUX_DATA(MEMC_DREQ0_MARK, PORT96_FN1, MSEL4CR_6_1),
-+
-+ PINMUX_DATA(SCIFA2_RTS_MARK, PORT96_FN2),
-+ PINMUX_DATA(SIM_CLK_MARK, PORT96_FN4),
-+ PINMUX_DATA(VIO0_D15_PORT96_MARK, PORT96_FN7, MSEL5CR_27_1),
-+ PINMUX_DATA(IRQ23_MARK, PORT96_FN0),
-+
-+ /* Port97 */
-+ PINMUX_DATA(MEMC_AD4_MARK, PORT97_FN1),
-+ PINMUX_DATA(BBIF1_RSCK_MARK, PORT97_FN2),
-+ PINMUX_DATA(LCD1_CS_MARK, PORT97_FN6),
-+ PINMUX_DATA(LCD1_HSYN_MARK, PORT97_FN7),
-+ PINMUX_DATA(IRQ12_PORT97_MARK, PORT97_FN0, MSEL1CR_12_0),
-+
-+ /* Port98 */
-+ PINMUX_DATA(MEMC_AD5_MARK, PORT98_FN1),
-+ PINMUX_DATA(BBIF1_RSYNC_MARK, PORT98_FN2),
-+ PINMUX_DATA(LCD1_VSYN_MARK, PORT98_FN7),
-+ PINMUX_DATA(IRQ13_PORT98_MARK, PORT98_FN0, MSEL1CR_13_0),
-+
-+ /* Port99 */
-+ PINMUX_DATA(MEMC_AD6_MARK, PORT99_FN1),
-+ PINMUX_DATA(BBIF1_FLOW_MARK, PORT99_FN2),
-+ PINMUX_DATA(LCD1_WR_MARK, PORT99_FN6),
-+ PINMUX_DATA(LCD1_DCK_MARK, PORT99_FN7),
-+ PINMUX_DATA(IRQ14_PORT99_MARK, PORT99_FN0, MSEL1CR_14_0),
-+
-+ /* Port100 */
-+ PINMUX_DATA(MEMC_AD7_MARK, PORT100_FN1),
-+ PINMUX_DATA(BBIF1_RX_FLOW_N_MARK, PORT100_FN2),
-+ PINMUX_DATA(LCD1_DON_MARK, PORT100_FN7),
-+ PINMUX_DATA(IRQ15_PORT100_MARK, PORT100_FN0, MSEL1CR_15_0),
-+
-+ /* Port101 */
-+ PINMUX_DATA(FCE0_MARK, PORT101_FN1),
-+
-+ /* Port102 */
-+ PINMUX_DATA(FRB_MARK, PORT102_FN1),
-+ PINMUX_DATA(LCD0_LCLK_PORT102_MARK, PORT102_FN4, MSEL5CR_6_0),
-+
-+ /* Port103 */
-+ PINMUX_DATA(CS5B_MARK, PORT103_FN1),
-+ PINMUX_DATA(FCE1_MARK, PORT103_FN2),
-+ PINMUX_DATA(MMC1_CLK_PORT103_MARK, PORT103_FN3, MSEL4CR_15_1),
-+
-+ /* Port104 */
-+ PINMUX_DATA(CS6A_MARK, PORT104_FN1),
-+ PINMUX_DATA(MMC1_CMD_PORT104_MARK, PORT104_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(IRQ11_MARK, PORT104_FN0),
-+
-+ /* Port105 */
-+ PINMUX_DATA(CS5A_PORT105_MARK, PORT105_FN1, MSEL5CR_2_0),
-+ PINMUX_DATA(SCIFA3_RTS_PORT105_MARK, PORT105_FN4, MSEL5CR_8_0),
-+
-+ /* Port106 */
-+ PINMUX_DATA(IOIS16_MARK, PORT106_FN1),
-+ PINMUX_DATA(IDE_EXBUF_ENB_MARK, PORT106_FN6),
-+
-+ /* Port107 - Port115 Function */
-+ PINMUX_DATA(WE3_ICIOWR_MARK, PORT107_FN1),
-+ PINMUX_DATA(WE2_ICIORD_MARK, PORT108_FN1),
-+ PINMUX_DATA(CS0_MARK, PORT109_FN1),
-+ PINMUX_DATA(CS2_MARK, PORT110_FN1),
-+ PINMUX_DATA(CS4_MARK, PORT111_FN1),
-+ PINMUX_DATA(WE1_MARK, PORT112_FN1),
-+ PINMUX_DATA(WE0_FWE_MARK, PORT113_FN1),
-+ PINMUX_DATA(RDWR_MARK, PORT114_FN1),
-+ PINMUX_DATA(RD_FSC_MARK, PORT115_FN1),
-+
-+ /* Port116 */
-+ PINMUX_DATA(A25_MARK, PORT116_FN1),
-+ PINMUX_DATA(MSIOF0_SS2_MARK, PORT116_FN2),
-+ PINMUX_DATA(MSIOF1_SS2_PORT116_MARK, PORT116_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(SCIFA3_SCK_PORT116_MARK, PORT116_FN4, MSEL5CR_8_0),
-+ PINMUX_DATA(GPO1_MARK, PORT116_FN5),
-+
-+ /* Port117 */
-+ PINMUX_DATA(A24_MARK, PORT117_FN1),
-+ PINMUX_DATA(MSIOF0_SS1_MARK, PORT117_FN2),
-+ PINMUX_DATA(MSIOF1_SS1_PORT117_MARK, PORT117_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(SCIFA3_CTS_PORT117_MARK, PORT117_FN4, MSEL5CR_8_0),
-+ PINMUX_DATA(GPO0_MARK, PORT117_FN5),
-+
-+ /* Port118 */
-+ PINMUX_DATA(A23_MARK, PORT118_FN1),
-+ PINMUX_DATA(MSIOF0_MCK1_MARK, PORT118_FN2),
-+ PINMUX_DATA(MSIOF1_RXD_PORT118_MARK, PORT118_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(GPI1_MARK, PORT118_FN5),
-+ PINMUX_DATA(IRQ9_PORT118_MARK, PORT118_FN0, MSEL1CR_9_0),
-+
-+ /* Port119 */
-+ PINMUX_DATA(A22_MARK, PORT119_FN1),
-+ PINMUX_DATA(MSIOF0_MCK0_MARK, PORT119_FN2),
-+ PINMUX_DATA(MSIOF1_TXD_PORT119_MARK, PORT119_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(GPI0_MARK, PORT119_FN5),
-+ PINMUX_DATA(IRQ8_MARK, PORT119_FN0),
-+
-+ /* Port120 */
-+ PINMUX_DATA(A21_MARK, PORT120_FN1),
-+ PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT120_FN2),
-+ PINMUX_DATA(MSIOF1_TSYNC_PORT120_MARK, PORT120_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(IRQ7_PORT120_MARK, PORT120_FN0, MSEL1CR_7_0),
-+
-+ /* Port121 */
-+ PINMUX_DATA(A20_MARK, PORT121_FN1),
-+ PINMUX_DATA(MSIOF0_RSCK_MARK, PORT121_FN2),
-+ PINMUX_DATA(MSIOF1_TSCK_PORT121_MARK, PORT121_FN3, MSEL4CR_10_0),
-+ PINMUX_DATA(IRQ6_PORT121_MARK, PORT121_FN0, MSEL1CR_6_0),
-+
-+ /* Port122 */
-+ PINMUX_DATA(A19_MARK, PORT122_FN1),
-+ PINMUX_DATA(MSIOF0_RXD_MARK, PORT122_FN2),
-+
-+ /* Port123 */
-+ PINMUX_DATA(A18_MARK, PORT123_FN1),
-+ PINMUX_DATA(MSIOF0_TSCK_MARK, PORT123_FN2),
-+
-+ /* Port124 */
-+ PINMUX_DATA(A17_MARK, PORT124_FN1),
-+ PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT124_FN2),
-+
-+ /* Port125 - Port141 Function */
-+ PINMUX_DATA(A16_MARK, PORT125_FN1),
-+ PINMUX_DATA(A15_MARK, PORT126_FN1),
-+ PINMUX_DATA(A14_MARK, PORT127_FN1),
-+ PINMUX_DATA(A13_MARK, PORT128_FN1),
-+ PINMUX_DATA(A12_MARK, PORT129_FN1),
-+ PINMUX_DATA(A11_MARK, PORT130_FN1),
-+ PINMUX_DATA(A10_MARK, PORT131_FN1),
-+ PINMUX_DATA(A9_MARK, PORT132_FN1),
-+ PINMUX_DATA(A8_MARK, PORT133_FN1),
-+ PINMUX_DATA(A7_MARK, PORT134_FN1),
-+ PINMUX_DATA(A6_MARK, PORT135_FN1),
-+ PINMUX_DATA(A5_FCDE_MARK, PORT136_FN1),
-+ PINMUX_DATA(A4_FOE_MARK, PORT137_FN1),
-+ PINMUX_DATA(A3_MARK, PORT138_FN1),
-+ PINMUX_DATA(A2_MARK, PORT139_FN1),
-+ PINMUX_DATA(A1_MARK, PORT140_FN1),
-+ PINMUX_DATA(CKO_MARK, PORT141_FN1),
-+
-+ /* Port142 - Port157 Function1 */
-+ PINMUX_DATA(D15_NAF15_MARK, PORT142_FN1),
-+ PINMUX_DATA(D14_NAF14_MARK, PORT143_FN1),
-+ PINMUX_DATA(D13_NAF13_MARK, PORT144_FN1),
-+ PINMUX_DATA(D12_NAF12_MARK, PORT145_FN1),
-+ PINMUX_DATA(D11_NAF11_MARK, PORT146_FN1),
-+ PINMUX_DATA(D10_NAF10_MARK, PORT147_FN1),
-+ PINMUX_DATA(D9_NAF9_MARK, PORT148_FN1),
-+ PINMUX_DATA(D8_NAF8_MARK, PORT149_FN1),
-+ PINMUX_DATA(D7_NAF7_MARK, PORT150_FN1),
-+ PINMUX_DATA(D6_NAF6_MARK, PORT151_FN1),
-+ PINMUX_DATA(D5_NAF5_MARK, PORT152_FN1),
-+ PINMUX_DATA(D4_NAF4_MARK, PORT153_FN1),
-+ PINMUX_DATA(D3_NAF3_MARK, PORT154_FN1),
-+ PINMUX_DATA(D2_NAF2_MARK, PORT155_FN1),
-+ PINMUX_DATA(D1_NAF1_MARK, PORT156_FN1),
-+ PINMUX_DATA(D0_NAF0_MARK, PORT157_FN1),
-+
-+ /* Port142 - Port149 Function3 */
-+ PINMUX_DATA(MMC1_D7_PORT142_MARK, PORT142_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D6_PORT143_MARK, PORT143_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D5_PORT144_MARK, PORT144_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D4_PORT145_MARK, PORT145_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D3_PORT146_MARK, PORT146_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D2_PORT147_MARK, PORT147_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D1_PORT148_MARK, PORT148_FN3, MSEL4CR_15_1),
-+ PINMUX_DATA(MMC1_D0_PORT149_MARK, PORT149_FN3, MSEL4CR_15_1),
-+
-+ /* Port158 */
-+ PINMUX_DATA(D31_MARK, PORT158_FN1),
-+ PINMUX_DATA(SCIFA3_SCK_PORT158_MARK, PORT158_FN2, MSEL5CR_8_1),
-+ PINMUX_DATA(RMII_REF125CK_MARK, PORT158_FN3),
-+ PINMUX_DATA(LCD0_D21_PORT158_MARK, PORT158_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IRDA_FIRSEL_MARK, PORT158_FN5),
-+ PINMUX_DATA(IDE_D15_MARK, PORT158_FN6),
-+
-+ /* Port159 */
-+ PINMUX_DATA(D30_MARK, PORT159_FN1),
-+ PINMUX_DATA(SCIFA3_RXD_PORT159_MARK, PORT159_FN2, MSEL5CR_8_1),
-+ PINMUX_DATA(RMII_REF50CK_MARK, PORT159_FN3),
-+ PINMUX_DATA(LCD0_D23_PORT159_MARK, PORT159_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IDE_D14_MARK, PORT159_FN6),
-+
-+ /* Port160 */
-+ PINMUX_DATA(D29_MARK, PORT160_FN1),
-+ PINMUX_DATA(SCIFA3_TXD_PORT160_MARK, PORT160_FN2, MSEL5CR_8_1),
-+ PINMUX_DATA(LCD0_D22_PORT160_MARK, PORT160_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(VIO1_HD_MARK, PORT160_FN5),
-+ PINMUX_DATA(IDE_D13_MARK, PORT160_FN6),
-+
-+ /* Port161 */
-+ PINMUX_DATA(D28_MARK, PORT161_FN1),
-+ PINMUX_DATA(SCIFA3_RTS_PORT161_MARK, PORT161_FN2, MSEL5CR_8_1),
-+ PINMUX_DATA(ET_RX_DV_MARK, PORT161_FN3),
-+ PINMUX_DATA(LCD0_D20_PORT161_MARK, PORT161_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IRDA_IN_MARK, PORT161_FN5),
-+ PINMUX_DATA(IDE_D12_MARK, PORT161_FN6),
-+
-+ /* Port162 */
-+ PINMUX_DATA(D27_MARK, PORT162_FN1),
-+ PINMUX_DATA(SCIFA3_CTS_PORT162_MARK, PORT162_FN2, MSEL5CR_8_1),
-+ PINMUX_DATA(LCD0_D19_PORT162_MARK, PORT162_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IRDA_OUT_MARK, PORT162_FN5),
-+ PINMUX_DATA(IDE_D11_MARK, PORT162_FN6),
-+
-+ /* Port163 */
-+ PINMUX_DATA(D26_MARK, PORT163_FN1),
-+ PINMUX_DATA(MSIOF2_SS2_MARK, PORT163_FN2),
-+ PINMUX_DATA(ET_COL_MARK, PORT163_FN3),
-+ PINMUX_DATA(LCD0_D18_PORT163_MARK, PORT163_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IROUT_MARK, PORT163_FN5),
-+ PINMUX_DATA(IDE_D10_MARK, PORT163_FN6),
-+
-+ /* Port164 */
-+ PINMUX_DATA(D25_MARK, PORT164_FN1),
-+ PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT164_FN2),
-+ PINMUX_DATA(ET_PHY_INT_MARK, PORT164_FN3),
-+ PINMUX_DATA(LCD0_RD_MARK, PORT164_FN4),
-+ PINMUX_DATA(IDE_D9_MARK, PORT164_FN6),
-+
-+ /* Port165 */
-+ PINMUX_DATA(D24_MARK, PORT165_FN1),
-+ PINMUX_DATA(MSIOF2_RXD_MARK, PORT165_FN2),
-+ PINMUX_DATA(LCD0_LCLK_PORT165_MARK, PORT165_FN4, MSEL5CR_6_1),
-+ PINMUX_DATA(IDE_D8_MARK, PORT165_FN6),
-+
-+ /* Port166 - Port171 Function1 */
-+ PINMUX_DATA(D21_MARK, PORT166_FN1),
-+ PINMUX_DATA(D20_MARK, PORT167_FN1),
-+ PINMUX_DATA(D19_MARK, PORT168_FN1),
-+ PINMUX_DATA(D18_MARK, PORT169_FN1),
-+ PINMUX_DATA(D17_MARK, PORT170_FN1),
-+ PINMUX_DATA(D16_MARK, PORT171_FN1),
-+
-+ /* Port166 - Port171 Function3 */
-+ PINMUX_DATA(ET_ETXD5_MARK, PORT166_FN3),
-+ PINMUX_DATA(ET_ETXD4_MARK, PORT167_FN3),
-+ PINMUX_DATA(ET_ETXD3_MARK, PORT168_FN3),
-+ PINMUX_DATA(ET_ETXD2_MARK, PORT169_FN3),
-+ PINMUX_DATA(ET_ETXD1_MARK, PORT170_FN3),
-+ PINMUX_DATA(ET_ETXD0_MARK, PORT171_FN3),
-+
-+ /* Port166 - Port171 Function6 */
-+ PINMUX_DATA(IDE_D5_MARK, PORT166_FN6),
-+ PINMUX_DATA(IDE_D4_MARK, PORT167_FN6),
-+ PINMUX_DATA(IDE_D3_MARK, PORT168_FN6),
-+ PINMUX_DATA(IDE_D2_MARK, PORT169_FN6),
-+ PINMUX_DATA(IDE_D1_MARK, PORT170_FN6),
-+ PINMUX_DATA(IDE_D0_MARK, PORT171_FN6),
-+
-+ /* Port167 - Port171 IRQ */
-+ PINMUX_DATA(IRQ31_PORT167_MARK, PORT167_FN0, MSEL1CR_31_0),
-+ PINMUX_DATA(IRQ27_PORT168_MARK, PORT168_FN0, MSEL1CR_27_0),
-+ PINMUX_DATA(IRQ28_PORT169_MARK, PORT169_FN0, MSEL1CR_28_0),
-+ PINMUX_DATA(IRQ29_PORT170_MARK, PORT170_FN0, MSEL1CR_29_0),
-+ PINMUX_DATA(IRQ30_PORT171_MARK, PORT171_FN0, MSEL1CR_30_0),
-+
-+ /* Port172 */
-+ PINMUX_DATA(D23_MARK, PORT172_FN1),
-+ PINMUX_DATA(SCIFB_RTS_PORT172_MARK, PORT172_FN2, MSEL5CR_17_1),
-+ PINMUX_DATA(ET_ETXD7_MARK, PORT172_FN3),
-+ PINMUX_DATA(IDE_D7_MARK, PORT172_FN6),
-+ PINMUX_DATA(IRQ4_PORT172_MARK, PORT172_FN0, MSEL1CR_4_1),
-+
-+ /* Port173 */
-+ PINMUX_DATA(D22_MARK, PORT173_FN1),
-+ PINMUX_DATA(SCIFB_CTS_PORT173_MARK, PORT173_FN2, MSEL5CR_17_1),
-+ PINMUX_DATA(ET_ETXD6_MARK, PORT173_FN3),
-+ PINMUX_DATA(IDE_D6_MARK, PORT173_FN6),
-+ PINMUX_DATA(IRQ6_PORT173_MARK, PORT173_FN0, MSEL1CR_6_1),
-+
-+ /* Port174 */
-+ PINMUX_DATA(A26_MARK, PORT174_FN1),
-+ PINMUX_DATA(MSIOF0_TXD_MARK, PORT174_FN2),
-+ PINMUX_DATA(ET_RX_CLK_MARK, PORT174_FN3),
-+ PINMUX_DATA(SCIFA3_RXD_PORT174_MARK, PORT174_FN4, MSEL5CR_8_0),
-+
-+ /* Port175 */
-+ PINMUX_DATA(A0_MARK, PORT175_FN1),
-+ PINMUX_DATA(BS_MARK, PORT175_FN2),
-+ PINMUX_DATA(ET_WOL_MARK, PORT175_FN3),
-+ PINMUX_DATA(SCIFA3_TXD_PORT175_MARK, PORT175_FN4, MSEL5CR_8_0),
-+
-+ /* Port176 */
-+ PINMUX_DATA(ET_GTX_CLK_MARK, PORT176_FN3),
-+
-+ /* Port177 */
-+ PINMUX_DATA(WAIT_PORT177_MARK, PORT177_FN1, MSEL5CR_2_0),
-+ PINMUX_DATA(ET_LINK_MARK, PORT177_FN3),
-+ PINMUX_DATA(IDE_IOWR_MARK, PORT177_FN6),
-+ PINMUX_DATA(SDHI2_WP_PORT177_MARK, PORT177_FN7, MSEL5CR_19_1),
-+
-+ /* Port178 */
-+ PINMUX_DATA(VIO0_D12_MARK, PORT178_FN1),
-+ PINMUX_DATA(VIO1_D4_MARK, PORT178_FN5),
-+ PINMUX_DATA(IDE_IORD_MARK, PORT178_FN6),
-+
-+ /* Port179 */
-+ PINMUX_DATA(VIO0_D11_MARK, PORT179_FN1),
-+ PINMUX_DATA(VIO1_D3_MARK, PORT179_FN5),
-+ PINMUX_DATA(IDE_IORDY_MARK, PORT179_FN6),
-+
-+ /* Port180 */
-+ PINMUX_DATA(VIO0_D10_MARK, PORT180_FN1),
-+ PINMUX_DATA(TPU0TO3_MARK, PORT180_FN4),
-+ PINMUX_DATA(VIO1_D2_MARK, PORT180_FN5),
-+ PINMUX_DATA(IDE_INT_MARK, PORT180_FN6),
-+ PINMUX_DATA(IRQ24_MARK, PORT180_FN0),
-+
-+ /* Port181 */
-+ PINMUX_DATA(VIO0_D9_MARK, PORT181_FN1),
-+ PINMUX_DATA(VIO1_D1_MARK, PORT181_FN5),
-+ PINMUX_DATA(IDE_RST_MARK, PORT181_FN6),
-+
-+ /* Port182 */
-+ PINMUX_DATA(VIO0_D8_MARK, PORT182_FN1),
-+ PINMUX_DATA(VIO1_D0_MARK, PORT182_FN5),
-+ PINMUX_DATA(IDE_DIRECTION_MARK, PORT182_FN6),
-+
-+ /* Port183 */
-+ PINMUX_DATA(DREQ1_MARK, PORT183_FN1),
-+ PINMUX_DATA(BBIF2_TXD2_PORT183_MARK, PORT183_FN2, MSEL5CR_0_1),
-+ PINMUX_DATA(ET_TX_EN_MARK, PORT183_FN3),
-+
-+ /* Port184 */
-+ PINMUX_DATA(DACK1_MARK, PORT184_FN1),
-+ PINMUX_DATA(BBIF2_TSYNC2_PORT184_MARK, PORT184_FN2, MSEL5CR_0_1),
-+ PINMUX_DATA(ET_TX_CLK_MARK, PORT184_FN3),
-+
-+ /* Port185 - Port192 Function1 */
-+ PINMUX_DATA(SCIFA1_SCK_MARK, PORT185_FN1),
-+ PINMUX_DATA(SCIFB_RTS_PORT186_MARK, PORT186_FN1, MSEL5CR_17_0),
-+ PINMUX_DATA(SCIFB_CTS_PORT187_MARK, PORT187_FN1, MSEL5CR_17_0),
-+ PINMUX_DATA(SCIFA0_SCK_MARK, PORT188_FN1),
-+ PINMUX_DATA(SCIFB_SCK_PORT190_MARK, PORT190_FN1, MSEL5CR_17_0),
-+ PINMUX_DATA(SCIFB_RXD_PORT191_MARK, PORT191_FN1, MSEL5CR_17_0),
-+ PINMUX_DATA(SCIFB_TXD_PORT192_MARK, PORT192_FN1, MSEL5CR_17_0),
-+
-+ /* Port185 - Port192 Function3 */
-+ PINMUX_DATA(ET_ERXD0_MARK, PORT185_FN3),
-+ PINMUX_DATA(ET_ERXD1_MARK, PORT186_FN3),
-+ PINMUX_DATA(ET_ERXD2_MARK, PORT187_FN3),
-+ PINMUX_DATA(ET_ERXD3_MARK, PORT188_FN3),
-+ PINMUX_DATA(ET_ERXD4_MARK, PORT189_FN3),
-+ PINMUX_DATA(ET_ERXD5_MARK, PORT190_FN3),
-+ PINMUX_DATA(ET_ERXD6_MARK, PORT191_FN3),
-+ PINMUX_DATA(ET_ERXD7_MARK, PORT192_FN3),
-+
-+ /* Port185 - Port192 Function6 */
-+ PINMUX_DATA(STP1_IPCLK_MARK, PORT185_FN6),
-+ PINMUX_DATA(STP1_IPD0_PORT186_MARK, PORT186_FN6, MSEL5CR_23_0),
-+ PINMUX_DATA(STP1_IPEN_PORT187_MARK, PORT187_FN6, MSEL5CR_23_0),
-+ PINMUX_DATA(STP1_IPSYNC_MARK, PORT188_FN6),
-+ PINMUX_DATA(STP0_IPCLK_MARK, PORT189_FN6),
-+ PINMUX_DATA(STP0_IPD0_MARK, PORT190_FN6),
-+ PINMUX_DATA(STP0_IPEN_MARK, PORT191_FN6),
-+ PINMUX_DATA(STP0_IPSYNC_MARK, PORT192_FN6),
-+
-+ /* Port193 */
-+ PINMUX_DATA(SCIFA0_CTS_MARK, PORT193_FN1),
-+ PINMUX_DATA(RMII_CRS_DV_MARK, PORT193_FN3),
-+ PINMUX_DATA(STP1_IPEN_PORT193_MARK, PORT193_FN6, MSEL5CR_23_1), /* ? */
-+ PINMUX_DATA(LCD1_D17_MARK, PORT193_FN7),
-+
-+ /* Port194 */
-+ PINMUX_DATA(SCIFA0_RTS_MARK, PORT194_FN1),
-+ PINMUX_DATA(RMII_RX_ER_MARK, PORT194_FN3),
-+ PINMUX_DATA(STP1_IPD0_PORT194_MARK, PORT194_FN6, MSEL5CR_23_1), /* ? */
-+ PINMUX_DATA(LCD1_D16_MARK, PORT194_FN7),
-+
-+ /* Port195 */
-+ PINMUX_DATA(SCIFA1_RXD_MARK, PORT195_FN1),
-+ PINMUX_DATA(RMII_RXD0_MARK, PORT195_FN3),
-+ PINMUX_DATA(STP1_IPD3_MARK, PORT195_FN6),
-+ PINMUX_DATA(LCD1_D15_MARK, PORT195_FN7),
-+
-+ /* Port196 */
-+ PINMUX_DATA(SCIFA1_TXD_MARK, PORT196_FN1),
-+ PINMUX_DATA(RMII_RXD1_MARK, PORT196_FN3),
-+ PINMUX_DATA(STP1_IPD2_MARK, PORT196_FN6),
-+ PINMUX_DATA(LCD1_D14_MARK, PORT196_FN7),
-+
-+ /* Port197 */
-+ PINMUX_DATA(SCIFA0_RXD_MARK, PORT197_FN1),
-+ PINMUX_DATA(VIO1_CLK_MARK, PORT197_FN5),
-+ PINMUX_DATA(STP1_IPD5_MARK, PORT197_FN6),
-+ PINMUX_DATA(LCD1_D19_MARK, PORT197_FN7),
-+
-+ /* Port198 */
-+ PINMUX_DATA(SCIFA0_TXD_MARK, PORT198_FN1),
-+ PINMUX_DATA(VIO1_VD_MARK, PORT198_FN5),
-+ PINMUX_DATA(STP1_IPD4_MARK, PORT198_FN6),
-+ PINMUX_DATA(LCD1_D18_MARK, PORT198_FN7),
-+
-+ /* Port199 */
-+ PINMUX_DATA(MEMC_NWE_MARK, PORT199_FN1),
-+ PINMUX_DATA(SCIFA2_SCK_PORT199_MARK, PORT199_FN2, MSEL5CR_7_1),
-+ PINMUX_DATA(RMII_TX_EN_MARK, PORT199_FN3),
-+ PINMUX_DATA(SIM_D_PORT199_MARK, PORT199_FN4, MSEL5CR_21_1),
-+ PINMUX_DATA(STP1_IPD1_MARK, PORT199_FN6),
-+ PINMUX_DATA(LCD1_D13_MARK, PORT199_FN7),
-+
-+ /* Port200 */
-+ PINMUX_DATA(MEMC_NOE_MARK, PORT200_FN1),
-+ PINMUX_DATA(SCIFA2_RXD_MARK, PORT200_FN2),
-+ PINMUX_DATA(RMII_TXD0_MARK, PORT200_FN3),
-+ PINMUX_DATA(STP0_IPD7_MARK, PORT200_FN6),
-+ PINMUX_DATA(LCD1_D12_MARK, PORT200_FN7),
-+
-+ /* Port201 */
-+ PINMUX_DATA(MEMC_WAIT_MARK, PORT201_FN1, MSEL4CR_6_0),
-+ PINMUX_DATA(MEMC_DREQ1_MARK, PORT201_FN1, MSEL4CR_6_1),
-+
-+ PINMUX_DATA(SCIFA2_TXD_MARK, PORT201_FN2),
-+ PINMUX_DATA(RMII_TXD1_MARK, PORT201_FN3),
-+ PINMUX_DATA(STP0_IPD6_MARK, PORT201_FN6),
-+ PINMUX_DATA(LCD1_D11_MARK, PORT201_FN7),
-+
-+ /* Port202 */
-+ PINMUX_DATA(MEMC_BUSCLK_MARK, PORT202_FN1, MSEL4CR_6_0),
-+ PINMUX_DATA(MEMC_A0_MARK, PORT202_FN1, MSEL4CR_6_1),
-+
-+ PINMUX_DATA(MSIOF1_SS2_PORT202_MARK, PORT202_FN2, MSEL4CR_10_1),
-+ PINMUX_DATA(RMII_MDC_MARK, PORT202_FN3),
-+ PINMUX_DATA(TPU0TO2_PORT202_MARK, PORT202_FN4, MSEL5CR_25_1),
-+ PINMUX_DATA(IDE_CS0_MARK, PORT202_FN6),
-+ PINMUX_DATA(SDHI2_CD_PORT202_MARK, PORT202_FN7, MSEL5CR_19_1),
-+ PINMUX_DATA(IRQ21_MARK, PORT202_FN0),
-+
-+ /* Port203 - Port208 Function1 */
-+ PINMUX_DATA(SDHI2_CLK_MARK, PORT203_FN1),
-+ PINMUX_DATA(SDHI2_CMD_MARK, PORT204_FN1),
-+ PINMUX_DATA(SDHI2_D0_MARK, PORT205_FN1),
-+ PINMUX_DATA(SDHI2_D1_MARK, PORT206_FN1),
-+ PINMUX_DATA(SDHI2_D2_MARK, PORT207_FN1),
-+ PINMUX_DATA(SDHI2_D3_MARK, PORT208_FN1),
-+
-+ /* Port203 - Port208 Function3 */
-+ PINMUX_DATA(ET_TX_ER_MARK, PORT203_FN3),
-+ PINMUX_DATA(ET_RX_ER_MARK, PORT204_FN3),
-+ PINMUX_DATA(ET_CRS_MARK, PORT205_FN3),
-+ PINMUX_DATA(ET_MDC_MARK, PORT206_FN3),
-+ PINMUX_DATA(ET_MDIO_MARK, PORT207_FN3),
-+ PINMUX_DATA(RMII_MDIO_MARK, PORT208_FN3),
-+
-+ /* Port203 - Port208 Function6 */
-+ PINMUX_DATA(IDE_A2_MARK, PORT203_FN6),
-+ PINMUX_DATA(IDE_A1_MARK, PORT204_FN6),
-+ PINMUX_DATA(IDE_A0_MARK, PORT205_FN6),
-+ PINMUX_DATA(IDE_IODACK_MARK, PORT206_FN6),
-+ PINMUX_DATA(IDE_IODREQ_MARK, PORT207_FN6),
-+ PINMUX_DATA(IDE_CS1_MARK, PORT208_FN6),
-+
-+ /* Port203 - Port208 Function7 */
-+ PINMUX_DATA(SCIFA4_TXD_PORT203_MARK, PORT203_FN7, MSEL5CR_12_0, MSEL5CR_11_1),
-+ PINMUX_DATA(SCIFA4_RXD_PORT204_MARK, PORT204_FN7, MSEL5CR_12_0, MSEL5CR_11_1),
-+ PINMUX_DATA(SCIFA4_SCK_PORT205_MARK, PORT205_FN7, MSEL5CR_10_1),
-+ PINMUX_DATA(SCIFA5_SCK_PORT206_MARK, PORT206_FN7, MSEL5CR_13_1),
-+ PINMUX_DATA(SCIFA5_RXD_PORT207_MARK, PORT207_FN7, MSEL5CR_15_0, MSEL5CR_14_1),
-+ PINMUX_DATA(SCIFA5_TXD_PORT208_MARK, PORT208_FN7, MSEL5CR_15_0, MSEL5CR_14_1),
-+
-+ /* Port209 */
-+ PINMUX_DATA(VBUS_MARK, PORT209_FN1),
-+ PINMUX_DATA(IRQ7_PORT209_MARK, PORT209_FN0, MSEL1CR_7_1),
-+
-+ /* Port210 */
-+ PINMUX_DATA(IRQ9_PORT210_MARK, PORT210_FN0, MSEL1CR_9_1),
-+
-+ /* Port211 */
-+ PINMUX_DATA(IRQ16_PORT211_MARK, PORT211_FN0, MSEL1CR_16_1),
-+
-+ /* LCDC select */
-+ PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
-+ PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
-+
-+ /* SDENC */
-+ PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
-+ PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
-+
-+ /* SYSC */
-+ PINMUX_DATA(RESETP_PULLUP_MARK, MSEL4CR_4_0),
-+ PINMUX_DATA(RESETP_PLAIN_MARK, MSEL4CR_4_1),
-+
-+ /* DEBUG */
-+ PINMUX_DATA(EDEBGREQ_PULLDOWN_MARK, MSEL4CR_1_0),
-+ PINMUX_DATA(EDEBGREQ_PULLUP_MARK, MSEL4CR_1_1),
-+
-+ PINMUX_DATA(TRACEAUD_FROM_VIO_MARK, MSEL5CR_30_0, MSEL5CR_29_0),
-+ PINMUX_DATA(TRACEAUD_FROM_LCDC0_MARK, MSEL5CR_30_0, MSEL5CR_29_1),
-+ PINMUX_DATA(TRACEAUD_FROM_MEMC_MARK, MSEL5CR_30_1, MSEL5CR_29_0),
-+};
-+
-+static struct pinmux_gpio pinmux_gpios[] = {
-+
-+ /* PORT */
-+ GPIO_PORT_ALL(),
-+
-+ /* IRQ */
-+ GPIO_FN(IRQ0_PORT2), GPIO_FN(IRQ0_PORT13),
-+ GPIO_FN(IRQ1),
-+ GPIO_FN(IRQ2_PORT11), GPIO_FN(IRQ2_PORT12),
-+ GPIO_FN(IRQ3_PORT10), GPIO_FN(IRQ3_PORT14),
-+ GPIO_FN(IRQ4_PORT15), GPIO_FN(IRQ4_PORT172),
-+ GPIO_FN(IRQ5_PORT0), GPIO_FN(IRQ5_PORT1),
-+ GPIO_FN(IRQ6_PORT121), GPIO_FN(IRQ6_PORT173),
-+ GPIO_FN(IRQ7_PORT120), GPIO_FN(IRQ7_PORT209),
-+ GPIO_FN(IRQ8),
-+ GPIO_FN(IRQ9_PORT118), GPIO_FN(IRQ9_PORT210),
-+ GPIO_FN(IRQ10),
-+ GPIO_FN(IRQ11),
-+ GPIO_FN(IRQ12_PORT42), GPIO_FN(IRQ12_PORT97),
-+ GPIO_FN(IRQ13_PORT64), GPIO_FN(IRQ13_PORT98),
-+ GPIO_FN(IRQ14_PORT63), GPIO_FN(IRQ14_PORT99),
-+ GPIO_FN(IRQ15_PORT62), GPIO_FN(IRQ15_PORT100),
-+ GPIO_FN(IRQ16_PORT68), GPIO_FN(IRQ16_PORT211),
-+ GPIO_FN(IRQ17),
-+ GPIO_FN(IRQ18),
-+ GPIO_FN(IRQ19),
-+ GPIO_FN(IRQ20),
-+ GPIO_FN(IRQ21),
-+ GPIO_FN(IRQ22),
-+ GPIO_FN(IRQ23),
-+ GPIO_FN(IRQ24),
-+ GPIO_FN(IRQ25),
-+ GPIO_FN(IRQ26_PORT58), GPIO_FN(IRQ26_PORT81),
-+ GPIO_FN(IRQ27_PORT57), GPIO_FN(IRQ27_PORT168),
-+ GPIO_FN(IRQ28_PORT56), GPIO_FN(IRQ28_PORT169),
-+ GPIO_FN(IRQ29_PORT50), GPIO_FN(IRQ29_PORT170),
-+ GPIO_FN(IRQ30_PORT49), GPIO_FN(IRQ30_PORT171),
-+ GPIO_FN(IRQ31_PORT41), GPIO_FN(IRQ31_PORT167),
-+
-+ /* Function */
-+
-+ /* DBGT */
-+ GPIO_FN(DBGMDT2), GPIO_FN(DBGMDT1), GPIO_FN(DBGMDT0),
-+ GPIO_FN(DBGMD10), GPIO_FN(DBGMD11), GPIO_FN(DBGMD20),
-+ GPIO_FN(DBGMD21),
-+
-+ /* FSI */
-+ GPIO_FN(FSIAISLD_PORT0), /* FSIAISLD Port 0/5 */
-+ GPIO_FN(FSIAISLD_PORT5),
-+ GPIO_FN(FSIASPDIF_PORT9), /* FSIASPDIF Port 9/18 */
-+ GPIO_FN(FSIASPDIF_PORT18),
-+ GPIO_FN(FSIAOSLD1), GPIO_FN(FSIAOSLD2), GPIO_FN(FSIAOLR),
-+ GPIO_FN(FSIAOBT), GPIO_FN(FSIAOSLD), GPIO_FN(FSIAOMC),
-+ GPIO_FN(FSIACK), GPIO_FN(FSIAILR), GPIO_FN(FSIAIBT),
-+
-+ /* FMSI */
-+ GPIO_FN(FMSISLD_PORT1), /* FMSISLD Port 1/6 */
-+ GPIO_FN(FMSISLD_PORT6),
-+ GPIO_FN(FMSIILR), GPIO_FN(FMSIIBT), GPIO_FN(FMSIOLR),
-+ GPIO_FN(FMSIOBT), GPIO_FN(FMSICK), GPIO_FN(FMSOILR),
-+ GPIO_FN(FMSOIBT), GPIO_FN(FMSOOLR), GPIO_FN(FMSOOBT),
-+ GPIO_FN(FMSOSLD), GPIO_FN(FMSOCK),
-+
-+ /* SCIFA0 */
-+ GPIO_FN(SCIFA0_SCK), GPIO_FN(SCIFA0_CTS), GPIO_FN(SCIFA0_RTS),
-+ GPIO_FN(SCIFA0_RXD), GPIO_FN(SCIFA0_TXD),
-+
-+ /* SCIFA1 */
-+ GPIO_FN(SCIFA1_CTS), GPIO_FN(SCIFA1_SCK),
-+ GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_TXD), GPIO_FN(SCIFA1_RTS),
-+
-+ /* SCIFA2 */
-+ GPIO_FN(SCIFA2_SCK_PORT22), /* SCIFA2_SCK Port 22/199 */
-+ GPIO_FN(SCIFA2_SCK_PORT199),
-+ GPIO_FN(SCIFA2_RXD), GPIO_FN(SCIFA2_TXD),
-+ GPIO_FN(SCIFA2_CTS), GPIO_FN(SCIFA2_RTS),
-+
-+ /* SCIFA3 */
-+ GPIO_FN(SCIFA3_RTS_PORT105), /* MSEL5CR_8_0 */
-+ GPIO_FN(SCIFA3_SCK_PORT116),
-+ GPIO_FN(SCIFA3_CTS_PORT117),
-+ GPIO_FN(SCIFA3_RXD_PORT174),
-+ GPIO_FN(SCIFA3_TXD_PORT175),
-+
-+ GPIO_FN(SCIFA3_RTS_PORT161), /* MSEL5CR_8_1 */
-+ GPIO_FN(SCIFA3_SCK_PORT158),
-+ GPIO_FN(SCIFA3_CTS_PORT162),
-+ GPIO_FN(SCIFA3_RXD_PORT159),
-+ GPIO_FN(SCIFA3_TXD_PORT160),
-+
-+ /* SCIFA4 */
-+ GPIO_FN(SCIFA4_RXD_PORT12), /* MSEL5CR[12:11] = 00 */
-+ GPIO_FN(SCIFA4_TXD_PORT13),
-+
-+ GPIO_FN(SCIFA4_RXD_PORT204), /* MSEL5CR[12:11] = 01 */
-+ GPIO_FN(SCIFA4_TXD_PORT203),
-+
-+ GPIO_FN(SCIFA4_RXD_PORT94), /* MSEL5CR[12:11] = 10 */
-+ GPIO_FN(SCIFA4_TXD_PORT93),
-+
-+ GPIO_FN(SCIFA4_SCK_PORT21), /* SCIFA4_SCK Port 21/205 */
-+ GPIO_FN(SCIFA4_SCK_PORT205),
-+
-+ /* SCIFA5 */
-+ GPIO_FN(SCIFA5_TXD_PORT20), /* MSEL5CR[15:14] = 00 */
-+ GPIO_FN(SCIFA5_RXD_PORT10),
-+
-+ GPIO_FN(SCIFA5_RXD_PORT207), /* MSEL5CR[15:14] = 01 */
-+ GPIO_FN(SCIFA5_TXD_PORT208),
-+
-+ GPIO_FN(SCIFA5_TXD_PORT91), /* MSEL5CR[15:14] = 10 */
-+ GPIO_FN(SCIFA5_RXD_PORT92),
-+
-+ GPIO_FN(SCIFA5_SCK_PORT23), /* SCIFA5_SCK Port 23/206 */
-+ GPIO_FN(SCIFA5_SCK_PORT206),
-+
-+ /* SCIFA6 */
-+ GPIO_FN(SCIFA6_SCK), GPIO_FN(SCIFA6_RXD), GPIO_FN(SCIFA6_TXD),
-+
-+ /* SCIFA7 */
-+ GPIO_FN(SCIFA7_TXD), GPIO_FN(SCIFA7_RXD),
-+
-+ /* SCIFAB */
-+ GPIO_FN(SCIFB_SCK_PORT190), /* MSEL5CR_17_0 */
-+ GPIO_FN(SCIFB_RXD_PORT191),
-+ GPIO_FN(SCIFB_TXD_PORT192),
-+ GPIO_FN(SCIFB_RTS_PORT186),
-+ GPIO_FN(SCIFB_CTS_PORT187),
-+
-+ GPIO_FN(SCIFB_SCK_PORT2), /* MSEL5CR_17_1 */
-+ GPIO_FN(SCIFB_RXD_PORT3),
-+ GPIO_FN(SCIFB_TXD_PORT4),
-+ GPIO_FN(SCIFB_RTS_PORT172),
-+ GPIO_FN(SCIFB_CTS_PORT173),
-+
-+ /* LCD0 */
-+ GPIO_FN(LCD0_D0), GPIO_FN(LCD0_D1), GPIO_FN(LCD0_D2),
-+ GPIO_FN(LCD0_D3), GPIO_FN(LCD0_D4), GPIO_FN(LCD0_D5),
-+ GPIO_FN(LCD0_D6), GPIO_FN(LCD0_D7), GPIO_FN(LCD0_D8),
-+ GPIO_FN(LCD0_D9), GPIO_FN(LCD0_D10), GPIO_FN(LCD0_D11),
-+ GPIO_FN(LCD0_D12), GPIO_FN(LCD0_D13), GPIO_FN(LCD0_D14),
-+ GPIO_FN(LCD0_D15), GPIO_FN(LCD0_D16), GPIO_FN(LCD0_D17),
-+ GPIO_FN(LCD0_DON), GPIO_FN(LCD0_VCPWC), GPIO_FN(LCD0_VEPWC),
-+ GPIO_FN(LCD0_DCK), GPIO_FN(LCD0_VSYN),
-+ GPIO_FN(LCD0_HSYN), GPIO_FN(LCD0_DISP),
-+ GPIO_FN(LCD0_WR), GPIO_FN(LCD0_RD),
-+ GPIO_FN(LCD0_CS), GPIO_FN(LCD0_RS),
-+
-+ GPIO_FN(LCD0_D18_PORT163), GPIO_FN(LCD0_D19_PORT162),
-+ GPIO_FN(LCD0_D20_PORT161), GPIO_FN(LCD0_D21_PORT158),
-+ GPIO_FN(LCD0_D22_PORT160), GPIO_FN(LCD0_D23_PORT159),
-+ GPIO_FN(LCD0_LCLK_PORT165), /* MSEL5CR_6_1 */
-+
-+ GPIO_FN(LCD0_D18_PORT40), GPIO_FN(LCD0_D19_PORT4),
-+ GPIO_FN(LCD0_D20_PORT3), GPIO_FN(LCD0_D21_PORT2),
-+ GPIO_FN(LCD0_D22_PORT0), GPIO_FN(LCD0_D23_PORT1),
-+ GPIO_FN(LCD0_LCLK_PORT102), /* MSEL5CR_6_0 */
-+
-+ /* LCD1 */
-+ GPIO_FN(LCD1_D0), GPIO_FN(LCD1_D1), GPIO_FN(LCD1_D2),
-+ GPIO_FN(LCD1_D3), GPIO_FN(LCD1_D4), GPIO_FN(LCD1_D5),
-+ GPIO_FN(LCD1_D6), GPIO_FN(LCD1_D7), GPIO_FN(LCD1_D8),
-+ GPIO_FN(LCD1_D9), GPIO_FN(LCD1_D10), GPIO_FN(LCD1_D11),
-+ GPIO_FN(LCD1_D12), GPIO_FN(LCD1_D13), GPIO_FN(LCD1_D14),
-+ GPIO_FN(LCD1_D15), GPIO_FN(LCD1_D16), GPIO_FN(LCD1_D17),
-+ GPIO_FN(LCD1_D18), GPIO_FN(LCD1_D19), GPIO_FN(LCD1_D20),
-+ GPIO_FN(LCD1_D21), GPIO_FN(LCD1_D22), GPIO_FN(LCD1_D23),
-+ GPIO_FN(LCD1_RS), GPIO_FN(LCD1_RD), GPIO_FN(LCD1_CS),
-+ GPIO_FN(LCD1_WR), GPIO_FN(LCD1_DCK), GPIO_FN(LCD1_DON),
-+ GPIO_FN(LCD1_VCPWC), GPIO_FN(LCD1_LCLK), GPIO_FN(LCD1_HSYN),
-+ GPIO_FN(LCD1_VSYN), GPIO_FN(LCD1_VEPWC), GPIO_FN(LCD1_DISP),
-+
-+ /* RSPI */
-+ GPIO_FN(RSPI_SSL0_A), GPIO_FN(RSPI_SSL1_A), GPIO_FN(RSPI_SSL2_A),
-+ GPIO_FN(RSPI_SSL3_A), GPIO_FN(RSPI_CK_A), GPIO_FN(RSPI_MOSI_A),
-+ GPIO_FN(RSPI_MISO_A),
-+
-+ /* VIO CKO */
-+ GPIO_FN(VIO_CKO1),
-+ GPIO_FN(VIO_CKO2),
-+ GPIO_FN(VIO_CKO_1),
-+ GPIO_FN(VIO_CKO),
-+
-+ /* VIO0 */
-+ GPIO_FN(VIO0_D0), GPIO_FN(VIO0_D1), GPIO_FN(VIO0_D2),
-+ GPIO_FN(VIO0_D3), GPIO_FN(VIO0_D4), GPIO_FN(VIO0_D5),
-+ GPIO_FN(VIO0_D6), GPIO_FN(VIO0_D7), GPIO_FN(VIO0_D8),
-+ GPIO_FN(VIO0_D9), GPIO_FN(VIO0_D10), GPIO_FN(VIO0_D11),
-+ GPIO_FN(VIO0_D12), GPIO_FN(VIO0_VD), GPIO_FN(VIO0_HD),
-+ GPIO_FN(VIO0_CLK), GPIO_FN(VIO0_FIELD),
-+
-+ GPIO_FN(VIO0_D13_PORT26), /* MSEL5CR_27_0 */
-+ GPIO_FN(VIO0_D14_PORT25),
-+ GPIO_FN(VIO0_D15_PORT24),
-+
-+ GPIO_FN(VIO0_D13_PORT22), /* MSEL5CR_27_1 */
-+ GPIO_FN(VIO0_D14_PORT95),
-+ GPIO_FN(VIO0_D15_PORT96),
-+
-+ /* VIO1 */
-+ GPIO_FN(VIO1_D0), GPIO_FN(VIO1_D1), GPIO_FN(VIO1_D2),
-+ GPIO_FN(VIO1_D3), GPIO_FN(VIO1_D4), GPIO_FN(VIO1_D5),
-+ GPIO_FN(VIO1_D6), GPIO_FN(VIO1_D7), GPIO_FN(VIO1_VD),
-+ GPIO_FN(VIO1_HD), GPIO_FN(VIO1_CLK), GPIO_FN(VIO1_FIELD),
-+
-+ /* TPU0 */
-+ GPIO_FN(TPU0TO0), GPIO_FN(TPU0TO1), GPIO_FN(TPU0TO3),
-+ GPIO_FN(TPU0TO2_PORT66), /* TPU0TO2 Port 66/202 */
-+ GPIO_FN(TPU0TO2_PORT202),
-+
-+ /* SSP1 0 */
-+ GPIO_FN(STP0_IPD0), GPIO_FN(STP0_IPD1), GPIO_FN(STP0_IPD2),
-+ GPIO_FN(STP0_IPD3), GPIO_FN(STP0_IPD4), GPIO_FN(STP0_IPD5),
-+ GPIO_FN(STP0_IPD6), GPIO_FN(STP0_IPD7), GPIO_FN(STP0_IPEN),
-+ GPIO_FN(STP0_IPCLK), GPIO_FN(STP0_IPSYNC),
-+
-+ /* SSP1 1 */
-+ GPIO_FN(STP1_IPD1), GPIO_FN(STP1_IPD2), GPIO_FN(STP1_IPD3),
-+ GPIO_FN(STP1_IPD4), GPIO_FN(STP1_IPD5), GPIO_FN(STP1_IPD6),
-+ GPIO_FN(STP1_IPD7), GPIO_FN(STP1_IPCLK), GPIO_FN(STP1_IPSYNC),
-+
-+ GPIO_FN(STP1_IPD0_PORT186), /* MSEL5CR_23_0 */
-+ GPIO_FN(STP1_IPEN_PORT187),
-+
-+ GPIO_FN(STP1_IPD0_PORT194), /* MSEL5CR_23_1 */
-+ GPIO_FN(STP1_IPEN_PORT193),
-+
-+ /* SIM */
-+ GPIO_FN(SIM_RST), GPIO_FN(SIM_CLK),
-+ GPIO_FN(SIM_D_PORT22), /* SIM_D Port 22/199 */
-+ GPIO_FN(SIM_D_PORT199),
-+
-+ /* SDHI0 */
-+ GPIO_FN(SDHI0_D0), GPIO_FN(SDHI0_D1), GPIO_FN(SDHI0_D2),
-+ GPIO_FN(SDHI0_D3), GPIO_FN(SDHI0_CD), GPIO_FN(SDHI0_WP),
-+ GPIO_FN(SDHI0_CMD), GPIO_FN(SDHI0_CLK),
-+
-+ /* SDHI1 */
-+ GPIO_FN(SDHI1_D0), GPIO_FN(SDHI1_D1), GPIO_FN(SDHI1_D2),
-+ GPIO_FN(SDHI1_D3), GPIO_FN(SDHI1_CD), GPIO_FN(SDHI1_WP),
-+ GPIO_FN(SDHI1_CMD), GPIO_FN(SDHI1_CLK),
-+
-+ /* SDHI2 */
-+ GPIO_FN(SDHI2_D0), GPIO_FN(SDHI2_D1), GPIO_FN(SDHI2_D2),
-+ GPIO_FN(SDHI2_D3), GPIO_FN(SDHI2_CLK), GPIO_FN(SDHI2_CMD),
-+
-+ GPIO_FN(SDHI2_CD_PORT24), /* MSEL5CR_19_0 */
-+ GPIO_FN(SDHI2_WP_PORT25),
-+
-+ GPIO_FN(SDHI2_WP_PORT177), /* MSEL5CR_19_1 */
-+ GPIO_FN(SDHI2_CD_PORT202),
-+
-+ /* MSIOF2 */
-+ GPIO_FN(MSIOF2_TXD), GPIO_FN(MSIOF2_RXD), GPIO_FN(MSIOF2_TSCK),
-+ GPIO_FN(MSIOF2_SS2), GPIO_FN(MSIOF2_TSYNC), GPIO_FN(MSIOF2_SS1),
-+ GPIO_FN(MSIOF2_MCK1), GPIO_FN(MSIOF2_MCK0), GPIO_FN(MSIOF2_RSYNC),
-+ GPIO_FN(MSIOF2_RSCK),
-+
-+ /* KEYSC */
-+ GPIO_FN(KEYIN4), GPIO_FN(KEYIN5),
-+ GPIO_FN(KEYIN6), GPIO_FN(KEYIN7),
-+ GPIO_FN(KEYOUT0), GPIO_FN(KEYOUT1), GPIO_FN(KEYOUT2),
-+ GPIO_FN(KEYOUT3), GPIO_FN(KEYOUT4), GPIO_FN(KEYOUT5),
-+ GPIO_FN(KEYOUT6), GPIO_FN(KEYOUT7),
-+
-+ GPIO_FN(KEYIN0_PORT43), /* MSEL4CR_18_0 */
-+ GPIO_FN(KEYIN1_PORT44),
-+ GPIO_FN(KEYIN2_PORT45),
-+ GPIO_FN(KEYIN3_PORT46),
-+
-+ GPIO_FN(KEYIN0_PORT58), /* MSEL4CR_18_1 */
-+ GPIO_FN(KEYIN1_PORT57),
-+ GPIO_FN(KEYIN2_PORT56),
-+ GPIO_FN(KEYIN3_PORT55),
-+
-+ /* VOU */
-+ GPIO_FN(DV_D0), GPIO_FN(DV_D1), GPIO_FN(DV_D2),
-+ GPIO_FN(DV_D3), GPIO_FN(DV_D4), GPIO_FN(DV_D5),
-+ GPIO_FN(DV_D6), GPIO_FN(DV_D7), GPIO_FN(DV_D8),
-+ GPIO_FN(DV_D9), GPIO_FN(DV_D10), GPIO_FN(DV_D11),
-+ GPIO_FN(DV_D12), GPIO_FN(DV_D13), GPIO_FN(DV_D14),
-+ GPIO_FN(DV_D15), GPIO_FN(DV_CLK),
-+ GPIO_FN(DV_VSYNC), GPIO_FN(DV_HSYNC),
-+
-+ /* MEMC */
-+ GPIO_FN(MEMC_AD0), GPIO_FN(MEMC_AD1), GPIO_FN(MEMC_AD2),
-+ GPIO_FN(MEMC_AD3), GPIO_FN(MEMC_AD4), GPIO_FN(MEMC_AD5),
-+ GPIO_FN(MEMC_AD6), GPIO_FN(MEMC_AD7), GPIO_FN(MEMC_AD8),
-+ GPIO_FN(MEMC_AD9), GPIO_FN(MEMC_AD10), GPIO_FN(MEMC_AD11),
-+ GPIO_FN(MEMC_AD12), GPIO_FN(MEMC_AD13), GPIO_FN(MEMC_AD14),
-+ GPIO_FN(MEMC_AD15), GPIO_FN(MEMC_CS0), GPIO_FN(MEMC_INT),
-+ GPIO_FN(MEMC_NWE), GPIO_FN(MEMC_NOE), GPIO_FN(MEMC_CS1),
-+ GPIO_FN(MEMC_A1), GPIO_FN(MEMC_ADV), GPIO_FN(MEMC_DREQ0),
-+ GPIO_FN(MEMC_WAIT), GPIO_FN(MEMC_DREQ1), GPIO_FN(MEMC_BUSCLK),
-+ GPIO_FN(MEMC_A0),
-+
-+ /* MMC */
-+ GPIO_FN(MMC0_D0_PORT68), GPIO_FN(MMC0_D1_PORT69),
-+ GPIO_FN(MMC0_D2_PORT70), GPIO_FN(MMC0_D3_PORT71),
-+ GPIO_FN(MMC0_D4_PORT72), GPIO_FN(MMC0_D5_PORT73),
-+ GPIO_FN(MMC0_D6_PORT74), GPIO_FN(MMC0_D7_PORT75),
-+ GPIO_FN(MMC0_CLK_PORT66),
-+ GPIO_FN(MMC0_CMD_PORT67), /* MSEL4CR_15_0 */
-+
-+ GPIO_FN(MMC1_D0_PORT149), GPIO_FN(MMC1_D1_PORT148),
-+ GPIO_FN(MMC1_D2_PORT147), GPIO_FN(MMC1_D3_PORT146),
-+ GPIO_FN(MMC1_D4_PORT145), GPIO_FN(MMC1_D5_PORT144),
-+ GPIO_FN(MMC1_D6_PORT143), GPIO_FN(MMC1_D7_PORT142),
-+ GPIO_FN(MMC1_CLK_PORT103),
-+ GPIO_FN(MMC1_CMD_PORT104), /* MSEL4CR_15_1 */
-+
-+ /* MSIOF0 */
-+ GPIO_FN(MSIOF0_SS1), GPIO_FN(MSIOF0_SS2), GPIO_FN(MSIOF0_RXD),
-+ GPIO_FN(MSIOF0_TXD), GPIO_FN(MSIOF0_MCK0), GPIO_FN(MSIOF0_MCK1),
-+ GPIO_FN(MSIOF0_RSYNC), GPIO_FN(MSIOF0_RSCK), GPIO_FN(MSIOF0_TSCK),
-+ GPIO_FN(MSIOF0_TSYNC),
-+
-+ /* MSIOF1 */
-+ GPIO_FN(MSIOF1_RSCK), GPIO_FN(MSIOF1_RSYNC),
-+ GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
-+
-+ GPIO_FN(MSIOF1_SS2_PORT116), GPIO_FN(MSIOF1_SS1_PORT117),
-+ GPIO_FN(MSIOF1_RXD_PORT118), GPIO_FN(MSIOF1_TXD_PORT119),
-+ GPIO_FN(MSIOF1_TSYNC_PORT120),
-+ GPIO_FN(MSIOF1_TSCK_PORT121), /* MSEL4CR_10_0 */
-+
-+ GPIO_FN(MSIOF1_SS1_PORT67), GPIO_FN(MSIOF1_TSCK_PORT72),
-+ GPIO_FN(MSIOF1_TSYNC_PORT73), GPIO_FN(MSIOF1_TXD_PORT74),
-+ GPIO_FN(MSIOF1_RXD_PORT75),
-+ GPIO_FN(MSIOF1_SS2_PORT202), /* MSEL4CR_10_1 */
-+
-+ /* GPIO */
-+ GPIO_FN(GPO0), GPIO_FN(GPI0),
-+ GPIO_FN(GPO1), GPIO_FN(GPI1),
-+
-+ /* USB0 */
-+ GPIO_FN(USB0_OCI), GPIO_FN(USB0_PPON), GPIO_FN(VBUS),
-+
-+ /* USB1 */
-+ GPIO_FN(USB1_OCI), GPIO_FN(USB1_PPON),
-+
-+ /* BBIF1 */
-+ GPIO_FN(BBIF1_RXD), GPIO_FN(BBIF1_TXD), GPIO_FN(BBIF1_TSYNC),
-+ GPIO_FN(BBIF1_TSCK), GPIO_FN(BBIF1_RSCK), GPIO_FN(BBIF1_RSYNC),
-+ GPIO_FN(BBIF1_FLOW), GPIO_FN(BBIF1_RX_FLOW_N),
-+
-+ /* BBIF2 */
-+ GPIO_FN(BBIF2_TXD2_PORT5), /* MSEL5CR_0_0 */
-+ GPIO_FN(BBIF2_RXD2_PORT60),
-+ GPIO_FN(BBIF2_TSYNC2_PORT6),
-+ GPIO_FN(BBIF2_TSCK2_PORT59),
-+
-+ GPIO_FN(BBIF2_RXD2_PORT90), /* MSEL5CR_0_1 */
-+ GPIO_FN(BBIF2_TXD2_PORT183),
-+ GPIO_FN(BBIF2_TSCK2_PORT89),
-+ GPIO_FN(BBIF2_TSYNC2_PORT184),
-+
-+ /* BSC / FLCTL / PCMCIA */
-+ GPIO_FN(CS0), GPIO_FN(CS2), GPIO_FN(CS4),
-+ GPIO_FN(CS5B), GPIO_FN(CS6A),
-+ GPIO_FN(CS5A_PORT105), /* CS5A PORT 19/105 */
-+ GPIO_FN(CS5A_PORT19),
-+ GPIO_FN(IOIS16), /* ? */
-+
-+ GPIO_FN(A0), GPIO_FN(A1), GPIO_FN(A2), GPIO_FN(A3),
-+ GPIO_FN(A4_FOE), GPIO_FN(A5_FCDE), /* share with FLCTL */
-+ GPIO_FN(A6), GPIO_FN(A7), GPIO_FN(A8), GPIO_FN(A9),
-+ GPIO_FN(A10), GPIO_FN(A11), GPIO_FN(A12), GPIO_FN(A13),
-+ GPIO_FN(A14), GPIO_FN(A15), GPIO_FN(A16), GPIO_FN(A17),
-+ GPIO_FN(A18), GPIO_FN(A19), GPIO_FN(A20), GPIO_FN(A21),
-+ GPIO_FN(A22), GPIO_FN(A23), GPIO_FN(A24), GPIO_FN(A25),
-+ GPIO_FN(A26),
-+
-+ GPIO_FN(D0_NAF0), GPIO_FN(D1_NAF1), /* share with FLCTL */
-+ GPIO_FN(D2_NAF2), GPIO_FN(D3_NAF3), /* share with FLCTL */
-+ GPIO_FN(D4_NAF4), GPIO_FN(D5_NAF5), /* share with FLCTL */
-+ GPIO_FN(D6_NAF6), GPIO_FN(D7_NAF7), /* share with FLCTL */
-+ GPIO_FN(D8_NAF8), GPIO_FN(D9_NAF9), /* share with FLCTL */
-+ GPIO_FN(D10_NAF10), GPIO_FN(D11_NAF11), /* share with FLCTL */
-+ GPIO_FN(D12_NAF12), GPIO_FN(D13_NAF13), /* share with FLCTL */
-+ GPIO_FN(D14_NAF14), GPIO_FN(D15_NAF15), /* share with FLCTL */
-+ GPIO_FN(D16), GPIO_FN(D17), GPIO_FN(D18), GPIO_FN(D19),
-+ GPIO_FN(D20), GPIO_FN(D21), GPIO_FN(D22), GPIO_FN(D23),
-+ GPIO_FN(D24), GPIO_FN(D25), GPIO_FN(D26), GPIO_FN(D27),
-+ GPIO_FN(D28), GPIO_FN(D29), GPIO_FN(D30), GPIO_FN(D31),
-+
-+ GPIO_FN(WE0_FWE), /* share with FLCTL */
-+ GPIO_FN(WE1),
-+ GPIO_FN(WE2_ICIORD), /* share with PCMCIA */
-+ GPIO_FN(WE3_ICIOWR), /* share with PCMCIA */
-+ GPIO_FN(CKO), GPIO_FN(BS), GPIO_FN(RDWR),
-+ GPIO_FN(RD_FSC), /* share with FLCTL */
-+ GPIO_FN(WAIT_PORT177), /* WAIT Port 90/177 */
-+ GPIO_FN(WAIT_PORT90),
-+
-+ GPIO_FN(FCE0), GPIO_FN(FCE1), GPIO_FN(FRB), /* FLCTL */
-+
-+ /* IRDA */
-+ GPIO_FN(IRDA_FIRSEL), GPIO_FN(IRDA_IN), GPIO_FN(IRDA_OUT),
-+
-+ /* ATAPI */
-+ GPIO_FN(IDE_D0), GPIO_FN(IDE_D1), GPIO_FN(IDE_D2),
-+ GPIO_FN(IDE_D3), GPIO_FN(IDE_D4), GPIO_FN(IDE_D5),
-+ GPIO_FN(IDE_D6), GPIO_FN(IDE_D7), GPIO_FN(IDE_D8),
-+ GPIO_FN(IDE_D9), GPIO_FN(IDE_D10), GPIO_FN(IDE_D11),
-+ GPIO_FN(IDE_D12), GPIO_FN(IDE_D13), GPIO_FN(IDE_D14),
-+ GPIO_FN(IDE_D15), GPIO_FN(IDE_A0), GPIO_FN(IDE_A1),
-+ GPIO_FN(IDE_A2), GPIO_FN(IDE_CS0), GPIO_FN(IDE_CS1),
-+ GPIO_FN(IDE_IOWR), GPIO_FN(IDE_IORD), GPIO_FN(IDE_IORDY),
-+ GPIO_FN(IDE_INT), GPIO_FN(IDE_RST), GPIO_FN(IDE_DIRECTION),
-+ GPIO_FN(IDE_EXBUF_ENB), GPIO_FN(IDE_IODACK), GPIO_FN(IDE_IODREQ),
-+
-+ /* RMII */
-+ GPIO_FN(RMII_CRS_DV), GPIO_FN(RMII_RX_ER), GPIO_FN(RMII_RXD0),
-+ GPIO_FN(RMII_RXD1), GPIO_FN(RMII_TX_EN), GPIO_FN(RMII_TXD0),
-+ GPIO_FN(RMII_MDC), GPIO_FN(RMII_TXD1), GPIO_FN(RMII_MDIO),
-+ GPIO_FN(RMII_REF50CK), GPIO_FN(RMII_REF125CK), /* for GMII */
-+
-+ /* GEther */
-+ GPIO_FN(ET_TX_CLK), GPIO_FN(ET_TX_EN), GPIO_FN(ET_ETXD0),
-+ GPIO_FN(ET_ETXD1), GPIO_FN(ET_ETXD2), GPIO_FN(ET_ETXD3),
-+ GPIO_FN(ET_ETXD4), GPIO_FN(ET_ETXD5), /* for GEther */
-+ GPIO_FN(ET_ETXD6), GPIO_FN(ET_ETXD7), /* for GEther */
-+ GPIO_FN(ET_COL), GPIO_FN(ET_TX_ER), GPIO_FN(ET_RX_CLK),
-+ GPIO_FN(ET_RX_DV), GPIO_FN(ET_ERXD0), GPIO_FN(ET_ERXD1),
-+ GPIO_FN(ET_ERXD2), GPIO_FN(ET_ERXD3),
-+ GPIO_FN(ET_ERXD4), GPIO_FN(ET_ERXD5), /* for GEther */
-+ GPIO_FN(ET_ERXD6), GPIO_FN(ET_ERXD7), /* for GEther */
-+ GPIO_FN(ET_RX_ER), GPIO_FN(ET_CRS), GPIO_FN(ET_MDC),
-+ GPIO_FN(ET_MDIO), GPIO_FN(ET_LINK), GPIO_FN(ET_PHY_INT),
-+ GPIO_FN(ET_WOL), GPIO_FN(ET_GTX_CLK),
-+
-+ /* DMA0 */
-+ GPIO_FN(DREQ0), GPIO_FN(DACK0),
-+
-+ /* DMA1 */
-+ GPIO_FN(DREQ1), GPIO_FN(DACK1),
-+
-+ /* SYSC */
-+ GPIO_FN(RESETOUTS),
-+
-+ /* IRREM */
-+ GPIO_FN(IROUT),
-+
-+ /* LCDC */
-+ GPIO_FN(LCDC0_SELECT),
-+ GPIO_FN(LCDC1_SELECT),
-+
-+ /* SDENC */
-+ GPIO_FN(SDENC_CPG),
-+ GPIO_FN(SDENC_DV_CLKI),
-+
-+ /* SYSC */
-+ GPIO_FN(RESETP_PULLUP),
-+ GPIO_FN(RESETP_PLAIN),
-+
-+ /* DEBUG */
-+ GPIO_FN(EDEBGREQ_PULLDOWN),
-+ GPIO_FN(EDEBGREQ_PULLUP),
-+
-+ GPIO_FN(TRACEAUD_FROM_VIO),
-+ GPIO_FN(TRACEAUD_FROM_LCDC0),
-+ GPIO_FN(TRACEAUD_FROM_MEMC),
-+};
-+
-+static struct pinmux_cfg_reg pinmux_config_regs[] = {
-+ PORTCR(0, 0xe6050000), /* PORT0CR */
-+ PORTCR(1, 0xe6050001), /* PORT1CR */
-+ PORTCR(2, 0xe6050002), /* PORT2CR */
-+ PORTCR(3, 0xe6050003), /* PORT3CR */
-+ PORTCR(4, 0xe6050004), /* PORT4CR */
-+ PORTCR(5, 0xe6050005), /* PORT5CR */
-+ PORTCR(6, 0xe6050006), /* PORT6CR */
-+ PORTCR(7, 0xe6050007), /* PORT7CR */
-+ PORTCR(8, 0xe6050008), /* PORT8CR */
-+ PORTCR(9, 0xe6050009), /* PORT9CR */
-+ PORTCR(10, 0xe605000a), /* PORT10CR */
-+ PORTCR(11, 0xe605000b), /* PORT11CR */
-+ PORTCR(12, 0xe605000c), /* PORT12CR */
-+ PORTCR(13, 0xe605000d), /* PORT13CR */
-+ PORTCR(14, 0xe605000e), /* PORT14CR */
-+ PORTCR(15, 0xe605000f), /* PORT15CR */
-+ PORTCR(16, 0xe6050010), /* PORT16CR */
-+ PORTCR(17, 0xe6050011), /* PORT17CR */
-+ PORTCR(18, 0xe6050012), /* PORT18CR */
-+ PORTCR(19, 0xe6050013), /* PORT19CR */
-+ PORTCR(20, 0xe6050014), /* PORT20CR */
-+ PORTCR(21, 0xe6050015), /* PORT21CR */
-+ PORTCR(22, 0xe6050016), /* PORT22CR */
-+ PORTCR(23, 0xe6050017), /* PORT23CR */
-+ PORTCR(24, 0xe6050018), /* PORT24CR */
-+ PORTCR(25, 0xe6050019), /* PORT25CR */
-+ PORTCR(26, 0xe605001a), /* PORT26CR */
-+ PORTCR(27, 0xe605001b), /* PORT27CR */
-+ PORTCR(28, 0xe605001c), /* PORT28CR */
-+ PORTCR(29, 0xe605001d), /* PORT29CR */
-+ PORTCR(30, 0xe605001e), /* PORT30CR */
-+ PORTCR(31, 0xe605001f), /* PORT31CR */
-+ PORTCR(32, 0xe6050020), /* PORT32CR */
-+ PORTCR(33, 0xe6050021), /* PORT33CR */
-+ PORTCR(34, 0xe6050022), /* PORT34CR */
-+ PORTCR(35, 0xe6050023), /* PORT35CR */
-+ PORTCR(36, 0xe6050024), /* PORT36CR */
-+ PORTCR(37, 0xe6050025), /* PORT37CR */
-+ PORTCR(38, 0xe6050026), /* PORT38CR */
-+ PORTCR(39, 0xe6050027), /* PORT39CR */
-+ PORTCR(40, 0xe6050028), /* PORT40CR */
-+ PORTCR(41, 0xe6050029), /* PORT41CR */
-+ PORTCR(42, 0xe605002a), /* PORT42CR */
-+ PORTCR(43, 0xe605002b), /* PORT43CR */
-+ PORTCR(44, 0xe605002c), /* PORT44CR */
-+ PORTCR(45, 0xe605002d), /* PORT45CR */
-+ PORTCR(46, 0xe605002e), /* PORT46CR */
-+ PORTCR(47, 0xe605002f), /* PORT47CR */
-+ PORTCR(48, 0xe6050030), /* PORT48CR */
-+ PORTCR(49, 0xe6050031), /* PORT49CR */
-+ PORTCR(50, 0xe6050032), /* PORT50CR */
-+ PORTCR(51, 0xe6050033), /* PORT51CR */
-+ PORTCR(52, 0xe6050034), /* PORT52CR */
-+ PORTCR(53, 0xe6050035), /* PORT53CR */
-+ PORTCR(54, 0xe6050036), /* PORT54CR */
-+ PORTCR(55, 0xe6050037), /* PORT55CR */
-+ PORTCR(56, 0xe6050038), /* PORT56CR */
-+ PORTCR(57, 0xe6050039), /* PORT57CR */
-+ PORTCR(58, 0xe605003a), /* PORT58CR */
-+ PORTCR(59, 0xe605003b), /* PORT59CR */
-+ PORTCR(60, 0xe605003c), /* PORT60CR */
-+ PORTCR(61, 0xe605003d), /* PORT61CR */
-+ PORTCR(62, 0xe605003e), /* PORT62CR */
-+ PORTCR(63, 0xe605003f), /* PORT63CR */
-+ PORTCR(64, 0xe6050040), /* PORT64CR */
-+ PORTCR(65, 0xe6050041), /* PORT65CR */
-+ PORTCR(66, 0xe6050042), /* PORT66CR */
-+ PORTCR(67, 0xe6050043), /* PORT67CR */
-+ PORTCR(68, 0xe6050044), /* PORT68CR */
-+ PORTCR(69, 0xe6050045), /* PORT69CR */
-+ PORTCR(70, 0xe6050046), /* PORT70CR */
-+ PORTCR(71, 0xe6050047), /* PORT71CR */
-+ PORTCR(72, 0xe6050048), /* PORT72CR */
-+ PORTCR(73, 0xe6050049), /* PORT73CR */
-+ PORTCR(74, 0xe605004a), /* PORT74CR */
-+ PORTCR(75, 0xe605004b), /* PORT75CR */
-+ PORTCR(76, 0xe605004c), /* PORT76CR */
-+ PORTCR(77, 0xe605004d), /* PORT77CR */
-+ PORTCR(78, 0xe605004e), /* PORT78CR */
-+ PORTCR(79, 0xe605004f), /* PORT79CR */
-+ PORTCR(80, 0xe6050050), /* PORT80CR */
-+ PORTCR(81, 0xe6050051), /* PORT81CR */
-+ PORTCR(82, 0xe6050052), /* PORT82CR */
-+ PORTCR(83, 0xe6050053), /* PORT83CR */
-+
-+ PORTCR(84, 0xe6051054), /* PORT84CR */
-+ PORTCR(85, 0xe6051055), /* PORT85CR */
-+ PORTCR(86, 0xe6051056), /* PORT86CR */
-+ PORTCR(87, 0xe6051057), /* PORT87CR */
-+ PORTCR(88, 0xe6051058), /* PORT88CR */
-+ PORTCR(89, 0xe6051059), /* PORT89CR */
-+ PORTCR(90, 0xe605105a), /* PORT90CR */
-+ PORTCR(91, 0xe605105b), /* PORT91CR */
-+ PORTCR(92, 0xe605105c), /* PORT92CR */
-+ PORTCR(93, 0xe605105d), /* PORT93CR */
-+ PORTCR(94, 0xe605105e), /* PORT94CR */
-+ PORTCR(95, 0xe605105f), /* PORT95CR */
-+ PORTCR(96, 0xe6051060), /* PORT96CR */
-+ PORTCR(97, 0xe6051061), /* PORT97CR */
-+ PORTCR(98, 0xe6051062), /* PORT98CR */
-+ PORTCR(99, 0xe6051063), /* PORT99CR */
-+ PORTCR(100, 0xe6051064), /* PORT100CR */
-+ PORTCR(101, 0xe6051065), /* PORT101CR */
-+ PORTCR(102, 0xe6051066), /* PORT102CR */
-+ PORTCR(103, 0xe6051067), /* PORT103CR */
-+ PORTCR(104, 0xe6051068), /* PORT104CR */
-+ PORTCR(105, 0xe6051069), /* PORT105CR */
-+ PORTCR(106, 0xe605106a), /* PORT106CR */
-+ PORTCR(107, 0xe605106b), /* PORT107CR */
-+ PORTCR(108, 0xe605106c), /* PORT108CR */
-+ PORTCR(109, 0xe605106d), /* PORT109CR */
-+ PORTCR(110, 0xe605106e), /* PORT110CR */
-+ PORTCR(111, 0xe605106f), /* PORT111CR */
-+ PORTCR(112, 0xe6051070), /* PORT112CR */
-+ PORTCR(113, 0xe6051071), /* PORT113CR */
-+ PORTCR(114, 0xe6051072), /* PORT114CR */
-+
-+ PORTCR(115, 0xe6052073), /* PORT115CR */
-+ PORTCR(116, 0xe6052074), /* PORT116CR */
-+ PORTCR(117, 0xe6052075), /* PORT117CR */
-+ PORTCR(118, 0xe6052076), /* PORT118CR */
-+ PORTCR(119, 0xe6052077), /* PORT119CR */
-+ PORTCR(120, 0xe6052078), /* PORT120CR */
-+ PORTCR(121, 0xe6052079), /* PORT121CR */
-+ PORTCR(122, 0xe605207a), /* PORT122CR */
-+ PORTCR(123, 0xe605207b), /* PORT123CR */
-+ PORTCR(124, 0xe605207c), /* PORT124CR */
-+ PORTCR(125, 0xe605207d), /* PORT125CR */
-+ PORTCR(126, 0xe605207e), /* PORT126CR */
-+ PORTCR(127, 0xe605207f), /* PORT127CR */
-+ PORTCR(128, 0xe6052080), /* PORT128CR */
-+ PORTCR(129, 0xe6052081), /* PORT129CR */
-+ PORTCR(130, 0xe6052082), /* PORT130CR */
-+ PORTCR(131, 0xe6052083), /* PORT131CR */
-+ PORTCR(132, 0xe6052084), /* PORT132CR */
-+ PORTCR(133, 0xe6052085), /* PORT133CR */
-+ PORTCR(134, 0xe6052086), /* PORT134CR */
-+ PORTCR(135, 0xe6052087), /* PORT135CR */
-+ PORTCR(136, 0xe6052088), /* PORT136CR */
-+ PORTCR(137, 0xe6052089), /* PORT137CR */
-+ PORTCR(138, 0xe605208a), /* PORT138CR */
-+ PORTCR(139, 0xe605208b), /* PORT139CR */
-+ PORTCR(140, 0xe605208c), /* PORT140CR */
-+ PORTCR(141, 0xe605208d), /* PORT141CR */
-+ PORTCR(142, 0xe605208e), /* PORT142CR */
-+ PORTCR(143, 0xe605208f), /* PORT143CR */
-+ PORTCR(144, 0xe6052090), /* PORT144CR */
-+ PORTCR(145, 0xe6052091), /* PORT145CR */
-+ PORTCR(146, 0xe6052092), /* PORT146CR */
-+ PORTCR(147, 0xe6052093), /* PORT147CR */
-+ PORTCR(148, 0xe6052094), /* PORT148CR */
-+ PORTCR(149, 0xe6052095), /* PORT149CR */
-+ PORTCR(150, 0xe6052096), /* PORT150CR */
-+ PORTCR(151, 0xe6052097), /* PORT151CR */
-+ PORTCR(152, 0xe6052098), /* PORT152CR */
-+ PORTCR(153, 0xe6052099), /* PORT153CR */
-+ PORTCR(154, 0xe605209a), /* PORT154CR */
-+ PORTCR(155, 0xe605209b), /* PORT155CR */
-+ PORTCR(156, 0xe605209c), /* PORT156CR */
-+ PORTCR(157, 0xe605209d), /* PORT157CR */
-+ PORTCR(158, 0xe605209e), /* PORT158CR */
-+ PORTCR(159, 0xe605209f), /* PORT159CR */
-+ PORTCR(160, 0xe60520a0), /* PORT160CR */
-+ PORTCR(161, 0xe60520a1), /* PORT161CR */
-+ PORTCR(162, 0xe60520a2), /* PORT162CR */
-+ PORTCR(163, 0xe60520a3), /* PORT163CR */
-+ PORTCR(164, 0xe60520a4), /* PORT164CR */
-+ PORTCR(165, 0xe60520a5), /* PORT165CR */
-+ PORTCR(166, 0xe60520a6), /* PORT166CR */
-+ PORTCR(167, 0xe60520a7), /* PORT167CR */
-+ PORTCR(168, 0xe60520a8), /* PORT168CR */
-+ PORTCR(169, 0xe60520a9), /* PORT169CR */
-+ PORTCR(170, 0xe60520aa), /* PORT170CR */
-+ PORTCR(171, 0xe60520ab), /* PORT171CR */
-+ PORTCR(172, 0xe60520ac), /* PORT172CR */
-+ PORTCR(173, 0xe60520ad), /* PORT173CR */
-+ PORTCR(174, 0xe60520ae), /* PORT174CR */
-+ PORTCR(175, 0xe60520af), /* PORT175CR */
-+ PORTCR(176, 0xe60520b0), /* PORT176CR */
-+ PORTCR(177, 0xe60520b1), /* PORT177CR */
-+ PORTCR(178, 0xe60520b2), /* PORT178CR */
-+ PORTCR(179, 0xe60520b3), /* PORT179CR */
-+ PORTCR(180, 0xe60520b4), /* PORT180CR */
-+ PORTCR(181, 0xe60520b5), /* PORT181CR */
-+ PORTCR(182, 0xe60520b6), /* PORT182CR */
-+ PORTCR(183, 0xe60520b7), /* PORT183CR */
-+ PORTCR(184, 0xe60520b8), /* PORT184CR */
-+ PORTCR(185, 0xe60520b9), /* PORT185CR */
-+ PORTCR(186, 0xe60520ba), /* PORT186CR */
-+ PORTCR(187, 0xe60520bb), /* PORT187CR */
-+ PORTCR(188, 0xe60520bc), /* PORT188CR */
-+ PORTCR(189, 0xe60520bd), /* PORT189CR */
-+ PORTCR(190, 0xe60520be), /* PORT190CR */
-+ PORTCR(191, 0xe60520bf), /* PORT191CR */
-+ PORTCR(192, 0xe60520c0), /* PORT192CR */
-+ PORTCR(193, 0xe60520c1), /* PORT193CR */
-+ PORTCR(194, 0xe60520c2), /* PORT194CR */
-+ PORTCR(195, 0xe60520c3), /* PORT195CR */
-+ PORTCR(196, 0xe60520c4), /* PORT196CR */
-+ PORTCR(197, 0xe60520c5), /* PORT197CR */
-+ PORTCR(198, 0xe60520c6), /* PORT198CR */
-+ PORTCR(199, 0xe60520c7), /* PORT199CR */
-+ PORTCR(200, 0xe60520c8), /* PORT200CR */
-+ PORTCR(201, 0xe60520c9), /* PORT201CR */
-+ PORTCR(202, 0xe60520ca), /* PORT202CR */
-+ PORTCR(203, 0xe60520cb), /* PORT203CR */
-+ PORTCR(204, 0xe60520cc), /* PORT204CR */
-+ PORTCR(205, 0xe60520cd), /* PORT205CR */
-+ PORTCR(206, 0xe60520ce), /* PORT206CR */
-+ PORTCR(207, 0xe60520cf), /* PORT207CR */
-+ PORTCR(208, 0xe60520d0), /* PORT208CR */
-+ PORTCR(209, 0xe60520d1), /* PORT209CR */
-+
-+ PORTCR(210, 0xe60530d2), /* PORT210CR */
-+ PORTCR(211, 0xe60530d3), /* PORT211CR */
-+
-+ { PINMUX_CFG_REG("MSEL1CR", 0xe605800c, 32, 1) {
-+ MSEL1CR_31_0, MSEL1CR_31_1,
-+ MSEL1CR_30_0, MSEL1CR_30_1,
-+ MSEL1CR_29_0, MSEL1CR_29_1,
-+ MSEL1CR_28_0, MSEL1CR_28_1,
-+ MSEL1CR_27_0, MSEL1CR_27_1,
-+ MSEL1CR_26_0, MSEL1CR_26_1,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ MSEL1CR_16_0, MSEL1CR_16_1,
-+ MSEL1CR_15_0, MSEL1CR_15_1,
-+ MSEL1CR_14_0, MSEL1CR_14_1,
-+ MSEL1CR_13_0, MSEL1CR_13_1,
-+ MSEL1CR_12_0, MSEL1CR_12_1,
-+ 0, 0, 0, 0,
-+ MSEL1CR_9_0, MSEL1CR_9_1,
-+ 0, 0,
-+ MSEL1CR_7_0, MSEL1CR_7_1,
-+ MSEL1CR_6_0, MSEL1CR_6_1,
-+ MSEL1CR_5_0, MSEL1CR_5_1,
-+ MSEL1CR_4_0, MSEL1CR_4_1,
-+ MSEL1CR_3_0, MSEL1CR_3_1,
-+ MSEL1CR_2_0, MSEL1CR_2_1,
-+ 0, 0,
-+ MSEL1CR_0_0, MSEL1CR_0_1,
-+ }
-+ },
-+ { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ MSEL3CR_15_0, MSEL3CR_15_1,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ MSEL3CR_6_0, MSEL3CR_6_1,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ }
-+ },
-+ { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ MSEL4CR_19_0, MSEL4CR_19_1,
-+ MSEL4CR_18_0, MSEL4CR_18_1,
-+ 0, 0, 0, 0,
-+ MSEL4CR_15_0, MSEL4CR_15_1,
-+ 0, 0, 0, 0, 0, 0, 0, 0,
-+ MSEL4CR_10_0, MSEL4CR_10_1,
-+ 0, 0, 0, 0, 0, 0,
-+ MSEL4CR_6_0, MSEL4CR_6_1,
-+ 0, 0,
-+ MSEL4CR_4_0, MSEL4CR_4_1,
-+ 0, 0, 0, 0,
-+ MSEL4CR_1_0, MSEL4CR_1_1,
-+ 0, 0,
-+ }
-+ },
-+ { PINMUX_CFG_REG("MSEL5CR", 0xE6058028, 32, 1) {
-+ MSEL5CR_31_0, MSEL5CR_31_1,
-+ MSEL5CR_30_0, MSEL5CR_30_1,
-+ MSEL5CR_29_0, MSEL5CR_29_1,
-+ 0, 0,
-+ MSEL5CR_27_0, MSEL5CR_27_1,
-+ 0, 0,
-+ MSEL5CR_25_0, MSEL5CR_25_1,
-+ 0, 0,
-+ MSEL5CR_23_0, MSEL5CR_23_1,
-+ 0, 0,
-+ MSEL5CR_21_0, MSEL5CR_21_1,
-+ 0, 0,
-+ MSEL5CR_19_0, MSEL5CR_19_1,
-+ 0, 0,
-+ MSEL5CR_17_0, MSEL5CR_17_1,
-+ 0, 0,
-+ MSEL5CR_15_0, MSEL5CR_15_1,
-+ MSEL5CR_14_0, MSEL5CR_14_1,
-+ MSEL5CR_13_0, MSEL5CR_13_1,
-+ MSEL5CR_12_0, MSEL5CR_12_1,
-+ MSEL5CR_11_0, MSEL5CR_11_1,
-+ MSEL5CR_10_0, MSEL5CR_10_1,
-+ 0, 0,
-+ MSEL5CR_8_0, MSEL5CR_8_1,
-+ MSEL5CR_7_0, MSEL5CR_7_1,
-+ MSEL5CR_6_0, MSEL5CR_6_1,
-+ MSEL5CR_5_0, MSEL5CR_5_1,
-+ MSEL5CR_4_0, MSEL5CR_4_1,
-+ MSEL5CR_3_0, MSEL5CR_3_1,
-+ MSEL5CR_2_0, MSEL5CR_2_1,
-+ 0, 0,
-+ MSEL5CR_0_0, MSEL5CR_0_1,
-+ }
-+ },
-+ { },
-+};
-+
-+static struct pinmux_data_reg pinmux_data_regs[] = {
-+ { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054800, 32) {
-+ PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
-+ PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
-+ PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
-+ PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
-+ PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
-+ PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
-+ PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
-+ PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054804, 32) {
-+ PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
-+ PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
-+ PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
-+ PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
-+ PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
-+ PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
-+ PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
-+ PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054808, 32) {
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
-+ PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
-+ PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
-+ PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
-+ PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTD095_064DR", 0xe6055808, 32) {
-+ PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
-+ PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
-+ PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0 }
-+ },
-+ { PINMUX_DATA_REG("PORTD127_096DR", 0xe605580c, 32) {
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, PORT114_DATA, PORT113_DATA, PORT112_DATA,
-+ PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
-+ PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
-+ PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
-+ PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTR127_096DR", 0xe605680C, 32) {
-+ PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
-+ PORT123_DATA, PORT122_DATA, PORT121_DATA, PORT120_DATA,
-+ PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
-+ PORT115_DATA, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0 }
-+ },
-+ { PINMUX_DATA_REG("PORTR159_128DR", 0xe6056810, 32) {
-+ PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
-+ PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
-+ PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
-+ PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
-+ PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
-+ PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
-+ PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
-+ PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056814, 32) {
-+ PORT191_DATA, PORT190_DATA, PORT189_DATA, PORT188_DATA,
-+ PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
-+ PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
-+ PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
-+ PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
-+ PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
-+ PORT167_DATA, PORT166_DATA, PORT165_DATA, PORT164_DATA,
-+ PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056818, 32) {
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, PORT209_DATA, PORT208_DATA,
-+ PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
-+ PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
-+ PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
-+ PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
-+ },
-+ { PINMUX_DATA_REG("PORTU223_192DR", 0xe6057818, 32) {
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ PORT211_DATA, PORT210_DATA, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0,
-+ 0, 0, 0, 0 }
-+ },
-+ { },
-+};
-+
-+static struct pinmux_info r8a7740_pinmux_info = {
-+ .name = "r8a7740_pfc",
-+ .reserved_id = PINMUX_RESERVED,
-+ .data = { PINMUX_DATA_BEGIN,
-+ PINMUX_DATA_END },
-+ .input = { PINMUX_INPUT_BEGIN,
-+ PINMUX_INPUT_END },
-+ .input_pu = { PINMUX_INPUT_PULLUP_BEGIN,
-+ PINMUX_INPUT_PULLUP_END },
-+ .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN,
-+ PINMUX_INPUT_PULLDOWN_END },
-+ .output = { PINMUX_OUTPUT_BEGIN,
-+ PINMUX_OUTPUT_END },
-+ .mark = { PINMUX_MARK_BEGIN,
-+ PINMUX_MARK_END },
-+ .function = { PINMUX_FUNCTION_BEGIN,
-+ PINMUX_FUNCTION_END },
-+
-+ .first_gpio = GPIO_PORT0,
-+ .last_gpio = GPIO_FN_TRACEAUD_FROM_MEMC,
-+
-+ .gpios = pinmux_gpios,
-+ .cfg_regs = pinmux_config_regs,
-+ .data_regs = pinmux_data_regs,
-+
-+ .gpio_data = pinmux_data,
-+ .gpio_data_size = ARRAY_SIZE(pinmux_data),
-+};
-+
-+void r8a7740_pinmux_init(void)
-+{
-+ register_pinmux(&r8a7740_pinmux_info);
-+}
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0059-ARM-mach-shmobile-r8a7740-add-i2c-support.patch b/patches.armadillo800eva/0059-ARM-mach-shmobile-r8a7740-add-i2c-support.patch
deleted file mode 100644
index 1394d8a4c095e1..00000000000000
--- a/patches.armadillo800eva/0059-ARM-mach-shmobile-r8a7740-add-i2c-support.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From c2217fad0cedabc607ac175a24d1c8594035022d Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:46:23 -0800
-Subject: ARM: mach-shmobile: r8a7740: add i2c support
-
-This patch adds I2C support to r8a7740 CPU
-which has lasting errata on I2C I/O pad reset.
-This patch is including work-around.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 6831f3a9184a1c5400e4fa2f2d3172b6dfb2c805)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-r8a7740.c | 106 ++++++++++++++++++++++++++++++++
- 1 file changed, 106 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-index 5548518..e16860f 100644
---- a/arch/arm/mach-shmobile/setup-r8a7740.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -17,8 +17,10 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-+#include <linux/delay.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
-+#include <linux/io.h>
- #include <linux/platform_device.h>
- #include <linux/serial_sci.h>
- #include <linux/sh_timer.h>
-@@ -233,10 +235,114 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
- &cmt10_device,
- };
-
-+/* I2C */
-+static struct resource i2c0_resources[] = {
-+ [0] = {
-+ .name = "IIC0",
-+ .start = 0xfff20000,
-+ .end = 0xfff20425 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = gic_spi(201),
-+ .end = gic_spi(204),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct resource i2c1_resources[] = {
-+ [0] = {
-+ .name = "IIC1",
-+ .start = 0xe6c20000,
-+ .end = 0xe6c20425 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = gic_spi(70),
-+ .end = gic_spi(73),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device i2c0_device = {
-+ .name = "i2c-sh_mobile",
-+ .id = 0,
-+ .resource = i2c0_resources,
-+ .num_resources = ARRAY_SIZE(i2c0_resources),
-+};
-+
-+static struct platform_device i2c1_device = {
-+ .name = "i2c-sh_mobile",
-+ .id = 1,
-+ .resource = i2c1_resources,
-+ .num_resources = ARRAY_SIZE(i2c1_resources),
-+};
-+
-+static struct platform_device *r8a7740_late_devices[] __initdata = {
-+ &i2c0_device,
-+ &i2c1_device,
-+};
-+
-+#define ICCR 0x0004
-+#define ICSTART 0x0070
-+
-+#define i2c_read(reg, offset) ioread8(reg + offset)
-+#define i2c_write(reg, offset, data) iowrite8(data, reg + offset)
-+
-+/*
-+ * r8a7740 chip has lasting errata on I2C I/O pad reset.
-+ * this is work-around for it.
-+ */
-+static void r8a7740_i2c_workaround(struct platform_device *pdev)
-+{
-+ struct resource *res;
-+ void __iomem *reg;
-+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ if (unlikely(!res)) {
-+ pr_err("r8a7740 i2c workaround fail (cannot find resource)\n");
-+ return;
-+ }
-+
-+ reg = ioremap(res->start, resource_size(res));
-+ if (unlikely(!reg)) {
-+ pr_err("r8a7740 i2c workaround fail (cannot map IO)\n");
-+ return;
-+ }
-+
-+ i2c_write(reg, ICCR, i2c_read(reg, ICCR) | 0x80);
-+ i2c_read(reg, ICCR); /* dummy read */
-+
-+ i2c_write(reg, ICSTART, i2c_read(reg, ICSTART) | 0x10);
-+ i2c_read(reg, ICSTART); /* dummy read */
-+
-+ mdelay(100);
-+
-+ i2c_write(reg, ICCR, 0x01);
-+ i2c_read(reg, ICCR);
-+ i2c_write(reg, ICSTART, 0x00);
-+ i2c_read(reg, ICSTART);
-+
-+ i2c_write(reg, ICCR, 0x10);
-+ mdelay(100);
-+ i2c_write(reg, ICCR, 0x00);
-+ mdelay(100);
-+ i2c_write(reg, ICCR, 0x10);
-+ mdelay(100);
-+
-+ iounmap(reg);
-+}
-+
- void __init r8a7740_add_standard_devices(void)
- {
-+ /* I2C work-around */
-+ r8a7740_i2c_workaround(&i2c0_device);
-+ r8a7740_i2c_workaround(&i2c1_device);
-+
- platform_add_devices(r8a7740_early_devices,
- ARRAY_SIZE(r8a7740_early_devices));
-+ platform_add_devices(r8a7740_late_devices,
-+ ARRAY_SIZE(r8a7740_late_devices));
- }
-
- void __init r8a7740_add_early_devices(void)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0060-ARM-mach-shmobile-r8a7740-add-INTC-support.patch b/patches.armadillo800eva/0060-ARM-mach-shmobile-r8a7740-add-INTC-support.patch
deleted file mode 100644
index 016c954982906a..00000000000000
--- a/patches.armadillo800eva/0060-ARM-mach-shmobile-r8a7740-add-INTC-support.patch
+++ /dev/null
@@ -1,804 +0,0 @@
-From c860bfd0606674dde926e2eb48112b65678bc943 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:46:35 -0800
-Subject: ARM: mach-shmobile: r8a7740: add INTC support
-
-R8A7740 GIC can not get external IRQx interrupt directly
-without GIC - INTC demux support.
-
-Current AG5 is using GIC - INTCS demux with
-special irq relocation. but GIC - INTCA demux
-is still not supported and it needs irq number re-mapping.
-
-OTOH, normal INTC support as before is very enough for R8A7740,
-because it is not SMP CPU.
-This patch adds INTCA/INTCS support instead of GIC.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 215d6cc9230c2a42a643c4cd296680040eeb1f49)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 1 -
- arch/arm/mach-shmobile/Makefile | 2 +-
- arch/arm/mach-shmobile/intc-r8a7740.c | 612 +++++++++++++++++++++++++++++++-
- arch/arm/mach-shmobile/setup-r8a7740.c | 28 +-
- 4 files changed, 614 insertions(+), 29 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 2ce88de..193f011 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -32,7 +32,6 @@ config ARCH_R8A7740
- select CPU_V7
- select SH_CLK_CPG
- select ARCH_WANT_OPTIONAL_GPIOLIB
-- select ARM_GIC
-
- comment "SH-Mobile Board Type"
-
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index 8c2067d..d76ad60 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -31,7 +31,7 @@ obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
- obj-$(CONFIG_ARCH_SH7377) += entry-intc.o
- obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
- obj-$(CONFIG_ARCH_SH73A0) += entry-gic.o
--obj-$(CONFIG_ARCH_R8A7740) += entry-gic.o
-+obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o
-
- # PM objects
- obj-$(CONFIG_SUSPEND) += suspend.o
-diff --git a/arch/arm/mach-shmobile/intc-r8a7740.c b/arch/arm/mach-shmobile/intc-r8a7740.c
-index c62a205..272c84c 100644
---- a/arch/arm/mach-shmobile/intc-r8a7740.c
-+++ b/arch/arm/mach-shmobile/intc-r8a7740.c
-@@ -18,28 +18,614 @@
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
- #include <linux/irq.h>
- #include <linux/io.h>
--#include <asm/hardware/gic.h>
-+#include <linux/sh_intc.h>
-+#include <mach/intc.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-
--#define INTA_CTRL 0xe605807c
-+/*
-+ * INTCA
-+ */
-+enum {
-+ UNUSED_INTCA = 0,
-+
-+ /* interrupt sources INTCA */
-+ DIRC,
-+ ATAPI,
-+ IIC1_ALI, IIC1_TACKI, IIC1_WAITI, IIC1_DTEI,
-+ AP_ARM_COMMTX, AP_ARM_COMMRX,
-+ MFI, MFIS,
-+ BBIF1, BBIF2,
-+ USBHSDMAC,
-+ USBF_OUL_SOF, USBF_IXL_INT,
-+ SGX540,
-+ CMT1_0, CMT1_1, CMT1_2, CMT1_3,
-+ CMT2,
-+ CMT3,
-+ KEYSC,
-+ SCIFA0, SCIFA1, SCIFA2, SCIFA3,
-+ MSIOF2, MSIOF1,
-+ SCIFA4, SCIFA5, SCIFB,
-+ FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
-+ SDHI0_0, SDHI0_1, SDHI0_2, SDHI0_3,
-+ SDHI1_0, SDHI1_1, SDHI1_2, SDHI1_3,
-+ AP_ARM_L2CINT,
-+ IRDA,
-+ TPU0,
-+ SCIFA6, SCIFA7,
-+ GbEther,
-+ ICBS0,
-+ DDM,
-+ SDHI2_0, SDHI2_1, SDHI2_2, SDHI2_3,
-+ RWDT0,
-+ DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3,
-+ DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR,
-+ DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
-+ DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
-+ DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
-+ DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
-+ SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
-+ USBH_INT, USBH_OHCI, USBH_EHCI, USBH_PME, USBH_BIND,
-+ RSPI_OVRF, RSPI_SPTEF, RSPI_SPRF,
-+ SPU2_0, SPU2_1,
-+ FSI, FMSI,
-+ IPMMU,
-+ AP_ARM_CTIIRQ, AP_ARM_PMURQ,
-+ MFIS2,
-+ CPORTR2S,
-+ CMT14, CMT15,
-+ MMCIF_0, MMCIF_1, MMCIF_2,
-+ SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEI,
-+ STPRO_0, STPRO_1, STPRO_2, STPRO_3, STPRO_4,
-+
-+ /* interrupt groups INTCA */
-+ DMAC1_1, DMAC1_2,
-+ DMAC2_1, DMAC2_2,
-+ DMAC3_1, DMAC3_2,
-+ AP_ARM1, AP_ARM2,
-+ SDHI0, SDHI1, SDHI2,
-+ SHWYSTAT,
-+ USBF, USBH1, USBH2,
-+ RSPI, SPU2, FLCTL, IIC1,
-+};
-+
-+static struct intc_vect intca_vectors[] __initdata = {
-+ INTC_VECT(DIRC, 0x0560),
-+ INTC_VECT(ATAPI, 0x05E0),
-+ INTC_VECT(IIC1_ALI, 0x0780),
-+ INTC_VECT(IIC1_TACKI, 0x07A0),
-+ INTC_VECT(IIC1_WAITI, 0x07C0),
-+ INTC_VECT(IIC1_DTEI, 0x07E0),
-+ INTC_VECT(AP_ARM_COMMTX, 0x0840),
-+ INTC_VECT(AP_ARM_COMMRX, 0x0860),
-+ INTC_VECT(MFI, 0x0900),
-+ INTC_VECT(MFIS, 0x0920),
-+ INTC_VECT(BBIF1, 0x0940),
-+ INTC_VECT(BBIF2, 0x0960),
-+ INTC_VECT(USBHSDMAC, 0x0A00),
-+ INTC_VECT(USBF_OUL_SOF, 0x0A20),
-+ INTC_VECT(USBF_IXL_INT, 0x0A40),
-+ INTC_VECT(SGX540, 0x0A60),
-+ INTC_VECT(CMT1_0, 0x0B00),
-+ INTC_VECT(CMT1_1, 0x0B20),
-+ INTC_VECT(CMT1_2, 0x0B40),
-+ INTC_VECT(CMT1_3, 0x0B60),
-+ INTC_VECT(CMT2, 0x0B80),
-+ INTC_VECT(CMT3, 0x0BA0),
-+ INTC_VECT(KEYSC, 0x0BE0),
-+ INTC_VECT(SCIFA0, 0x0C00),
-+ INTC_VECT(SCIFA1, 0x0C20),
-+ INTC_VECT(SCIFA2, 0x0C40),
-+ INTC_VECT(SCIFA3, 0x0C60),
-+ INTC_VECT(MSIOF2, 0x0C80),
-+ INTC_VECT(MSIOF1, 0x0D00),
-+ INTC_VECT(SCIFA4, 0x0D20),
-+ INTC_VECT(SCIFA5, 0x0D40),
-+ INTC_VECT(SCIFB, 0x0D60),
-+ INTC_VECT(FLCTL_FLSTEI, 0x0D80),
-+ INTC_VECT(FLCTL_FLTENDI, 0x0DA0),
-+ INTC_VECT(FLCTL_FLTREQ0I, 0x0DC0),
-+ INTC_VECT(FLCTL_FLTREQ1I, 0x0DE0),
-+ INTC_VECT(SDHI0_0, 0x0E00),
-+ INTC_VECT(SDHI0_1, 0x0E20),
-+ INTC_VECT(SDHI0_2, 0x0E40),
-+ INTC_VECT(SDHI0_3, 0x0E60),
-+ INTC_VECT(SDHI1_0, 0x0E80),
-+ INTC_VECT(SDHI1_1, 0x0EA0),
-+ INTC_VECT(SDHI1_2, 0x0EC0),
-+ INTC_VECT(SDHI1_3, 0x0EE0),
-+ INTC_VECT(AP_ARM_L2CINT, 0x0FA0),
-+ INTC_VECT(IRDA, 0x0480),
-+ INTC_VECT(TPU0, 0x04A0),
-+ INTC_VECT(SCIFA6, 0x04C0),
-+ INTC_VECT(SCIFA7, 0x04E0),
-+ INTC_VECT(GbEther, 0x0500),
-+ INTC_VECT(ICBS0, 0x0540),
-+ INTC_VECT(DDM, 0x1140),
-+ INTC_VECT(SDHI2_0, 0x1200),
-+ INTC_VECT(SDHI2_1, 0x1220),
-+ INTC_VECT(SDHI2_2, 0x1240),
-+ INTC_VECT(SDHI2_3, 0x1260),
-+ INTC_VECT(RWDT0, 0x1280),
-+ INTC_VECT(DMAC1_1_DEI0, 0x2000),
-+ INTC_VECT(DMAC1_1_DEI1, 0x2020),
-+ INTC_VECT(DMAC1_1_DEI2, 0x2040),
-+ INTC_VECT(DMAC1_1_DEI3, 0x2060),
-+ INTC_VECT(DMAC1_2_DEI4, 0x2080),
-+ INTC_VECT(DMAC1_2_DEI5, 0x20A0),
-+ INTC_VECT(DMAC1_2_DADERR, 0x20C0),
-+ INTC_VECT(DMAC2_1_DEI0, 0x2100),
-+ INTC_VECT(DMAC2_1_DEI1, 0x2120),
-+ INTC_VECT(DMAC2_1_DEI2, 0x2140),
-+ INTC_VECT(DMAC2_1_DEI3, 0x2160),
-+ INTC_VECT(DMAC2_2_DEI4, 0x2180),
-+ INTC_VECT(DMAC2_2_DEI5, 0x21A0),
-+ INTC_VECT(DMAC2_2_DADERR, 0x21C0),
-+ INTC_VECT(DMAC3_1_DEI0, 0x2200),
-+ INTC_VECT(DMAC3_1_DEI1, 0x2220),
-+ INTC_VECT(DMAC3_1_DEI2, 0x2240),
-+ INTC_VECT(DMAC3_1_DEI3, 0x2260),
-+ INTC_VECT(DMAC3_2_DEI4, 0x2280),
-+ INTC_VECT(DMAC3_2_DEI5, 0x22A0),
-+ INTC_VECT(DMAC3_2_DADERR, 0x22C0),
-+ INTC_VECT(SHWYSTAT_RT, 0x1300),
-+ INTC_VECT(SHWYSTAT_HS, 0x1320),
-+ INTC_VECT(SHWYSTAT_COM, 0x1340),
-+ INTC_VECT(USBH_INT, 0x1540),
-+ INTC_VECT(USBH_OHCI, 0x1560),
-+ INTC_VECT(USBH_EHCI, 0x1580),
-+ INTC_VECT(USBH_PME, 0x15A0),
-+ INTC_VECT(USBH_BIND, 0x15C0),
-+ INTC_VECT(RSPI_OVRF, 0x1780),
-+ INTC_VECT(RSPI_SPTEF, 0x17A0),
-+ INTC_VECT(RSPI_SPRF, 0x17C0),
-+ INTC_VECT(SPU2_0, 0x1800),
-+ INTC_VECT(SPU2_1, 0x1820),
-+ INTC_VECT(FSI, 0x1840),
-+ INTC_VECT(FMSI, 0x1860),
-+ INTC_VECT(IPMMU, 0x1920),
-+ INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
-+ INTC_VECT(AP_ARM_PMURQ, 0x19A0),
-+ INTC_VECT(MFIS2, 0x1A00),
-+ INTC_VECT(CPORTR2S, 0x1A20),
-+ INTC_VECT(CMT14, 0x1A40),
-+ INTC_VECT(CMT15, 0x1A60),
-+ INTC_VECT(MMCIF_0, 0x1AA0),
-+ INTC_VECT(MMCIF_1, 0x1AC0),
-+ INTC_VECT(MMCIF_2, 0x1AE0),
-+ INTC_VECT(SIM_ERI, 0x1C00),
-+ INTC_VECT(SIM_RXI, 0x1C20),
-+ INTC_VECT(SIM_TXI, 0x1C40),
-+ INTC_VECT(SIM_TEI, 0x1C60),
-+ INTC_VECT(STPRO_0, 0x1C80),
-+ INTC_VECT(STPRO_1, 0x1CA0),
-+ INTC_VECT(STPRO_2, 0x1CC0),
-+ INTC_VECT(STPRO_3, 0x1CE0),
-+ INTC_VECT(STPRO_4, 0x1D00),
-+};
-+
-+static struct intc_group intca_groups[] __initdata = {
-+ INTC_GROUP(DMAC1_1,
-+ DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3),
-+ INTC_GROUP(DMAC1_2,
-+ DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR),
-+ INTC_GROUP(DMAC2_1,
-+ DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
-+ INTC_GROUP(DMAC2_2,
-+ DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR),
-+ INTC_GROUP(DMAC3_1,
-+ DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
-+ INTC_GROUP(DMAC3_2,
-+ DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR),
-+ INTC_GROUP(AP_ARM1,
-+ AP_ARM_COMMTX, AP_ARM_COMMRX),
-+ INTC_GROUP(AP_ARM2,
-+ AP_ARM_CTIIRQ, AP_ARM_PMURQ),
-+ INTC_GROUP(USBF,
-+ USBF_OUL_SOF, USBF_IXL_INT),
-+ INTC_GROUP(SDHI0,
-+ SDHI0_0, SDHI0_1, SDHI0_2, SDHI0_3),
-+ INTC_GROUP(SDHI1,
-+ SDHI1_0, SDHI1_1, SDHI1_2, SDHI1_3),
-+ INTC_GROUP(SDHI2,
-+ SDHI2_0, SDHI2_1, SDHI2_2, SDHI2_3),
-+ INTC_GROUP(SHWYSTAT,
-+ SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
-+ INTC_GROUP(USBH1, /* FIXME */
-+ USBH_INT, USBH_OHCI),
-+ INTC_GROUP(USBH2, /* FIXME */
-+ USBH_EHCI,
-+ USBH_PME, USBH_BIND),
-+ INTC_GROUP(RSPI,
-+ RSPI_OVRF, RSPI_SPTEF, RSPI_SPRF),
-+ INTC_GROUP(SPU2,
-+ SPU2_0, SPU2_1),
-+ INTC_GROUP(FLCTL,
-+ FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
-+ INTC_GROUP(IIC1,
-+ IIC1_ALI, IIC1_TACKI, IIC1_WAITI, IIC1_DTEI),
-+};
-+
-+static struct intc_mask_reg intca_mask_registers[] __initdata = {
-+ { /* IMR0A / IMCR0A */ 0xe6940080, 0xe69400c0, 8,
-+ { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
-+ 0, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
-+ { /* IMR1A / IMCR1A */ 0xe6940084, 0xe69400c4, 8,
-+ { ATAPI, 0, DIRC, 0,
-+ DMAC1_1_DEI3, DMAC1_1_DEI2, DMAC1_1_DEI1, DMAC1_1_DEI0 } },
-+ { /* IMR2A / IMCR2A */ 0xe6940088, 0xe69400c8, 8,
-+ { 0, 0, 0, 0,
-+ BBIF1, BBIF2, MFIS, MFI } },
-+ { /* IMR3A / IMCR3A */ 0xe694008c, 0xe69400cc, 8,
-+ { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
-+ DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
-+ { /* IMR4A / IMCR4A */ 0xe6940090, 0xe69400d0, 8,
-+ { DDM, 0, 0, 0,
-+ 0, 0, 0, 0 } },
-+ { /* IMR5A / IMCR5A */ 0xe6940094, 0xe69400d4, 8,
-+ { KEYSC, DMAC1_2_DADERR, DMAC1_2_DEI5, DMAC1_2_DEI4,
-+ SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
-+ { /* IMR6A / IMCR6A */ 0xe6940098, 0xe69400d8, 8,
-+ { SCIFB, SCIFA5, SCIFA4, MSIOF1,
-+ 0, 0, MSIOF2, 0 } },
-+ { /* IMR7A / IMCR7A */ 0xe694009c, 0xe69400dc, 8,
-+ { SDHI0_3, SDHI0_2, SDHI0_1, SDHI0_0,
-+ FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
-+ { /* IMR8A / IMCR8A */ 0xe69400a0, 0xe69400e0, 8,
-+ { SDHI1_3, SDHI1_2, SDHI1_1, SDHI1_0,
-+ 0, USBHSDMAC, 0, AP_ARM_L2CINT } },
-+ { /* IMR9A / IMCR9A */ 0xe69400a4, 0xe69400e4, 8,
-+ { CMT1_3, CMT1_2, CMT1_1, CMT1_0,
-+ CMT2, USBF_IXL_INT, USBF_OUL_SOF, SGX540 } },
-+ { /* IMR10A / IMCR10A */ 0xe69400a8, 0xe69400e8, 8,
-+ { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
-+ 0, 0, 0, 0 } },
-+ { /* IMR11A / IMCR11A */ 0xe69400ac, 0xe69400ec, 8,
-+ { IIC1_DTEI, IIC1_WAITI, IIC1_TACKI, IIC1_ALI,
-+ ICBS0, 0, 0, 0 } },
-+ { /* IMR12A / IMCR12A */ 0xe69400b0, 0xe69400f0, 8,
-+ { 0, 0, TPU0, SCIFA6,
-+ SCIFA7, GbEther, 0, 0 } },
-+ { /* IMR13A / IMCR13A */ 0xe69400b4, 0xe69400f4, 8,
-+ { SDHI2_3, SDHI2_2, SDHI2_1, SDHI2_0,
-+ 0, CMT3, 0, RWDT0 } },
-+ { /* IMR0A3 / IMCR0A3 */ 0xe6950080, 0xe69500c0, 8,
-+ { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
-+ 0, 0, 0, 0 } },
-+ /* IMR1A3 / IMCR1A3 */
-+ { /* IMR2A3 / IMCR2A3 */ 0xe6950088, 0xe69500c8, 8,
-+ { 0, 0, USBH_INT, USBH_OHCI,
-+ USBH_EHCI, USBH_PME, USBH_BIND, 0 } },
-+ /* IMR3A3 / IMCR3A3 */
-+ { /* IMR4A3 / IMCR4A3 */ 0xe6950090, 0xe69500d0, 8,
-+ { 0, 0, 0, 0,
-+ RSPI_OVRF, RSPI_SPTEF, RSPI_SPRF, 0 } },
-+ { /* IMR5A3 / IMCR5A3 */ 0xe6950094, 0xe69500d4, 8,
-+ { SPU2_0, SPU2_1, FSI, FMSI,
-+ 0, 0, 0, 0 } },
-+ { /* IMR6A3 / IMCR6A3 */ 0xe6950098, 0xe69500d8, 8,
-+ { 0, IPMMU, 0, 0,
-+ AP_ARM_CTIIRQ, AP_ARM_PMURQ, 0, 0 } },
-+ { /* IMR7A3 / IMCR7A3 */ 0xe695009c, 0xe69500dc, 8,
-+ { MFIS2, CPORTR2S, CMT14, CMT15,
-+ 0, MMCIF_0, MMCIF_1, MMCIF_2 } },
-+ /* IMR8A3 / IMCR8A3 */
-+ { /* IMR9A3 / IMCR9A3 */ 0xe69500a4, 0xe69500e4, 8,
-+ { SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEI,
-+ STPRO_0, STPRO_1, STPRO_2, STPRO_3 } },
-+ { /* IMR10A3 / IMCR10A3 */ 0xe69500a8, 0xe69500e8, 8,
-+ { STPRO_4, 0, 0, 0,
-+ 0, 0, 0, 0 } },
-+};
-+
-+static struct intc_prio_reg intca_prio_registers[] __initdata = {
-+ { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, ICBS0 } },
-+ { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
-+ { 0xe6940008, 0, 16, 4, /* IPRCA */ { ATAPI, 0, CMT1_1, AP_ARM1 } },
-+ { 0xe694000c, 0, 16, 4, /* IPRDA */ { 0, 0, CMT1_2, 0 } },
-+ { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC1_1, MFIS, MFI, USBF } },
-+ { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC, DMAC1_2,
-+ SGX540, CMT1_0 } },
-+ { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
-+ SCIFA2, SCIFA3 } },
-+ { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBHSDMAC,
-+ FLCTL, SDHI0 } },
-+ { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, 0, IIC1 } },
-+ { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2,
-+ AP_ARM_L2CINT, 0 } },
-+ { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_3, 0, SDHI1 } },
-+ { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, SCIFA6,
-+ SCIFA7, GbEther } },
-+ { 0xe6940030, 0, 16, 4, /* IPRMA */ { 0, CMT3, 0, RWDT0 } },
-+ { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
-+ { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
-+ { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
-+ /* IPRBA3 */
-+ /* IPRCA3 */
-+ /* IPRDA3 */
-+ { 0xe6950010, 0, 16, 4, /* IPREA3 */ { USBH1, 0, 0, 0 } },
-+ { 0xe6950014, 0, 16, 4, /* IPRFA3 */ { USBH2, 0, 0, 0 } },
-+ /* IPRGA3 */
-+ /* IPRHA3 */
-+ /* IPRIA3 */
-+ { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { RSPI, 0, 0, 0 } },
-+ { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
-+ /* IPRLA3 */
-+ { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU, 0, 0, 0 } },
-+ { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
-+ { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
-+ CMT14, CMT15 } },
-+ { 0xe695003c, 0, 16, 4, /* IPRPA3 */ { 0, MMCIF_0, MMCIF_1, MMCIF_2 } },
-+ /* IPRQA3 */
-+ /* IPRRA3 */
-+ { 0xe6950048, 0, 16, 4, /* IPRSA3 */ { SIM_ERI, SIM_RXI,
-+ SIM_TXI, SIM_TEI } },
-+ { 0xe695004c, 0, 16, 4, /* IPRTA3 */ { STPRO_0, STPRO_1,
-+ STPRO_2, STPRO_3 } },
-+ { 0xe6950050, 0, 16, 4, /* IPRUA3 */ { STPRO_4, 0, 0, 0 } },
-+};
-+
-+static DECLARE_INTC_DESC(intca_desc, "r8a7740-intca",
-+ intca_vectors, intca_groups,
-+ intca_mask_registers, intca_prio_registers,
-+ NULL);
-+
-+INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000,
-+ INTC_VECT, "r8a7740-intca-irq-pins");
-+
-+
-+/*
-+ * INTCS
-+ */
-+enum {
-+ UNUSED_INTCS = 0,
-+
-+ INTCS,
-+
-+ /* interrupt sources INTCS */
-+
-+ /* HUDI */
-+ /* STPRO */
-+ /* RTDMAC(1) */
-+ VPU5HA2,
-+ _2DG_TRAP, _2DG_GPM_INT, _2DG_CER_INT,
-+ /* MFI */
-+ /* BBIF2 */
-+ VPU5F,
-+ _2DG_BRK_INT,
-+ /* SGX540 */
-+ /* 2DDMAC */
-+ /* IPMMU */
-+ /* RTDMAC 2 */
-+ /* KEYSC */
-+ /* MSIOF */
-+ IIC0_ALI, IIC0_TACKI, IIC0_WAITI, IIC0_DTEI,
-+ TMU0_0, TMU0_1, TMU0_2,
-+ CMT0,
-+ /* CMT2 */
-+ LMB,
-+ CTI,
-+ VOU,
-+ /* RWDT0 */
-+ ICB,
-+ VIO6C,
-+ CEU20, CEU21,
-+ JPU,
-+ LCDC0,
-+ LCRC,
-+ /* RTDMAC2(1) */
-+ /* RTDMAC2(2) */
-+ LCDC1,
-+ /* SPU2 */
-+ /* FSI */
-+ /* FMSI */
-+ TMU1_0, TMU1_1, TMU1_2,
-+ CMT4,
-+ DISP,
-+ DSRV,
-+ /* MFIS2 */
-+ CPORTS2R,
-+
-+ /* interrupt groups INTCS */
-+ _2DG1,
-+ IIC0, TMU1,
-+};
-+
-+static struct intc_vect intcs_vectors[] = {
-+ /* HUDI */
-+ /* STPRO */
-+ /* RTDMAC(1) */
-+ INTCS_VECT(VPU5HA2, 0x0880),
-+ INTCS_VECT(_2DG_TRAP, 0x08A0),
-+ INTCS_VECT(_2DG_GPM_INT, 0x08C0),
-+ INTCS_VECT(_2DG_CER_INT, 0x08E0),
-+ /* MFI */
-+ /* BBIF2 */
-+ INTCS_VECT(VPU5F, 0x0980),
-+ INTCS_VECT(_2DG_BRK_INT, 0x09A0),
-+ /* SGX540 */
-+ /* 2DDMAC */
-+ /* IPMMU */
-+ /* RTDMAC(2) */
-+ /* KEYSC */
-+ /* MSIOF */
-+ INTCS_VECT(IIC0_ALI, 0x0E00),
-+ INTCS_VECT(IIC0_TACKI, 0x0E20),
-+ INTCS_VECT(IIC0_WAITI, 0x0E40),
-+ INTCS_VECT(IIC0_DTEI, 0x0E60),
-+ INTCS_VECT(TMU0_0, 0x0E80),
-+ INTCS_VECT(TMU0_1, 0x0EA0),
-+ INTCS_VECT(TMU0_2, 0x0EC0),
-+ INTCS_VECT(CMT0, 0x0F00),
-+ /* CMT2 */
-+ INTCS_VECT(LMB, 0x0F60),
-+ INTCS_VECT(CTI, 0x0400),
-+ INTCS_VECT(VOU, 0x0420),
-+ /* RWDT0 */
-+ INTCS_VECT(ICB, 0x0480),
-+ INTCS_VECT(VIO6C, 0x04E0),
-+ INTCS_VECT(CEU20, 0x0500),
-+ INTCS_VECT(CEU21, 0x0520),
-+ INTCS_VECT(JPU, 0x0560),
-+ INTCS_VECT(LCDC0, 0x0580),
-+ INTCS_VECT(LCRC, 0x05A0),
-+ /* RTDMAC2(1) */
-+ /* RTDMAC2(2) */
-+ INTCS_VECT(LCDC1, 0x1780),
-+ /* SPU2 */
-+ /* FSI */
-+ /* FMSI */
-+ INTCS_VECT(TMU1_0, 0x1900),
-+ INTCS_VECT(TMU1_1, 0x1920),
-+ INTCS_VECT(TMU1_2, 0x1940),
-+ INTCS_VECT(CMT4, 0x1980),
-+ INTCS_VECT(DISP, 0x19A0),
-+ INTCS_VECT(DSRV, 0x19C0),
-+ /* MFIS2 */
-+ INTCS_VECT(CPORTS2R, 0x1A20),
-+
-+ INTC_VECT(INTCS, 0xf80),
-+};
-
--static int r8a7740_set_wake(struct irq_data *data, unsigned int on)
-+static struct intc_group intcs_groups[] __initdata = {
-+ INTC_GROUP(_2DG1, /*FIXME*/
-+ _2DG_CER_INT, _2DG_GPM_INT, _2DG_TRAP),
-+ INTC_GROUP(IIC0,
-+ IIC0_DTEI, IIC0_WAITI, IIC0_TACKI, IIC0_ALI),
-+ INTC_GROUP(TMU1,
-+ TMU1_0, TMU1_1, TMU1_2),
-+};
-+
-+static struct intc_mask_reg intcs_mask_registers[] = {
-+ /* IMR0SA / IMCR0SA */ /* all 0 */
-+ { /* IMR1SA / IMCR1SA */ 0xffd20184, 0xffd201c4, 8,
-+ { _2DG_CER_INT, _2DG_GPM_INT, _2DG_TRAP, VPU5HA2,
-+ 0, 0, 0, 0 /*STPRO*/ } },
-+ { /* IMR2SA / IMCR2SA */ 0xffd20188, 0xffd201c8, 8,
-+ { 0/*STPRO*/, 0, CEU21, VPU5F,
-+ 0/*BBIF2*/, 0, 0, 0/*MFI*/ } },
-+ { /* IMR3SA / IMCR3SA */ 0xffd2018c, 0xffd201cc, 8,
-+ { 0, 0, 0, 0, /*2DDMAC*/
-+ VIO6C, 0, 0, ICB } },
-+ { /* IMR4SA / IMCR4SA */ 0xffd20190, 0xffd201d0, 8,
-+ { 0, 0, VOU, CTI,
-+ JPU, 0, LCRC, LCDC0 } },
-+ /* IMR5SA / IMCR5SA */ /*KEYSC/RTDMAC2/RTDMAC1*/
-+ /* IMR6SA / IMCR6SA */ /*MSIOF/SGX540*/
-+ { /* IMR7SA / IMCR7SA */ 0xffd2019c, 0xffd201dc, 8,
-+ { 0, TMU0_2, TMU0_1, TMU0_0,
-+ 0, 0, 0, 0 } },
-+ { /* IMR8SA / IMCR8SA */ 0xffd201a0, 0xffd201e0, 8,
-+ { 0, 0, 0, 0,
-+ CEU20, 0, 0, 0 } },
-+ { /* IMR9SA / IMCR9SA */ 0xffd201a4, 0xffd201e4, 8,
-+ { 0, 0/*RWDT0*/, 0/*CMT2*/, CMT0,
-+ 0, 0, 0, 0 } },
-+ /* IMR10SA / IMCR10SA */ /*IPMMU*/
-+ { /* IMR11SA / IMCR11SA */ 0xffd201ac, 0xffd201ec, 8,
-+ { IIC0_DTEI, IIC0_WAITI, IIC0_TACKI, IIC0_ALI,
-+ 0, _2DG_BRK_INT, LMB, 0 } },
-+ /* IMR12SA / IMCR12SA */
-+ /* IMR13SA / IMCR13SA */
-+ /* IMR0SA3 / IMCR0SA3 */ /*RTDMAC2(1)/RTDMAC2(2)*/
-+ /* IMR1SA3 / IMCR1SA3 */
-+ /* IMR2SA3 / IMCR2SA3 */
-+ /* IMR3SA3 / IMCR3SA3 */
-+ { /* IMR4SA3 / IMCR4SA3 */ 0xffd50190, 0xffd501d0, 8,
-+ { 0, 0, 0, 0,
-+ LCDC1, 0, 0, 0 } },
-+ /* IMR5SA3 / IMCR5SA3 */ /* SPU2/FSI/FMSI */
-+ { /* IMR6SA3 / IMCR6SA3 */ 0xffd50198, 0xffd501d8, 8,
-+ { TMU1_0, TMU1_1, TMU1_2, 0,
-+ CMT4, DISP, DSRV, 0 } },
-+ { /* IMR7SA3 / IMCR7SA3 */ 0xffd5019c, 0xffd501dc, 8,
-+ { 0/*MFIS2*/, CPORTS2R, 0, 0,
-+ 0, 0, 0, 0 } },
-+ { /* INTAMASK */ 0xffd20104, 0, 16,
-+ { 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, INTCS } },
-+};
-+
-+/* Priority is needed for INTCA to receive the INTCS interrupt */
-+static struct intc_prio_reg intcs_prio_registers[] = {
-+ { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, VOU, 0/*2DDMAC*/, ICB } },
-+ { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU, LCDC0, 0, LCRC } },
-+ /* IPRCS */ /*BBIF2*/
-+ /* IPRDS */
-+ { 0xffd20010, 0, 16, 4, /* IPRES */ { 0/*RTDMAC(1)*/, VPU5HA2,
-+ 0/*MFI*/, VPU5F } },
-+ { 0xffd20014, 0, 16, 4, /* IPRFS */ { 0/*KEYSC*/, 0/*RTDMAC(2)*/,
-+ 0/*CMT2*/, CMT0 } },
-+ { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU0_0, TMU0_1,
-+ TMU0_2, _2DG1 } },
-+ { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0/*STPRO*/, 0/*STPRO*/,
-+ _2DG_BRK_INT/*FIXME*/ } },
-+ { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, 0/*MSIOF*/, 0, IIC0 } },
-+ { 0xffd20024, 0, 16, 4, /* IPRJS */ { CEU20, 0/*SGX540*/, 0, 0 } },
-+ { 0xffd20028, 0, 16, 4, /* IPRKS */ { VIO6C, 0, LMB, 0 } },
-+ { 0xffd2002c, 0, 16, 4, /* IPRLS */ { 0/*IPMMU*/, 0, CEU21, 0 } },
-+ /* IPRMS */ /*RWDT0*/
-+ /* IPRAS3 */ /*RTDMAC2(1)*/
-+ /* IPRBS3 */ /*RTDMAC2(2)*/
-+ /* IPRCS3 */
-+ /* IPRDS3 */
-+ /* IPRES3 */
-+ /* IPRFS3 */
-+ /* IPRGS3 */
-+ /* IPRHS3 */
-+ /* IPRIS3 */
-+ { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, 0, 0, 0 } },
-+ /* IPRKS3 */ /*SPU2/FSI/FMSi*/
-+ /* IPRLS3 */
-+ { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } },
-+ { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DISP, DSRV, 0 } },
-+ { 0xffd50038, 0, 16, 4, /* IPROS3 */ { 0/*MFIS2*/, CPORTS2R, 0, 0 } },
-+ /* IPRPS3 */
-+};
-+
-+static struct resource intcs_resources[] __initdata = {
-+ [0] = {
-+ .start = 0xffd20000,
-+ .end = 0xffd201ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 0xffd50000,
-+ .end = 0xffd501ff,
-+ .flags = IORESOURCE_MEM,
-+ }
-+};
-+
-+static struct intc_desc intcs_desc __initdata = {
-+ .name = "r8a7740-intcs",
-+ .resource = intcs_resources,
-+ .num_resources = ARRAY_SIZE(intcs_resources),
-+ .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
-+ intcs_prio_registers, NULL, NULL),
-+};
-+
-+static void intcs_demux(unsigned int irq, struct irq_desc *desc)
- {
-- return 0; /* always allow wakeup */
-+ void __iomem *reg = (void *)irq_get_handler_data(irq);
-+ unsigned int evtcodeas = ioread32(reg);
-+
-+ generic_handle_irq(intcs_evt2irq(evtcodeas));
- }
-
- void __init r8a7740_init_irq(void)
- {
-- void __iomem *gic_dist_base = __io(0xf0001000);
-- void __iomem *gic_cpu_base = __io(0xf0000000);
-+ void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
-
-- /*
-- * Change INT_SEL INTCA->GIC
-- * (on GPIO)
-- */
-- __raw_writel(__raw_readl(INTA_CTRL) & ~(1 << 1), INTA_CTRL);
-+ register_intc_controller(&intca_desc);
-+ register_intc_controller(&intca_irq_pins_desc);
-+ register_intc_controller(&intcs_desc);
-
-- gic_init(0, 29, gic_dist_base, gic_cpu_base);
-- gic_arch_extn.irq_set_wake = r8a7740_set_wake;
-+ /* demux using INTEVTSA */
-+ irq_set_handler_data(evt2irq(0xf80), (void *)intevtsa);
-+ irq_set_chained_handler(evt2irq(0xf80), intcs_demux);
- }
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-index e16860f..986dca6 100644
---- a/arch/arm/mach-shmobile/setup-r8a7740.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -35,7 +35,7 @@ static struct plat_sci_port scif0_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(100)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0c00)),
- };
-
- static struct platform_device scif0_device = {
-@@ -53,7 +53,7 @@ static struct plat_sci_port scif1_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(101)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0c20)),
- };
-
- static struct platform_device scif1_device = {
-@@ -71,7 +71,7 @@ static struct plat_sci_port scif2_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(102)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0c40)),
- };
-
- static struct platform_device scif2_device = {
-@@ -89,7 +89,7 @@ static struct plat_sci_port scif3_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(103)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0c60)),
- };
-
- static struct platform_device scif3_device = {
-@@ -107,7 +107,7 @@ static struct plat_sci_port scif4_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(104)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0d20)),
- };
-
- static struct platform_device scif4_device = {
-@@ -125,7 +125,7 @@ static struct plat_sci_port scif5_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(105)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0d40)),
- };
-
- static struct platform_device scif5_device = {
-@@ -143,7 +143,7 @@ static struct plat_sci_port scif6_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(106)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x04c0)),
- };
-
- static struct platform_device scif6_device = {
-@@ -161,7 +161,7 @@ static struct plat_sci_port scif7_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(107)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x04e0)),
- };
-
- static struct platform_device scif7_device = {
-@@ -179,7 +179,7 @@ static struct plat_sci_port scifb_platform_data = {
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFB,
-- .irqs = SCIx_IRQ_MUXED(gic_spi(108)),
-+ .irqs = SCIx_IRQ_MUXED(evt2irq(0x0d60)),
- };
-
- static struct platform_device scifb_device = {
-@@ -207,7 +207,7 @@ static struct resource cmt10_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- [1] = {
-- .start = gic_spi(58),
-+ .start = evt2irq(0x0b00),
- .flags = IORESOURCE_IRQ,
- },
- };
-@@ -244,8 +244,8 @@ static struct resource i2c0_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- [1] = {
-- .start = gic_spi(201),
-- .end = gic_spi(204),
-+ .start = intcs_evt2irq(0xe00),
-+ .end = intcs_evt2irq(0xe60),
- .flags = IORESOURCE_IRQ,
- },
- };
-@@ -258,8 +258,8 @@ static struct resource i2c1_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- [1] = {
-- .start = gic_spi(70),
-- .end = gic_spi(73),
-+ .start = evt2irq(0x780), /* IIC1_ALI1 */
-+ .end = evt2irq(0x7e0), /* IIC1_DTEI1 */
- .flags = IORESOURCE_IRQ,
- },
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0061-ARM-mach-shmobile-bonito-Add-LCDC0-support.patch b/patches.armadillo800eva/0061-ARM-mach-shmobile-bonito-Add-LCDC0-support.patch
deleted file mode 100644
index ccb19973122a87..00000000000000
--- a/patches.armadillo800eva/0061-ARM-mach-shmobile-bonito-Add-LCDC0-support.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From a312fff23bc9b15c9896061c837a35edf027780b Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:47:16 -0800
-Subject: ARM: mach-shmobile: bonito: Add LCDC0 support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 665ccfa0904cc0a05aa882d193f9506081824d7c)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-bonito.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 5bb02f2..3b35b9a 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -251,7 +251,7 @@ static struct clk div6_clks[DIV6_NR] = {
-
- enum {
- MSTP125,
-- MSTP116, MSTP111,
-+ MSTP116, MSTP111, MSTP100, MSTP117,
-
- MSTP230,
- MSTP222,
-@@ -264,8 +264,10 @@ enum {
-
- static struct clk mstp_clks[MSTP_NR] = {
- [MSTP125] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */
-+ [MSTP117] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 17, 0), /* LCDC1 */
- [MSTP116] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */
- [MSTP111] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 11, 0), /* TMU1 */
-+ [MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
-
- [MSTP230] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 30, 0), /* SCIFA6 */
- [MSTP222] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 22, 0), /* SCIFA7 */
-@@ -314,8 +316,10 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
-
- /* MSTP32 clocks */
-+ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]),
- CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]),
- CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]),
-+ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]),
- CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]),
-
- CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]),
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0062-ARM-mach-shmobile-r8a7740-sh_clk_ops-rename.patch b/patches.armadillo800eva/0062-ARM-mach-shmobile-r8a7740-sh_clk_ops-rename.patch
deleted file mode 100644
index efbae90aed2e76..00000000000000
--- a/patches.armadillo800eva/0062-ARM-mach-shmobile-r8a7740-sh_clk_ops-rename.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 9ea780bd6745d2432f607d442035256ed93fc0e7 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 22:17:00 +0900
-Subject: ARM: mach-shmobile: r8a7740 sh_clk_ops rename
-
-Convert r8a7740 to use sh_clk_ops.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d9f8670df8c6eb4c0726ea3fa8ff8bc712702500)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 3b35b9a..6a40684 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -93,7 +93,7 @@ static unsigned long div_recalc(struct clk *clk)
- return clk->parent->rate / (int)(clk->priv);
- }
-
--static struct clk_ops div_clk_ops = {
-+static struct sh_clk_ops div_clk_ops = {
- .recalc = div_recalc,
- };
-
-@@ -125,7 +125,7 @@ static struct clk extal2_div2_clk = {
- .parent = &extal2_clk,
- };
-
--static struct clk_ops followparent_clk_ops = {
-+static struct sh_clk_ops followparent_clk_ops = {
- .recalc = followparent_recalc,
- };
-
-@@ -156,7 +156,7 @@ static unsigned long pllc01_recalc(struct clk *clk)
- return clk->parent->rate * mult;
- }
-
--static struct clk_ops pllc01_clk_ops = {
-+static struct sh_clk_ops pllc01_clk_ops = {
- .recalc = pllc01_recalc,
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0063-ARM-mach-shmobile-r8a7740-map_io-and-init_early-upda.patch b/patches.armadillo800eva/0063-ARM-mach-shmobile-r8a7740-map_io-and-init_early-upda.patch
deleted file mode 100644
index 05d247f82c56bb..00000000000000
--- a/patches.armadillo800eva/0063-ARM-mach-shmobile-r8a7740-map_io-and-init_early-upda.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 5e344935b55c044d754627cb8d38720c19181662 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 21:37:35 +0900
-Subject: ARM: mach-shmobile: r8a7740 map_io and init_early update
-
-Update the r8a7740 SoC and the Bonito board to make use of
-the functions r8a7740_map_io() and r8a7740_add_early_devices().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d3ab7221489fa188b0e1e9bfe2cc4ecd1d7da933)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-bonito.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/common.h | 1 +
- arch/arm/mach-shmobile/setup-r8a7740.c | 35 ++++++++++++++++++++++++++
- 2 files changed, 36 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index d821f63..2e21a77 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -55,6 +55,7 @@ extern int sh73a0_boot_secondary(unsigned int cpu);
- extern void sh73a0_smp_prepare_cpus(void);
-
- extern void r8a7740_init_irq(void);
-+extern void r8a7740_map_io(void);
- extern void r8a7740_add_early_devices(void);
- extern void r8a7740_add_standard_devices(void);
- extern void r8a7740_clock_init(u8 md_ck);
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-index 986dca6..dbc3067 100644
---- a/arch/arm/mach-shmobile/setup-r8a7740.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -25,9 +25,41 @@
- #include <linux/serial_sci.h>
- #include <linux/sh_timer.h>
- #include <mach/r8a7740.h>
-+#include <mach/common.h>
- #include <asm/mach-types.h>
-+#include <asm/mach/map.h>
- #include <asm/mach/arch.h>
-
-+static struct map_desc r8a7740_io_desc[] __initdata = {
-+ /*
-+ * for CPGA/INTC/PFC
-+ * 0xe6000000-0xefffffff -> 0xe6000000-0xefffffff
-+ */
-+ {
-+ .virtual = 0xe6000000,
-+ .pfn = __phys_to_pfn(0xe6000000),
-+ .length = 160 << 20,
-+ .type = MT_DEVICE_NONSHARED
-+ },
-+#ifdef CONFIG_CACHE_L2X0
-+ /*
-+ * for l2x0_init()
-+ * 0xf0100000-0xf0101000 -> 0xf0002000-0xf0003000
-+ */
-+ {
-+ .virtual = 0xf0002000,
-+ .pfn = __phys_to_pfn(0xf0100000),
-+ .length = PAGE_SIZE,
-+ .type = MT_DEVICE_NONSHARED
-+ },
-+#endif
-+};
-+
-+void __init r8a7740_map_io(void)
-+{
-+ iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
-+}
-+
- /* SCIFA0 */
- static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe6c40000,
-@@ -349,4 +381,7 @@ void __init r8a7740_add_early_devices(void)
- {
- early_platform_add_devices(r8a7740_early_devices,
- ARRAY_SIZE(r8a7740_early_devices));
-+
-+ /* setup early console here as well */
-+ shmobile_setup_console();
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0064-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch b/patches.armadillo800eva/0064-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
deleted file mode 100644
index 777f99a63b0d1d..00000000000000
--- a/patches.armadillo800eva/0064-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From c5cbdbce8978b5b8baf3cd96a10ea6ce76e2decd Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 21:41:30 +0900
-Subject: ARM: mach-shmobile: rename clk_init() to shmobile_clk_init()
-
-Rename clk_init() to shmobile_clk_init() to avoid a potential
-future name space collision with the common clock framework.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6b6a4c067cefe04eb0a0e7d1cace16ae727c6295)
-
-Conflicts:
-
- arch/arm/mach-shmobile/clock-r8a7779.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 6a40684..99c4d74 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -376,7 +376,7 @@ void __init r8a7740_clock_init(u8 md_ck)
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
-- clk_init();
-+ shmobile_clk_init();
- else
- panic("failed to setup r8a7740 clocks\n");
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0065-ARM-mach-shmobile-r8a7740-and-Bonito-timer-rework.patch b/patches.armadillo800eva/0065-ARM-mach-shmobile-r8a7740-and-Bonito-timer-rework.patch
deleted file mode 100644
index 051129a38c3959..00000000000000
--- a/patches.armadillo800eva/0065-ARM-mach-shmobile-r8a7740-and-Bonito-timer-rework.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 61ff43d82e7561e42ec05781acf017d65368bfee Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 6 Mar 2012 17:36:53 +0900
-Subject: ARM: mach-shmobile: r8a7740 and Bonito timer rework
-
-Copy the SoC specific timer code from Bonito board code
-to r8a7740 setup code. This makes is possible to share
-the SoC specific timer code across boards. The Bonito
-specific timer setup code tied to the FPGA is kept as-is.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 23e5bc03e3b07185d61c212bf39aaf126cc958e3)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-bonito.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-r8a7740.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-index dbc3067..74e5234 100644
---- a/arch/arm/mach-shmobile/setup-r8a7740.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -29,6 +29,7 @@
- #include <asm/mach-types.h>
- #include <asm/mach/map.h>
- #include <asm/mach/arch.h>
-+#include <asm/mach/time.h>
-
- static struct map_desc r8a7740_io_desc[] __initdata = {
- /*
-@@ -377,6 +378,12 @@ void __init r8a7740_add_standard_devices(void)
- ARRAY_SIZE(r8a7740_late_devices));
- }
-
-+static void __init r8a7740_earlytimer_init(void)
-+{
-+ r8a7740_clock_init(0);
-+ shmobile_earlytimer_init();
-+}
-+
- void __init r8a7740_add_early_devices(void)
- {
- early_platform_add_devices(r8a7740_early_devices,
-@@ -384,4 +391,7 @@ void __init r8a7740_add_early_devices(void)
-
- /* setup early console here as well */
- shmobile_setup_console();
-+
-+ /* override timer setup with soc-specific code */
-+ shmobile_timer.init = r8a7740_earlytimer_init;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0066-ARM-mach-shmobile-pfc-r8a7740-add-gpio_irq-support.patch b/patches.armadillo800eva/0066-ARM-mach-shmobile-pfc-r8a7740-add-gpio_irq-support.patch
deleted file mode 100644
index c5a7f1d72e1664..00000000000000
--- a/patches.armadillo800eva/0066-ARM-mach-shmobile-pfc-r8a7740-add-gpio_irq-support.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From b9aaa6ed8c90707a7161bc602aa2353fafde4551 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:28:14 -0700
-Subject: ARM: mach-shmobile: pfc-r8a7740: add gpio_irq support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit c8ad89c21540fd58acaec22f984bb5e8775d0e59)
-
-N.B: this commit is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-r8a7740.c | 39 ++++++++++++++++++++++++++++++++++
- 1 file changed, 39 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/pfc-r8a7740.c b/arch/arm/mach-shmobile/pfc-r8a7740.c
-index a4fff69..670fe18 100644
---- a/arch/arm/mach-shmobile/pfc-r8a7740.c
-+++ b/arch/arm/mach-shmobile/pfc-r8a7740.c
-@@ -22,6 +22,7 @@
- #include <linux/kernel.h>
- #include <linux/gpio.h>
- #include <mach/r8a7740.h>
-+#include <mach/irqs.h>
-
- #define CPU_ALL_PORT(fn, pfx, sfx) \
- PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
-@@ -2527,6 +2528,41 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
- { },
- };
-
-+static struct pinmux_irq pinmux_irqs[] = {
-+ PINMUX_IRQ(evt2irq(0x0200), PORT2_FN0, PORT13_FN0), /* IRQ0A */
-+ PINMUX_IRQ(evt2irq(0x0220), PORT20_FN0), /* IRQ1A */
-+ PINMUX_IRQ(evt2irq(0x0240), PORT11_FN0, PORT12_FN0), /* IRQ2A */
-+ PINMUX_IRQ(evt2irq(0x0260), PORT10_FN0, PORT14_FN0), /* IRQ3A */
-+ PINMUX_IRQ(evt2irq(0x0280), PORT15_FN0, PORT172_FN0), /* IRQ4A */
-+ PINMUX_IRQ(evt2irq(0x02A0), PORT0_FN0, PORT1_FN0), /* IRQ5A */
-+ PINMUX_IRQ(evt2irq(0x02C0), PORT121_FN0, PORT173_FN0), /* IRQ6A */
-+ PINMUX_IRQ(evt2irq(0x02E0), PORT120_FN0, PORT209_FN0), /* IRQ7A */
-+ PINMUX_IRQ(evt2irq(0x0300), PORT119_FN0), /* IRQ8A */
-+ PINMUX_IRQ(evt2irq(0x0320), PORT118_FN0, PORT210_FN0), /* IRQ9A */
-+ PINMUX_IRQ(evt2irq(0x0340), PORT19_FN0), /* IRQ10A */
-+ PINMUX_IRQ(evt2irq(0x0360), PORT104_FN0), /* IRQ11A */
-+ PINMUX_IRQ(evt2irq(0x0380), PORT42_FN0, PORT97_FN0), /* IRQ12A */
-+ PINMUX_IRQ(evt2irq(0x03A0), PORT64_FN0, PORT98_FN0), /* IRQ13A */
-+ PINMUX_IRQ(evt2irq(0x03C0), PORT63_FN0, PORT99_FN0), /* IRQ14A */
-+ PINMUX_IRQ(evt2irq(0x03E0), PORT62_FN0, PORT100_FN0), /* IRQ15A */
-+ PINMUX_IRQ(evt2irq(0x3200), PORT68_FN0, PORT211_FN0), /* IRQ16A */
-+ PINMUX_IRQ(evt2irq(0x3220), PORT69_FN0), /* IRQ17A */
-+ PINMUX_IRQ(evt2irq(0x3240), PORT70_FN0), /* IRQ18A */
-+ PINMUX_IRQ(evt2irq(0x3260), PORT71_FN0), /* IRQ19A */
-+ PINMUX_IRQ(evt2irq(0x3280), PORT67_FN0), /* IRQ20A */
-+ PINMUX_IRQ(evt2irq(0x32A0), PORT202_FN0), /* IRQ21A */
-+ PINMUX_IRQ(evt2irq(0x32C0), PORT95_FN0), /* IRQ22A */
-+ PINMUX_IRQ(evt2irq(0x32E0), PORT96_FN0), /* IRQ23A */
-+ PINMUX_IRQ(evt2irq(0x3300), PORT180_FN0), /* IRQ24A */
-+ PINMUX_IRQ(evt2irq(0x3320), PORT38_FN0), /* IRQ25A */
-+ PINMUX_IRQ(evt2irq(0x3340), PORT58_FN0, PORT81_FN0), /* IRQ26A */
-+ PINMUX_IRQ(evt2irq(0x3360), PORT57_FN0, PORT168_FN0), /* IRQ27A */
-+ PINMUX_IRQ(evt2irq(0x3380), PORT56_FN0, PORT169_FN0), /* IRQ28A */
-+ PINMUX_IRQ(evt2irq(0x33A0), PORT50_FN0, PORT170_FN0), /* IRQ29A */
-+ PINMUX_IRQ(evt2irq(0x33C0), PORT49_FN0, PORT171_FN0), /* IRQ30A */
-+ PINMUX_IRQ(evt2irq(0x33E0), PORT41_FN0, PORT167_FN0), /* IRQ31A */
-+};
-+
- static struct pinmux_info r8a7740_pinmux_info = {
- .name = "r8a7740_pfc",
- .reserved_id = PINMUX_RESERVED,
-@@ -2554,6 +2590,9 @@ static struct pinmux_info r8a7740_pinmux_info = {
-
- .gpio_data = pinmux_data,
- .gpio_data_size = ARRAY_SIZE(pinmux_data),
-+
-+ .gpio_irq = pinmux_irqs,
-+ .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
- };
-
- void r8a7740_pinmux_init(void)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0067-net-sh_eth-tidyup-compile-warning.patch b/patches.armadillo800eva/0067-net-sh_eth-tidyup-compile-warning.patch
deleted file mode 100644
index ed039c39f417bb..00000000000000
--- a/patches.armadillo800eva/0067-net-sh_eth-tidyup-compile-warning.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From a9e3730dc28fd56cdb9f0b898bd05c099020efb4 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 23 Jun 2011 16:02:38 +0000
-Subject: net: sh_eth: tidyup compile warning
-
-This patch tidyup below warning
-
-${LINUX}/drivers/net/sh_eth.c:1773: warning:
-'mdp' may be used uninitialized in this function
-
-Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit ec0d75518cb06261f1823fa2713fe52b9b26455e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/sh_eth.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
-index 1f3f7b4..3a7a6a5 100644
---- a/drivers/net/sh_eth.c
-+++ b/drivers/net/sh_eth.c
-@@ -1772,7 +1772,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- int ret, devno = 0;
- struct resource *res;
- struct net_device *ndev = NULL;
-- struct sh_eth_private *mdp;
-+ struct sh_eth_private *mdp = NULL;
- struct sh_eth_plat_data *pd;
-
- /* get base addr */
-@@ -1890,7 +1890,7 @@ out_unregister:
-
- out_release:
- /* net_dev free */
-- if (mdp->tsu_addr)
-+ if (mdp && mdp->tsu_addr)
- iounmap(mdp->tsu_addr);
- if (ndev)
- free_netdev(ndev);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0068-net-sh_eth-remove-__flush_purge_region.patch b/patches.armadillo800eva/0068-net-sh_eth-remove-__flush_purge_region.patch
deleted file mode 100644
index c787b08ac39853..00000000000000
--- a/patches.armadillo800eva/0068-net-sh_eth-remove-__flush_purge_region.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From a7514fd245d399bbd56a4465f0c651ce78c6f19e Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 30 Jun 2011 22:52:13 +0000
-Subject: net: sh_eth: remove __flush_purge_region
-
-It is a function of SuperH architecture. There is no good to use
-the function on a driver generally. So, the driver uses
-dma_map_single() instead of __flush_purge_region.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 31fcb99d9958bdf04e84224e202f69e6cdac893b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/sh_eth.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
-index 3a7a6a5..ad35c21 100644
---- a/drivers/net/sh_eth.c
-+++ b/drivers/net/sh_eth.c
-@@ -33,7 +33,6 @@
- #include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/ethtool.h>
--#include <asm/cacheflush.h>
-
- #include "sh_eth.h"
-
-@@ -866,6 +865,8 @@ static int sh_eth_txfree(struct net_device *ndev)
- break;
- /* Free the original skb. */
- if (mdp->tx_skbuff[entry]) {
-+ dma_unmap_single(&ndev->dev, txdesc->addr,
-+ txdesc->buffer_length, DMA_TO_DEVICE);
- dev_kfree_skb_irq(mdp->tx_skbuff[entry]);
- mdp->tx_skbuff[entry] = NULL;
- freeNum++;
-@@ -1489,13 +1490,12 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
- entry = mdp->cur_tx % TX_RING_SIZE;
- mdp->tx_skbuff[entry] = skb;
- txdesc = &mdp->tx_ring[entry];
-- txdesc->addr = virt_to_phys(skb->data);
- /* soft swap. */
- if (!mdp->cd->hw_swap)
- sh_eth_soft_swap(phys_to_virt(ALIGN(txdesc->addr, 4)),
- skb->len + 2);
-- /* write back */
-- __flush_purge_region(skb->data, skb->len);
-+ txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len,
-+ DMA_TO_DEVICE);
- if (skb->len < ETHERSMALL)
- txdesc->buffer_length = ETHERSMALL;
- else
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0069-sh_eth-Move-the-Renesas-SuperH-driver.patch b/patches.armadillo800eva/0069-sh_eth-Move-the-Renesas-SuperH-driver.patch
deleted file mode 100644
index de00744ce1d9ac..00000000000000
--- a/patches.armadillo800eva/0069-sh_eth-Move-the-Renesas-SuperH-driver.patch
+++ /dev/null
@@ -1,290 +0,0 @@
-From aac0e941122849b587798822e4dd5a62facfcd9a Mon Sep 17 00:00:00 2001
-From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-Date: Sat, 25 Jun 2011 03:53:13 -0700
-Subject: sh_eth: Move the Renesas SuperH driver
-
-Move the Renesas driver into drivers/net/ethernet/renesas/ and make
-the necessary Kconfig and Makefile changes.
-
-CC: Yoshihiro Shimoda <yoshihiro.shirmoda.uh@renesas.com>
-Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-(cherry picked from commit 37b937575b5a93a8fcbd4e1d553415f99381f650)
-
-Conflicts:
-
- drivers/net/Kconfig
- drivers/net/Makefile
- drivers/net/ethernet/Kconfig
- drivers/net/ethernet/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/Kconfig | 15 +--
- drivers/net/Makefile | 2 +-
- drivers/net/ethernet/Kconfig | 164 +++++++++++++++++++++++++++
- drivers/net/ethernet/renesas/Kconfig | 18 +++
- drivers/net/ethernet/renesas/Makefile | 5 +
- drivers/net/{ => ethernet/renesas}/sh_eth.c | 0
- drivers/net/{ => ethernet/renesas}/sh_eth.h | 0
- 7 files changed, 189 insertions(+), 15 deletions(-)
- create mode 100644 drivers/net/ethernet/Kconfig
- create mode 100644 drivers/net/ethernet/renesas/Kconfig
- create mode 100644 drivers/net/ethernet/renesas/Makefile
- rename drivers/net/{ => ethernet/renesas}/sh_eth.c (100%)
- rename drivers/net/{ => ethernet/renesas}/sh_eth.h (100%)
-
-diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
-index 93359fa..bc75f35 100644
---- a/drivers/net/Kconfig
-+++ b/drivers/net/Kconfig
-@@ -528,20 +528,7 @@ config STNIC
-
- If unsure, say N.
-
--config SH_ETH
-- tristate "Renesas SuperH Ethernet support"
-- depends on SUPERH && \
-- (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
-- CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
-- CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757)
-- select CRC32
-- select MII
-- select MDIO_BITBANG
-- select PHYLIB
-- help
-- Renesas SuperH Ethernet device driver.
-- This driver supporting CPUs are:
-- - SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757.
-+source "drivers/net/ethernet/renesas/Kconfig"
-
- config SUNLANCE
- tristate "Sun LANCE support"
-diff --git a/drivers/net/Makefile b/drivers/net/Makefile
-index d5ce011..45ae508 100644
---- a/drivers/net/Makefile
-+++ b/drivers/net/Makefile
-@@ -106,7 +106,7 @@ obj-$(CONFIG_VIA_RHINE) += via-rhine.o
- obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
- obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
- obj-$(CONFIG_RIONET) += rionet.o
--obj-$(CONFIG_SH_ETH) += sh_eth.o
-+obj-$(CONFIG_SH_ETH) += ethernet/renesas/
- obj-$(CONFIG_STMMAC_ETH) += stmmac/
-
- #
-diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
-new file mode 100644
-index 0000000..df8940d
---- /dev/null
-+++ b/drivers/net/ethernet/Kconfig
-@@ -0,0 +1,164 @@
-+#
-+# Ethernet LAN device configuration
-+#
-+
-+menuconfig ETHERNET
-+ bool "Ethernet driver support"
-+ depends on NET
-+ default y
-+ ---help---
-+ This section contains all the Ethernet device drivers.
-+
-+if ETHERNET
-+
-+source "drivers/net/ethernet/3com/Kconfig"
-+source "drivers/net/ethernet/adaptec/Kconfig"
-+source "drivers/net/ethernet/aeroflex/Kconfig"
-+source "drivers/net/ethernet/amd/Kconfig"
-+source "drivers/net/ethernet/apple/Kconfig"
-+source "drivers/net/ethernet/atheros/Kconfig"
-+source "drivers/net/ethernet/cadence/Kconfig"
-+source "drivers/net/ethernet/adi/Kconfig"
-+source "drivers/net/ethernet/broadcom/Kconfig"
-+source "drivers/net/ethernet/brocade/Kconfig"
-+source "drivers/net/ethernet/chelsio/Kconfig"
-+source "drivers/net/ethernet/cirrus/Kconfig"
-+source "drivers/net/ethernet/cisco/Kconfig"
-+source "drivers/net/ethernet/davicom/Kconfig"
-+
-+config DNET
-+ tristate "Dave ethernet support (DNET)"
-+ depends on HAS_IOMEM
-+ select PHYLIB
-+ ---help---
-+ The Dave ethernet interface (DNET) is found on Qong Board FPGA.
-+ Say Y to include support for the DNET chip.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called dnet.
-+
-+source "drivers/net/ethernet/dec/Kconfig"
-+source "drivers/net/ethernet/dlink/Kconfig"
-+source "drivers/net/ethernet/emulex/Kconfig"
-+source "drivers/net/ethernet/neterion/Kconfig"
-+source "drivers/net/ethernet/faraday/Kconfig"
-+source "drivers/net/ethernet/freescale/Kconfig"
-+source "drivers/net/ethernet/fujitsu/Kconfig"
-+source "drivers/net/ethernet/hp/Kconfig"
-+source "drivers/net/ethernet/ibm/Kconfig"
-+source "drivers/net/ethernet/intel/Kconfig"
-+source "drivers/net/ethernet/i825xx/Kconfig"
-+source "drivers/net/ethernet/xscale/Kconfig"
-+source "drivers/net/ethernet/icplus/Kconfig"
-+
-+config JME
-+ tristate "JMicron(R) PCI-Express Gigabit Ethernet support"
-+ depends on PCI
-+ select CRC32
-+ select MII
-+ ---help---
-+ This driver supports the PCI-Express gigabit ethernet adapters
-+ based on JMicron JMC250 chipset.
-+
-+ To compile this driver as a module, choose M here. The module
-+ will be called jme.
-+
-+config KORINA
-+ tristate "Korina (IDT RC32434) Ethernet support"
-+ depends on MIKROTIK_RB532
-+ ---help---
-+ If you have a Mikrotik RouterBoard 500 or IDT RC32434
-+ based system say Y. Otherwise say N.
-+
-+config LANTIQ_ETOP
-+ tristate "Lantiq SoC ETOP driver"
-+ depends on SOC_TYPE_XWAY
-+ ---help---
-+ Support for the MII0 inside the Lantiq SoC
-+
-+source "drivers/net/ethernet/marvell/Kconfig"
-+source "drivers/net/ethernet/mellanox/Kconfig"
-+source "drivers/net/ethernet/micrel/Kconfig"
-+source "drivers/net/ethernet/microchip/Kconfig"
-+
-+config MIPS_SIM_NET
-+ tristate "MIPS simulator Network device"
-+ depends on MIPS_SIM
-+ ---help---
-+ The MIPSNET device is a simple Ethernet network device which is
-+ emulated by the MIPS Simulator.
-+ If you are not using a MIPSsim or are unsure, say N.
-+
-+source "drivers/net/ethernet/myricom/Kconfig"
-+
-+config FEALNX
-+ tristate "Myson MTD-8xx PCI Ethernet support"
-+ depends on PCI
-+ select CRC32
-+ select MII
-+ ---help---
-+ Say Y here to support the Myson MTD-800 family of PCI-based Ethernet
-+ cards. <http://www.myson.com.tw/>
-+
-+source "drivers/net/ethernet/natsemi/Kconfig"
-+source "drivers/net/ethernet/8390/Kconfig"
-+
-+config NET_NETX
-+ tristate "NetX Ethernet support"
-+ select MII
-+ depends on ARCH_NETX
-+ ---help---
-+ This is support for the Hilscher netX builtin Ethernet ports
-+
-+ To compile this driver as a module, choose M here. The module
-+ will be called netx-eth.
-+
-+source "drivers/net/ethernet/nuvoton/Kconfig"
-+source "drivers/net/ethernet/nvidia/Kconfig"
-+source "drivers/net/ethernet/octeon/Kconfig"
-+source "drivers/net/ethernet/oki-semi/Kconfig"
-+
-+config ETHOC
-+ tristate "OpenCores 10/100 Mbps Ethernet MAC support"
-+ depends on HAS_IOMEM && HAS_DMA
-+ select MII
-+ select PHYLIB
-+ select CRC32
-+ select BITREVERSE
-+ ---help---
-+ Say Y here if you want to use the OpenCores 10/100 Mbps Ethernet MAC.
-+
-+source "drivers/net/ethernet/packetengines/Kconfig"
-+source "drivers/net/ethernet/pasemi/Kconfig"
-+source "drivers/net/ethernet/qlogic/Kconfig"
-+source "drivers/net/ethernet/racal/Kconfig"
-+source "drivers/net/ethernet/realtek/Kconfig"
-+source "drivers/net/ethernet/renesas/Kconfig"
-+source "drivers/net/ethernet/rdc/Kconfig"
-+
-+config S6GMAC
-+ tristate "S6105 GMAC ethernet support"
-+ depends on XTENSA_VARIANT_S6000
-+ select PHYLIB
-+ ---help---
-+ This driver supports the on chip ethernet device on the
-+ S6105 xtensa processor.
-+
-+ To compile this driver as a module, choose M here. The module
-+ will be called s6gmac.
-+
-+source "drivers/net/ethernet/seeq/Kconfig"
-+source "drivers/net/ethernet/sis/Kconfig"
-+source "drivers/net/ethernet/sfc/Kconfig"
-+source "drivers/net/ethernet/sgi/Kconfig"
-+source "drivers/net/ethernet/smsc/Kconfig"
-+source "drivers/net/ethernet/stmicro/Kconfig"
-+source "drivers/net/ethernet/sun/Kconfig"
-+source "drivers/net/ethernet/tehuti/Kconfig"
-+source "drivers/net/ethernet/ti/Kconfig"
-+source "drivers/net/ethernet/toshiba/Kconfig"
-+source "drivers/net/ethernet/tundra/Kconfig"
-+source "drivers/net/ethernet/via/Kconfig"
-+source "drivers/net/ethernet/xilinx/Kconfig"
-+
-+endif # ETHERNET
-diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
-new file mode 100644
-index 0000000..f57ae23
---- /dev/null
-+++ b/drivers/net/ethernet/renesas/Kconfig
-@@ -0,0 +1,18 @@
-+#
-+# Renesas device configuration
-+#
-+
-+config SH_ETH
-+ tristate "Renesas SuperH Ethernet support"
-+ depends on SUPERH && \
-+ (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
-+ CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
-+ CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757)
-+ select CRC32
-+ select MII
-+ select MDIO_BITBANG
-+ select PHYLIB
-+ ---help---
-+ Renesas SuperH Ethernet device driver.
-+ This driver supporting CPUs are:
-+ - SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757.
-diff --git a/drivers/net/ethernet/renesas/Makefile b/drivers/net/ethernet/renesas/Makefile
-new file mode 100644
-index 0000000..1c278a8
---- /dev/null
-+++ b/drivers/net/ethernet/renesas/Makefile
-@@ -0,0 +1,5 @@
-+#
-+# Makefile for the Renesas device drivers.
-+#
-+
-+obj-$(CONFIG_SH_ETH) += sh_eth.o
-diff --git a/drivers/net/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-similarity index 100%
-rename from drivers/net/sh_eth.c
-rename to drivers/net/ethernet/renesas/sh_eth.c
-diff --git a/drivers/net/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-similarity index 100%
-rename from drivers/net/sh_eth.h
-rename to drivers/net/ethernet/renesas/sh_eth.h
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0070-net-sh_eth-Fix-build-by-forgot-including-linux-inter.patch b/patches.armadillo800eva/0070-net-sh_eth-Fix-build-by-forgot-including-linux-inter.patch
deleted file mode 100644
index c3165737c33120..00000000000000
--- a/patches.armadillo800eva/0070-net-sh_eth-Fix-build-by-forgot-including-linux-inter.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 3eb257177788daf38fe43663ca9b96556138f973 Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Tue, 9 Aug 2011 20:15:50 +0000
-Subject: net: sh_eth: Fix build by forgot including linux/interrupt.h
-
-By a6b7a407865aab9f849dd99a71072b7cd1175116, remove interrupt.h
-from netdevice.h. But this forget to revise sh_eth.
-
-This fix the build failure.
-
-error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sh_eth_interrupt'
-error: implicit declaration of function 'request_irq'
-error: 'sh_eth_interrupt' undeclared (first use in this function)
-error: (Each undeclared identifier is reported only once
- drivers/net/sh_eth.c:1386: error: for each function it appears in.)
-error: 'IRQF_SHARED' undeclared (first use in this function)
-error: implicit declaration of function 'free_irq'
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-CC: Alexey Dobriyan <adobriyan@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 6a27cdeddf48858089e3672f844615cbf0877ebf)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index ad35c21..190f619 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -21,6 +21,7 @@
- */
-
- #include <linux/init.h>
-+#include <linux/interrupt.h>
- #include <linux/dma-mapping.h>
- #include <linux/etherdevice.h>
- #include <linux/delay.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0071-net-remove-use-of-ndo_set_multicast_list-in-drivers.patch b/patches.armadillo800eva/0071-net-remove-use-of-ndo_set_multicast_list-in-drivers.patch
deleted file mode 100644
index 560bf1334cb957..00000000000000
--- a/patches.armadillo800eva/0071-net-remove-use-of-ndo_set_multicast_list-in-drivers.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-From 69db4921cc9c0997a22f4815c552235a0de0bd2a Mon Sep 17 00:00:00 2001
-From: Jiri Pirko <jpirko@redhat.com>
-Date: Tue, 16 Aug 2011 06:29:01 +0000
-Subject: net: remove use of ndo_set_multicast_list in drivers
-
-replace it by ndo_set_rx_mode
-
-Signed-off-by: Jiri Pirko <jpirko@redhat.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from afc4b13df143122f99a0eb10bfefb216c2806de0)
-
- arch/ia64/hp/sim/simeth.c
- arch/um/drivers/net_kern.c
- arch/xtensa/platforms/iss/network.c
- drivers/infiniband/hw/nes/nes_nic.c
- drivers/infiniband/ulp/ipoib/ipoib_main.c
- drivers/media/dvb/dvb-core/dvb_net.c
- drivers/net/appletalk/cops.c
- drivers/net/appletalk/ltpc.c
- drivers/net/arcnet/com20020.c
- drivers/net/bonding/bond_main.c
- drivers/net/cris/eth_v10.c
- drivers/net/defxx.c
- drivers/net/dummy.c
- drivers/net/ethernet/3com/3c501.c
- drivers/net/ethernet/3com/3c509.c
- drivers/net/ethernet/3com/3c515.c
- drivers/net/ethernet/3com/3c574_cs.c
- drivers/net/ethernet/3com/3c589_cs.c
- drivers/net/ethernet/3com/3c59x.c
- drivers/net/ethernet/3com/typhoon.c
- drivers/net/ethernet/8390/3c503.c
- drivers/net/ethernet/8390/8390.c
- drivers/net/ethernet/8390/8390p.c
- drivers/net/ethernet/8390/ac3200.c
- drivers/net/ethernet/8390/ax88796.c
- drivers/net/ethernet/8390/axnet_cs.c
- drivers/net/ethernet/8390/e2100.c
- drivers/net/ethernet/8390/etherh.c
- drivers/net/ethernet/8390/hp-plus.c
- drivers/net/ethernet/8390/hydra.c
- drivers/net/ethernet/8390/mac8390.c
- drivers/net/ethernet/8390/ne-h8300.c
- drivers/net/ethernet/8390/ne2k-pci.c
- drivers/net/ethernet/8390/pcnet_cs.c
- drivers/net/ethernet/8390/smc-mca.c
- drivers/net/ethernet/8390/smc-ultra.c
- drivers/net/ethernet/8390/smc-ultra32.c
- drivers/net/ethernet/8390/wd.c
- drivers/net/ethernet/8390/zorro8390.c
- drivers/net/ethernet/adaptec/starfire.c
- drivers/net/ethernet/adi/bfin_mac.c
- drivers/net/ethernet/aeroflex/greth.c
- drivers/net/ethernet/alteon/acenic.c
- drivers/net/ethernet/amd/a2065.c
- drivers/net/ethernet/amd/am79c961a.c
- drivers/net/ethernet/amd/amd8111e.c
- drivers/net/ethernet/amd/ariadne.c
- drivers/net/ethernet/amd/atarilance.c
- drivers/net/ethernet/amd/au1000_eth.c
- drivers/net/ethernet/amd/declance.c
- drivers/net/ethernet/amd/depca.c
- drivers/net/ethernet/amd/hplance.c
- drivers/net/ethernet/amd/lance.c
- drivers/net/ethernet/amd/mvme147.c
- drivers/net/ethernet/amd/ni65.c
- drivers/net/ethernet/amd/nmclan_cs.c
- drivers/net/ethernet/amd/pcnet32.c
- drivers/net/ethernet/amd/sun3lance.c
- drivers/net/ethernet/amd/sunlance.c
- drivers/net/ethernet/apple/bmac.c
- drivers/net/ethernet/apple/cs89x0.c
- drivers/net/ethernet/apple/mac89x0.c
- drivers/net/ethernet/apple/mace.c
- drivers/net/ethernet/apple/macmace.c
- drivers/net/ethernet/atheros/atl1c/atl1c_main.c
- drivers/net/ethernet/atheros/atl1e/atl1e_main.c
- drivers/net/ethernet/atheros/atlx/atl1.c
- drivers/net/ethernet/atheros/atlx/atl2.c
- drivers/net/ethernet/broadcom/b44.c
- drivers/net/ethernet/broadcom/bcm63xx_enet.c
- drivers/net/ethernet/broadcom/sb1250-mac.c
- drivers/net/ethernet/broadcom/tg3.c
- drivers/net/ethernet/brocade/bna/bnad.c
- drivers/net/ethernet/cadence/at91_ether.c
- drivers/net/ethernet/cadence/macb.c
- drivers/net/ethernet/chelsio/cxgb/cxgb2.c
- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
- drivers/net/ethernet/cisco/enic/enic_main.c
- drivers/net/ethernet/davicom/dm9000.c
- drivers/net/ethernet/dec/ewrk3.c
- drivers/net/ethernet/dec/tulip/de2104x.c
- drivers/net/ethernet/dec/tulip/de4x5.c
- drivers/net/ethernet/dec/tulip/dmfe.c
- drivers/net/ethernet/dec/tulip/tulip_core.c
- drivers/net/ethernet/dec/tulip/uli526x.c
- drivers/net/ethernet/dec/tulip/winbond-840.c
- drivers/net/ethernet/dlink/de620.c
- drivers/net/ethernet/dlink/dl2k.c
- drivers/net/ethernet/dlink/sundance.c
- drivers/net/ethernet/ethoc.c
- drivers/net/ethernet/fealnx.c
- drivers/net/ethernet/freescale/fec.c
- drivers/net/ethernet/freescale/fec_mpc52xx.c
- .../net/ethernet/freescale/fs_enet/fs_enet-main.c
- drivers/net/ethernet/freescale/gianfar.c
- drivers/net/ethernet/freescale/ucc_geth.c
- drivers/net/ethernet/fujitsu/at1700.c
- drivers/net/ethernet/fujitsu/eth16i.c
- drivers/net/ethernet/fujitsu/fmvj18x_cs.c
- drivers/net/ethernet/hp/hp100.c
- drivers/net/ethernet/i825xx/3c505.c
- drivers/net/ethernet/i825xx/3c523.c
- drivers/net/ethernet/i825xx/3c527.c
- drivers/net/ethernet/i825xx/82596.c
- drivers/net/ethernet/i825xx/eepro.c
- drivers/net/ethernet/i825xx/eexpress.c
- drivers/net/ethernet/i825xx/ether1.c
- drivers/net/ethernet/i825xx/lib82596.c
- drivers/net/ethernet/i825xx/lp486e.c
- drivers/net/ethernet/i825xx/ni52.c
- drivers/net/ethernet/i825xx/sun3_82586.c
- drivers/net/ethernet/i825xx/znet.c
- drivers/net/ethernet/ibm/ehea/ehea_main.c
- drivers/net/ethernet/ibm/emac/core.c
- drivers/net/ethernet/ibm/ibmveth.c
- drivers/net/ethernet/ibm/iseries_veth.c
- drivers/net/ethernet/icplus/ipg.c
- drivers/net/ethernet/intel/e100.c
- drivers/net/ethernet/intel/e1000e/netdev.c
- drivers/net/ethernet/intel/igb/igb_main.c
- drivers/net/ethernet/intel/igbvf/netdev.c
- drivers/net/ethernet/intel/ixgb/ixgb_main.c
- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
- drivers/net/ethernet/jme.c
- drivers/net/ethernet/korina.c
- drivers/net/ethernet/lantiq_etop.c
- drivers/net/ethernet/marvell/skge.c
- drivers/net/ethernet/marvell/sky2.c
- drivers/net/ethernet/mellanox/mlx4/en_netdev.c
- drivers/net/ethernet/micrel/ks8695net.c
- drivers/net/ethernet/microchip/enc28j60.c
- drivers/net/ethernet/mipsnet.c
- drivers/net/ethernet/myricom/myri10ge/myri10ge.c
- drivers/net/ethernet/natsemi/ibmlana.c
- drivers/net/ethernet/natsemi/jazzsonic.c
- drivers/net/ethernet/natsemi/macsonic.c
- drivers/net/ethernet/natsemi/natsemi.c
- drivers/net/ethernet/natsemi/ns83820.c
- drivers/net/ethernet/natsemi/xtsonic.c
- drivers/net/ethernet/neterion/s2io.c
- drivers/net/ethernet/neterion/vxge/vxge-main.c
- drivers/net/ethernet/netx-eth.c
- drivers/net/ethernet/nuvoton/w90p910_ether.c
- drivers/net/ethernet/nvidia/forcedeth.c
- drivers/net/ethernet/octeon/octeon_mgmt.c
- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
- drivers/net/ethernet/packetengines/hamachi.c
- drivers/net/ethernet/packetengines/yellowfin.c
- drivers/net/ethernet/pasemi/pasemi_mac.c
- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
- drivers/net/ethernet/qlogic/qla3xxx.c
- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
- drivers/net/ethernet/qlogic/qlge/qlge_main.c
- drivers/net/ethernet/racal/ni5010.c
- drivers/net/ethernet/rdc/r6040.c
- drivers/net/ethernet/realtek/8139cp.c
- drivers/net/ethernet/realtek/8139too.c
- drivers/net/ethernet/realtek/atp.c
- drivers/net/ethernet/realtek/r8169.c
- drivers/net/ethernet/realtek/sc92031.c
- drivers/net/ethernet/seeq/ether3.c
- drivers/net/ethernet/seeq/seeq8005.c
- drivers/net/ethernet/seeq/sgiseeq.c
- drivers/net/ethernet/sfc/efx.c
- drivers/net/ethernet/sgi/ioc3-eth.c
- drivers/net/ethernet/sis/sis190.c
- drivers/net/ethernet/sis/sis900.c
- drivers/net/ethernet/smsc/epic100.c
- drivers/net/ethernet/smsc/smc911x.c
- drivers/net/ethernet/smsc/smc9194.c
- drivers/net/ethernet/smsc/smc91c92_cs.c
- drivers/net/ethernet/smsc/smc91x.c
- drivers/net/ethernet/smsc/smsc911x.c
- drivers/net/ethernet/smsc/smsc9420.c
- drivers/net/ethernet/sun/cassini.c
- drivers/net/ethernet/sun/sunbmac.c
- drivers/net/ethernet/sun/sungem.c
- drivers/net/ethernet/sun/sunhme.c
- drivers/net/ethernet/sun/sunqe.c
- drivers/net/ethernet/sun/sunvnet.c
- drivers/net/ethernet/tehuti/tehuti.c
- drivers/net/ethernet/ti/cpmac.c
- drivers/net/ethernet/ti/davinci_emac.c
- drivers/net/ethernet/ti/tlan.c
- drivers/net/ethernet/toshiba/ps3_gelic_net.c
- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
- drivers/net/ethernet/toshiba/spider_net.c
- drivers/net/ethernet/toshiba/tc35815.c
- drivers/net/ethernet/tundra/tsi108_eth.c
- drivers/net/ethernet/via/via-rhine.c
- drivers/net/ethernet/via/via-velocity.c
- drivers/net/ethernet/xilinx/ll_temac_main.c
- drivers/net/ethernet/xircom/xirc2ps_cs.c
- drivers/net/ethernet/xscale/ixp4xx_eth.c
- drivers/net/macvlan.c
- drivers/net/skfp/skfddi.c
- drivers/net/tokenring/3c359.c
- drivers/net/tokenring/ibmtr.c
- drivers/net/tokenring/lanstreamer.c
- drivers/net/tokenring/olympic.c
- drivers/net/tokenring/smctr.c
- drivers/net/tokenring/tms380tr.c
- drivers/net/tun.c
- drivers/net/usb/asix.c
- drivers/net/usb/catc.c
- drivers/net/usb/dm9601.c
- drivers/net/usb/int51x1.c
- drivers/net/usb/kaweth.c
- drivers/net/usb/mcs7830.c
- drivers/net/usb/pegasus.c
- drivers/net/usb/rtl8150.c
- drivers/net/usb/smsc75xx.c
- drivers/net/usb/smsc95xx.c
- drivers/net/vmxnet3/vmxnet3_drv.c
- drivers/net/wan/sbni.c
- drivers/net/wireless/airo.c
- drivers/net/wireless/hostap/hostap_main.c
- drivers/net/wireless/ipw2x00/ipw2200.c
- drivers/net/wireless/libertas/main.c
- drivers/net/wireless/libertas/mesh.c
- drivers/net/wireless/mwifiex/main.c
- drivers/net/wireless/orinoco/main.c
- drivers/net/wireless/orinoco/orinoco_usb.c
- drivers/net/wireless/ray_cs.c
- drivers/net/wireless/rndis_wlan.c
- drivers/net/wireless/zd1201.c
- drivers/s390/net/lcs.c
- drivers/s390/net/qeth_l2_main.c
- drivers/s390/net/qeth_l3_main.c
- drivers/staging/ath6kl/os/linux/ar6000_drv.c
- drivers/staging/brcm80211/brcmfmac/dhd_linux.c
- drivers/staging/et131x/et131x_netdev.c
- drivers/staging/hv/netvsc_drv.c
- drivers/staging/octeon/ethernet.c
- drivers/staging/rtl8187se/r8180_core.c
- drivers/staging/rtl8192e/r8192E_core.c
- drivers/staging/rtl8192u/r8192U_core.c
- drivers/staging/slicoss/slicoss.c
- drivers/staging/vt6655/device_main.c
- drivers/staging/vt6656/main_usb.c
- drivers/staging/wlags49_h2/wl_netdev.c
- drivers/staging/wlan-ng/p80211netdev.c
- net/8021q/vlan_dev.c
- net/atm/lec.c
- net/bluetooth/bnep/netdev.c
- net/bridge/br_device.c
- net/dsa/slave.c
- net/irda/irlan/irlan_eth.c
- net/mac80211/iface.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 190f619..bf2404a 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1759,7 +1759,7 @@ static const struct net_device_ops sh_eth_netdev_ops = {
- .ndo_start_xmit = sh_eth_start_xmit,
- .ndo_get_stats = sh_eth_get_stats,
- #if defined(SH_ETH_HAS_TSU)
-- .ndo_set_multicast_list = sh_eth_set_multicast_list,
-+ .ndo_set_rx_mode = sh_eth_set_multicast_list,
- #endif
- .ndo_tx_timeout = sh_eth_tx_timeout,
- .ndo_do_ioctl = sh_eth_do_ioctl,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0072-net-sh_eth-fix-the-compile-error.patch b/patches.armadillo800eva/0072-net-sh_eth-fix-the-compile-error.patch
deleted file mode 100644
index c591b17b57c343..00000000000000
--- a/patches.armadillo800eva/0072-net-sh_eth-fix-the-compile-error.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 28e67372504cee9f9ed9356081c9408df9492325 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 22 Aug 2011 23:26:33 +0000
-Subject: net: sh_eth: fix the compile error
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fix the following build error:
-
- CC drivers/net/sh_eth.o
-drivers/net/sh_eth.c:1115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sh_eth_interrupt’
-drivers/net/sh_eth.c: In function ‘sh_eth_open’:
-drivers/net/sh_eth.c:1387: error: implicit declaration of function ‘request_irq’
-drivers/net/sh_eth.c:1387: error: ‘sh_eth_interrupt’ undeclared (first use in this function)
-drivers/net/sh_eth.c:1387: error: (Each undeclared identifier is reported only once
-drivers/net/sh_eth.c:1387: error: for each function it appears in.)
-drivers/net/sh_eth.c:1391: error: ‘IRQF_SHARED’ undeclared (first use in this function)
-drivers/net/sh_eth.c:1424: error: implicit declaration of function ‘free_irq’
-make[2]: *** [drivers/net/sh_eth.o] Error 1
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 69558eeeaba7d79364bb9ac4743dc1ad209508b7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index bf2404a..4479a45 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -31,6 +31,7 @@
- #include <linux/phy.h>
- #include <linux/cache.h>
- #include <linux/io.h>
-+#include <linux/interrupt.h>
- #include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/ethtool.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0073-net-sh_eth-use-ioremap.patch b/patches.armadillo800eva/0073-net-sh_eth-use-ioremap.patch
deleted file mode 100644
index 8753f1d06d69e6..00000000000000
--- a/patches.armadillo800eva/0073-net-sh_eth-use-ioremap.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From 5fd3f7efdf369ae6e886de441d342c9dc8b7f7ef Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 27 Sep 2011 21:48:58 +0000
-Subject: net: sh_eth: use ioremap()
-
-This patch also changes writel/readl to iowrite32/ioread32.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit ae70644df780c0e87f1705fda932e7cb1bdb2074)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 38 +++++++++++++++++++++------------
- drivers/net/ethernet/renesas/sh_eth.h | 9 ++++----
- 2 files changed, 29 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 4479a45..38ccda5 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -155,18 +155,18 @@ static void sh_eth_chip_reset_giga(struct net_device *ndev)
-
- /* save MAHR and MALR */
- for (i = 0; i < 2; i++) {
-- malr[i] = readl(GIGA_MALR(i));
-- mahr[i] = readl(GIGA_MAHR(i));
-+ malr[i] = ioread32((void *)GIGA_MALR(i));
-+ mahr[i] = ioread32((void *)GIGA_MAHR(i));
- }
-
- /* reset device */
-- writel(ARSTR_ARSTR, SH_GIGA_ETH_BASE + 0x1800);
-+ iowrite32(ARSTR_ARSTR, (void *)(SH_GIGA_ETH_BASE + 0x1800));
- mdelay(1);
-
- /* restore MAHR and MALR */
- for (i = 0; i < 2; i++) {
-- writel(malr[i], GIGA_MALR(i));
-- writel(mahr[i], GIGA_MAHR(i));
-+ iowrite32(malr[i], (void *)GIGA_MALR(i));
-+ iowrite32(mahr[i], (void *)GIGA_MAHR(i));
- }
- }
-
-@@ -515,9 +515,9 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp)
- }
-
- struct bb_info {
-- void (*set_gate)(unsigned long addr);
-+ void (*set_gate)(void *addr);
- struct mdiobb_ctrl ctrl;
-- u32 addr;
-+ void *addr;
- u32 mmd_msk;/* MMD */
- u32 mdo_msk;
- u32 mdi_msk;
-@@ -525,21 +525,21 @@ struct bb_info {
- };
-
- /* PHY bit set */
--static void bb_set(u32 addr, u32 msk)
-+static void bb_set(void *addr, u32 msk)
- {
-- writel(readl(addr) | msk, addr);
-+ iowrite32(ioread32(addr) | msk, addr);
- }
-
- /* PHY bit clear */
--static void bb_clr(u32 addr, u32 msk)
-+static void bb_clr(void *addr, u32 msk)
- {
-- writel((readl(addr) & ~msk), addr);
-+ iowrite32((ioread32(addr) & ~msk), addr);
- }
-
- /* PHY bit read */
--static int bb_read(u32 addr, u32 msk)
-+static int bb_read(void *addr, u32 msk)
- {
-- return (readl(addr) & msk) != 0;
-+ return (ioread32(addr) & msk) != 0;
- }
-
- /* Data I/O pin control */
-@@ -1680,7 +1680,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
- }
-
- /* bitbang init */
-- bitbang->addr = ndev->base_addr + mdp->reg_offset[PIR];
-+ bitbang->addr = mdp->addr + mdp->reg_offset[PIR];
- bitbang->set_gate = pd->set_mdio_gate;
- bitbang->mdi_msk = 0x08;
- bitbang->mdo_msk = 0x04;
-@@ -1812,6 +1812,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- ether_setup(ndev);
-
- mdp = netdev_priv(ndev);
-+ mdp->addr = ioremap(res->start, resource_size(res));
-+ if (mdp->addr == NULL) {
-+ ret = -ENOMEM;
-+ dev_err(&pdev->dev, "ioremap failed.\n");
-+ goto out_release;
-+ }
-+
- spin_lock_init(&mdp->lock);
- mdp->pdev = pdev;
- pm_runtime_enable(&pdev->dev);
-@@ -1892,6 +1899,8 @@ out_unregister:
-
- out_release:
- /* net_dev free */
-+ if (mdp && mdp->addr)
-+ iounmap(mdp->addr);
- if (mdp && mdp->tsu_addr)
- iounmap(mdp->tsu_addr);
- if (ndev)
-@@ -1910,6 +1919,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
- sh_mdio_release(ndev);
- unregister_netdev(ndev);
- pm_runtime_disable(&pdev->dev);
-+ iounmap(mdp->addr);
- free_netdev(ndev);
- platform_set_drvdata(pdev, NULL);
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index c3048a6..78e586e 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -762,6 +762,7 @@ struct sh_eth_private {
- struct platform_device *pdev;
- struct sh_eth_cpu_data *cd;
- const u16 *reg_offset;
-+ void __iomem *addr;
- void __iomem *tsu_addr;
- dma_addr_t rx_desc_dma;
- dma_addr_t tx_desc_dma;
-@@ -811,7 +812,7 @@ static inline void sh_eth_write(struct net_device *ndev, unsigned long data,
- {
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
-- writel(data, ndev->base_addr + mdp->reg_offset[enum_index]);
-+ iowrite32(data, mdp->addr + mdp->reg_offset[enum_index]);
- }
-
- static inline unsigned long sh_eth_read(struct net_device *ndev,
-@@ -819,19 +820,19 @@ static inline unsigned long sh_eth_read(struct net_device *ndev,
- {
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
-- return readl(ndev->base_addr + mdp->reg_offset[enum_index]);
-+ return ioread32(mdp->addr + mdp->reg_offset[enum_index]);
- }
-
- static inline void sh_eth_tsu_write(struct sh_eth_private *mdp,
- unsigned long data, int enum_index)
- {
-- writel(data, mdp->tsu_addr + mdp->reg_offset[enum_index]);
-+ iowrite32(data, mdp->tsu_addr + mdp->reg_offset[enum_index]);
- }
-
- static inline unsigned long sh_eth_tsu_read(struct sh_eth_private *mdp,
- int enum_index)
- {
-- return readl(mdp->tsu_addr + mdp->reg_offset[enum_index]);
-+ return ioread32(mdp->tsu_addr + mdp->reg_offset[enum_index]);
- }
-
- #endif /* #ifndef __SH_ETH_H__ */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0074-sh-modify-prototype-in-sh_eth.h.patch b/patches.armadillo800eva/0074-sh-modify-prototype-in-sh_eth.h.patch
deleted file mode 100644
index 21052ddf30d44e..00000000000000
--- a/patches.armadillo800eva/0074-sh-modify-prototype-in-sh_eth.h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From e3801d21072f471de604508fb6a62ceec50152cf Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 27 Sep 2011 21:49:05 +0000
-Subject: sh: modify prototype in sh_eth.h
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 8eac3f60acad6e05a938a3d5feef01cb367bde4a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/include/asm/sh_eth.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h
-index 0f325da..2076acf 100644
---- a/arch/sh/include/asm/sh_eth.h
-+++ b/arch/sh/include/asm/sh_eth.h
-@@ -15,7 +15,7 @@ struct sh_eth_plat_data {
- int edmac_endian;
- int register_type;
- phy_interface_t phy_interface;
-- void (*set_mdio_gate)(unsigned long addr);
-+ void (*set_mdio_gate)(void *addr);
-
- unsigned char mac_addr[6];
- unsigned no_ether_link:1;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0075-net-sh_eth-move-the-asm-sh_eth.h-to-include-linux.patch b/patches.armadillo800eva/0075-net-sh_eth-move-the-asm-sh_eth.h-to-include-linux.patch
deleted file mode 100644
index bfa649b8669054..00000000000000
--- a/patches.armadillo800eva/0075-net-sh_eth-move-the-asm-sh_eth.h-to-include-linux.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From f4685e7e984fd49d5d4b5099aa0d02452f39cda3 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 27 Sep 2011 21:49:12 +0000
-Subject: net: sh_eth: move the asm/sh_eth.h to include/linux/
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 +
- drivers/net/ethernet/renesas/sh_eth.h | 8 --------
- {arch/sh/include/asm => include/linux}/sh_eth.h | 0
- 3 files changed, 1 insertion(+), 8 deletions(-)
- rename {arch/sh/include/asm => include/linux}/sh_eth.h (100%)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 38ccda5..6aa0704 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -35,6 +35,7 @@
- #include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/ethtool.h>
-+#include <linux/sh_eth.h>
-
- #include "sh_eth.h"
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index 78e586e..47877b1 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -23,14 +23,6 @@
- #ifndef __SH_ETH_H__
- #define __SH_ETH_H__
-
--#include <linux/module.h>
--#include <linux/kernel.h>
--#include <linux/spinlock.h>
--#include <linux/netdevice.h>
--#include <linux/phy.h>
--
--#include <asm/sh_eth.h>
--
- #define CARDNAME "sh-eth"
- #define TX_TIMEOUT (5*HZ)
- #define TX_RING_SIZE 64 /* Tx ring size */
-diff --git a/arch/sh/include/asm/sh_eth.h b/include/linux/sh_eth.h
-similarity index 100%
-rename from arch/sh/include/asm/sh_eth.h
-rename to include/linux/sh_eth.h
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0076-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-some.patch b/patches.armadillo800eva/0076-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-some.patch
deleted file mode 100644
index a59dd8265fa6ec..00000000000000
--- a/patches.armadillo800eva/0076-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-some.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 9503ab0bc933df9d4ca43f2f89c4a30735a5537b Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 28 Sep 2011 16:49:14 +0900
-Subject: sh: modify the asm/sh_eth.h to linux/sh_eth.h in some boards
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit cf8e56bf5b60dba5ba11db83ca7f1df884e568e5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/boards/board-espt.c | 2 +-
- arch/sh/boards/mach-ecovec24/setup.c | 2 +-
- arch/sh/boards/mach-se/7724/setup.c | 2 +-
- arch/sh/boards/mach-sh7763rdp/setup.c | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
-index 9da92ac..b3ae9d3 100644
---- a/arch/sh/boards/board-espt.c
-+++ b/arch/sh/boards/board-espt.c
-@@ -13,9 +13,9 @@
- #include <linux/interrupt.h>
- #include <linux/mtd/physmap.h>
- #include <linux/io.h>
-+#include <linux/sh_eth.h>
- #include <asm/machvec.h>
- #include <asm/sizes.h>
--#include <asm/sh_eth.h>
-
- /* NOR Flash */
- static struct mtd_partition espt_nor_flash_partitions[] = {
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 513cb1a..4fd83c4 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -28,13 +28,13 @@
- #include <linux/spi/mmc_spi.h>
- #include <linux/input.h>
- #include <linux/input/sh_keysc.h>
-+#include <linux/sh_eth.h>
- #include <video/sh_mobile_lcdc.h>
- #include <sound/sh_fsi.h>
- #include <media/sh_mobile_ceu.h>
- #include <media/tw9910.h>
- #include <media/mt9t112.h>
- #include <asm/heartbeat.h>
--#include <asm/sh_eth.h>
- #include <asm/clock.h>
- #include <asm/suspend.h>
- #include <cpu/sh7724.h>
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 1235767..631da7d 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -23,12 +23,12 @@
- #include <linux/input.h>
- #include <linux/input/sh_keysc.h>
- #include <linux/usb/r8a66597.h>
-+#include <linux/sh_eth.h>
- #include <video/sh_mobile_lcdc.h>
- #include <media/sh_mobile_ceu.h>
- #include <sound/sh_fsi.h>
- #include <asm/io.h>
- #include <asm/heartbeat.h>
--#include <asm/sh_eth.h>
- #include <asm/clock.h>
- #include <asm/suspend.h>
- #include <cpu/sh7724.h>
-diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
-index f3d828f..dd036f1 100644
---- a/arch/sh/boards/mach-sh7763rdp/setup.c
-+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
-@@ -17,8 +17,8 @@
- #include <linux/mtd/physmap.h>
- #include <linux/fb.h>
- #include <linux/io.h>
-+#include <linux/sh_eth.h>
- #include <mach/sh7763rdp.h>
--#include <asm/sh_eth.h>
- #include <asm/sh7760fb.h>
-
- /* NOR Flash */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0077-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh77.patch b/patches.armadillo800eva/0077-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh77.patch
deleted file mode 100644
index 79db017293b504..00000000000000
--- a/patches.armadillo800eva/0077-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh77.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 918b4fb00c28358daa5ff5263d552e591088cf0e Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Tue, 1 Nov 2011 14:54:38 +0900
-Subject: sh: modify the asm/sh_eth.h to linux/sh_eth.h in sh7757lcr
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 389cc10cbdde1a9225eac51318fb30e2039135ad)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/boards/board-sh7757lcr.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index fa2a208..ec8c84c 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -18,8 +18,8 @@
- #include <linux/mmc/host.h>
- #include <linux/mmc/sh_mmcif.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
-+#include <linux/sh_eth.h>
- #include <cpu/sh7757.h>
--#include <asm/sh_eth.h>
- #include <asm/heartbeat.h>
-
- static struct resource heartbeat_resource = {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0078-net-sh_eth-fix-build-failure.patch b/patches.armadillo800eva/0078-net-sh_eth-fix-build-failure.patch
deleted file mode 100644
index 09091d4940746a..00000000000000
--- a/patches.armadillo800eva/0078-net-sh_eth-fix-build-failure.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From cedc32557ee5304a1364df9e21e69848ac880861 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 29 Sep 2011 17:16:57 +0000
-Subject: net: sh_eth: fix build failure
-
-The following commit removed some including headers:
- "net: sh_eth: move the asm/sh_eth.h to include/linux/"
- (commit id: d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)
-
-Then, the build failure happened on the linux-next:
-
-drivers/net/ethernet/renesas/sh_eth.c:601: error: 'THIS_MODULE' undeclared here (not in a function)
-drivers/net/ethernet/renesas/sh_eth.c:1970: error: expected declaration specifiers or '...' before string constant
-drivers/net/ethernet/renesas/sh_eth.c:1970: warning: data definition has no type or storage class
-drivers/net/ethernet/renesas/sh_eth.c:1970: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
-drivers/net/ethernet/renesas/sh_eth.c:1970: warning: function declaration isn't a prototype
-drivers/net/ethernet/renesas/sh_eth.c:1971: error: expected declaration specifiers or '...' before string constant
-drivers/net/ethernet/renesas/sh_eth.c:1971: warning: data definition has no type or storage class
-drivers/net/ethernet/renesas/sh_eth.c:1971: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
-drivers/net/ethernet/renesas/sh_eth.c:1971: warning: function declaration isn't a prototype
-drivers/net/ethernet/renesas/sh_eth.c:1972: error: expected declaration specifiers or '...' before string constant
-drivers/net/ethernet/renesas/sh_eth.c:1972: warning: data definition has no type or storage class
-drivers/net/ethernet/renesas/sh_eth.c:1972: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
-drivers/net/ethernet/renesas/sh_eth.c:1972: warning: function declaration isn't a prototype
-
-This patch fixes the issue. This patch also get back include/kernel.h
-and linux/spinlock.h.
-
-Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 0654011d900670884197d9a06ad17b378dfde831)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 6aa0704..9b23074 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -21,6 +21,9 @@
- */
-
- #include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/spinlock.h>
- #include <linux/interrupt.h>
- #include <linux/dma-mapping.h>
- #include <linux/etherdevice.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0079-net-ethernet-convert-drivers-net-ethernet-to-use-mod.patch b/patches.armadillo800eva/0079-net-ethernet-convert-drivers-net-ethernet-to-use-mod.patch
deleted file mode 100644
index 435ad6f6d20bdf..00000000000000
--- a/patches.armadillo800eva/0079-net-ethernet-convert-drivers-net-ethernet-to-use-mod.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 1f6d3ca609bee2bd730ec3654e088d28f324af07 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Sun, 27 Nov 2011 16:44:17 +0000
-Subject: net/ethernet: convert drivers/net/ethernet/* to use
- module_platform_driver()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch converts the drivers in drivers/net/ethernet/* to use the
-module_platform_driver() macro which makes the code smaller and a bit
-simpler.
-
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
-Cc: Vitaly Bordug <vbordug@ru.mvista.com>
-Cc: Wan ZongShun <mcuos.com@gmail.com>
-Cc: Nicolas Pitre <nico@fluxnic.net>
-Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
-Cc: Marc Kleine-Budde <mkl@pengutronix.de>
-Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-Cc: Jiri Pirko <jpirko@redhat.com>
-Cc: Daniel Hellstrom <daniel@gaisler.com>
-Cc: Alexey Dobriyan <adobriyan@gmail.com>
-Cc: Tobias Klauser <tklauser@distanz.ch>
-Cc: Grant Likely <grant.likely@secretlab.ca>
-Cc: Jiri Kosina <jkosina@suse.cz>
-Cc: Richard Cochran <richard.cochran@omicron.at>
-Cc: Jonas Bonn <jonas@southpole.se>
-Cc: Sebastian Poehn <sebastian.poehn@belden.com>
-Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
-Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Acked-by: Wan ZongShun <mcuos.com@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit db62f684deeb291ab2533b99843d5df9a36b1f19)
-
- drivers/net/ethernet/8390/ax88796.c
- drivers/net/ethernet/aeroflex/greth.c
- drivers/net/ethernet/amd/au1000_eth.c
- drivers/net/ethernet/amd/sunlance.c
- drivers/net/ethernet/broadcom/sb1250-mac.c
- drivers/net/ethernet/dnet.c
- drivers/net/ethernet/ethoc.c
- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
- drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
- drivers/net/ethernet/freescale/fs_enet/mii-fec.c
- drivers/net/ethernet/freescale/fsl_pq_mdio.c
- drivers/net/ethernet/freescale/gianfar.c
- drivers/net/ethernet/freescale/gianfar_ptp.c
- drivers/net/ethernet/korina.c
- drivers/net/ethernet/marvell/pxa168_eth.c
- drivers/net/ethernet/micrel/ks8842.c
- drivers/net/ethernet/micrel/ks8851_mll.c
- drivers/net/ethernet/natsemi/jazzsonic.c
- drivers/net/ethernet/natsemi/macsonic.c
- drivers/net/ethernet/natsemi/xtsonic.c
- drivers/net/ethernet/nuvoton/w90p910_ether.c
- drivers/net/ethernet/seeq/sgiseeq.c
- drivers/net/ethernet/sgi/meth.c
- drivers/net/ethernet/smsc/smc911x.c
- drivers/net/ethernet/smsc/smc91x.c
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
- drivers/net/ethernet/sun/sunbmac.c
- drivers/net/ethernet/tundra/tsi108_eth.c
- drivers/net/ethernet/xilinx/ll_temac_main.c
- drivers/net/ethernet/xilinx/xilinx_emaclite.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 13 +------------
- 1 file changed, 1 insertion(+), 12 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 9b23074..ebfb682 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1957,18 +1957,7 @@ static struct platform_driver sh_eth_driver = {
- },
- };
-
--static int __init sh_eth_init(void)
--{
-- return platform_driver_register(&sh_eth_driver);
--}
--
--static void __exit sh_eth_cleanup(void)
--{
-- platform_driver_unregister(&sh_eth_driver);
--}
--
--module_init(sh_eth_init);
--module_exit(sh_eth_cleanup);
-+module_platform_driver(sh_eth_driver);
-
- MODULE_AUTHOR("Nobuhiro Iwamatsu, Yoshihiro Shimoda");
- MODULE_DESCRIPTION("Renesas SuperH Ethernet driver");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0080-net-make-ethtool_ops-const.patch b/patches.armadillo800eva/0080-net-make-ethtool_ops-const.patch
deleted file mode 100644
index 454117ad08f234..00000000000000
--- a/patches.armadillo800eva/0080-net-make-ethtool_ops-const.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 039e8360c642702e9e06b707d15dacc1027ce559 Mon Sep 17 00:00:00 2001
-From: stephen hemminger <shemminger@vyatta.com>
-Date: Wed, 4 Jan 2012 12:59:49 +0000
-Subject: net: make ethtool_ops const
-
-Auditing all usage of ethtool_ops found several drivers that
-are not declaring the struct const when it should be.
-
-Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 9b07be4b2a78166bc54c8eedf18da8a8aafacfab)
-
-Conflicts:
-
- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
- drivers/net/ethernet/freescale/fec.c
- drivers/net/ethernet/micrel/ksz884x.c
- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
-
-Signed-off-by: Simon Horman <horms@verge.ent.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index ebfb682..fc9bda9 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1369,13 +1369,13 @@ static void sh_eth_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
- }
- }
-
--static struct ethtool_ops sh_eth_ethtool_ops = {
-+static const struct ethtool_ops sh_eth_ethtool_ops = {
- .get_settings = sh_eth_get_settings,
- .set_settings = sh_eth_set_settings,
-- .nway_reset = sh_eth_nway_reset,
-+ .nway_reset = sh_eth_nway_reset,
- .get_msglevel = sh_eth_get_msglevel,
- .set_msglevel = sh_eth_set_msglevel,
-- .get_link = ethtool_op_get_link,
-+ .get_link = ethtool_op_get_link,
- .get_strings = sh_eth_get_strings,
- .get_ethtool_stats = sh_eth_get_ethtool_stats,
- .get_sset_count = sh_eth_get_sset_count,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0081-sh-eth-use-an-unique-MDIO-bus-name.patch b/patches.armadillo800eva/0081-sh-eth-use-an-unique-MDIO-bus-name.patch
deleted file mode 100644
index 7ac20cb3372012..00000000000000
--- a/patches.armadillo800eva/0081-sh-eth-use-an-unique-MDIO-bus-name.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 95b8b9d5077a0ce33b4a7c5be721f4513b2aa975 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 9 Jan 2012 23:59:17 +0000
-Subject: sh-eth: use an unique MDIO bus name.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 5278fb547076ad6768d16c8b4df45c086470c163)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index fc9bda9..6ece429 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1702,7 +1702,8 @@ static int sh_mdio_init(struct net_device *ndev, int id,
- /* Hook up MII support for ethtool */
- mdp->mii_bus->name = "sh_mii";
- mdp->mii_bus->parent = &ndev->dev;
-- snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id);
-+ snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
-+ mdp->pdev->name, pdid);
-
- /* PHY IRQ */
- mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0082-net-sh-eth-Fix-build-error-by-the-value-which-is-not.patch b/patches.armadillo800eva/0082-net-sh-eth-Fix-build-error-by-the-value-which-is-not.patch
deleted file mode 100644
index 795bcaee5bfa65..00000000000000
--- a/patches.armadillo800eva/0082-net-sh-eth-Fix-build-error-by-the-value-which-is-not.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0c859269808e5372a6ef7239f18912dac0cca6c3 Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Mon, 16 Jan 2012 16:50:16 +0000
-Subject: net: sh-eth: Fix build error by the value which is not defined
-
------
-drivers/net/ethernet/renesas/sh_eth.c:1706: error: 'pdid' undeclared (first use in this function)
-drivers/net/ethernet/renesas/sh_eth.c:1706: error: (Each undeclared identifier is reported only once
-drivers/net/ethernet/renesas/sh_eth.c:1706: error: for each function it appears in.)
-make[5]: *** [drivers/net/ethernet/renesas/sh_eth.o] Error 1
------
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-CC: Florian Fainelli <florian@openwrt.org>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 34aa6f1400810890636ba0b170effbfa71eacec7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 6ece429..813d41c 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1703,7 +1703,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
- mdp->mii_bus->name = "sh_mii";
- mdp->mii_bus->parent = &ndev->dev;
- snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
-- mdp->pdev->name, pdid);
-+ mdp->pdev->name, id);
-
- /* PHY IRQ */
- mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0083-drivers-net-Remove-alloc_etherdev-error-messages.patch b/patches.armadillo800eva/0083-drivers-net-Remove-alloc_etherdev-error-messages.patch
deleted file mode 100644
index e4565f5e6b36ca..00000000000000
--- a/patches.armadillo800eva/0083-drivers-net-Remove-alloc_etherdev-error-messages.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 42aebb28332e0bdae20b449c6de19d9e363c40a3 Mon Sep 17 00:00:00 2001
-From: Joe Perches <joe@perches.com>
-Date: Sun, 29 Jan 2012 13:47:52 +0000
-Subject: drivers/net: Remove alloc_etherdev error messages
-
-alloc_etherdev has a generic OOM/unable to alloc message.
-Remove the duplicative messages after alloc_etherdev calls.
-
-Signed-off-by: Joe Perches <joe@perches.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 41de8d4cff21a2e81e3d9ff66f5f7c903f9c3ab1)
-
-Conflicts:
-
- drivers/net/ethernet/3com/3c59x.c
- drivers/net/ethernet/adaptec/starfire.c
- drivers/net/ethernet/adi/bfin_mac.c
- drivers/net/ethernet/alteon/acenic.c
- drivers/net/ethernet/amd/amd8111e.c
- drivers/net/ethernet/amd/au1000_eth.c
- drivers/net/ethernet/amd/declance.c
- drivers/net/ethernet/amd/pcnet32.c
- drivers/net/ethernet/apple/bmac.c
- drivers/net/ethernet/apple/mace.c
- drivers/net/ethernet/atheros/atl1c/atl1c_main.c
- drivers/net/ethernet/atheros/atl1e/atl1e_main.c
- drivers/net/ethernet/broadcom/b44.c
- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
- drivers/net/ethernet/broadcom/sb1250-mac.c
- drivers/net/ethernet/broadcom/tg3.c
- drivers/net/ethernet/brocade/bna/bnad.c
- drivers/net/ethernet/cadence/macb.c
- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
- drivers/net/ethernet/cisco/enic/enic_main.c
- drivers/net/ethernet/davicom/dm9000.c
- drivers/net/ethernet/dec/tulip/tulip_core.c
- drivers/net/ethernet/dnet.c
- drivers/net/ethernet/ethoc.c
- drivers/net/ethernet/hp/hp100.c
- drivers/net/ethernet/ibm/ehea/ehea_main.c
- drivers/net/ethernet/ibm/emac/core.c
- drivers/net/ethernet/ibm/iseries_veth.c
- drivers/net/ethernet/icplus/ipg.c
- drivers/net/ethernet/intel/e100.c
- drivers/net/ethernet/jme.c
- drivers/net/ethernet/korina.c
- drivers/net/ethernet/lantiq_etop.c
- drivers/net/ethernet/marvell/skge.c
- drivers/net/ethernet/marvell/sky2.c
- drivers/net/ethernet/mellanox/mlx4/en_netdev.c
- drivers/net/ethernet/micrel/ks8695net.c
- drivers/net/ethernet/micrel/ks8851.c
- drivers/net/ethernet/microchip/enc28j60.c
- drivers/net/ethernet/myricom/myri10ge/myri10ge.c
- drivers/net/ethernet/neterion/s2io.c
- drivers/net/ethernet/netx-eth.c
- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
- drivers/net/ethernet/packetengines/yellowfin.c
- drivers/net/ethernet/pasemi/pasemi_mac.c
- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
- drivers/net/ethernet/qlogic/qla3xxx.c
- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
- drivers/net/ethernet/rdc/r6040.c
- drivers/net/ethernet/realtek/8139too.c
- drivers/net/ethernet/realtek/r8169.c
- drivers/net/ethernet/s6gmac.c
- drivers/net/ethernet/seeq/sgiseeq.c
- drivers/net/ethernet/sis/sis190.c
- drivers/net/ethernet/smsc/epic100.c
- drivers/net/ethernet/smsc/smc911x.c
- drivers/net/ethernet/smsc/smc91x.c
- drivers/net/ethernet/smsc/smsc911x.c
- drivers/net/ethernet/smsc/smsc9420.c
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
- drivers/net/ethernet/sun/cassini.c
- drivers/net/ethernet/sun/niu.c
- drivers/net/ethernet/sun/sungem.c
- drivers/net/ethernet/sun/sunvnet.c
- drivers/net/ethernet/tehuti/tehuti.c
- drivers/net/ethernet/ti/cpmac.c
- drivers/net/ethernet/ti/davinci_emac.c
- drivers/net/ethernet/ti/tlan.c
- drivers/net/ethernet/toshiba/tc35815.c
- drivers/net/ethernet/tundra/tsi108_eth.c
- drivers/net/ethernet/via/via-rhine.c
- drivers/net/ethernet/via/via-velocity.c
- drivers/net/ethernet/xilinx/ll_temac_main.c
- drivers/net/ethernet/xilinx/xilinx_axienet_main.c
- drivers/net/ethernet/xilinx/xilinx_emaclite.c
- drivers/net/plip/plip.c
- drivers/net/rionet.c
- drivers/net/tulip/xircom_cb.c
- drivers/net/usb/pegasus.c
- drivers/net/usb/rtl8150.c
- drivers/net/usb/usbnet.c
- drivers/net/vmxnet3/vmxnet3_drv.c
- drivers/net/wireless/atmel.c
- drivers/net/wireless/ipw2x00/libipw_module.c
- drivers/net/xen-netfront.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 813d41c..1cb5a34 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1792,7 +1792,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
-
- ndev = alloc_etherdev(sizeof(struct sh_eth_private));
- if (!ndev) {
-- dev_err(&pdev->dev, "Could not allocate device.\n");
- ret = -ENOMEM;
- goto out;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0084-net-sh_eth-fix-skb_over_panic-happen.patch b/patches.armadillo800eva/0084-net-sh_eth-fix-skb_over_panic-happen.patch
deleted file mode 100644
index 57140494326227..00000000000000
--- a/patches.armadillo800eva/0084-net-sh_eth-fix-skb_over_panic-happen.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From e65e32c14f4b953af76267facf47249d1648338a Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 6 Feb 2012 23:55:15 +0000
-Subject: net: sh_eth: fix skb_over_panic happen
-
-When this GETHER controller received a large frame (about 1800 bytes
-or more), skb_over_panic() happened. This is because the previous
-driver set the RFLR to 0x1000 (4096 bytes) and the skb allocate size
-is smaller than 4096 bytes. So, the controller accepted such a frame.
-
-The controller can discard a large frame by the RFLR setting.
-So, the patch modifies the value of RFLR to mtu + ETH_HLEN +
-VLAN_HLEN + ETH_FCS_LEN.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Cc: Eric Dumazet <eric.dumazet@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit fdb37a7f84a58ccad24abffd54ad46d23b763e13)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 4 +++-
- drivers/net/ethernet/renesas/sh_eth.h | 3 ---
- 2 files changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 1cb5a34..557736d 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -38,6 +38,7 @@
- #include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/ethtool.h>
-+#include <linux/if_vlan.h>
- #include <linux/sh_eth.h>
-
- #include "sh_eth.h"
-@@ -817,7 +818,8 @@ static int sh_eth_dev_init(struct net_device *ndev)
- sh_eth_write(ndev, 0, TRIMD);
-
- /* Recv frame limit set register */
-- sh_eth_write(ndev, RFLR_VALUE, RFLR);
-+ sh_eth_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN,
-+ RFLR);
-
- sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR);
- sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index 47877b1..cdbd844 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -575,9 +575,6 @@ enum RPADIR_BIT {
- RPADIR_PADR = 0x0003f,
- };
-
--/* RFLR */
--#define RFLR_VALUE 0x1000
--
- /* FDR */
- #define DEFAULT_FDR_INIT 0x00000707
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0085-sh-eth-use-netdev-stats-structure-and-fix-dma_map_si.patch b/patches.armadillo800eva/0085-sh-eth-use-netdev-stats-structure-and-fix-dma_map_si.patch
deleted file mode 100644
index 2c25f8cfb8b96d..00000000000000
--- a/patches.armadillo800eva/0085-sh-eth-use-netdev-stats-structure-and-fix-dma_map_si.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-From 259213094bcbc4680f972fc8ec8030306327f25d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <eric.dumazet@gmail.com>
-Date: Mon, 6 Feb 2012 22:17:21 +0000
-Subject: sh-eth: use netdev stats structure and fix dma_map_single
-
-No need to maintain a parallel net_device_stats structure in
-sh_eth_private, since we have a generic one in netdev
-
-Fix two dma_map_single() incorrect parameters, passing skb->tail instead
-of skb->data. Seems that there is no corresponding dmap_unmap_single()
-calls for the moment in this driver.
-
-Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
-Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit bb7d92e3e3049e22b5807ac559a72b38fad5f499)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 62 ++++++++++++++++-----------------
- drivers/net/ethernet/renesas/sh_eth.h | 1 -
- 2 files changed, 31 insertions(+), 32 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 557736d..1fe9541 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -658,7 +658,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
- mdp->rx_skbuff[i] = skb;
- if (skb == NULL)
- break;
-- dma_map_single(&ndev->dev, skb->tail, mdp->rx_buf_sz,
-+ dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
- DMA_FROM_DEVICE);
- skb->dev = ndev; /* Mark as being used by this device. */
- sh_eth_set_receive_align(skb);
-@@ -883,8 +883,8 @@ static int sh_eth_txfree(struct net_device *ndev)
- if (entry >= TX_RING_SIZE - 1)
- txdesc->status |= cpu_to_edmac(mdp, TD_TDLE);
-
-- mdp->stats.tx_packets++;
-- mdp->stats.tx_bytes += txdesc->buffer_length;
-+ ndev->stats.tx_packets++;
-+ ndev->stats.tx_bytes += txdesc->buffer_length;
- }
- return freeNum;
- }
-@@ -910,23 +910,23 @@ static int sh_eth_rx(struct net_device *ndev)
- break;
-
- if (!(desc_status & RDFEND))
-- mdp->stats.rx_length_errors++;
-+ ndev->stats.rx_length_errors++;
-
- if (desc_status & (RD_RFS1 | RD_RFS2 | RD_RFS3 | RD_RFS4 |
- RD_RFS5 | RD_RFS6 | RD_RFS10)) {
-- mdp->stats.rx_errors++;
-+ ndev->stats.rx_errors++;
- if (desc_status & RD_RFS1)
-- mdp->stats.rx_crc_errors++;
-+ ndev->stats.rx_crc_errors++;
- if (desc_status & RD_RFS2)
-- mdp->stats.rx_frame_errors++;
-+ ndev->stats.rx_frame_errors++;
- if (desc_status & RD_RFS3)
-- mdp->stats.rx_length_errors++;
-+ ndev->stats.rx_length_errors++;
- if (desc_status & RD_RFS4)
-- mdp->stats.rx_length_errors++;
-+ ndev->stats.rx_length_errors++;
- if (desc_status & RD_RFS6)
-- mdp->stats.rx_missed_errors++;
-+ ndev->stats.rx_missed_errors++;
- if (desc_status & RD_RFS10)
-- mdp->stats.rx_over_errors++;
-+ ndev->stats.rx_over_errors++;
- } else {
- if (!mdp->cd->hw_swap)
- sh_eth_soft_swap(
-@@ -939,8 +939,8 @@ static int sh_eth_rx(struct net_device *ndev)
- skb_put(skb, pkt_len);
- skb->protocol = eth_type_trans(skb, ndev);
- netif_rx(skb);
-- mdp->stats.rx_packets++;
-- mdp->stats.rx_bytes += pkt_len;
-+ ndev->stats.rx_packets++;
-+ ndev->stats.rx_bytes += pkt_len;
- }
- rxdesc->status |= cpu_to_edmac(mdp, RD_RACT);
- entry = (++mdp->cur_rx) % RX_RING_SIZE;
-@@ -959,7 +959,7 @@ static int sh_eth_rx(struct net_device *ndev)
- mdp->rx_skbuff[entry] = skb;
- if (skb == NULL)
- break; /* Better luck next round. */
-- dma_map_single(&ndev->dev, skb->tail, mdp->rx_buf_sz,
-+ dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
- DMA_FROM_DEVICE);
- skb->dev = ndev;
- sh_eth_set_receive_align(skb);
-@@ -1009,7 +1009,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
- felic_stat = sh_eth_read(ndev, ECSR);
- sh_eth_write(ndev, felic_stat, ECSR); /* clear int */
- if (felic_stat & ECSR_ICD)
-- mdp->stats.tx_carrier_errors++;
-+ ndev->stats.tx_carrier_errors++;
- if (felic_stat & ECSR_LCHNG) {
- /* Link Changed */
- if (mdp->cd->no_psr || mdp->no_ether_link) {
-@@ -1042,7 +1042,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
- if (intr_status & EESR_TWB) {
- /* Write buck end. unused write back interrupt */
- if (intr_status & EESR_TABT) /* Transmit Abort int */
-- mdp->stats.tx_aborted_errors++;
-+ ndev->stats.tx_aborted_errors++;
- if (netif_msg_tx_err(mdp))
- dev_err(&ndev->dev, "Transmit Abort\n");
- }
-@@ -1051,7 +1051,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
- /* Receive Abort int */
- if (intr_status & EESR_RFRMER) {
- /* Receive Frame Overflow int */
-- mdp->stats.rx_frame_errors++;
-+ ndev->stats.rx_frame_errors++;
- if (netif_msg_rx_err(mdp))
- dev_err(&ndev->dev, "Receive Abort\n");
- }
-@@ -1059,21 +1059,21 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
-
- if (intr_status & EESR_TDE) {
- /* Transmit Descriptor Empty int */
-- mdp->stats.tx_fifo_errors++;
-+ ndev->stats.tx_fifo_errors++;
- if (netif_msg_tx_err(mdp))
- dev_err(&ndev->dev, "Transmit Descriptor Empty\n");
- }
-
- if (intr_status & EESR_TFE) {
- /* FIFO under flow */
-- mdp->stats.tx_fifo_errors++;
-+ ndev->stats.tx_fifo_errors++;
- if (netif_msg_tx_err(mdp))
- dev_err(&ndev->dev, "Transmit FIFO Under flow\n");
- }
-
- if (intr_status & EESR_RDE) {
- /* Receive Descriptor Empty int */
-- mdp->stats.rx_over_errors++;
-+ ndev->stats.rx_over_errors++;
-
- if (sh_eth_read(ndev, EDRRR) ^ EDRRR_R)
- sh_eth_write(ndev, EDRRR_R, EDRRR);
-@@ -1083,14 +1083,14 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
-
- if (intr_status & EESR_RFE) {
- /* Receive FIFO Overflow int */
-- mdp->stats.rx_fifo_errors++;
-+ ndev->stats.rx_fifo_errors++;
- if (netif_msg_rx_err(mdp))
- dev_err(&ndev->dev, "Receive FIFO Overflow\n");
- }
-
- if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) {
- /* Address Error */
-- mdp->stats.tx_fifo_errors++;
-+ ndev->stats.tx_fifo_errors++;
- if (netif_msg_tx_err(mdp))
- dev_err(&ndev->dev, "Address Error\n");
- }
-@@ -1447,7 +1447,7 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
- " resetting...\n", ndev->name, (int)sh_eth_read(ndev, EESR));
-
- /* tx_errors count up */
-- mdp->stats.tx_errors++;
-+ ndev->stats.tx_errors++;
-
- /* timer off */
- del_timer_sync(&mdp->timer);
-@@ -1569,27 +1569,27 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
-
- pm_runtime_get_sync(&mdp->pdev->dev);
-
-- mdp->stats.tx_dropped += sh_eth_read(ndev, TROCR);
-+ ndev->stats.tx_dropped += sh_eth_read(ndev, TROCR);
- sh_eth_write(ndev, 0, TROCR); /* (write clear) */
-- mdp->stats.collisions += sh_eth_read(ndev, CDCR);
-+ ndev->stats.collisions += sh_eth_read(ndev, CDCR);
- sh_eth_write(ndev, 0, CDCR); /* (write clear) */
-- mdp->stats.tx_carrier_errors += sh_eth_read(ndev, LCCR);
-+ ndev->stats.tx_carrier_errors += sh_eth_read(ndev, LCCR);
- sh_eth_write(ndev, 0, LCCR); /* (write clear) */
- if (sh_eth_is_gether(mdp)) {
-- mdp->stats.tx_carrier_errors += sh_eth_read(ndev, CERCR);
-+ ndev->stats.tx_carrier_errors += sh_eth_read(ndev, CERCR);
- sh_eth_write(ndev, 0, CERCR); /* (write clear) */
-- mdp->stats.tx_carrier_errors += sh_eth_read(ndev, CEECR);
-+ ndev->stats.tx_carrier_errors += sh_eth_read(ndev, CEECR);
- sh_eth_write(ndev, 0, CEECR); /* (write clear) */
- } else {
-- mdp->stats.tx_carrier_errors += sh_eth_read(ndev, CNDCR);
-+ ndev->stats.tx_carrier_errors += sh_eth_read(ndev, CNDCR);
- sh_eth_write(ndev, 0, CNDCR); /* (write clear) */
- }
- pm_runtime_put_sync(&mdp->pdev->dev);
-
-- return &mdp->stats;
-+ return &ndev->stats;
- }
-
--/* ioctl to device funciotn*/
-+/* ioctl to device function */
- static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq,
- int cmd)
- {
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index cdbd844..cb07add 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -759,7 +759,6 @@ struct sh_eth_private {
- struct sh_eth_txdesc *tx_ring;
- struct sk_buff **rx_skbuff;
- struct sk_buff **tx_skbuff;
-- struct net_device_stats stats;
- struct timer_list timer;
- spinlock_t lock;
- u32 cur_rx, dirty_rx; /* Producer/consumer ring indices */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0086-netdev-ethernet-dev_alloc_skb-to-netdev_alloc_skb.patch b/patches.armadillo800eva/0086-netdev-ethernet-dev_alloc_skb-to-netdev_alloc_skb.patch
deleted file mode 100644
index 4f270468e8c6b1..00000000000000
--- a/patches.armadillo800eva/0086-netdev-ethernet-dev_alloc_skb-to-netdev_alloc_skb.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From c45262499db9ff6ad6f32765b6fe0c9433443f91 Mon Sep 17 00:00:00 2001
-From: "Pradeep A. Dalvi" <netdev@pradeepdalvi.com>
-Date: Mon, 6 Feb 2012 11:16:13 +0000
-Subject: netdev: ethernet dev_alloc_skb to netdev_alloc_skb
-
-Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
- - Removed extra skb->dev = dev after netdev_alloc_skb
-
-Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit dae2e9f430c46c29e3f771110094bd3da3625aa4)
-
-Conflicts:
-
- drivers/net/ethernet/netx-eth.c
- drivers/net/ethernet/nuvoton/w90p910_ether.c
- drivers/net/ethernet/nvidia/forcedeth.c
- drivers/net/ethernet/packetengines/hamachi.c
- drivers/net/ethernet/packetengines/yellowfin.c
- drivers/net/ethernet/pasemi/pasemi_mac.c
- drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
- drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
- drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
- drivers/net/ethernet/racal/ni5010.c
- drivers/net/ethernet/realtek/atp.c
- drivers/net/ethernet/seeq/ether3.c
- drivers/net/ethernet/seeq/seeq8005.c
- drivers/net/ethernet/sis/sis900.c
- drivers/net/ethernet/smsc/epic100.c
- drivers/net/ethernet/smsc/smc911x.c
- drivers/net/ethernet/smsc/smc9194.c
- drivers/net/ethernet/smsc/smc91c92_cs.c
- drivers/net/ethernet/smsc/smc91x.c
- drivers/net/ethernet/smsc/smsc9420.c
- drivers/net/ethernet/sun/cassini.c
- drivers/net/ethernet/sun/sunbmac.c
- drivers/net/ethernet/sun/sunhme.c
- drivers/net/ethernet/sun/sunqe.c
- drivers/net/ethernet/tehuti/tehuti.c
- drivers/net/ethernet/ti/davinci_emac.c
- drivers/net/ethernet/tile/tilepro.c
- drivers/net/ethernet/toshiba/tc35815.c
- drivers/net/ethernet/via/via-rhine.c
- drivers/net/ethernet/via/via-velocity.c
- drivers/net/ethernet/xilinx/xilinx_emaclite.c
- drivers/net/ethernet/xircom/xirc2ps_cs.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 1fe9541..cfad091 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -654,13 +654,12 @@ static void sh_eth_ring_format(struct net_device *ndev)
- for (i = 0; i < RX_RING_SIZE; i++) {
- /* skb */
- mdp->rx_skbuff[i] = NULL;
-- skb = dev_alloc_skb(mdp->rx_buf_sz);
-+ skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz);
- mdp->rx_skbuff[i] = skb;
- if (skb == NULL)
- break;
- dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
- DMA_FROM_DEVICE);
-- skb->dev = ndev; /* Mark as being used by this device. */
- sh_eth_set_receive_align(skb);
-
- /* RX descriptor */
-@@ -955,13 +954,12 @@ static int sh_eth_rx(struct net_device *ndev)
- rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16);
-
- if (mdp->rx_skbuff[entry] == NULL) {
-- skb = dev_alloc_skb(mdp->rx_buf_sz);
-+ skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz);
- mdp->rx_skbuff[entry] = skb;
- if (skb == NULL)
- break; /* Better luck next round. */
- dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
- DMA_FROM_DEVICE);
-- skb->dev = ndev;
- sh_eth_set_receive_align(skb);
-
- skb_checksum_none_assert(skb);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0087-renesas-sh_eth.c-fix-linux-interrupt.h-included-twic.patch b/patches.armadillo800eva/0087-renesas-sh_eth.c-fix-linux-interrupt.h-included-twic.patch
deleted file mode 100644
index de17d264bbf7cc..00000000000000
--- a/patches.armadillo800eva/0087-renesas-sh_eth.c-fix-linux-interrupt.h-included-twic.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 82b348082b3bca174a3e7c53a64214f06cb36f2e Mon Sep 17 00:00:00 2001
-From: Danny Kukawka <danny.kukawka@bisect.de>
-Date: Wed, 15 Feb 2012 07:54:43 +0000
-Subject: renesas/sh_eth.c: fix linux/interrupt.h included twice
-
-Remove double include of linux/interrupt.h.
-
-Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 16387605a503a5462c79b740f9696ad4f5a960e5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index cfad091..98062bf 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -34,7 +34,6 @@
- #include <linux/phy.h>
- #include <linux/cache.h>
- #include <linux/io.h>
--#include <linux/interrupt.h>
- #include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/ethtool.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0088-net-sh_eth-add-the-value-of-tsu-to-the-SH7757-s-GETH.patch b/patches.armadillo800eva/0088-net-sh_eth-add-the-value-of-tsu-to-the-SH7757-s-GETH.patch
deleted file mode 100644
index 72fbf7974c1cdf..00000000000000
--- a/patches.armadillo800eva/0088-net-sh_eth-add-the-value-of-tsu-to-the-SH7757-s-GETH.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 44eccf7d2cf65f09b4412927d0105cb6777eba4a Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 15 Feb 2012 17:54:51 +0000
-Subject: net: sh_eth: add the value of tsu to the SH7757's GETHER
-
-The SH7757's GETHER has TSU registers. So, this patch adds the value
-of ".tsu = 1" in the sh_eth_cpu_data.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 3acbc9715a5ac8a2534a69eb3488b63b7c9fb1e2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 98062bf..8f53b5a 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -268,6 +268,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
- .rpadir_value = 2 << 16,
- .no_trimd = 1,
- .no_ade = 1,
-+ .tsu = 1,
- };
-
- static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0089-net-sh_eth-change-the-condition-of-initialization.patch b/patches.armadillo800eva/0089-net-sh_eth-change-the-condition-of-initialization.patch
deleted file mode 100644
index a2e45364a9444d..00000000000000
--- a/patches.armadillo800eva/0089-net-sh_eth-change-the-condition-of-initialization.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 6d4f5594a3cd8dd552204374f76b42b6eafc3931 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 15 Feb 2012 17:54:56 +0000
-Subject: net: sh_eth: change the condition of initialization
-
-The SH7757 has 2 Fast Ethernet and 2 Gigabit Ethernet, and the first
-Gigabit channel needs the initialization. So, this patch adds the
-parameter of "needs_init", and if the sh_eth_plat_data is set it
-to 1, the driver will initialize the channel.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 150647fb2c313d7c5184fca3fa0829a4a7d6f7bc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
- include/linux/sh_eth.h | 1 +
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 8f53b5a..5a5afbc 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1859,8 +1859,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- /* read and set MAC address */
- read_mac_address(ndev, pd->mac_addr);
-
-- /* First device only init */
-- if (!devno) {
-+ /* initialize first or needed device */
-+ if (!devno || pd->needs_init) {
- if (mdp->cd->tsu) {
- struct resource *rtsu;
- rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
-index 2076acf..b17d765d 100644
---- a/include/linux/sh_eth.h
-+++ b/include/linux/sh_eth.h
-@@ -20,6 +20,7 @@ struct sh_eth_plat_data {
- unsigned char mac_addr[6];
- unsigned no_ether_link:1;
- unsigned ether_link_active_low:1;
-+ unsigned needs_init:1;
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0090-net-sh_eth-modify-a-condition-of-ioremap-for-TSU.patch b/patches.armadillo800eva/0090-net-sh_eth-modify-a-condition-of-ioremap-for-TSU.patch
deleted file mode 100644
index a16070a74e595c..00000000000000
--- a/patches.armadillo800eva/0090-net-sh_eth-modify-a-condition-of-ioremap-for-TSU.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From d0ff01f0ef5c7a64604619a50a2ec3cd1160e43b Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 15 Feb 2012 17:55:01 +0000
-Subject: net: sh_eth: modify a condition of ioremap for TSU
-
-If the controller has TSU, the each channel needs TSU registers.
-This patch also fixes the iounmap condition in the sh_eth_drv_remove().
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 6ba88021c36516c26c11eff8c6d7d9a045faecd3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 25 ++++++++++++++-----------
- 1 file changed, 14 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 5a5afbc..8bd0e58 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1859,18 +1859,20 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- /* read and set MAC address */
- read_mac_address(ndev, pd->mac_addr);
-
-+ /* ioremap the TSU registers */
-+ if (mdp->cd->tsu) {
-+ struct resource *rtsu;
-+ rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+ if (!rtsu) {
-+ dev_err(&pdev->dev, "Not found TSU resource\n");
-+ goto out_release;
-+ }
-+ mdp->tsu_addr = ioremap(rtsu->start,
-+ resource_size(rtsu));
-+ }
-+
- /* initialize first or needed device */
- if (!devno || pd->needs_init) {
-- if (mdp->cd->tsu) {
-- struct resource *rtsu;
-- rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-- if (!rtsu) {
-- dev_err(&pdev->dev, "Not found TSU resource\n");
-- goto out_release;
-- }
-- mdp->tsu_addr = ioremap(rtsu->start,
-- resource_size(rtsu));
-- }
- if (mdp->cd->chip_reset)
- mdp->cd->chip_reset(ndev);
-
-@@ -1919,7 +1921,8 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
- struct net_device *ndev = platform_get_drvdata(pdev);
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
-- iounmap(mdp->tsu_addr);
-+ if (mdp->cd->tsu)
-+ iounmap(mdp->tsu_addr);
- sh_mdio_release(ndev);
- unregister_netdev(ndev);
- pm_runtime_disable(&pdev->dev);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0091-net-sh_eth-add-support-for-multicast-filtering.patch b/patches.armadillo800eva/0091-net-sh_eth-add-support-for-multicast-filtering.patch
deleted file mode 100644
index 17682df7ec6ad0..00000000000000
--- a/patches.armadillo800eva/0091-net-sh_eth-add-support-for-multicast-filtering.patch
+++ /dev/null
@@ -1,362 +0,0 @@
-From e0ebdb700d3dcdf618b281aa0b2355399048cd71 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 15 Feb 2012 17:55:03 +0000
-Subject: net: sh_eth: add support for multicast filtering
-
-Some controllers have TSU. It can filter multicast by hardware.
-This patch supports it.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 6743fe6df43b4dc5950f605edfeee086d0a80f06)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 282 ++++++++++++++++++++++++++++++++-
- drivers/net/ethernet/renesas/sh_eth.h | 9 ++
- 2 files changed, 286 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 8bd0e58..99d8ce8 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1604,18 +1604,289 @@ static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq,
- }
-
- #if defined(SH_ETH_HAS_TSU)
-+/* For TSU_POSTn. Please refer to the manual about this (strange) bitfields */
-+static void *sh_eth_tsu_get_post_reg_offset(struct sh_eth_private *mdp,
-+ int entry)
-+{
-+ return sh_eth_tsu_get_offset(mdp, TSU_POST1) + (entry / 8 * 4);
-+}
-+
-+static u32 sh_eth_tsu_get_post_mask(int entry)
-+{
-+ return 0x0f << (28 - ((entry % 8) * 4));
-+}
-+
-+static u32 sh_eth_tsu_get_post_bit(struct sh_eth_private *mdp, int entry)
-+{
-+ return (0x08 >> (mdp->port << 1)) << (28 - ((entry % 8) * 4));
-+}
-+
-+static void sh_eth_tsu_enable_cam_entry_post(struct net_device *ndev,
-+ int entry)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ u32 tmp;
-+ void *reg_offset;
-+
-+ reg_offset = sh_eth_tsu_get_post_reg_offset(mdp, entry);
-+ tmp = ioread32(reg_offset);
-+ iowrite32(tmp | sh_eth_tsu_get_post_bit(mdp, entry), reg_offset);
-+}
-+
-+static bool sh_eth_tsu_disable_cam_entry_post(struct net_device *ndev,
-+ int entry)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ u32 post_mask, ref_mask, tmp;
-+ void *reg_offset;
-+
-+ reg_offset = sh_eth_tsu_get_post_reg_offset(mdp, entry);
-+ post_mask = sh_eth_tsu_get_post_mask(entry);
-+ ref_mask = sh_eth_tsu_get_post_bit(mdp, entry) & ~post_mask;
-+
-+ tmp = ioread32(reg_offset);
-+ iowrite32(tmp & ~post_mask, reg_offset);
-+
-+ /* If other port enables, the function returns "true" */
-+ return tmp & ref_mask;
-+}
-+
-+static int sh_eth_tsu_busy(struct net_device *ndev)
-+{
-+ int timeout = SH_ETH_TSU_TIMEOUT_MS * 100;
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+
-+ while ((sh_eth_tsu_read(mdp, TSU_ADSBSY) & TSU_ADSBSY_0)) {
-+ udelay(10);
-+ timeout--;
-+ if (timeout <= 0) {
-+ dev_err(&ndev->dev, "%s: timeout\n", __func__);
-+ return -ETIMEDOUT;
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+static int sh_eth_tsu_write_entry(struct net_device *ndev, void *reg,
-+ const u8 *addr)
-+{
-+ u32 val;
-+
-+ val = addr[0] << 24 | addr[1] << 16 | addr[2] << 8 | addr[3];
-+ iowrite32(val, reg);
-+ if (sh_eth_tsu_busy(ndev) < 0)
-+ return -EBUSY;
-+
-+ val = addr[4] << 8 | addr[5];
-+ iowrite32(val, reg + 4);
-+ if (sh_eth_tsu_busy(ndev) < 0)
-+ return -EBUSY;
-+
-+ return 0;
-+}
-+
-+static void sh_eth_tsu_read_entry(void *reg, u8 *addr)
-+{
-+ u32 val;
-+
-+ val = ioread32(reg);
-+ addr[0] = (val >> 24) & 0xff;
-+ addr[1] = (val >> 16) & 0xff;
-+ addr[2] = (val >> 8) & 0xff;
-+ addr[3] = val & 0xff;
-+ val = ioread32(reg + 4);
-+ addr[4] = (val >> 8) & 0xff;
-+ addr[5] = val & 0xff;
-+}
-+
-+
-+static int sh_eth_tsu_find_entry(struct net_device *ndev, const u8 *addr)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0);
-+ int i;
-+ u8 c_addr[ETH_ALEN];
-+
-+ for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
-+ sh_eth_tsu_read_entry(reg_offset, c_addr);
-+ if (memcmp(addr, c_addr, ETH_ALEN) == 0)
-+ return i;
-+ }
-+
-+ return -ENOENT;
-+}
-+
-+static int sh_eth_tsu_find_empty(struct net_device *ndev)
-+{
-+ u8 blank[ETH_ALEN];
-+ int entry;
-+
-+ memset(blank, 0, sizeof(blank));
-+ entry = sh_eth_tsu_find_entry(ndev, blank);
-+ return (entry < 0) ? -ENOMEM : entry;
-+}
-+
-+static int sh_eth_tsu_disable_cam_entry_table(struct net_device *ndev,
-+ int entry)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0);
-+ int ret;
-+ u8 blank[ETH_ALEN];
-+
-+ sh_eth_tsu_write(mdp, sh_eth_tsu_read(mdp, TSU_TEN) &
-+ ~(1 << (31 - entry)), TSU_TEN);
-+
-+ memset(blank, 0, sizeof(blank));
-+ ret = sh_eth_tsu_write_entry(ndev, reg_offset + entry * 8, blank);
-+ if (ret < 0)
-+ return ret;
-+ return 0;
-+}
-+
-+static int sh_eth_tsu_add_entry(struct net_device *ndev, const u8 *addr)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0);
-+ int i, ret;
-+
-+ if (!mdp->cd->tsu)
-+ return 0;
-+
-+ i = sh_eth_tsu_find_entry(ndev, addr);
-+ if (i < 0) {
-+ /* No entry found, create one */
-+ i = sh_eth_tsu_find_empty(ndev);
-+ if (i < 0)
-+ return -ENOMEM;
-+ ret = sh_eth_tsu_write_entry(ndev, reg_offset + i * 8, addr);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* Enable the entry */
-+ sh_eth_tsu_write(mdp, sh_eth_tsu_read(mdp, TSU_TEN) |
-+ (1 << (31 - i)), TSU_TEN);
-+ }
-+
-+ /* Entry found or created, enable POST */
-+ sh_eth_tsu_enable_cam_entry_post(ndev, i);
-+
-+ return 0;
-+}
-+
-+static int sh_eth_tsu_del_entry(struct net_device *ndev, const u8 *addr)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ int i, ret;
-+
-+ if (!mdp->cd->tsu)
-+ return 0;
-+
-+ i = sh_eth_tsu_find_entry(ndev, addr);
-+ if (i) {
-+ /* Entry found */
-+ if (sh_eth_tsu_disable_cam_entry_post(ndev, i))
-+ goto done;
-+
-+ /* Disable the entry if both ports was disabled */
-+ ret = sh_eth_tsu_disable_cam_entry_table(ndev, i);
-+ if (ret < 0)
-+ return ret;
-+ }
-+done:
-+ return 0;
-+}
-+
-+static int sh_eth_tsu_purge_all(struct net_device *ndev)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ int i, ret;
-+
-+ if (unlikely(!mdp->cd->tsu))
-+ return 0;
-+
-+ for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++) {
-+ if (sh_eth_tsu_disable_cam_entry_post(ndev, i))
-+ continue;
-+
-+ /* Disable the entry if both ports was disabled */
-+ ret = sh_eth_tsu_disable_cam_entry_table(ndev, i);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ return 0;
-+}
-+
-+static void sh_eth_tsu_purge_mcast(struct net_device *ndev)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ u8 addr[ETH_ALEN];
-+ void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0);
-+ int i;
-+
-+ if (unlikely(!mdp->cd->tsu))
-+ return;
-+
-+ for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
-+ sh_eth_tsu_read_entry(reg_offset, addr);
-+ if (is_multicast_ether_addr(addr))
-+ sh_eth_tsu_del_entry(ndev, addr);
-+ }
-+}
-+
- /* Multicast reception directions set */
- static void sh_eth_set_multicast_list(struct net_device *ndev)
- {
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ u32 ecmr_bits;
-+ int mcast_all = 0;
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&mdp->lock, flags);
-+ /*
-+ * Initial condition is MCT = 1, PRM = 0.
-+ * Depending on ndev->flags, set PRM or clear MCT
-+ */
-+ ecmr_bits = (sh_eth_read(ndev, ECMR) & ~ECMR_PRM) | ECMR_MCT;
-+
-+ if (!(ndev->flags & IFF_MULTICAST)) {
-+ sh_eth_tsu_purge_mcast(ndev);
-+ mcast_all = 1;
-+ }
-+ if (ndev->flags & IFF_ALLMULTI) {
-+ sh_eth_tsu_purge_mcast(ndev);
-+ ecmr_bits &= ~ECMR_MCT;
-+ mcast_all = 1;
-+ }
-+
- if (ndev->flags & IFF_PROMISC) {
-- /* Set promiscuous. */
-- sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_MCT) |
-- ECMR_PRM, ECMR);
-+ sh_eth_tsu_purge_all(ndev);
-+ ecmr_bits = (ecmr_bits & ~ECMR_MCT) | ECMR_PRM;
-+ } else if (mdp->cd->tsu) {
-+ struct netdev_hw_addr *ha;
-+ netdev_for_each_mc_addr(ha, ndev) {
-+ if (mcast_all && is_multicast_ether_addr(ha->addr))
-+ continue;
-+
-+ if (sh_eth_tsu_add_entry(ndev, ha->addr) < 0) {
-+ if (!mcast_all) {
-+ sh_eth_tsu_purge_mcast(ndev);
-+ ecmr_bits &= ~ECMR_MCT;
-+ mcast_all = 1;
-+ }
-+ }
-+ }
- } else {
- /* Normal, unicast/broadcast-only mode. */
-- sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_PRM) |
-- ECMR_MCT, ECMR);
-+ ecmr_bits = (ecmr_bits & ~ECMR_PRM) | ECMR_MCT;
- }
-+
-+ /* update the ethernet mode */
-+ sh_eth_write(ndev, ecmr_bits, ECMR);
-+
-+ spin_unlock_irqrestore(&mdp->lock, flags);
- }
- #endif /* SH_ETH_HAS_TSU */
-
-@@ -1869,6 +2140,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- }
- mdp->tsu_addr = ioremap(rtsu->start,
- resource_size(rtsu));
-+ mdp->port = devno % 2;
- }
-
- /* initialize first or needed device */
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index cb07add..86b392e 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -29,6 +29,8 @@
- #define RX_RING_SIZE 64 /* Rx ring size */
- #define ETHERSMALL 60
- #define PKT_BUF_SZ 1538
-+#define SH_ETH_TSU_TIMEOUT_MS 500
-+#define SH_ETH_TSU_CAM_ENTRIES 32
-
- enum {
- /* E-DMAC registers */
-@@ -778,6 +780,7 @@ struct sh_eth_private {
- char post_rx; /* POST receive */
- char post_fw; /* POST forward */
- struct net_device_stats tsu_stats; /* TSU forward status */
-+ int port; /* for TSU */
-
- unsigned no_ether_link:1;
- unsigned ether_link_active_low:1;
-@@ -811,6 +814,12 @@ static inline unsigned long sh_eth_read(struct net_device *ndev,
- return ioread32(mdp->addr + mdp->reg_offset[enum_index]);
- }
-
-+static inline void *sh_eth_tsu_get_offset(struct sh_eth_private *mdp,
-+ int enum_index)
-+{
-+ return mdp->tsu_addr + mdp->reg_offset[enum_index];
-+}
-+
- static inline void sh_eth_tsu_write(struct sh_eth_private *mdp,
- unsigned long data, int enum_index)
- {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0092-net-sh_eth-add-support-for-VLAN-tag-filtering.patch b/patches.armadillo800eva/0092-net-sh_eth-add-support-for-VLAN-tag-filtering.patch
deleted file mode 100644
index 78e57fc310acbb..00000000000000
--- a/patches.armadillo800eva/0092-net-sh_eth-add-support-for-VLAN-tag-filtering.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 88005e464c36fa68e0bb15937f5ea1373191782e Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 15 Feb 2012 17:55:06 +0000
-Subject: net: sh_eth: add support for VLAN tag filtering
-
-Some controllers have TSU. It can register one VLAN tag, and it can
-filter other VLAN tag by hardware.
-If vlan_rx_add_vid() is called twice or more, the driver will disable
-the filtering.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 71cc7c37af71b497698f7f8a68e46a458071fcef)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 59 +++++++++++++++++++++++++++++++++
- drivers/net/ethernet/renesas/sh_eth.h | 5 +++
- 2 files changed, 64 insertions(+)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 99d8ce8..8615961 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1888,6 +1888,62 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
-
- spin_unlock_irqrestore(&mdp->lock, flags);
- }
-+
-+static int sh_eth_get_vtag_index(struct sh_eth_private *mdp)
-+{
-+ if (!mdp->port)
-+ return TSU_VTAG0;
-+ else
-+ return TSU_VTAG1;
-+}
-+
-+static int sh_eth_vlan_rx_add_vid(struct net_device *ndev, u16 vid)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ int vtag_reg_index = sh_eth_get_vtag_index(mdp);
-+
-+ if (unlikely(!mdp->cd->tsu))
-+ return -EPERM;
-+
-+ /* No filtering if vid = 0 */
-+ if (!vid)
-+ return 0;
-+
-+ mdp->vlan_num_ids++;
-+
-+ /*
-+ * The controller has one VLAN tag HW filter. So, if the filter is
-+ * already enabled, the driver disables it and the filte
-+ */
-+ if (mdp->vlan_num_ids > 1) {
-+ /* disable VLAN filter */
-+ sh_eth_tsu_write(mdp, 0, vtag_reg_index);
-+ return 0;
-+ }
-+
-+ sh_eth_tsu_write(mdp, TSU_VTAG_ENABLE | (vid & TSU_VTAG_VID_MASK),
-+ vtag_reg_index);
-+
-+ return 0;
-+}
-+
-+static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev, u16 vid)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ int vtag_reg_index = sh_eth_get_vtag_index(mdp);
-+
-+ if (unlikely(!mdp->cd->tsu))
-+ return -EPERM;
-+
-+ /* No filtering if vid = 0 */
-+ if (!vid)
-+ return 0;
-+
-+ mdp->vlan_num_ids--;
-+ sh_eth_tsu_write(mdp, 0, vtag_reg_index);
-+
-+ return 0;
-+}
- #endif /* SH_ETH_HAS_TSU */
-
- /* SuperH's TSU register init function */
-@@ -2037,6 +2093,8 @@ static const struct net_device_ops sh_eth_netdev_ops = {
- .ndo_get_stats = sh_eth_get_stats,
- #if defined(SH_ETH_HAS_TSU)
- .ndo_set_rx_mode = sh_eth_set_multicast_list,
-+ .ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid,
-+ .ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid,
- #endif
- .ndo_tx_timeout = sh_eth_tx_timeout,
- .ndo_do_ioctl = sh_eth_do_ioctl,
-@@ -2141,6 +2199,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
- mdp->tsu_addr = ioremap(rtsu->start,
- resource_size(rtsu));
- mdp->port = devno % 2;
-+ ndev->features = NETIF_F_HW_VLAN_FILTER;
- }
-
- /* initialize first or needed device */
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index 86b392e..57dc262 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -679,6 +679,10 @@ enum TSU_FWSLC_BIT {
- TSU_FWSLC_CAMSEL11 = 0x0002, TSU_FWSLC_CAMSEL10 = 0x0001,
- };
-
-+/* TSU_VTAGn */
-+#define TSU_VTAG_ENABLE 0x80000000
-+#define TSU_VTAG_VID_MASK 0x00000fff
-+
- /*
- * The sh ether Tx buffer descriptors.
- * This structure should be 20 bytes.
-@@ -781,6 +785,7 @@ struct sh_eth_private {
- char post_fw; /* POST forward */
- struct net_device_stats tsu_stats; /* TSU forward status */
- int port; /* for TSU */
-+ int vlan_num_ids; /* for VLAN tag filter */
-
- unsigned no_ether_link:1;
- unsigned ether_link_active_low:1;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0093-net-sh_eth-Add-support-SH7734.patch b/patches.armadillo800eva/0093-net-sh_eth-Add-support-SH7734.patch
deleted file mode 100644
index 5139197b08785d..00000000000000
--- a/patches.armadillo800eva/0093-net-sh_eth-Add-support-SH7734.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-From 3b43f34993772ee505d5cf82d6f67f8ab8630e55 Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Sun, 25 Mar 2012 18:59:51 +0000
-Subject: net: sh_eth: Add support SH7734
-
-Add define of SH7734 register and sh_eth_reset_hw_crc function.
-
-V3: Rebase net/HEAD.
-V2: Do not split line of #if defined.
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit f0e81fecd4f83de7854262c8a6b3af19dfa99bf9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/Kconfig | 5 +++--
- drivers/net/ethernet/renesas/sh_eth.c | 20 +++++++++++++++++---
- drivers/net/ethernet/renesas/sh_eth.h | 11 ++++++++---
- 3 files changed, 28 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
-index f57ae23..20cbf26 100644
---- a/drivers/net/ethernet/renesas/Kconfig
-+++ b/drivers/net/ethernet/renesas/Kconfig
-@@ -7,7 +7,8 @@ config SH_ETH
- depends on SUPERH && \
- (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
- CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
-- CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757)
-+ CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
-+ CPU_SUBTYPE_SH7757)
- select CRC32
- select MII
- select MDIO_BITBANG
-@@ -15,4 +16,4 @@ config SH_ETH
- ---help---
- Renesas SuperH Ethernet device driver.
- This driver supporting CPUs are:
-- - SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757.
-+ - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763 and SH7757.
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 8615961..8bdf070 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1,8 +1,8 @@
- /*
- * SuperH Ethernet device driver
- *
-- * Copyright (C) 2006-2008 Nobuhiro Iwamatsu
-- * Copyright (C) 2008-2009 Renesas Solutions Corp.
-+ * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
-+ * Copyright (C) 2008-2012 Renesas Solutions Corp.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
-@@ -38,6 +38,7 @@
- #include <linux/slab.h>
- #include <linux/ethtool.h>
- #include <linux/if_vlan.h>
-+#include <linux/clk.h>
- #include <linux/sh_eth.h>
-
- #include "sh_eth.h"
-@@ -279,8 +280,9 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp)
- return &sh_eth_my_cpu_data;
- }
-
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
-+#elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
- #define SH_ETH_HAS_TSU 1
-+static void sh_eth_reset_hw_crc(struct net_device *ndev);
- static void sh_eth_chip_reset(struct net_device *ndev)
- {
- struct sh_eth_private *mdp = netdev_priv(ndev);
-@@ -314,6 +316,9 @@ static void sh_eth_reset(struct net_device *ndev)
- sh_eth_write(ndev, 0x0, RDFAR);
- sh_eth_write(ndev, 0x0, RDFXR);
- sh_eth_write(ndev, 0x0, RDFFR);
-+
-+ /* Reset HW CRC register */
-+ sh_eth_reset_hw_crc(ndev);
- }
-
- static void sh_eth_set_duplex(struct net_device *ndev)
-@@ -370,8 +375,17 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
- .no_trimd = 1,
- .no_ade = 1,
- .tsu = 1,
-+#if defined(CONFIG_CPU_SUBTYPE_SH7734)
-+ .hw_crc = 1,
-+#endif
- };
-
-+static void sh_eth_reset_hw_crc(struct net_device *ndev)
-+{
-+ if (sh_eth_my_cpu_data.hw_crc)
-+ sh_eth_write(ndev, 0x0, CSMR);
-+}
-+
- #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
- #define SH_ETH_RESET_DEFAULT 1
- static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index 57dc262..e66de18 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -1,8 +1,8 @@
- /*
- * SuperH Ethernet device driver
- *
-- * Copyright (C) 2006-2008 Nobuhiro Iwamatsu
-- * Copyright (C) 2008-2011 Renesas Solutions Corp.
-+ * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
-+ * Copyright (C) 2008-2012 Renesas Solutions Corp.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
-@@ -98,6 +98,8 @@ enum {
- CEECR,
- MAFCR,
- RTRATE,
-+ CSMR,
-+ RMII_MII,
-
- /* TSU Absolute address */
- ARSTR,
-@@ -172,6 +174,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
- [RMCR] = 0x0458,
- [RPADIR] = 0x0460,
- [FCFTR] = 0x0468,
-+ [CSMR] = 0x04E4,
-
- [ECMR] = 0x0500,
- [ECSR] = 0x0510,
-@@ -200,6 +203,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
- [CERCR] = 0x0768,
- [CEECR] = 0x0770,
- [MAFCR] = 0x0778,
-+ [RMII_MII] = 0x0790,
-
- [ARSTR] = 0x0000,
- [TSU_CTRST] = 0x0004,
-@@ -377,7 +381,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
- /*
- * Register's bits
- */
--#ifdef CONFIG_CPU_SUBTYPE_SH7763
-+#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
- /* EDSR */
- enum EDSR_BIT {
- EDSR_ENT = 0x01, EDSR_ENR = 0x02,
-@@ -751,6 +755,7 @@ struct sh_eth_cpu_data {
- unsigned rpadir:1; /* E-DMAC have RPADIR */
- unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */
- unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */
-+ unsigned hw_crc:1; /* E-DMAC have CSMR */
- };
-
- struct sh_eth_private {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0094-net-sh_eth-fix-endian-check-for-architecture-indepen.patch b/patches.armadillo800eva/0094-net-sh_eth-fix-endian-check-for-architecture-indepen.patch
deleted file mode 100644
index a98c2c88fb53fe..00000000000000
--- a/patches.armadillo800eva/0094-net-sh_eth-fix-endian-check-for-architecture-indepen.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From acb273eabf0abf90201a06494f6b2b11c7caf605 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 29 Mar 2012 19:32:08 +0000
-Subject: net: sh_eth: fix endian check for architecture independent
-
-SuperH has the "CONFIG_CPU_LITTLE_ENDIAN" and the "__LITTLE_ENDIAN__".
-But, other architecture doesn't have them. So, this patch fixes it.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 10b9194f959608368ed89df1937f17cfe6bd6d84)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/sh_eth.c | 2 +-
- drivers/net/ethernet/renesas/sh_eth.h | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 8bdf070..d63e09b 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -804,7 +804,7 @@ static int sh_eth_dev_init(struct net_device *ndev)
- /* all sh_eth int mask */
- sh_eth_write(ndev, 0, EESIPR);
-
--#if defined(__LITTLE_ENDIAN__)
-+#if defined(__LITTLE_ENDIAN)
- if (mdp->cd->hw_swap)
- sh_eth_write(ndev, EDMR_EL, EDMR);
- else
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index e66de18..0fa14af 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -693,7 +693,7 @@ enum TSU_FWSLC_BIT {
- */
- struct sh_eth_txdesc {
- u32 status; /* TD0 */
--#if defined(CONFIG_CPU_LITTLE_ENDIAN)
-+#if defined(__LITTLE_ENDIAN)
- u16 pad0; /* TD1 */
- u16 buffer_length; /* TD1 */
- #else
-@@ -710,7 +710,7 @@ struct sh_eth_txdesc {
- */
- struct sh_eth_rxdesc {
- u32 status; /* RD0 */
--#if defined(CONFIG_CPU_LITTLE_ENDIAN)
-+#if defined(__LITTLE_ENDIAN)
- u16 frame_length; /* RD1 */
- u16 buffer_length; /* RD1 */
- #else
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0095-net-sh_eth-add-support-R8A7740.patch b/patches.armadillo800eva/0095-net-sh_eth-add-support-R8A7740.patch
deleted file mode 100644
index 779e9e6e1a2f5e..00000000000000
--- a/patches.armadillo800eva/0095-net-sh_eth-add-support-R8A7740.patch
+++ /dev/null
@@ -1,211 +0,0 @@
-From 96f83b7e39c9f99d4436562b1e0abe12c9c2f9c0 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 4 Apr 2012 18:37:10 +0000
-Subject: net: sh_eth: add support R8A7740
-
-The R8A7740 has a Gigabit Ethernet MAC. This patch supports it.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit 73a0d907301ece200d32b4e8ba2da2ca296b507f)
-
-N.B: This patch is not present upstream yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/net/ethernet/renesas/Kconfig | 7 +-
- drivers/net/ethernet/renesas/sh_eth.c | 114 ++++++++++++++++++++++++++++++++-
- drivers/net/ethernet/renesas/sh_eth.h | 5 +-
- 3 files changed, 120 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
-index 20cbf26..cdac706 100644
---- a/drivers/net/ethernet/renesas/Kconfig
-+++ b/drivers/net/ethernet/renesas/Kconfig
-@@ -4,11 +4,11 @@
-
- config SH_ETH
- tristate "Renesas SuperH Ethernet support"
-- depends on SUPERH && \
-+ depends on (SUPERH || ARCH_SHMOBILE) && \
- (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
- CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
- CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
-- CPU_SUBTYPE_SH7757)
-+ CPU_SUBTYPE_SH7757 || ARCH_R8A7740)
- select CRC32
- select MII
- select MDIO_BITBANG
-@@ -16,4 +16,5 @@ config SH_ETH
- ---help---
- Renesas SuperH Ethernet device driver.
- This driver supporting CPUs are:
-- - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763 and SH7757.
-+ - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
-+ and R8A7740.
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index d63e09b..be3c221 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -386,6 +386,114 @@ static void sh_eth_reset_hw_crc(struct net_device *ndev)
- sh_eth_write(ndev, 0x0, CSMR);
- }
-
-+#elif defined(CONFIG_ARCH_R8A7740)
-+#define SH_ETH_HAS_TSU 1
-+static void sh_eth_chip_reset(struct net_device *ndev)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+ unsigned long mii;
-+
-+ /* reset device */
-+ sh_eth_tsu_write(mdp, ARSTR_ARSTR, ARSTR);
-+ mdelay(1);
-+
-+ switch (mdp->phy_interface) {
-+ case PHY_INTERFACE_MODE_GMII:
-+ mii = 2;
-+ break;
-+ case PHY_INTERFACE_MODE_MII:
-+ mii = 1;
-+ break;
-+ case PHY_INTERFACE_MODE_RMII:
-+ default:
-+ mii = 0;
-+ break;
-+ }
-+ sh_eth_write(ndev, mii, RMII_MII);
-+}
-+
-+static void sh_eth_reset(struct net_device *ndev)
-+{
-+ int cnt = 100;
-+
-+ sh_eth_write(ndev, EDSR_ENALL, EDSR);
-+ sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER, EDMR);
-+ while (cnt > 0) {
-+ if (!(sh_eth_read(ndev, EDMR) & 0x3))
-+ break;
-+ mdelay(1);
-+ cnt--;
-+ }
-+ if (cnt == 0)
-+ printk(KERN_ERR "Device reset fail\n");
-+
-+ /* Table Init */
-+ sh_eth_write(ndev, 0x0, TDLAR);
-+ sh_eth_write(ndev, 0x0, TDFAR);
-+ sh_eth_write(ndev, 0x0, TDFXR);
-+ sh_eth_write(ndev, 0x0, TDFFR);
-+ sh_eth_write(ndev, 0x0, RDLAR);
-+ sh_eth_write(ndev, 0x0, RDFAR);
-+ sh_eth_write(ndev, 0x0, RDFXR);
-+ sh_eth_write(ndev, 0x0, RDFFR);
-+}
-+
-+static void sh_eth_set_duplex(struct net_device *ndev)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+
-+ if (mdp->duplex) /* Full */
-+ sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-+ else /* Half */
-+ sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-+}
-+
-+static void sh_eth_set_rate(struct net_device *ndev)
-+{
-+ struct sh_eth_private *mdp = netdev_priv(ndev);
-+
-+ switch (mdp->speed) {
-+ case 10: /* 10BASE */
-+ sh_eth_write(ndev, GECMR_10, GECMR);
-+ break;
-+ case 100:/* 100BASE */
-+ sh_eth_write(ndev, GECMR_100, GECMR);
-+ break;
-+ case 1000: /* 1000BASE */
-+ sh_eth_write(ndev, GECMR_1000, GECMR);
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+/* R8A7740 */
-+static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
-+ .chip_reset = sh_eth_chip_reset,
-+ .set_duplex = sh_eth_set_duplex,
-+ .set_rate = sh_eth_set_rate,
-+
-+ .ecsr_value = ECSR_ICD | ECSR_MPD,
-+ .ecsipr_value = ECSIPR_LCHNGIP | ECSIPR_ICDIP | ECSIPR_MPDIP,
-+ .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
-+
-+ .tx_check = EESR_TC1 | EESR_FTC,
-+ .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | \
-+ EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | \
-+ EESR_ECI,
-+ .tx_error_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_TDE | \
-+ EESR_TFE,
-+
-+ .apr = 1,
-+ .mpr = 1,
-+ .tpauser = 1,
-+ .bculr = 1,
-+ .hw_swap = 1,
-+ .no_trimd = 1,
-+ .no_ade = 1,
-+ .tsu = 1,
-+};
-+
- #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
- #define SH_ETH_RESET_DEFAULT 1
- static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
-@@ -443,7 +551,7 @@ static void sh_eth_reset(struct net_device *ndev)
- }
- #endif
-
--#if defined(CONFIG_CPU_SH4)
-+#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
- static void sh_eth_set_receive_align(struct sk_buff *skb)
- {
- int reserve;
-@@ -919,6 +1027,10 @@ static int sh_eth_rx(struct net_device *ndev)
- desc_status = edmac_to_cpu(mdp, rxdesc->status);
- pkt_len = rxdesc->frame_length;
-
-+#if defined(CONFIG_ARCH_R8A7740)
-+ desc_status >>= 16;
-+#endif
-+
- if (--boguscnt < 0)
- break;
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
-index 0fa14af..57b8e1f 100644
---- a/drivers/net/ethernet/renesas/sh_eth.h
-+++ b/drivers/net/ethernet/renesas/sh_eth.h
-@@ -372,7 +372,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
- };
-
- /* Driver's parameters */
--#if defined(CONFIG_CPU_SH4)
-+#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
- #define SH4_SKB_RX_ALIGN 32
- #else
- #define SH2_SH3_SKB_RX_ALIGN 2
-@@ -381,7 +381,8 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
- /*
- * Register's bits
- */
--#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
-+#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) ||\
-+ defined(CONFIG_ARCH_R8A7740)
- /* EDSR */
- enum EDSR_BIT {
- EDSR_ENT = 0x01, EDSR_ENR = 0x02,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0096-atomic-use-linux-atomic.h.patch b/patches.armadillo800eva/0096-atomic-use-linux-atomic.h.patch
deleted file mode 100644
index 9f0d056935e4aa..00000000000000
--- a/patches.armadillo800eva/0096-atomic-use-linux-atomic.h.patch
+++ /dev/null
@@ -1,480 +0,0 @@
-From 70f3283955786c63da5b5003986805f6b74ad5d4 Mon Sep 17 00:00:00 2001
-From: Arun Sharma <asharma@fb.com>
-Date: Tue, 26 Jul 2011 16:09:06 -0700
-Subject: atomic: use <linux/atomic.h>
-
-This allows us to move duplicated code in <asm/atomic.h>
-(atomic_inc_not_zero() for now) to <linux/atomic.h>
-
-Signed-off-by: Arun Sharma <asharma@fb.com>
-Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
-Cc: Ingo Molnar <mingo@elte.hu>
-Cc: David Miller <davem@davemloft.net>
-Cc: Eric Dumazet <eric.dumazet@gmail.com>
-Acked-by: Mike Frysinger <vapier@gentoo.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit 60063497a95e716c9a689af3be2687d261f115b4)
-
-Conflicts:
-
- arch/alpha/include/asm/atomic.h
- arch/alpha/include/asm/local.h
- arch/alpha/kernel/perf_event.c
- arch/alpha/kernel/smp.c
- arch/alpha/lib/dec_and_lock.c
- arch/arm/include/asm/atomic.h
- arch/arm/kernel/smp.c
- arch/arm/kernel/traps.c
- arch/arm/mach-at91/pm.c
- arch/arm/mach-bcmring/dma.c
- arch/arm/mach-cns3xxx/include/mach/pm.h
- arch/arm/mach-cns3xxx/pm.c
- arch/arm/mach-omap1/pm.c
- arch/arm/mach-s3c2440/clock.c
- arch/arm/mach-s3c2440/s3c2442.c
- arch/arm/mach-s3c2440/s3c244x-clock.c
- arch/avr32/include/asm/atomic.h
- arch/blackfin/include/asm/atomic.h
- arch/blackfin/include/asm/dma.h
- arch/blackfin/include/asm/ipipe.h
- arch/blackfin/include/asm/spinlock.h
- arch/blackfin/kernel/ftrace.c
- arch/blackfin/kernel/ipipe.c
- arch/blackfin/kernel/nmi.c
- arch/blackfin/mach-common/smp.c
- arch/cris/arch-v32/drivers/cryptocop.c
- arch/cris/arch-v32/kernel/smp.c
- arch/cris/include/asm/atomic.h
- arch/cris/include/asm/bitops.h
- arch/cris/kernel/process.c
- arch/frv/include/asm/atomic.h
- arch/frv/include/asm/hardirq.h
- arch/frv/kernel/irq.c
- arch/h8300/include/asm/atomic.h
- arch/ia64/include/asm/atomic.h
- arch/ia64/include/asm/processor.h
- arch/ia64/include/asm/spinlock.h
- arch/ia64/kernel/smp.c
- arch/ia64/kernel/smpboot.c
- arch/ia64/kernel/uncached.c
- arch/m32r/include/asm/atomic.h
- arch/m32r/include/asm/mmu_context.h
- arch/m32r/include/asm/spinlock.h
- arch/m32r/kernel/smp.c
- arch/m32r/kernel/traps.c
- arch/m68k/include/asm/atomic.h
- arch/microblaze/include/asm/mmu_context_mm.h
- arch/microblaze/include/asm/prom.h
- arch/mips/include/asm/atomic.h
- arch/mips/include/asm/hw_irq.h
- arch/mips/include/asm/local.h
- arch/mips/include/asm/smp.h
- arch/mips/kernel/irq.c
- arch/mips/kernel/mips-mt.c
- arch/mips/kernel/rtlx.c
- arch/mips/kernel/smp-cmp.c
- arch/mips/kernel/smp-mt.c
- arch/mips/kernel/smp.c
- arch/mips/kernel/smtc-proc.c
- arch/mips/kernel/smtc.c
- arch/mips/kernel/sync-r4k.c
- arch/mips/kernel/vpe.c
- arch/mips/mipssim/sim_smtc.c
- arch/mips/sgi-ip27/ip27-nmi.c
- arch/mn10300/include/asm/atomic.h
- arch/mn10300/include/asm/mmu_context.h
- arch/mn10300/include/asm/spinlock.h
- arch/mn10300/include/asm/system.h
- arch/mn10300/kernel/mn10300-watchdog.c
- arch/mn10300/kernel/traps.c
- arch/mn10300/mm/misalignment.c
- arch/mn10300/proc-mn2ws0050/proc-init.c
- arch/parisc/include/asm/atomic.h
- arch/parisc/include/asm/bitops.h
- arch/parisc/include/asm/mmu_context.h
- arch/parisc/kernel/parisc_ksyms.c
- arch/parisc/kernel/smp.c
- arch/parisc/kernel/traps.c
- arch/parisc/lib/bitops.c
- arch/powerpc/include/asm/atomic.h
- arch/powerpc/include/asm/emulated_ops.h
- arch/powerpc/include/asm/irq.h
- arch/powerpc/include/asm/local.h
- arch/powerpc/include/asm/prom.h
- arch/powerpc/kernel/of_platform.c
- arch/powerpc/kernel/ppc_ksyms.c
- arch/powerpc/kernel/rtas.c
- arch/powerpc/kernel/rtasd.c
- arch/powerpc/kernel/smp-tbsync.c
- arch/powerpc/kernel/smp.c
- arch/powerpc/platforms/83xx/km83xx.c
- arch/powerpc/platforms/83xx/mpc832x_mds.c
- arch/powerpc/platforms/83xx/mpc834x_itx.c
- arch/powerpc/platforms/83xx/mpc834x_mds.c
- arch/powerpc/platforms/83xx/mpc836x_mds.c
- arch/powerpc/platforms/83xx/sbc834x.c
- arch/powerpc/platforms/85xx/mpc85xx_cds.c
- arch/powerpc/platforms/85xx/mpc85xx_mds.c
- arch/powerpc/platforms/85xx/sbc8548.c
- arch/powerpc/platforms/cell/cpufreq_spudemand.c
- arch/powerpc/platforms/cell/smp.c
- arch/powerpc/platforms/cell/spufs/context.c
- arch/powerpc/platforms/chrp/smp.c
- arch/powerpc/platforms/iseries/smp.c
- arch/powerpc/platforms/powermac/backlight.c
- arch/powerpc/platforms/powermac/smp.c
- arch/powerpc/platforms/pseries/eeh.c
- arch/powerpc/platforms/pseries/eeh_cache.c
- arch/powerpc/platforms/pseries/smp.c
- arch/powerpc/sysdev/fsl_soc.c
- arch/powerpc/sysdev/tsi108_dev.c
- arch/s390/include/asm/atomic.h
- arch/s390/kernel/dis.c
- arch/s390/kernel/traps.c
- arch/sh/include/asm/atomic.h
- arch/sh/include/asm/hw_irq.h
- arch/sh/include/asm/smp.h
- arch/sh/kernel/idle.c
- arch/sh/kernel/smp.c
- arch/sh/kernel/traps_64.c
- arch/sh/kernel/unwinder.c
- arch/sparc/include/asm/atomic_32.h
- arch/sparc/include/asm/atomic_64.h
- arch/sparc/include/asm/prom.h
- arch/sparc/include/asm/smp_32.h
- arch/sparc/include/asm/smp_64.h
- arch/sparc/kernel/irq_64.c
- arch/sparc/kernel/leon_smp.c
- arch/sparc/kernel/perf_event.c
- arch/sparc/kernel/smp_32.c
- arch/sparc/kernel/smp_64.c
- arch/sparc/lib/atomic32.c
- arch/tile/include/asm/atomic.h
- arch/tile/include/asm/atomic_32.h
- arch/tile/include/asm/atomic_64.h
- arch/tile/include/asm/bitops_32.h
- arch/tile/include/asm/bitops_64.h
- arch/tile/include/asm/spinlock_32.h
- arch/tile/kernel/intvec_32.S
- arch/tile/lib/atomic_32.c
- arch/tile/lib/atomic_asm_32.S
- arch/x86/ia32/sys_ia32.c
- arch/x86/include/asm/apic.h
- arch/x86/include/asm/atomic.h
- arch/x86/include/asm/hw_irq.h
- arch/x86/include/asm/local.h
- arch/x86/include/asm/mce.h
- arch/x86/include/asm/mmu_context.h
- arch/x86/include/asm/prom.h
- arch/x86/include/asm/spinlock.h
- arch/x86/include/asm/thread_info.h
- arch/x86/kernel/amd_gart_64.c
- arch/x86/kernel/apic/apic.c
- arch/x86/kernel/apic/es7000_32.c
- arch/x86/kernel/cpu/common.c
- arch/x86/kernel/i8259.c
- arch/x86/kernel/irqinit.c
- arch/x86/kernel/traps.c
- arch/x86/kvm/lapic.c
- arch/x86/kvm/timer.c
- arch/x86/lib/atomic64_32.c
- arch/x86/mm/mmio-mod.c
- arch/xtensa/include/asm/atomic.h
- arch/xtensa/kernel/process.c
- crypto/af_alg.c
- crypto/proc.c
- crypto/rng.c
- drivers/atm/ambassador.c
- drivers/atm/atmtcp.c
- drivers/atm/eni.c
- drivers/atm/eni.h
- drivers/atm/firestream.c
- drivers/atm/fore200e.c
- drivers/atm/horizon.c
- drivers/atm/idt77252.c
- drivers/atm/iphase.c
- drivers/atm/nicstar.c
- drivers/atm/suni.c
- drivers/atm/uPD98402.c
- drivers/atm/zatm.c
- drivers/base/memory.c
- drivers/base/power/sysfs.c
- drivers/block/cciss_scsi.c
- drivers/char/ipmi/ipmi_watchdog.c
- drivers/char/mspec.c
- drivers/connector/cn_proc.c
- drivers/edac/edac_stub.c
- drivers/firewire/core-card.c
- drivers/firewire/core-device.c
- drivers/firewire/core-topology.c
- drivers/firewire/core.h
- drivers/firewire/nosy.c
- drivers/gpu/drm/radeon/radeon.h
- drivers/gpu/drm/radeon/radeon_fence.c
- drivers/gpu/drm/ttm/ttm_bo.c
- drivers/gpu/drm/ttm/ttm_lock.c
- drivers/gpu/drm/ttm/ttm_object.c
- drivers/gpu/drm/ttm/ttm_page_alloc.c
- drivers/hwmon/sht15.c
- drivers/infiniband/hw/cxgb4/mem.c
- drivers/infiniband/hw/ehca/ehca_tools.h
- drivers/infiniband/hw/nes/nes_cm.c
- drivers/infiniband/ulp/ipoib/ipoib.h
- drivers/infiniband/ulp/srp/ib_srp.c
- drivers/isdn/gigaset/gigaset.h
- drivers/md/dm-crypt.c
- drivers/md/dm-kcopyd.c
- drivers/md/dm-mpath.c
- drivers/md/dm-queue-length.c
- drivers/md/dm-table.c
- drivers/media/video/hdpvr/hdpvr-core.c
- drivers/media/video/tlg2300/pd-dvb.c
- drivers/media/video/uvc/uvc_ctrl.c
- drivers/media/video/uvc/uvc_queue.c
- drivers/media/video/uvc/uvc_v4l2.c
- drivers/media/video/uvc/uvc_video.c
- drivers/message/i2o/i2o_scsi.c
- drivers/misc/phantom.c
- drivers/net/atlx/atl1.c
- drivers/net/atlx/atl2.c
- drivers/net/atlx/atl2.h
- drivers/net/cassini.c
- drivers/net/cpmac.c
- drivers/net/cxgb3/cxgb3_offload.c
- drivers/net/cxgb3/l2t.h
- drivers/net/cxgb3/t3cdev.h
- drivers/net/cxgb4/cxgb4_uld.h
- drivers/net/cxgb4/l2t.h
- drivers/net/hamradio/6pack.c
- drivers/net/hamradio/dmascc.c
- drivers/net/ibmveth.c
- drivers/net/phy/phy.c
- drivers/net/ppp_generic.c
- drivers/net/wimax/i2400m/i2400m.h
- drivers/net/wireless/b43legacy/b43legacy.h
- drivers/net/wireless/b43legacy/dma.h
- drivers/oprofile/oprofile_stats.h
- drivers/pci/hotplug/cpci_hotplug_core.c
- drivers/pci/xen-pcifront.c
- drivers/s390/block/dasd_eer.c
- drivers/s390/char/sclp_quiesce.c
- drivers/s390/char/vmlogrdr.c
- drivers/s390/cio/device.h
- drivers/s390/cio/qdio_main.c
- drivers/s390/cio/qdio_thinint.c
- drivers/s390/crypto/ap_bus.c
- drivers/s390/crypto/zcrypt_api.c
- drivers/s390/crypto/zcrypt_cex2a.c
- drivers/s390/crypto/zcrypt_mono.c
- drivers/s390/crypto/zcrypt_pcica.c
- drivers/s390/crypto/zcrypt_pcicc.c
- drivers/s390/crypto/zcrypt_pcixcc.c
- drivers/s390/net/fsm.h
- drivers/s390/scsi/zfcp_scsi.c
- drivers/sbus/char/display7seg.c
- drivers/scsi/dpt/dpti_i2o.h
- drivers/scsi/hpsa.c
- drivers/scsi/pm8001/pm8001_sas.h
- drivers/staging/octeon/ethernet-rx.c
- drivers/staging/octeon/ethernet-tx.c
- drivers/staging/solo6x10/solo6x10.h
- drivers/staging/tidspbridge/include/dspbridge/host_os.h
- drivers/staging/winbond/mds_s.h
- drivers/staging/winbond/wb35reg_s.h
- drivers/tty/bfin_jtag_comm.c
- drivers/tty/rocket.c
- drivers/tty/serial/dz.c
- drivers/tty/serial/sb1250-duart.c
- drivers/tty/serial/zs.c
- drivers/usb/gadget/f_audio.c
- drivers/usb/gadget/f_rndis.c
- drivers/usb/gadget/uvc_queue.c
- drivers/usb/image/microtek.c
- drivers/usb/misc/appledisplay.c
- drivers/usb/serial/garmin_gps.c
- drivers/usb/wusbcore/wa-rpipe.c
- drivers/vhost/vhost.h
- drivers/video/vermilion/vermilion.h
- drivers/w1/masters/matrox_w1.c
- drivers/w1/w1.c
- drivers/w1/w1_family.h
- drivers/watchdog/intel_scu_watchdog.c
- drivers/watchdog/sbc7240_wdt.c
- fs/btrfs/delayed-inode.h
- fs/direct-io.c
- fs/eventpoll.c
- fs/file_table.c
- fs/gfs2/main.c
- fs/nfs/cache_lib.h
- fs/nfs/direct.c
- fs/notify/group.c
- fs/notify/inode_mark.c
- fs/notify/mark.c
- fs/notify/notification.c
- fs/notify/vfsmount_mark.c
- fs/ntfs/inode.h
- fs/posix_acl.c
- fs/proc/meminfo.c
- include/acpi/platform/aclinux.h
- include/asm-generic/atomic.h
- include/asm-generic/local.h
- include/asm-generic/local64.h
- include/drm/ttm/ttm_lock.h
- include/linux/aio.h
- include/linux/atmdev.h
- include/linux/atomic.h
- include/linux/backing-dev.h
- include/linux/bit_spinlock.h
- include/linux/buffer_head.h
- include/linux/configfs.h
- include/linux/connector.h
- include/linux/cred.h
- include/linux/crypto.h
- include/linux/dcache.h
- include/linux/debug_locks.h
- include/linux/device.h
- include/linux/edac.h
- include/linux/fault-inject.h
- include/linux/fdtable.h
- include/linux/filter.h
- include/linux/firewire.h
- include/linux/fsnotify_backend.h
- include/linux/interrupt.h
- include/linux/jump_label.h
- include/linux/kdb.h
- include/linux/key.h
- include/linux/kgdb.h
- include/linux/kobject.h
- include/linux/mlx4/device.h
- include/linux/mman.h
- include/linux/mmzone.h
- include/linux/mount.h
- include/linux/mutex.h
- include/linux/netdevice.h
- include/linux/nfs_fs_sb.h
- include/linux/oprofile.h
- include/linux/pci.h
- include/linux/perf_event.h
- include/linux/phy.h
- include/linux/proc_fs.h
- include/linux/quota.h
- include/linux/rwsem.h
- include/linux/sem.h
- include/linux/skbuff.h
- include/linux/sonet.h
- include/linux/spinlock.h
- include/linux/sunrpc/auth.h
- include/linux/sunrpc/cache.h
- include/linux/sunrpc/timer.h
- include/linux/swap.h
- include/linux/sysfs.h
- include/linux/vmstat.h
- include/linux/workqueue.h
- include/net/ax25.h
- include/net/cipso_ipv4.h
- include/net/flow.h
- include/net/inet_hashtables.h
- include/net/inet_timewait_sock.h
- include/net/inetpeer.h
- include/net/ip_vs.h
- include/net/lib80211.h
- include/net/llc.h
- include/net/neighbour.h
- include/net/net_namespace.h
- include/net/netfilter/nf_conntrack.h
- include/net/netlabel.h
- include/net/netns/conntrack.h
- include/net/sctp/structs.h
- include/pcmcia/ds.h
- include/rdma/ib_sa.h
- include/rdma/ib_verbs.h
- include/rxrpc/types.h
- include/scsi/scsi_device.h
- kernel/audit.c
- kernel/auditsc.c
- kernel/cgroup.c
- kernel/cpuset.c
- kernel/debug/debug_core.c
- kernel/rcupdate.c
- kernel/rcutorture.c
- kernel/rcutree_trace.c
- kernel/rwsem.c
- kernel/stop_machine.c
- kernel/taskstats.c
- kernel/trace/trace.h
- kernel/trace/trace_mmiotrace.c
- lib/atomic64.c
- lib/atomic64_test.c
- lib/crc32.c
- lib/dec_and_lock.c
- mm/init-mm.c
- mm/kmemleak.c
- mm/slob.c
- mm/vmalloc.c
- net/atm/atm_misc.c
- net/atm/clip.c
- net/atm/common.c
- net/atm/lec.c
- net/atm/proc.c
- net/bridge/br_fdb.c
- net/core/flow.c
- net/decnet/dn_fib.c
- net/decnet/dn_neigh.c
- net/decnet/dn_table.c
- net/decnet/dn_timer.c
- net/ipv4/cipso_ipv4.c
- net/ipv4/raw.c
- net/ipv6/ip6_tunnel.c
- net/iucv/iucv.c
- net/l2tp/l2tp_core.c
- net/l2tp/l2tp_ppp.c
- net/netfilter/nfnetlink_log.c
- net/netfilter/nfnetlink_queue.c
- net/netlabel/netlabel_cipso_v4.c
- net/netlabel/netlabel_kapi.c
- net/netlabel/netlabel_mgmt.c
- net/netlabel/netlabel_mgmt.h
- net/netlabel/netlabel_unlabeled.c
- net/sunrpc/xprtrdma/xprt_rdma.h
- net/tipc/core.h
- security/selinux/hooks.c
- security/selinux/xfrm.c
- sound/pci/echoaudio/darla20.c
- sound/pci/echoaudio/darla24.c
- sound/pci/echoaudio/echo3g.c
- sound/pci/echoaudio/gina20.c
- sound/pci/echoaudio/gina24.c
- sound/pci/echoaudio/indigo.c
- sound/pci/echoaudio/indigodj.c
- sound/pci/echoaudio/indigodjx.c
- sound/pci/echoaudio/indigoio.c
- sound/pci/echoaudio/indigoiox.c
- sound/pci/echoaudio/layla20.c
- sound/pci/echoaudio/layla24.c
- sound/pci/echoaudio/mia.c
- sound/pci/echoaudio/mona.c
- sound/pci/lx6464es/lx6464es.h
- sound/sparc/dbri.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 019dbd3..b048417 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -24,7 +24,7 @@
- #include <linux/backlight.h>
- #include <linux/gpio.h>
- #include <video/sh_mobile_lcdc.h>
--#include <asm/atomic.h>
-+#include <linux/atomic.h>
-
- #include "sh_mobile_lcdcfb.h"
- #include "sh_mobile_meram.h"
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0097-fbdev-sh_mobile_meram-Enable-runtime-PM.patch b/patches.armadillo800eva/0097-fbdev-sh_mobile_meram-Enable-runtime-PM.patch
deleted file mode 100644
index c7b9dd69b88a2e..00000000000000
--- a/patches.armadillo800eva/0097-fbdev-sh_mobile_meram-Enable-runtime-PM.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 2e680868e989715d2893a5a256c0a8339dd55d67 Mon Sep 17 00:00:00 2001
-From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Date: Mon, 4 Jul 2011 08:06:11 +0200
-Subject: fbdev: sh_mobile_meram: Enable runtime PM
-
-Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-(cherry picked from commit 176737782e8360f1e577264c7aaeb691a7cbbfdd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index cc7d732..34efd8a 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -12,6 +12,7 @@
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/device.h>
-+#include <linux/pm_runtime.h>
- #include <linux/io.h>
- #include <linux/slab.h>
- #include <linux/platform_device.h>
-@@ -515,6 +516,8 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE1)
- meram_write_reg(priv->base, MEVCR1, 1 << 29);
-
-+ pm_runtime_enable(&pdev->dev);
-+
- dev_info(&pdev->dev, "sh_mobile_meram initialized.");
-
- return 0;
-@@ -530,6 +533,8 @@ static int sh_mobile_meram_remove(struct platform_device *pdev)
- {
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-
-+ pm_runtime_disable(&pdev->dev);
-+
- if (priv->base)
- iounmap(priv->base);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0098-fbdev-sh_mobile_meram-Enable-disable-MERAM-along-wit.patch b/patches.armadillo800eva/0098-fbdev-sh_mobile_meram-Enable-disable-MERAM-along-wit.patch
deleted file mode 100644
index 60241d6688ace0..00000000000000
--- a/patches.armadillo800eva/0098-fbdev-sh_mobile_meram-Enable-disable-MERAM-along-wit.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 08c7a79e11d3a62dc42e836d9c167c1645f0b14e Mon Sep 17 00:00:00 2001
-From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Date: Mon, 4 Jul 2011 08:06:47 +0200
-Subject: fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDC
-
-The MERAM reference counts should be tied to the two LCDC devices (LCD/HDMI)
-so that when they are enable/disabled, the MERAM is as well.
-
-Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-(cherry picked from commit ec19b9e0fa808d82ad996d73358a5b06a565b78b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index b048417..2f921ad 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -259,6 +259,8 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
- pm_runtime_get_sync(priv->dev);
- if (priv->dot_clk)
- clk_enable(priv->dot_clk);
-+ if (priv->meram_dev && priv->meram_dev->pdev)
-+ pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
- }
- }
-
-@@ -267,6 +269,8 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
- if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
- if (priv->dot_clk)
- clk_disable(priv->dot_clk);
-+ if (priv->meram_dev && priv->meram_dev->pdev)
-+ pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
- pm_runtime_put(priv->dev);
- }
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0099-fbdev-sh_mobile_meram-Move-private-data-from-.h-to-..patch b/patches.armadillo800eva/0099-fbdev-sh_mobile_meram-Move-private-data-from-.h-to-..patch
deleted file mode 100644
index 9b6c63877dd4f7..00000000000000
--- a/patches.armadillo800eva/0099-fbdev-sh_mobile_meram-Move-private-data-from-.h-to-..patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 7468303594359b92b0beaa4fd090cb7875ba156e Mon Sep 17 00:00:00 2001
-From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Date: Wed, 22 Jun 2011 07:49:50 +0200
-Subject: fbdev: sh_mobile_meram: Move private data from .h to .c
-
-There is no reason for sh_mobile_meram_priv to be in the .h file
-since it should be private to sh_mobile_meram.c
-
-Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-(cherry picked from commit 0aa492be88b10b7b7621101df5fbf79f9236aecb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 8 ++++++++
- drivers/video/sh_mobile_meram.h | 8 --------
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 34efd8a..cfa1a78 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -37,6 +37,14 @@
- #define MEQSEL1 0x40
- #define MEQSEL2 0x44
-
-+struct sh_mobile_meram_priv {
-+ void __iomem *base;
-+ struct mutex lock;
-+ unsigned long used_icb;
-+ int used_meram_cache_regions;
-+ unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
-+};
-+
- /* settings */
- #define MERAM_SEC_LINE 15
- #define MERAM_LINE_WIDTH 2048
-diff --git a/drivers/video/sh_mobile_meram.h b/drivers/video/sh_mobile_meram.h
-index 82c54fb..1615204b 100644
---- a/drivers/video/sh_mobile_meram.h
-+++ b/drivers/video/sh_mobile_meram.h
-@@ -17,14 +17,6 @@
- #define SH_MOBILE_MERAM_CACHE_OFFSET(p) ((p) >> 16)
- #define SH_MOBILE_MERAM_CACHE_SIZE(p) ((p) & 0xffff)
-
--struct sh_mobile_meram_priv {
-- void __iomem *base;
-- struct mutex lock;
-- unsigned long used_icb;
-- int used_meram_cache_regions;
-- unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
--};
--
- int sh_mobile_meram_alloc_icb(const struct sh_mobile_meram_cfg *cfg,
- int xres,
- int yres,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0100-fbdev-sh_mobile_meram-Backup-restore-device-register.patch b/patches.armadillo800eva/0100-fbdev-sh_mobile_meram-Backup-restore-device-register.patch
deleted file mode 100644
index 1c5fe16c2eabfc..00000000000000
--- a/patches.armadillo800eva/0100-fbdev-sh_mobile_meram-Backup-restore-device-register.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From 07eb0d7f0b84da3bf41c145f3aa555ca6a4ed7b2 Mon Sep 17 00:00:00 2001
-From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Date: Wed, 22 Jun 2011 07:49:51 +0200
-Subject: fbdev: sh_mobile_meram: Backup/restore device registers on
- shutdown/resume
-
-Save and reconfigure the MERAM registers when the MERAM is powered down
-and restored
-
-Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-(cherry picked from commit 0b3bb77c3a07a94d878fd3219302c46209f7d71c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 71 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 71 insertions(+)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index cfa1a78..39f28a1 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -37,12 +37,31 @@
- #define MEQSEL1 0x40
- #define MEQSEL2 0x44
-
-+static unsigned long common_regs[] = {
-+ MEVCR1,
-+ MEQSEL1,
-+ MEQSEL2,
-+};
-+#define CMN_REGS_SIZE ARRAY_SIZE(common_regs)
-+
-+static unsigned long icb_regs[] = {
-+ MExxCTL,
-+ MExxBSIZE,
-+ MExxMNCF,
-+ MExxSARA,
-+ MExxSARB,
-+ MExxSBSIZE,
-+};
-+#define ICB_REGS_SIZE ARRAY_SIZE(icb_regs)
-+
- struct sh_mobile_meram_priv {
- void __iomem *base;
- struct mutex lock;
- unsigned long used_icb;
- int used_meram_cache_regions;
- unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
-+ unsigned long cmn_saved_regs[CMN_REGS_SIZE];
-+ unsigned long icb_saved_regs[ICB_REGS_SIZE * SH_MOBILE_MERAM_ICB_NUM];
- };
-
- /* settings */
-@@ -469,6 +488,57 @@ static int sh_mobile_meram_update(struct sh_mobile_meram_info *pdata,
- return 0;
- }
-
-+static int sh_mobile_meram_runtime_suspend(struct device *dev)
-+{
-+ struct platform_device *pdev = to_platform_device(dev);
-+ struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-+ int k, j;
-+
-+ for (k = 0; k < CMN_REGS_SIZE; k++)
-+ priv->cmn_saved_regs[k] = meram_read_reg(priv->base,
-+ common_regs[k]);
-+
-+ for (j = 0; j < 32; j++) {
-+ if (!test_bit(j, &priv->used_icb))
-+ continue;
-+ for (k = 0; k < ICB_REGS_SIZE; k++) {
-+ priv->icb_saved_regs[j * ICB_REGS_SIZE + k] =
-+ meram_read_icb(priv->base, j, icb_regs[k]);
-+ /* Reset ICB on resume */
-+ if (icb_regs[k] == MExxCTL)
-+ priv->icb_saved_regs[j * ICB_REGS_SIZE + k] =
-+ 0x70;
-+ }
-+ }
-+ return 0;
-+}
-+
-+static int sh_mobile_meram_runtime_resume(struct device *dev)
-+{
-+ struct platform_device *pdev = to_platform_device(dev);
-+ struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-+ int k, j;
-+
-+ for (j = 0; j < 32; j++) {
-+ if (!test_bit(j, &priv->used_icb))
-+ continue;
-+ for (k = 0; k < ICB_REGS_SIZE; k++) {
-+ meram_write_icb(priv->base, j, icb_regs[k],
-+ priv->icb_saved_regs[j * ICB_REGS_SIZE + k]);
-+ }
-+ }
-+
-+ for (k = 0; k < CMN_REGS_SIZE; k++)
-+ meram_write_reg(priv->base, common_regs[k],
-+ priv->cmn_saved_regs[k]);
-+ return 0;
-+}
-+
-+static const struct dev_pm_ops sh_mobile_meram_dev_pm_ops = {
-+ .runtime_suspend = sh_mobile_meram_runtime_suspend,
-+ .runtime_resume = sh_mobile_meram_runtime_resume,
-+};
-+
- static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
- .module = THIS_MODULE,
- .meram_register = sh_mobile_meram_register,
-@@ -557,6 +627,7 @@ static struct platform_driver sh_mobile_meram_driver = {
- .driver = {
- .name = "sh_mobile_meram",
- .owner = THIS_MODULE,
-+ .pm = &sh_mobile_meram_dev_pm_ops,
- },
- .probe = sh_mobile_meram_probe,
- .remove = sh_mobile_meram_remove,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0101-drivercore-Add-helper-macro-for-platform_driver-boil.patch b/patches.armadillo800eva/0101-drivercore-Add-helper-macro-for-platform_driver-boil.patch
deleted file mode 100644
index 5600f7a31fadae..00000000000000
--- a/patches.armadillo800eva/0101-drivercore-Add-helper-macro-for-platform_driver-boil.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From 497218122305ec6f9c2db85774b6f3bd2c24fee2 Mon Sep 17 00:00:00 2001
-From: Grant Likely <grant.likely@secretlab.ca>
-Date: Wed, 5 Oct 2011 11:29:49 -0600
-Subject: drivercore: Add helper macro for platform_driver boilerplate
-
-For simple modules that contain a single platform_driver without any
-additional setup code then ends up being a block of duplicated
-boilerplate. This patch adds a new macro, module_platform_driver(),
-which replaces the module_init()/module_exit() registrations with
-template functions.
-
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
-Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
-(cherry picked from commit 940ab88962bc1aff3273a8356d64577a6e386736)
-
-Conflicts:
-
- drivers/spi/spi-altera.c
- drivers/spi/spi-ath79.c
- drivers/spi/spi-atmel.c
- drivers/spi/spi-bfin-sport.c
- drivers/spi/spi-coldfire-qspi.c
- drivers/spi/spi-davinci.c
- drivers/spi/spi-dw-mmio.c
- drivers/spi/spi-ep93xx.c
- drivers/spi/spi-fsl-espi.c
- drivers/spi/spi-gpio.c
- drivers/spi/spi-imx.c
- drivers/spi/spi-mpc512x-psc.c
- drivers/spi/spi-mpc52xx-psc.c
- drivers/spi/spi-mpc52xx.c
- drivers/spi/spi-nuc900.c
- drivers/spi/spi-oc-tiny.c
- drivers/spi/spi-ppc4xx.c
- drivers/spi/spi-s3c24xx.c
- drivers/spi/spi-sh-msiof.c
- drivers/spi/spi-sh-sci.c
- drivers/spi/spi-sh.c
- drivers/spi/spi-stmp.c
- drivers/spi/spi-tegra.c
- drivers/spi/spi-ti-ssp.c
- drivers/spi/spi-xilinx.c
- drivers/tty/serial/of_serial.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/platform_device.h | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
-
-diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
-index ede1a80..279f87d 100644
---- a/include/linux/platform_device.h
-+++ b/include/linux/platform_device.h
-@@ -145,6 +145,23 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data
- dev_set_drvdata(&pdev->dev, data);
- }
-
-+/* module_platform_driver() - Helper macro for drivers that don't do
-+ * anything special in module init/exit. This eliminates a lot of
-+ * boilerplate. Each module may only use this macro once, and
-+ * calling it replaces module_init() and module_exit()
-+ */
-+#define module_platform_driver(__platform_driver) \
-+static int __init __platform_driver##_init(void) \
-+{ \
-+ return platform_driver_register(&(__platform_driver)); \
-+} \
-+module_init(__platform_driver##_init); \
-+static void __exit __platform_driver##_exit(void) \
-+{ \
-+ platform_driver_unregister(&(__platform_driver)); \
-+} \
-+module_exit(__platform_driver##_exit);
-+
- extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
- int (*probe)(struct platform_device *),
- struct resource *res, unsigned int n_res,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0102-drivercore-Generalize-module_platform_driver.patch b/patches.armadillo800eva/0102-drivercore-Generalize-module_platform_driver.patch
deleted file mode 100644
index 20cddbc99d5af8..00000000000000
--- a/patches.armadillo800eva/0102-drivercore-Generalize-module_platform_driver.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 73339a0d323e34694c75f09eaaf21584c3732829 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 16 Nov 2011 10:13:35 +0100
-Subject: drivercore: Generalize module_platform_driver
-
-This patch generalizes the module_platform_driver macro and introduces a new
-module_driver macro. The module_driver macro takes a driver name, a register
-and a unregister function for this driver type. Using these it construct the
-module init and exit sections which register and unregister the driver. Since
-such init/exit sections are commonly found in drivers this macro can be used
-to eliminate a lot of boilerplate code.
-
-The macro is not intended to be used by driver modules directly, instead it
-should be used to generate bus specific macros for registering drivers like
-the module_platform_driver macro.
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-Acked-by: Jonathan Cameron <jic23@kernel.org>
-Acked-by: Wolfram Sang <w.sang@pengutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 907d0ed1c84114d4e8dafd66af982515d3739c90)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/device.h | 21 +++++++++++++++++++++
- include/linux/platform_device.h | 12 ++----------
- 2 files changed, 23 insertions(+), 10 deletions(-)
-
-diff --git a/include/linux/device.h b/include/linux/device.h
-index 0aa0b62..680656e 100644
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -974,4 +974,25 @@ extern long sysfs_deprecated;
- #define sysfs_deprecated 0
- #endif
-
-+/**
-+ * module_driver() - Helper macro for drivers that don't do anything
-+ * special in module init/exit. This eliminates a lot of boilerplate.
-+ * Each module may only use this macro once, and calling it replaces
-+ * module_init() and module_exit().
-+ *
-+ * Use this macro to construct bus specific macros for registering
-+ * drivers, and do not use it on its own.
-+ */
-+#define module_driver(__driver, __register, __unregister) \
-+static int __init __driver##_init(void) \
-+{ \
-+ return __register(&(__driver)); \
-+} \
-+module_init(__driver##_init); \
-+static void __exit __driver##_exit(void) \
-+{ \
-+ __unregister(&(__driver)); \
-+} \
-+module_exit(__driver##_exit);
-+
- #endif /* _DEVICE_H_ */
-diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
-index 279f87d..a72760d 100644
---- a/include/linux/platform_device.h
-+++ b/include/linux/platform_device.h
-@@ -151,16 +151,8 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data
- * calling it replaces module_init() and module_exit()
- */
- #define module_platform_driver(__platform_driver) \
--static int __init __platform_driver##_init(void) \
--{ \
-- return platform_driver_register(&(__platform_driver)); \
--} \
--module_init(__platform_driver##_init); \
--static void __exit __platform_driver##_exit(void) \
--{ \
-- platform_driver_unregister(&(__platform_driver)); \
--} \
--module_exit(__platform_driver##_exit);
-+ module_driver(__platform_driver, platform_driver_register, \
-+ platform_driver_unregister)
-
- extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
- int (*probe)(struct platform_device *),
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0103-fbdev-sh_mobile_lcdc-Turn-dot-clock-on-before-resumi.patch b/patches.armadillo800eva/0103-fbdev-sh_mobile_lcdc-Turn-dot-clock-on-before-resumi.patch
deleted file mode 100644
index 8ce6a317b3f5fc..00000000000000
--- a/patches.armadillo800eva/0103-fbdev-sh_mobile_lcdc-Turn-dot-clock-on-before-resumi.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 08b64fd8ad32aabbe1d838d156b7353518a91f31 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 11 Jul 2011 11:05:49 +0200
-Subject: fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from
- runtime PM
-
-Resuming from runtime PM restores all LCDC registers. If the dot clock
-is off at that time display panning information will be corrupted.
-
-Turn the dot clock on before resuming from runtime PM. Similarly,
-turn the clock off after suspending the LCDC.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-(cherry picked from commit f1ad90da5c0fcb8841cc5e6d66c56f4005d8c960)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 2f921ad..9135159 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -256,9 +256,9 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
- static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
- {
- if (atomic_inc_and_test(&priv->hw_usecnt)) {
-- pm_runtime_get_sync(priv->dev);
- if (priv->dot_clk)
- clk_enable(priv->dot_clk);
-+ pm_runtime_get_sync(priv->dev);
- if (priv->meram_dev && priv->meram_dev->pdev)
- pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
- }
-@@ -267,11 +267,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
- static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
- {
- if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
-- if (priv->dot_clk)
-- clk_disable(priv->dot_clk);
- if (priv->meram_dev && priv->meram_dev->pdev)
- pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
- pm_runtime_put(priv->dev);
-+ if (priv->dot_clk)
-+ clk_disable(priv->dot_clk);
- }
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0104-fbdev-sh_mobile_lcdc-Replace-hardcoded-register-valu.patch b/patches.armadillo800eva/0104-fbdev-sh_mobile_lcdc-Replace-hardcoded-register-valu.patch
deleted file mode 100644
index 520648818de949..00000000000000
--- a/patches.armadillo800eva/0104-fbdev-sh_mobile_lcdc-Replace-hardcoded-register-valu.patch
+++ /dev/null
@@ -1,573 +0,0 @@
-From 627c7703563e65c2b5b3ca339b325af3deee25a0 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Replace hardcoded register values with macros
-
-Instead of hardcoding register values through the driver, define macros
-for individual register bits using the register name and the bit name,
-and use the macros.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit ce1c0b0873bf4e970970a49612105cf6c36d81e3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 204 +++++++++++++++++---------------------
- include/video/sh_mobile_lcdc.h | 135 +++++++++++++++++++++----
- 2 files changed, 209 insertions(+), 130 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 9135159..84504d5 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -32,20 +32,6 @@
- #define SIDE_B_OFFSET 0x1000
- #define MIRROR_OFFSET 0x2000
-
--/* shared registers */
--#define _LDDCKR 0x410
--#define _LDDCKSTPR 0x414
--#define _LDINTR 0x468
--#define _LDSR 0x46c
--#define _LDCNT1R 0x470
--#define _LDCNT2R 0x474
--#define _LDRCNTR 0x478
--#define _LDDDSR 0x47c
--#define _LDDWD0R 0x800
--#define _LDDRDR 0x840
--#define _LDDWAR 0x900
--#define _LDDRAR 0x904
--
- /* shared registers and their order for context save/restore */
- static int lcdc_shared_regs[] = {
- _LDDCKR,
-@@ -98,22 +84,6 @@ static unsigned long lcdc_offs_sublcd[NR_CH_REGS] = {
- [LDPMR] = 0x63c,
- };
-
--#define START_LCDC 0x00000001
--#define LCDC_RESET 0x00000100
--#define DISPLAY_BEU 0x00000008
--#define LCDC_ENABLE 0x00000001
--#define LDINTR_FE 0x00000400
--#define LDINTR_VSE 0x00000200
--#define LDINTR_VEE 0x00000100
--#define LDINTR_FS 0x00000004
--#define LDINTR_VSS 0x00000002
--#define LDINTR_VES 0x00000001
--#define LDRCNTR_SRS 0x00020000
--#define LDRCNTR_SRC 0x00010000
--#define LDRCNTR_MRS 0x00000002
--#define LDRCNTR_MRC 0x00000001
--#define LDSR_MRS 0x00000100
--
- static const struct fb_videomode default_720p = {
- .name = "HDMI 720p",
- .xres = 1280,
-@@ -218,33 +188,36 @@ static void lcdc_sys_write_index(void *handle, unsigned long data)
- {
- struct sh_mobile_lcdc_chan *ch = handle;
-
-- lcdc_write(ch->lcdc, _LDDWD0R, data | 0x10000000);
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-- lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-+ lcdc_write(ch->lcdc, _LDDWD0R, data | LDDWDxR_WDACT);
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
-+ lcdc_write(ch->lcdc, _LDDWAR, LDDWAR_WA |
-+ (lcdc_chan_is_sublcd(ch) ? 2 : 0));
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
- }
-
- static void lcdc_sys_write_data(void *handle, unsigned long data)
- {
- struct sh_mobile_lcdc_chan *ch = handle;
-
-- lcdc_write(ch->lcdc, _LDDWD0R, data | 0x11000000);
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-- lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-+ lcdc_write(ch->lcdc, _LDDWD0R, data | LDDWDxR_WDACT | LDDWDxR_RSW);
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
-+ lcdc_write(ch->lcdc, _LDDWAR, LDDWAR_WA |
-+ (lcdc_chan_is_sublcd(ch) ? 2 : 0));
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
- }
-
- static unsigned long lcdc_sys_read_data(void *handle)
- {
- struct sh_mobile_lcdc_chan *ch = handle;
-
-- lcdc_write(ch->lcdc, _LDDRDR, 0x01000000);
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-- lcdc_write(ch->lcdc, _LDDRAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
-+ lcdc_write(ch->lcdc, _LDDRDR, LDDRDR_RSR);
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
-+ lcdc_write(ch->lcdc, _LDDRAR, LDDRAR_RA |
-+ (lcdc_chan_is_sublcd(ch) ? 2 : 0));
- udelay(1);
-- lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
-+ lcdc_wait_bit(ch->lcdc, _LDSR, LDSR_AS, 0);
-
-- return lcdc_read(ch->lcdc, _LDDRDR) & 0x3ffff;
-+ return lcdc_read(ch->lcdc, _LDDRDR) & LDDRDR_DRD_MASK;
- }
-
- struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
-@@ -323,13 +296,13 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
- if (bcfg->start_transfer)
- bcfg->start_transfer(bcfg->board_data, ch,
- &sh_mobile_lcdc_sys_bus_ops);
-- lcdc_write_chan(ch, LDSM2R, 1);
-+ lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
- } else {
- if (bcfg->start_transfer)
- bcfg->start_transfer(bcfg->board_data, ch,
- &sh_mobile_lcdc_sys_bus_ops);
-- lcdc_write_chan(ch, LDSM2R, 1);
-+ lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- }
- }
-
-@@ -356,11 +329,11 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
- * disable further VSYNC End IRQs, preserve all other enabled IRQs,
- * write 0 to bits 0-6 to ack all triggered IRQs.
- */
-- tmp &= 0xffffff00 & ~LDINTR_VEE;
-+ tmp &= ~LDINTR_STATUS_MASK & ~LDINTR_VEE;
- lcdc_write(priv, _LDINTR, tmp);
-
- /* figure out if this interrupt is for main or sub lcd */
-- is_sub = (lcdc_read(priv, _LDSR) & (1 << 10)) ? 1 : 0;
-+ is_sub = (lcdc_read(priv, _LDSR) & LDSR_MSS) ? 1 : 0;
-
- /* wake up channel and disable clocks */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-@@ -395,16 +368,17 @@ static void sh_mobile_lcdc_start_stop(struct sh_mobile_lcdc_priv *priv,
-
- /* start or stop the lcdc */
- if (start)
-- lcdc_write(priv, _LDCNT2R, tmp | START_LCDC);
-+ lcdc_write(priv, _LDCNT2R, tmp | LDCNT2R_DO);
- else
-- lcdc_write(priv, _LDCNT2R, tmp & ~START_LCDC);
-+ lcdc_write(priv, _LDCNT2R, tmp & ~LDCNT2R_DO);
-
- /* wait until power is applied/stopped on all channels */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++)
- if (lcdc_read(priv, _LDCNT2R) & priv->ch[k].enabled)
- while (1) {
-- tmp = lcdc_read_chan(&priv->ch[k], LDPMR) & 3;
-- if (start && tmp == 3)
-+ tmp = lcdc_read_chan(&priv->ch[k], LDPMR)
-+ & LDPMR_LPS;
-+ if (start && tmp == LDPMR_LPS)
- break;
- if (!start && tmp == 0)
- break;
-@@ -422,13 +396,13 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- u32 tmp;
-
- tmp = ch->ldmt1r_value;
-- tmp |= (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 1 << 28;
-- tmp |= (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 1 << 27;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DWPOL) ? 1 << 26 : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DIPOL) ? 1 << 25 : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DAPOL) ? 1 << 24 : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_HSCNT) ? 1 << 17 : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DWCNT) ? 1 << 16 : 0;
-+ tmp |= (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : LDMT1R_VPOL;
-+ tmp |= (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : LDMT1R_HPOL;
-+ tmp |= (ch->cfg.flags & LCDC_FLAGS_DWPOL) ? LDMT1R_DWPOL : 0;
-+ tmp |= (ch->cfg.flags & LCDC_FLAGS_DIPOL) ? LDMT1R_DIPOL : 0;
-+ tmp |= (ch->cfg.flags & LCDC_FLAGS_DAPOL) ? LDMT1R_DAPOL : 0;
-+ tmp |= (ch->cfg.flags & LCDC_FLAGS_HSCNT) ? LDMT1R_HSCNT : 0;
-+ tmp |= (ch->cfg.flags & LCDC_FLAGS_DWCNT) ? LDMT1R_DWCNT : 0;
- lcdc_write_chan(ch, LDMT1R, tmp);
-
- /* setup SYS bus */
-@@ -486,8 +460,8 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- /* reset */
-- lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) | LCDC_RESET);
-- lcdc_wait_bit(priv, _LDCNT2R, LCDC_RESET, 0);
-+ lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) | LDCNT2R_BR);
-+ lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
-
- /* enable LCDC channels */
- tmp = lcdc_read(priv, _LDCNT2R);
-@@ -496,7 +470,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_write(priv, _LDCNT2R, tmp);
-
- /* read data from external memory, avoid using the BEU for now */
-- lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) & ~DISPLAY_BEU);
-+ lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) & ~LDCNT2R_MD);
-
- /* stop the lcdc first */
- sh_mobile_lcdc_start_stop(priv, 0);
-@@ -514,7 +488,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- continue;
-
- if (m == 1)
-- m = 1 << 6;
-+ m = LDDCKR_MOSEL;
- tmp |= m << (lcdc_chan_is_sublcd(ch) ? 8 : 0);
-
- /* FIXME: sh7724 can only use 42, 48, 54 and 60 for the divider denominator */
-@@ -554,20 +528,21 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- /* word and long word swap */
- ldddsr = lcdc_read(priv, _LDDDSR);
- if (priv->ch[0].info->var.nonstd)
-- lcdc_write(priv, _LDDDSR, ldddsr | 7);
-+ ldddsr |= LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
- else {
- switch (bpp) {
- case 16:
-- lcdc_write(priv, _LDDDSR, ldddsr | 6);
-+ ldddsr |= LDDDSR_LS | LDDDSR_WS;
- break;
- case 24:
-- lcdc_write(priv, _LDDDSR, ldddsr | 7);
-+ ldddsr |= LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
- break;
- case 32:
-- lcdc_write(priv, _LDDDSR, ldddsr | 4);
-+ ldddsr |= LDDDSR_LS;
- break;
- }
- }
-+ lcdc_write(priv, _LDDDSR, ldddsr);
-
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
- unsigned long base_addr_y;
-@@ -580,28 +555,29 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- /* set bpp format in PKF[4:0] */
- tmp = lcdc_read_chan(ch, LDDFR);
-- tmp &= ~0x0003031f;
-+ tmp &= ~(LDDFR_CF0 | LDDFR_CC | LDDFR_YF_MASK | LDDFR_PKF_MASK);
- if (ch->info->var.nonstd) {
- tmp |= (ch->info->var.nonstd << 16);
- switch (ch->info->var.bits_per_pixel) {
- case 12:
- break;
- case 16:
-- tmp |= (0x1 << 8);
-+ tmp |= LDDFR_YF_422;
- break;
- case 24:
-- tmp |= (0x2 << 8);
-+ tmp |= LDDFR_YF_444;
- break;
- }
- } else {
- switch (ch->info->var.bits_per_pixel) {
- case 16:
-- tmp |= 0x03;
-+ tmp |= LDDFR_PKF_RGB16;
- break;
- case 24:
-- tmp |= 0x0b;
-+ tmp |= LDDFR_PKF_RGB24;
- break;
- case 32:
-+ tmp |= LDDFR_PKF_ARGB32;
- break;
- }
- }
-@@ -672,14 +648,14 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- /* setup deferred io if SYS bus */
- tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
-- if (ch->ldmt1r_value & (1 << 12) && tmp) {
-+ if (ch->ldmt1r_value & LDMT1R_IFM && tmp) {
- ch->defio.deferred_io = sh_mobile_lcdc_deferred_io;
- ch->defio.delay = msecs_to_jiffies(tmp);
- ch->info->fbdefio = &ch->defio;
- fb_deferred_io_init(ch->info);
-
- /* one-shot mode */
-- lcdc_write_chan(ch, LDSM1R, 1);
-+ lcdc_write_chan(ch, LDSM1R, LDSM1R_OS);
-
- /* enable "Frame End Interrupt Enable" bit */
- lcdc_write(priv, _LDINTR, LDINTR_FE);
-@@ -691,7 +667,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- /* display output */
-- lcdc_write(priv, _LDCNT1R, LCDC_ENABLE);
-+ lcdc_write(priv, _LDCNT1R, LDCNT1R_DE);
-
- /* start the lcdc */
- sh_mobile_lcdc_start_stop(priv, 1);
-@@ -780,42 +756,42 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
-
- static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
- {
-- int ifm, miftyp;
--
-- switch (ch->cfg.interface_type) {
-- case RGB8: ifm = 0; miftyp = 0; break;
-- case RGB9: ifm = 0; miftyp = 4; break;
-- case RGB12A: ifm = 0; miftyp = 5; break;
-- case RGB12B: ifm = 0; miftyp = 6; break;
-- case RGB16: ifm = 0; miftyp = 7; break;
-- case RGB18: ifm = 0; miftyp = 10; break;
-- case RGB24: ifm = 0; miftyp = 11; break;
-- case SYS8A: ifm = 1; miftyp = 0; break;
-- case SYS8B: ifm = 1; miftyp = 1; break;
-- case SYS8C: ifm = 1; miftyp = 2; break;
-- case SYS8D: ifm = 1; miftyp = 3; break;
-- case SYS9: ifm = 1; miftyp = 4; break;
-- case SYS12: ifm = 1; miftyp = 5; break;
-- case SYS16A: ifm = 1; miftyp = 7; break;
-- case SYS16B: ifm = 1; miftyp = 8; break;
-- case SYS16C: ifm = 1; miftyp = 9; break;
-- case SYS18: ifm = 1; miftyp = 10; break;
-- case SYS24: ifm = 1; miftyp = 11; break;
-- default: goto bad;
-+ int interface_type = ch->cfg.interface_type;
-+
-+ switch (interface_type) {
-+ case RGB8:
-+ case RGB9:
-+ case RGB12A:
-+ case RGB12B:
-+ case RGB16:
-+ case RGB18:
-+ case RGB24:
-+ case SYS8A:
-+ case SYS8B:
-+ case SYS8C:
-+ case SYS8D:
-+ case SYS9:
-+ case SYS12:
-+ case SYS16A:
-+ case SYS16B:
-+ case SYS16C:
-+ case SYS18:
-+ case SYS24:
-+ break;
-+ default:
-+ return -EINVAL;
- }
-
- /* SUBLCD only supports SYS interface */
- if (lcdc_chan_is_sublcd(ch)) {
-- if (ifm == 0)
-- goto bad;
-- else
-- ifm = 0;
-+ if (!(interface_type & LDMT1R_IFM))
-+ return -EINVAL;
-+
-+ interface_type &= ~LDMT1R_IFM;
- }
-
-- ch->ldmt1r_value = (ifm << 12) | miftyp;
-+ ch->ldmt1r_value = interface_type;
- return 0;
-- bad:
-- return -EINVAL;
- }
-
- static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
-@@ -823,18 +799,24 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
- struct sh_mobile_lcdc_priv *priv)
- {
- char *str;
-- int icksel;
-
- switch (clock_source) {
-- case LCDC_CLK_BUS: str = "bus_clk"; icksel = 0; break;
-- case LCDC_CLK_PERIPHERAL: str = "peripheral_clk"; icksel = 1; break;
-- case LCDC_CLK_EXTERNAL: str = NULL; icksel = 2; break;
-+ case LCDC_CLK_BUS:
-+ str = "bus_clk";
-+ priv->lddckr = LDDCKR_ICKSEL_BUS;
-+ break;
-+ case LCDC_CLK_PERIPHERAL:
-+ str = "peripheral_clk";
-+ priv->lddckr = LDDCKR_ICKSEL_MIPI;
-+ break;
-+ case LCDC_CLK_EXTERNAL:
-+ str = NULL;
-+ priv->lddckr = LDDCKR_ICKSEL_HDMI;
-+ break;
- default:
- return -EINVAL;
- }
-
-- priv->lddckr = icksel << 16;
--
- if (str) {
- priv->dot_clk = clk_get(&pdev->dev, str);
- if (IS_ERR(priv->dot_clk)) {
-@@ -1476,12 +1458,12 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-
- switch (pdata->ch[i].chan) {
- case LCDC_CHAN_MAINLCD:
-- ch->enabled = 1 << 1;
-+ ch->enabled = LDCNT2R_ME;
- ch->reg_offs = lcdc_offs_mainlcd;
- j++;
- break;
- case LCDC_CHAN_SUBLCD:
-- ch->enabled = 1 << 2;
-+ ch->enabled = LDCNT2R_SE;
- ch->reg_offs = lcdc_offs_sublcd;
- j++;
- break;
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index d964e68..8101b72 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -4,26 +4,123 @@
- #include <linux/fb.h>
- #include <video/sh_mobile_meram.h>
-
-+/* Register definitions */
-+#define _LDDCKR 0x410
-+#define LDDCKR_ICKSEL_BUS (0 << 16)
-+#define LDDCKR_ICKSEL_MIPI (1 << 16)
-+#define LDDCKR_ICKSEL_HDMI (2 << 16)
-+#define LDDCKR_ICKSEL_EXT (3 << 16)
-+#define LDDCKR_ICKSEL_MASK (7 << 16)
-+#define LDDCKR_MOSEL (1 << 6)
-+#define _LDDCKSTPR 0x414
-+#define _LDINTR 0x468
-+#define LDINTR_FE (1 << 10)
-+#define LDINTR_VSE (1 << 9)
-+#define LDINTR_VEE (1 << 8)
-+#define LDINTR_FS (1 << 2)
-+#define LDINTR_VSS (1 << 1)
-+#define LDINTR_VES (1 << 0)
-+#define LDINTR_STATUS_MASK (0xff << 0)
-+#define _LDSR 0x46c
-+#define LDSR_MSS (1 << 10)
-+#define LDSR_MRS (1 << 8)
-+#define LDSR_AS (1 << 1)
-+#define _LDCNT1R 0x470
-+#define LDCNT1R_DE (1 << 0)
-+#define _LDCNT2R 0x474
-+#define LDCNT2R_BR (1 << 8)
-+#define LDCNT2R_MD (1 << 3)
-+#define LDCNT2R_SE (1 << 2)
-+#define LDCNT2R_ME (1 << 1)
-+#define LDCNT2R_DO (1 << 0)
-+#define _LDRCNTR 0x478
-+#define LDRCNTR_SRS (1 << 17)
-+#define LDRCNTR_SRC (1 << 16)
-+#define LDRCNTR_MRS (1 << 1)
-+#define LDRCNTR_MRC (1 << 0)
-+#define _LDDDSR 0x47c
-+#define LDDDSR_LS (1 << 2)
-+#define LDDDSR_WS (1 << 1)
-+#define LDDDSR_BS (1 << 0)
-+
-+#define LDMT1R_VPOL (1 << 28)
-+#define LDMT1R_HPOL (1 << 27)
-+#define LDMT1R_DWPOL (1 << 26)
-+#define LDMT1R_DIPOL (1 << 25)
-+#define LDMT1R_DAPOL (1 << 24)
-+#define LDMT1R_HSCNT (1 << 17)
-+#define LDMT1R_DWCNT (1 << 16)
-+#define LDMT1R_IFM (1 << 12)
-+#define LDMT1R_MIFTYP_RGB8 (0x0 << 0)
-+#define LDMT1R_MIFTYP_RGB9 (0x4 << 0)
-+#define LDMT1R_MIFTYP_RGB12A (0x5 << 0)
-+#define LDMT1R_MIFTYP_RGB12B (0x6 << 0)
-+#define LDMT1R_MIFTYP_RGB16 (0x7 << 0)
-+#define LDMT1R_MIFTYP_RGB18 (0xa << 0)
-+#define LDMT1R_MIFTYP_RGB24 (0xb << 0)
-+#define LDMT1R_MIFTYP_YCBCR (0xf << 0)
-+#define LDMT1R_MIFTYP_SYS8A (0x0 << 0)
-+#define LDMT1R_MIFTYP_SYS8B (0x1 << 0)
-+#define LDMT1R_MIFTYP_SYS8C (0x2 << 0)
-+#define LDMT1R_MIFTYP_SYS8D (0x3 << 0)
-+#define LDMT1R_MIFTYP_SYS9 (0x4 << 0)
-+#define LDMT1R_MIFTYP_SYS12 (0x5 << 0)
-+#define LDMT1R_MIFTYP_SYS16A (0x7 << 0)
-+#define LDMT1R_MIFTYP_SYS16B (0x8 << 0)
-+#define LDMT1R_MIFTYP_SYS16C (0x9 << 0)
-+#define LDMT1R_MIFTYP_SYS18 (0xa << 0)
-+#define LDMT1R_MIFTYP_SYS24 (0xb << 0)
-+#define LDMT1R_MIFTYP_MASK (0xf << 0)
-+
-+#define LDDFR_CF1 (1 << 18)
-+#define LDDFR_CF0 (1 << 17)
-+#define LDDFR_CC (1 << 16)
-+#define LDDFR_YF_420 (0 << 8)
-+#define LDDFR_YF_422 (1 << 8)
-+#define LDDFR_YF_444 (2 << 8)
-+#define LDDFR_YF_MASK (3 << 8)
-+#define LDDFR_PKF_ARGB32 (0x00 << 0)
-+#define LDDFR_PKF_RGB16 (0x03 << 0)
-+#define LDDFR_PKF_RGB24 (0x0b << 0)
-+#define LDDFR_PKF_MASK (0x1f << 0)
-+
-+#define LDSM1R_OS (1 << 0)
-+
-+#define LDSM2R_OSTRG (1 << 0)
-+
-+#define LDPMR_LPS (3 << 0)
-+
-+#define _LDDWD0R 0x800
-+#define LDDWDxR_WDACT (1 << 28)
-+#define LDDWDxR_RSW (1 << 24)
-+#define _LDDRDR 0x840
-+#define LDDRDR_RSR (1 << 24)
-+#define LDDRDR_DRD_MASK (0x3ffff << 0)
-+#define _LDDWAR 0x900
-+#define LDDWAR_WA (1 << 0)
-+#define _LDDRAR 0x904
-+#define LDDRAR_RA (1 << 0)
-+
- enum {
-- RGB8, /* 24bpp, 8:8:8 */
-- RGB9, /* 18bpp, 9:9 */
-- RGB12A, /* 24bpp, 12:12 */
-- RGB12B, /* 12bpp */
-- RGB16, /* 16bpp */
-- RGB18, /* 18bpp */
-- RGB24, /* 24bpp */
-- YUV422, /* 16bpp */
-- SYS8A, /* 24bpp, 8:8:8 */
-- SYS8B, /* 18bpp, 8:8:2 */
-- SYS8C, /* 18bpp, 2:8:8 */
-- SYS8D, /* 16bpp, 8:8 */
-- SYS9, /* 18bpp, 9:9 */
-- SYS12, /* 24bpp, 12:12 */
-- SYS16A, /* 16bpp */
-- SYS16B, /* 18bpp, 16:2 */
-- SYS16C, /* 18bpp, 2:16 */
-- SYS18, /* 18bpp */
-- SYS24, /* 24bpp */
-+ RGB8 = LDMT1R_MIFTYP_RGB8, /* 24bpp, 8:8:8 */
-+ RGB9 = LDMT1R_MIFTYP_RGB9, /* 18bpp, 9:9 */
-+ RGB12A = LDMT1R_MIFTYP_RGB12A, /* 24bpp, 12:12 */
-+ RGB12B = LDMT1R_MIFTYP_RGB12B, /* 12bpp */
-+ RGB16 = LDMT1R_MIFTYP_RGB16, /* 16bpp */
-+ RGB18 = LDMT1R_MIFTYP_RGB18, /* 18bpp */
-+ RGB24 = LDMT1R_MIFTYP_RGB24, /* 24bpp */
-+ YUV422 = LDMT1R_MIFTYP_YCBCR, /* 16bpp */
-+ SYS8A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8A, /* 24bpp, 8:8:8 */
-+ SYS8B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8B, /* 18bpp, 8:8:2 */
-+ SYS8C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8C, /* 18bpp, 2:8:8 */
-+ SYS8D = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8D, /* 16bpp, 8:8 */
-+ SYS9 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS9, /* 18bpp, 9:9 */
-+ SYS12 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS12, /* 24bpp, 12:12 */
-+ SYS16A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16A, /* 16bpp */
-+ SYS16B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16B, /* 18bpp, 16:2 */
-+ SYS16C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16C, /* 18bpp, 2:16 */
-+ SYS18 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS18, /* 18bpp */
-+ SYS24 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS24, /* 24bpp */
- };
-
- enum { LCDC_CHAN_DISABLED = 0,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0105-fbdev-sh_mobile_lcdc-Don-t-acknowlege-interrupts-uni.patch b/patches.armadillo800eva/0105-fbdev-sh_mobile_lcdc-Don-t-acknowlege-interrupts-uni.patch
deleted file mode 100644
index 607aea7c66d275..00000000000000
--- a/patches.armadillo800eva/0105-fbdev-sh_mobile_lcdc-Don-t-acknowlege-interrupts-uni.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From c28345871c5662edc793e88be1d57a259cb86391 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Don't acknowlege interrupts unintentionally
-
-The LDINTR register caries both interrupt enable and interrupt status
-bits. When setting or clearing interrupt enable bits, write all status
-bits to 1 to avoid acknowledging interrupts by mistake.
-
-When acknowledging interrupts, write 1 to all non-triggered interrupt
-bits to avoid losing interrupts.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit dc48665fae5aa360e80dfdb2d6cab4fa58b27ee4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 20 ++++++++------------
- 1 file changed, 8 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 84504d5..99656f5 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -318,19 +318,13 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
- {
- struct sh_mobile_lcdc_priv *priv = data;
- struct sh_mobile_lcdc_chan *ch;
-- unsigned long tmp;
- unsigned long ldintr;
- int is_sub;
- int k;
-
-- /* acknowledge interrupt */
-- ldintr = tmp = lcdc_read(priv, _LDINTR);
-- /*
-- * disable further VSYNC End IRQs, preserve all other enabled IRQs,
-- * write 0 to bits 0-6 to ack all triggered IRQs.
-- */
-- tmp &= ~LDINTR_STATUS_MASK & ~LDINTR_VEE;
-- lcdc_write(priv, _LDINTR, tmp);
-+ /* Acknowledge interrupts and disable further VSYNC End IRQs. */
-+ ldintr = lcdc_read(priv, _LDINTR);
-+ lcdc_write(priv, _LDINTR, (ldintr ^ LDINTR_STATUS_MASK) & ~LDINTR_VEE);
-
- /* figure out if this interrupt is for main or sub lcd */
- is_sub = (lcdc_read(priv, _LDSR) & LDSR_MSS) ? 1 : 0;
-@@ -342,7 +336,7 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
- if (!ch->enabled)
- continue;
-
-- /* Frame Start */
-+ /* Frame End */
- if (ldintr & LDINTR_FS) {
- if (is_sub == lcdc_chan_is_sublcd(ch)) {
- ch->frame_end = 1;
-@@ -971,9 +965,11 @@ static int sh_mobile_wait_for_vsync(struct fb_info *info)
- unsigned long ldintr;
- int ret;
-
-- /* Enable VSync End interrupt */
-+ /* Enable VSync End interrupt and be careful not to acknowledge any
-+ * pending interrupt.
-+ */
- ldintr = lcdc_read(ch->lcdc, _LDINTR);
-- ldintr |= LDINTR_VEE;
-+ ldintr |= LDINTR_VEE | LDINTR_STATUS_MASK;
- lcdc_write(ch->lcdc, _LDINTR, ldintr);
-
- ret = wait_for_completion_interruptible_timeout(&ch->vsync_completion,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0106-fbdev-sh_mobile_lcdc-Compute-clock-pattern-using-div.patch b/patches.armadillo800eva/0106-fbdev-sh_mobile_lcdc-Compute-clock-pattern-using-div.patch
deleted file mode 100644
index c07a77c544326a..00000000000000
--- a/patches.armadillo800eva/0106-fbdev-sh_mobile_lcdc-Compute-clock-pattern-using-div.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 6bb3f4d8de6da233738c058f3fb0016fffd5d81b Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Compute clock pattern using divider
- denominator
-
-The clock divider pattern is computed based on the dot clock register
-value which stores the divider denumerator. However, when using a 1:1
-divider ratio, the register is programmed with a value that must not be
-interpreted as a denominator. This results in a shift left operation
-with a value of 32, which produces undefined behaviour.
-
-Compute the clock pattern using the divider denominator, not the dot
-clock register value.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 505c7de51fe5ebb81fac096cb8cebd7cb45b7955)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 99656f5..2d935db 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -481,13 +481,15 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- if (!m)
- continue;
-
-+ /* FIXME: sh7724 can only use 42, 48, 54 and 60 for the divider
-+ * denominator.
-+ */
-+ lcdc_write_chan(ch, LDDCKPAT1R, 0);
-+ lcdc_write_chan(ch, LDDCKPAT2R, (1 << (m/2)) - 1);
-+
- if (m == 1)
- m = LDDCKR_MOSEL;
- tmp |= m << (lcdc_chan_is_sublcd(ch) ? 8 : 0);
--
-- /* FIXME: sh7724 can only use 42, 48, 54 and 60 for the divider denominator */
-- lcdc_write_chan(ch, LDDCKPAT1R, 0);
-- lcdc_write_chan(ch, LDDCKPAT2R, (1 << (m/2)) - 1);
- }
-
- lcdc_write(priv, _LDDCKR, tmp);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0107-fbdev-sh_mobile_lcdc-Split-LCDC-start-code-from-sh_m.patch b/patches.armadillo800eva/0107-fbdev-sh_mobile_lcdc-Split-LCDC-start-code-from-sh_m.patch
deleted file mode 100644
index b157c59059102e..00000000000000
--- a/patches.armadillo800eva/0107-fbdev-sh_mobile_lcdc-Split-LCDC-start-code-from-sh_m.patch
+++ /dev/null
@@ -1,443 +0,0 @@
-From 10c7583e1d260cb9e66c6060c4c7608e317353a4 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Split LCDC start code from
- sh_mobile_lcdc_start
-
-Splitting the LCDC start code from clock, MERAM and panel management
-will make the code usable by runtime PM.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 9a217e3444ec0c3a0dba35f7b4221af6671da67b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 309 +++++++++++++++++++-------------------
- drivers/video/sh_mobile_lcdcfb.h | 11 ++
- 2 files changed, 162 insertions(+), 158 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 2d935db..292cfc0 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -435,48 +435,42 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- lcdc_write_chan(ch, LDHAJR, tmp);
- }
-
--static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-+/*
-+ * __sh_mobile_lcdc_start - Configure and tart the LCDC
-+ * @priv: LCDC device
-+ *
-+ * Configure all enabled channels and start the LCDC device. All external
-+ * devices (clocks, MERAM, panels, ...) are not touched by this function.
-+ */
-+static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- {
- struct sh_mobile_lcdc_chan *ch;
-- struct sh_mobile_lcdc_board_cfg *board_cfg;
- unsigned long tmp;
- int bpp = 0;
-- unsigned long ldddsr;
-- int k, m, ret;
-+ int k, m;
-
-- /* enable clocks before accessing the hardware */
-- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- if (priv->ch[k].enabled) {
-- sh_mobile_lcdc_clk_on(priv);
-- if (!bpp)
-- bpp = priv->ch[k].info->var.bits_per_pixel;
-- }
-- }
--
-- /* reset */
-- lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) | LDCNT2R_BR);
-- lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
--
-- /* enable LCDC channels */
-- tmp = lcdc_read(priv, _LDCNT2R);
-- tmp |= priv->ch[0].enabled;
-- tmp |= priv->ch[1].enabled;
-- lcdc_write(priv, _LDCNT2R, tmp);
--
-- /* read data from external memory, avoid using the BEU for now */
-- lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) & ~LDCNT2R_MD);
-+ /* Enable LCDC channels. Read data from external memory, avoid using the
-+ * BEU for now.
-+ */
-+ lcdc_write(priv, _LDCNT2R, priv->ch[0].enabled | priv->ch[1].enabled);
-
-- /* stop the lcdc first */
-+ /* Stop the LCDC first and disable all interrupts. */
- sh_mobile_lcdc_start_stop(priv, 0);
-+ lcdc_write(priv, _LDINTR, 0);
-
-- /* configure clocks */
-+ /* Configure power supply, dot clocks and start them. */
- tmp = priv->lddckr;
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
- ch = &priv->ch[k];
--
-- if (!priv->ch[k].enabled)
-+ if (!ch->enabled)
- continue;
-
-+ if (!bpp)
-+ bpp = ch->info->var.bits_per_pixel;
-+
-+ /* Power supply */
-+ lcdc_write_chan(ch, LDPMR, 0);
-+
- m = ch->cfg.clock_divider;
- if (!m)
- continue;
-@@ -493,188 +487,187 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- lcdc_write(priv, _LDDCKR, tmp);
--
-- /* start dotclock again */
- lcdc_write(priv, _LDDCKSTPR, 0);
- lcdc_wait_bit(priv, _LDDCKSTPR, ~0, 0);
-
-- /* interrupts are disabled to begin with */
-- lcdc_write(priv, _LDINTR, 0);
--
-+ /* Setup geometry, format, frame buffer memory and operation mode. */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
- ch = &priv->ch[k];
--
- if (!ch->enabled)
- continue;
-
- sh_mobile_lcdc_geometry(ch);
-
-- /* power supply */
-- lcdc_write_chan(ch, LDPMR, 0);
--
-- board_cfg = &ch->cfg.board_cfg;
-- if (board_cfg->setup_sys) {
-- ret = board_cfg->setup_sys(board_cfg->board_data,
-- ch, &sh_mobile_lcdc_sys_bus_ops);
-- if (ret)
-- return ret;
-- }
-- }
--
-- /* word and long word swap */
-- ldddsr = lcdc_read(priv, _LDDDSR);
-- if (priv->ch[0].info->var.nonstd)
-- ldddsr |= LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-- else {
-- switch (bpp) {
-- case 16:
-- ldddsr |= LDDDSR_LS | LDDDSR_WS;
-- break;
-- case 24:
-- ldddsr |= LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-- break;
-- case 32:
-- ldddsr |= LDDDSR_LS;
-- break;
-- }
-- }
-- lcdc_write(priv, _LDDDSR, ldddsr);
--
-- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- unsigned long base_addr_y;
-- unsigned long base_addr_c = 0;
-- int pitch;
-- ch = &priv->ch[k];
--
-- if (!priv->ch[k].enabled)
-- continue;
--
-- /* set bpp format in PKF[4:0] */
-- tmp = lcdc_read_chan(ch, LDDFR);
-- tmp &= ~(LDDFR_CF0 | LDDFR_CC | LDDFR_YF_MASK | LDDFR_PKF_MASK);
- if (ch->info->var.nonstd) {
-- tmp |= (ch->info->var.nonstd << 16);
-+ tmp = (ch->info->var.nonstd << 16);
- switch (ch->info->var.bits_per_pixel) {
- case 12:
-+ tmp |= LDDFR_YF_420;
- break;
- case 16:
- tmp |= LDDFR_YF_422;
- break;
- case 24:
-+ default:
- tmp |= LDDFR_YF_444;
- break;
- }
- } else {
- switch (ch->info->var.bits_per_pixel) {
- case 16:
-- tmp |= LDDFR_PKF_RGB16;
-+ tmp = LDDFR_PKF_RGB16;
- break;
- case 24:
-- tmp |= LDDFR_PKF_RGB24;
-+ tmp = LDDFR_PKF_RGB24;
- break;
- case 32:
-- tmp |= LDDFR_PKF_ARGB32;
-+ default:
-+ tmp = LDDFR_PKF_ARGB32;
- break;
- }
- }
-+
- lcdc_write_chan(ch, LDDFR, tmp);
-+ lcdc_write_chan(ch, LDMLSR, ch->pitch);
-+ lcdc_write_chan(ch, LDSA1R, ch->base_addr_y);
-+ if (ch->info->var.nonstd)
-+ lcdc_write_chan(ch, LDSA2R, ch->base_addr_c);
-
-- base_addr_y = ch->info->fix.smem_start;
-- base_addr_c = base_addr_y +
-- ch->info->var.xres *
-- ch->info->var.yres_virtual;
-- pitch = ch->info->fix.line_length;
-+ /* When using deferred I/O mode, configure the LCDC for one-shot
-+ * operation and enable the frame end interrupt. Otherwise use
-+ * continuous read mode.
-+ */
-+ if (ch->ldmt1r_value & LDMT1R_IFM &&
-+ ch->cfg.sys_bus_cfg.deferred_io_msec) {
-+ lcdc_write_chan(ch, LDSM1R, LDSM1R_OS);
-+ lcdc_write(priv, _LDINTR, LDINTR_FE);
-+ } else {
-+ lcdc_write_chan(ch, LDSM1R, 0);
-+ }
-+ }
-
-- /* test if we can enable meram */
-- if (ch->cfg.meram_cfg && priv->meram_dev &&
-- priv->meram_dev->ops) {
-- struct sh_mobile_meram_cfg *cfg;
-- struct sh_mobile_meram_info *mdev;
-- unsigned long icb_addr_y, icb_addr_c;
-- int icb_pitch;
-- int pf;
-+ /* Word and long word swap. */
-+ if (priv->ch[0].info->var.nonstd)
-+ tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-+ else {
-+ switch (bpp) {
-+ case 16:
-+ tmp = LDDDSR_LS | LDDDSR_WS;
-+ break;
-+ case 24:
-+ tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-+ break;
-+ case 32:
-+ default:
-+ tmp = LDDDSR_LS;
-+ break;
-+ }
-+ }
-+ lcdc_write(priv, _LDDDSR, tmp);
-
-- cfg = ch->cfg.meram_cfg;
-- mdev = priv->meram_dev;
-- /* we need to de-init configured ICBs before we
-- * we can re-initialize them.
-- */
-- if (ch->meram_enabled)
-- mdev->ops->meram_unregister(mdev, cfg);
-+ /* Enable the display output. */
-+ lcdc_write(priv, _LDCNT1R, LDCNT1R_DE);
-+ sh_mobile_lcdc_start_stop(priv, 1);
-+ priv->started = 1;
-+}
-
-- ch->meram_enabled = 0;
-+static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-+{
-+ struct sh_mobile_meram_info *mdev = priv->meram_dev;
-+ struct sh_mobile_lcdc_board_cfg *board_cfg;
-+ struct sh_mobile_lcdc_chan *ch;
-+ unsigned long tmp;
-+ int ret;
-+ int k;
-
-- if (ch->info->var.nonstd) {
-- if (ch->info->var.bits_per_pixel == 24)
-- pf = SH_MOBILE_MERAM_PF_NV24;
-- else
-- pf = SH_MOBILE_MERAM_PF_NV;
-- } else {
-- pf = SH_MOBILE_MERAM_PF_RGB;
-- }
-+ /* enable clocks before accessing the hardware */
-+ for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-+ if (priv->ch[k].enabled)
-+ sh_mobile_lcdc_clk_on(priv);
-+ }
-
-- ret = mdev->ops->meram_register(mdev, cfg, pitch,
-- ch->info->var.yres,
-- pf,
-- base_addr_y,
-- base_addr_c,
-- &icb_addr_y,
-- &icb_addr_c,
-- &icb_pitch);
-- if (!ret) {
-- /* set LDSA1R value */
-- base_addr_y = icb_addr_y;
-- pitch = icb_pitch;
--
-- /* set LDSA2R value if required */
-- if (base_addr_c)
-- base_addr_c = icb_addr_c;
--
-- ch->meram_enabled = 1;
-- }
-- }
-+ /* reset */
-+ lcdc_write(priv, _LDCNT2R, lcdc_read(priv, _LDCNT2R) | LDCNT2R_BR);
-+ lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
-
-- /* point out our frame buffer */
-- lcdc_write_chan(ch, LDSA1R, base_addr_y);
-- if (ch->info->var.nonstd)
-- lcdc_write_chan(ch, LDSA2R, base_addr_c);
-+ for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-+ ch = &priv->ch[k];
-
-- /* set line size */
-- lcdc_write_chan(ch, LDMLSR, pitch);
-+ if (!ch->enabled)
-+ continue;
-
-- /* setup deferred io if SYS bus */
-- tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
-- if (ch->ldmt1r_value & LDMT1R_IFM && tmp) {
-- ch->defio.deferred_io = sh_mobile_lcdc_deferred_io;
-- ch->defio.delay = msecs_to_jiffies(tmp);
-- ch->info->fbdefio = &ch->defio;
-- fb_deferred_io_init(ch->info);
-+ board_cfg = &ch->cfg.board_cfg;
-+ if (board_cfg->setup_sys) {
-+ ret = board_cfg->setup_sys(board_cfg->board_data, ch,
-+ &sh_mobile_lcdc_sys_bus_ops);
-+ if (ret)
-+ return ret;
-+ }
-+ }
-
-- /* one-shot mode */
-- lcdc_write_chan(ch, LDSM1R, LDSM1R_OS);
-+ /* Compute frame buffer base address and pitch for each channel. */
-+ for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-+ struct sh_mobile_meram_cfg *cfg;
-+ int pixelformat;
-
-- /* enable "Frame End Interrupt Enable" bit */
-- lcdc_write(priv, _LDINTR, LDINTR_FE);
-+ ch = &priv->ch[k];
-+ if (!ch->enabled)
-+ continue;
-
-- } else {
-- /* continuous read mode */
-- lcdc_write_chan(ch, LDSM1R, 0);
-+ ch->base_addr_y = ch->info->fix.smem_start;
-+ ch->base_addr_c = ch->base_addr_y
-+ + ch->info->var.xres
-+ * ch->info->var.yres_virtual;
-+ ch->pitch = ch->info->fix.line_length;
-+
-+ /* Enable MERAM if possible. */
-+ cfg = ch->cfg.meram_cfg;
-+ if (mdev == NULL || mdev->ops == NULL || cfg == NULL)
-+ continue;
-+
-+ /* we need to de-init configured ICBs before we can
-+ * re-initialize them.
-+ */
-+ if (ch->meram_enabled) {
-+ mdev->ops->meram_unregister(mdev, cfg);
-+ ch->meram_enabled = 0;
- }
-- }
-
-- /* display output */
-- lcdc_write(priv, _LDCNT1R, LDCNT1R_DE);
-+ if (!ch->info->var.nonstd)
-+ pixelformat = SH_MOBILE_MERAM_PF_RGB;
-+ else if (ch->info->var.bits_per_pixel == 24)
-+ pixelformat = SH_MOBILE_MERAM_PF_NV24;
-+ else
-+ pixelformat = SH_MOBILE_MERAM_PF_NV;
-+
-+ ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
-+ ch->info->var.yres, pixelformat,
-+ ch->base_addr_y, ch->base_addr_c,
-+ &ch->base_addr_y, &ch->base_addr_c,
-+ &ch->pitch);
-+ if (!ret)
-+ ch->meram_enabled = 1;
-+ }
-
-- /* start the lcdc */
-- sh_mobile_lcdc_start_stop(priv, 1);
-- priv->started = 1;
-+ /* Start the LCDC. */
-+ __sh_mobile_lcdc_start(priv);
-
-- /* tell the board code to enable the panel */
-+ /* Setup deferred I/O, tell the board code to enable the panels, and
-+ * turn backlight on.
-+ */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
- ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
-+ tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
-+ if (ch->ldmt1r_value & LDMT1R_IFM && tmp) {
-+ ch->defio.deferred_io = sh_mobile_lcdc_deferred_io;
-+ ch->defio.delay = msecs_to_jiffies(tmp);
-+ ch->info->fbdefio = &ch->defio;
-+ fb_deferred_io_init(ch->info);
-+ }
-+
- board_cfg = &ch->cfg.board_cfg;
- if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
- board_cfg->display_on(board_cfg->board_data, ch->info);
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index aeed668..a06219b 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -18,6 +18,13 @@ struct sh_mobile_lcdc_priv;
- struct fb_info;
- struct backlight_device;
-
-+/*
-+ * struct sh_mobile_lcdc_chan - LCDC display channel
-+ *
-+ * @base_addr_y: Frame buffer viewport base address (luma component)
-+ * @base_addr_c: Frame buffer viewport base address (chroma component)
-+ * @pitch: Frame buffer line pitch
-+ */
- struct sh_mobile_lcdc_chan {
- struct sh_mobile_lcdc_priv *lcdc;
- unsigned long *reg_offs;
-@@ -40,6 +47,10 @@ struct sh_mobile_lcdc_chan {
- int blank_status;
- struct mutex open_lock; /* protects the use counter */
- int meram_enabled;
-+
-+ unsigned long base_addr_y;
-+ unsigned long base_addr_c;
-+ unsigned int pitch;
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0108-fbdev-sh_mobile_lcdc-Store-the-frame-buffer-base-add.patch b/patches.armadillo800eva/0108-fbdev-sh_mobile_lcdc-Store-the-frame-buffer-base-add.patch
deleted file mode 100644
index dabd84d33aa510..00000000000000
--- a/patches.armadillo800eva/0108-fbdev-sh_mobile_lcdc-Store-the-frame-buffer-base-add.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From c751b099194544ec0ff1e0e12a8a0b5afd14c8a9 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Store the frame buffer base address when
- panning
-
-When the frame buffer base address is changed by a panning operation,
-store it in the channel structure. It will be reused when runtime PM
-code will use __sh_mobile_lcdc_start().
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 49d79ba2e39b5d3346e9e3ddf894eda72c743c85)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 22 +++++++++-------------
- 1 file changed, 9 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 292cfc0..69c267a 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -915,32 +915,28 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- base_addr_c += 2 * var->xoffset;
- else
- base_addr_c += var->xoffset;
-- } else
-- base_addr_c = 0;
-+ }
-
-- if (!ch->meram_enabled) {
-- lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
-- if (base_addr_c)
-- lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
-- } else {
-+ if (ch->meram_enabled) {
- struct sh_mobile_meram_cfg *cfg;
- struct sh_mobile_meram_info *mdev;
-- unsigned long icb_addr_y, icb_addr_c;
- int ret;
-
- cfg = ch->cfg.meram_cfg;
- mdev = priv->meram_dev;
- ret = mdev->ops->meram_update(mdev, cfg,
- base_addr_y, base_addr_c,
-- &icb_addr_y, &icb_addr_c);
-+ &base_addr_y, &base_addr_c);
- if (ret)
- return ret;
-+ }
-
-- lcdc_write_chan_mirror(ch, LDSA1R, icb_addr_y);
-- if (icb_addr_c)
-- lcdc_write_chan_mirror(ch, LDSA2R, icb_addr_c);
-+ ch->base_addr_y = base_addr_y;
-+ ch->base_addr_c = base_addr_c;
-
-- }
-+ lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
-+ if (var->nonstd)
-+ lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
-
- if (lcdc_chan_is_sublcd(ch))
- lcdc_write(ch->lcdc, _LDRCNTR, ldrcntr ^ LDRCNTR_SRS);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0109-fbdev-sh_mobile_lcdc-Restart-LCDC-in-runtime-PM-resu.patch b/patches.armadillo800eva/0109-fbdev-sh_mobile_lcdc-Restart-LCDC-in-runtime-PM-resu.patch
deleted file mode 100644
index 0d109b804c51b3..00000000000000
--- a/patches.armadillo800eva/0109-fbdev-sh_mobile_lcdc-Restart-LCDC-in-runtime-PM-resu.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From a5c2ad5d6ffebc6230d9a50263cff48b22e87ebd Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_lcdc: Restart LCDC in runtime PM resume handler
-
-Instead of restoring registers blindly, restart the LCDC by going
-through the startup sequence when resuming from runtime PM suspend. All
-registers are now correctly initialized in the right order.
-
-As a side effect, this also gets rid fo a possible panning restore issue
-caused by always saving the frame buffer base address registers from set
-A instead of the currently active set.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 2427bb241b1db35c6e699ad55adf4a30083b79cd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 49 ++++----------------------------------
- drivers/video/sh_mobile_lcdcfb.h | 1 -
- 2 files changed, 5 insertions(+), 45 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 69c267a..0b7b492 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -32,17 +32,6 @@
- #define SIDE_B_OFFSET 0x1000
- #define MIRROR_OFFSET 0x2000
-
--/* shared registers and their order for context save/restore */
--static int lcdc_shared_regs[] = {
-- _LDDCKR,
-- _LDDCKSTPR,
-- _LDINTR,
-- _LDDDSR,
-- _LDCNT1R,
-- _LDCNT2R,
--};
--#define NR_SHARED_REGS ARRAY_SIZE(lcdc_shared_regs)
--
- #define MAX_XRES 1920
- #define MAX_YRES 1080
-
-@@ -111,7 +100,6 @@ struct sh_mobile_lcdc_priv {
- unsigned long lddckr;
- struct sh_mobile_lcdc_chan ch[2];
- struct notifier_block notifier;
-- unsigned long saved_shared_regs[NR_SHARED_REGS];
- int started;
- int forced_bpp; /* 2 channel LCDC must share bpp setting */
- struct sh_mobile_meram_info *meram_dev;
-@@ -1289,47 +1277,20 @@ static int sh_mobile_lcdc_resume(struct device *dev)
- static int sh_mobile_lcdc_runtime_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
-- struct sh_mobile_lcdc_priv *p = platform_get_drvdata(pdev);
-- struct sh_mobile_lcdc_chan *ch;
-- int k, n;
--
-- /* save per-channel registers */
-- for (k = 0; k < ARRAY_SIZE(p->ch); k++) {
-- ch = &p->ch[k];
-- if (!ch->enabled)
-- continue;
-- for (n = 0; n < NR_CH_REGS; n++)
-- ch->saved_ch_regs[n] = lcdc_read_chan(ch, n);
-- }
--
-- /* save shared registers */
-- for (n = 0; n < NR_SHARED_REGS; n++)
-- p->saved_shared_regs[n] = lcdc_read(p, lcdc_shared_regs[n]);
-+ struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-
- /* turn off LCDC hardware */
-- lcdc_write(p, _LDCNT1R, 0);
-+ lcdc_write(priv, _LDCNT1R, 0);
-+
- return 0;
- }
-
- static int sh_mobile_lcdc_runtime_resume(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
-- struct sh_mobile_lcdc_priv *p = platform_get_drvdata(pdev);
-- struct sh_mobile_lcdc_chan *ch;
-- int k, n;
--
-- /* restore per-channel registers */
-- for (k = 0; k < ARRAY_SIZE(p->ch); k++) {
-- ch = &p->ch[k];
-- if (!ch->enabled)
-- continue;
-- for (n = 0; n < NR_CH_REGS; n++)
-- lcdc_write_chan(ch, n, ch->saved_ch_regs[n]);
-- }
-+ struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-
-- /* restore shared registers */
-- for (n = 0; n < NR_SHARED_REGS; n++)
-- lcdc_write(p, lcdc_shared_regs[n], p->saved_shared_regs[n]);
-+ __sh_mobile_lcdc_start(priv);
-
- return 0;
- }
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index a06219b..a58a0f3 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -32,7 +32,6 @@ struct sh_mobile_lcdc_chan {
- unsigned long enabled; /* ME and SE in LDCNT2R */
- struct sh_mobile_lcdc_chan_cfg cfg;
- u32 pseudo_palette[PALETTE_NR];
-- unsigned long saved_ch_regs[NR_CH_REGS];
- struct fb_info *info;
- struct backlight_device *bl;
- dma_addr_t dma_handle;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0110-fbdev-sh_mobile_meram-Replace-hardcoded-register-val.patch b/patches.armadillo800eva/0110-fbdev-sh_mobile_meram-Replace-hardcoded-register-val.patch
deleted file mode 100644
index af8ccd51c463f1..00000000000000
--- a/patches.armadillo800eva/0110-fbdev-sh_mobile_meram-Replace-hardcoded-register-val.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From a49f66a7d8b886c5e47a3af179e386b87204a693 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_meram: Replace hardcoded register values with
- macros
-
-Instead of hardcoding register values through the driver, define macros
-for individual register bits using the register name and the bit name,
-and use the macros.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit f0a260fef6943c60bae65ae52fc4fa52e7f078b1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 97 ++++++++++++++++++++++++++++-----------
- 1 file changed, 71 insertions(+), 26 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 39f28a1..85577cf 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -20,22 +20,67 @@
- #include "sh_mobile_meram.h"
-
- /* meram registers */
--#define MExxCTL 0x0
--#define MExxBSIZE 0x4
--#define MExxMNCF 0x8
--#define MExxSARA 0x10
--#define MExxSARB 0x14
--#define MExxSBSIZE 0x18
--
--#define MERAM_MExxCTL_VAL(ctl, next_icb, addr) \
-- ((ctl) | (((next_icb) & 0x1f) << 11) | (((addr) & 0x7ff) << 16))
--#define MERAM_MExxBSIZE_VAL(a, b, c) \
-- (((a) << 28) | ((b) << 16) | (c))
--
--#define MEVCR1 0x4
--#define MEACTS 0x10
--#define MEQSEL1 0x40
--#define MEQSEL2 0x44
-+#define MEVCR1 0x4
-+#define MEVCR1_RST (1 << 31)
-+#define MEVCR1_WD (1 << 30)
-+#define MEVCR1_AMD1 (1 << 29)
-+#define MEVCR1_AMD0 (1 << 28)
-+#define MEQSEL1 0x40
-+#define MEQSEL2 0x44
-+
-+#define MExxCTL 0x400
-+#define MExxCTL_BV (1 << 31)
-+#define MExxCTL_BSZ_SHIFT 28
-+#define MExxCTL_MSAR_MASK (0x7ff << MExxCTL_MSAR_SHIFT)
-+#define MExxCTL_MSAR_SHIFT 16
-+#define MExxCTL_NXT_MASK (0x1f << MExxCTL_NXT_SHIFT)
-+#define MExxCTL_NXT_SHIFT 11
-+#define MExxCTL_WD1 (1 << 10)
-+#define MExxCTL_WD0 (1 << 9)
-+#define MExxCTL_WS (1 << 8)
-+#define MExxCTL_CB (1 << 7)
-+#define MExxCTL_WBF (1 << 6)
-+#define MExxCTL_WF (1 << 5)
-+#define MExxCTL_RF (1 << 4)
-+#define MExxCTL_CM (1 << 3)
-+#define MExxCTL_MD_READ (1 << 0)
-+#define MExxCTL_MD_WRITE (2 << 0)
-+#define MExxCTL_MD_ICB_WB (3 << 0)
-+#define MExxCTL_MD_ICB (4 << 0)
-+#define MExxCTL_MD_FB (7 << 0)
-+#define MExxCTL_MD_MASK (7 << 0)
-+#define MExxBSIZE 0x404
-+#define MExxBSIZE_RCNT_SHIFT 28
-+#define MExxBSIZE_YSZM1_SHIFT 16
-+#define MExxBSIZE_XSZM1_SHIFT 0
-+#define MExxMNCF 0x408
-+#define MExxMNCF_KWBNM_SHIFT 28
-+#define MExxMNCF_KRBNM_SHIFT 24
-+#define MExxMNCF_BNM_SHIFT 16
-+#define MExxMNCF_XBV (1 << 15)
-+#define MExxMNCF_CPL_YCBCR444 (1 << 12)
-+#define MExxMNCF_CPL_YCBCR420 (2 << 12)
-+#define MExxMNCF_CPL_YCBCR422 (3 << 12)
-+#define MExxMNCF_CPL_MSK (3 << 12)
-+#define MExxMNCF_BL (1 << 2)
-+#define MExxMNCF_LNM_SHIFT 0
-+#define MExxSARA 0x410
-+#define MExxSARB 0x414
-+#define MExxSBSIZE 0x418
-+#define MExxSBSIZE_HDV (1 << 31)
-+#define MExxSBSIZE_HSZ16 (0 << 28)
-+#define MExxSBSIZE_HSZ32 (1 << 28)
-+#define MExxSBSIZE_HSZ64 (2 << 28)
-+#define MExxSBSIZE_HSZ128 (3 << 28)
-+#define MExxSBSIZE_SBSIZZ_SHIFT 0
-+
-+#define MERAM_MExxCTL_VAL(next, addr) \
-+ ((((next) << MExxCTL_NXT_SHIFT) & MExxCTL_NXT_MASK) | \
-+ (((addr) << MExxCTL_MSAR_SHIFT) & MExxCTL_MSAR_MASK))
-+#define MERAM_MExxBSIZE_VAL(rcnt, yszm1, xszm1) \
-+ (((rcnt) << MExxBSIZE_RCNT_SHIFT) | \
-+ ((yszm1) << MExxBSIZE_YSZM1_SHIFT) | \
-+ ((xszm1) << MExxBSIZE_XSZM1_SHIFT))
-
- static unsigned long common_regs[] = {
- MEVCR1,
-@@ -72,8 +117,7 @@ struct sh_mobile_meram_priv {
- * MERAM/ICB access functions
- */
-
--#define MERAM_ICB_OFFSET(base, idx, off) \
-- ((base) + (0x400 + ((idx) * 0x20) + (off)))
-+#define MERAM_ICB_OFFSET(base, idx, off) ((base) + (off) + (idx) * 0x20)
-
- static inline void meram_write_icb(void __iomem *base, int idx, int off,
- unsigned long val)
-@@ -308,17 +352,18 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- /*
- * Set MERAM for framebuffer
- *
-- * 0x70f: WD = 0x3, WS=0x1, CM=0x1, MD=FB mode
- * we also chain the cache_icb and the marker_icb.
- * we also split the allocated MERAM buffer between two ICBs.
- */
- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(0x70f, icb->marker_icb,
-- icb->meram_offset));
-+ MERAM_MExxCTL_VAL(icb->marker_icb, icb->meram_offset) |
-+ MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
-+ MExxCTL_MD_FB);
- meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(0x70f, icb->cache_icb,
-- icb->meram_offset +
-- icb->meram_size / 2));
-+ MERAM_MExxCTL_VAL(icb->cache_icb, icb->meram_offset +
-+ icb->meram_size / 2) |
-+ MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
-+ MExxCTL_MD_FB);
-
- return 0;
- }
-@@ -507,7 +552,7 @@ static int sh_mobile_meram_runtime_suspend(struct device *dev)
- /* Reset ICB on resume */
- if (icb_regs[k] == MExxCTL)
- priv->icb_saved_regs[j * ICB_REGS_SIZE + k] =
-- 0x70;
-+ MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF;
- }
- }
- return 0;
-@@ -592,7 +637,7 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
-
- /* initialize ICB addressing mode */
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE1)
-- meram_write_reg(priv->base, MEVCR1, 1 << 29);
-+ meram_write_reg(priv->base, MEVCR1, MEVCR1_AMD1);
-
- pm_runtime_enable(&pdev->dev);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0111-fbdev-sh_mobile_meram-Validate-ICB-configuration-out.patch b/patches.armadillo800eva/0111-fbdev-sh_mobile_meram-Validate-ICB-configuration-out.patch
deleted file mode 100644
index 015b03fb2aba66..00000000000000
--- a/patches.armadillo800eva/0111-fbdev-sh_mobile_meram-Validate-ICB-configuration-out.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 89b84aedbe39e0e31c4a5d289527b207657e6bc0 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_meram: Validate ICB configuration outside mutex
-
-Validate as much of the requested ICB configuration as possible outside
-of the mutex-protected region when registering ICBs.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 7963e21e50c8e712553347f900f0d0afaf5be2aa)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 18 ++++++++----------
- 1 file changed, 8 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 85577cf..25a7118 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -410,24 +410,22 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- xres, yres, (!pixelformat) ? "yuv" : "rgb",
- base_addr_y, base_addr_c);
-
-- mutex_lock(&priv->lock);
--
- /* we can't handle wider than 8192px */
- if (xres > 8192) {
- dev_err(&pdev->dev, "width exceeding the limit (> 8192).");
-- error = -EINVAL;
-- goto err;
-- }
--
-- if (priv->used_meram_cache_regions + 2 > SH_MOBILE_MERAM_ICB_NUM) {
-- dev_err(&pdev->dev, "no more ICB available.");
-- error = -EINVAL;
-- goto err;
-+ return -EINVAL;
- }
-
- /* do we have at least one ICB config? */
- if (cfg->icb[0].marker_icb < 0 || cfg->icb[0].cache_icb < 0) {
- dev_err(&pdev->dev, "at least one ICB is required.");
-+ return -EINVAL;
-+ }
-+
-+ mutex_lock(&priv->lock);
-+
-+ if (priv->used_meram_cache_regions + 2 > SH_MOBILE_MERAM_ICB_NUM) {
-+ dev_err(&pdev->dev, "no more ICB available.");
- error = -EINVAL;
- goto err;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0112-fbdev-sh_mobile_meram-Fix-MExxCTL-register-save-on-r.patch b/patches.armadillo800eva/0112-fbdev-sh_mobile_meram-Fix-MExxCTL-register-save-on-r.patch
deleted file mode 100644
index 398dfa31351275..00000000000000
--- a/patches.armadillo800eva/0112-fbdev-sh_mobile_meram-Fix-MExxCTL-register-save-on-r.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 09bd9eb3222ee896966878de283d90ebfc686ab5 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_meram: Fix MExxCTL register save on runtime PM
- suspend
-
-To reset the ICB on resume the MExxCTL register needs to be OR'ed with
-MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF, no set to that value. Fix this.
-
-This fixes corruption at the bottom of the display when resuming from
-runtime PM.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d86d29df57adf9258f56939e59cdd70932845885)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 25a7118..7ba6dce 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -549,7 +549,7 @@ static int sh_mobile_meram_runtime_suspend(struct device *dev)
- meram_read_icb(priv->base, j, icb_regs[k]);
- /* Reset ICB on resume */
- if (icb_regs[k] == MExxCTL)
-- priv->icb_saved_regs[j * ICB_REGS_SIZE + k] =
-+ priv->icb_saved_regs[j * ICB_REGS_SIZE + k] |=
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF;
- }
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0113-fbdev-sh_mobile_meram-Remove-unneeded-sh_mobile_mera.patch b/patches.armadillo800eva/0113-fbdev-sh_mobile_meram-Remove-unneeded-sh_mobile_mera.patch
deleted file mode 100644
index 63eb7142d59013..00000000000000
--- a/patches.armadillo800eva/0113-fbdev-sh_mobile_meram-Remove-unneeded-sh_mobile_mera.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 7f44def1067de547be05419f7d765d4f373c015a Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 13 Jul 2011 12:13:47 +0200
-Subject: fbdev: sh_mobile_meram: Remove unneeded sh_mobile_meram.h
-
-The drivers/video/sh_mobile_meram.h header contains unused definitions
-and declarations. Move the only used macro to sh_mobile_meram.c, and
-remove the header.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 8a20974f0370fe1b924704399e7ba327d894ef72)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 2 +-
- drivers/video/sh_mobile_meram.c | 5 +++--
- drivers/video/sh_mobile_meram.h | 33 ---------------------------------
- 3 files changed, 4 insertions(+), 36 deletions(-)
- delete mode 100644 drivers/video/sh_mobile_meram.h
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 0b7b492..088cb17 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -24,10 +24,10 @@
- #include <linux/backlight.h>
- #include <linux/gpio.h>
- #include <video/sh_mobile_lcdc.h>
-+#include <video/sh_mobile_meram.h>
- #include <linux/atomic.h>
-
- #include "sh_mobile_lcdcfb.h"
--#include "sh_mobile_meram.h"
-
- #define SIDE_B_OFFSET 0x1000
- #define MIRROR_OFFSET 0x2000
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 7ba6dce..f632970 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -16,8 +16,7 @@
- #include <linux/io.h>
- #include <linux/slab.h>
- #include <linux/platform_device.h>
--
--#include "sh_mobile_meram.h"
-+#include <video/sh_mobile_meram.h>
-
- /* meram registers */
- #define MEVCR1 0x4
-@@ -82,6 +81,8 @@
- ((yszm1) << MExxBSIZE_YSZM1_SHIFT) | \
- ((xszm1) << MExxBSIZE_XSZM1_SHIFT))
-
-+#define SH_MOBILE_MERAM_ICB_NUM 32
-+
- static unsigned long common_regs[] = {
- MEVCR1,
- MEQSEL1,
-diff --git a/drivers/video/sh_mobile_meram.h b/drivers/video/sh_mobile_meram.h
-deleted file mode 100644
-index 1615204b..0000000
---- a/drivers/video/sh_mobile_meram.h
-+++ /dev/null
-@@ -1,33 +0,0 @@
--#ifndef __sh_mobile_meram_h__
--#define __sh_mobile_meram_h__
--
--#include <linux/mutex.h>
--#include <video/sh_mobile_meram.h>
--
--/*
-- * MERAM private
-- */
--
--#define MERAM_ICB_Y 0x1
--#define MERAM_ICB_C 0x2
--
--/* MERAM cache size */
--#define SH_MOBILE_MERAM_ICB_NUM 32
--
--#define SH_MOBILE_MERAM_CACHE_OFFSET(p) ((p) >> 16)
--#define SH_MOBILE_MERAM_CACHE_SIZE(p) ((p) & 0xffff)
--
--int sh_mobile_meram_alloc_icb(const struct sh_mobile_meram_cfg *cfg,
-- int xres,
-- int yres,
-- unsigned int base_addr,
-- int yuv_mode,
-- int *marker_icb,
-- int *out_pitch);
--
--void sh_mobile_meram_free_icb(int marker_icb);
--
--#define SH_MOBILE_MERAM_START(ind, ab) \
-- (0xC0000000 | ((ab & 0x1) << 23) | ((ind & 0x1F) << 24))
--
--#endif /* !__sh_mobile_meram_h__ */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0114-sh_mobile_meram-Reset-ICBs-at-unregistration-time.patch b/patches.armadillo800eva/0114-sh_mobile_meram-Reset-ICBs-at-unregistration-time.patch
deleted file mode 100644
index e30ec617658c50..00000000000000
--- a/patches.armadillo800eva/0114-sh_mobile_meram-Reset-ICBs-at-unregistration-time.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From a3d7fb0249ed6db32c6d99fc726e9cc919fdfd38 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:52 +0200
-Subject: sh_mobile_meram: Reset ICBs at unregistration time
-
-When ICBs are unregistered and later reused they need to be reset to
-avoid data corruption. Set the WBF, WF and RF bits to make sure ICBs get
-reset properly.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit da6cf5125f66ed1810616937777884cea021e66a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index f632970..4d63490 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -373,8 +373,10 @@ static void meram_deinit(struct sh_mobile_meram_priv *priv,
- struct sh_mobile_meram_icb *icb)
- {
- /* disable ICB */
-- meram_write_icb(priv->base, icb->cache_icb, MExxCTL, 0);
-- meram_write_icb(priv->base, icb->marker_icb, MExxCTL, 0);
-+ meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-+ MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
-+ meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
-+ MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
- icb->cache_unit = 0;
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0115-fbdev-sh_mobile_lcdc-Adjust-requested-parameters-in-.patch b/patches.armadillo800eva/0115-fbdev-sh_mobile_lcdc-Adjust-requested-parameters-in-.patch
deleted file mode 100644
index a9828594352308..00000000000000
--- a/patches.armadillo800eva/0115-fbdev-sh_mobile_lcdc-Adjust-requested-parameters-in-.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From c37da1d84d5fa1c39e811adf761f274d2789131f Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:53 +0200
-Subject: fbdev: sh_mobile_lcdc: Adjust requested parameters in .fb_check_var
-
-Instead of failing when the requested fb_var_screeninfo parameters are
-not supported, adjust the parameters according to the hardware
-capabilities.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 0386219441d48e0f0902e9f145f0d75ad952d753)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 103 ++++++++++++++++++++++++++++++++------
- 1 file changed, 88 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 088cb17..33b0ff8 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1055,28 +1055,101 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
- struct sh_mobile_lcdc_priv *p = ch->lcdc;
-+ unsigned int best_dist = (unsigned int)-1;
-+ unsigned int best_xres = 0;
-+ unsigned int best_yres = 0;
-+ unsigned int i;
-
-- if (var->xres > MAX_XRES || var->yres > MAX_YRES ||
-- var->xres * var->yres * (ch->cfg.bpp / 8) * 2 > info->fix.smem_len) {
-- dev_warn(info->dev, "Invalid info: %u-%u-%u-%u x %u-%u-%u-%u @ %lukHz!\n",
-- var->left_margin, var->xres, var->right_margin, var->hsync_len,
-- var->upper_margin, var->yres, var->lower_margin, var->vsync_len,
-- PICOS2KHZ(var->pixclock));
-+ if (var->xres > MAX_XRES || var->yres > MAX_YRES)
- return -EINVAL;
-+
-+ /* If board code provides us with a list of available modes, make sure
-+ * we use one of them. Find the mode closest to the requested one. The
-+ * distance between two modes is defined as the size of the
-+ * non-overlapping parts of the two rectangles.
-+ */
-+ for (i = 0; i < ch->cfg.num_cfg; ++i) {
-+ const struct fb_videomode *mode = &ch->cfg.lcd_cfg[i];
-+ unsigned int dist;
-+
-+ /* We can only round up. */
-+ if (var->xres > mode->xres || var->yres > mode->yres)
-+ continue;
-+
-+ dist = var->xres * var->yres + mode->xres * mode->yres
-+ - 2 * min(var->xres, mode->xres)
-+ * min(var->yres, mode->yres);
-+
-+ if (dist < best_dist) {
-+ best_xres = mode->xres;
-+ best_yres = mode->yres;
-+ best_dist = dist;
-+ }
- }
-
-- /* only accept the forced_bpp for dual channel configurations */
-- if (p->forced_bpp && p->forced_bpp != var->bits_per_pixel)
-+ /* If no available mode can be used, return an error. */
-+ if (ch->cfg.num_cfg != 0) {
-+ if (best_dist == (unsigned int)-1)
-+ return -EINVAL;
-+
-+ var->xres = best_xres;
-+ var->yres = best_yres;
-+ }
-+
-+ /* Make sure the virtual resolution is at least as big as the visible
-+ * resolution.
-+ */
-+ if (var->xres_virtual < var->xres)
-+ var->xres_virtual = var->xres;
-+ if (var->yres_virtual < var->yres)
-+ var->yres_virtual = var->yres;
-+
-+ if (var->bits_per_pixel <= 16) { /* RGB 565 */
-+ var->bits_per_pixel = 16;
-+ var->red.offset = 11;
-+ var->red.length = 5;
-+ var->green.offset = 5;
-+ var->green.length = 6;
-+ var->blue.offset = 0;
-+ var->blue.length = 5;
-+ var->transp.offset = 0;
-+ var->transp.length = 0;
-+ } else if (var->bits_per_pixel <= 24) { /* RGB 888 */
-+ var->bits_per_pixel = 24;
-+ var->red.offset = 16;
-+ var->red.length = 8;
-+ var->green.offset = 8;
-+ var->green.length = 8;
-+ var->blue.offset = 0;
-+ var->blue.length = 8;
-+ var->transp.offset = 0;
-+ var->transp.length = 0;
-+ } else if (var->bits_per_pixel <= 32) { /* RGBA 888 */
-+ var->bits_per_pixel = 32;
-+ var->red.offset = 16;
-+ var->red.length = 8;
-+ var->green.offset = 8;
-+ var->green.length = 8;
-+ var->blue.offset = 0;
-+ var->blue.length = 8;
-+ var->transp.offset = 24;
-+ var->transp.length = 8;
-+ } else
- return -EINVAL;
-
-- switch (var->bits_per_pixel) {
-- case 16: /* PKF[4:0] = 00011 - RGB 565 */
-- case 24: /* PKF[4:0] = 01011 - RGB 888 */
-- case 32: /* PKF[4:0] = 00000 - RGBA 888 */
-- break;
-- default:
-+ var->red.msb_right = 0;
-+ var->green.msb_right = 0;
-+ var->blue.msb_right = 0;
-+ var->transp.msb_right = 0;
-+
-+ /* Make sure we don't exceed our allocated memory. */
-+ if (var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8 >
-+ info->fix.smem_len)
-+ return -EINVAL;
-+
-+ /* only accept the forced_bpp for dual channel configurations */
-+ if (p->forced_bpp && p->forced_bpp != var->bits_per_pixel)
- return -EINVAL;
-- }
-
- return 0;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0116-fbdev-sh_mobile_lcdc-Add-support-for-format-changes-.patch b/patches.armadillo800eva/0116-fbdev-sh_mobile_lcdc-Add-support-for-format-changes-.patch
deleted file mode 100644
index ff92ebff1b7c25..00000000000000
--- a/patches.armadillo800eva/0116-fbdev-sh_mobile_lcdc-Add-support-for-format-changes-.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From e2d64963daac294aedfa4d8a08ad5761e5fbf846 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:54 +0200
-Subject: fbdev: sh_mobile_lcdc: Add support for format changes at runtime
-
-Implement .fb_set_par to support frame buffer format changes at runtime.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit ed5bebf29e82beab3456901e26a495ae0a49ebad)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 33b0ff8..f9f420d 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1154,6 +1154,19 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- return 0;
- }
-
-+static int sh_mobile_set_par(struct fb_info *info)
-+{
-+ struct sh_mobile_lcdc_chan *ch = info->par;
-+ int ret;
-+
-+ sh_mobile_lcdc_stop(ch->lcdc);
-+ ret = sh_mobile_lcdc_start(ch->lcdc);
-+ if (ret < 0)
-+ dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
-+
-+ return ret;
-+}
-+
- /*
- * Screen blanking. Behavior is as follows:
- * FB_BLANK_UNBLANK: screen unblanked, clocks enabled
-@@ -1211,6 +1224,7 @@ static struct fb_ops sh_mobile_lcdc_ops = {
- .fb_open = sh_mobile_open,
- .fb_release = sh_mobile_release,
- .fb_check_var = sh_mobile_check_var,
-+ .fb_set_par = sh_mobile_set_par,
- };
-
- static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0117-fbdev-sh_mobile_lcdc-use-display-information-in-info.patch b/patches.armadillo800eva/0117-fbdev-sh_mobile_lcdc-use-display-information-in-info.patch
deleted file mode 100644
index bc96908b8a0f53..00000000000000
--- a/patches.armadillo800eva/0117-fbdev-sh_mobile_lcdc-use-display-information-in-info.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 08eb10f68bdd1e24a58aee50502b81a861a14308 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:55 +0200
-Subject: fbdev: sh_mobile_lcdc: use display information in info for panning
-
-We must not use any information in the passed var besides xoffset,
-yoffset and vmode as otherwise applications might abuse it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit dc1d5adab5cc57eb732407d80c9e7ae48891ffca)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 24 ++++++++++++------------
- 1 file changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index f9f420d..1ff215c 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -877,12 +877,12 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- unsigned long base_addr_y, base_addr_c;
- unsigned long c_offset;
-
-- if (!var->nonstd)
-- new_pan_offset = (var->yoffset * info->fix.line_length) +
-- (var->xoffset * (info->var.bits_per_pixel / 8));
-+ if (!info->var.nonstd)
-+ new_pan_offset = var->yoffset * info->fix.line_length
-+ + var->xoffset * (info->var.bits_per_pixel / 8);
- else
-- new_pan_offset = (var->yoffset * info->fix.line_length) +
-- (var->xoffset);
-+ new_pan_offset = var->yoffset * info->fix.line_length
-+ + var->xoffset;
-
- if (new_pan_offset == ch->pan_offset)
- return 0; /* No change, do nothing */
-@@ -891,13 +891,13 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
-
- /* Set the source address for the next refresh */
- base_addr_y = ch->dma_handle + new_pan_offset;
-- if (var->nonstd) {
-+ if (info->var.nonstd) {
- /* Set y offset */
-- c_offset = (var->yoffset *
-- info->fix.line_length *
-- (info->var.bits_per_pixel - 8)) / 8;
-- base_addr_c = ch->dma_handle + var->xres * var->yres_virtual +
-- c_offset;
-+ c_offset = var->yoffset * info->fix.line_length
-+ * (info->var.bits_per_pixel - 8) / 8;
-+ base_addr_c = ch->dma_handle
-+ + info->var.xres * info->var.yres_virtual
-+ + c_offset;
- /* Set x offset */
- if (info->var.bits_per_pixel == 24)
- base_addr_c += 2 * var->xoffset;
-@@ -923,7 +923,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- ch->base_addr_c = base_addr_c;
-
- lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
-- if (var->nonstd)
-+ if (info->var.nonstd)
- lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
-
- if (lcdc_chan_is_sublcd(ch))
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0118-fbdev-sh_mobile_lcdc-Update-fix.line_length-in-.fb_s.patch b/patches.armadillo800eva/0118-fbdev-sh_mobile_lcdc-Update-fix.line_length-in-.fb_s.patch
deleted file mode 100644
index 1ed2d2a568455e..00000000000000
--- a/patches.armadillo800eva/0118-fbdev-sh_mobile_lcdc-Update-fix.line_length-in-.fb_s.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9b846f132ae1db5220b7d92a59f599d167df3c01 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:56 +0200
-Subject: fbdev: sh_mobile_lcdc: Update fix.line_length in .fb_set_par()
-
-Instead of updating the fixed screen information line length manually
-after calling fb_set_var() in sh_mobile_fb_reconfig(), update the field
-in the .fb_set_par() operation handler.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 91fba48d59666718e3d3e86964755b80d39cdbdd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 17 +++++++++++------
- 1 file changed, 11 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 1ff215c..b6da1d6 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -998,11 +998,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
- /* Couldn't reconfigure, hopefully, can continue as before */
- return;
-
-- if (info->var.nonstd)
-- info->fix.line_length = mode1.xres;
-- else
-- info->fix.line_length = mode1.xres * (ch->cfg.bpp / 8);
--
- /*
- * fb_set_var() calls the notifier change internally, only if
- * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a
-@@ -1157,12 +1152,22 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- static int sh_mobile_set_par(struct fb_info *info)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-+ u32 line_length = info->fix.line_length;
- int ret;
-
- sh_mobile_lcdc_stop(ch->lcdc);
-+
-+ if (info->var.nonstd)
-+ info->fix.line_length = info->var.xres;
-+ else
-+ info->fix.line_length = info->var.xres
-+ * info->var.bits_per_pixel / 8;
-+
- ret = sh_mobile_lcdc_start(ch->lcdc);
-- if (ret < 0)
-+ if (ret < 0) {
- dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
-+ info->fix.line_length = line_length;
-+ }
-
- return ret;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0119-fbdev-sh_mobile_lcdc-Avoid-forward-declarations.patch b/patches.armadillo800eva/0119-fbdev-sh_mobile_lcdc-Avoid-forward-declarations.patch
deleted file mode 100644
index c9f24ecad1bdcb..00000000000000
--- a/patches.armadillo800eva/0119-fbdev-sh_mobile_lcdc-Avoid-forward-declarations.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 2a1254b8c2db1dff2f38c6ebc6cc92965ba077c6 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:57 +0200
-Subject: fbdev: sh_mobile_lcdc: Avoid forward declarations
-
-Reorder probe/remove functions to avoid forward declarations.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit b4bee692e5d5a3beb5b59ca7967c0a98e3efcc26)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 102 +++++++++++++++++++-------------------
- 1 file changed, 50 insertions(+), 52 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index b6da1d6..366315b 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1434,7 +1434,56 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- return NOTIFY_OK;
- }
-
--static int sh_mobile_lcdc_remove(struct platform_device *pdev);
-+static int sh_mobile_lcdc_remove(struct platform_device *pdev)
-+{
-+ struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-+ struct fb_info *info;
-+ int i;
-+
-+ fb_unregister_client(&priv->notifier);
-+
-+ for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
-+ if (priv->ch[i].info && priv->ch[i].info->dev)
-+ unregister_framebuffer(priv->ch[i].info);
-+
-+ sh_mobile_lcdc_stop(priv);
-+
-+ for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-+ info = priv->ch[i].info;
-+
-+ if (!info || !info->device)
-+ continue;
-+
-+ if (priv->ch[i].sglist)
-+ vfree(priv->ch[i].sglist);
-+
-+ if (info->screen_base)
-+ dma_free_coherent(&pdev->dev, info->fix.smem_len,
-+ info->screen_base,
-+ priv->ch[i].dma_handle);
-+ fb_dealloc_cmap(&info->cmap);
-+ framebuffer_release(info);
-+ }
-+
-+ for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-+ if (priv->ch[i].bl)
-+ sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
-+ }
-+
-+ if (priv->dot_clk)
-+ clk_put(priv->dot_clk);
-+
-+ if (priv->dev)
-+ pm_runtime_disable(priv->dev);
-+
-+ if (priv->base)
-+ iounmap(priv->base);
-+
-+ if (priv->irq)
-+ free_irq(priv->irq, priv);
-+ kfree(priv);
-+ return 0;
-+}
-
- static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- {
-@@ -1691,57 +1740,6 @@ err1:
- return error;
- }
-
--static int sh_mobile_lcdc_remove(struct platform_device *pdev)
--{
-- struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-- struct fb_info *info;
-- int i;
--
-- fb_unregister_client(&priv->notifier);
--
-- for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
-- if (priv->ch[i].info && priv->ch[i].info->dev)
-- unregister_framebuffer(priv->ch[i].info);
--
-- sh_mobile_lcdc_stop(priv);
--
-- for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-- info = priv->ch[i].info;
--
-- if (!info || !info->device)
-- continue;
--
-- if (priv->ch[i].sglist)
-- vfree(priv->ch[i].sglist);
--
-- if (info->screen_base)
-- dma_free_coherent(&pdev->dev, info->fix.smem_len,
-- info->screen_base,
-- priv->ch[i].dma_handle);
-- fb_dealloc_cmap(&info->cmap);
-- framebuffer_release(info);
-- }
--
-- for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-- if (priv->ch[i].bl)
-- sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
-- }
--
-- if (priv->dot_clk)
-- clk_put(priv->dot_clk);
--
-- if (priv->dev)
-- pm_runtime_disable(priv->dev);
--
-- if (priv->base)
-- iounmap(priv->base);
--
-- if (priv->irq)
-- free_irq(priv->irq, priv);
-- kfree(priv);
-- return 0;
--}
--
- static struct platform_driver sh_mobile_lcdc_driver = {
- .driver = {
- .name = "sh_mobile_lcdc_fb",
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0120-fbdev-sh_mobile_lcdc-Split-channel-initialization-fr.patch b/patches.armadillo800eva/0120-fbdev-sh_mobile_lcdc-Split-channel-initialization-fr.patch
deleted file mode 100644
index 83d8c557eaf0a3..00000000000000
--- a/patches.armadillo800eva/0120-fbdev-sh_mobile_lcdc-Split-channel-initialization-fr.patch
+++ /dev/null
@@ -1,332 +0,0 @@
-From 0a9d12c3d05cb18e74e8f03614af9d779928998b Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:58 +0200
-Subject: fbdev: sh_mobile_lcdc: Split channel initialization from probe
- function
-
-Move channel initialization to sh_mobile_lcdc_channel_init() and call
-the function from sh_mobile_lcdc_probe(). This makes the code more
-readable and prepares it for fix/var initialization rework.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 3ce05599907c604a8af9cefe8c5e0702a30d1112)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 247 ++++++++++++++++++++------------------
- 1 file changed, 129 insertions(+), 118 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 366315b..d1576e2 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1485,15 +1485,129 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- return 0;
- }
-
--static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-+static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
-+ struct device *dev)
- {
-+ struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
-+ const struct fb_videomode *max_mode;
-+ const struct fb_videomode *mode;
-+ struct fb_var_screeninfo *var;
- struct fb_info *info;
-- struct sh_mobile_lcdc_priv *priv;
-+ unsigned int max_size;
-+ int num_cfg;
-+ void *buf;
-+ int ret;
-+ int i;
-+
-+ ch->info = framebuffer_alloc(0, dev);
-+ if (!ch->info) {
-+ dev_err(dev, "unable to allocate fb_info\n");
-+ return -ENOMEM;
-+ }
-+
-+ info = ch->info;
-+ var = &info->var;
-+ info->fbops = &sh_mobile_lcdc_ops;
-+ info->par = ch;
-+
-+ mutex_init(&ch->open_lock);
-+
-+ /* Iterate through the modes to validate them and find the highest
-+ * resolution.
-+ */
-+ max_mode = NULL;
-+ max_size = 0;
-+
-+ for (i = 0, mode = cfg->lcd_cfg; i < cfg->num_cfg; i++, mode++) {
-+ unsigned int size = mode->yres * mode->xres;
-+
-+ /* NV12 buffers must have even number of lines */
-+ if ((cfg->nonstd) && cfg->bpp == 12 &&
-+ (mode->yres & 0x1)) {
-+ dev_err(dev, "yres must be multiple of 2 for YCbCr420 "
-+ "mode.\n");
-+ return -EINVAL;
-+ }
-+
-+ if (size > max_size) {
-+ max_mode = mode;
-+ max_size = size;
-+ }
-+ }
-+
-+ if (!max_size)
-+ max_size = MAX_XRES * MAX_YRES;
-+ else
-+ dev_dbg(dev, "Found largest videomode %ux%u\n",
-+ max_mode->xres, max_mode->yres);
-+
-+ info->fix = sh_mobile_lcdc_fix;
-+ info->fix.smem_len = max_size * 2 * cfg->bpp / 8;
-+
-+ /* Only pan in 2 line steps for NV12 */
-+ if (cfg->nonstd && cfg->bpp == 12)
-+ info->fix.ypanstep = 2;
-+
-+ if (cfg->lcd_cfg == NULL) {
-+ mode = &default_720p;
-+ num_cfg = 1;
-+ } else {
-+ mode = cfg->lcd_cfg;
-+ num_cfg = cfg->num_cfg;
-+ }
-+
-+ fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
-+
-+ fb_videomode_to_var(var, mode);
-+ var->width = cfg->lcd_size_cfg.width;
-+ var->height = cfg->lcd_size_cfg.height;
-+ /* Default Y virtual resolution is 2x panel size */
-+ var->yres_virtual = var->yres * 2;
-+ var->activate = FB_ACTIVATE_NOW;
-+
-+ ret = sh_mobile_lcdc_set_bpp(var, cfg->bpp, cfg->nonstd);
-+ if (ret)
-+ return ret;
-+
-+ buf = dma_alloc_coherent(dev, info->fix.smem_len, &ch->dma_handle,
-+ GFP_KERNEL);
-+ if (!buf) {
-+ dev_err(dev, "unable to allocate buffer\n");
-+ return -ENOMEM;
-+ }
-+
-+ info->pseudo_palette = &ch->pseudo_palette;
-+ info->flags = FBINFO_FLAG_DEFAULT;
-+
-+ ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
-+ if (ret < 0) {
-+ dev_err(dev, "unable to allocate cmap\n");
-+ dma_free_coherent(dev, info->fix.smem_len,
-+ buf, ch->dma_handle);
-+ return ret;
-+ }
-+
-+ info->fix.smem_start = ch->dma_handle;
-+ if (var->nonstd)
-+ info->fix.line_length = var->xres;
-+ else
-+ info->fix.line_length = var->xres * (cfg->bpp / 8);
-+
-+ info->screen_base = buf;
-+ info->device = dev;
-+ ch->display_var = *var;
-+
-+ return 0;
-+}
-+
-+static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-+{
- struct sh_mobile_lcdc_info *pdata = pdev->dev.platform_data;
-+ struct sh_mobile_lcdc_priv *priv;
- struct resource *res;
-+ int num_channels;
- int error;
-- void *buf;
-- int i, j;
-+ int i;
-
- if (!pdata) {
- dev_err(&pdev->dev, "no platform data defined\n");
-@@ -1525,9 +1639,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- priv->irq = i;
- atomic_set(&priv->hw_usecnt, -1);
-
-- j = 0;
-- for (i = 0; i < ARRAY_SIZE(pdata->ch); i++) {
-- struct sh_mobile_lcdc_chan *ch = priv->ch + j;
-+ for (i = 0, num_channels = 0; i < ARRAY_SIZE(pdata->ch); i++) {
-+ struct sh_mobile_lcdc_chan *ch = priv->ch + num_channels;
-
- ch->lcdc = priv;
- memcpy(&ch->cfg, &pdata->ch[i], sizeof(pdata->ch[i]));
-@@ -1549,24 +1662,24 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- case LCDC_CHAN_MAINLCD:
- ch->enabled = LDCNT2R_ME;
- ch->reg_offs = lcdc_offs_mainlcd;
-- j++;
-+ num_channels++;
- break;
- case LCDC_CHAN_SUBLCD:
- ch->enabled = LDCNT2R_SE;
- ch->reg_offs = lcdc_offs_sublcd;
-- j++;
-+ num_channels++;
- break;
- }
- }
-
-- if (!j) {
-+ if (!num_channels) {
- dev_err(&pdev->dev, "no channels defined\n");
- error = -EINVAL;
- goto err1;
- }
-
- /* for dual channel LCDC (MAIN + SUB) force shared bpp setting */
-- if (j == 2)
-+ if (num_channels == 2)
- priv->forced_bpp = pdata->ch[0].bpp;
-
- priv->base = ioremap_nocache(res->start, resource_size(res));
-@@ -1581,125 +1694,23 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-
- priv->meram_dev = pdata->meram_dev;
-
-- for (i = 0; i < j; i++) {
-- struct fb_var_screeninfo *var;
-- const struct fb_videomode *lcd_cfg, *max_cfg = NULL;
-+ for (i = 0; i < num_channels; i++) {
- struct sh_mobile_lcdc_chan *ch = priv->ch + i;
-- struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
-- const struct fb_videomode *mode = cfg->lcd_cfg;
-- unsigned long max_size = 0;
-- int k;
-- int num_cfg;
--
-- ch->info = framebuffer_alloc(0, &pdev->dev);
-- if (!ch->info) {
-- dev_err(&pdev->dev, "unable to allocate fb_info\n");
-- error = -ENOMEM;
-- break;
-- }
--
-- info = ch->info;
-- var = &info->var;
-- info->fbops = &sh_mobile_lcdc_ops;
-- info->par = ch;
--
-- mutex_init(&ch->open_lock);
--
-- for (k = 0, lcd_cfg = mode;
-- k < cfg->num_cfg && lcd_cfg;
-- k++, lcd_cfg++) {
-- unsigned long size = lcd_cfg->yres * lcd_cfg->xres;
-- /* NV12 buffers must have even number of lines */
-- if ((cfg->nonstd) && cfg->bpp == 12 &&
-- (lcd_cfg->yres & 0x1)) {
-- dev_err(&pdev->dev, "yres must be multiple of 2"
-- " for YCbCr420 mode.\n");
-- error = -EINVAL;
-- goto err1;
-- }
--
-- if (size > max_size) {
-- max_cfg = lcd_cfg;
-- max_size = size;
-- }
-- }
--
-- if (!mode)
-- max_size = MAX_XRES * MAX_YRES;
-- else if (max_cfg)
-- dev_dbg(&pdev->dev, "Found largest videomode %ux%u\n",
-- max_cfg->xres, max_cfg->yres);
--
-- info->fix = sh_mobile_lcdc_fix;
-- info->fix.smem_len = max_size * 2 * cfg->bpp / 8;
--
-- /* Only pan in 2 line steps for NV12 */
-- if (cfg->nonstd && cfg->bpp == 12)
-- info->fix.ypanstep = 2;
--
-- if (!mode) {
-- mode = &default_720p;
-- num_cfg = 1;
-- } else {
-- num_cfg = cfg->num_cfg;
-- }
--
-- fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
-
-- fb_videomode_to_var(var, mode);
-- var->width = cfg->lcd_size_cfg.width;
-- var->height = cfg->lcd_size_cfg.height;
-- /* Default Y virtual resolution is 2x panel size */
-- var->yres_virtual = var->yres * 2;
-- var->activate = FB_ACTIVATE_NOW;
--
-- error = sh_mobile_lcdc_set_bpp(var, cfg->bpp, cfg->nonstd);
-+ error = sh_mobile_lcdc_channel_init(ch, &pdev->dev);
- if (error)
-- break;
--
-- buf = dma_alloc_coherent(&pdev->dev, info->fix.smem_len,
-- &ch->dma_handle, GFP_KERNEL);
-- if (!buf) {
-- dev_err(&pdev->dev, "unable to allocate buffer\n");
-- error = -ENOMEM;
-- break;
-- }
--
-- info->pseudo_palette = &ch->pseudo_palette;
-- info->flags = FBINFO_FLAG_DEFAULT;
--
-- error = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
-- if (error < 0) {
-- dev_err(&pdev->dev, "unable to allocate cmap\n");
-- dma_free_coherent(&pdev->dev, info->fix.smem_len,
-- buf, ch->dma_handle);
-- break;
-- }
--
-- info->fix.smem_start = ch->dma_handle;
-- if (var->nonstd)
-- info->fix.line_length = var->xres;
-- else
-- info->fix.line_length = var->xres * (cfg->bpp / 8);
--
-- info->screen_base = buf;
-- info->device = &pdev->dev;
-- ch->display_var = *var;
-+ goto err1;
- }
-
-- if (error)
-- goto err1;
--
- error = sh_mobile_lcdc_start(priv);
- if (error) {
- dev_err(&pdev->dev, "unable to start hardware\n");
- goto err1;
- }
-
-- for (i = 0; i < j; i++) {
-+ for (i = 0; i < num_channels; i++) {
- struct sh_mobile_lcdc_chan *ch = priv->ch + i;
--
-- info = ch->info;
-+ struct fb_info *info = ch->info;
-
- if (info->fbdefio) {
- ch->sglist = vmalloc(sizeof(struct scatterlist) *
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0121-fbdev-sh_mobile_lcdc-Remove-sh_mobile_lcdc_set_bpp.patch b/patches.armadillo800eva/0121-fbdev-sh_mobile_lcdc-Remove-sh_mobile_lcdc_set_bpp.patch
deleted file mode 100644
index 8f1ce97e59f1b9..00000000000000
--- a/patches.armadillo800eva/0121-fbdev-sh_mobile_lcdc-Remove-sh_mobile_lcdc_set_bpp.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From f8912387b109a237c5978755d20a1b3ae7dbcb94 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 31 Aug 2011 13:00:59 +0200
-Subject: fbdev: sh_mobile_lcdc: Remove sh_mobile_lcdc_set_bpp()
-
-The function duplicates code found in sh_mobile_check_var(). Remove
-sh_mobile_lcdc_set_bpp() and call sh_mobile_check_var() instead.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit a67472ad1ae040f073e45048cbc5a01195f2e3f5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 87 ++++++++------------------------------
- 1 file changed, 17 insertions(+), 70 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index d1576e2..97ab8ba 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1291,66 +1291,6 @@ static void sh_mobile_lcdc_bl_remove(struct backlight_device *bdev)
- backlight_device_unregister(bdev);
- }
-
--static int sh_mobile_lcdc_set_bpp(struct fb_var_screeninfo *var, int bpp,
-- int nonstd)
--{
-- if (nonstd) {
-- switch (bpp) {
-- case 12:
-- case 16:
-- case 24:
-- var->bits_per_pixel = bpp;
-- var->nonstd = nonstd;
-- return 0;
-- default:
-- return -EINVAL;
-- }
-- }
--
-- switch (bpp) {
-- case 16: /* PKF[4:0] = 00011 - RGB 565 */
-- var->red.offset = 11;
-- var->red.length = 5;
-- var->green.offset = 5;
-- var->green.length = 6;
-- var->blue.offset = 0;
-- var->blue.length = 5;
-- var->transp.offset = 0;
-- var->transp.length = 0;
-- break;
--
-- case 24: /* PKF[4:0] = 01011 - RGB 888 */
-- var->red.offset = 16;
-- var->red.length = 8;
-- var->green.offset = 8;
-- var->green.length = 8;
-- var->blue.offset = 0;
-- var->blue.length = 8;
-- var->transp.offset = 0;
-- var->transp.length = 0;
-- break;
--
-- case 32: /* PKF[4:0] = 00000 - RGBA 888 */
-- var->red.offset = 16;
-- var->red.length = 8;
-- var->green.offset = 8;
-- var->green.length = 8;
-- var->blue.offset = 0;
-- var->blue.length = 8;
-- var->transp.offset = 24;
-- var->transp.length = 8;
-- break;
-- default:
-- return -EINVAL;
-- }
-- var->bits_per_pixel = bpp;
-- var->red.msb_right = 0;
-- var->green.msb_right = 0;
-- var->blue.msb_right = 0;
-- var->transp.msb_right = 0;
-- return 0;
--}
--
- static int sh_mobile_lcdc_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
-@@ -1499,6 +1439,9 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- int ret;
- int i;
-
-+ mutex_init(&ch->open_lock);
-+
-+ /* Allocate the frame buffer device. */
- ch->info = framebuffer_alloc(0, dev);
- if (!ch->info) {
- dev_err(dev, "unable to allocate fb_info\n");
-@@ -1506,11 +1449,10 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- }
-
- info = ch->info;
-- var = &info->var;
- info->fbops = &sh_mobile_lcdc_ops;
- info->par = ch;
--
-- mutex_init(&ch->open_lock);
-+ info->pseudo_palette = &ch->pseudo_palette;
-+ info->flags = FBINFO_FLAG_DEFAULT;
-
- /* Iterate through the modes to validate them and find the highest
- * resolution.
-@@ -1541,13 +1483,15 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- dev_dbg(dev, "Found largest videomode %ux%u\n",
- max_mode->xres, max_mode->yres);
-
-+ /* Initialize fixed screen information. Restrict pan to 2 lines steps
-+ * for NV12.
-+ */
- info->fix = sh_mobile_lcdc_fix;
- info->fix.smem_len = max_size * 2 * cfg->bpp / 8;
--
-- /* Only pan in 2 line steps for NV12 */
- if (cfg->nonstd && cfg->bpp == 12)
- info->fix.ypanstep = 2;
-
-+ /* Create the mode list. */
- if (cfg->lcd_cfg == NULL) {
- mode = &default_720p;
- num_cfg = 1;
-@@ -1558,17 +1502,23 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
-
- fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
-
-+ /* Initialize variable screen information using the first mode as
-+ * default. The default Y virtual resolution is twice the panel size to
-+ * allow for double-buffering.
-+ */
-+ var = &info->var;
- fb_videomode_to_var(var, mode);
-+ var->bits_per_pixel = cfg->bpp;
- var->width = cfg->lcd_size_cfg.width;
- var->height = cfg->lcd_size_cfg.height;
-- /* Default Y virtual resolution is 2x panel size */
- var->yres_virtual = var->yres * 2;
- var->activate = FB_ACTIVATE_NOW;
-
-- ret = sh_mobile_lcdc_set_bpp(var, cfg->bpp, cfg->nonstd);
-+ ret = sh_mobile_check_var(var, info);
- if (ret)
- return ret;
-
-+ /* Allocate frame buffer memory and color map. */
- buf = dma_alloc_coherent(dev, info->fix.smem_len, &ch->dma_handle,
- GFP_KERNEL);
- if (!buf) {
-@@ -1576,9 +1526,6 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- return -ENOMEM;
- }
-
-- info->pseudo_palette = &ch->pseudo_palette;
-- info->flags = FBINFO_FLAG_DEFAULT;
--
- ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
- if (ret < 0) {
- dev_err(dev, "unable to allocate cmap\n");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0122-video-irq-Remove-IRQF_DISABLED.patch b/patches.armadillo800eva/0122-video-irq-Remove-IRQF_DISABLED.patch
deleted file mode 100644
index 8c333139d8c06f..00000000000000
--- a/patches.armadillo800eva/0122-video-irq-Remove-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From a74921402cead64d227baab172fb9d52a552f89d Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Thu, 22 Sep 2011 16:59:16 +0800
-Subject: video: irq: Remove IRQF_DISABLED
-
-Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
-We run all interrupt handlers with interrupts disabled
-and we even check and yell when an interrupt handler
-returns with interrupts enabled (see commit [b738a50a:
-genirq: Warn when handler enables interrupts]).
-
-So now this flag is a NOOP and can be removed.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Acked-by: David Brown <davidb@codeaurora.org>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit f8798ccbefc0e4ef7438c080b7ba0410738c8cfa)
-
-Conflicts:
-
- drivers/video/au1200fb.c
- drivers/video/bf54x-lq043fb.c
- drivers/video/bfin-lq035q1-fb.c
- drivers/video/bfin-t350mcqb-fb.c
- drivers/video/bfin_adv7393fb.c
- drivers/video/mb862xx/mb862xxfbdrv.c
- drivers/video/msm/mddi.c
- drivers/video/msm/mdp.c
- drivers/video/nuc900fb.c
- drivers/video/omap2/displays/panel-taal.c
- drivers/video/ps3fb.c
- drivers/video/pxa3xx-gcu.c
- drivers/video/pxafb.c
- drivers/video/s3c2410fb.c
- drivers/video/sa1100fb.c
- drivers/video/tmiofb.c
- drivers/video/vt8500lcdfb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 97ab8ba..3a41c01 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1576,7 +1576,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-
- platform_set_drvdata(pdev, priv);
-
-- error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
-+ error = request_irq(i, sh_mobile_lcdc_irq, 0,
- dev_name(&pdev->dev), priv);
- if (error) {
- dev_err(&pdev->dev, "unable to request irq\n");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0123-video-Add-module.h-to-drivers-video-files-who-really.patch b/patches.armadillo800eva/0123-video-Add-module.h-to-drivers-video-files-who-really.patch
deleted file mode 100644
index 989d4272ff23c9..00000000000000
--- a/patches.armadillo800eva/0123-video-Add-module.h-to-drivers-video-files-who-really.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From c1078a8a456c56536478ee66109fbbbca07ef90e Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 3 Jul 2011 16:17:28 -0400
-Subject: video: Add module.h to drivers/video files who really use it.
-
-They were getting this implicitly by an include of module.h
-from device.h -- but we are going to clean that up and break
-that include chain, so include module.h explicitly now.
-
-[ with contributions from Axel Lin <axel.lin@gmail.com> ]
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 355b200bacdb6017669cdc5bc9e7b1037aac42a2)
-
-Conflicts:
-
- drivers/video/atmel_lcdfb.c
- drivers/video/backlight/88pm860x_bl.c
- drivers/video/backlight/adp5520_bl.c
- drivers/video/backlight/ams369fg06.c
- drivers/video/backlight/da903x_bl.c
- drivers/video/backlight/ep93xx_bl.c
- drivers/video/backlight/l4f00242t03.c
- drivers/video/backlight/ld9040.c
- drivers/video/backlight/lms283gf05.c
- drivers/video/backlight/max8925_bl.c
- drivers/video/backlight/s6e63m0.c
- drivers/video/backlight/wm831x_bl.c
- drivers/video/carminefb.c
- drivers/video/cobalt_lcdfb.c
- drivers/video/ep93xx-fb.c
- drivers/video/fb_ddc.c
- drivers/video/mb862xx/mb862xxfbdrv.c
- drivers/video/omap/lcd_mipid.c
- drivers/video/omap/omapfb_main.c
- drivers/video/omap2/dss/dsi.c
- drivers/video/savage/savagefb_accel.c
- drivers/video/w100fb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 1 +
- drivers/video/sh_mobile_lcdcfb.c | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 24640c8..72ee96b 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -17,6 +17,7 @@
- #include <linux/slab.h>
- #include <linux/string.h>
- #include <linux/types.h>
-+#include <linux/module.h>
-
- #include <video/mipi_display.h>
- #include <video/sh_mipi_dsi.h>
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 3a41c01..facffc2 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -23,6 +23,7 @@
- #include <linux/console.h>
- #include <linux/backlight.h>
- #include <linux/gpio.h>
-+#include <linux/module.h>
- #include <video/sh_mobile_lcdc.h>
- #include <video/sh_mobile_meram.h>
- #include <linux/atomic.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0124-fbdev-sh_mobile_lcdcfb-fixup-LDHAJR-HSYNPAJ-needs-ma.patch b/patches.armadillo800eva/0124-fbdev-sh_mobile_lcdcfb-fixup-LDHAJR-HSYNPAJ-needs-ma.patch
deleted file mode 100644
index e92d978a44e22e..00000000000000
--- a/patches.armadillo800eva/0124-fbdev-sh_mobile_lcdcfb-fixup-LDHAJR-HSYNPAJ-needs-ma.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 99dfaab457ce1a4ccb35e74a5142aae11f5912df Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:33:29 -0800
-Subject: fbdev: sh_mobile_lcdcfb: fixup LDHAJR :: HSYNPAJ needs mask
-
-LDHAJR register will be broken by hsync_pos without this patch
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 41e583c22c3f907e46e329764b4606117040a1ae)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index facffc2..1f49ab4 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -420,7 +420,7 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- tmp = ((display_var->xres & 7) << 24) |
- ((display_h_total & 7) << 16) |
- ((display_var->hsync_len & 7) << 8) |
-- hsync_pos;
-+ (hsync_pos & 7);
- lcdc_write_chan(ch, LDHAJR, tmp);
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0125-fbdev-sh_mipi_dsi-tidyup-dsip_clk.patch b/patches.armadillo800eva/0125-fbdev-sh_mipi_dsi-tidyup-dsip_clk.patch
deleted file mode 100644
index 30c65ff45cbdb7..00000000000000
--- a/patches.armadillo800eva/0125-fbdev-sh_mipi_dsi-tidyup-dsip_clk.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 883693112270305ab4d371a5f4924ea325691ec1 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:33:47 -0800
-Subject: fbdev: sh_mipi_dsi: tidyup dsip_clk
-
-dsipck clock is controled by CLKDEV_ICK_ID() in clock-shxxx.
-dsi0p_clk/dsi1p_clk naming is not needed.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 9250741e5feedb6a5273683a940b339af59a1086)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh7372.c | 4 ++--
- arch/arm/mach-shmobile/clock-sh73a0.c | 4 ++--
- drivers/video/sh_mipi_dsi.c | 4 +---
- 3 files changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
-index e116a95..7336bce 100644
---- a/arch/arm/mach-shmobile/clock-sh7372.c
-+++ b/arch/arm/mach-shmobile/clock-sh7372.c
-@@ -604,8 +604,8 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("hdmi_clk", &div6_reparent_clks[DIV6_HDMI]),
- CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
- CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
-- CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
-- CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
-+ CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
-+ CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
-
- /* MSTP32 clocks */
- CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index c4bef73..9fc2830 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -319,8 +319,8 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("sdhi2_clk", &div6_clks[DIV6_SDHI2]),
- CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
- CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
-- CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
-- CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
-+ CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
-+ CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
-
- /* MSTP32 clocks */
- CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 72ee96b..4aa5053 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -363,7 +363,6 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- unsigned long rate, f_current;
- int idx = pdev->id, ret;
-- char dsip_clk[] = "dsi.p_clk";
-
- if (!res || !res2 || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
- return -ENODEV;
-@@ -428,8 +427,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
-
- dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
-
-- sprintf(dsip_clk, "dsi%1.1dp_clk", idx);
-- mipi->dsip_clk = clk_get(&pdev->dev, dsip_clk);
-+ mipi->dsip_clk = clk_get(&pdev->dev, "dsip_clk");
- if (IS_ERR(mipi->dsip_clk)) {
- ret = PTR_ERR(mipi->dsip_clk);
- goto eclkpget;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0126-fbdev-sh_mipi_dsi-typo-fix-of-SH_MIPI_DSI_HBPBM.patch b/patches.armadillo800eva/0126-fbdev-sh_mipi_dsi-typo-fix-of-SH_MIPI_DSI_HBPBM.patch
deleted file mode 100644
index 812a5901a33770..00000000000000
--- a/patches.armadillo800eva/0126-fbdev-sh_mipi_dsi-typo-fix-of-SH_MIPI_DSI_HBPBM.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From ae293d490cb59082a9cebdcf1f31703fe1cb99bc Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:01 -0800
-Subject: fbdev: sh_mipi_dsi: typo fix of SH_MIPI_DSI_HBPBM
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 32ba95c69f33126e297466dc706db73cc7e7a543)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 2 +-
- include/video/sh_mipi_dsi.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 4aa5053..94bb1bb 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -318,7 +318,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- */
- if (pdata->flags & SH_MIPI_DSI_HSABM)
- vmctr2 |= 0x20;
-- if (pdata->flags & SH_MIPI_DSI_HSPBM)
-+ if (pdata->flags & SH_MIPI_DSI_HBPBM)
- vmctr2 |= 0x10;
- iowrite32(vmctr2, mipi->linkbase + VMCTR2);
-
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 6cb95c9..4e2bcb5 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -28,7 +28,7 @@ enum sh_mipi_dsi_data_fmt {
- struct sh_mobile_lcdc_chan_cfg;
-
- #define SH_MIPI_DSI_HSABM (1 << 0)
--#define SH_MIPI_DSI_HSPBM (1 << 1)
-+#define SH_MIPI_DSI_HBPBM (1 << 1)
-
- struct sh_mipi_dsi_info {
- enum sh_mipi_dsi_data_fmt data_format;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0127-fbdev-sh_mipi_dsi-tidyup-VMCTR2-parameter-expression.patch b/patches.armadillo800eva/0127-fbdev-sh_mipi_dsi-tidyup-VMCTR2-parameter-expression.patch
deleted file mode 100644
index e8c750753646ea..00000000000000
--- a/patches.armadillo800eva/0127-fbdev-sh_mipi_dsi-tidyup-VMCTR2-parameter-expression.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 58f65adecdc4b62a84325391c9adee322336c713 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:12 -0800
-Subject: fbdev: sh_mipi_dsi: tidyup VMCTR2 parameter expression
-
-VMCTR2 parameter will be supported more in the future.
-1 << xx style is easy to understand.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 3c2a659936ba1e3bbd7e5eca89255c134fafb506)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 94bb1bb..20ccc23 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -317,9 +317,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- * HSA period allowed, no commands in LP
- */
- if (pdata->flags & SH_MIPI_DSI_HSABM)
-- vmctr2 |= 0x20;
-+ vmctr2 |= 1 << 5;
- if (pdata->flags & SH_MIPI_DSI_HBPBM)
-- vmctr2 |= 0x10;
-+ vmctr2 |= 1 << 4;
- iowrite32(vmctr2, mipi->linkbase + VMCTR2);
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0128-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_HFPBM-flag.patch b/patches.armadillo800eva/0128-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_HFPBM-flag.patch
deleted file mode 100644
index 951971d2232c4e..00000000000000
--- a/patches.armadillo800eva/0128-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_HFPBM-flag.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 201a9816caf85e7306d0482d230e496ceb45adbc Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:24 -0800
-Subject: fbdev: sh_mipi_dsi: add SH_MIPI_DSI_HFPBM flag
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit f7b0af68bc9f5eb5291996706951661d57909137)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 2 ++
- include/video/sh_mipi_dsi.h | 1 +
- 2 files changed, 3 insertions(+)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 20ccc23..c9fac13 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -320,6 +320,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- vmctr2 |= 1 << 5;
- if (pdata->flags & SH_MIPI_DSI_HBPBM)
- vmctr2 |= 1 << 4;
-+ if (pdata->flags & SH_MIPI_DSI_HFPBM)
-+ vmctr2 |= 1 << 3;
- iowrite32(vmctr2, mipi->linkbase + VMCTR2);
-
- /*
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 4e2bcb5..86a72c0 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -29,6 +29,7 @@ struct sh_mobile_lcdc_chan_cfg;
-
- #define SH_MIPI_DSI_HSABM (1 << 0)
- #define SH_MIPI_DSI_HBPBM (1 << 1)
-+#define SH_MIPI_DSI_HFPBM (1 << 2)
-
- struct sh_mipi_dsi_info {
- enum sh_mipi_dsi_data_fmt data_format;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0129-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_BL2E-flag.patch b/patches.armadillo800eva/0129-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_BL2E-flag.patch
deleted file mode 100644
index 9e5c4054d2d8bc..00000000000000
--- a/patches.armadillo800eva/0129-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_BL2E-flag.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a8bbb7d8e03ba80f4e3bbf24464dcf6567617747 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:33 -0800
-Subject: fbdev: sh_mipi_dsi: add SH_MIPI_DSI_BL2E flag
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit d07a9d2a5e82ed677971b2e9f3e4cbd49b9ec34e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 2 ++
- include/video/sh_mipi_dsi.h | 1 +
- 2 files changed, 3 insertions(+)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index c9fac13..dfd5154 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -316,6 +316,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- * Non-burst mode with sync pulses: VSE and HSE are output,
- * HSA period allowed, no commands in LP
- */
-+ if (pdata->flags & SH_MIPI_DSI_BL2E)
-+ vmctr2 |= 1 << 17;
- if (pdata->flags & SH_MIPI_DSI_HSABM)
- vmctr2 |= 1 << 5;
- if (pdata->flags & SH_MIPI_DSI_HBPBM)
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 86a72c0..58b78f8 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -30,6 +30,7 @@ struct sh_mobile_lcdc_chan_cfg;
- #define SH_MIPI_DSI_HSABM (1 << 0)
- #define SH_MIPI_DSI_HBPBM (1 << 1)
- #define SH_MIPI_DSI_HFPBM (1 << 2)
-+#define SH_MIPI_DSI_BL2E (1 << 3)
-
- struct sh_mipi_dsi_info {
- enum sh_mipi_dsi_data_fmt data_format;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0130-fbdev-sh_mipi_dsi-add-lane-control-support.patch b/patches.armadillo800eva/0130-fbdev-sh_mipi_dsi-add-lane-control-support.patch
deleted file mode 100644
index 09257ccc66fedd..00000000000000
--- a/patches.armadillo800eva/0130-fbdev-sh_mipi_dsi-add-lane-control-support.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 4c15c6a3e5916682a8545836816f52ac4dc8be57 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:43 -0800
-Subject: fbdev: sh_mipi_dsi: add lane control support
-
-SH MIPI DSI can use 0-4 lane
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 26c3d7ac219e74ab3939048a32d6bd3b4a16798a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 1 +
- arch/arm/mach-shmobile/board-ap4evb.c | 1 +
- drivers/video/sh_mipi_dsi.c | 10 +++++++++-
- include/video/sh_mipi_dsi.h | 1 +
- 4 files changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index ce5c251..70beba2 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -323,6 +323,7 @@ static struct resource mipidsi0_resources[] = {
- static struct sh_mipi_dsi_info mipidsi0_info = {
- .data_format = MIPI_RGB888,
- .lcd_chan = &lcdc0_info.ch[0],
-+ .lane = 2,
- .vsynw_offset = 20,
- .clksrc = 1,
- .flags = SH_MIPI_DSI_HSABM,
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 803bc6e..1cf6040 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -578,6 +578,7 @@ static struct resource mipidsi0_resources[] = {
- static struct sh_mipi_dsi_info mipidsi0_info = {
- .data_format = MIPI_RGB888,
- .lcd_chan = &lcdc_info.ch[0],
-+ .lane = 2,
- .vsynw_offset = 17,
- };
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index dfd5154..af6bec2 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -8,6 +8,7 @@
- * published by the Free Software Foundation.
- */
-
-+#include <linux/bitmap.h>
- #include <linux/clk.h>
- #include <linux/delay.h>
- #include <linux/init.h>
-@@ -153,6 +154,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
- u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000;
- bool yuv;
-+ u32 tmp;
-
- /*
- * Select data format. MIPI DSI is not hot-pluggable, so, we just use
-@@ -253,6 +255,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- (!yuv && ch->interface_type != RGB24))
- return -EINVAL;
-
-+ if (!pdata->lane)
-+ return -EINVAL;
-+
- /* reset DSI link */
- iowrite32(0x00000001, base + SYSCTRL);
- /* Hold reset for 100 cycles of the slowest of bus, HS byte and LP clock */
-@@ -269,7 +274,10 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- * ECC check enable
- * additionally enable first two lanes
- */
-- iowrite32(0x00003703, base + SYSCONF);
-+ bitmap_fill((unsigned long *)&tmp, pdata->lane);
-+ tmp |= 0x00003700;
-+ iowrite32(tmp, base + SYSCONF);
-+
- /*
- * T_wakeup = 0x7000
- * T_hs-trail = 3
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 58b78f8..3d0ec50 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -35,6 +35,7 @@ struct sh_mobile_lcdc_chan_cfg;
- struct sh_mipi_dsi_info {
- enum sh_mipi_dsi_data_fmt data_format;
- struct sh_mobile_lcdc_chan_cfg *lcd_chan;
-+ int lane;
- unsigned long flags;
- u32 clksrc;
- unsigned int vsynw_offset;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0131-fbdev-sh_mipi_dsi-add-sync_pulses-sync_events-burst-.patch b/patches.armadillo800eva/0131-fbdev-sh_mipi_dsi-add-sync_pulses-sync_events-burst-.patch
deleted file mode 100644
index cbeafc5acddd64..00000000000000
--- a/patches.armadillo800eva/0131-fbdev-sh_mipi_dsi-add-sync_pulses-sync_events-burst-.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 140ac3e8915cfd48cda5cd305136597b3c19ff29 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:34:55 -0800
-Subject: fbdev: sh_mipi_dsi: add sync_pulses/sync_events/burst mode
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit f832906a56bcf9c597589e9a7898c1dd2f0513b9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 3 ++-
- arch/arm/mach-shmobile/board-ap4evb.c | 1 +
- drivers/video/sh_mipi_dsi.c | 9 ++++++++-
- include/video/sh_mipi_dsi.h | 9 +++++++++
- 4 files changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 70beba2..87e9091 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -326,7 +326,8 @@ static struct sh_mipi_dsi_info mipidsi0_info = {
- .lane = 2,
- .vsynw_offset = 20,
- .clksrc = 1,
-- .flags = SH_MIPI_DSI_HSABM,
-+ .flags = SH_MIPI_DSI_HSABM |
-+ SH_MIPI_DSI_SYNC_PULSES_MODE,
- };
-
- static struct platform_device mipidsi0_device = {
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 1cf6040..5db88ba 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -580,6 +580,7 @@ static struct sh_mipi_dsi_info mipidsi0_info = {
- .lcd_chan = &lcdc_info.ch[0],
- .lane = 2,
- .vsynw_offset = 17,
-+ .flags = SH_MIPI_DSI_SYNC_PULSES_MODE,
- };
-
- static struct platform_device mipidsi0_device = {
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index af6bec2..b8c4873 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -152,7 +152,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- {
- void __iomem *base = mipi->base;
- struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
-- u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000;
-+ u32 pctype, datatype, pixfmt, linelength, vmctr2;
- bool yuv;
- u32 tmp;
-
-@@ -324,6 +324,13 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- * Non-burst mode with sync pulses: VSE and HSE are output,
- * HSA period allowed, no commands in LP
- */
-+ vmctr2 = 0;
-+ if (pdata->flags & SH_MIPI_DSI_VSEE)
-+ vmctr2 |= 1 << 23;
-+ if (pdata->flags & SH_MIPI_DSI_HSEE)
-+ vmctr2 |= 1 << 22;
-+ if (pdata->flags & SH_MIPI_DSI_HSAE)
-+ vmctr2 |= 1 << 21;
- if (pdata->flags & SH_MIPI_DSI_BL2E)
- vmctr2 |= 1 << 17;
- if (pdata->flags & SH_MIPI_DSI_HSABM)
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 3d0ec50..c8225b4 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -31,6 +31,15 @@ struct sh_mobile_lcdc_chan_cfg;
- #define SH_MIPI_DSI_HBPBM (1 << 1)
- #define SH_MIPI_DSI_HFPBM (1 << 2)
- #define SH_MIPI_DSI_BL2E (1 << 3)
-+#define SH_MIPI_DSI_VSEE (1 << 4)
-+#define SH_MIPI_DSI_HSEE (1 << 5)
-+#define SH_MIPI_DSI_HSAE (1 << 6)
-+
-+#define SH_MIPI_DSI_SYNC_PULSES_MODE (SH_MIPI_DSI_VSEE | \
-+ SH_MIPI_DSI_HSEE | \
-+ SH_MIPI_DSI_HSAE)
-+#define SH_MIPI_DSI_SYNC_EVENTS_MODE (0)
-+#define SH_MIPI_DSI_SYNC_BURST_MODE (SH_MIPI_DSI_BL2E)
-
- struct sh_mipi_dsi_info {
- enum sh_mipi_dsi_data_fmt data_format;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0132-fbdev-sh_mipi_dsi-add-VMLEN1-VMLEN2-calculation.patch b/patches.armadillo800eva/0132-fbdev-sh_mipi_dsi-add-VMLEN1-VMLEN2-calculation.patch
deleted file mode 100644
index 38bbd2df7c19d2..00000000000000
--- a/patches.armadillo800eva/0132-fbdev-sh_mipi_dsi-add-VMLEN1-VMLEN2-calculation.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From d9f07c596acae1663a208454d970fd7e5c6eddff Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:05 -0800
-Subject: fbdev: sh_mipi_dsi: add VMLEN1/VMLEN2 calculation
-
-VMLEN1/VMLEN2 needs blanking length which is calculated from
-video image size.
-
-The calculation methods are explained on
-[SH MIPI] - [Video Mode] - [Blanking Packet setting]
-But HFPLEN (= VMLEN2) is un-understandable.
-
-For example, if SH-MIPI input was RGB888 (3byte),
-output was RGB888 (3byte)
-and 3lane connection, the date goes straight.
-
-But if SH-MIPI input was RGB888 (3byte),
-output was RGB565 (2byte)
-and 4lane connection, it needs delay in HFPLEN.
-Then (input cycle - output cycle) * lane is necessary the delay
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 08750617badd03fd95f33921a5213a5632022178)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 45 ++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 40 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index b8c4873..190e941 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -42,6 +42,7 @@
- #define VMCTR1 0x0020
- #define VMCTR2 0x0024
- #define VMLEN1 0x0028
-+#define VMLEN2 0x002c
- #define CMTSRTREQ 0x0070
- #define CMTSRTCTR 0x00d0
-
-@@ -153,8 +154,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- void __iomem *base = mipi->base;
- struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
- u32 pctype, datatype, pixfmt, linelength, vmctr2;
-+ u32 tmp, top, bottom, delay;
- bool yuv;
-- u32 tmp;
-+ int bpp;
-
- /*
- * Select data format. MIPI DSI is not hot-pluggable, so, we just use
-@@ -342,11 +344,44 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- iowrite32(vmctr2, mipi->linkbase + VMCTR2);
-
- /*
-- * 0x660 = 1632 bytes per line (RGB24, 544 pixels: see
-- * sh_mobile_lcdc_info.ch[0].lcd_cfg[0].xres), HSALEN = 1 - default
-- * (unused if VMCTR2[HSABM] = 0)
-+ * VMLEN1 = RGBLEN | HSALEN
-+ *
-+ * see
-+ * Video mode - Blanking Packet setting
- */
-- iowrite32(1 | (linelength << 16), mipi->linkbase + VMLEN1);
-+ top = linelength << 16; /* RGBLEN */
-+ bottom = 0x00000001;
-+ if (pdata->flags & SH_MIPI_DSI_HSABM) /* HSALEN */
-+ bottom = (pdata->lane * ch->lcd_cfg[0].hsync_len) - 10;
-+ iowrite32(top | bottom , mipi->linkbase + VMLEN1);
-+
-+ /*
-+ * VMLEN2 = HBPLEN | HFPLEN
-+ *
-+ * see
-+ * Video mode - Blanking Packet setting
-+ */
-+ top = 0x00010000;
-+ bottom = 0x00000001;
-+ delay = 0;
-+
-+ if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */
-+ top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin;
-+ top = ((pdata->lane * top) - 10) << 16;
-+ }
-+ if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */
-+ bottom = ch->lcd_cfg[0].right_margin;
-+ bottom = (pdata->lane * bottom) - 12;
-+ }
-+
-+ bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */
-+ if (pdata->lane > bpp) {
-+ tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */
-+ tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */
-+ delay = (pdata->lane * tmp);
-+ }
-+
-+ iowrite32(top | (bottom + delay) , mipi->linkbase + VMLEN2);
-
- msleep(5);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0133-fbdev-sh_mipi_dsi-add-set_dot_clock-for-each-platfor.patch b/patches.armadillo800eva/0133-fbdev-sh_mipi_dsi-add-set_dot_clock-for-each-platfor.patch
deleted file mode 100644
index 4ca0b27ec2b631..00000000000000
--- a/patches.armadillo800eva/0133-fbdev-sh_mipi_dsi-add-set_dot_clock-for-each-platfor.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 72fb7f1eb9dae522c75c2805a61cc38882791f03 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:14 -0800
-Subject: fbdev: sh_mipi_dsi: add set_dot_clock() for each platform
-
-Dot clock of SH MIPI are depends on each platform board.
-This patch adds set_dot_clock() function for it.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 5e47431aabf716c9ad9eacf1a966e1fc1469c809)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ag5evm.c
- arch/arm/mach-shmobile/board-ap4evb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 45 +++++++++++--------------------------------
- include/video/sh_mipi_dsi.h | 3 +++
- 2 files changed, 14 insertions(+), 34 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 190e941..77743f4 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -53,7 +53,6 @@ struct sh_mipi {
- void __iomem *base;
- void __iomem *linkbase;
- struct clk *dsit_clk;
-- struct clk *dsip_clk;
- struct device *dev;
-
- void *next_board_data;
-@@ -307,8 +306,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- /* DSI-Tx bias on */
- iowrite32(0x00000001, base + PHYCTRL);
- udelay(200);
-- /* Deassert resets, power on, set multiplier */
-- iowrite32(0x03070b01, base + PHYCTRL);
-+ /* Deassert resets, power on */
-+ iowrite32(0x03070001, base + PHYCTRL);
-
- /* setup l-bridge */
-
-@@ -421,6 +420,9 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- if (!res || !res2 || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
- return -ENODEV;
-
-+ if (!pdata->set_dot_clock)
-+ return -EINVAL;
-+
- mutex_lock(&array_lock);
- if (idx < 0)
- for (idx = 0; idx < ARRAY_SIZE(mipi_dsi) && mipi_dsi[idx]; idx++)
-@@ -481,34 +483,10 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
-
- dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
-
-- mipi->dsip_clk = clk_get(&pdev->dev, "dsip_clk");
-- if (IS_ERR(mipi->dsip_clk)) {
-- ret = PTR_ERR(mipi->dsip_clk);
-- goto eclkpget;
-- }
--
-- f_current = clk_get_rate(mipi->dsip_clk);
-- /* Between 10 and 50MHz */
-- rate = clk_round_rate(mipi->dsip_clk, 24000000);
-- if (rate > 0 && rate != f_current)
-- ret = clk_set_rate(mipi->dsip_clk, rate);
-- else
-- ret = rate;
-- if (ret < 0)
-- goto esetprate;
--
-- dev_dbg(&pdev->dev, "DSI-P clk %lu -> %lu\n", f_current, rate);
--
-- msleep(10);
--
- ret = clk_enable(mipi->dsit_clk);
- if (ret < 0)
- goto eclkton;
-
-- ret = clk_enable(mipi->dsip_clk);
-- if (ret < 0)
-- goto eclkpon;
--
- mipi_dsi[idx] = mipi;
-
- pm_runtime_enable(&pdev->dev);
-@@ -518,6 +496,10 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- if (ret < 0)
- goto emipisetup;
-
-+ ret = pdata->set_dot_clock(pdev, mipi->base, 1);
-+ if (ret < 0)
-+ goto emipisetup;
-+
- mutex_unlock(&array_lock);
- platform_set_drvdata(pdev, mipi);
-
-@@ -537,13 +519,8 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- emipisetup:
- mipi_dsi[idx] = NULL;
- pm_runtime_disable(&pdev->dev);
-- clk_disable(mipi->dsip_clk);
--eclkpon:
- clk_disable(mipi->dsit_clk);
- eclkton:
--esetprate:
-- clk_put(mipi->dsip_clk);
--eclkpget:
- esettrate:
- clk_put(mipi->dsit_clk);
- eclktget:
-@@ -594,10 +571,10 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
- pdata->lcd_chan->board_cfg.board_data = NULL;
-
- pm_runtime_disable(&pdev->dev);
-- clk_disable(mipi->dsip_clk);
- clk_disable(mipi->dsit_clk);
- clk_put(mipi->dsit_clk);
-- clk_put(mipi->dsip_clk);
-+ pdata->set_dot_clock(pdev, mipi->base, 0);
-+
- iounmap(mipi->linkbase);
- if (res2)
- release_mem_region(res2->start, resource_size(res2));
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index c8225b4..310b883 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -48,6 +48,9 @@ struct sh_mipi_dsi_info {
- unsigned long flags;
- u32 clksrc;
- unsigned int vsynw_offset;
-+ int (*set_dot_clock)(struct platform_device *pdev,
-+ void __iomem *base,
-+ int enable);
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0134-fbdev-sh_mipi_dsi-add-HSxxCLK-support.patch b/patches.armadillo800eva/0134-fbdev-sh_mipi_dsi-add-HSxxCLK-support.patch
deleted file mode 100644
index bcbf07b0b8c73c..00000000000000
--- a/patches.armadillo800eva/0134-fbdev-sh_mipi_dsi-add-HSxxCLK-support.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 3e92ce8c74c424c9641d078d20bb16dd879df9fe Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:27 -0800
-Subject: fbdev: sh_mipi_dsi: add HSxxCLK support
-
-SH MIPI manual explains the calculation method of HBP/HFP.
-it is based on HSbyteCLK settings.
-SH73a0 chip can use HS6divCLK/HS4divCLK for it.
-This patch has compatibility to SH7372 mipi
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit a2e6297153f8fc7185d119c59d8eed1ee7d4c74f)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ag5evm.c
- arch/arm/mach-shmobile/board-ap4evb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 14 ++++++++++----
- include/video/sh_mipi_dsi.h | 4 ++++
- 2 files changed, 14 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 77743f4..b8aea8c 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -153,7 +153,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- void __iomem *base = mipi->base;
- struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
- u32 pctype, datatype, pixfmt, linelength, vmctr2;
-- u32 tmp, top, bottom, delay;
-+ u32 tmp, top, bottom, delay, div;
- bool yuv;
- int bpp;
-
-@@ -364,17 +364,23 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- bottom = 0x00000001;
- delay = 0;
-
-+ div = 1; /* HSbyteCLK is calculation base
-+ * HS4divCLK = HSbyteCLK/2
-+ * HS6divCLK is not supported for now */
-+ if (pdata->flags & SH_MIPI_DSI_HS4divCLK)
-+ div = 2;
-+
- if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */
- top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin;
-- top = ((pdata->lane * top) - 10) << 16;
-+ top = ((pdata->lane * top / div) - 10) << 16;
- }
- if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */
- bottom = ch->lcd_cfg[0].right_margin;
-- bottom = (pdata->lane * bottom) - 12;
-+ bottom = (pdata->lane * bottom / div) - 12;
- }
-
- bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */
-- if (pdata->lane > bpp) {
-+ if ((pdata->lane / div) > bpp) {
- tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */
- tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */
- delay = (pdata->lane * tmp);
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 310b883..434d56b 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -35,6 +35,10 @@ struct sh_mobile_lcdc_chan_cfg;
- #define SH_MIPI_DSI_HSEE (1 << 5)
- #define SH_MIPI_DSI_HSAE (1 << 6)
-
-+#define SH_MIPI_DSI_HSbyteCLK (1 << 24)
-+#define SH_MIPI_DSI_HS6divCLK (1 << 25)
-+#define SH_MIPI_DSI_HS4divCLK (1 << 26)
-+
- #define SH_MIPI_DSI_SYNC_PULSES_MODE (SH_MIPI_DSI_VSEE | \
- SH_MIPI_DSI_HSEE | \
- SH_MIPI_DSI_HSAE)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0135-fbdev-sh_mipi_dsi-sh_mipi-has-pdata-instead-of-dev.patch b/patches.armadillo800eva/0135-fbdev-sh_mipi_dsi-sh_mipi-has-pdata-instead-of-dev.patch
deleted file mode 100644
index b232427867bd4d..00000000000000
--- a/patches.armadillo800eva/0135-fbdev-sh_mipi_dsi-sh_mipi-has-pdata-instead-of-dev.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From e4b43eae56dea01d88026bc9e915c4bfd1847fe6 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:36 -0800
-Subject: fbdev: sh_mipi_dsi: sh_mipi has pdata instead of dev
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 7d9f88b4f427df6dab7ff92ea81f1ddb7e9c95e4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index b8aea8c..7e46505 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -53,7 +53,7 @@ struct sh_mipi {
- void __iomem *base;
- void __iomem *linkbase;
- struct clk *dsit_clk;
-- struct device *dev;
-+ struct platform_device *pdev;
-
- void *next_board_data;
- void (*next_display_on)(void *board_data, struct fb_info *info);
-@@ -129,7 +129,7 @@ static void mipi_display_on(void *arg, struct fb_info *info)
- {
- struct sh_mipi *mipi = arg;
-
-- pm_runtime_get_sync(mipi->dev);
-+ pm_runtime_get_sync(&mipi->pdev->dev);
- sh_mipi_dsi_enable(mipi, true);
-
- if (mipi->next_display_on)
-@@ -144,7 +144,7 @@ static void mipi_display_off(void *arg)
- mipi->next_display_off(mipi->next_board_data);
-
- sh_mipi_dsi_enable(mipi, false);
-- pm_runtime_put(mipi->dev);
-+ pm_runtime_put(&mipi->pdev->dev);
- }
-
- static int __init sh_mipi_setup(struct sh_mipi *mipi,
-@@ -469,7 +469,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- goto emap2;
- }
-
-- mipi->dev = &pdev->dev;
-+ mipi->pdev = pdev;
-
- mipi->dsit_clk = clk_get(&pdev->dev, "dsit_clk");
- if (IS_ERR(mipi->dsit_clk)) {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0136-fbdev-sh_mipi_dsi-fixup-setup-timing-of-sh_mipi_setu.patch b/patches.armadillo800eva/0136-fbdev-sh_mipi_dsi-fixup-setup-timing-of-sh_mipi_setu.patch
deleted file mode 100644
index 250317d66536a8..00000000000000
--- a/patches.armadillo800eva/0136-fbdev-sh_mipi_dsi-fixup-setup-timing-of-sh_mipi_setu.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From d642b03d416c201afb2e557c6c5bc181621cbcbd Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:45 -0800
-Subject: fbdev: sh_mipi_dsi: fixup setup timing of sh_mipi_setup()
-
-sh_mipi_setup() should be called after setting of CPG
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit c2658b70f06108361aa5024798f9c1bf47c73374)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 79 ++++++++++++++++++++++++-------------------
- 1 file changed, 44 insertions(+), 35 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 7e46505..f2c3f94 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -125,28 +125,6 @@ static void sh_mipi_shutdown(struct platform_device *pdev)
- sh_mipi_dsi_enable(mipi, false);
- }
-
--static void mipi_display_on(void *arg, struct fb_info *info)
--{
-- struct sh_mipi *mipi = arg;
--
-- pm_runtime_get_sync(&mipi->pdev->dev);
-- sh_mipi_dsi_enable(mipi, true);
--
-- if (mipi->next_display_on)
-- mipi->next_display_on(mipi->next_board_data, info);
--}
--
--static void mipi_display_off(void *arg)
--{
-- struct sh_mipi *mipi = arg;
--
-- if (mipi->next_display_off)
-- mipi->next_display_off(mipi->next_board_data);
--
-- sh_mipi_dsi_enable(mipi, false);
-- pm_runtime_put(&mipi->pdev->dev);
--}
--
- static int __init sh_mipi_setup(struct sh_mipi *mipi,
- struct sh_mipi_dsi_info *pdata)
- {
-@@ -414,6 +392,50 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- return 0;
- }
-
-+static void mipi_display_on(void *arg, struct fb_info *info)
-+{
-+ struct sh_mipi *mipi = arg;
-+ struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-+ int ret;
-+
-+ pm_runtime_get_sync(&mipi->pdev->dev);
-+
-+ ret = pdata->set_dot_clock(mipi->pdev, mipi->base, 1);
-+ if (ret < 0)
-+ goto mipi_display_on_fail1;
-+
-+ ret = sh_mipi_setup(mipi, pdata);
-+ if (ret < 0)
-+ goto mipi_display_on_fail2;
-+
-+ sh_mipi_dsi_enable(mipi, true);
-+
-+ if (mipi->next_display_on)
-+ mipi->next_display_on(mipi->next_board_data, info);
-+
-+ return;
-+
-+mipi_display_on_fail1:
-+ pm_runtime_put_sync(&mipi->pdev->dev);
-+mipi_display_on_fail2:
-+ pdata->set_dot_clock(mipi->pdev, mipi->base, 0);
-+}
-+
-+static void mipi_display_off(void *arg)
-+{
-+ struct sh_mipi *mipi = arg;
-+ struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-+
-+ if (mipi->next_display_off)
-+ mipi->next_display_off(mipi->next_board_data);
-+
-+ sh_mipi_dsi_enable(mipi, false);
-+
-+ pdata->set_dot_clock(mipi->pdev, mipi->base, 0);
-+
-+ pm_runtime_put_sync(&mipi->pdev->dev);
-+}
-+
- static int __init sh_mipi_probe(struct platform_device *pdev)
- {
- struct sh_mipi *mipi;
-@@ -498,14 +520,6 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- pm_runtime_enable(&pdev->dev);
- pm_runtime_resume(&pdev->dev);
-
-- ret = sh_mipi_setup(mipi, pdata);
-- if (ret < 0)
-- goto emipisetup;
--
-- ret = pdata->set_dot_clock(pdev, mipi->base, 1);
-- if (ret < 0)
-- goto emipisetup;
--
- mutex_unlock(&array_lock);
- platform_set_drvdata(pdev, mipi);
-
-@@ -522,10 +536,6 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
-
- return 0;
-
--emipisetup:
-- mipi_dsi[idx] = NULL;
-- pm_runtime_disable(&pdev->dev);
-- clk_disable(mipi->dsit_clk);
- eclkton:
- esettrate:
- clk_put(mipi->dsit_clk);
-@@ -579,7 +589,6 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
- pm_runtime_disable(&pdev->dev);
- clk_disable(mipi->dsit_clk);
- clk_put(mipi->dsit_clk);
-- pdata->set_dot_clock(pdev, mipi->base, 0);
-
- iounmap(mipi->linkbase);
- if (res2)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0137-fbdev-sh_mipi_dsi-fixup-setup-timing-of-SYSCONF.patch b/patches.armadillo800eva/0137-fbdev-sh_mipi_dsi-fixup-setup-timing-of-SYSCONF.patch
deleted file mode 100644
index b06c5de74371f4..00000000000000
--- a/patches.armadillo800eva/0137-fbdev-sh_mipi_dsi-fixup-setup-timing-of-SYSCONF.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c504438caf59f330b34db335804a9ceca7e1fabf Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:35:56 -0800
-Subject: fbdev: sh_mipi_dsi: fixup setup timing of SYSCONF
-
-SYSCONF should be set after PHYCTRL
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit a2065a368cc2539d6a48450f367f5033c699cdc4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 23 +++++++++++------------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index f2c3f94..187e127 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -246,18 +246,6 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- /* setup DSI link */
-
- /*
-- * Default = ULPS enable |
-- * Contention detection enabled |
-- * EoT packet transmission enable |
-- * CRC check enable |
-- * ECC check enable
-- * additionally enable first two lanes
-- */
-- bitmap_fill((unsigned long *)&tmp, pdata->lane);
-- tmp |= 0x00003700;
-- iowrite32(tmp, base + SYSCONF);
--
-- /*
- * T_wakeup = 0x7000
- * T_hs-trail = 3
- * T_hs-prepare = 3
-@@ -287,6 +275,17 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- /* Deassert resets, power on */
- iowrite32(0x03070001, base + PHYCTRL);
-
-+ /*
-+ * Default = ULPS enable |
-+ * Contention detection enabled |
-+ * EoT packet transmission enable |
-+ * CRC check enable |
-+ * ECC check enable
-+ */
-+ bitmap_fill((unsigned long *)&tmp, pdata->lane);
-+ tmp |= 0x00003700;
-+ iowrite32(tmp, base + SYSCONF);
-+
- /* setup l-bridge */
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0138-fbdev-sh_mipi_dsi-fixup-setup-timing-DSICTRL.patch b/patches.armadillo800eva/0138-fbdev-sh_mipi_dsi-fixup-setup-timing-DSICTRL.patch
deleted file mode 100644
index 5568035b7955de..00000000000000
--- a/patches.armadillo800eva/0138-fbdev-sh_mipi_dsi-fixup-setup-timing-DSICTRL.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 228f32c1dd653d1624fdb1e7ad2a5ae15c3a3313 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 8 Nov 2011 20:36:07 -0800
-Subject: fbdev: sh_mipi_dsi: fixup setup timing DSICTRL
-
-DSICTRL should be called after all mipi settings
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 97cab45583f75428773547f3bbe59fece05420d3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 187e127..05151b8 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -265,8 +265,6 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- iowrite32(0x0fffffff, base + TATOVSET);
- /* Peripheral reset timeout, default 0xffffffff */
- iowrite32(0x0fffffff, base + PRTOVSET);
-- /* Enable timeout counters */
-- iowrite32(0x00000f00, base + DSICTRL);
- /* Interrupts not used, disable all */
- iowrite32(0, base + DSIINTE);
- /* DSI-Tx bias on */
-@@ -388,6 +386,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- pixfmt << 4);
- sh_mipi_dcs(ch->chan, MIPI_DCS_SET_DISPLAY_ON);
-
-+ /* Enable timeout counters */
-+ iowrite32(0x00000f00, base + DSICTRL);
-+
- return 0;
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0139-video-convert-drivers-video-to-use-module_platform_d.patch b/patches.armadillo800eva/0139-video-convert-drivers-video-to-use-module_platform_d.patch
deleted file mode 100644
index bc4ab4d834382a..00000000000000
--- a/patches.armadillo800eva/0139-video-convert-drivers-video-to-use-module_platform_d.patch
+++ /dev/null
@@ -1,386 +0,0 @@
-From f6feb296d6b1a27441b3776be80ba86f6be4c95a Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Sat, 26 Nov 2011 10:25:54 +0800
-Subject: video: convert drivers/video/* to use module_platform_driver()
-
-This patch converts the drivers in drivers/video/* to use the
-module_platform_driver() macro which makes the code smaller and a bit
-simpler.
-
-Cc: Ben Dooks <ben@simtec.co.uk>
-Cc: Manuel Lauss <mano@roarinelk.homelinux.net>
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Acked-by: Wan ZongShun <mcuos.com@gmail.com>
-Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
-Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
-Acked-by: Alexey Charkov <alchark@gmail.com>
-Acked-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Acked-by: Jingoo Han <jg1.han@samsung.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 4277f2c4667187cbbdd3da3be31ee681bc6b8300)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/mxsfb.c | 13 +------------
- drivers/video/nuc900fb.c | 13 +------------
- drivers/video/pxa168fb.c | 12 +-----------
- drivers/video/pxa3xx-gcu.c | 15 +--------------
- drivers/video/s3c-fb.c | 13 +------------
- drivers/video/sh7760fb.c | 13 +------------
- drivers/video/sh_mobile_lcdcfb.c | 13 +------------
- drivers/video/sh_mobile_meram.c | 13 +------------
- drivers/video/sm501fb.c | 13 +------------
- drivers/video/vt8500lcdfb.c | 13 +------------
- drivers/video/w100fb.c | 13 +------------
- drivers/video/wm8505fb.c | 13 +------------
- drivers/video/wmt_ge_rops.c | 13 +------------
- drivers/video/xilinxfb.c | 20 +-------------------
- 14 files changed, 14 insertions(+), 176 deletions(-)
-
-diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
-index 0b2f2dd..55e6680 100644
---- a/drivers/video/mxsfb.c
-+++ b/drivers/video/mxsfb.c
-@@ -901,18 +901,7 @@ static struct platform_driver mxsfb_driver = {
- },
- };
-
--static int __init mxsfb_init(void)
--{
-- return platform_driver_register(&mxsfb_driver);
--}
--
--static void __exit mxsfb_exit(void)
--{
-- platform_driver_unregister(&mxsfb_driver);
--}
--
--module_init(mxsfb_init);
--module_exit(mxsfb_exit);
-+module_platform_driver(mxsfb_devtype);
-
- MODULE_DESCRIPTION("Freescale mxs framebuffer driver");
- MODULE_AUTHOR("Sascha Hauer, Pengutronix");
-diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
-index f838d9e..675255e 100644
---- a/drivers/video/nuc900fb.c
-+++ b/drivers/video/nuc900fb.c
-@@ -763,18 +763,7 @@ static struct platform_driver nuc900fb_driver = {
- },
- };
-
--int __devinit nuc900fb_init(void)
--{
-- return platform_driver_register(&nuc900fb_driver);
--}
--
--static void __exit nuc900fb_cleanup(void)
--{
-- platform_driver_unregister(&nuc900fb_driver);
--}
--
--module_init(nuc900fb_init);
--module_exit(nuc900fb_cleanup);
-+module_platform_driver(nuc900fb_driver);
-
- MODULE_DESCRIPTION("Framebuffer driver for the NUC900");
- MODULE_LICENSE("GPL");
-diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
-index bb95ec5..53d575e 100644
---- a/drivers/video/pxa168fb.c
-+++ b/drivers/video/pxa168fb.c
-@@ -832,17 +832,7 @@ static struct platform_driver pxa168fb_driver = {
- .remove = __devexit_p(pxa168fb_remove),
- };
-
--static int __init pxa168fb_init(void)
--{
-- return platform_driver_register(&pxa168fb_driver);
--}
--module_init(pxa168fb_init);
--
--static void __exit pxa168fb_exit(void)
--{
-- platform_driver_unregister(&pxa168fb_driver);
--}
--module_exit(pxa168fb_exit);
-+module_platform_driver(pxa168fb_driver);
-
- MODULE_AUTHOR("Lennert Buytenhek <buytenh@marvell.com> "
- "Green Wan <gwan@marvell.com>");
-diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
-index 0283c70..68b8ced 100644
---- a/drivers/video/pxa3xx-gcu.c
-+++ b/drivers/video/pxa3xx-gcu.c
-@@ -749,20 +749,7 @@ static struct platform_driver pxa3xx_gcu_driver = {
- },
- };
-
--static int __init
--pxa3xx_gcu_init(void)
--{
-- return platform_driver_register(&pxa3xx_gcu_driver);
--}
--
--static void __exit
--pxa3xx_gcu_exit(void)
--{
-- platform_driver_unregister(&pxa3xx_gcu_driver);
--}
--
--module_init(pxa3xx_gcu_init);
--module_exit(pxa3xx_gcu_exit);
-+module_platform_driver(pxa3xx_gcu_driver);
-
- MODULE_DESCRIPTION("PXA3xx graphics controller unit driver");
- MODULE_LICENSE("GPL");
-diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
-index 4aecf21..296e005 100644
---- a/drivers/video/s3c-fb.c
-+++ b/drivers/video/s3c-fb.c
-@@ -1895,18 +1895,7 @@ static struct platform_driver s3c_fb_driver = {
- },
- };
-
--static int __init s3c_fb_init(void)
--{
-- return platform_driver_register(&s3c_fb_driver);
--}
--
--static void __exit s3c_fb_cleanup(void)
--{
-- platform_driver_unregister(&s3c_fb_driver);
--}
--
--module_init(s3c_fb_init);
--module_exit(s3c_fb_cleanup);
-+module_platform_driver(s3c_fb_driver);
-
- MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
- MODULE_DESCRIPTION("Samsung S3C SoC Framebuffer driver");
-diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
-index 45e47d8..83b16e2 100644
---- a/drivers/video/sh7760fb.c
-+++ b/drivers/video/sh7760fb.c
-@@ -585,18 +585,7 @@ static struct platform_driver sh7760_lcdc_driver = {
- .remove = __devexit_p(sh7760fb_remove),
- };
-
--static int __init sh7760fb_init(void)
--{
-- return platform_driver_register(&sh7760_lcdc_driver);
--}
--
--static void __exit sh7760fb_exit(void)
--{
-- platform_driver_unregister(&sh7760_lcdc_driver);
--}
--
--module_init(sh7760fb_init);
--module_exit(sh7760fb_exit);
-+module_platform_driver(sh7760_lcdc_driver);
-
- MODULE_AUTHOR("Nobuhiro Iwamatsu, Manuel Lauss");
- MODULE_DESCRIPTION("FBdev for SH7760/63 integrated LCD Controller");
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 1f49ab4..a264ebf 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1709,18 +1709,7 @@ static struct platform_driver sh_mobile_lcdc_driver = {
- .remove = sh_mobile_lcdc_remove,
- };
-
--static int __init sh_mobile_lcdc_init(void)
--{
-- return platform_driver_register(&sh_mobile_lcdc_driver);
--}
--
--static void __exit sh_mobile_lcdc_exit(void)
--{
-- platform_driver_unregister(&sh_mobile_lcdc_driver);
--}
--
--module_init(sh_mobile_lcdc_init);
--module_exit(sh_mobile_lcdc_exit);
-+module_platform_driver(sh_mobile_lcdc_driver);
-
- MODULE_DESCRIPTION("SuperH Mobile LCDC Framebuffer driver");
- MODULE_AUTHOR("Magnus Damm <damm@opensource.se>");
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 4d63490..f45d83e 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -679,18 +679,7 @@ static struct platform_driver sh_mobile_meram_driver = {
- .remove = sh_mobile_meram_remove,
- };
-
--static int __init sh_mobile_meram_init(void)
--{
-- return platform_driver_register(&sh_mobile_meram_driver);
--}
--
--static void __exit sh_mobile_meram_exit(void)
--{
-- platform_driver_unregister(&sh_mobile_meram_driver);
--}
--
--module_init(sh_mobile_meram_init);
--module_exit(sh_mobile_meram_exit);
-+module_platform_driver(sh_mobile_meram_driver);
-
- MODULE_DESCRIPTION("SuperH Mobile MERAM driver");
- MODULE_AUTHOR("Damian Hobson-Garcia / Takanari Hayama");
-diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
-index 6294dca..420ba8d 100644
---- a/drivers/video/sm501fb.c
-+++ b/drivers/video/sm501fb.c
-@@ -2230,18 +2230,7 @@ static struct platform_driver sm501fb_driver = {
- },
- };
-
--static int __devinit sm501fb_init(void)
--{
-- return platform_driver_register(&sm501fb_driver);
--}
--
--static void __exit sm501fb_cleanup(void)
--{
-- platform_driver_unregister(&sm501fb_driver);
--}
--
--module_init(sm501fb_init);
--module_exit(sm501fb_cleanup);
-+module_platform_driver(sm501fb_driver);
-
- module_param_named(mode, fb_mode, charp, 0);
- MODULE_PARM_DESC(mode,
-diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
-index 0e120d6..aeea1c1 100644
---- a/drivers/video/vt8500lcdfb.c
-+++ b/drivers/video/vt8500lcdfb.c
-@@ -457,18 +457,7 @@ static struct platform_driver vt8500lcd_driver = {
- },
- };
-
--static int __init vt8500lcd_init(void)
--{
-- return platform_driver_register(&vt8500lcd_driver);
--}
--
--static void __exit vt8500lcd_exit(void)
--{
-- platform_driver_unregister(&vt8500lcd_driver);
--}
--
--module_init(vt8500lcd_init);
--module_exit(vt8500lcd_exit);
-+module_platform_driver(vt8500lcd_driver);
-
- MODULE_AUTHOR("Alexey Charkov <alchark@gmail.com>");
- MODULE_DESCRIPTION("LCD controller driver for VIA VT8500");
-diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
-index c8be8af..1fce2dc 100644
---- a/drivers/video/w100fb.c
-+++ b/drivers/video/w100fb.c
-@@ -1619,18 +1619,7 @@ static struct platform_driver w100fb_driver = {
- },
- };
-
--int __init w100fb_init(void)
--{
-- return platform_driver_register(&w100fb_driver);
--}
--
--void __exit w100fb_cleanup(void)
--{
-- platform_driver_unregister(&w100fb_driver);
--}
--
--module_init(w100fb_init);
--module_exit(w100fb_cleanup);
-+module_platform_driver(w100fb_driver);
-
- MODULE_DESCRIPTION("ATI Imageon w100 framebuffer driver");
- MODULE_LICENSE("GPL");
-diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
-index 96e34a5..c8703bd 100644
---- a/drivers/video/wm8505fb.c
-+++ b/drivers/video/wm8505fb.c
-@@ -404,18 +404,7 @@ static struct platform_driver wm8505fb_driver = {
- },
- };
-
--static int __init wm8505fb_init(void)
--{
-- return platform_driver_register(&wm8505fb_driver);
--}
--
--static void __exit wm8505fb_exit(void)
--{
-- platform_driver_unregister(&wm8505fb_driver);
--}
--
--module_init(wm8505fb_init);
--module_exit(wm8505fb_exit);
-+module_platform_driver(wm8505fb_driver);
-
- MODULE_AUTHOR("Ed Spiridonov <edo.rus@gmail.com>");
- MODULE_DESCRIPTION("Framebuffer driver for WMT WM8505");
-diff --git a/drivers/video/wmt_ge_rops.c b/drivers/video/wmt_ge_rops.c
-index 45832b7..55be386 100644
---- a/drivers/video/wmt_ge_rops.c
-+++ b/drivers/video/wmt_ge_rops.c
-@@ -167,18 +167,7 @@ static struct platform_driver wmt_ge_rops_driver = {
- },
- };
-
--static int __init wmt_ge_rops_init(void)
--{
-- return platform_driver_register(&wmt_ge_rops_driver);
--}
--
--static void __exit wmt_ge_rops_exit(void)
--{
-- platform_driver_unregister(&wmt_ge_rops_driver);
--}
--
--module_init(wmt_ge_rops_init);
--module_exit(wmt_ge_rops_exit);
-+module_platform_driver(wmt_ge_rops_driver);
-
- MODULE_AUTHOR("Alexey Charkov <alchark@gmail.com");
- MODULE_DESCRIPTION("Accelerators for raster operations using "
-diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
-index 77dea01..e44e1f0 100644
---- a/drivers/video/xilinxfb.c
-+++ b/drivers/video/xilinxfb.c
-@@ -512,25 +512,7 @@ static struct platform_driver xilinxfb_of_driver = {
- },
- };
-
--
--/* ---------------------------------------------------------------------
-- * Module setup and teardown
-- */
--
--static int __init
--xilinxfb_init(void)
--{
-- return platform_driver_register(&xilinxfb_of_driver);
--}
--
--static void __exit
--xilinxfb_cleanup(void)
--{
-- platform_driver_unregister(&xilinxfb_of_driver);
--}
--
--module_init(xilinxfb_init);
--module_exit(xilinxfb_cleanup);
-+module_platform_driver(xilinxfb_of_driver);
-
- MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
- MODULE_DESCRIPTION("Xilinx TFT frame buffer driver");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0140-fbdev-Add-FOURCC-based-format-configuration-API.patch b/patches.armadillo800eva/0140-fbdev-Add-FOURCC-based-format-configuration-API.patch
deleted file mode 100644
index 620a6770b92c6d..00000000000000
--- a/patches.armadillo800eva/0140-fbdev-Add-FOURCC-based-format-configuration-API.patch
+++ /dev/null
@@ -1,423 +0,0 @@
-From 75c33faaf0d531af322d0cab6f50a6456fdfbcd5 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 13 Dec 2011 14:02:26 +0100
-Subject: fbdev: Add FOURCC-based format configuration API
-
-This API will be used to support YUV frame buffer formats in a standard
-way.
-
-Last but not least, create a much needed fbdev API documentation and
-document the format setting APIs.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit fb21c2f42879c05c76ea9e249b6905fc729f8529)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/fb/api.txt | 306 ++++++++++++++++++++++++++++++++++++++++++++++
- drivers/video/fbmem.c | 14 +++
- include/linux/fb.h | 14 ++-
- 3 files changed, 330 insertions(+), 4 deletions(-)
- create mode 100644 Documentation/fb/api.txt
-
-diff --git a/Documentation/fb/api.txt b/Documentation/fb/api.txt
-new file mode 100644
-index 0000000..d4ff7de
---- /dev/null
-+++ b/Documentation/fb/api.txt
-@@ -0,0 +1,306 @@
-+ The Frame Buffer Device API
-+ ---------------------------
-+
-+Last revised: June 21, 2011
-+
-+
-+0. Introduction
-+---------------
-+
-+This document describes the frame buffer API used by applications to interact
-+with frame buffer devices. In-kernel APIs between device drivers and the frame
-+buffer core are not described.
-+
-+Due to a lack of documentation in the original frame buffer API, drivers
-+behaviours differ in subtle (and not so subtle) ways. This document describes
-+the recommended API implementation, but applications should be prepared to
-+deal with different behaviours.
-+
-+
-+1. Capabilities
-+---------------
-+
-+Device and driver capabilities are reported in the fixed screen information
-+capabilities field.
-+
-+struct fb_fix_screeninfo {
-+ ...
-+ __u16 capabilities; /* see FB_CAP_* */
-+ ...
-+};
-+
-+Application should use those capabilities to find out what features they can
-+expect from the device and driver.
-+
-+- FB_CAP_FOURCC
-+
-+The driver supports the four character code (FOURCC) based format setting API.
-+When supported, formats are configured using a FOURCC instead of manually
-+specifying color components layout.
-+
-+
-+2. Types and visuals
-+--------------------
-+
-+Pixels are stored in memory in hardware-dependent formats. Applications need
-+to be aware of the pixel storage format in order to write image data to the
-+frame buffer memory in the format expected by the hardware.
-+
-+Formats are described by frame buffer types and visuals. Some visuals require
-+additional information, which are stored in the variable screen information
-+bits_per_pixel, grayscale, red, green, blue and transp fields.
-+
-+Visuals describe how color information is encoded and assembled to create
-+macropixels. Types describe how macropixels are stored in memory. The following
-+types and visuals are supported.
-+
-+- FB_TYPE_PACKED_PIXELS
-+
-+Macropixels are stored contiguously in a single plane. If the number of bits
-+per macropixel is not a multiple of 8, whether macropixels are padded to the
-+next multiple of 8 bits or packed together into bytes depends on the visual.
-+
-+Padding at end of lines may be present and is then reported through the fixed
-+screen information line_length field.
-+
-+- FB_TYPE_PLANES
-+
-+Macropixels are split across multiple planes. The number of planes is equal to
-+the number of bits per macropixel, with plane i'th storing i'th bit from all
-+macropixels.
-+
-+Planes are located contiguously in memory.
-+
-+- FB_TYPE_INTERLEAVED_PLANES
-+
-+Macropixels are split across multiple planes. The number of planes is equal to
-+the number of bits per macropixel, with plane i'th storing i'th bit from all
-+macropixels.
-+
-+Planes are interleaved in memory. The interleave factor, defined as the
-+distance in bytes between the beginning of two consecutive interleaved blocks
-+belonging to different planes, is stored in the fixed screen information
-+type_aux field.
-+
-+- FB_TYPE_FOURCC
-+
-+Macropixels are stored in memory as described by the format FOURCC identifier
-+stored in the variable screen information grayscale field.
-+
-+- FB_VISUAL_MONO01
-+
-+Pixels are black or white and stored on a number of bits (typically one)
-+specified by the variable screen information bpp field.
-+
-+Black pixels are represented by all bits set to 1 and white pixels by all bits
-+set to 0. When the number of bits per pixel is smaller than 8, several pixels
-+are packed together in a byte.
-+
-+FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only.
-+
-+- FB_VISUAL_MONO10
-+
-+Pixels are black or white and stored on a number of bits (typically one)
-+specified by the variable screen information bpp field.
-+
-+Black pixels are represented by all bits set to 0 and white pixels by all bits
-+set to 1. When the number of bits per pixel is smaller than 8, several pixels
-+are packed together in a byte.
-+
-+FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only.
-+
-+- FB_VISUAL_TRUECOLOR
-+
-+Pixels are broken into red, green and blue components, and each component
-+indexes a read-only lookup table for the corresponding value. Lookup tables
-+are device-dependent, and provide linear or non-linear ramps.
-+
-+Each component is stored in a macropixel according to the variable screen
-+information red, green, blue and transp fields.
-+
-+- FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR
-+
-+Pixel values are encoded as indices into a colormap that stores red, green and
-+blue components. The colormap is read-only for FB_VISUAL_STATIC_PSEUDOCOLOR
-+and read-write for FB_VISUAL_PSEUDOCOLOR.
-+
-+Each pixel value is stored in the number of bits reported by the variable
-+screen information bits_per_pixel field.
-+
-+- FB_VISUAL_DIRECTCOLOR
-+
-+Pixels are broken into red, green and blue components, and each component
-+indexes a programmable lookup table for the corresponding value.
-+
-+Each component is stored in a macropixel according to the variable screen
-+information red, green, blue and transp fields.
-+
-+- FB_VISUAL_FOURCC
-+
-+Pixels are encoded and interpreted as described by the format FOURCC
-+identifier stored in the variable screen information grayscale field.
-+
-+
-+3. Screen information
-+---------------------
-+
-+Screen information are queried by applications using the FBIOGET_FSCREENINFO
-+and FBIOGET_VSCREENINFO ioctls. Those ioctls take a pointer to a
-+fb_fix_screeninfo and fb_var_screeninfo structure respectively.
-+
-+struct fb_fix_screeninfo stores device independent unchangeable information
-+about the frame buffer device and the current format. Those information can't
-+be directly modified by applications, but can be changed by the driver when an
-+application modifies the format.
-+
-+struct fb_fix_screeninfo {
-+ char id[16]; /* identification string eg "TT Builtin" */
-+ unsigned long smem_start; /* Start of frame buffer mem */
-+ /* (physical address) */
-+ __u32 smem_len; /* Length of frame buffer mem */
-+ __u32 type; /* see FB_TYPE_* */
-+ __u32 type_aux; /* Interleave for interleaved Planes */
-+ __u32 visual; /* see FB_VISUAL_* */
-+ __u16 xpanstep; /* zero if no hardware panning */
-+ __u16 ypanstep; /* zero if no hardware panning */
-+ __u16 ywrapstep; /* zero if no hardware ywrap */
-+ __u32 line_length; /* length of a line in bytes */
-+ unsigned long mmio_start; /* Start of Memory Mapped I/O */
-+ /* (physical address) */
-+ __u32 mmio_len; /* Length of Memory Mapped I/O */
-+ __u32 accel; /* Indicate to driver which */
-+ /* specific chip/card we have */
-+ __u16 capabilities; /* see FB_CAP_* */
-+ __u16 reserved[2]; /* Reserved for future compatibility */
-+};
-+
-+struct fb_var_screeninfo stores device independent changeable information
-+about a frame buffer device, its current format and video mode, as well as
-+other miscellaneous parameters.
-+
-+struct fb_var_screeninfo {
-+ __u32 xres; /* visible resolution */
-+ __u32 yres;
-+ __u32 xres_virtual; /* virtual resolution */
-+ __u32 yres_virtual;
-+ __u32 xoffset; /* offset from virtual to visible */
-+ __u32 yoffset; /* resolution */
-+
-+ __u32 bits_per_pixel; /* guess what */
-+ __u32 grayscale; /* 0 = color, 1 = grayscale, */
-+ /* >1 = FOURCC */
-+ struct fb_bitfield red; /* bitfield in fb mem if true color, */
-+ struct fb_bitfield green; /* else only length is significant */
-+ struct fb_bitfield blue;
-+ struct fb_bitfield transp; /* transparency */
-+
-+ __u32 nonstd; /* != 0 Non standard pixel format */
-+
-+ __u32 activate; /* see FB_ACTIVATE_* */
-+
-+ __u32 height; /* height of picture in mm */
-+ __u32 width; /* width of picture in mm */
-+
-+ __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
-+
-+ /* Timing: All values in pixclocks, except pixclock (of course) */
-+ __u32 pixclock; /* pixel clock in ps (pico seconds) */
-+ __u32 left_margin; /* time from sync to picture */
-+ __u32 right_margin; /* time from picture to sync */
-+ __u32 upper_margin; /* time from sync to picture */
-+ __u32 lower_margin;
-+ __u32 hsync_len; /* length of horizontal sync */
-+ __u32 vsync_len; /* length of vertical sync */
-+ __u32 sync; /* see FB_SYNC_* */
-+ __u32 vmode; /* see FB_VMODE_* */
-+ __u32 rotate; /* angle we rotate counter clockwise */
-+ __u32 colorspace; /* colorspace for FOURCC-based modes */
-+ __u32 reserved[4]; /* Reserved for future compatibility */
-+};
-+
-+To modify variable information, applications call the FBIOPUT_VSCREENINFO
-+ioctl with a pointer to a fb_var_screeninfo structure. If the call is
-+successful, the driver will update the fixed screen information accordingly.
-+
-+Instead of filling the complete fb_var_screeninfo structure manually,
-+applications should call the FBIOGET_VSCREENINFO ioctl and modify only the
-+fields they care about.
-+
-+
-+4. Format configuration
-+-----------------------
-+
-+Frame buffer devices offer two ways to configure the frame buffer format: the
-+legacy API and the FOURCC-based API.
-+
-+
-+The legacy API has been the only frame buffer format configuration API for a
-+long time and is thus widely used by application. It is the recommended API
-+for applications when using RGB and grayscale formats, as well as legacy
-+non-standard formats.
-+
-+To select a format, applications set the fb_var_screeninfo bits_per_pixel field
-+to the desired frame buffer depth. Values up to 8 will usually map to
-+monochrome, grayscale or pseudocolor visuals, although this is not required.
-+
-+- For grayscale formats, applications set the grayscale field to one. The red,
-+ blue, green and transp fields must be set to 0 by applications and ignored by
-+ drivers. Drivers must fill the red, blue and green offsets to 0 and lengths
-+ to the bits_per_pixel value.
-+
-+- For pseudocolor formats, applications set the grayscale field to zero. The
-+ red, blue, green and transp fields must be set to 0 by applications and
-+ ignored by drivers. Drivers must fill the red, blue and green offsets to 0
-+ and lengths to the bits_per_pixel value.
-+
-+- For truecolor and directcolor formats, applications set the grayscale field
-+ to zero, and the red, blue, green and transp fields to describe the layout of
-+ color components in memory.
-+
-+struct fb_bitfield {
-+ __u32 offset; /* beginning of bitfield */
-+ __u32 length; /* length of bitfield */
-+ __u32 msb_right; /* != 0 : Most significant bit is */
-+ /* right */
-+};
-+
-+ Pixel values are bits_per_pixel wide and are split in non-overlapping red,
-+ green, blue and alpha (transparency) components. Location and size of each
-+ component in the pixel value are described by the fb_bitfield offset and
-+ length fields. Offset are computed from the right.
-+
-+ Pixels are always stored in an integer number of bytes. If the number of
-+ bits per pixel is not a multiple of 8, pixel values are padded to the next
-+ multiple of 8 bits.
-+
-+Upon successful format configuration, drivers update the fb_fix_screeninfo
-+type, visual and line_length fields depending on the selected format.
-+
-+
-+The FOURCC-based API replaces format descriptions by four character codes
-+(FOURCC). FOURCCs are abstract identifiers that uniquely define a format
-+without explicitly describing it. This is the only API that supports YUV
-+formats. Drivers are also encouraged to implement the FOURCC-based API for RGB
-+and grayscale formats.
-+
-+Drivers that support the FOURCC-based API report this capability by setting
-+the FB_CAP_FOURCC bit in the fb_fix_screeninfo capabilities field.
-+
-+FOURCC definitions are located in the linux/videodev2.h header. However, and
-+despite starting with the V4L2_PIX_FMT_prefix, they are not restricted to V4L2
-+and don't require usage of the V4L2 subsystem. FOURCC documentation is
-+available in Documentation/DocBook/v4l/pixfmt.xml.
-+
-+To select a format, applications set the grayscale field to the desired FOURCC.
-+For YUV formats, they should also select the appropriate colorspace by setting
-+the colorspace field to one of the colorspaces listed in linux/videodev2.h and
-+documented in Documentation/DocBook/v4l/colorspaces.xml.
-+
-+The red, green, blue and transp fields are not used with the FOURCC-based API.
-+For forward compatibility reasons applications must zero those fields, and
-+drivers must ignore them. Values other than 0 may get a meaning in future
-+extensions.
-+
-+Upon successful format configuration, drivers update the fb_fix_screeninfo
-+type, visual and line_length fields depending on the selected format. The type
-+and visual fields are set to FB_TYPE_FOURCC and FB_VISUAL_FOURCC respectively.
-diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
-index 7a41220..c6ce416 100644
---- a/drivers/video/fbmem.c
-+++ b/drivers/video/fbmem.c
-@@ -967,6 +967,20 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
- memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) {
- u32 activate = var->activate;
-
-+ /* When using FOURCC mode, make sure the red, green, blue and
-+ * transp fields are set to 0.
-+ */
-+ if ((info->fix.capabilities & FB_CAP_FOURCC) &&
-+ var->grayscale > 1) {
-+ if (var->red.offset || var->green.offset ||
-+ var->blue.offset || var->transp.offset ||
-+ var->red.length || var->green.length ||
-+ var->blue.length || var->transp.length ||
-+ var->red.msb_right || var->green.msb_right ||
-+ var->blue.msb_right || var->transp.msb_right)
-+ return -EINVAL;
-+ }
-+
- if (!info->fbops->fb_check_var) {
- *var = info->var;
- goto done;
-diff --git a/include/linux/fb.h b/include/linux/fb.h
-index f9d013d..1bcc94d 100644
---- a/include/linux/fb.h
-+++ b/include/linux/fb.h
-@@ -45,6 +45,7 @@
- #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
- #define FB_TYPE_TEXT 3 /* Text/attributes */
- #define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
-+#define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */
-
- #define FB_AUX_TEXT_MDA 0 /* Monochrome text */
- #define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
-@@ -69,6 +70,7 @@
- #define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
- #define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
- #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
-+#define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */
-
- #define FB_ACCEL_NONE 0 /* no hardware accelerator */
- #define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
-@@ -154,6 +156,8 @@
-
- #define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */
-
-+#define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */
-+
- struct fb_fix_screeninfo {
- char id[16]; /* identification string eg "TT Builtin" */
- unsigned long smem_start; /* Start of frame buffer mem */
-@@ -171,7 +175,8 @@ struct fb_fix_screeninfo {
- __u32 mmio_len; /* Length of Memory Mapped I/O */
- __u32 accel; /* Indicate to driver which */
- /* specific chip/card we have */
-- __u16 reserved[3]; /* Reserved for future compatibility */
-+ __u16 capabilities; /* see FB_CAP_* */
-+ __u16 reserved[2]; /* Reserved for future compatibility */
- };
-
- /* Interpretation of offset for color fields: All offsets are from the right,
-@@ -246,8 +251,8 @@ struct fb_var_screeninfo {
- __u32 yoffset; /* resolution */
-
- __u32 bits_per_pixel; /* guess what */
-- __u32 grayscale; /* != 0 Graylevels instead of colors */
--
-+ __u32 grayscale; /* 0 = color, 1 = grayscale, */
-+ /* >1 = FOURCC */
- struct fb_bitfield red; /* bitfield in fb mem if true color, */
- struct fb_bitfield green; /* else only length is significant */
- struct fb_bitfield blue;
-@@ -273,7 +278,8 @@ struct fb_var_screeninfo {
- __u32 sync; /* see FB_SYNC_* */
- __u32 vmode; /* see FB_VMODE_* */
- __u32 rotate; /* angle we rotate counter clockwise */
-- __u32 reserved[5]; /* Reserved for future compatibility */
-+ __u32 colorspace; /* colorspace for FOURCC-based modes */
-+ __u32 reserved[4]; /* Reserved for future compatibility */
- };
-
- struct fb_cmap {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0141-v4l-Add-V4L2_PIX_FMT_NV24-and-V4L2_PIX_FMT_NV42-form.patch b/patches.armadillo800eva/0141-v4l-Add-V4L2_PIX_FMT_NV24-and-V4L2_PIX_FMT_NV42-form.patch
deleted file mode 100644
index afb958ebecc8df..00000000000000
--- a/patches.armadillo800eva/0141-v4l-Add-V4L2_PIX_FMT_NV24-and-V4L2_PIX_FMT_NV42-form.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 4df32b1d27fb25846739684fff2da3dee4f9353f Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 13 Dec 2011 14:02:27 +0100
-Subject: v4l: Add V4L2_PIX_FMT_NV24 and V4L2_PIX_FMT_NV42 formats
-
-NV24 and NV42 are planar YCbCr 4:4:4 and YCrCb 4:4:4 formats with a
-luma plane followed by an interleaved chroma plane.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 0b9eabd77f4867232a9ac6ca54fa39607b0c9bc7)
-
-Conflicts:
-
- Documentation/DocBook/media/v4l/pixfmt.xml
- Documentation/DocBook/media/v4l/pixfmt-nv24.xml
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
----
- include/linux/videodev2.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/linux/videodev2.h
-+++ b/include/linux/videodev2.h
-@@ -343,6 +343,8 @@ struct v4l2_pix_format {
- #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
- #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
- #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
-+#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
-+#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
-
- /* two non contiguous planes - one Y, one Cr + Cb interleaved */
- #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
diff --git a/patches.armadillo800eva/0142-arm-fix-compile-failure-in-mach-shmobile-board-ag5ev.patch b/patches.armadillo800eva/0142-arm-fix-compile-failure-in-mach-shmobile-board-ag5ev.patch
deleted file mode 100644
index 8a74c02fae02fe..00000000000000
--- a/patches.armadillo800eva/0142-arm-fix-compile-failure-in-mach-shmobile-board-ag5ev.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From ec6cb263d29985e3a9750d14a8ffd1e9d096419c Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 22 Jan 2012 14:57:25 -0500
-Subject: arm: fix compile failure in mach-shmobile/board-ag5evm.c
-
-Add videodev2 header which provides V4L2_PIX_FMT_RGB565 to fix:
-
-arch/arm/mach-shmobile/board-ag5evm.c:274: error: 'V4L2_PIX_FMT_RGB565' undeclared here (not in a function)
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 04f47a03c51c9f02fa27b0ecf4207e25c0741804)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 87e9091..5f5a8bb 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -30,6 +30,7 @@
- #include <linux/serial_sci.h>
- #include <linux/smsc911x.h>
- #include <linux/gpio.h>
-+#include <linux/videodev2.h>
- #include <linux/input.h>
- #include <linux/input/sh_keysc.h>
- #include <linux/mmc/host.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0143-sh-se7724-fix-compile-breakage.patch b/patches.armadillo800eva/0143-sh-se7724-fix-compile-breakage.patch
deleted file mode 100644
index d81a4fffac5bb1..00000000000000
--- a/patches.armadillo800eva/0143-sh-se7724-fix-compile-breakage.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From c8673f13e0fa8797e793291a52449d98bdd44662 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 25 Jan 2012 22:07:05 +0100
-Subject: sh: se7724: fix compile breakage
-
-Fix compilation breakage
-
-arch/sh/boards/mach-se/7724/setup.c:182: error: 'V4L2_PIX_FMT_RGB565' undeclared here (not in a function)
-make[3]: *** [arch/sh/boards/mach-se/7724/setup.o] Error 1
-
-caused by commit "fbdev: sh_mobile_lcdc: Support FOURCC-based format API"
-Also add other missing headers, even if compilation currently succeeds
-because of their indirect inclusion via other headers.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a1ad803322a904a250fa901020b4a4dfaf51a829)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/boards/mach-ap325rxa/setup.c | 1 +
- arch/sh/boards/mach-ecovec24/setup.c | 2 ++
- arch/sh/boards/mach-kfr2r09/setup.c | 1 +
- arch/sh/boards/mach-migor/setup.c | 2 ++
- arch/sh/boards/mach-se/7724/setup.c | 1 +
- 5 files changed, 7 insertions(+)
-
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index 969421f..069cf26 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -22,6 +22,7 @@
- #include <linux/i2c.h>
- #include <linux/smsc911x.h>
- #include <linux/gpio.h>
-+#include <linux/videodev2.h>
- #include <media/ov772x.h>
- #include <media/soc_camera.h>
- #include <media/soc_camera_platform.h>
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 4fd83c4..4e8db96 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -29,9 +29,11 @@
- #include <linux/input.h>
- #include <linux/input/sh_keysc.h>
- #include <linux/sh_eth.h>
-+#include <linux/videodev2.h>
- #include <video/sh_mobile_lcdc.h>
- #include <sound/sh_fsi.h>
- #include <media/sh_mobile_ceu.h>
-+#include <media/soc_camera.h>
- #include <media/tw9910.h>
- #include <media/mt9t112.h>
- #include <asm/heartbeat.h>
-diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
-index 8b4abbb..ca6df46 100644
---- a/arch/sh/boards/mach-kfr2r09/setup.c
-+++ b/arch/sh/boards/mach-kfr2r09/setup.c
-@@ -22,6 +22,7 @@
- #include <linux/input/sh_keysc.h>
- #include <linux/i2c.h>
- #include <linux/usb/r8a66597.h>
-+#include <linux/videodev2.h>
- #include <media/rj54n1cb0c.h>
- #include <media/soc_camera.h>
- #include <media/sh_mobile_ceu.h>
-diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
-index 184fde1..67f4e4f 100644
---- a/arch/sh/boards/mach-migor/setup.c
-+++ b/arch/sh/boards/mach-migor/setup.c
-@@ -21,9 +21,11 @@
- #include <linux/delay.h>
- #include <linux/clk.h>
- #include <linux/gpio.h>
-+#include <linux/videodev2.h>
- #include <video/sh_mobile_lcdc.h>
- #include <media/sh_mobile_ceu.h>
- #include <media/ov772x.h>
-+#include <media/soc_camera.h>
- #include <media/tw9910.h>
- #include <asm/clock.h>
- #include <asm/machvec.h>
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 631da7d..ecb64e0 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -24,6 +24,7 @@
- #include <linux/input/sh_keysc.h>
- #include <linux/usb/r8a66597.h>
- #include <linux/sh_eth.h>
-+#include <linux/videodev2.h>
- #include <video/sh_mobile_lcdc.h>
- #include <media/sh_mobile_ceu.h>
- #include <sound/sh_fsi.h>
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0144-fbdev-sh_mobile_lcdc-Support-FOURCC-based-format-API.patch b/patches.armadillo800eva/0144-fbdev-sh_mobile_lcdc-Support-FOURCC-based-format-API.patch
deleted file mode 100644
index 8b97700e746e6e..00000000000000
--- a/patches.armadillo800eva/0144-fbdev-sh_mobile_lcdc-Support-FOURCC-based-format-API.patch
+++ /dev/null
@@ -1,731 +0,0 @@
-From e2f763d7daf34ed70175d30f2059a9be348681f9 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 13 Dec 2011 14:02:28 +0100
-Subject: fbdev: sh_mobile_lcdc: Support FOURCC-based format API
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit edd153a3e4f7346551f98014b3ccf0494219a9d1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 2 +-
- arch/arm/mach-shmobile/board-ap4evb.c | 4 +-
- arch/arm/mach-shmobile/board-mackerel.c | 4 +-
- arch/sh/boards/mach-ap325rxa/setup.c | 2 +-
- arch/sh/boards/mach-ecovec24/setup.c | 2 +-
- arch/sh/boards/mach-kfr2r09/setup.c | 2 +-
- arch/sh/boards/mach-migor/setup.c | 4 +-
- arch/sh/boards/mach-se/7724/setup.c | 2 +-
- drivers/video/sh_mobile_lcdcfb.c | 360 ++++++++++++++++++++-----------
- include/video/sh_mobile_lcdc.h | 4 +-
- 10 files changed, 253 insertions(+), 133 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 5f5a8bb..14501ec 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -271,7 +271,7 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
- .flags = LCDC_FLAGS_DWPOL,
- .lcd_size_cfg.width = 44,
- .lcd_size_cfg.height = 79,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .lcd_cfg = lcdc0_modes,
- .num_cfg = ARRAY_SIZE(lcdc0_modes),
- .board_cfg = {
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 5db88ba..305dcd7 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -489,7 +489,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .meram_dev = &meram_info,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .lcd_cfg = ap4evb_lcdc_modes,
- .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
- .meram_cfg = &lcd_meram_cfg,
-@@ -785,7 +785,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
- .meram_dev = &meram_info,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB24,
- .clock_divider = 1,
- .flags = LCDC_FLAGS_DWPOL,
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 3802f2a..28d98da 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -387,7 +387,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_source = LCDC_CLK_BUS,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .lcd_cfg = mackerel_lcdc_modes,
- .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
- .interface_type = RGB24,
-@@ -450,7 +450,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
- .clock_source = LCDC_CLK_EXTERNAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB24,
- .clock_divider = 1,
- .flags = LCDC_FLAGS_DWPOL,
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index 069cf26..4fde884 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -208,7 +208,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_source = LCDC_CLK_EXTERNAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB18,
- .clock_divider = 1,
- .lcd_cfg = ap325rxa_lcdc_modes,
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 4e8db96..67c2ee8 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -328,7 +328,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .ch[0] = {
- .interface_type = RGB18,
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .lcd_size_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
-diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
-index ca6df46..7a35a5c 100644
---- a/arch/sh/boards/mach-kfr2r09/setup.c
-+++ b/arch/sh/boards/mach-kfr2r09/setup.c
-@@ -147,7 +147,7 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
- .clock_source = LCDC_CLK_BUS,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = SYS18,
- .clock_divider = 6,
- .flags = LCDC_FLAGS_DWPOL,
-diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
-index 67f4e4f..55ea682 100644
---- a/arch/sh/boards/mach-migor/setup.c
-+++ b/arch/sh/boards/mach-migor/setup.c
-@@ -246,7 +246,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .clock_source = LCDC_CLK_BUS,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB16,
- .clock_divider = 2,
- .lcd_cfg = migor_lcd_modes,
-@@ -260,7 +260,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .clock_source = LCDC_CLK_PERIPHERAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = SYS16A,
- .clock_divider = 10,
- .lcd_cfg = migor_lcd_modes,
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index ecb64e0..65ff79d 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -180,7 +180,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_source = LCDC_CLK_EXTERNAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
-- .bpp = 16,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
- .clock_divider = 1,
- .lcd_size_cfg = { /* 7.0 inch */
- .width = 152,
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index a264ebf..aac5b36 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -17,6 +17,7 @@
- #include <linux/platform_device.h>
- #include <linux/dma-mapping.h>
- #include <linux/interrupt.h>
-+#include <linux/videodev2.h>
- #include <linux/vmalloc.h>
- #include <linux/ioctl.h>
- #include <linux/slab.h>
-@@ -102,7 +103,7 @@ struct sh_mobile_lcdc_priv {
- struct sh_mobile_lcdc_chan ch[2];
- struct notifier_block notifier;
- int started;
-- int forced_bpp; /* 2 channel LCDC must share bpp setting */
-+ int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
- struct sh_mobile_meram_info *meram_dev;
- };
-
-@@ -215,6 +216,47 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
- lcdc_sys_read_data,
- };
-
-+static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
-+{
-+ if (var->grayscale > 1)
-+ return var->grayscale;
-+
-+ switch (var->bits_per_pixel) {
-+ case 16:
-+ return V4L2_PIX_FMT_RGB565;
-+ case 24:
-+ return V4L2_PIX_FMT_BGR24;
-+ case 32:
-+ return V4L2_PIX_FMT_BGR32;
-+ default:
-+ return 0;
-+ }
-+}
-+
-+static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
-+{
-+ return var->grayscale > 1;
-+}
-+
-+static bool sh_mobile_format_is_yuv(const struct fb_var_screeninfo *var)
-+{
-+ if (var->grayscale <= 1)
-+ return false;
-+
-+ switch (var->grayscale) {
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV21:
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV61:
-+ case V4L2_PIX_FMT_NV24:
-+ case V4L2_PIX_FMT_NV42:
-+ return true;
-+
-+ default:
-+ return false;
-+ }
-+}
-+
- static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
- {
- if (atomic_inc_and_test(&priv->hw_usecnt)) {
-@@ -435,7 +477,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- {
- struct sh_mobile_lcdc_chan *ch;
- unsigned long tmp;
-- int bpp = 0;
- int k, m;
-
- /* Enable LCDC channels. Read data from external memory, avoid using the
-@@ -454,9 +495,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- if (!ch->enabled)
- continue;
-
-- if (!bpp)
-- bpp = ch->info->var.bits_per_pixel;
--
- /* Power supply */
- lcdc_write_chan(ch, LDPMR, 0);
-
-@@ -487,31 +525,37 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- sh_mobile_lcdc_geometry(ch);
-
-- if (ch->info->var.nonstd) {
-- tmp = (ch->info->var.nonstd << 16);
-- switch (ch->info->var.bits_per_pixel) {
-- case 12:
-- tmp |= LDDFR_YF_420;
-- break;
-- case 16:
-- tmp |= LDDFR_YF_422;
-- break;
-- case 24:
-- default:
-- tmp |= LDDFR_YF_444;
-- break;
-- }
-- } else {
-- switch (ch->info->var.bits_per_pixel) {
-- case 16:
-- tmp = LDDFR_PKF_RGB16;
-- break;
-- case 24:
-- tmp = LDDFR_PKF_RGB24;
-+ switch (sh_mobile_format_fourcc(&ch->info->var)) {
-+ case V4L2_PIX_FMT_RGB565:
-+ tmp = LDDFR_PKF_RGB16;
-+ break;
-+ case V4L2_PIX_FMT_BGR24:
-+ tmp = LDDFR_PKF_RGB24;
-+ break;
-+ case V4L2_PIX_FMT_BGR32:
-+ tmp = LDDFR_PKF_ARGB32;
-+ break;
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV21:
-+ tmp = LDDFR_CC | LDDFR_YF_420;
-+ break;
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV61:
-+ tmp = LDDFR_CC | LDDFR_YF_422;
-+ break;
-+ case V4L2_PIX_FMT_NV24:
-+ case V4L2_PIX_FMT_NV42:
-+ tmp = LDDFR_CC | LDDFR_YF_444;
-+ break;
-+ }
-+
-+ if (sh_mobile_format_is_yuv(&ch->info->var)) {
-+ switch (ch->info->var.colorspace) {
-+ case V4L2_COLORSPACE_REC709:
-+ tmp |= LDDFR_CF1;
- break;
-- case 32:
-- default:
-- tmp = LDDFR_PKF_ARGB32;
-+ case V4L2_COLORSPACE_JPEG:
-+ tmp |= LDDFR_CF0;
- break;
- }
- }
-@@ -519,7 +563,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_write_chan(ch, LDDFR, tmp);
- lcdc_write_chan(ch, LDMLSR, ch->pitch);
- lcdc_write_chan(ch, LDSA1R, ch->base_addr_y);
-- if (ch->info->var.nonstd)
-+ if (sh_mobile_format_is_yuv(&ch->info->var))
- lcdc_write_chan(ch, LDSA2R, ch->base_addr_c);
-
- /* When using deferred I/O mode, configure the LCDC for one-shot
-@@ -536,21 +580,23 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- /* Word and long word swap. */
-- if (priv->ch[0].info->var.nonstd)
-+ switch (sh_mobile_format_fourcc(&priv->ch[0].info->var)) {
-+ case V4L2_PIX_FMT_RGB565:
-+ case V4L2_PIX_FMT_NV21:
-+ case V4L2_PIX_FMT_NV61:
-+ case V4L2_PIX_FMT_NV42:
-+ tmp = LDDDSR_LS | LDDDSR_WS;
-+ break;
-+ case V4L2_PIX_FMT_BGR24:
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV24:
- tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-- else {
-- switch (bpp) {
-- case 16:
-- tmp = LDDDSR_LS | LDDDSR_WS;
-- break;
-- case 24:
-- tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
-- break;
-- case 32:
-- default:
-- tmp = LDDDSR_LS;
-- break;
-- }
-+ break;
-+ case V4L2_PIX_FMT_BGR32:
-+ default:
-+ tmp = LDDDSR_LS;
-+ break;
- }
- lcdc_write(priv, _LDDDSR, tmp);
-
-@@ -622,12 +668,24 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- ch->meram_enabled = 0;
- }
-
-- if (!ch->info->var.nonstd)
-- pixelformat = SH_MOBILE_MERAM_PF_RGB;
-- else if (ch->info->var.bits_per_pixel == 24)
-- pixelformat = SH_MOBILE_MERAM_PF_NV24;
-- else
-+ switch (sh_mobile_format_fourcc(&ch->info->var)) {
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV21:
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV61:
- pixelformat = SH_MOBILE_MERAM_PF_NV;
-+ break;
-+ case V4L2_PIX_FMT_NV24:
-+ case V4L2_PIX_FMT_NV42:
-+ pixelformat = SH_MOBILE_MERAM_PF_NV24;
-+ break;
-+ case V4L2_PIX_FMT_RGB565:
-+ case V4L2_PIX_FMT_BGR24:
-+ case V4L2_PIX_FMT_BGR32:
-+ default:
-+ pixelformat = SH_MOBILE_MERAM_PF_RGB;
-+ break;
-+ }
-
- ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
- ch->info->var.yres, pixelformat,
-@@ -845,6 +903,7 @@ static struct fb_fix_screeninfo sh_mobile_lcdc_fix = {
- .xpanstep = 0,
- .ypanstep = 1,
- .ywrapstep = 0,
-+ .capabilities = FB_CAP_FOURCC,
- };
-
- static void sh_mobile_lcdc_fillrect(struct fb_info *info,
-@@ -877,8 +936,9 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- unsigned long new_pan_offset;
- unsigned long base_addr_y, base_addr_c;
- unsigned long c_offset;
-+ bool yuv = sh_mobile_format_is_yuv(&info->var);
-
-- if (!info->var.nonstd)
-+ if (!yuv)
- new_pan_offset = var->yoffset * info->fix.line_length
- + var->xoffset * (info->var.bits_per_pixel / 8);
- else
-@@ -892,7 +952,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
-
- /* Set the source address for the next refresh */
- base_addr_y = ch->dma_handle + new_pan_offset;
-- if (info->var.nonstd) {
-+ if (yuv) {
- /* Set y offset */
- c_offset = var->yoffset * info->fix.line_length
- * (info->var.bits_per_pixel - 8) / 8;
-@@ -900,7 +960,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- + info->var.xres * info->var.yres_virtual
- + c_offset;
- /* Set x offset */
-- if (info->var.bits_per_pixel == 24)
-+ if (sh_mobile_format_fourcc(&info->var) == V4L2_PIX_FMT_NV24)
- base_addr_c += 2 * var->xoffset;
- else
- base_addr_c += var->xoffset;
-@@ -924,7 +984,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- ch->base_addr_c = base_addr_c;
-
- lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
-- if (info->var.nonstd)
-+ if (yuv)
- lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
-
- if (lcdc_chan_is_sublcd(ch))
-@@ -1100,51 +1160,84 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- if (var->yres_virtual < var->yres)
- var->yres_virtual = var->yres;
-
-- if (var->bits_per_pixel <= 16) { /* RGB 565 */
-- var->bits_per_pixel = 16;
-- var->red.offset = 11;
-- var->red.length = 5;
-- var->green.offset = 5;
-- var->green.length = 6;
-- var->blue.offset = 0;
-- var->blue.length = 5;
-- var->transp.offset = 0;
-- var->transp.length = 0;
-- } else if (var->bits_per_pixel <= 24) { /* RGB 888 */
-- var->bits_per_pixel = 24;
-- var->red.offset = 16;
-- var->red.length = 8;
-- var->green.offset = 8;
-- var->green.length = 8;
-- var->blue.offset = 0;
-- var->blue.length = 8;
-- var->transp.offset = 0;
-- var->transp.length = 0;
-- } else if (var->bits_per_pixel <= 32) { /* RGBA 888 */
-- var->bits_per_pixel = 32;
-- var->red.offset = 16;
-- var->red.length = 8;
-- var->green.offset = 8;
-- var->green.length = 8;
-- var->blue.offset = 0;
-- var->blue.length = 8;
-- var->transp.offset = 24;
-- var->transp.length = 8;
-- } else
-- return -EINVAL;
-+ if (sh_mobile_format_is_fourcc(var)) {
-+ switch (var->grayscale) {
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV21:
-+ var->bits_per_pixel = 12;
-+ break;
-+ case V4L2_PIX_FMT_RGB565:
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV61:
-+ var->bits_per_pixel = 16;
-+ break;
-+ case V4L2_PIX_FMT_BGR24:
-+ case V4L2_PIX_FMT_NV24:
-+ case V4L2_PIX_FMT_NV42:
-+ var->bits_per_pixel = 24;
-+ break;
-+ case V4L2_PIX_FMT_BGR32:
-+ var->bits_per_pixel = 32;
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ /* Default to RGB and JPEG color-spaces for RGB and YUV formats
-+ * respectively.
-+ */
-+ if (!sh_mobile_format_is_yuv(var))
-+ var->colorspace = V4L2_COLORSPACE_SRGB;
-+ else if (var->colorspace != V4L2_COLORSPACE_REC709)
-+ var->colorspace = V4L2_COLORSPACE_JPEG;
-+ } else {
-+ if (var->bits_per_pixel <= 16) { /* RGB 565 */
-+ var->bits_per_pixel = 16;
-+ var->red.offset = 11;
-+ var->red.length = 5;
-+ var->green.offset = 5;
-+ var->green.length = 6;
-+ var->blue.offset = 0;
-+ var->blue.length = 5;
-+ var->transp.offset = 0;
-+ var->transp.length = 0;
-+ } else if (var->bits_per_pixel <= 24) { /* RGB 888 */
-+ var->bits_per_pixel = 24;
-+ var->red.offset = 16;
-+ var->red.length = 8;
-+ var->green.offset = 8;
-+ var->green.length = 8;
-+ var->blue.offset = 0;
-+ var->blue.length = 8;
-+ var->transp.offset = 0;
-+ var->transp.length = 0;
-+ } else if (var->bits_per_pixel <= 32) { /* RGBA 888 */
-+ var->bits_per_pixel = 32;
-+ var->red.offset = 16;
-+ var->red.length = 8;
-+ var->green.offset = 8;
-+ var->green.length = 8;
-+ var->blue.offset = 0;
-+ var->blue.length = 8;
-+ var->transp.offset = 24;
-+ var->transp.length = 8;
-+ } else
-+ return -EINVAL;
-
-- var->red.msb_right = 0;
-- var->green.msb_right = 0;
-- var->blue.msb_right = 0;
-- var->transp.msb_right = 0;
-+ var->red.msb_right = 0;
-+ var->green.msb_right = 0;
-+ var->blue.msb_right = 0;
-+ var->transp.msb_right = 0;
-+ }
-
- /* Make sure we don't exceed our allocated memory. */
- if (var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8 >
- info->fix.smem_len)
- return -EINVAL;
-
-- /* only accept the forced_bpp for dual channel configurations */
-- if (p->forced_bpp && p->forced_bpp != var->bits_per_pixel)
-+ /* only accept the forced_fourcc for dual channel configurations */
-+ if (p->forced_fourcc &&
-+ p->forced_fourcc != sh_mobile_format_fourcc(var))
- return -EINVAL;
-
- return 0;
-@@ -1158,7 +1251,7 @@ static int sh_mobile_set_par(struct fb_info *info)
-
- sh_mobile_lcdc_stop(ch->lcdc);
-
-- if (info->var.nonstd)
-+ if (sh_mobile_format_is_yuv(&info->var))
- info->fix.line_length = info->var.xres;
- else
- info->fix.line_length = info->var.xres
-@@ -1170,6 +1263,14 @@ static int sh_mobile_set_par(struct fb_info *info)
- info->fix.line_length = line_length;
- }
-
-+ if (sh_mobile_format_is_fourcc(&info->var)) {
-+ info->fix.type = FB_TYPE_FOURCC;
-+ info->fix.visual = FB_VISUAL_FOURCC;
-+ } else {
-+ info->fix.type = FB_TYPE_PACKED_PIXELS;
-+ info->fix.visual = FB_VISUAL_TRUECOLOR;
-+ }
-+
- return ret;
- }
-
-@@ -1464,9 +1565,9 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- for (i = 0, mode = cfg->lcd_cfg; i < cfg->num_cfg; i++, mode++) {
- unsigned int size = mode->yres * mode->xres;
-
-- /* NV12 buffers must have even number of lines */
-- if ((cfg->nonstd) && cfg->bpp == 12 &&
-- (mode->yres & 0x1)) {
-+ /* NV12/NV21 buffers must have even number of lines */
-+ if ((cfg->fourcc == V4L2_PIX_FMT_NV12 ||
-+ cfg->fourcc == V4L2_PIX_FMT_NV21) && (mode->yres & 0x1)) {
- dev_err(dev, "yres must be multiple of 2 for YCbCr420 "
- "mode.\n");
- return -EINVAL;
-@@ -1484,14 +1585,6 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- dev_dbg(dev, "Found largest videomode %ux%u\n",
- max_mode->xres, max_mode->yres);
-
-- /* Initialize fixed screen information. Restrict pan to 2 lines steps
-- * for NV12.
-- */
-- info->fix = sh_mobile_lcdc_fix;
-- info->fix.smem_len = max_size * 2 * cfg->bpp / 8;
-- if (cfg->nonstd && cfg->bpp == 12)
-- info->fix.ypanstep = 2;
--
- /* Create the mode list. */
- if (cfg->lcd_cfg == NULL) {
- mode = &default_720p;
-@@ -1509,19 +1602,38 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- */
- var = &info->var;
- fb_videomode_to_var(var, mode);
-- var->bits_per_pixel = cfg->bpp;
- var->width = cfg->lcd_size_cfg.width;
- var->height = cfg->lcd_size_cfg.height;
- var->yres_virtual = var->yres * 2;
- var->activate = FB_ACTIVATE_NOW;
-
-+ switch (cfg->fourcc) {
-+ case V4L2_PIX_FMT_RGB565:
-+ var->bits_per_pixel = 16;
-+ break;
-+ case V4L2_PIX_FMT_BGR24:
-+ var->bits_per_pixel = 24;
-+ break;
-+ case V4L2_PIX_FMT_BGR32:
-+ var->bits_per_pixel = 32;
-+ break;
-+ default:
-+ var->grayscale = cfg->fourcc;
-+ break;
-+ }
-+
-+ /* Make sure the memory size check won't fail. smem_len is initialized
-+ * later based on var.
-+ */
-+ info->fix.smem_len = UINT_MAX;
- ret = sh_mobile_check_var(var, info);
- if (ret)
- return ret;
-
-+ max_size = max_size * var->bits_per_pixel / 8 * 2;
-+
- /* Allocate frame buffer memory and color map. */
-- buf = dma_alloc_coherent(dev, info->fix.smem_len, &ch->dma_handle,
-- GFP_KERNEL);
-+ buf = dma_alloc_coherent(dev, max_size, &ch->dma_handle, GFP_KERNEL);
- if (!buf) {
- dev_err(dev, "unable to allocate buffer\n");
- return -ENOMEM;
-@@ -1530,16 +1642,27 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
- if (ret < 0) {
- dev_err(dev, "unable to allocate cmap\n");
-- dma_free_coherent(dev, info->fix.smem_len,
-- buf, ch->dma_handle);
-+ dma_free_coherent(dev, max_size, buf, ch->dma_handle);
- return ret;
- }
-
-+ /* Initialize fixed screen information. Restrict pan to 2 lines steps
-+ * for NV12 and NV21.
-+ */
-+ info->fix = sh_mobile_lcdc_fix;
- info->fix.smem_start = ch->dma_handle;
-- if (var->nonstd)
-+ info->fix.smem_len = max_size;
-+ if (cfg->fourcc == V4L2_PIX_FMT_NV12 ||
-+ cfg->fourcc == V4L2_PIX_FMT_NV21)
-+ info->fix.ypanstep = 2;
-+
-+ if (sh_mobile_format_is_yuv(var)) {
- info->fix.line_length = var->xres;
-- else
-- info->fix.line_length = var->xres * (cfg->bpp / 8);
-+ info->fix.visual = FB_VISUAL_FOURCC;
-+ } else {
-+ info->fix.line_length = var->xres * var->bits_per_pixel / 8;
-+ info->fix.visual = FB_VISUAL_TRUECOLOR;
-+ }
-
- info->screen_base = buf;
- info->device = dev;
-@@ -1626,9 +1749,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- goto err1;
- }
-
-- /* for dual channel LCDC (MAIN + SUB) force shared bpp setting */
-+ /* for dual channel LCDC (MAIN + SUB) force shared format setting */
- if (num_channels == 2)
-- priv->forced_bpp = pdata->ch[0].bpp;
-+ priv->forced_fourcc = pdata->ch[0].fourcc;
-
- priv->base = ioremap_nocache(res->start, resource_size(res));
- if (!priv->base)
-@@ -1675,13 +1798,10 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- if (error < 0)
- goto err1;
-
-- dev_info(info->dev,
-- "registered %s/%s as %dx%d %dbpp.\n",
-- pdev->name,
-- (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
-- "mainlcd" : "sublcd",
-- info->var.xres, info->var.yres,
-- ch->cfg.bpp);
-+ dev_info(info->dev, "registered %s/%s as %dx%d %dbpp.\n",
-+ pdev->name, (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
-+ "mainlcd" : "sublcd", info->var.xres, info->var.yres,
-+ info->var.bits_per_pixel);
-
- /* deferred io mode: disable clock to save power */
- if (info->fbdefio || info->state == FBINFO_STATE_SUSPENDED)
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 8101b72..fe30b75 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -174,7 +174,8 @@ struct sh_mobile_lcdc_bl_info {
-
- struct sh_mobile_lcdc_chan_cfg {
- int chan;
-- int bpp;
-+ int fourcc;
-+ int colorspace;
- int interface_type; /* selects RGBn or SYSn I/F, see above */
- int clock_divider;
- unsigned long flags; /* LCDC_FLAGS_... */
-@@ -184,7 +185,6 @@ struct sh_mobile_lcdc_chan_cfg {
- struct sh_mobile_lcdc_board_cfg board_cfg;
- struct sh_mobile_lcdc_bl_info bl_info;
- struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
-- int nonstd;
- struct sh_mobile_meram_cfg *meram_cfg;
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0145-fbdev-sh_mobile_lcdc-Reorder-code-into-sections.patch b/patches.armadillo800eva/0145-fbdev-sh_mobile_lcdc-Reorder-code-into-sections.patch
deleted file mode 100644
index 9fcf01f3696165..00000000000000
--- a/patches.armadillo800eva/0145-fbdev-sh_mobile_lcdc-Reorder-code-into-sections.patch
+++ /dev/null
@@ -1,547 +0,0 @@
-From 4256e90e66526555938a4f071320bbab2e942abe Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 7 Sep 2011 11:09:26 +0200
-Subject: fbdev: sh_mobile_lcdc: Reorder code into sections
-
-Make the driver more readable by reordering code and splitting it into
-logical sections. Reorder the headers alphabetically.
-
-No modification to the code have been performed.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit f1f60b5f55099a658a5f79cc453b371a439864e6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 421 +++++++++++++++++++++-----------------
- 1 file changed, 231 insertions(+), 190 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index aac5b36..8b18360 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -8,26 +8,27 @@
- * for more details.
- */
-
--#include <linux/kernel.h>
--#include <linux/init.h>
--#include <linux/delay.h>
--#include <linux/mm.h>
-+#include <linux/atomic.h>
-+#include <linux/backlight.h>
- #include <linux/clk.h>
--#include <linux/pm_runtime.h>
--#include <linux/platform_device.h>
-+#include <linux/console.h>
- #include <linux/dma-mapping.h>
-+#include <linux/delay.h>
-+#include <linux/gpio.h>
-+#include <linux/init.h>
- #include <linux/interrupt.h>
--#include <linux/videodev2.h>
--#include <linux/vmalloc.h>
- #include <linux/ioctl.h>
--#include <linux/slab.h>
--#include <linux/console.h>
--#include <linux/backlight.h>
--#include <linux/gpio.h>
-+#include <linux/kernel.h>
-+#include <linux/mm.h>
- #include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/pm_runtime.h>
-+#include <linux/slab.h>
-+#include <linux/videodev2.h>
-+#include <linux/vmalloc.h>
-+
- #include <video/sh_mobile_lcdc.h>
- #include <video/sh_mobile_meram.h>
--#include <linux/atomic.h>
-
- #include "sh_mobile_lcdcfb.h"
-
-@@ -37,6 +38,24 @@
- #define MAX_XRES 1920
- #define MAX_YRES 1080
-
-+struct sh_mobile_lcdc_priv {
-+ void __iomem *base;
-+ int irq;
-+ atomic_t hw_usecnt;
-+ struct device *dev;
-+ struct clk *dot_clk;
-+ unsigned long lddckr;
-+ struct sh_mobile_lcdc_chan ch[2];
-+ struct notifier_block notifier;
-+ int started;
-+ int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
-+ struct sh_mobile_meram_info *meram_dev;
-+};
-+
-+/* -----------------------------------------------------------------------------
-+ * Registers access
-+ */
-+
- static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = {
- [LDDCKPAT1R] = 0x400,
- [LDDCKPAT2R] = 0x404,
-@@ -75,38 +94,6 @@ static unsigned long lcdc_offs_sublcd[NR_CH_REGS] = {
- [LDPMR] = 0x63c,
- };
-
--static const struct fb_videomode default_720p = {
-- .name = "HDMI 720p",
-- .xres = 1280,
-- .yres = 720,
--
-- .left_margin = 220,
-- .right_margin = 110,
-- .hsync_len = 40,
--
-- .upper_margin = 20,
-- .lower_margin = 5,
-- .vsync_len = 5,
--
-- .pixclock = 13468,
-- .refresh = 60,
-- .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
--};
--
--struct sh_mobile_lcdc_priv {
-- void __iomem *base;
-- int irq;
-- atomic_t hw_usecnt;
-- struct device *dev;
-- struct clk *dot_clk;
-- unsigned long lddckr;
-- struct sh_mobile_lcdc_chan ch[2];
-- struct notifier_block notifier;
-- int started;
-- int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
-- struct sh_mobile_meram_info *meram_dev;
--};
--
- static bool banked(int reg_nr)
- {
- switch (reg_nr) {
-@@ -127,6 +114,11 @@ static bool banked(int reg_nr)
- return false;
- }
-
-+static int lcdc_chan_is_sublcd(struct sh_mobile_lcdc_chan *chan)
-+{
-+ return chan->cfg.chan == LCDC_CHAN_SUBLCD;
-+}
-+
- static void lcdc_write_chan(struct sh_mobile_lcdc_chan *chan,
- int reg_nr, unsigned long data)
- {
-@@ -169,11 +161,77 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv *priv,
- cpu_relax();
- }
-
--static int lcdc_chan_is_sublcd(struct sh_mobile_lcdc_chan *chan)
-+/* -----------------------------------------------------------------------------
-+ * Clock management
-+ */
-+
-+static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
- {
-- return chan->cfg.chan == LCDC_CHAN_SUBLCD;
-+ if (atomic_inc_and_test(&priv->hw_usecnt)) {
-+ if (priv->dot_clk)
-+ clk_enable(priv->dot_clk);
-+ pm_runtime_get_sync(priv->dev);
-+ if (priv->meram_dev && priv->meram_dev->pdev)
-+ pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
-+ }
- }
-
-+static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
-+{
-+ if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
-+ if (priv->meram_dev && priv->meram_dev->pdev)
-+ pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
-+ pm_runtime_put(priv->dev);
-+ if (priv->dot_clk)
-+ clk_disable(priv->dot_clk);
-+ }
-+}
-+
-+static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
-+ int clock_source,
-+ struct sh_mobile_lcdc_priv *priv)
-+{
-+ char *str;
-+
-+ switch (clock_source) {
-+ case LCDC_CLK_BUS:
-+ str = "bus_clk";
-+ priv->lddckr = LDDCKR_ICKSEL_BUS;
-+ break;
-+ case LCDC_CLK_PERIPHERAL:
-+ str = "peripheral_clk";
-+ priv->lddckr = LDDCKR_ICKSEL_MIPI;
-+ break;
-+ case LCDC_CLK_EXTERNAL:
-+ str = NULL;
-+ priv->lddckr = LDDCKR_ICKSEL_HDMI;
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ if (str) {
-+ priv->dot_clk = clk_get(&pdev->dev, str);
-+ if (IS_ERR(priv->dot_clk)) {
-+ dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
-+ return PTR_ERR(priv->dot_clk);
-+ }
-+ }
-+
-+ /* Runtime PM support involves two step for this driver:
-+ * 1) Enable Runtime PM
-+ * 2) Force Runtime PM Resume since hardware is accessed from probe()
-+ */
-+ priv->dev = &pdev->dev;
-+ pm_runtime_enable(priv->dev);
-+ pm_runtime_resume(priv->dev);
-+ return 0;
-+}
-+
-+/* -----------------------------------------------------------------------------
-+ * Sys panel and deferred I/O
-+ */
-+
- static void lcdc_sys_write_index(void *handle, unsigned long data)
- {
- struct sh_mobile_lcdc_chan *ch = handle;
-@@ -216,69 +274,6 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
- lcdc_sys_read_data,
- };
-
--static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
--{
-- if (var->grayscale > 1)
-- return var->grayscale;
--
-- switch (var->bits_per_pixel) {
-- case 16:
-- return V4L2_PIX_FMT_RGB565;
-- case 24:
-- return V4L2_PIX_FMT_BGR24;
-- case 32:
-- return V4L2_PIX_FMT_BGR32;
-- default:
-- return 0;
-- }
--}
--
--static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
--{
-- return var->grayscale > 1;
--}
--
--static bool sh_mobile_format_is_yuv(const struct fb_var_screeninfo *var)
--{
-- if (var->grayscale <= 1)
-- return false;
--
-- switch (var->grayscale) {
-- case V4L2_PIX_FMT_NV12:
-- case V4L2_PIX_FMT_NV21:
-- case V4L2_PIX_FMT_NV16:
-- case V4L2_PIX_FMT_NV61:
-- case V4L2_PIX_FMT_NV24:
-- case V4L2_PIX_FMT_NV42:
-- return true;
--
-- default:
-- return false;
-- }
--}
--
--static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
--{
-- if (atomic_inc_and_test(&priv->hw_usecnt)) {
-- if (priv->dot_clk)
-- clk_enable(priv->dot_clk);
-- pm_runtime_get_sync(priv->dev);
-- if (priv->meram_dev && priv->meram_dev->pdev)
-- pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
-- }
--}
--
--static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
--{
-- if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
-- if (priv->meram_dev && priv->meram_dev->pdev)
-- pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
-- pm_runtime_put(priv->dev);
-- if (priv->dot_clk)
-- clk_disable(priv->dot_clk);
-- }
--}
--
- static int sh_mobile_lcdc_sginit(struct fb_info *info,
- struct list_head *pagelist)
- {
-@@ -345,6 +340,55 @@ static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
- schedule_delayed_work(&info->deferred_work, fbdefio->delay);
- }
-
-+/* -----------------------------------------------------------------------------
-+ * Format helpers
-+ */
-+
-+static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
-+{
-+ if (var->grayscale > 1)
-+ return var->grayscale;
-+
-+ switch (var->bits_per_pixel) {
-+ case 16:
-+ return V4L2_PIX_FMT_RGB565;
-+ case 24:
-+ return V4L2_PIX_FMT_BGR24;
-+ case 32:
-+ return V4L2_PIX_FMT_BGR32;
-+ default:
-+ return 0;
-+ }
-+}
-+
-+static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
-+{
-+ return var->grayscale > 1;
-+}
-+
-+static bool sh_mobile_format_is_yuv(const struct fb_var_screeninfo *var)
-+{
-+ if (var->grayscale <= 1)
-+ return false;
-+
-+ switch (var->grayscale) {
-+ case V4L2_PIX_FMT_NV12:
-+ case V4L2_PIX_FMT_NV21:
-+ case V4L2_PIX_FMT_NV16:
-+ case V4L2_PIX_FMT_NV61:
-+ case V4L2_PIX_FMT_NV24:
-+ case V4L2_PIX_FMT_NV42:
-+ return true;
-+
-+ default:
-+ return false;
-+ }
-+}
-+
-+/* -----------------------------------------------------------------------------
-+ * Start, stop and IRQ
-+ */
-+
- static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
- {
- struct sh_mobile_lcdc_priv *priv = data;
-@@ -790,86 +834,9 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
- sh_mobile_lcdc_clk_off(priv);
- }
-
--static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
--{
-- int interface_type = ch->cfg.interface_type;
--
-- switch (interface_type) {
-- case RGB8:
-- case RGB9:
-- case RGB12A:
-- case RGB12B:
-- case RGB16:
-- case RGB18:
-- case RGB24:
-- case SYS8A:
-- case SYS8B:
-- case SYS8C:
-- case SYS8D:
-- case SYS9:
-- case SYS12:
-- case SYS16A:
-- case SYS16B:
-- case SYS16C:
-- case SYS18:
-- case SYS24:
-- break;
-- default:
-- return -EINVAL;
-- }
--
-- /* SUBLCD only supports SYS interface */
-- if (lcdc_chan_is_sublcd(ch)) {
-- if (!(interface_type & LDMT1R_IFM))
-- return -EINVAL;
--
-- interface_type &= ~LDMT1R_IFM;
-- }
--
-- ch->ldmt1r_value = interface_type;
-- return 0;
--}
--
--static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
-- int clock_source,
-- struct sh_mobile_lcdc_priv *priv)
--{
-- char *str;
--
-- switch (clock_source) {
-- case LCDC_CLK_BUS:
-- str = "bus_clk";
-- priv->lddckr = LDDCKR_ICKSEL_BUS;
-- break;
-- case LCDC_CLK_PERIPHERAL:
-- str = "peripheral_clk";
-- priv->lddckr = LDDCKR_ICKSEL_MIPI;
-- break;
-- case LCDC_CLK_EXTERNAL:
-- str = NULL;
-- priv->lddckr = LDDCKR_ICKSEL_HDMI;
-- break;
-- default:
-- return -EINVAL;
-- }
--
-- if (str) {
-- priv->dot_clk = clk_get(&pdev->dev, str);
-- if (IS_ERR(priv->dot_clk)) {
-- dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
-- return PTR_ERR(priv->dot_clk);
-- }
-- }
--
-- /* Runtime PM support involves two step for this driver:
-- * 1) Enable Runtime PM
-- * 2) Force Runtime PM Resume since hardware is accessed from probe()
-- */
-- priv->dev = &pdev->dev;
-- pm_runtime_enable(priv->dev);
-- pm_runtime_resume(priv->dev);
-- return 0;
--}
-+/* -----------------------------------------------------------------------------
-+ * Frame buffer operations
-+ */
-
- static int sh_mobile_lcdc_setcolreg(u_int regno,
- u_int red, u_int green, u_int blue,
-@@ -1334,6 +1301,10 @@ static struct fb_ops sh_mobile_lcdc_ops = {
- .fb_set_par = sh_mobile_set_par,
- };
-
-+/* -----------------------------------------------------------------------------
-+ * Backlight
-+ */
-+
- static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
- {
- struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
-@@ -1393,6 +1364,10 @@ static void sh_mobile_lcdc_bl_remove(struct backlight_device *bdev)
- backlight_device_unregister(bdev);
- }
-
-+/* -----------------------------------------------------------------------------
-+ * Power management
-+ */
-+
- static int sh_mobile_lcdc_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
-@@ -1436,6 +1411,10 @@ static const struct dev_pm_ops sh_mobile_lcdc_dev_pm_ops = {
- .runtime_resume = sh_mobile_lcdc_runtime_resume,
- };
-
-+/* -----------------------------------------------------------------------------
-+ * Framebuffer notifier
-+ */
-+
- /* locking: called with info->lock held */
- static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- unsigned long action, void *data)
-@@ -1476,6 +1455,28 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- return NOTIFY_OK;
- }
-
-+/* -----------------------------------------------------------------------------
-+ * Probe/remove and driver init/exit
-+ */
-+
-+static const struct fb_videomode default_720p = {
-+ .name = "HDMI 720p",
-+ .xres = 1280,
-+ .yres = 720,
-+
-+ .left_margin = 220,
-+ .right_margin = 110,
-+ .hsync_len = 40,
-+
-+ .upper_margin = 20,
-+ .lower_margin = 5,
-+ .vsync_len = 5,
-+
-+ .pixclock = 13468,
-+ .refresh = 60,
-+ .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
-+};
-+
- static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- {
- struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-@@ -1527,6 +1528,46 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- return 0;
- }
-
-+static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
-+{
-+ int interface_type = ch->cfg.interface_type;
-+
-+ switch (interface_type) {
-+ case RGB8:
-+ case RGB9:
-+ case RGB12A:
-+ case RGB12B:
-+ case RGB16:
-+ case RGB18:
-+ case RGB24:
-+ case SYS8A:
-+ case SYS8B:
-+ case SYS8C:
-+ case SYS8D:
-+ case SYS9:
-+ case SYS12:
-+ case SYS16A:
-+ case SYS16B:
-+ case SYS16C:
-+ case SYS18:
-+ case SYS24:
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ /* SUBLCD only supports SYS interface */
-+ if (lcdc_chan_is_sublcd(ch)) {
-+ if (!(interface_type & LDMT1R_IFM))
-+ return -EINVAL;
-+
-+ interface_type &= ~LDMT1R_IFM;
-+ }
-+
-+ ch->ldmt1r_value = interface_type;
-+ return 0;
-+}
-+
- static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- struct device *dev)
- {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0146-fbdev-sh_mobile_lcdc-Mark-init-only-symbols-with-__d.patch b/patches.armadillo800eva/0146-fbdev-sh_mobile_lcdc-Mark-init-only-symbols-with-__d.patch
deleted file mode 100644
index 28627dc920f65b..00000000000000
--- a/patches.armadillo800eva/0146-fbdev-sh_mobile_lcdc-Mark-init-only-symbols-with-__d.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 944c754ccfe91d14fc6f94618841fdb9b0d4a6e3 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 7 Sep 2011 11:59:00 +0200
-Subject: fbdev: sh_mobile_lcdc: Mark init-only symbols with __devinit(const)
-
-default_720p and sh_mobile_lcdc_check_interface are used at device
-initialization time only. Mark them as __devinitconst and __devinit
-respectively.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 217e9c4353aa86f0c7eeb4c275bca73ea8b53be1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 8b18360..d9f394e 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1459,7 +1459,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- * Probe/remove and driver init/exit
- */
-
--static const struct fb_videomode default_720p = {
-+static const struct fb_videomode default_720p __devinitconst = {
- .name = "HDMI 720p",
- .xres = 1280,
- .yres = 720,
-@@ -1528,7 +1528,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- return 0;
- }
-
--static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
-+static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
- {
- int interface_type = ch->cfg.interface_type;
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0147-fbdev-sh_mobile_lcdc-Move-pm-runtime-enable-to-probe.patch b/patches.armadillo800eva/0147-fbdev-sh_mobile_lcdc-Move-pm-runtime-enable-to-probe.patch
deleted file mode 100644
index 6b545e8c94e5b5..00000000000000
--- a/patches.armadillo800eva/0147-fbdev-sh_mobile_lcdc-Move-pm-runtime-enable-to-probe.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 8abe9070ac0df6222c5aa238ff8ea107da4b79af Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 7 Sep 2011 15:47:07 +0200
-Subject: fbdev: sh_mobile_lcdc: Move pm runtime enable to probe()
-
-The pm_runtime_enable() and pm_runtime_resume() calls don't belong to
-sh_mobile_lcdc_setup_clocks(). Move them to the probe function. Remove
-the unneeded pm_runtime_resume() call.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 4774c12aacafc0b8be81b1d159be5a761889e2d7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 34 ++++++++++++++++------------------
- 1 file changed, 16 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index d9f394e..75f613b 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -191,6 +191,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
- int clock_source,
- struct sh_mobile_lcdc_priv *priv)
- {
-+ struct clk *clk;
- char *str;
-
- switch (clock_source) {
-@@ -210,21 +211,16 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
- return -EINVAL;
- }
-
-- if (str) {
-- priv->dot_clk = clk_get(&pdev->dev, str);
-- if (IS_ERR(priv->dot_clk)) {
-- dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
-- return PTR_ERR(priv->dot_clk);
-- }
-+ if (str == NULL)
-+ return 0;
-+
-+ clk = clk_get(&pdev->dev, str);
-+ if (IS_ERR(clk)) {
-+ dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
-+ return PTR_ERR(clk);
- }
-
-- /* Runtime PM support involves two step for this driver:
-- * 1) Enable Runtime PM
-- * 2) Force Runtime PM Resume since hardware is accessed from probe()
-- */
-- priv->dev = &pdev->dev;
-- pm_runtime_enable(priv->dev);
-- pm_runtime_resume(priv->dev);
-+ priv->dot_clk = clk;
- return 0;
- }
-
-@@ -1513,11 +1509,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
- }
-
-- if (priv->dot_clk)
-+ if (priv->dot_clk) {
-+ pm_runtime_disable(&pdev->dev);
- clk_put(priv->dot_clk);
--
-- if (priv->dev)
-- pm_runtime_disable(priv->dev);
-+ }
-
- if (priv->base)
- iounmap(priv->base);
-@@ -1739,6 +1734,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- return -ENOMEM;
- }
-
-+ priv->dev = &pdev->dev;
-+ priv->meram_dev = pdata->meram_dev;
- platform_set_drvdata(pdev, priv);
-
- error = request_irq(i, sh_mobile_lcdc_irq, 0,
-@@ -1804,7 +1801,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- goto err1;
- }
-
-- priv->meram_dev = pdata->meram_dev;
-+ /* Enable runtime PM. */
-+ pm_runtime_enable(&pdev->dev);
-
- for (i = 0; i < num_channels; i++) {
- struct sh_mobile_lcdc_chan *ch = priv->ch + i;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0148-fbdev-sh_mobile_lcdc-Don-t-pass-struct-device-around.patch b/patches.armadillo800eva/0148-fbdev-sh_mobile_lcdc-Don-t-pass-struct-device-around.patch
deleted file mode 100644
index 25b141f5ab78f3..00000000000000
--- a/patches.armadillo800eva/0148-fbdev-sh_mobile_lcdc-Don-t-pass-struct-device-around.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From a5021ecc0d61923f6a09e5dc04b86f96526a5cc3 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 7 Sep 2011 16:02:31 +0200
-Subject: fbdev: sh_mobile_lcdc: Don't pass struct device around
-
-Pass a pointer to a struct sh_mobile_lcdc_priv instead, which stores a
-pointer to the device.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 0a7f17aa3d6b693700af2e1cbf8cfdd28e18aebb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 41 +++++++++++++++++++-------------------
- 1 file changed, 21 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 75f613b..a805f96 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -187,9 +187,8 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
- }
- }
-
--static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
-- int clock_source,
-- struct sh_mobile_lcdc_priv *priv)
-+static int sh_mobile_lcdc_setup_clocks(struct sh_mobile_lcdc_priv *priv,
-+ int clock_source)
- {
- struct clk *clk;
- char *str;
-@@ -214,9 +213,9 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
- if (str == NULL)
- return 0;
-
-- clk = clk_get(&pdev->dev, str);
-+ clk = clk_get(priv->dev, str);
- if (IS_ERR(clk)) {
-- dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
-+ dev_err(priv->dev, "cannot get dot clock %s\n", str);
- return PTR_ERR(clk);
- }
-
-@@ -1563,8 +1562,9 @@ static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *
- return 0;
- }
-
--static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
-- struct device *dev)
-+static int __devinit
-+sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
-+ struct sh_mobile_lcdc_chan *ch)
- {
- struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
- const struct fb_videomode *max_mode;
-@@ -1580,9 +1580,9 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- mutex_init(&ch->open_lock);
-
- /* Allocate the frame buffer device. */
-- ch->info = framebuffer_alloc(0, dev);
-+ ch->info = framebuffer_alloc(0, priv->dev);
- if (!ch->info) {
-- dev_err(dev, "unable to allocate fb_info\n");
-+ dev_err(priv->dev, "unable to allocate fb_info\n");
- return -ENOMEM;
- }
-
-@@ -1604,8 +1604,8 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- /* NV12/NV21 buffers must have even number of lines */
- if ((cfg->fourcc == V4L2_PIX_FMT_NV12 ||
- cfg->fourcc == V4L2_PIX_FMT_NV21) && (mode->yres & 0x1)) {
-- dev_err(dev, "yres must be multiple of 2 for YCbCr420 "
-- "mode.\n");
-+ dev_err(priv->dev, "yres must be multiple of 2 for "
-+ "YCbCr420 mode.\n");
- return -EINVAL;
- }
-
-@@ -1618,7 +1618,7 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- if (!max_size)
- max_size = MAX_XRES * MAX_YRES;
- else
-- dev_dbg(dev, "Found largest videomode %ux%u\n",
-+ dev_dbg(priv->dev, "Found largest videomode %ux%u\n",
- max_mode->xres, max_mode->yres);
-
- /* Create the mode list. */
-@@ -1669,16 +1669,17 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- max_size = max_size * var->bits_per_pixel / 8 * 2;
-
- /* Allocate frame buffer memory and color map. */
-- buf = dma_alloc_coherent(dev, max_size, &ch->dma_handle, GFP_KERNEL);
-+ buf = dma_alloc_coherent(priv->dev, max_size, &ch->dma_handle,
-+ GFP_KERNEL);
- if (!buf) {
-- dev_err(dev, "unable to allocate buffer\n");
-+ dev_err(priv->dev, "unable to allocate buffer\n");
- return -ENOMEM;
- }
-
- ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
- if (ret < 0) {
-- dev_err(dev, "unable to allocate cmap\n");
-- dma_free_coherent(dev, max_size, buf, ch->dma_handle);
-+ dev_err(priv->dev, "unable to allocate cmap\n");
-+ dma_free_coherent(priv->dev, max_size, buf, ch->dma_handle);
- return ret;
- }
-
-@@ -1701,7 +1702,7 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
- }
-
- info->screen_base = buf;
-- info->device = dev;
-+ info->device = priv->dev;
- ch->display_var = *var;
-
- return 0;
-@@ -1795,7 +1796,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- if (!priv->base)
- goto err1;
-
-- error = sh_mobile_lcdc_setup_clocks(pdev, pdata->clock_source, priv);
-+ error = sh_mobile_lcdc_setup_clocks(priv, pdata->clock_source);
- if (error) {
- dev_err(&pdev->dev, "unable to setup clocks\n");
- goto err1;
-@@ -1807,7 +1808,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- for (i = 0; i < num_channels; i++) {
- struct sh_mobile_lcdc_chan *ch = priv->ch + i;
-
-- error = sh_mobile_lcdc_channel_init(ch, &pdev->dev);
-+ error = sh_mobile_lcdc_channel_init(priv, ch);
- if (error)
- goto err1;
- }
-@@ -1837,7 +1838,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- if (error < 0)
- goto err1;
-
-- dev_info(info->dev, "registered %s/%s as %dx%d %dbpp.\n",
-+ dev_info(&pdev->dev, "registered %s/%s as %dx%d %dbpp.\n",
- pdev->name, (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
- "mainlcd" : "sublcd", info->var.xres, info->var.yres,
- info->var.bits_per_pixel);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0149-fbdev-sh_mobile_lcdc-Create-functions-to-turn-the-di.patch b/patches.armadillo800eva/0149-fbdev-sh_mobile_lcdc-Create-functions-to-turn-the-di.patch
deleted file mode 100644
index 302f8474653c16..00000000000000
--- a/patches.armadillo800eva/0149-fbdev-sh_mobile_lcdc-Create-functions-to-turn-the-di.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From b0d650961680a7480c79d5468b273cfdb494e7ed Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Fri, 9 Sep 2011 15:45:43 +0200
-Subject: fbdev: sh_mobile_lcdc: Create functions to turn the display on/off
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 37c5dcc21ddaa9f946c4d691996bb3076598b813)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 53 ++++++++++++++++++++------------------
- 1 file changed, 28 insertions(+), 25 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index a805f96..bd725a4 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -224,7 +224,7 @@ static int sh_mobile_lcdc_setup_clocks(struct sh_mobile_lcdc_priv *priv,
- }
-
- /* -----------------------------------------------------------------------------
-- * Sys panel and deferred I/O
-+ * Display, panel and deferred I/O
- */
-
- static void lcdc_sys_write_index(void *handle, unsigned long data)
-@@ -335,6 +335,27 @@ static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
- schedule_delayed_work(&info->deferred_work, fbdefio->delay);
- }
-
-+static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
-+{
-+ struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-+
-+ /* HDMI must be enabled before LCDC configuration */
-+ if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
-+ board_cfg->display_on(board_cfg->board_data, ch->info);
-+ module_put(board_cfg->owner);
-+ }
-+}
-+
-+static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
-+{
-+ struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-+
-+ if (board_cfg->display_off && try_module_get(board_cfg->owner)) {
-+ board_cfg->display_off(board_cfg->board_data);
-+ module_put(board_cfg->owner);
-+ }
-+}
-+
- /* -----------------------------------------------------------------------------
- * Format helpers
- */
-@@ -648,7 +669,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- {
- struct sh_mobile_meram_info *mdev = priv->meram_dev;
-- struct sh_mobile_lcdc_board_cfg *board_cfg;
- struct sh_mobile_lcdc_chan *ch;
- unsigned long tmp;
- int ret;
-@@ -665,8 +685,9 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
-
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- ch = &priv->ch[k];
-+ struct sh_mobile_lcdc_board_cfg *board_cfg;
-
-+ ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
-@@ -754,11 +775,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- fb_deferred_io_init(ch->info);
- }
-
-- board_cfg = &ch->cfg.board_cfg;
-- if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
-- board_cfg->display_on(board_cfg->board_data, ch->info);
-- module_put(board_cfg->owner);
-- }
-+ sh_mobile_lcdc_display_on(ch);
-
- if (ch->bl) {
- ch->bl->props.power = FB_BLANK_UNBLANK;
-@@ -772,7 +789,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
- {
- struct sh_mobile_lcdc_chan *ch;
-- struct sh_mobile_lcdc_board_cfg *board_cfg;
- int k;
-
- /* clean up deferred io and ask board code to disable panel */
-@@ -799,11 +815,7 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
- backlight_update_status(ch->bl);
- }
-
-- board_cfg = &ch->cfg.board_cfg;
-- if (board_cfg->display_off && try_module_get(board_cfg->owner)) {
-- board_cfg->display_off(board_cfg->board_data);
-- module_put(board_cfg->owner);
-- }
-+ sh_mobile_lcdc_display_off(ch);
-
- /* disable the meram */
- if (ch->meram_enabled) {
-@@ -1417,7 +1429,6 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- struct fb_event *event = data;
- struct fb_info *info = event->info;
- struct sh_mobile_lcdc_chan *ch = info->par;
-- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-
- if (&ch->lcdc->notifier != nb)
- return NOTIFY_DONE;
-@@ -1427,10 +1438,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
-
- switch(action) {
- case FB_EVENT_SUSPEND:
-- if (board_cfg->display_off && try_module_get(board_cfg->owner)) {
-- board_cfg->display_off(board_cfg->board_data);
-- module_put(board_cfg->owner);
-- }
-+ sh_mobile_lcdc_display_off(ch);
- sh_mobile_lcdc_stop(ch->lcdc);
- break;
- case FB_EVENT_RESUME:
-@@ -1438,12 +1446,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
- sh_mobile_fb_reconfig(info);
- mutex_unlock(&ch->open_lock);
-
-- /* HDMI must be enabled before LCDC configuration */
-- if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
-- board_cfg->display_on(board_cfg->board_data, info);
-- module_put(board_cfg->owner);
-- }
--
-+ sh_mobile_lcdc_display_on(ch);
- sh_mobile_lcdc_start(ch->lcdc);
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0150-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-channel-in-no.patch b/patches.armadillo800eva/0150-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-channel-in-no.patch
deleted file mode 100644
index 89450cbc1a093d..00000000000000
--- a/patches.armadillo800eva/0150-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-channel-in-no.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 20719471f5f65096346f478923583334bd56998d Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Thu, 24 Nov 2011 11:53:47 +0100
-Subject: fbdev: sh_mobile_hdmi: Don't access LCDC channel in notifier
- callback
-
-Instead of relying on info->par being a pointer to an LCDC channel, cast
-the notifier block pointer to an sh_hdmi pointer.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 12ee2502c0503c484a7df052d356e39c40b02400)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 647ba98..a77bbc3 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -225,6 +225,8 @@ struct sh_hdmi {
- struct notifier_block notifier;
- };
-
-+#define notifier_to_hdmi(n) container_of(n, struct sh_hdmi, notifier)
-+
- static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg)
- {
- iowrite8(data, hdmi->base + reg);
-@@ -1204,11 +1206,9 @@ static int sh_hdmi_notify(struct notifier_block *nb,
- {
- struct fb_event *event = data;
- struct fb_info *info = event->info;
-- struct sh_mobile_lcdc_chan *ch = info->par;
-- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-- struct sh_hdmi *hdmi = board_cfg->board_data;
-+ struct sh_hdmi *hdmi = notifier_to_hdmi(nb);
-
-- if (!hdmi || nb != &hdmi->notifier || hdmi->info != info)
-+ if (hdmi->info != info)
- return NOTIFY_DONE;
-
- switch(action) {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0151-sh_mobile_hdmi-Remove-platform-data-lcd_dev-field.patch b/patches.armadillo800eva/0151-sh_mobile_hdmi-Remove-platform-data-lcd_dev-field.patch
deleted file mode 100644
index d3319220fe4a2e..00000000000000
--- a/patches.armadillo800eva/0151-sh_mobile_hdmi-Remove-platform-data-lcd_dev-field.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 84d3c145adf7360dd17cd51b1747f7225064101d Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Fri, 9 Sep 2011 16:08:02 +0200
-Subject: sh_mobile_hdmi: Remove platform data lcd_dev field
-
-The field is used to print debug messages only. Remove it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 134d22eb58b72c4fe5e6ca3ebcaccd4975f06842)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 1 -
- arch/arm/mach-shmobile/board-mackerel.c | 1 -
- drivers/video/sh_mobile_hdmi.c | 17 +++++------------
- include/video/sh_mobile_hdmi.h | 1 -
- 4 files changed, 5 insertions(+), 15 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 305dcd7..5330b68 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -823,7 +823,6 @@ static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
-
- static struct sh_mobile_hdmi_info hdmi_info = {
- .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
-- .lcd_dev = &lcdc1_device.dev,
- .flags = HDMI_SND_SRC_SPDIF,
- .clk_optimize_parent = ap4evb_clk_optimize,
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 28d98da..45a608b 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -484,7 +484,6 @@ static struct platform_device hdmi_lcdc_device = {
-
- static struct sh_mobile_hdmi_info hdmi_info = {
- .lcd_chan = &hdmi_lcdc_info.ch[0],
-- .lcd_dev = &hdmi_lcdc_device.dev,
- .flags = HDMI_SND_SRC_SPDIF,
- };
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index a77bbc3..ebd0651 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -1008,11 +1008,9 @@ static void sh_hdmi_display_on(void *arg, struct fb_info *info)
- * FB_EVENT_FB_UNBIND notify is also called with info->lock held
- */
- struct sh_hdmi *hdmi = arg;
-- struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data;
- struct sh_mobile_lcdc_chan *ch = info->par;
-
-- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__,
-- pdata->lcd_dev, info->state);
-+ dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
-
- /* No need to lock */
- hdmi->info = info;
-@@ -1040,9 +1038,8 @@ static void sh_hdmi_display_on(void *arg, struct fb_info *info)
- static void sh_hdmi_display_off(void *arg)
- {
- struct sh_hdmi *hdmi = arg;
-- struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data;
-
-- dev_dbg(hdmi->dev, "%s(%p)\n", __func__, pdata->lcd_dev);
-+ dev_dbg(hdmi->dev, "%s(%p)\n", __func__, hdmi);
- /* PS mode e->a */
- hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL);
- }
-@@ -1114,15 +1111,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- {
- struct sh_hdmi *hdmi = container_of(work, struct sh_hdmi, edid_work.work);
- struct fb_info *info;
-- struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data;
- struct sh_mobile_lcdc_chan *ch;
- int ret;
-
-- dev_dbg(hdmi->dev, "%s(%p): begin, hotplug status %d\n", __func__,
-- pdata->lcd_dev, hdmi->hp_state);
--
-- if (!pdata->lcd_dev)
-- return;
-+ dev_dbg(hdmi->dev, "%s(%p): begin, hotplug status %d\n", __func__, hdmi,
-+ hdmi->hp_state);
-
- mutex_lock(&hdmi->mutex);
-
-@@ -1198,7 +1191,7 @@ out:
- hdmi->hp_state = HDMI_HOTPLUG_DISCONNECTED;
- mutex_unlock(&hdmi->mutex);
-
-- dev_dbg(hdmi->dev, "%s(%p): end\n", __func__, pdata->lcd_dev);
-+ dev_dbg(hdmi->dev, "%s(%p): end\n", __func__, hdmi);
- }
-
- static int sh_hdmi_notify(struct notifier_block *nb,
-diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h
-index b569329..0b8d2cf 100644
---- a/include/video/sh_mobile_hdmi.h
-+++ b/include/video/sh_mobile_hdmi.h
-@@ -32,7 +32,6 @@ struct clk;
-
- struct sh_mobile_hdmi_info {
- struct sh_mobile_lcdc_chan_cfg *lcd_chan;
-- struct device *lcd_dev;
- unsigned int flags;
- long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq,
- unsigned long *parent_freq);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0152-fbdev-sh_mobile_lcdc-Add-sh_mobile_lcdc_entity-defin.patch b/patches.armadillo800eva/0152-fbdev-sh_mobile_lcdc-Add-sh_mobile_lcdc_entity-defin.patch
deleted file mode 100644
index aec56ab5aeeb63..00000000000000
--- a/patches.armadillo800eva/0152-fbdev-sh_mobile_lcdc-Add-sh_mobile_lcdc_entity-defin.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From b9adc06ac68d46790bb530b0f5b2fb606b2915fa Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:15:36 +0200
-Subject: fbdev: sh_mobile_lcdc: Add sh_mobile_lcdc_entity definition
-
-The sh_mobile_lcdc_entity structure will be used to abstract operations
-performed by transceivers (such as MIPI/DSI and HDMI).
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d2ccdc807baa38a6487a25099c939a82f4698953)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.h | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index a58a0f3..d79e5aa 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -14,9 +14,23 @@ enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R,
-
- #define PALETTE_NR 16
-
--struct sh_mobile_lcdc_priv;
--struct fb_info;
- struct backlight_device;
-+struct fb_info;
-+struct module;
-+struct sh_mobile_lcdc_entity;
-+struct sh_mobile_lcdc_priv;
-+
-+struct sh_mobile_lcdc_entity_ops {
-+ /* Display */
-+ int (*display_on)(struct sh_mobile_lcdc_entity *entity,
-+ struct fb_info *info);
-+ void (*display_off)(struct sh_mobile_lcdc_entity *entity);
-+};
-+
-+struct sh_mobile_lcdc_entity {
-+ struct module *owner;
-+ const struct sh_mobile_lcdc_entity_ops *ops;
-+};
-
- /*
- * struct sh_mobile_lcdc_chan - LCDC display channel
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0153-fbdev-sh_mobile_hdmi-Implement-sh_mobile_lcdc_entity.patch b/patches.armadillo800eva/0153-fbdev-sh_mobile_hdmi-Implement-sh_mobile_lcdc_entity.patch
deleted file mode 100644
index 9bc856abe8b103..00000000000000
--- a/patches.armadillo800eva/0153-fbdev-sh_mobile_hdmi-Implement-sh_mobile_lcdc_entity.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From 8e8ced18a284a9ce45e5e3d9e696127119bd07a6 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:27:50 +0200
-Subject: fbdev: sh_mobile_hdmi: Implement sh_mobile_lcdc_entity interface
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 8511ea4ad39e351767167280b0b0ac716a8f2986)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 39 +++++++++++++++++++++++++++++++--------
- 1 file changed, 31 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index ebd0651..5e5f83c 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -208,6 +208,8 @@ enum hotplug_state {
- };
-
- struct sh_hdmi {
-+ struct sh_mobile_lcdc_entity entity;
-+
- void __iomem *base;
- enum hotplug_state hp_state; /* hot-plug status */
- u8 preprogrammed_vic; /* use a pre-programmed VIC or
-@@ -225,6 +227,7 @@ struct sh_hdmi {
- struct notifier_block notifier;
- };
-
-+#define entity_to_sh_hdmi(e) container_of(e, struct sh_hdmi, entity)
- #define notifier_to_hdmi(n) container_of(n, struct sh_hdmi, notifier)
-
- static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg)
-@@ -1001,13 +1004,14 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
- }
-
- /* locking: called with info->lock held, or before register_framebuffer() */
--static void sh_hdmi_display_on(void *arg, struct fb_info *info)
-+static int __sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
-+ struct fb_info *info)
- {
- /*
- * info is guaranteed to be valid, when we are called, because our
- * FB_EVENT_FB_UNBIND notify is also called with info->lock held
- */
-- struct sh_hdmi *hdmi = arg;
-+ struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
- struct sh_mobile_lcdc_chan *ch = info->par;
-
- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
-@@ -1032,18 +1036,35 @@ static void sh_hdmi_display_on(void *arg, struct fb_info *info)
- default:
- hdmi->var = ch->display_var;
- }
-+
-+ return 0;
-+}
-+
-+static void sh_hdmi_display_on(void *arg, struct fb_info *info)
-+{
-+ __sh_hdmi_display_on(arg, info);
- }
-
- /* locking: called with info->lock held */
--static void sh_hdmi_display_off(void *arg)
-+static void __sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
- {
-- struct sh_hdmi *hdmi = arg;
-+ struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
-
- dev_dbg(hdmi->dev, "%s(%p)\n", __func__, hdmi);
- /* PS mode e->a */
- hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL);
- }
-
-+static void sh_hdmi_display_off(void *arg)
-+{
-+ __sh_hdmi_display_off(arg);
-+}
-+
-+static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
-+ .display_on = __sh_hdmi_display_on,
-+ .display_off = __sh_hdmi_display_off,
-+};
-+
- static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
- {
- struct fb_info *info = hdmi->info;
-@@ -1157,7 +1178,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- */
- info->var.width = hdmi->var.width;
- info->var.height = hdmi->var.height;
-- sh_hdmi_display_on(hdmi, info);
-+ __sh_hdmi_display_on(&hdmi->entity, info);
- } else {
- /* New monitor or have to wake up */
- fb_set_suspend(info, 0);
-@@ -1251,6 +1272,8 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
- mutex_init(&hdmi->mutex);
-
- hdmi->dev = &pdev->dev;
-+ hdmi->entity.owner = THIS_MODULE;
-+ hdmi->entity.ops = &sh_hdmi_ops;
-
- hdmi->hdmi_clk = clk_get(&pdev->dev, "ick");
- if (IS_ERR(hdmi->hdmi_clk)) {
-@@ -1290,12 +1313,12 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
- goto emap;
- }
-
-- platform_set_drvdata(pdev, hdmi);
-+ platform_set_drvdata(pdev, &hdmi->entity);
-
- /* Set up LCDC callbacks */
- board_cfg = &pdata->lcd_chan->board_cfg;
- board_cfg->owner = THIS_MODULE;
-- board_cfg->board_data = hdmi;
-+ board_cfg->board_data = &hdmi->entity;
- board_cfg->display_on = sh_hdmi_display_on;
- board_cfg->display_off = sh_hdmi_display_off;
-
-@@ -1349,7 +1372,7 @@ egetclk:
- static int __exit sh_hdmi_remove(struct platform_device *pdev)
- {
- struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
-- struct sh_hdmi *hdmi = platform_get_drvdata(pdev);
-+ struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- struct sh_mobile_lcdc_board_cfg *board_cfg = &pdata->lcd_chan->board_cfg;
- int irq = platform_get_irq(pdev, 0);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0154-fbdev-sh_mipi_dsi-Implement-sh_mobile_lcdc_entity-in.patch b/patches.armadillo800eva/0154-fbdev-sh_mipi_dsi-Implement-sh_mobile_lcdc_entity-in.patch
deleted file mode 100644
index 92ed67242f56b8..00000000000000
--- a/patches.armadillo800eva/0154-fbdev-sh_mipi_dsi-Implement-sh_mobile_lcdc_entity-in.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From 1ed16de331bc8d40027b299ddeac6ab2f0d3b3be Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:27:50 +0200
-Subject: fbdev: sh_mipi_dsi: Implement sh_mobile_lcdc_entity interface
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 732bbcc46c31dea5bb6dd27de331d8767e9e8530)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 66 +++++++++++++++++++++++++++++++++----------
- 1 file changed, 51 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 05151b8..58744fe 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -24,6 +24,8 @@
- #include <video/sh_mipi_dsi.h>
- #include <video/sh_mobile_lcdc.h>
-
-+#include "sh_mobile_lcdcfb.h"
-+
- #define SYSCTRL 0x0000
- #define SYSCONF 0x0004
- #define TIMSET 0x0008
-@@ -50,6 +52,8 @@
- #define MAX_SH_MIPI_DSI 2
-
- struct sh_mipi {
-+ struct sh_mobile_lcdc_entity entity;
-+
- void __iomem *base;
- void __iomem *linkbase;
- struct clk *dsit_clk;
-@@ -60,6 +64,8 @@ struct sh_mipi {
- void (*next_display_off)(void *board_data);
- };
-
-+#define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
-+
- static struct sh_mipi *mipi_dsi[MAX_SH_MIPI_DSI];
-
- /* Protect the above array */
-@@ -120,7 +126,7 @@ static void sh_mipi_dsi_enable(struct sh_mipi *mipi, bool enable)
-
- static void sh_mipi_shutdown(struct platform_device *pdev)
- {
-- struct sh_mipi *mipi = platform_get_drvdata(pdev);
-+ struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
-
- sh_mipi_dsi_enable(mipi, false);
- }
-@@ -392,9 +398,10 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- return 0;
- }
-
--static void mipi_display_on(void *arg, struct fb_info *info)
-+static int __mipi_display_on(struct sh_mobile_lcdc_entity *entity,
-+ struct fb_info *info)
- {
-- struct sh_mipi *mipi = arg;
-+ struct sh_mipi *mipi = to_sh_mipi(entity);
- struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
- int ret;
-
-@@ -410,24 +417,34 @@ static void mipi_display_on(void *arg, struct fb_info *info)
-
- sh_mipi_dsi_enable(mipi, true);
-
-- if (mipi->next_display_on)
-- mipi->next_display_on(mipi->next_board_data, info);
--
-- return;
-+ return 0;
-
- mipi_display_on_fail1:
- pm_runtime_put_sync(&mipi->pdev->dev);
- mipi_display_on_fail2:
- pdata->set_dot_clock(mipi->pdev, mipi->base, 0);
-+
-+ return ret;
- }
-
--static void mipi_display_off(void *arg)
-+static void mipi_display_on(void *arg, struct fb_info *info)
- {
-- struct sh_mipi *mipi = arg;
-- struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-+ struct sh_mobile_lcdc_entity *entity = arg;
-+ struct sh_mipi *mipi = to_sh_mipi(entity);
-+ int ret;
-
-- if (mipi->next_display_off)
-- mipi->next_display_off(mipi->next_board_data);
-+ ret = __mipi_display_on(entity, info);
-+ if (ret < 0)
-+ return;
-+
-+ if (mipi->next_display_on)
-+ mipi->next_display_on(mipi->next_board_data, info);
-+}
-+
-+static void __mipi_display_off(struct sh_mobile_lcdc_entity *entity)
-+{
-+ struct sh_mipi *mipi = to_sh_mipi(entity);
-+ struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-
- sh_mipi_dsi_enable(mipi, false);
-
-@@ -436,6 +453,22 @@ static void mipi_display_off(void *arg)
- pm_runtime_put_sync(&mipi->pdev->dev);
- }
-
-+static void mipi_display_off(void *arg)
-+{
-+ struct sh_mobile_lcdc_entity *entity = arg;
-+ struct sh_mipi *mipi = to_sh_mipi(entity);
-+
-+ if (mipi->next_display_off)
-+ mipi->next_display_off(mipi->next_board_data);
-+
-+ __mipi_display_off(entity);
-+}
-+
-+static const struct sh_mobile_lcdc_entity_ops mipi_ops = {
-+ .display_on = __mipi_display_on,
-+ .display_off = __mipi_display_off,
-+};
-+
- static int __init sh_mipi_probe(struct platform_device *pdev)
- {
- struct sh_mipi *mipi;
-@@ -467,6 +500,9 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- goto ealloc;
- }
-
-+ mipi->entity.owner = THIS_MODULE;
-+ mipi->entity.ops = &mipi_ops;
-+
- if (!request_mem_region(res->start, resource_size(res), pdev->name)) {
- dev_err(&pdev->dev, "MIPI register region already claimed\n");
- ret = -EBUSY;
-@@ -521,7 +557,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- pm_runtime_resume(&pdev->dev);
-
- mutex_unlock(&array_lock);
-- platform_set_drvdata(pdev, mipi);
-+ platform_set_drvdata(pdev, &mipi->entity);
-
- /* Save original LCDC callbacks */
- mipi->next_board_data = pdata->lcd_chan->board_cfg.board_data;
-@@ -529,7 +565,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- mipi->next_display_off = pdata->lcd_chan->board_cfg.display_off;
-
- /* Set up LCDC callbacks */
-- pdata->lcd_chan->board_cfg.board_data = mipi;
-+ pdata->lcd_chan->board_cfg.board_data = &mipi->entity;
- pdata->lcd_chan->board_cfg.display_on = mipi_display_on;
- pdata->lcd_chan->board_cfg.display_off = mipi_display_off;
- pdata->lcd_chan->board_cfg.owner = THIS_MODULE;
-@@ -561,7 +597,7 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
- struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-- struct sh_mipi *mipi = platform_get_drvdata(pdev);
-+ struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
- int i, ret;
-
- mutex_lock(&array_lock);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0155-fbdev-sh_mobile_lcdc-Handle-HDMI-MIPI-transmitter-de.patch b/patches.armadillo800eva/0155-fbdev-sh_mobile_lcdc-Handle-HDMI-MIPI-transmitter-de.patch
deleted file mode 100644
index 883a0c33de5380..00000000000000
--- a/patches.armadillo800eva/0155-fbdev-sh_mobile_lcdc-Handle-HDMI-MIPI-transmitter-de.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From c9a39a89bc6d2b75c156f057fa8316ff11f46435 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 22:59:04 +0200
-Subject: fbdev: sh_mobile_lcdc: Handle HDMI/MIPI transmitter device directly
-
-Pass a pointer to the transmitter device through platform data, retrieve
-the corresponding sh_mobile_lcdc_entity structure in the probe method
-and call the transmitter display_on/off methods directly.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 9a2985e7f943678154f5761dad753f1987c2fdd0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 31 ++++++++++++++++++++++++++-----
- drivers/video/sh_mobile_lcdcfb.h | 2 ++
- include/video/sh_mobile_lcdc.h | 2 ++
- 3 files changed, 30 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index bd725a4..a2e0903 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -339,6 +339,11 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- {
- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-
-+ if (ch->tx_dev) {
-+ if (ch->tx_dev->ops->display_on(ch->tx_dev, ch->info) < 0)
-+ return;
-+ }
-+
- /* HDMI must be enabled before LCDC configuration */
- if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
- board_cfg->display_on(board_cfg->board_data, ch->info);
-@@ -354,6 +359,9 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- board_cfg->display_off(board_cfg->board_data);
- module_put(board_cfg->owner);
- }
-+
-+ if (ch->tx_dev)
-+ ch->tx_dev->ops->display_off(ch->tx_dev);
- }
-
- /* -----------------------------------------------------------------------------
-@@ -1490,18 +1498,21 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- sh_mobile_lcdc_stop(priv);
-
- for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-- info = priv->ch[i].info;
-+ struct sh_mobile_lcdc_chan *ch = &priv->ch[i];
-
-+ info = ch->info;
- if (!info || !info->device)
- continue;
-
-- if (priv->ch[i].sglist)
-- vfree(priv->ch[i].sglist);
-+ if (ch->tx_dev)
-+ module_put(ch->cfg.tx_dev->dev.driver->owner);
-+
-+ if (ch->sglist)
-+ vfree(ch->sglist);
-
- if (info->screen_base)
- dma_free_coherent(&pdev->dev, info->fix.smem_len,
-- info->screen_base,
-- priv->ch[i].dma_handle);
-+ info->screen_base, ch->dma_handle);
- fb_dealloc_cmap(&info->cmap);
- framebuffer_release(info);
- }
-@@ -1595,6 +1606,16 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- info->pseudo_palette = &ch->pseudo_palette;
- info->flags = FBINFO_FLAG_DEFAULT;
-
-+ if (cfg->tx_dev) {
-+ if (!cfg->tx_dev->dev.driver ||
-+ !try_module_get(cfg->tx_dev->dev.driver->owner)) {
-+ dev_warn(priv->dev,
-+ "unable to get transmitter device\n");
-+ return -EINVAL;
-+ }
-+ ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
-+ }
-+
- /* Iterate through the modes to validate them and find the highest
- * resolution.
- */
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index d79e5aa..9601b92 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -41,6 +41,8 @@ struct sh_mobile_lcdc_entity {
- */
- struct sh_mobile_lcdc_chan {
- struct sh_mobile_lcdc_priv *lcdc;
-+ struct sh_mobile_lcdc_entity *tx_dev;
-+
- unsigned long *reg_offs;
- unsigned long ldmt1r_value;
- unsigned long enabled; /* ME and SE in LDCNT2R */
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index fe30b75..3681cf6 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -186,6 +186,8 @@ struct sh_mobile_lcdc_chan_cfg {
- struct sh_mobile_lcdc_bl_info bl_info;
- struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
- struct sh_mobile_meram_cfg *meram_cfg;
-+
-+ struct platform_device *tx_dev; /* HDMI/DSI transmitter device */
- };
-
- struct sh_mobile_lcdc_info {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0156-fbdev-sh_mipi_dsi-Don-t-hook-up-into-board_cfg-displ.patch b/patches.armadillo800eva/0156-fbdev-sh_mipi_dsi-Don-t-hook-up-into-board_cfg-displ.patch
deleted file mode 100644
index e16e66d29dbf64..00000000000000
--- a/patches.armadillo800eva/0156-fbdev-sh_mipi_dsi-Don-t-hook-up-into-board_cfg-displ.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From b287fffd8e9c2a4931c1b7ec3464f7b25cf68505 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:27:50 +0200
-Subject: fbdev: sh_mipi_dsi: Don't hook up into board_cfg display operations
-
-The display_on/off operations are now accessed through the
-sh_mobile_lcdc_entity operations.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d2c594a014563175b54115d1a73b607aaeb650ec)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 56 ++++---------------------------------------
- 1 file changed, 5 insertions(+), 51 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 58744fe..ad09a05 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -58,10 +58,6 @@ struct sh_mipi {
- void __iomem *linkbase;
- struct clk *dsit_clk;
- struct platform_device *pdev;
--
-- void *next_board_data;
-- void (*next_display_on)(void *board_data, struct fb_info *info);
-- void (*next_display_off)(void *board_data);
- };
-
- #define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
-@@ -398,8 +394,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- return 0;
- }
-
--static int __mipi_display_on(struct sh_mobile_lcdc_entity *entity,
-- struct fb_info *info)
-+static int mipi_display_on(struct sh_mobile_lcdc_entity *entity,
-+ struct fb_info *info)
- {
- struct sh_mipi *mipi = to_sh_mipi(entity);
- struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-@@ -427,21 +423,7 @@ mipi_display_on_fail2:
- return ret;
- }
-
--static void mipi_display_on(void *arg, struct fb_info *info)
--{
-- struct sh_mobile_lcdc_entity *entity = arg;
-- struct sh_mipi *mipi = to_sh_mipi(entity);
-- int ret;
--
-- ret = __mipi_display_on(entity, info);
-- if (ret < 0)
-- return;
--
-- if (mipi->next_display_on)
-- mipi->next_display_on(mipi->next_board_data, info);
--}
--
--static void __mipi_display_off(struct sh_mobile_lcdc_entity *entity)
-+static void mipi_display_off(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_mipi *mipi = to_sh_mipi(entity);
- struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-@@ -453,20 +435,9 @@ static void __mipi_display_off(struct sh_mobile_lcdc_entity *entity)
- pm_runtime_put_sync(&mipi->pdev->dev);
- }
-
--static void mipi_display_off(void *arg)
--{
-- struct sh_mobile_lcdc_entity *entity = arg;
-- struct sh_mipi *mipi = to_sh_mipi(entity);
--
-- if (mipi->next_display_off)
-- mipi->next_display_off(mipi->next_board_data);
--
-- __mipi_display_off(entity);
--}
--
- static const struct sh_mobile_lcdc_entity_ops mipi_ops = {
-- .display_on = __mipi_display_on,
-- .display_off = __mipi_display_off,
-+ .display_on = mipi_display_on,
-+ .display_off = mipi_display_off,
- };
-
- static int __init sh_mipi_probe(struct platform_device *pdev)
-@@ -559,17 +530,6 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
- mutex_unlock(&array_lock);
- platform_set_drvdata(pdev, &mipi->entity);
-
-- /* Save original LCDC callbacks */
-- mipi->next_board_data = pdata->lcd_chan->board_cfg.board_data;
-- mipi->next_display_on = pdata->lcd_chan->board_cfg.display_on;
-- mipi->next_display_off = pdata->lcd_chan->board_cfg.display_off;
--
-- /* Set up LCDC callbacks */
-- pdata->lcd_chan->board_cfg.board_data = &mipi->entity;
-- pdata->lcd_chan->board_cfg.display_on = mipi_display_on;
-- pdata->lcd_chan->board_cfg.display_off = mipi_display_off;
-- pdata->lcd_chan->board_cfg.owner = THIS_MODULE;
--
- return 0;
-
- eclkton:
-@@ -594,7 +554,6 @@ efindslot:
-
- static int __exit sh_mipi_remove(struct platform_device *pdev)
- {
-- struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
-@@ -617,11 +576,6 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
- if (ret < 0)
- return ret;
-
-- pdata->lcd_chan->board_cfg.owner = NULL;
-- pdata->lcd_chan->board_cfg.display_on = NULL;
-- pdata->lcd_chan->board_cfg.display_off = NULL;
-- pdata->lcd_chan->board_cfg.board_data = NULL;
--
- pm_runtime_disable(&pdev->dev);
- clk_disable(mipi->dsit_clk);
- clk_put(mipi->dsit_clk);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0157-fbdev-sh_mobile_hdmi-Don-t-hook-up-into-board_cfg-di.patch b/patches.armadillo800eva/0157-fbdev-sh_mobile_hdmi-Don-t-hook-up-into-board_cfg-di.patch
deleted file mode 100644
index 67159884dac06e..00000000000000
--- a/patches.armadillo800eva/0157-fbdev-sh_mobile_hdmi-Don-t-hook-up-into-board_cfg-di.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 02296809ddb7264f9480319cc0ed1114f7e87fe3 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:27:50 +0200
-Subject: fbdev: sh_mobile_hdmi: Don't hook up into board_cfg display
- operations
-
-The display_on/off operations are now accessed through the
-sh_mobile_lcdc_entity operations.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit db85905ad95b090941dc894b7f93f9f3818bdc07)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 37 ++++++-------------------------------
- 1 file changed, 6 insertions(+), 31 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 5e5f83c..3f4e4a4 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -1004,8 +1004,8 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
- }
-
- /* locking: called with info->lock held, or before register_framebuffer() */
--static int __sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
-- struct fb_info *info)
-+static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
-+ struct fb_info *info)
- {
- /*
- * info is guaranteed to be valid, when we are called, because our
-@@ -1040,13 +1040,8 @@ static int __sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
- return 0;
- }
-
--static void sh_hdmi_display_on(void *arg, struct fb_info *info)
--{
-- __sh_hdmi_display_on(arg, info);
--}
--
- /* locking: called with info->lock held */
--static void __sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
-+static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
-
-@@ -1055,14 +1050,9 @@ static void __sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
- hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL);
- }
-
--static void sh_hdmi_display_off(void *arg)
--{
-- __sh_hdmi_display_off(arg);
--}
--
- static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
-- .display_on = __sh_hdmi_display_on,
-- .display_off = __sh_hdmi_display_off,
-+ .display_on = sh_hdmi_display_on,
-+ .display_off = sh_hdmi_display_off,
- };
-
- static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
-@@ -1178,7 +1168,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- */
- info->var.width = hdmi->var.width;
- info->var.height = hdmi->var.height;
-- __sh_hdmi_display_on(&hdmi->entity, info);
-+ sh_hdmi_display_on(&hdmi->entity, info);
- } else {
- /* New monitor or have to wake up */
- fb_set_suspend(info, 0);
-@@ -1255,7 +1245,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
- {
- struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- struct sh_mobile_lcdc_board_cfg *board_cfg;
- int irq = platform_get_irq(pdev, 0), ret;
- struct sh_hdmi *hdmi;
- long rate;
-@@ -1315,13 +1304,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
-
- platform_set_drvdata(pdev, &hdmi->entity);
-
-- /* Set up LCDC callbacks */
-- board_cfg = &pdata->lcd_chan->board_cfg;
-- board_cfg->owner = THIS_MODULE;
-- board_cfg->board_data = &hdmi->entity;
-- board_cfg->display_on = sh_hdmi_display_on;
-- board_cfg->display_off = sh_hdmi_display_off;
--
- INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn);
-
- pm_runtime_enable(&pdev->dev);
-@@ -1371,21 +1353,14 @@ egetclk:
-
- static int __exit sh_hdmi_remove(struct platform_device *pdev)
- {
-- struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- struct sh_mobile_lcdc_board_cfg *board_cfg = &pdata->lcd_chan->board_cfg;
- int irq = platform_get_irq(pdev, 0);
-
- snd_soc_unregister_codec(&pdev->dev);
-
- fb_unregister_client(&hdmi->notifier);
-
-- board_cfg->display_on = NULL;
-- board_cfg->display_off = NULL;
-- board_cfg->board_data = NULL;
-- board_cfg->owner = NULL;
--
- /* No new work will be scheduled, wait for running ISR */
- free_irq(irq, hdmi);
- /* Wait for already scheduled work */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0158-arm-mach-shmobile-Don-t-initialize-the-hdmi_info-lcd.patch b/patches.armadillo800eva/0158-arm-mach-shmobile-Don-t-initialize-the-hdmi_info-lcd.patch
deleted file mode 100644
index 12669b55dfc989..00000000000000
--- a/patches.armadillo800eva/0158-arm-mach-shmobile-Don-t-initialize-the-hdmi_info-lcd.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 9e74e33fa2c40dc0db376afc44e3c865418fc4d5 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 23:30:45 +0200
-Subject: arm: mach-shmobile: Don't initialize the hdmi_info lcd_chan field
-
-The field is unused and will be removed. Don't initialize it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit e2543c5ab299c67ddfb73a36eca4da6574259ab9)
-
-Conflicts:
- arch/arm/mach-shmobile/board-ap4evb.c
- arch/arm/mach-shmobile/board-mackerel.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 1 -
- arch/arm/mach-shmobile/board-mackerel.c | 1 -
- 2 files changed, 2 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 5330b68..488bd13 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -822,7 +822,6 @@ static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
-
-
- static struct sh_mobile_hdmi_info hdmi_info = {
-- .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
- .flags = HDMI_SND_SRC_SPDIF,
- .clk_optimize_parent = ap4evb_clk_optimize,
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 45a608b..42ad34e 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -483,7 +483,6 @@ static struct platform_device hdmi_lcdc_device = {
- };
-
- static struct sh_mobile_hdmi_info hdmi_info = {
-- .lcd_chan = &hdmi_lcdc_info.ch[0],
- .flags = HDMI_SND_SRC_SPDIF,
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0159-fbdev-sh_mobile_hdmi-Remove-sh_mobile_hdmi_info-lcd_.patch b/patches.armadillo800eva/0159-fbdev-sh_mobile_hdmi-Remove-sh_mobile_hdmi_info-lcd_.patch
deleted file mode 100644
index 340c320ef8144a..00000000000000
--- a/patches.armadillo800eva/0159-fbdev-sh_mobile_hdmi-Remove-sh_mobile_hdmi_info-lcd_.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 38b973cfee458255242f5d7ae5c6bd79033d3ed3 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 18:27:50 +0200
-Subject: fbdev: sh_mobile_hdmi: Remove sh_mobile_hdmi_info lcd_chan field
-
-The field is unused, remove it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit ca0a0cd7986e1704d5c60be9ae096ba51b2084f7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/video/sh_mobile_hdmi.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h
-index 0b8d2cf..728f9de 100644
---- a/include/video/sh_mobile_hdmi.h
-+++ b/include/video/sh_mobile_hdmi.h
-@@ -31,7 +31,6 @@ struct clk;
- #define HDMI_SND_SRC_HBR (3 << 0)
-
- struct sh_mobile_hdmi_info {
-- struct sh_mobile_lcdc_chan_cfg *lcd_chan;
- unsigned int flags;
- long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq,
- unsigned long *parent_freq);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0160-fbdev-sh_mobile_lcdc-Remove-board-configuration-owne.patch b/patches.armadillo800eva/0160-fbdev-sh_mobile_lcdc-Remove-board-configuration-owne.patch
deleted file mode 100644
index 9857e74b4f0b57..00000000000000
--- a/patches.armadillo800eva/0160-fbdev-sh_mobile_lcdc-Remove-board-configuration-owne.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 45096137bd1cda24dd66df4661078baab18f0c74 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 22:59:04 +0200
-Subject: fbdev: sh_mobile_lcdc: Remove board configuration owner field
-
-The field is unused, remove it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit aa7b5b0b2db6d33a8104e411cb74c15a4983b286)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 8 ++------
- include/video/sh_mobile_lcdc.h | 2 --
- 2 files changed, 2 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index a2e0903..a899b6d 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -345,20 +345,16 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- }
-
- /* HDMI must be enabled before LCDC configuration */
-- if (board_cfg->display_on && try_module_get(board_cfg->owner)) {
-+ if (board_cfg->display_on)
- board_cfg->display_on(board_cfg->board_data, ch->info);
-- module_put(board_cfg->owner);
-- }
- }
-
- static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- {
- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-
-- if (board_cfg->display_off && try_module_get(board_cfg->owner)) {
-+ if (board_cfg->display_off)
- board_cfg->display_off(board_cfg->board_data);
-- module_put(board_cfg->owner);
-- }
-
- if (ch->tx_dev)
- ch->tx_dev->ops->display_off(ch->tx_dev);
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 3681cf6..163f4b7 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -147,9 +147,7 @@ struct sh_mobile_lcdc_sys_bus_ops {
- unsigned long (*read_data)(void *handle);
- };
-
--struct module;
- struct sh_mobile_lcdc_board_cfg {
-- struct module *owner;
- void *board_data;
- int (*setup_sys)(void *board_data, void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0161-fbdev-sh_mobile_lcdc-Remove-board-configuration-boar.patch b/patches.armadillo800eva/0161-fbdev-sh_mobile_lcdc-Remove-board-configuration-boar.patch
deleted file mode 100644
index 7de62237dff607..00000000000000
--- a/patches.armadillo800eva/0161-fbdev-sh_mobile_lcdc-Remove-board-configuration-boar.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From 8e1b4a2c4460a50bcffcb5ab517330608a4d7e2e Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 22:59:04 +0200
-Subject: fbdev: sh_mobile_lcdc: Remove board configuration board_data field
-
-The field is unused, remove it. Update board code accordingly.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 018882aa66f5110478edc14e6c3fecc2b46ca0c0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 14 ++------------
- arch/arm/mach-shmobile/board-mackerel.c | 4 ++--
- arch/sh/boards/mach-ap325rxa/setup.c | 8 ++++----
- arch/sh/boards/mach-ecovec24/setup.c | 4 ++--
- arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 10 ++++------
- arch/sh/boards/mach-migor/lcd_qvga.c | 3 +--
- arch/sh/boards/mach-se/7724/setup.c | 2 --
- arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 16 ++++++++--------
- arch/sh/include/mach-migor/mach/migor.h | 2 +-
- drivers/video/sh_mobile_lcdcfb.c | 16 +++++++---------
- include/video/sh_mobile_lcdc.h | 13 ++++++-------
- 11 files changed, 37 insertions(+), 55 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 14501ec..9865d97 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -236,16 +236,6 @@ static void lcd_backlight_reset(void)
- gpio_set_value(GPIO_PORT235, 1);
- }
-
--static void lcd_on(void *board_data, struct fb_info *info)
--{
-- lcd_backlight_on();
--}
--
--static void lcd_off(void *board_data)
--{
-- lcd_backlight_reset();
--}
--
- /* LCDC0 */
- static const struct fb_videomode lcdc0_modes[] = {
- {
-@@ -275,8 +265,8 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
- .lcd_cfg = lcdc0_modes,
- .num_cfg = ARRAY_SIZE(lcdc0_modes),
- .board_cfg = {
-- .display_on = lcd_on,
-- .display_off = lcd_off,
-+ .display_on = lcd_backlight_on,
-+ .display_off = lcd_backlight_reset,
- },
- }
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 42ad34e..7937c7a 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -355,14 +355,14 @@ static struct fb_videomode mackerel_lcdc_modes[] = {
- },
- };
-
--static int mackerel_set_brightness(void *board_data, int brightness)
-+static int mackerel_set_brightness(int brightness)
- {
- gpio_set_value(GPIO_PORT31, brightness);
-
- return 0;
- }
-
--static int mackerel_get_brightness(void *board_data)
-+static int mackerel_get_brightness(void)
- {
- return gpio_get_value(GPIO_PORT31);
- }
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index 4fde884..ab632fc 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -157,7 +157,7 @@ static struct platform_device nand_flash_device = {
- #define PORT_DRVCRA 0xA405018A
- #define PORT_DRVCRB 0xA405018C
-
--static int ap320_wvga_set_brightness(void *board_data, int brightness)
-+static int ap320_wvga_set_brightness(int brightness)
- {
- if (brightness) {
- gpio_set_value(GPIO_PTS3, 0);
-@@ -170,12 +170,12 @@ static int ap320_wvga_set_brightness(void *board_data, int brightness)
- return 0;
- }
-
--static int ap320_wvga_get_brightness(void *board_data)
-+static int ap320_wvga_get_brightness(void)
- {
- return gpio_get_value(GPIO_PTS3);
- }
-
--static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
-+static void ap320_wvga_power_on(void)
- {
- msleep(100);
-
-@@ -183,7 +183,7 @@ static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
- __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
- }
-
--static void ap320_wvga_power_off(void *board_data)
-+static void ap320_wvga_power_off(void)
- {
- /* ASD AP-320/325 LCD OFF */
- __raw_writew(0, FPGA_LCDREG);
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 67c2ee8..ccbc7d6 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -312,14 +312,14 @@ const static struct fb_videomode ecovec_dvi_modes[] = {
- },
- };
-
--static int ecovec24_set_brightness(void *board_data, int brightness)
-+static int ecovec24_set_brightness(int brightness)
- {
- gpio_set_value(GPIO_PTR1, brightness);
-
- return 0;
- }
-
--static int ecovec24_get_brightness(void *board_data)
-+static int ecovec24_get_brightness(void)
- {
- return gpio_get_value(GPIO_PTR1);
- }
-diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
-index 25e145f..c148b36 100644
---- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
-+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
-@@ -251,8 +251,7 @@ static void display_on(void *sohandle,
- write_memory_start(sohandle, so);
- }
-
--int kfr2r09_lcd_setup(void *board_data, void *sohandle,
-- struct sh_mobile_lcdc_sys_bus_ops *so)
-+int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
- {
- /* power on */
- gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
-@@ -273,8 +272,7 @@ int kfr2r09_lcd_setup(void *board_data, void *sohandle,
- return 0;
- }
-
--void kfr2r09_lcd_start(void *board_data, void *sohandle,
-- struct sh_mobile_lcdc_sys_bus_ops *so)
-+void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
- {
- write_memory_start(sohandle, so);
- }
-@@ -327,12 +325,12 @@ static int kfr2r09_lcd_backlight(int on)
- return 0;
- }
-
--void kfr2r09_lcd_on(void *board_data, struct fb_info *info)
-+void kfr2r09_lcd_on(void)
- {
- kfr2r09_lcd_backlight(1);
- }
-
--void kfr2r09_lcd_off(void *board_data)
-+void kfr2r09_lcd_off(void)
- {
- kfr2r09_lcd_backlight(0);
- }
-diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
-index de9014a..8bccd34 100644
---- a/arch/sh/boards/mach-migor/lcd_qvga.c
-+++ b/arch/sh/boards/mach-migor/lcd_qvga.c
-@@ -113,8 +113,7 @@ static const unsigned short magic3_data[] = {
- 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
- };
-
--int migor_lcd_qvga_setup(void *board_data, void *sohandle,
-- struct sh_mobile_lcdc_sys_bus_ops *so)
-+int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
- {
- unsigned long xres = 320;
- unsigned long yres = 240;
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 65ff79d..93d53ec 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -186,8 +186,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .width = 152,
- .height = 91,
- },
-- .board_cfg = {
-- },
- }
- };
-
-diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
-index 07e635b..ba3d93d 100644
---- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
-+++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
-@@ -4,21 +4,21 @@
- #include <video/sh_mobile_lcdc.h>
-
- #if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
--void kfr2r09_lcd_on(void *board_data, struct fb_info *info);
--void kfr2r09_lcd_off(void *board_data);
--int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle,
-+void kfr2r09_lcd_on(void);
-+void kfr2r09_lcd_off(void);
-+int kfr2r09_lcd_setup(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
--void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle,
-+void kfr2r09_lcd_start(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
- #else
--static void kfr2r09_lcd_on(void *board_data) {}
--static void kfr2r09_lcd_off(void *board_data) {}
--static int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle,
-+static void kfr2r09_lcd_on(void) {}
-+static void kfr2r09_lcd_off(void) {}
-+static int kfr2r09_lcd_setup(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
- {
- return -ENODEV;
- }
--static void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle,
-+static void kfr2r09_lcd_start(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
- {
- }
-diff --git a/arch/sh/include/mach-migor/mach/migor.h b/arch/sh/include/mach-migor/mach/migor.h
-index 42fccf9..7de7bb7 100644
---- a/arch/sh/include/mach-migor/mach/migor.h
-+++ b/arch/sh/include/mach-migor/mach/migor.h
-@@ -9,7 +9,7 @@
-
- #include <video/sh_mobile_lcdc.h>
-
--int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle,
-+int migor_lcd_qvga_setup(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-
- #endif /* __ASM_SH_MIGOR_H */
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index a899b6d..c54eb97 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -315,14 +315,12 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
- /* trigger panel update */
- dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
- if (bcfg->start_transfer)
-- bcfg->start_transfer(bcfg->board_data, ch,
-- &sh_mobile_lcdc_sys_bus_ops);
-+ bcfg->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
- lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
- } else {
- if (bcfg->start_transfer)
-- bcfg->start_transfer(bcfg->board_data, ch,
-- &sh_mobile_lcdc_sys_bus_ops);
-+ bcfg->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
- lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- }
- }
-@@ -346,7 +344,7 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
-
- /* HDMI must be enabled before LCDC configuration */
- if (board_cfg->display_on)
-- board_cfg->display_on(board_cfg->board_data, ch->info);
-+ board_cfg->display_on();
- }
-
- static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
-@@ -354,7 +352,7 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-
- if (board_cfg->display_off)
-- board_cfg->display_off(board_cfg->board_data);
-+ board_cfg->display_off();
-
- if (ch->tx_dev)
- ch->tx_dev->ops->display_off(ch->tx_dev);
-@@ -697,7 +695,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- board_cfg = &ch->cfg.board_cfg;
- if (board_cfg->setup_sys) {
-- ret = board_cfg->setup_sys(board_cfg->board_data, ch,
-+ ret = board_cfg->setup_sys(ch,
- &sh_mobile_lcdc_sys_bus_ops);
- if (ret)
- return ret;
-@@ -1326,7 +1324,7 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
- bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
- brightness = 0;
-
-- return cfg->set_brightness(cfg->board_data, brightness);
-+ return cfg->set_brightness(brightness);
- }
-
- static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
-@@ -1334,7 +1332,7 @@ static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
- struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
- struct sh_mobile_lcdc_board_cfg *cfg = &ch->cfg.board_cfg;
-
-- return cfg->get_brightness(cfg->board_data);
-+ return cfg->get_brightness();
- }
-
- static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 163f4b7..62be2c9 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -148,15 +148,14 @@ struct sh_mobile_lcdc_sys_bus_ops {
- };
-
- struct sh_mobile_lcdc_board_cfg {
-- void *board_data;
-- int (*setup_sys)(void *board_data, void *sys_ops_handle,
-+ int (*setup_sys)(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-- void (*start_transfer)(void *board_data, void *sys_ops_handle,
-+ void (*start_transfer)(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
-- void (*display_on)(void *board_data, struct fb_info *info);
-- void (*display_off)(void *board_data);
-- int (*set_brightness)(void *board_data, int brightness);
-- int (*get_brightness)(void *board_data);
-+ void (*display_on)(void);
-+ void (*display_off)(void);
-+ int (*set_brightness)(int brightness);
-+ int (*get_brightness)(void);
- };
-
- struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0162-fbdev-sh_mobile_lcdc-Move-brightness-ops-to-sh_mobil.patch b/patches.armadillo800eva/0162-fbdev-sh_mobile_lcdc-Move-brightness-ops-to-sh_mobil.patch
deleted file mode 100644
index 1527310125d9c1..00000000000000
--- a/patches.armadillo800eva/0162-fbdev-sh_mobile_lcdc-Move-brightness-ops-to-sh_mobil.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-From 206dd980ded59158a5fc2108f69d4b63a0c0f94c Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 22:59:04 +0200
-Subject: fbdev: sh_mobile_lcdc: Move brightness ops to sh_mobile_lcdc_bl_info
-
-Update board code accordingly.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 43059b0f46f814b4152f327c701d079253904540)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-mackerel.c | 6 ++----
- arch/sh/boards/mach-ap325rxa/setup.c | 4 ++--
- arch/sh/boards/mach-ecovec24/setup.c | 6 ++----
- drivers/video/sh_mobile_lcdcfb.c | 6 ++----
- include/video/sh_mobile_lcdc.h | 4 ++--
- 5 files changed, 10 insertions(+), 16 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 7937c7a..40d61de 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -395,13 +395,11 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .flags = 0,
- .lcd_size_cfg.width = 152,
- .lcd_size_cfg.height = 91,
-- .board_cfg = {
-- .set_brightness = mackerel_set_brightness,
-- .get_brightness = mackerel_get_brightness,
-- },
- .bl_info = {
- .name = "sh_mobile_lcdc_bl",
- .max_brightness = 1,
-+ .set_brightness = mackerel_set_brightness,
-+ .get_brightness = mackerel_get_brightness,
- },
- .meram_cfg = &lcd_meram_cfg,
- }
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index ab632fc..514968a 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -220,12 +220,12 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .board_cfg = {
- .display_on = ap320_wvga_power_on,
- .display_off = ap320_wvga_power_off,
-- .set_brightness = ap320_wvga_set_brightness,
-- .get_brightness = ap320_wvga_get_brightness,
- },
- .bl_info = {
- .name = "sh_mobile_lcdc_bl",
- .max_brightness = 1,
-+ .set_brightness = ap320_wvga_set_brightness,
-+ .get_brightness = ap320_wvga_get_brightness,
- },
- }
- };
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index ccbc7d6..5c2b2fc 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -333,13 +333,11 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .width = 152,
- .height = 91,
- },
-- .board_cfg = {
-- .set_brightness = ecovec24_set_brightness,
-- .get_brightness = ecovec24_get_brightness,
-- },
- .bl_info = {
- .name = "sh_mobile_lcdc_bl",
- .max_brightness = 1,
-+ .set_brightness = ecovec24_set_brightness,
-+ .get_brightness = ecovec24_get_brightness,
- },
- }
- };
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index c54eb97..adfffd6 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1317,22 +1317,20 @@ static struct fb_ops sh_mobile_lcdc_ops = {
- static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
- {
- struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
-- struct sh_mobile_lcdc_board_cfg *cfg = &ch->cfg.board_cfg;
- int brightness = bdev->props.brightness;
-
- if (bdev->props.power != FB_BLANK_UNBLANK ||
- bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
- brightness = 0;
-
-- return cfg->set_brightness(brightness);
-+ return ch->cfg.bl_info.set_brightness(brightness);
- }
-
- static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
- {
- struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
-- struct sh_mobile_lcdc_board_cfg *cfg = &ch->cfg.board_cfg;
-
-- return cfg->get_brightness();
-+ return ch->cfg.bl_info.get_brightness();
- }
-
- static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 62be2c9..ecde6aa 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -154,8 +154,6 @@ struct sh_mobile_lcdc_board_cfg {
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
- void (*display_on)(void);
- void (*display_off)(void);
-- int (*set_brightness)(int brightness);
-- int (*get_brightness)(void);
- };
-
- struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
-@@ -167,6 +165,8 @@ struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
- struct sh_mobile_lcdc_bl_info {
- const char *name;
- int max_brightness;
-+ int (*set_brightness)(int brightness);
-+ int (*get_brightness)(void);
- };
-
- struct sh_mobile_lcdc_chan_cfg {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0163-fbdev-sh_mobile_lcdc-Merge-board_cfg-and-lcd_size_cf.patch b/patches.armadillo800eva/0163-fbdev-sh_mobile_lcdc-Merge-board_cfg-and-lcd_size_cf.patch
deleted file mode 100644
index c9607616fffce7..00000000000000
--- a/patches.armadillo800eva/0163-fbdev-sh_mobile_lcdc-Merge-board_cfg-and-lcd_size_cf.patch
+++ /dev/null
@@ -1,314 +0,0 @@
-From 9cc62e588f6e71c7ca250eacd91f4da3e0af1f90 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 22:59:04 +0200
-Subject: fbdev: sh_mobile_lcdc: Merge board_cfg and lcd_size_cfg into
- panel_cfg
-
-Update board code accordingly.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit afaad83b9c0d24eac88535cc5a8c6019f0c45bcb)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-bonito.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 6 +++---
- arch/arm/mach-shmobile/board-ap4evb.c | 8 +++----
- arch/arm/mach-shmobile/board-mackerel.c | 6 ++++--
- arch/sh/boards/mach-ap325rxa/setup.c | 6 ++----
- arch/sh/boards/mach-ecovec24/setup.c | 2 +-
- arch/sh/boards/mach-kfr2r09/setup.c | 4 +---
- arch/sh/boards/mach-migor/setup.c | 8 +++----
- arch/sh/boards/mach-se/7724/setup.c | 2 +-
- drivers/video/sh_mobile_lcdcfb.c | 35 +++++++++++++++----------------
- include/video/sh_mobile_lcdc.h | 12 ++++-------
- 10 files changed, 40 insertions(+), 49 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 9865d97..22b0861 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -259,12 +259,12 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
- .interface_type = RGB24,
- .clock_divider = 1,
- .flags = LCDC_FLAGS_DWPOL,
-- .lcd_size_cfg.width = 44,
-- .lcd_size_cfg.height = 79,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .lcd_cfg = lcdc0_modes,
- .num_cfg = ARRAY_SIZE(lcdc0_modes),
-- .board_cfg = {
-+ .panel_cfg = {
-+ .width = 44,
-+ .height = 79,
- .display_on = lcd_backlight_on,
- .display_off = lcd_backlight_reset,
- },
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 488bd13..afdddb4 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -1324,8 +1324,8 @@ static void __init ap4evb_init(void)
- lcdc_info.ch[0].interface_type = RGB24;
- lcdc_info.ch[0].clock_divider = 1;
- lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
-- lcdc_info.ch[0].lcd_size_cfg.width = 44;
-- lcdc_info.ch[0].lcd_size_cfg.height = 79;
-+ lcdc_info.ch[0].panel_cfg.width = 44;
-+ lcdc_info.ch[0].panel_cfg.height = 79;
-
- platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices));
-
-@@ -1366,8 +1366,8 @@ static void __init ap4evb_init(void)
- lcdc_info.ch[0].interface_type = RGB18;
- lcdc_info.ch[0].clock_divider = 3;
- lcdc_info.ch[0].flags = 0;
-- lcdc_info.ch[0].lcd_size_cfg.width = 152;
-- lcdc_info.ch[0].lcd_size_cfg.height = 91;
-+ lcdc_info.ch[0].panel_cfg.width = 152;
-+ lcdc_info.ch[0].panel_cfg.height = 91;
-
- /* enable TouchScreen */
- irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 40d61de..c9cab79 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -393,8 +393,10 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .interface_type = RGB24,
- .clock_divider = 3,
- .flags = 0,
-- .lcd_size_cfg.width = 152,
-- .lcd_size_cfg.height = 91,
-+ .panel_cfg = {
-+ .width = 152,
-+ .height = 91,
-+ },
- .bl_info = {
- .name = "sh_mobile_lcdc_bl",
- .max_brightness = 1,
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index 514968a..f7d7ce4 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -213,11 +213,9 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_divider = 1,
- .lcd_cfg = ap325rxa_lcdc_modes,
- .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes),
-- .lcd_size_cfg = { /* 7.0 inch */
-- .width = 152,
-+ .panel_cfg = {
-+ .width = 152, /* 7.0 inch */
- .height = 91,
-- },
-- .board_cfg = {
- .display_on = ap320_wvga_power_on,
- .display_off = ap320_wvga_power_off,
- },
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 5c2b2fc..44799f9 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -329,7 +329,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .interface_type = RGB18,
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
-- .lcd_size_cfg = { /* 7.0 inch */
-+ .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
-diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
-index 7a35a5c..39585bb 100644
---- a/arch/sh/boards/mach-kfr2r09/setup.c
-+++ b/arch/sh/boards/mach-kfr2r09/setup.c
-@@ -153,11 +153,9 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
- .flags = LCDC_FLAGS_DWPOL,
- .lcd_cfg = kfr2r09_lcdc_modes,
- .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes),
-- .lcd_size_cfg = {
-+ .panel_cfg = {
- .width = 35,
- .height = 58,
-- },
-- .board_cfg = {
- .setup_sys = kfr2r09_lcd_setup,
- .start_transfer = kfr2r09_lcd_start,
- .display_on = kfr2r09_lcd_on,
-diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
-index 55ea682..5ce86c8 100644
---- a/arch/sh/boards/mach-migor/setup.c
-+++ b/arch/sh/boards/mach-migor/setup.c
-@@ -251,7 +251,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .clock_divider = 2,
- .lcd_cfg = migor_lcd_modes,
- .num_cfg = ARRAY_SIZE(migor_lcd_modes),
-- .lcd_size_cfg = { /* 7.0 inch */
-+ .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
-@@ -265,11 +265,9 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .clock_divider = 10,
- .lcd_cfg = migor_lcd_modes,
- .num_cfg = ARRAY_SIZE(migor_lcd_modes),
-- .lcd_size_cfg = { /* 2.4 inch */
-- .width = 49,
-+ .panel_cfg = {
-+ .width = 49, /* 2.4 inch */
- .height = 37,
-- },
-- .board_cfg = {
- .setup_sys = migor_lcd_qvga_setup,
- },
- .sys_bus_cfg = {
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 93d53ec..23cd9d6 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -182,7 +182,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .clock_divider = 1,
-- .lcd_size_cfg = { /* 7.0 inch */
-+ .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index adfffd6..9e44988 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -289,7 +289,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
- struct list_head *pagelist)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-- struct sh_mobile_lcdc_board_cfg *bcfg = &ch->cfg.board_cfg;
-+ struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-
- /* enable clocks before accessing hardware */
- sh_mobile_lcdc_clk_on(ch->lcdc);
-@@ -314,13 +314,13 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
-
- /* trigger panel update */
- dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
-- if (bcfg->start_transfer)
-- bcfg->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
-+ if (panel->start_transfer)
-+ panel->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
- lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
- } else {
-- if (bcfg->start_transfer)
-- bcfg->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
-+ if (panel->start_transfer)
-+ panel->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
- lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
- }
- }
-@@ -335,7 +335,7 @@ static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
-
- static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- {
-- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-+ struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-
- if (ch->tx_dev) {
- if (ch->tx_dev->ops->display_on(ch->tx_dev, ch->info) < 0)
-@@ -343,16 +343,16 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- }
-
- /* HDMI must be enabled before LCDC configuration */
-- if (board_cfg->display_on)
-- board_cfg->display_on();
-+ if (panel->display_on)
-+ panel->display_on();
- }
-
- static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- {
-- struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg;
-+ struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-
-- if (board_cfg->display_off)
-- board_cfg->display_off();
-+ if (panel->display_off)
-+ panel->display_off();
-
- if (ch->tx_dev)
- ch->tx_dev->ops->display_off(ch->tx_dev);
-@@ -687,16 +687,15 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
-
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- struct sh_mobile_lcdc_board_cfg *board_cfg;
-+ struct sh_mobile_lcdc_panel_cfg *panel;
-
- ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
-- board_cfg = &ch->cfg.board_cfg;
-- if (board_cfg->setup_sys) {
-- ret = board_cfg->setup_sys(ch,
-- &sh_mobile_lcdc_sys_bus_ops);
-+ panel = &ch->cfg.panel_cfg;
-+ if (panel->setup_sys) {
-+ ret = panel->setup_sys(ch, &sh_mobile_lcdc_sys_bus_ops);
- if (ret)
- return ret;
- }
-@@ -1654,8 +1653,8 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- */
- var = &info->var;
- fb_videomode_to_var(var, mode);
-- var->width = cfg->lcd_size_cfg.width;
-- var->height = cfg->lcd_size_cfg.height;
-+ var->width = cfg->panel_cfg.width;
-+ var->height = cfg->panel_cfg.height;
- var->yres_virtual = var->yres * 2;
- var->activate = FB_ACTIVATE_NOW;
-
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index ecde6aa..4f0fb55 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -147,7 +147,9 @@ struct sh_mobile_lcdc_sys_bus_ops {
- unsigned long (*read_data)(void *handle);
- };
-
--struct sh_mobile_lcdc_board_cfg {
-+struct sh_mobile_lcdc_panel_cfg {
-+ unsigned long width; /* Panel width in mm */
-+ unsigned long height; /* Panel height in mm */
- int (*setup_sys)(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
- void (*start_transfer)(void *sys_ops_handle,
-@@ -156,11 +158,6 @@ struct sh_mobile_lcdc_board_cfg {
- void (*display_off)(void);
- };
-
--struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
-- unsigned long width;
-- unsigned long height;
--};
--
- /* backlight info */
- struct sh_mobile_lcdc_bl_info {
- const char *name;
-@@ -178,8 +175,7 @@ struct sh_mobile_lcdc_chan_cfg {
- unsigned long flags; /* LCDC_FLAGS_... */
- const struct fb_videomode *lcd_cfg;
- int num_cfg;
-- struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
-- struct sh_mobile_lcdc_board_cfg board_cfg;
-+ struct sh_mobile_lcdc_panel_cfg panel_cfg;
- struct sh_mobile_lcdc_bl_info bl_info;
- struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
- struct sh_mobile_meram_cfg *meram_cfg;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0164-sh_mobile_lcdc-Add-an-lcdc-channel-pointer-to-sh_mob.patch b/patches.armadillo800eva/0164-sh_mobile_lcdc-Add-an-lcdc-channel-pointer-to-sh_mob.patch
deleted file mode 100644
index 9d6f5eb31f8c5c..00000000000000
--- a/patches.armadillo800eva/0164-sh_mobile_lcdc-Add-an-lcdc-channel-pointer-to-sh_mob.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 60a5a49490ff63dc2a0864406fafd92b52da1e69 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 18 Sep 2011 12:21:17 +0200
-Subject: sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity
-
-The field will be used by the transmitter drivers to access
-sh_mobile_lcdc_chan fields such as fb_info.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit e34d0bbb062cc78802d0f0686c939ea1569889a6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 5 ++++-
- drivers/video/sh_mobile_lcdcfb.h | 2 ++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 9e44988..1ecc71e 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1495,8 +1495,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- if (!info || !info->device)
- continue;
-
-- if (ch->tx_dev)
-+ if (ch->tx_dev) {
-+ ch->tx_dev->lcdc = NULL;
- module_put(ch->cfg.tx_dev->dev.driver->owner);
-+ }
-
- if (ch->sglist)
- vfree(ch->sglist);
-@@ -1605,6 +1607,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- return -EINVAL;
- }
- ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
-+ ch->tx_dev->lcdc = ch;
- }
-
- /* Iterate through the modes to validate them and find the highest
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 9601b92..36cd564 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -19,6 +19,7 @@ struct fb_info;
- struct module;
- struct sh_mobile_lcdc_entity;
- struct sh_mobile_lcdc_priv;
-+struct sh_mobile_lcdc_chan;
-
- struct sh_mobile_lcdc_entity_ops {
- /* Display */
-@@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
- struct sh_mobile_lcdc_entity {
- struct module *owner;
- const struct sh_mobile_lcdc_entity_ops *ops;
-+ struct sh_mobile_lcdc_chan *lcdc;
- };
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0165-sh_mobile_hdmi-Use-sh_mobile_lcdc_entity-channel-to-.patch b/patches.armadillo800eva/0165-sh_mobile_hdmi-Use-sh_mobile_lcdc_entity-channel-to-.patch
deleted file mode 100644
index 0bfe8ff4949150..00000000000000
--- a/patches.armadillo800eva/0165-sh_mobile_hdmi-Use-sh_mobile_lcdc_entity-channel-to-.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-From 5918dd8a351c7ce48cbe605ce93e01b7f9eda8b4 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 18 Sep 2011 12:25:21 +0200
-Subject: sh_mobile_hdmi: Use sh_mobile_lcdc_entity::channel to access fb_info
-
-The fb_info parameter passed to the display_on operation will be
-removed, don't use it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit bce95fe838a5ca84e57411338b953be672c2a5eb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 80 ++++++----------------------------------
- 1 file changed, 12 insertions(+), 68 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 3f4e4a4..bd885ee 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -219,16 +219,12 @@ struct sh_hdmi {
- u8 edid_blocks;
- struct clk *hdmi_clk;
- struct device *dev;
-- struct fb_info *info;
-- struct mutex mutex; /* Protect the info pointer */
- struct delayed_work edid_work;
- struct fb_var_screeninfo var;
- struct fb_monspecs monspec;
-- struct notifier_block notifier;
- };
-
- #define entity_to_sh_hdmi(e) container_of(e, struct sh_hdmi, entity)
--#define notifier_to_hdmi(n) container_of(n, struct sh_hdmi, notifier)
-
- static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg)
- {
-@@ -737,10 +733,11 @@ static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi,
- static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- unsigned long *parent_rate)
- {
-+ struct fb_info *info = hdmi->entity.lcdc
-+ ? hdmi->entity.lcdc->info : NULL;
- struct fb_var_screeninfo tmpvar;
- struct fb_var_screeninfo *var = &tmpvar;
- const struct fb_videomode *mode, *found = NULL;
-- struct fb_info *info = hdmi->info;
- struct fb_modelist *modelist = NULL;
- unsigned int f_width = 0, f_height = 0, f_refresh = 0;
- unsigned long found_rate_error = ULONG_MAX; /* silly compiler... */
-@@ -1012,13 +1009,10 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
- * FB_EVENT_FB_UNBIND notify is also called with info->lock held
- */
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
-- struct sh_mobile_lcdc_chan *ch = info->par;
-+ struct sh_mobile_lcdc_chan *ch = entity->lcdc;
-
- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
-
-- /* No need to lock */
-- hdmi->info = info;
--
- /*
- * hp_state can be set to
- * HDMI_HOTPLUG_DISCONNECTED: on monitor unplug
-@@ -1040,7 +1034,6 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
- return 0;
- }
-
--/* locking: called with info->lock held */
- static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
-@@ -1057,15 +1050,14 @@ static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
-
- static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
- {
-- struct fb_info *info = hdmi->info;
-- struct sh_mobile_lcdc_chan *ch = info->par;
-+ struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
- struct fb_var_screeninfo *new_var = &hdmi->var, *old_var = &ch->display_var;
- struct fb_videomode mode1, mode2;
-
- fb_var_to_videomode(&mode1, old_var);
- fb_var_to_videomode(&mode2, new_var);
-
-- dev_dbg(info->dev, "Old %ux%u, new %ux%u\n",
-+ dev_dbg(hdmi->dev, "Old %ux%u, new %ux%u\n",
- mode1.xres, mode1.yres, mode2.xres, mode2.yres);
-
- if (fb_mode_is_equal(&mode1, &mode2)) {
-@@ -1075,7 +1067,7 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
- return false;
- }
-
-- dev_dbg(info->dev, "Switching %u -> %u lines\n",
-+ dev_dbg(hdmi->dev, "Switching %u -> %u lines\n",
- mode1.yres, mode2.yres);
- *old_var = *new_var;
-
-@@ -1121,17 +1113,13 @@ static long sh_hdmi_clk_configure(struct sh_hdmi *hdmi, unsigned long hdmi_rate,
- static void sh_hdmi_edid_work_fn(struct work_struct *work)
- {
- struct sh_hdmi *hdmi = container_of(work, struct sh_hdmi, edid_work.work);
-+ struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
- struct fb_info *info;
-- struct sh_mobile_lcdc_chan *ch;
- int ret;
-
- dev_dbg(hdmi->dev, "%s(%p): begin, hotplug status %d\n", __func__, hdmi,
- hdmi->hp_state);
-
-- mutex_lock(&hdmi->mutex);
--
-- info = hdmi->info;
--
- if (hdmi->hp_state == HDMI_HOTPLUG_CONNECTED) {
- unsigned long parent_rate = 0, hdmi_rate;
-
-@@ -1151,10 +1139,10 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- /* Switched to another (d) power-save mode */
- msleep(10);
-
-- if (!info)
-+ if (ch == NULL)
- goto out;
-
-- ch = info->par;
-+ info = ch->info;
-
- if (lock_fb_info(info)) {
- console_lock();
-@@ -1179,9 +1167,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- }
- } else {
- ret = 0;
-- if (!info)
-+ if (ch == NULL)
- goto out;
-
-+ info = ch->info;
-+
- hdmi->monspec.modedb_len = 0;
- fb_destroy_modedb(hdmi->monspec.modedb);
- hdmi->monspec.modedb = NULL;
-@@ -1200,47 +1190,10 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- out:
- if (ret < 0 && ret != -EAGAIN)
- hdmi->hp_state = HDMI_HOTPLUG_DISCONNECTED;
-- mutex_unlock(&hdmi->mutex);
-
- dev_dbg(hdmi->dev, "%s(%p): end\n", __func__, hdmi);
- }
-
--static int sh_hdmi_notify(struct notifier_block *nb,
-- unsigned long action, void *data)
--{
-- struct fb_event *event = data;
-- struct fb_info *info = event->info;
-- struct sh_hdmi *hdmi = notifier_to_hdmi(nb);
--
-- if (hdmi->info != info)
-- return NOTIFY_DONE;
--
-- switch(action) {
-- case FB_EVENT_FB_REGISTERED:
-- /* Unneeded, activation taken care by sh_hdmi_display_on() */
-- break;
-- case FB_EVENT_FB_UNREGISTERED:
-- /*
-- * We are called from unregister_framebuffer() with the
-- * info->lock held. This is bad for us, because we can race with
-- * the scheduled work, which has to call fb_set_suspend(), which
-- * takes info->lock internally, so, sh_hdmi_edid_work_fn()
-- * cannot take and hold info->lock for the whole function
-- * duration. Using an additional lock creates a classical AB-BA
-- * lock up. Therefore, we have to release the info->lock
-- * temporarily, synchronise with the work queue and re-acquire
-- * the info->lock.
-- */
-- unlock_fb_info(info);
-- mutex_lock(&hdmi->mutex);
-- hdmi->info = NULL;
-- mutex_unlock(&hdmi->mutex);
-- lock_fb_info(info);
-- return NOTIFY_OK;
-- }
-- return NOTIFY_DONE;
--}
--
- static int __init sh_hdmi_probe(struct platform_device *pdev)
- {
- struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
-@@ -1258,8 +1211,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
- return -ENOMEM;
- }
-
-- mutex_init(&hdmi->mutex);
--
- hdmi->dev = &pdev->dev;
- hdmi->entity.owner = THIS_MODULE;
- hdmi->entity.ops = &sh_hdmi_ops;
-@@ -1327,9 +1278,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
- goto ecodec;
- }
-
-- hdmi->notifier.notifier_call = sh_hdmi_notify;
-- fb_register_client(&hdmi->notifier);
--
- return 0;
-
- ecodec:
-@@ -1345,7 +1293,6 @@ ereqreg:
- erate:
- clk_put(hdmi->hdmi_clk);
- egetclk:
-- mutex_destroy(&hdmi->mutex);
- kfree(hdmi);
-
- return ret;
-@@ -1359,8 +1306,6 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
-
- snd_soc_unregister_codec(&pdev->dev);
-
-- fb_unregister_client(&hdmi->notifier);
--
- /* No new work will be scheduled, wait for running ISR */
- free_irq(irq, hdmi);
- /* Wait for already scheduled work */
-@@ -1371,7 +1316,6 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
- clk_put(hdmi->hdmi_clk);
- iounmap(hdmi->base);
- release_mem_region(res->start, resource_size(res));
-- mutex_destroy(&hdmi->mutex);
- kfree(hdmi);
-
- return 0;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0166-fbdev-sh_mobile_lcdc-Remove-fb_info-parameter-to-dis.patch b/patches.armadillo800eva/0166-fbdev-sh_mobile_lcdc-Remove-fb_info-parameter-to-dis.patch
deleted file mode 100644
index b0c9ed726c1e30..00000000000000
--- a/patches.armadillo800eva/0166-fbdev-sh_mobile_lcdc-Remove-fb_info-parameter-to-dis.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From a3d2150cd0207917a39f6ae0a4bae6dcdee57800 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 18 Sep 2011 12:26:50 +0200
-Subject: fbdev: sh_mobile_lcdc: Remove fb_info parameter to display_on
- operation
-
-The parameter is unused, remove it.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 5864ace19a2546912308e94432c1cf52d5945afe)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 3 +--
- drivers/video/sh_mobile_hdmi.c | 11 +++--------
- drivers/video/sh_mobile_lcdcfb.c | 2 +-
- drivers/video/sh_mobile_lcdcfb.h | 3 +--
- 4 files changed, 6 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index ad09a05..1ede247 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -394,8 +394,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- return 0;
- }
-
--static int mipi_display_on(struct sh_mobile_lcdc_entity *entity,
-- struct fb_info *info)
-+static int mipi_display_on(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_mipi *mipi = to_sh_mipi(entity);
- struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index bd885ee..c22e123 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -1000,16 +1000,11 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
- return IRQ_HANDLED;
- }
-
--/* locking: called with info->lock held, or before register_framebuffer() */
--static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
-- struct fb_info *info)
-+static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- {
-- /*
-- * info is guaranteed to be valid, when we are called, because our
-- * FB_EVENT_FB_UNBIND notify is also called with info->lock held
-- */
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
- struct sh_mobile_lcdc_chan *ch = entity->lcdc;
-+ struct fb_info *info = ch->info;
-
- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
-
-@@ -1156,7 +1151,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- */
- info->var.width = hdmi->var.width;
- info->var.height = hdmi->var.height;
-- sh_hdmi_display_on(&hdmi->entity, info);
-+ sh_hdmi_display_on(&hdmi->entity);
- } else {
- /* New monitor or have to wake up */
- fb_set_suspend(info, 0);
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 1ecc71e..03ee382 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -338,7 +338,7 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-
- if (ch->tx_dev) {
-- if (ch->tx_dev->ops->display_on(ch->tx_dev, ch->info) < 0)
-+ if (ch->tx_dev->ops->display_on(ch->tx_dev) < 0)
- return;
- }
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 36cd564..b2cb8e6 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -23,8 +23,7 @@ struct sh_mobile_lcdc_chan;
-
- struct sh_mobile_lcdc_entity_ops {
- /* Display */
-- int (*display_on)(struct sh_mobile_lcdc_entity *entity,
-- struct fb_info *info);
-+ int (*display_on)(struct sh_mobile_lcdc_entity *entity);
- void (*display_off)(struct sh_mobile_lcdc_entity *entity);
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0167-fbdev-sh_mobile_lcdc-Return-display-connection-state.patch b/patches.armadillo800eva/0167-fbdev-sh_mobile_lcdc-Return-display-connection-state.patch
deleted file mode 100644
index aa953289c1748f..00000000000000
--- a/patches.armadillo800eva/0167-fbdev-sh_mobile_lcdc-Return-display-connection-state.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From 202df78368566ccbb7b00d45bb973f044a7b4faf Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 28 Nov 2011 23:19:59 +0100
-Subject: fbdev: sh_mobile_lcdc: Return display connection state in display_on
-
-Return true if the display is connected and false otherwise. Set the fb
-info state to FBINFO_STATE_SUSPENDED in the sh_mobile_lcdc driver when
-the display is not connected.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 458981c3886133667e020900f53538f1fbc3ea1d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 2 +-
- drivers/video/sh_mobile_hdmi.c | 9 +++++----
- drivers/video/sh_mobile_lcdcfb.c | 8 +++++++-
- drivers/video/sh_mobile_lcdcfb.h | 3 +++
- 4 files changed, 16 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 1ede247..5ff3742 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -412,7 +412,7 @@ static int mipi_display_on(struct sh_mobile_lcdc_entity *entity)
-
- sh_mipi_dsi_enable(mipi, true);
-
-- return 0;
-+ return SH_MOBILE_LCDC_DISPLAY_CONNECTED;
-
- mipi_display_on_fail1:
- pm_runtime_put_sync(&mipi->pdev->dev);
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index c22e123..1464abf 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -1004,9 +1004,9 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
- struct sh_mobile_lcdc_chan *ch = entity->lcdc;
-- struct fb_info *info = ch->info;
-
-- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
-+ dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi,
-+ hdmi->hp_state);
-
- /*
- * hp_state can be set to
-@@ -1021,12 +1021,13 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- dev_dbg(hdmi->dev, "HDMI running\n");
- break;
- case HDMI_HOTPLUG_DISCONNECTED:
-- info->state = FBINFO_STATE_SUSPENDED;
- default:
- hdmi->var = ch->display_var;
- }
-
-- return 0;
-+ return hdmi->hp_state == HDMI_HOTPLUG_DISCONNECTED
-+ ? SH_MOBILE_LCDC_DISPLAY_DISCONNECTED
-+ : SH_MOBILE_LCDC_DISPLAY_CONNECTED;
- }
-
- static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 03ee382..5a19ef3 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -338,8 +338,14 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-
- if (ch->tx_dev) {
-- if (ch->tx_dev->ops->display_on(ch->tx_dev) < 0)
-+ int ret;
-+
-+ ret = ch->tx_dev->ops->display_on(ch->tx_dev);
-+ if (ret < 0)
- return;
-+
-+ if (ret == SH_MOBILE_LCDC_DISPLAY_DISCONNECTED)
-+ ch->info->state = FBINFO_STATE_SUSPENDED;
- }
-
- /* HDMI must be enabled before LCDC configuration */
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index b2cb8e6..6fb956c 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -21,6 +21,9 @@ struct sh_mobile_lcdc_entity;
- struct sh_mobile_lcdc_priv;
- struct sh_mobile_lcdc_chan;
-
-+#define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
-+#define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
-+
- struct sh_mobile_lcdc_entity_ops {
- /* Display */
- int (*display_on)(struct sh_mobile_lcdc_entity *entity);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0168-sh_mobile_lcdc-Add-display-notify-callback-to-sh_mob.patch b/patches.armadillo800eva/0168-sh_mobile_lcdc-Add-display-notify-callback-to-sh_mob.patch
deleted file mode 100644
index 2290e0ce67397b..00000000000000
--- a/patches.armadillo800eva/0168-sh_mobile_lcdc-Add-display-notify-callback-to-sh_mob.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From bfab4418a38c6f956a1516f6a86efb8cbdc46ce5 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 18 Sep 2011 14:14:46 +0200
-Subject: sh_mobile_lcdc: Add display notify callback to sh_mobile_lcdc_chan
-
-The callback implements 3 notification events:
-
-- SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT notifies the LCDC that the
- display has been connected
-- SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT notifies the LCDC that the
- display has been disconnected
-- SH_MOBILE_LCDC_EVENT_DISPLAY_MODE notifies that LCDC that a display
- mode has been detected
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit ecd29947862a9a145c07098499c76c22ed5b8eb3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 84 ++++++++++++++++++++++++++++++++++++++
- drivers/video/sh_mobile_lcdcfb.h | 10 +++++
- 2 files changed, 94 insertions(+)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 5a19ef3..128eb77 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -364,6 +364,89 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- ch->tx_dev->ops->display_off(ch->tx_dev);
- }
-
-+static bool
-+sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch,
-+ const struct fb_var_screeninfo *new_var)
-+{
-+ struct fb_var_screeninfo *old_var = &ch->display_var;
-+ struct fb_videomode old_mode;
-+ struct fb_videomode new_mode;
-+
-+ fb_var_to_videomode(&old_mode, old_var);
-+ fb_var_to_videomode(&new_mode, new_var);
-+
-+ dev_dbg(ch->info->dev, "Old %ux%u, new %ux%u\n",
-+ old_mode.xres, old_mode.yres, new_mode.xres, new_mode.yres);
-+
-+ if (fb_mode_is_equal(&old_mode, &new_mode)) {
-+ /* It can be a different monitor with an equal video-mode */
-+ old_var->width = new_var->width;
-+ old_var->height = new_var->height;
-+ return false;
-+ }
-+
-+ dev_dbg(ch->info->dev, "Switching %u -> %u lines\n",
-+ old_mode.yres, new_mode.yres);
-+ *old_var = *new_var;
-+
-+ return true;
-+}
-+
-+static int sh_mobile_check_var(struct fb_var_screeninfo *var,
-+ struct fb_info *info);
-+
-+static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
-+ enum sh_mobile_lcdc_entity_event event,
-+ struct fb_var_screeninfo *var)
-+{
-+ struct fb_info *info = ch->info;
-+ int ret = 0;
-+
-+ switch (event) {
-+ case SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT:
-+ /* HDMI plug in */
-+ if (lock_fb_info(info)) {
-+ console_lock();
-+
-+ if (!sh_mobile_lcdc_must_reconfigure(ch, var) &&
-+ info->state == FBINFO_STATE_RUNNING) {
-+ /* First activation with the default monitor.
-+ * Just turn on, if we run a resume here, the
-+ * logo disappears.
-+ */
-+ info->var.width = var->width;
-+ info->var.height = var->height;
-+ sh_mobile_lcdc_display_on(ch);
-+ } else {
-+ /* New monitor or have to wake up */
-+ fb_set_suspend(info, 0);
-+ }
-+
-+ console_unlock();
-+ unlock_fb_info(info);
-+ }
-+ break;
-+
-+ case SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT:
-+ /* HDMI disconnect */
-+ if (lock_fb_info(info)) {
-+ console_lock();
-+ fb_set_suspend(info, 1);
-+ console_unlock();
-+ unlock_fb_info(info);
-+ }
-+ break;
-+
-+ case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE:
-+ /* Validate a proposed new mode */
-+ var->bits_per_pixel = info->var.bits_per_pixel;
-+ ret = sh_mobile_check_var(var, info);
-+ break;
-+ }
-+
-+ return ret;
-+}
-+
- /* -----------------------------------------------------------------------------
- * Format helpers
- */
-@@ -1591,6 +1674,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- int i;
-
- mutex_init(&ch->open_lock);
-+ ch->notify = sh_mobile_lcdc_display_notify;
-
- /* Allocate the frame buffer device. */
- ch->info = framebuffer_alloc(0, priv->dev);
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 6fb956c..e2eb7af 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -30,6 +30,12 @@ struct sh_mobile_lcdc_entity_ops {
- void (*display_off)(struct sh_mobile_lcdc_entity *entity);
- };
-
-+enum sh_mobile_lcdc_entity_event {
-+ SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT,
-+ SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT,
-+ SH_MOBILE_LCDC_EVENT_DISPLAY_MODE,
-+};
-+
- struct sh_mobile_lcdc_entity {
- struct module *owner;
- const struct sh_mobile_lcdc_entity_ops *ops;
-@@ -70,6 +76,10 @@ struct sh_mobile_lcdc_chan {
- unsigned long base_addr_y;
- unsigned long base_addr_c;
- unsigned int pitch;
-+
-+ int (*notify)(struct sh_mobile_lcdc_chan *ch,
-+ enum sh_mobile_lcdc_entity_event event,
-+ struct fb_var_screeninfo *var);
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0169-sh_mobile_hdmi-Use-LCDC-notification-callback.patch b/patches.armadillo800eva/0169-sh_mobile_hdmi-Use-LCDC-notification-callback.patch
deleted file mode 100644
index c82cadfeb0eb2a..00000000000000
--- a/patches.armadillo800eva/0169-sh_mobile_hdmi-Use-LCDC-notification-callback.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From b72769e69999f6fb428eb25bee4690f021da55bc Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 18 Sep 2011 14:18:28 +0200
-Subject: sh_mobile_hdmi: Use LCDC notification callback
-
-Instead of accessing the LCDC channel and fb_info structures directly,
-use the LCDC notification callback to inform the LCDC driver about
-display-related events.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 7295752fd7ec86feca6e3ccb407c1cbabf59e1d3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 91 +++++++---------------------------------
- 1 file changed, 14 insertions(+), 77 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 1464abf..055cd92 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -733,12 +733,11 @@ static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi,
- static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- unsigned long *parent_rate)
- {
-- struct fb_info *info = hdmi->entity.lcdc
-- ? hdmi->entity.lcdc->info : NULL;
-- struct fb_var_screeninfo tmpvar;
-- struct fb_var_screeninfo *var = &tmpvar;
-+ struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
-+ struct fb_info *info = ch ? ch->info : NULL;
-+ struct fb_var_screeninfo var;
- const struct fb_videomode *mode, *found = NULL;
-- struct fb_modelist *modelist = NULL;
-+ const struct fb_modelist *modelist = NULL;
- unsigned int f_width = 0, f_height = 0, f_refresh = 0;
- unsigned long found_rate_error = ULONG_MAX; /* silly compiler... */
- bool scanning = false, preferred_bad = false;
-@@ -856,12 +855,10 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- }
-
- /* Check if supported: sufficient fb memory, supported clock-rate */
-- fb_videomode_to_var(var, mode);
-+ fb_videomode_to_var(&var, mode);
-
-- var->bits_per_pixel = info->var.bits_per_pixel;
--
-- if (info && info->fbops->fb_check_var &&
-- info->fbops->fb_check_var(var, info)) {
-+ if (ch && ch->notify &&
-+ ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_MODE, &var)) {
- scanning = true;
- preferred_bad = true;
- continue;
-@@ -1044,32 +1041,6 @@ static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
- .display_off = sh_hdmi_display_off,
- };
-
--static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
--{
-- struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
-- struct fb_var_screeninfo *new_var = &hdmi->var, *old_var = &ch->display_var;
-- struct fb_videomode mode1, mode2;
--
-- fb_var_to_videomode(&mode1, old_var);
-- fb_var_to_videomode(&mode2, new_var);
--
-- dev_dbg(hdmi->dev, "Old %ux%u, new %ux%u\n",
-- mode1.xres, mode1.yres, mode2.xres, mode2.yres);
--
-- if (fb_mode_is_equal(&mode1, &mode2)) {
-- /* It can be a different monitor with an equal video-mode */
-- old_var->width = new_var->width;
-- old_var->height = new_var->height;
-- return false;
-- }
--
-- dev_dbg(hdmi->dev, "Switching %u -> %u lines\n",
-- mode1.yres, mode2.yres);
-- *old_var = *new_var;
--
-- return true;
--}
--
- /**
- * sh_hdmi_clk_configure() - set HDMI clock frequency and enable the clock
- * @hdmi: driver context
-@@ -1110,7 +1081,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- {
- struct sh_hdmi *hdmi = container_of(work, struct sh_hdmi, edid_work.work);
- struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
-- struct fb_info *info;
- int ret;
-
- dev_dbg(hdmi->dev, "%s(%p): begin, hotplug status %d\n", __func__, hdmi,
-@@ -1135,52 +1105,19 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
- /* Switched to another (d) power-save mode */
- msleep(10);
-
-- if (ch == NULL)
-- goto out;
--
-- info = ch->info;
--
-- if (lock_fb_info(info)) {
-- console_lock();
--
-- /* HDMI plug in */
-- if (!sh_hdmi_must_reconfigure(hdmi) &&
-- info->state == FBINFO_STATE_RUNNING) {
-- /*
-- * First activation with the default monitor - just turn
-- * on, if we run a resume here, the logo disappears
-- */
-- info->var.width = hdmi->var.width;
-- info->var.height = hdmi->var.height;
-- sh_hdmi_display_on(&hdmi->entity);
-- } else {
-- /* New monitor or have to wake up */
-- fb_set_suspend(info, 0);
-- }
--
-- console_unlock();
-- unlock_fb_info(info);
-- }
-+ if (ch && ch->notify)
-+ ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT,
-+ &hdmi->var);
- } else {
-- ret = 0;
-- if (ch == NULL)
-- goto out;
--
-- info = ch->info;
--
- hdmi->monspec.modedb_len = 0;
- fb_destroy_modedb(hdmi->monspec.modedb);
- hdmi->monspec.modedb = NULL;
-
-- if (lock_fb_info(info)) {
-- console_lock();
-+ if (ch && ch->notify)
-+ ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT,
-+ NULL);
-
-- /* HDMI disconnect */
-- fb_set_suspend(info, 1);
--
-- console_unlock();
-- unlock_fb_info(info);
-- }
-+ ret = 0;
- }
-
- out:
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0170-fbdev-sh_mobile_lcdc-Pass-a-video-mode-to-the-notify.patch b/patches.armadillo800eva/0170-fbdev-sh_mobile_lcdc-Pass-a-video-mode-to-the-notify.patch
deleted file mode 100644
index 5e624e9eece47a..00000000000000
--- a/patches.armadillo800eva/0170-fbdev-sh_mobile_lcdc-Pass-a-video-mode-to-the-notify.patch
+++ /dev/null
@@ -1,296 +0,0 @@
-From 34bfa3a6b085c7f80ac52fa33888f4ee7aacbab1 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 01:05:47 +0100
-Subject: fbdev: sh_mobile_lcdc: Pass a video mode to the notify callback
-
-Pass pointers to struct fb_videomode and struct fb_monspecs instead of
-struct fb_var_screeninfo to the notify callback.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit e0c8601a18969229eb63065e5c3176319c785288)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 59 +++++++++++++++++---------------------
- drivers/video/sh_mobile_lcdcfb.c | 36 ++++++++++++-----------
- drivers/video/sh_mobile_lcdcfb.h | 3 +-
- 3 files changed, 48 insertions(+), 50 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 055cd92..2617609 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -220,7 +220,7 @@ struct sh_hdmi {
- struct clk *hdmi_clk;
- struct device *dev;
- struct delayed_work edid_work;
-- struct fb_var_screeninfo var;
-+ struct fb_videomode mode;
- struct fb_monspecs monspec;
- };
-
-@@ -291,24 +291,24 @@ static struct snd_soc_codec_driver soc_codec_dev_sh_hdmi = {
- /* External video parameter settings */
- static void sh_hdmi_external_video_param(struct sh_hdmi *hdmi)
- {
-- struct fb_var_screeninfo *var = &hdmi->var;
-+ struct fb_videomode *mode = &hdmi->mode;
- u16 htotal, hblank, hdelay, vtotal, vblank, vdelay, voffset;
- u8 sync = 0;
-
-- htotal = var->xres + var->right_margin + var->left_margin + var->hsync_len;
--
-- hdelay = var->hsync_len + var->left_margin;
-- hblank = var->right_margin + hdelay;
-+ htotal = mode->xres + mode->right_margin + mode->left_margin
-+ + mode->hsync_len;
-+ hdelay = mode->hsync_len + mode->left_margin;
-+ hblank = mode->right_margin + hdelay;
-
- /*
- * Vertical timing looks a bit different in Figure 18,
- * but let's try the same first by setting offset = 0
- */
-- vtotal = var->yres + var->upper_margin + var->lower_margin + var->vsync_len;
--
-- vdelay = var->vsync_len + var->upper_margin;
-- vblank = var->lower_margin + vdelay;
-- voffset = min(var->upper_margin / 2, 6U);
-+ vtotal = mode->yres + mode->upper_margin + mode->lower_margin
-+ + mode->vsync_len;
-+ vdelay = mode->vsync_len + mode->upper_margin;
-+ vblank = mode->lower_margin + vdelay;
-+ voffset = min(mode->upper_margin / 2, 6U);
-
- /*
- * [3]: VSYNC polarity: Positive
-@@ -316,14 +316,14 @@ static void sh_hdmi_external_video_param(struct sh_hdmi *hdmi)
- * [1]: Interlace/Progressive: Progressive
- * [0]: External video settings enable: used.
- */
-- if (var->sync & FB_SYNC_HOR_HIGH_ACT)
-+ if (mode->sync & FB_SYNC_HOR_HIGH_ACT)
- sync |= 4;
-- if (var->sync & FB_SYNC_VERT_HIGH_ACT)
-+ if (mode->sync & FB_SYNC_VERT_HIGH_ACT)
- sync |= 8;
-
- dev_dbg(hdmi->dev, "H: %u, %u, %u, %u; V: %u, %u, %u, %u; sync 0x%x\n",
-- htotal, hblank, hdelay, var->hsync_len,
-- vtotal, vblank, vdelay, var->vsync_len, sync);
-+ htotal, hblank, hdelay, mode->hsync_len,
-+ vtotal, vblank, vdelay, mode->vsync_len, sync);
-
- hdmi_write(hdmi, sync | (voffset << 4), HDMI_EXTERNAL_VIDEO_PARAM_SETTINGS);
-
-@@ -336,8 +336,8 @@ static void sh_hdmi_external_video_param(struct sh_hdmi *hdmi)
- hdmi_write(hdmi, hdelay, HDMI_EXTERNAL_H_DELAY_7_0);
- hdmi_write(hdmi, hdelay >> 8, HDMI_EXTERNAL_H_DELAY_9_8);
-
-- hdmi_write(hdmi, var->hsync_len, HDMI_EXTERNAL_H_DURATION_7_0);
-- hdmi_write(hdmi, var->hsync_len >> 8, HDMI_EXTERNAL_H_DURATION_9_8);
-+ hdmi_write(hdmi, mode->hsync_len, HDMI_EXTERNAL_H_DURATION_7_0);
-+ hdmi_write(hdmi, mode->hsync_len >> 8, HDMI_EXTERNAL_H_DURATION_9_8);
-
- hdmi_write(hdmi, vtotal, HDMI_EXTERNAL_V_TOTAL_7_0);
- hdmi_write(hdmi, vtotal >> 8, HDMI_EXTERNAL_V_TOTAL_9_8);
-@@ -346,7 +346,7 @@ static void sh_hdmi_external_video_param(struct sh_hdmi *hdmi)
-
- hdmi_write(hdmi, vdelay, HDMI_EXTERNAL_V_DELAY);
-
-- hdmi_write(hdmi, var->vsync_len, HDMI_EXTERNAL_V_DURATION);
-+ hdmi_write(hdmi, mode->vsync_len, HDMI_EXTERNAL_V_DURATION);
-
- /* Set bit 0 of HDMI_EXTERNAL_VIDEO_PARAM_SETTINGS here for external mode */
- if (!hdmi->preprogrammed_vic)
-@@ -473,7 +473,7 @@ static void sh_hdmi_audio_config(struct sh_hdmi *hdmi)
- */
- static void sh_hdmi_phy_config(struct sh_hdmi *hdmi)
- {
-- if (hdmi->var.pixclock < 10000) {
-+ if (hdmi->mode.pixclock < 10000) {
- /* for 1080p8bit 148MHz */
- hdmi_write(hdmi, 0x1d, HDMI_SLIPHDMIT_PARAM_SETTINGS_1);
- hdmi_write(hdmi, 0x00, HDMI_SLIPHDMIT_PARAM_SETTINGS_2);
-@@ -484,7 +484,7 @@ static void sh_hdmi_phy_config(struct sh_hdmi *hdmi)
- hdmi_write(hdmi, 0x0e, HDMI_SLIPHDMIT_PARAM_SETTINGS_8);
- hdmi_write(hdmi, 0x25, HDMI_SLIPHDMIT_PARAM_SETTINGS_9);
- hdmi_write(hdmi, 0x04, HDMI_SLIPHDMIT_PARAM_SETTINGS_10);
-- } else if (hdmi->var.pixclock < 30000) {
-+ } else if (hdmi->mode.pixclock < 30000) {
- /* 720p, 8bit, 74.25MHz. Might need to be adjusted for other formats */
- /*
- * [1:0] Speed_A
-@@ -735,7 +735,6 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- {
- struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
- struct fb_info *info = ch ? ch->info : NULL;
-- struct fb_var_screeninfo var;
- const struct fb_videomode *mode, *found = NULL;
- const struct fb_modelist *modelist = NULL;
- unsigned int f_width = 0, f_height = 0, f_refresh = 0;
-@@ -855,10 +854,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- }
-
- /* Check if supported: sufficient fb memory, supported clock-rate */
-- fb_videomode_to_var(&var, mode);
--
- if (ch && ch->notify &&
-- ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_MODE, &var)) {
-+ ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_MODE, mode,
-+ NULL)) {
- scanning = true;
- preferred_bad = true;
- continue;
-@@ -868,9 +866,6 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- found_rate_error = rate_error;
- }
-
-- hdmi->var.width = hdmi->monspec.max_x * 10;
-- hdmi->var.height = hdmi->monspec.max_y * 10;
--
- /*
- * TODO 1: if no ->info is present, postpone running the config until
- * after ->info first gets registered.
-@@ -916,7 +911,7 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- found->xres, found->yres, found->refresh,
- PICOS2KHZ(found->pixclock) * 1000, found_rate_error);
-
-- fb_videomode_to_var(&hdmi->var, found);
-+ hdmi->mode = *found;
- sh_hdmi_external_video_param(hdmi);
-
- return 0;
-@@ -1017,9 +1012,9 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- hdmi_write(hdmi, 0x80, HDMI_SYSTEM_CTRL);
- dev_dbg(hdmi->dev, "HDMI running\n");
- break;
-- case HDMI_HOTPLUG_DISCONNECTED:
- default:
-- hdmi->var = ch->display_var;
-+ fb_var_to_videomode(&hdmi->mode, &ch->display_var);
-+ break;
- }
-
- return hdmi->hp_state == HDMI_HOTPLUG_DISCONNECTED
-@@ -1107,7 +1102,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
-
- if (ch && ch->notify)
- ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT,
-- &hdmi->var);
-+ &hdmi->mode, &hdmi->monspec);
- } else {
- hdmi->monspec.modedb_len = 0;
- fb_destroy_modedb(hdmi->monspec.modedb);
-@@ -1115,7 +1110,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
-
- if (ch && ch->notify)
- ch->notify(ch, SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT,
-- NULL);
-+ NULL, NULL);
-
- ret = 0;
- }
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 128eb77..d3299ff 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -366,28 +366,23 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
-
- static bool
- sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch,
-- const struct fb_var_screeninfo *new_var)
-+ const struct fb_videomode *new_mode)
- {
- struct fb_var_screeninfo *old_var = &ch->display_var;
- struct fb_videomode old_mode;
-- struct fb_videomode new_mode;
-
- fb_var_to_videomode(&old_mode, old_var);
-- fb_var_to_videomode(&new_mode, new_var);
-
- dev_dbg(ch->info->dev, "Old %ux%u, new %ux%u\n",
-- old_mode.xres, old_mode.yres, new_mode.xres, new_mode.yres);
-+ old_mode.xres, old_mode.yres, new_mode->xres, new_mode->yres);
-
-- if (fb_mode_is_equal(&old_mode, &new_mode)) {
-- /* It can be a different monitor with an equal video-mode */
-- old_var->width = new_var->width;
-- old_var->height = new_var->height;
-+ /* It can be a different monitor with an equal video-mode */
-+ if (fb_mode_is_equal(&old_mode, new_mode))
- return false;
-- }
-
- dev_dbg(ch->info->dev, "Switching %u -> %u lines\n",
-- old_mode.yres, new_mode.yres);
-- *old_var = *new_var;
-+ old_mode.yres, new_mode->yres);
-+ fb_videomode_to_var(old_var, new_mode);
-
- return true;
- }
-@@ -397,9 +392,11 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var,
-
- static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
- enum sh_mobile_lcdc_entity_event event,
-- struct fb_var_screeninfo *var)
-+ const struct fb_videomode *mode,
-+ const struct fb_monspecs *monspec)
- {
- struct fb_info *info = ch->info;
-+ struct fb_var_screeninfo var;
- int ret = 0;
-
- switch (event) {
-@@ -408,14 +405,17 @@ static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
- if (lock_fb_info(info)) {
- console_lock();
-
-- if (!sh_mobile_lcdc_must_reconfigure(ch, var) &&
-+ ch->display_var.width = monspec->max_x * 10;
-+ ch->display_var.height = monspec->max_y * 10;
-+
-+ if (!sh_mobile_lcdc_must_reconfigure(ch, mode) &&
- info->state == FBINFO_STATE_RUNNING) {
- /* First activation with the default monitor.
- * Just turn on, if we run a resume here, the
- * logo disappears.
- */
-- info->var.width = var->width;
-- info->var.height = var->height;
-+ info->var.width = monspec->max_x * 10;
-+ info->var.height = monspec->max_y * 10;
- sh_mobile_lcdc_display_on(ch);
- } else {
- /* New monitor or have to wake up */
-@@ -439,8 +439,10 @@ static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
-
- case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE:
- /* Validate a proposed new mode */
-- var->bits_per_pixel = info->var.bits_per_pixel;
-- ret = sh_mobile_check_var(var, info);
-+ fb_videomode_to_var(&var, mode);
-+ var.bits_per_pixel = info->var.bits_per_pixel;
-+ var.grayscale = info->var.grayscale;
-+ ret = sh_mobile_check_var(&var, info);
- break;
- }
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index e2eb7af..10086ae 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -79,7 +79,8 @@ struct sh_mobile_lcdc_chan {
-
- int (*notify)(struct sh_mobile_lcdc_chan *ch,
- enum sh_mobile_lcdc_entity_event event,
-- struct fb_var_screeninfo *var);
-+ const struct fb_videomode *mode,
-+ const struct fb_monspecs *monspec);
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0171-fbdev-sh_mobile_hdmi-Don-t-set-sh_hdmi-mode-in-the-d.patch b/patches.armadillo800eva/0171-fbdev-sh_mobile_hdmi-Don-t-set-sh_hdmi-mode-in-the-d.patch
deleted file mode 100644
index 146ade3a173759..00000000000000
--- a/patches.armadillo800eva/0171-fbdev-sh_mobile_hdmi-Don-t-set-sh_hdmi-mode-in-the-d.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From ff1c59b9f903d00351b77e364a1e35a5b2b94516 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 01:07:50 +0100
-Subject: fbdev: sh_mobile_hdmi: Don't set sh_hdmi::mode in the display on
- handler
-
-The struct sh_hdmi mode field is only used after being assigned by the
-EDID read code. There is thus no need to initialize it from the LCDC
-display var in the display on handler.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d30555d24e462edf439a1057114e1b0df76c89ef)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 8 +-------
- 1 file changed, 1 insertion(+), 7 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 2617609..37f935f 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -995,7 +995,6 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
- static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- {
- struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
-- struct sh_mobile_lcdc_chan *ch = entity->lcdc;
-
- dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi,
- hdmi->hp_state);
-@@ -1006,15 +1005,10 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
- * HDMI_HOTPLUG_CONNECTED: on monitor plug-in
- * HDMI_HOTPLUG_EDID_DONE: on EDID read completion
- */
-- switch (hdmi->hp_state) {
-- case HDMI_HOTPLUG_EDID_DONE:
-+ if (hdmi->hp_state == HDMI_HOTPLUG_EDID_DONE) {
- /* PS mode d->e. All functions are active */
- hdmi_write(hdmi, 0x80, HDMI_SYSTEM_CTRL);
- dev_dbg(hdmi->dev, "HDMI running\n");
-- break;
-- default:
-- fb_var_to_videomode(&hdmi->mode, &ch->display_var);
-- break;
- }
-
- return hdmi->hp_state == HDMI_HOTPLUG_DISCONNECTED
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0172-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-fb_info.patch b/patches.armadillo800eva/0172-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-fb_info.patch
deleted file mode 100644
index 874d0b00e6e6b1..00000000000000
--- a/patches.armadillo800eva/0172-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-fb_info.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From e1d190da1084ca206f5eb5f948600ddba65c7332 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 01:46:12 +0100
-Subject: fbdev: sh_mobile_hdmi: Don't access LCDC fb_info
-
-The LCDC fb_info structure is only used to retrieve the default video
-mode in case none of the modes advertised by EDID information is
-acceptable. Pass a pointer to the default mode through the
-sh_mobile_lcdc_entity structure instead.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 13f80eea562be6cd58b5bdefc224c87cc0d9288d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_hdmi.c | 34 ++++++++++++++--------------------
- drivers/video/sh_mobile_lcdcfb.c | 24 +++++++++++++-----------
- drivers/video/sh_mobile_lcdcfb.h | 1 +
- 3 files changed, 28 insertions(+), 31 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
-index 37f935f..eafb19d 100644
---- a/drivers/video/sh_mobile_hdmi.c
-+++ b/drivers/video/sh_mobile_hdmi.c
-@@ -734,12 +734,11 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- unsigned long *parent_rate)
- {
- struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc;
-- struct fb_info *info = ch ? ch->info : NULL;
- const struct fb_videomode *mode, *found = NULL;
-- const struct fb_modelist *modelist = NULL;
- unsigned int f_width = 0, f_height = 0, f_refresh = 0;
- unsigned long found_rate_error = ULONG_MAX; /* silly compiler... */
- bool scanning = false, preferred_bad = false;
-+ bool use_edid_mode = false;
- u8 edid[128];
- char *forced;
- int i;
-@@ -864,25 +863,19 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
-
- found = mode;
- found_rate_error = rate_error;
-+ use_edid_mode = true;
- }
-
- /*
-- * TODO 1: if no ->info is present, postpone running the config until
-- * after ->info first gets registered.
-+ * TODO 1: if no default mode is present, postpone running the config
-+ * until after the LCDC channel is initialized.
- * TODO 2: consider registering the HDMI platform device from the LCDC
-- * driver, and passing ->info with HDMI platform data.
-+ * driver.
- */
-- if (info && !found) {
-- modelist = info->modelist.next &&
-- !list_empty(&info->modelist) ?
-- list_entry(info->modelist.next,
-- struct fb_modelist, list) :
-- NULL;
--
-- if (modelist) {
-- found = &modelist->mode;
-- found_rate_error = sh_hdmi_rate_error(hdmi, found, hdmi_rate, parent_rate);
-- }
-+ if (!found && hdmi->entity.def_mode.xres != 0) {
-+ found = &hdmi->entity.def_mode;
-+ found_rate_error = sh_hdmi_rate_error(hdmi, found, hdmi_rate,
-+ parent_rate);
- }
-
- /* No cookie today */
-@@ -906,10 +899,11 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi, unsigned long *hdmi_rate,
- else
- hdmi->preprogrammed_vic = 0;
-
-- dev_dbg(hdmi->dev, "Using %s %s mode %ux%u@%uHz (%luHz), clock error %luHz\n",
-- modelist ? "default" : "EDID", hdmi->preprogrammed_vic ? "VIC" : "external",
-- found->xres, found->yres, found->refresh,
-- PICOS2KHZ(found->pixclock) * 1000, found_rate_error);
-+ dev_dbg(hdmi->dev, "Using %s %s mode %ux%u@%uHz (%luHz), "
-+ "clock error %luHz\n", use_edid_mode ? "EDID" : "default",
-+ hdmi->preprogrammed_vic ? "VIC" : "external", found->xres,
-+ found->yres, found->refresh, PICOS2KHZ(found->pixclock) * 1000,
-+ found_rate_error);
-
- hdmi->mode = *found;
- sh_hdmi_external_video_param(hdmi);
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index d3299ff..986346d 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1691,17 +1691,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- info->pseudo_palette = &ch->pseudo_palette;
- info->flags = FBINFO_FLAG_DEFAULT;
-
-- if (cfg->tx_dev) {
-- if (!cfg->tx_dev->dev.driver ||
-- !try_module_get(cfg->tx_dev->dev.driver->owner)) {
-- dev_warn(priv->dev,
-- "unable to get transmitter device\n");
-- return -EINVAL;
-- }
-- ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
-- ch->tx_dev->lcdc = ch;
-- }
--
- /* Iterate through the modes to validate them and find the highest
- * resolution.
- */
-@@ -1742,6 +1731,19 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
-
- fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
-
-+ /* Initialize the transmitter device if present. */
-+ if (cfg->tx_dev) {
-+ if (!cfg->tx_dev->dev.driver ||
-+ !try_module_get(cfg->tx_dev->dev.driver->owner)) {
-+ dev_warn(priv->dev,
-+ "unable to get transmitter device\n");
-+ return -EINVAL;
-+ }
-+ ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
-+ ch->tx_dev->lcdc = ch;
-+ ch->tx_dev->def_mode = *mode;
-+ }
-+
- /* Initialize variable screen information using the first mode as
- * default. The default Y virtual resolution is twice the panel size to
- * allow for double-buffering.
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 10086ae..9c91fae 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -40,6 +40,7 @@ struct sh_mobile_lcdc_entity {
- struct module *owner;
- const struct sh_mobile_lcdc_entity_ops *ops;
- struct sh_mobile_lcdc_chan *lcdc;
-+ struct fb_videomode def_mode;
- };
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0173-fbdev-sh_mobile_lcdc-Store-display-mode-in-a-struct-.patch b/patches.armadillo800eva/0173-fbdev-sh_mobile_lcdc-Store-display-mode-in-a-struct-.patch
deleted file mode 100644
index 7dc7301aae0d84..00000000000000
--- a/patches.armadillo800eva/0173-fbdev-sh_mobile_lcdc-Store-display-mode-in-a-struct-.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-From d77a91222ef33c9df80de28959e2a56711cf9be8 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 13:42:48 +0100
-Subject: fbdev: sh_mobile_lcdc: Store display mode in a struct fb_videomode
-
-Embed struct fb_videomode instead of struct fb_var_screeninfo in struct
-sh_mobile_lcdc_chan to store the display mode.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 2d04559dc23bed905ed2904f2bbcbcc3f1a7fd91)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 74 ++++++++++++++++++++------------------
- drivers/video/sh_mobile_lcdcfb.h | 6 +++-
- 2 files changed, 44 insertions(+), 36 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 986346d..422fcfd 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -368,21 +368,17 @@ static bool
- sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch,
- const struct fb_videomode *new_mode)
- {
-- struct fb_var_screeninfo *old_var = &ch->display_var;
-- struct fb_videomode old_mode;
--
-- fb_var_to_videomode(&old_mode, old_var);
--
- dev_dbg(ch->info->dev, "Old %ux%u, new %ux%u\n",
-- old_mode.xres, old_mode.yres, new_mode->xres, new_mode->yres);
-+ ch->display.mode.xres, ch->display.mode.yres,
-+ new_mode->xres, new_mode->yres);
-
- /* It can be a different monitor with an equal video-mode */
-- if (fb_mode_is_equal(&old_mode, new_mode))
-+ if (fb_mode_is_equal(&ch->display.mode, new_mode))
- return false;
-
- dev_dbg(ch->info->dev, "Switching %u -> %u lines\n",
-- old_mode.yres, new_mode->yres);
-- fb_videomode_to_var(old_var, new_mode);
-+ ch->display.mode.yres, new_mode->yres);
-+ ch->display.mode = *new_mode;
-
- return true;
- }
-@@ -405,8 +401,8 @@ static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
- if (lock_fb_info(info)) {
- console_lock();
-
-- ch->display_var.width = monspec->max_x * 10;
-- ch->display_var.height = monspec->max_y * 10;
-+ ch->display.width = monspec->max_x * 10;
-+ ch->display.height = monspec->max_y * 10;
-
- if (!sh_mobile_lcdc_must_reconfigure(ch, mode) &&
- info->state == FBINFO_STATE_RUNNING) {
-@@ -569,7 +565,8 @@ static void sh_mobile_lcdc_start_stop(struct sh_mobile_lcdc_priv *priv,
-
- static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- {
-- struct fb_var_screeninfo *var = &ch->info->var, *display_var = &ch->display_var;
-+ const struct fb_var_screeninfo *var = &ch->info->var;
-+ const struct fb_videomode *mode = &ch->display.mode;
- unsigned long h_total, hsync_pos, display_h_total;
- u32 tmp;
-
-@@ -588,34 +585,32 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- lcdc_write_chan(ch, LDMT3R, ch->cfg.sys_bus_cfg.ldmt3r);
-
- /* horizontal configuration */
-- h_total = display_var->xres + display_var->hsync_len +
-- display_var->left_margin + display_var->right_margin;
-+ h_total = mode->xres + mode->hsync_len + mode->left_margin
-+ + mode->right_margin;
- tmp = h_total / 8; /* HTCN */
-- tmp |= (min(display_var->xres, var->xres) / 8) << 16; /* HDCN */
-+ tmp |= (min(mode->xres, var->xres) / 8) << 16; /* HDCN */
- lcdc_write_chan(ch, LDHCNR, tmp);
-
-- hsync_pos = display_var->xres + display_var->right_margin;
-+ hsync_pos = mode->xres + mode->right_margin;
- tmp = hsync_pos / 8; /* HSYNP */
-- tmp |= (display_var->hsync_len / 8) << 16; /* HSYNW */
-+ tmp |= (mode->hsync_len / 8) << 16; /* HSYNW */
- lcdc_write_chan(ch, LDHSYNR, tmp);
-
- /* vertical configuration */
-- tmp = display_var->yres + display_var->vsync_len +
-- display_var->upper_margin + display_var->lower_margin; /* VTLN */
-- tmp |= min(display_var->yres, var->yres) << 16; /* VDLN */
-+ tmp = mode->yres + mode->vsync_len + mode->upper_margin
-+ + mode->lower_margin; /* VTLN */
-+ tmp |= min(mode->yres, var->yres) << 16; /* VDLN */
- lcdc_write_chan(ch, LDVLNR, tmp);
-
-- tmp = display_var->yres + display_var->lower_margin; /* VSYNP */
-- tmp |= display_var->vsync_len << 16; /* VSYNW */
-+ tmp = mode->yres + mode->lower_margin; /* VSYNP */
-+ tmp |= mode->vsync_len << 16; /* VSYNW */
- lcdc_write_chan(ch, LDVSYNR, tmp);
-
- /* Adjust horizontal synchronisation for HDMI */
-- display_h_total = display_var->xres + display_var->hsync_len +
-- display_var->left_margin + display_var->right_margin;
-- tmp = ((display_var->xres & 7) << 24) |
-- ((display_h_total & 7) << 16) |
-- ((display_var->hsync_len & 7) << 8) |
-- (hsync_pos & 7);
-+ display_h_total = mode->xres + mode->hsync_len + mode->left_margin
-+ + mode->right_margin;
-+ tmp = ((mode->xres & 7) << 24) | ((display_h_total & 7) << 16)
-+ | ((mode->hsync_len & 7) << 8) | (hsync_pos & 7);
- lcdc_write_chan(ch, LDHAJR, tmp);
- }
-
-@@ -1106,7 +1101,8 @@ static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd,
- static void sh_mobile_fb_reconfig(struct fb_info *info)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-- struct fb_videomode mode1, mode2;
-+ struct fb_var_screeninfo var;
-+ struct fb_videomode mode;
- struct fb_event event;
- int evnt = FB_EVENT_MODE_CHANGE_ALL;
-
-@@ -1114,14 +1110,19 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
- /* More framebuffer users are active */
- return;
-
-- fb_var_to_videomode(&mode1, &ch->display_var);
-- fb_var_to_videomode(&mode2, &info->var);
-+ fb_var_to_videomode(&mode, &info->var);
-
-- if (fb_mode_is_equal(&mode1, &mode2))
-+ if (fb_mode_is_equal(&ch->display.mode, &mode))
- return;
-
- /* Display has been re-plugged, framebuffer is free now, reconfigure */
-- if (fb_set_var(info, &ch->display_var) < 0)
-+ var = info->var;
-+ fb_videomode_to_var(&var, &ch->display.mode);
-+ var.width = ch->display.width;
-+ var.height = ch->display.height;
-+ var.activate = FB_ACTIVATE_NOW;
-+
-+ if (fb_set_var(info, &var) < 0)
- /* Couldn't reconfigure, hopefully, can continue as before */
- return;
-
-@@ -1131,7 +1132,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
- * user event, we have to call the chain ourselves.
- */
- event.info = info;
-- event.data = &mode1;
-+ event.data = &ch->display.mode;
- fb_notifier_call_chain(evnt, &event);
- }
-
-@@ -1815,7 +1816,10 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
-
- info->screen_base = buf;
- info->device = priv->dev;
-- ch->display_var = *var;
-+
-+ ch->display.width = cfg->panel_cfg.width;
-+ ch->display.height = cfg->panel_cfg.height;
-+ ch->display.mode = *mode;
-
- return 0;
- }
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 9c91fae..c175387 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -68,7 +68,11 @@ struct sh_mobile_lcdc_chan {
- unsigned long pan_offset;
- wait_queue_head_t frame_end_wait;
- struct completion vsync_completion;
-- struct fb_var_screeninfo display_var;
-+ struct {
-+ unsigned int width;
-+ unsigned int height;
-+ struct fb_videomode mode;
-+ } display;
- int use_count;
- int blank_status;
- struct mutex open_lock; /* protects the use counter */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0174-fbdev-sh_mobile_lcdc-Rename-lcd-num-_cfg-lcd-num-_mo.patch b/patches.armadillo800eva/0174-fbdev-sh_mobile_lcdc-Rename-lcd-num-_cfg-lcd-num-_mo.patch
deleted file mode 100644
index d0c008795f86e8..00000000000000
--- a/patches.armadillo800eva/0174-fbdev-sh_mobile_lcdc-Rename-lcd-num-_cfg-lcd-num-_mo.patch
+++ /dev/null
@@ -1,405 +0,0 @@
-From 918a3c709c036aaea6bae77c6fc5c8935c8979a3 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 14:33:41 +0100
-Subject: fbdev: sh_mobile_lcdc: Rename (lcd|num)_cfg (lcd|num)_modes
-
-The struct sh_mobile_lcdc_chan_cfg platform data contains a list of
-video modes. Name the lcd_cfg and num_cfg fields to reflect that they
-describe video modes.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 93ff259846a774ff37dca54792c5a3a6425882c0)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ap4evb.c
- arch/arm/mach-shmobile/board-bonito.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 4 ++--
- arch/arm/mach-shmobile/board-ap4evb.c | 4 ++--
- arch/arm/mach-shmobile/board-mackerel.c | 4 ++--
- arch/sh/boards/mach-ap325rxa/setup.c | 4 ++--
- arch/sh/boards/mach-ecovec24/setup.c | 8 +++----
- arch/sh/boards/mach-kfr2r09/setup.c | 4 ++--
- arch/sh/boards/mach-migor/setup.c | 8 +++----
- arch/sh/boards/mach-se/7724/setup.c | 8 +++----
- drivers/video/sh_mipi_dsi.c | 38 +++++++++++++++----------------
- drivers/video/sh_mobile_lcdcfb.c | 20 ++++++++--------
- include/video/sh_mobile_lcdc.h | 4 ++--
- 11 files changed, 53 insertions(+), 53 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 22b0861..f04ee16 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -260,8 +260,8 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
- .clock_divider = 1,
- .flags = LCDC_FLAGS_DWPOL,
- .fourcc = V4L2_PIX_FMT_RGB565,
-- .lcd_cfg = lcdc0_modes,
-- .num_cfg = ARRAY_SIZE(lcdc0_modes),
-+ .lcd_modes = lcdc0_modes,
-+ .num_modes = ARRAY_SIZE(lcdc0_modes),
- .panel_cfg = {
- .width = 44,
- .height = 79,
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index afdddb4..3cf12de 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -490,8 +490,8 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
-- .lcd_cfg = ap4evb_lcdc_modes,
-- .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
-+ .lcd_modes = ap4evb_lcdc_modes,
-+ .num_modes = ARRAY_SIZE(ap4evb_lcdc_modes),
- .meram_cfg = &lcd_meram_cfg,
- }
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index c9cab79..31d99e5 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -388,8 +388,8 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
-- .lcd_cfg = mackerel_lcdc_modes,
-- .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
-+ .lcd_modes = mackerel_lcdc_modes,
-+ .num_modes = ARRAY_SIZE(mackerel_lcdc_modes),
- .interface_type = RGB24,
- .clock_divider = 3,
- .flags = 0,
-diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
-index f7d7ce4..7194ae7 100644
---- a/arch/sh/boards/mach-ap325rxa/setup.c
-+++ b/arch/sh/boards/mach-ap325rxa/setup.c
-@@ -211,8 +211,8 @@ static struct sh_mobile_lcdc_info lcdc_info = {
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB18,
- .clock_divider = 1,
-- .lcd_cfg = ap325rxa_lcdc_modes,
-- .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes),
-+ .lcd_modes = ap325rxa_lcdc_modes,
-+ .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes),
- .panel_cfg = {
- .width = 152, /* 7.0 inch */
- .height = 91,
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 44799f9..15e3bfd 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -1146,8 +1146,8 @@ static int __init arch_setup(void)
- /* DVI */
- lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
- lcdc_info.ch[0].clock_divider = 1;
-- lcdc_info.ch[0].lcd_cfg = ecovec_dvi_modes;
-- lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_dvi_modes);
-+ lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes;
-+ lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes);
-
- gpio_set_value(GPIO_PTA2, 1);
- gpio_set_value(GPIO_PTU1, 1);
-@@ -1155,8 +1155,8 @@ static int __init arch_setup(void)
- /* Panel */
- lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
- lcdc_info.ch[0].clock_divider = 2;
-- lcdc_info.ch[0].lcd_cfg = ecovec_lcd_modes;
-- lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_lcd_modes);
-+ lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes;
-+ lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes);
-
- gpio_set_value(GPIO_PTR1, 1);
-
-diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
-index 39585bb..32cf2c8 100644
---- a/arch/sh/boards/mach-kfr2r09/setup.c
-+++ b/arch/sh/boards/mach-kfr2r09/setup.c
-@@ -151,8 +151,8 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
- .interface_type = SYS18,
- .clock_divider = 6,
- .flags = LCDC_FLAGS_DWPOL,
-- .lcd_cfg = kfr2r09_lcdc_modes,
-- .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes),
-+ .lcd_modes = kfr2r09_lcdc_modes,
-+ .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes),
- .panel_cfg = {
- .width = 35,
- .height = 58,
-diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
-index 5ce86c8..a478493 100644
---- a/arch/sh/boards/mach-migor/setup.c
-+++ b/arch/sh/boards/mach-migor/setup.c
-@@ -249,8 +249,8 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB16,
- .clock_divider = 2,
-- .lcd_cfg = migor_lcd_modes,
-- .num_cfg = ARRAY_SIZE(migor_lcd_modes),
-+ .lcd_modes = migor_lcd_modes,
-+ .num_modes = ARRAY_SIZE(migor_lcd_modes),
- .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
-@@ -263,8 +263,8 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = SYS16A,
- .clock_divider = 10,
-- .lcd_cfg = migor_lcd_modes,
-- .num_cfg = ARRAY_SIZE(migor_lcd_modes),
-+ .lcd_modes = migor_lcd_modes,
-+ .num_modes = ARRAY_SIZE(migor_lcd_modes),
- .panel_cfg = {
- .width = 49, /* 2.4 inch */
- .height = 37,
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 23cd9d6..1342feb 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -904,12 +904,12 @@ static int __init devices_setup(void)
-
- if (sw & SW41_B) {
- /* 720p */
-- lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes;
-- lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes);
-+ lcdc_info.ch[0].lcd_modes = lcdc_720p_modes;
-+ lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes);
- } else {
- /* VGA */
-- lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes;
-- lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes);
-+ lcdc_info.ch[0].lcd_modes = lcdc_vga_modes;
-+ lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes);
- }
-
- if (sw & SW41_A) {
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 5ff3742..42ad0f7 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -147,77 +147,77 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- pctype = 0;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
- pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
-- linelength = ch->lcd_cfg[0].xres * 3;
-+ linelength = ch->lcd_modes[0].xres * 3;
- yuv = false;
- break;
- case MIPI_RGB565:
- pctype = 1;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
- pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
-- linelength = ch->lcd_cfg[0].xres * 2;
-+ linelength = ch->lcd_modes[0].xres * 2;
- yuv = false;
- break;
- case MIPI_RGB666_LP:
- pctype = 2;
- datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
- pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
-- linelength = ch->lcd_cfg[0].xres * 3;
-+ linelength = ch->lcd_modes[0].xres * 3;
- yuv = false;
- break;
- case MIPI_RGB666:
- pctype = 3;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
- pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
-- linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8;
-+ linelength = (ch->lcd_modes[0].xres * 18 + 7) / 8;
- yuv = false;
- break;
- case MIPI_BGR888:
- pctype = 8;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
- pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
-- linelength = ch->lcd_cfg[0].xres * 3;
-+ linelength = ch->lcd_modes[0].xres * 3;
- yuv = false;
- break;
- case MIPI_BGR565:
- pctype = 9;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
- pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
-- linelength = ch->lcd_cfg[0].xres * 2;
-+ linelength = ch->lcd_modes[0].xres * 2;
- yuv = false;
- break;
- case MIPI_BGR666_LP:
- pctype = 0xa;
- datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
- pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
-- linelength = ch->lcd_cfg[0].xres * 3;
-+ linelength = ch->lcd_modes[0].xres * 3;
- yuv = false;
- break;
- case MIPI_BGR666:
- pctype = 0xb;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
- pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
-- linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8;
-+ linelength = (ch->lcd_modes[0].xres * 18 + 7) / 8;
- yuv = false;
- break;
- case MIPI_YUYV:
- pctype = 4;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
- pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
-- linelength = ch->lcd_cfg[0].xres * 2;
-+ linelength = ch->lcd_modes[0].xres * 2;
- yuv = true;
- break;
- case MIPI_UYVY:
- pctype = 5;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
- pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
-- linelength = ch->lcd_cfg[0].xres * 2;
-+ linelength = ch->lcd_modes[0].xres * 2;
- yuv = true;
- break;
- case MIPI_YUV420_L:
- pctype = 6;
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
- pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
-- linelength = (ch->lcd_cfg[0].xres * 12 + 7) / 8;
-+ linelength = (ch->lcd_modes[0].xres * 12 + 7) / 8;
- yuv = true;
- break;
- case MIPI_YUV420:
-@@ -225,7 +225,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
- pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
- /* Length of U/V line */
-- linelength = (ch->lcd_cfg[0].xres + 1) / 2;
-+ linelength = (ch->lcd_modes[0].xres + 1) / 2;
- yuv = true;
- break;
- default:
-@@ -294,7 +294,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- */
- iowrite32(0x00000006, mipi->linkbase + DTCTR);
- /* VSYNC width = 2 (<< 17) */
-- iowrite32((ch->lcd_cfg[0].vsync_len << pdata->vsynw_offset) |
-+ iowrite32((ch->lcd_modes[0].vsync_len << pdata->vsynw_offset) |
- (pdata->clksrc << 16) | (pctype << 12) | datatype,
- mipi->linkbase + VMCTR1);
-
-@@ -328,7 +328,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- top = linelength << 16; /* RGBLEN */
- bottom = 0x00000001;
- if (pdata->flags & SH_MIPI_DSI_HSABM) /* HSALEN */
-- bottom = (pdata->lane * ch->lcd_cfg[0].hsync_len) - 10;
-+ bottom = (pdata->lane * ch->lcd_modes[0].hsync_len) - 10;
- iowrite32(top | bottom , mipi->linkbase + VMLEN1);
-
- /*
-@@ -348,18 +348,18 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- div = 2;
-
- if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */
-- top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin;
-+ top = ch->lcd_modes[0].hsync_len + ch->lcd_modes[0].left_margin;
- top = ((pdata->lane * top / div) - 10) << 16;
- }
- if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */
-- bottom = ch->lcd_cfg[0].right_margin;
-+ bottom = ch->lcd_modes[0].right_margin;
- bottom = (pdata->lane * bottom / div) - 12;
- }
-
-- bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */
-+ bpp = linelength / ch->lcd_modes[0].xres; /* byte / pixel */
- if ((pdata->lane / div) > bpp) {
-- tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */
-- tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */
-+ tmp = ch->lcd_modes[0].xres / bpp; /* output cycle */
-+ tmp = ch->lcd_modes[0].xres - tmp; /* (input - output) cycle */
- delay = (pdata->lane * tmp);
- }
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 422fcfd..ab7b179 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1191,8 +1191,8 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- * distance between two modes is defined as the size of the
- * non-overlapping parts of the two rectangles.
- */
-- for (i = 0; i < ch->cfg.num_cfg; ++i) {
-- const struct fb_videomode *mode = &ch->cfg.lcd_cfg[i];
-+ for (i = 0; i < ch->cfg.num_modes; ++i) {
-+ const struct fb_videomode *mode = &ch->cfg.lcd_modes[i];
- unsigned int dist;
-
- /* We can only round up. */
-@@ -1211,7 +1211,7 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- }
-
- /* If no available mode can be used, return an error. */
-- if (ch->cfg.num_cfg != 0) {
-+ if (ch->cfg.num_modes != 0) {
- if (best_dist == (unsigned int)-1)
- return -EINVAL;
-
-@@ -1671,7 +1671,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- struct fb_var_screeninfo *var;
- struct fb_info *info;
- unsigned int max_size;
-- int num_cfg;
-+ int num_modes;
- void *buf;
- int ret;
- int i;
-@@ -1698,7 +1698,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- max_mode = NULL;
- max_size = 0;
-
-- for (i = 0, mode = cfg->lcd_cfg; i < cfg->num_cfg; i++, mode++) {
-+ for (i = 0, mode = cfg->lcd_modes; i < cfg->num_modes; i++, mode++) {
- unsigned int size = mode->yres * mode->xres;
-
- /* NV12/NV21 buffers must have even number of lines */
-@@ -1722,15 +1722,15 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- max_mode->xres, max_mode->yres);
-
- /* Create the mode list. */
-- if (cfg->lcd_cfg == NULL) {
-+ if (cfg->lcd_modes == NULL) {
- mode = &default_720p;
-- num_cfg = 1;
-+ num_modes = 1;
- } else {
-- mode = cfg->lcd_cfg;
-- num_cfg = cfg->num_cfg;
-+ mode = cfg->lcd_modes;
-+ num_modes = cfg->num_modes;
- }
-
-- fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
-+ fb_videomode_to_modelist(mode, num_modes, &info->modelist);
-
- /* Initialize the transmitter device if present. */
- if (cfg->tx_dev) {
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 4f0fb55..484b0a2 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -173,8 +173,8 @@ struct sh_mobile_lcdc_chan_cfg {
- int interface_type; /* selects RGBn or SYSn I/F, see above */
- int clock_divider;
- unsigned long flags; /* LCDC_FLAGS_... */
-- const struct fb_videomode *lcd_cfg;
-- int num_cfg;
-+ const struct fb_videomode *lcd_modes;
-+ int num_modes;
- struct sh_mobile_lcdc_panel_cfg panel_cfg;
- struct sh_mobile_lcdc_bl_info bl_info;
- struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0175-fbdev-sh_mobile_lcdc-Reorganize-the-sh_mobile_lcdc_c.patch b/patches.armadillo800eva/0175-fbdev-sh_mobile_lcdc-Reorganize-the-sh_mobile_lcdc_c.patch
deleted file mode 100644
index ad3553973518a5..00000000000000
--- a/patches.armadillo800eva/0175-fbdev-sh_mobile_lcdc-Reorganize-the-sh_mobile_lcdc_c.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 3de9bc5c7d9d70a6a8323124f157fbc6ed456229 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 14:03:17 +0100
-Subject: fbdev: sh_mobile_lcdc: Reorganize the sh_mobile_lcdc_chan structure
-
-Group fields by purpose, and make the separation between core fields and
-FB-related fields clear.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 740f802af2d8c46f1423b6b3daa33e4e1ea223f0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.h | 39 ++++++++++++++++++++++----------------
- 1 file changed, 23 insertions(+), 16 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index c175387..8e0d009 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -53,30 +53,22 @@ struct sh_mobile_lcdc_entity {
- struct sh_mobile_lcdc_chan {
- struct sh_mobile_lcdc_priv *lcdc;
- struct sh_mobile_lcdc_entity *tx_dev;
-+ struct sh_mobile_lcdc_chan_cfg cfg;
-
- unsigned long *reg_offs;
- unsigned long ldmt1r_value;
- unsigned long enabled; /* ME and SE in LDCNT2R */
-- struct sh_mobile_lcdc_chan_cfg cfg;
-- u32 pseudo_palette[PALETTE_NR];
-- struct fb_info *info;
-- struct backlight_device *bl;
-+ int meram_enabled;
-+
-+ struct mutex open_lock; /* protects the use counter */
-+ int use_count;
-+
- dma_addr_t dma_handle;
-- struct fb_deferred_io defio;
-- struct scatterlist *sglist;
-- unsigned long frame_end;
- unsigned long pan_offset;
-+
-+ unsigned long frame_end;
- wait_queue_head_t frame_end_wait;
- struct completion vsync_completion;
-- struct {
-- unsigned int width;
-- unsigned int height;
-- struct fb_videomode mode;
-- } display;
-- int use_count;
-- int blank_status;
-- struct mutex open_lock; /* protects the use counter */
-- int meram_enabled;
-
- unsigned long base_addr_y;
- unsigned long base_addr_c;
-@@ -86,6 +78,21 @@ struct sh_mobile_lcdc_chan {
- enum sh_mobile_lcdc_entity_event event,
- const struct fb_videomode *mode,
- const struct fb_monspecs *monspec);
-+
-+ /* Backlight */
-+ struct backlight_device *bl;
-+
-+ /* FB */
-+ struct fb_info *info;
-+ u32 pseudo_palette[PALETTE_NR];
-+ struct {
-+ unsigned int width;
-+ unsigned int height;
-+ struct fb_videomode mode;
-+ } display;
-+ struct fb_deferred_io defio;
-+ struct scatterlist *sglist;
-+ int blank_status;
- };
-
- #endif
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0176-fbdev-sh_mobile_lcdc-Add-sh_mobile_format_info-funct.patch b/patches.armadillo800eva/0176-fbdev-sh_mobile_lcdc-Add-sh_mobile_format_info-funct.patch
deleted file mode 100644
index eedf6662e72412..00000000000000
--- a/patches.armadillo800eva/0176-fbdev-sh_mobile_lcdc-Add-sh_mobile_format_info-funct.patch
+++ /dev/null
@@ -1,277 +0,0 @@
-From cd6aeedfd01cbbc25b865687153f22419b922b31 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 15:58:10 +0100
-Subject: fbdev: sh_mobile_lcdc: Add sh_mobile_format_info() function
-
-The function returns a pointer to a structure describing a format based
-on its fourcc. Use the function where applicable instead of hardcoded
-switch-case statements.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 105784bbb47cd76f0fc32954b047a13b704fa840)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 174 ++++++++++++++++++++++----------------
- 1 file changed, 102 insertions(+), 72 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index ab7b179..c66f0f4 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -449,6 +449,75 @@ static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
- * Format helpers
- */
-
-+struct sh_mobile_lcdc_format_info {
-+ u32 fourcc;
-+ unsigned int bpp;
-+ bool yuv;
-+ u32 lddfr;
-+};
-+
-+static const struct sh_mobile_lcdc_format_info sh_mobile_format_infos[] = {
-+ {
-+ .fourcc = V4L2_PIX_FMT_RGB565,
-+ .bpp = 16,
-+ .yuv = false,
-+ .lddfr = LDDFR_PKF_RGB16,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_BGR24,
-+ .bpp = 24,
-+ .yuv = false,
-+ .lddfr = LDDFR_PKF_RGB24,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_BGR32,
-+ .bpp = 32,
-+ .yuv = false,
-+ .lddfr = LDDFR_PKF_ARGB32,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV12,
-+ .bpp = 12,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_420,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV21,
-+ .bpp = 12,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_420,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV16,
-+ .bpp = 16,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_422,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV61,
-+ .bpp = 16,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_422,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV24,
-+ .bpp = 24,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_444,
-+ }, {
-+ .fourcc = V4L2_PIX_FMT_NV42,
-+ .bpp = 24,
-+ .yuv = true,
-+ .lddfr = LDDFR_CC | LDDFR_YF_444,
-+ },
-+};
-+
-+static const struct sh_mobile_lcdc_format_info *
-+sh_mobile_format_info(u32 fourcc)
-+{
-+ unsigned int i;
-+
-+ for (i = 0; i < ARRAY_SIZE(sh_mobile_format_infos); ++i) {
-+ if (sh_mobile_format_infos[i].fourcc == fourcc)
-+ return &sh_mobile_format_infos[i];
-+ }
-+
-+ return NULL;
-+}
-+
- static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
- {
- if (var->grayscale > 1)
-@@ -473,21 +542,13 @@ static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
-
- static bool sh_mobile_format_is_yuv(const struct fb_var_screeninfo *var)
- {
-+ const struct sh_mobile_lcdc_format_info *format;
-+
- if (var->grayscale <= 1)
- return false;
-
-- switch (var->grayscale) {
-- case V4L2_PIX_FMT_NV12:
-- case V4L2_PIX_FMT_NV21:
-- case V4L2_PIX_FMT_NV16:
-- case V4L2_PIX_FMT_NV61:
-- case V4L2_PIX_FMT_NV24:
-- case V4L2_PIX_FMT_NV42:
-- return true;
--
-- default:
-- return false;
-- }
-+ format = sh_mobile_format_info(var->grayscale);
-+ return format ? format->yuv : false;
- }
-
- /* -----------------------------------------------------------------------------
-@@ -667,37 +728,20 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- /* Setup geometry, format, frame buffer memory and operation mode. */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-+ const struct sh_mobile_lcdc_format_info *format;
-+ u32 fourcc;
-+
- ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
- sh_mobile_lcdc_geometry(ch);
-
-- switch (sh_mobile_format_fourcc(&ch->info->var)) {
-- case V4L2_PIX_FMT_RGB565:
-- tmp = LDDFR_PKF_RGB16;
-- break;
-- case V4L2_PIX_FMT_BGR24:
-- tmp = LDDFR_PKF_RGB24;
-- break;
-- case V4L2_PIX_FMT_BGR32:
-- tmp = LDDFR_PKF_ARGB32;
-- break;
-- case V4L2_PIX_FMT_NV12:
-- case V4L2_PIX_FMT_NV21:
-- tmp = LDDFR_CC | LDDFR_YF_420;
-- break;
-- case V4L2_PIX_FMT_NV16:
-- case V4L2_PIX_FMT_NV61:
-- tmp = LDDFR_CC | LDDFR_YF_422;
-- break;
-- case V4L2_PIX_FMT_NV24:
-- case V4L2_PIX_FMT_NV42:
-- tmp = LDDFR_CC | LDDFR_YF_444;
-- break;
-- }
-+ fourcc = sh_mobile_format_fourcc(&ch->info->var);
-+ format = sh_mobile_format_info(fourcc);
-+ tmp = format->lddfr;
-
-- if (sh_mobile_format_is_yuv(&ch->info->var)) {
-+ if (format->yuv) {
- switch (ch->info->var.colorspace) {
- case V4L2_COLORSPACE_REC709:
- tmp |= LDDFR_CF1;
-@@ -711,7 +755,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_write_chan(ch, LDDFR, tmp);
- lcdc_write_chan(ch, LDMLSR, ch->pitch);
- lcdc_write_chan(ch, LDSA1R, ch->base_addr_y);
-- if (sh_mobile_format_is_yuv(&ch->info->var))
-+ if (format->yuv)
- lcdc_write_chan(ch, LDSA2R, ch->base_addr_c);
-
- /* When using deferred I/O mode, configure the LCDC for one-shot
-@@ -1228,32 +1272,17 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- var->yres_virtual = var->yres;
-
- if (sh_mobile_format_is_fourcc(var)) {
-- switch (var->grayscale) {
-- case V4L2_PIX_FMT_NV12:
-- case V4L2_PIX_FMT_NV21:
-- var->bits_per_pixel = 12;
-- break;
-- case V4L2_PIX_FMT_RGB565:
-- case V4L2_PIX_FMT_NV16:
-- case V4L2_PIX_FMT_NV61:
-- var->bits_per_pixel = 16;
-- break;
-- case V4L2_PIX_FMT_BGR24:
-- case V4L2_PIX_FMT_NV24:
-- case V4L2_PIX_FMT_NV42:
-- var->bits_per_pixel = 24;
-- break;
-- case V4L2_PIX_FMT_BGR32:
-- var->bits_per_pixel = 32;
-- break;
-- default:
-+ const struct sh_mobile_lcdc_format_info *format;
-+
-+ format = sh_mobile_format_info(var->grayscale);
-+ if (format == NULL)
- return -EINVAL;
-- }
-+ var->bits_per_pixel = format->bpp;
-
- /* Default to RGB and JPEG color-spaces for RGB and YUV formats
- * respectively.
- */
-- if (!sh_mobile_format_is_yuv(var))
-+ if (!format->yuv)
- var->colorspace = V4L2_COLORSPACE_SRGB;
- else if (var->colorspace != V4L2_COLORSPACE_REC709)
- var->colorspace = V4L2_COLORSPACE_JPEG;
-@@ -1665,6 +1694,7 @@ static int __devinit
- sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- struct sh_mobile_lcdc_chan *ch)
- {
-+ const struct sh_mobile_lcdc_format_info *format;
- struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
- const struct fb_videomode *max_mode;
- const struct fb_videomode *mode;
-@@ -1679,6 +1709,13 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- mutex_init(&ch->open_lock);
- ch->notify = sh_mobile_lcdc_display_notify;
-
-+ /* Validate the format. */
-+ format = sh_mobile_format_info(cfg->fourcc);
-+ if (format == NULL) {
-+ dev_err(priv->dev, "Invalid FOURCC %08x.\n", cfg->fourcc);
-+ return -EINVAL;
-+ }
-+
- /* Allocate the frame buffer device. */
- ch->info = framebuffer_alloc(0, priv->dev);
- if (!ch->info) {
-@@ -1756,20 +1793,13 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- var->yres_virtual = var->yres * 2;
- var->activate = FB_ACTIVATE_NOW;
-
-- switch (cfg->fourcc) {
-- case V4L2_PIX_FMT_RGB565:
-- var->bits_per_pixel = 16;
-- break;
-- case V4L2_PIX_FMT_BGR24:
-- var->bits_per_pixel = 24;
-- break;
-- case V4L2_PIX_FMT_BGR32:
-- var->bits_per_pixel = 32;
-- break;
-- default:
-+ /* Use the legacy API by default for RGB formats, and the FOURCC API
-+ * for YUV formats.
-+ */
-+ if (!format->yuv)
-+ var->bits_per_pixel = format->bpp;
-+ else
- var->grayscale = cfg->fourcc;
-- break;
-- }
-
- /* Make sure the memory size check won't fail. smem_len is initialized
- * later based on var.
-@@ -1806,7 +1836,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- cfg->fourcc == V4L2_PIX_FMT_NV21)
- info->fix.ypanstep = 2;
-
-- if (sh_mobile_format_is_yuv(var)) {
-+ if (format->yuv) {
- info->fix.line_length = var->xres;
- info->fix.visual = FB_VISUAL_FOURCC;
- } else {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0177-fbdev-sh_mobile_lcdc-Store-the-format-in-struct-sh_m.patch b/patches.armadillo800eva/0177-fbdev-sh_mobile_lcdc-Store-the-format-in-struct-sh_m.patch
deleted file mode 100644
index b8815c65da0c9b..00000000000000
--- a/patches.armadillo800eva/0177-fbdev-sh_mobile_lcdc-Store-the-format-in-struct-sh_m.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From 71f3e40042bbd466f829cae0a6388f82a989f71b Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 16:05:36 +0100
-Subject: fbdev: sh_mobile_lcdc: Store the format in struct
- sh_mobile_lcdc_chan
-
-Store the active format in the channel structure, and use it instead of
-parsing info->var all over the place when the format is needed.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit fc9e78e6b3d2ba2e96426527b8231f6b7c7b7b96)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 21 ++++++++++-----------
- drivers/video/sh_mobile_lcdcfb.h | 4 +++-
- 2 files changed, 13 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index c66f0f4..6d8c30b 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -728,20 +728,15 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- /* Setup geometry, format, frame buffer memory and operation mode. */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- const struct sh_mobile_lcdc_format_info *format;
-- u32 fourcc;
--
- ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
- sh_mobile_lcdc_geometry(ch);
-
-- fourcc = sh_mobile_format_fourcc(&ch->info->var);
-- format = sh_mobile_format_info(fourcc);
-- tmp = format->lddfr;
-+ tmp = ch->format->lddfr;
-
-- if (format->yuv) {
-+ if (ch->format->yuv) {
- switch (ch->info->var.colorspace) {
- case V4L2_COLORSPACE_REC709:
- tmp |= LDDFR_CF1;
-@@ -755,7 +750,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_write_chan(ch, LDDFR, tmp);
- lcdc_write_chan(ch, LDMLSR, ch->pitch);
- lcdc_write_chan(ch, LDSA1R, ch->base_addr_y);
-- if (format->yuv)
-+ if (ch->format->yuv)
- lcdc_write_chan(ch, LDSA2R, ch->base_addr_c);
-
- /* When using deferred I/O mode, configure the LCDC for one-shot
-@@ -772,7 +767,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- /* Word and long word swap. */
-- switch (sh_mobile_format_fourcc(&priv->ch[0].info->var)) {
-+ switch (priv->ch[0].format->fourcc) {
- case V4L2_PIX_FMT_RGB565:
- case V4L2_PIX_FMT_NV21:
- case V4L2_PIX_FMT_NV61:
-@@ -859,7 +854,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- ch->meram_enabled = 0;
- }
-
-- switch (sh_mobile_format_fourcc(&ch->info->var)) {
-+ switch (ch->format->fourcc) {
- case V4L2_PIX_FMT_NV12:
- case V4L2_PIX_FMT_NV21:
- case V4L2_PIX_FMT_NV16:
-@@ -1065,7 +1060,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- + info->var.xres * info->var.yres_virtual
- + c_offset;
- /* Set x offset */
-- if (sh_mobile_format_fourcc(&info->var) == V4L2_PIX_FMT_NV24)
-+ if (ch->format->fourcc == V4L2_PIX_FMT_NV24)
- base_addr_c += 2 * var->xoffset;
- else
- base_addr_c += var->xoffset;
-@@ -1353,6 +1348,8 @@ static int sh_mobile_set_par(struct fb_info *info)
- info->fix.line_length = info->var.xres
- * info->var.bits_per_pixel / 8;
-
-+ ch->format = sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
-+
- ret = sh_mobile_lcdc_start(ch->lcdc);
- if (ret < 0) {
- dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
-@@ -1716,6 +1713,8 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- return -EINVAL;
- }
-
-+ ch->format = format;
-+
- /* Allocate the frame buffer device. */
- ch->info = framebuffer_alloc(0, priv->dev);
- if (!ch->info) {
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 8e0d009..5ef7559 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -17,9 +17,10 @@ enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R,
- struct backlight_device;
- struct fb_info;
- struct module;
-+struct sh_mobile_lcdc_chan;
- struct sh_mobile_lcdc_entity;
-+struct sh_mobile_lcdc_format_info;
- struct sh_mobile_lcdc_priv;
--struct sh_mobile_lcdc_chan;
-
- #define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
- #define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
-@@ -70,6 +71,7 @@ struct sh_mobile_lcdc_chan {
- wait_queue_head_t frame_end_wait;
- struct completion vsync_completion;
-
-+ const struct sh_mobile_lcdc_format_info *format;
- unsigned long base_addr_y;
- unsigned long base_addr_c;
- unsigned int pitch;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0178-fbdev-sh_mobile_lcdc-Split-fb-init-cleanup-from-chan.patch b/patches.armadillo800eva/0178-fbdev-sh_mobile_lcdc-Split-fb-init-cleanup-from-chan.patch
deleted file mode 100644
index 50e33b7b7a305a..00000000000000
--- a/patches.armadillo800eva/0178-fbdev-sh_mobile_lcdc-Split-fb-init-cleanup-from-chan.patch
+++ /dev/null
@@ -1,396 +0,0 @@
-From 218c715b5e86e0b3fa6b5b52475c103db4cc1422 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 14:37:35 +0100
-Subject: fbdev: sh_mobile_lcdc: Split fb init/cleanup from channel
- init/cleanup
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit a67f379d3648746be0dab7b616f2fb838ec0fdfb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 285 +++++++++++++++++++++-----------------
- drivers/video/sh_mobile_lcdcfb.h | 2 +
- 2 files changed, 159 insertions(+), 128 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 6d8c30b..1f8dd83 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1427,6 +1427,141 @@ static struct fb_ops sh_mobile_lcdc_ops = {
- .fb_set_par = sh_mobile_set_par,
- };
-
-+static void
-+sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
-+{
-+ if (ch->info && ch->info->dev)
-+ unregister_framebuffer(ch->info);
-+}
-+
-+static int __devinit
-+sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
-+{
-+ struct fb_info *info = ch->info;
-+ int ret;
-+
-+ if (info->fbdefio) {
-+ ch->sglist = vmalloc(sizeof(struct scatterlist) *
-+ ch->fb_size >> PAGE_SHIFT);
-+ if (!ch->sglist) {
-+ dev_err(ch->lcdc->dev, "cannot allocate sglist\n");
-+ return -ENOMEM;
-+ }
-+ }
-+
-+ info->bl_dev = ch->bl;
-+
-+ ret = register_framebuffer(info);
-+ if (ret < 0)
-+ return ret;
-+
-+ dev_info(ch->lcdc->dev, "registered %s/%s as %dx%d %dbpp.\n",
-+ dev_name(ch->lcdc->dev), (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
-+ "mainlcd" : "sublcd", info->var.xres, info->var.yres,
-+ info->var.bits_per_pixel);
-+
-+ /* deferred io mode: disable clock to save power */
-+ if (info->fbdefio || info->state == FBINFO_STATE_SUSPENDED)
-+ sh_mobile_lcdc_clk_off(ch->lcdc);
-+
-+ return ret;
-+}
-+
-+static void
-+sh_mobile_lcdc_channel_fb_cleanup(struct sh_mobile_lcdc_chan *ch)
-+{
-+ struct fb_info *info = ch->info;
-+
-+ if (!info || !info->device)
-+ return;
-+
-+ if (ch->sglist)
-+ vfree(ch->sglist);
-+
-+ fb_dealloc_cmap(&info->cmap);
-+ framebuffer_release(info);
-+}
-+
-+static int __devinit
-+sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
-+ const struct fb_videomode *mode,
-+ unsigned int num_modes)
-+{
-+ struct sh_mobile_lcdc_priv *priv = ch->lcdc;
-+ struct fb_var_screeninfo *var;
-+ struct fb_info *info;
-+ int ret;
-+
-+ /* Allocate and initialize the frame buffer device. Create the modes
-+ * list and allocate the color map.
-+ */
-+ info = framebuffer_alloc(0, priv->dev);
-+ if (info == NULL) {
-+ dev_err(priv->dev, "unable to allocate fb_info\n");
-+ return -ENOMEM;
-+ }
-+
-+ ch->info = info;
-+
-+ info->flags = FBINFO_FLAG_DEFAULT;
-+ info->fbops = &sh_mobile_lcdc_ops;
-+ info->device = priv->dev;
-+ info->screen_base = ch->fb_mem;
-+ info->pseudo_palette = &ch->pseudo_palette;
-+ info->par = ch;
-+
-+ fb_videomode_to_modelist(mode, num_modes, &info->modelist);
-+
-+ ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
-+ if (ret < 0) {
-+ dev_err(priv->dev, "unable to allocate cmap\n");
-+ return ret;
-+ }
-+
-+ /* Initialize fixed screen information. Restrict pan to 2 lines steps
-+ * for NV12 and NV21.
-+ */
-+ info->fix = sh_mobile_lcdc_fix;
-+ info->fix.smem_start = ch->dma_handle;
-+ info->fix.smem_len = ch->fb_size;
-+ if (ch->format->fourcc == V4L2_PIX_FMT_NV12 ||
-+ ch->format->fourcc == V4L2_PIX_FMT_NV21)
-+ info->fix.ypanstep = 2;
-+
-+ /* Initialize variable screen information using the first mode as
-+ * default. The default Y virtual resolution is twice the panel size to
-+ * allow for double-buffering.
-+ */
-+ var = &info->var;
-+ fb_videomode_to_var(var, mode);
-+ var->width = ch->cfg.panel_cfg.width;
-+ var->height = ch->cfg.panel_cfg.height;
-+ var->yres_virtual = var->yres * 2;
-+ var->activate = FB_ACTIVATE_NOW;
-+
-+ /* Use the legacy API by default for RGB formats, and the FOURCC API
-+ * for YUV formats.
-+ */
-+ if (!ch->format->yuv)
-+ var->bits_per_pixel = ch->format->bpp;
-+ else
-+ var->grayscale = ch->format->fourcc;
-+
-+ ret = sh_mobile_check_var(var, info);
-+ if (ret)
-+ return ret;
-+
-+ if (ch->format->yuv) {
-+ info->fix.line_length = var->xres;
-+ info->fix.visual = FB_VISUAL_FOURCC;
-+ } else {
-+ info->fix.line_length = var->xres * ch->format->bpp / 8;
-+ info->fix.visual = FB_VISUAL_TRUECOLOR;
-+ }
-+
-+ return 0;
-+}
-+
- /* -----------------------------------------------------------------------------
- * Backlight
- */
-@@ -1595,37 +1730,28 @@ static const struct fb_videomode default_720p __devinitconst = {
- static int sh_mobile_lcdc_remove(struct platform_device *pdev)
- {
- struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
-- struct fb_info *info;
- int i;
-
- fb_unregister_client(&priv->notifier);
-
- for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
-- if (priv->ch[i].info && priv->ch[i].info->dev)
-- unregister_framebuffer(priv->ch[i].info);
-+ sh_mobile_lcdc_channel_fb_unregister(&priv->ch[i]);
-
- sh_mobile_lcdc_stop(priv);
-
- for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
- struct sh_mobile_lcdc_chan *ch = &priv->ch[i];
-
-- info = ch->info;
-- if (!info || !info->device)
-- continue;
--
- if (ch->tx_dev) {
- ch->tx_dev->lcdc = NULL;
- module_put(ch->cfg.tx_dev->dev.driver->owner);
- }
-
-- if (ch->sglist)
-- vfree(ch->sglist);
-+ sh_mobile_lcdc_channel_fb_cleanup(ch);
-
-- if (info->screen_base)
-- dma_free_coherent(&pdev->dev, info->fix.smem_len,
-- info->screen_base, ch->dma_handle);
-- fb_dealloc_cmap(&info->cmap);
-- framebuffer_release(info);
-+ if (ch->fb_mem)
-+ dma_free_coherent(&pdev->dev, ch->fb_size,
-+ ch->fb_mem, ch->dma_handle);
- }
-
- for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
-@@ -1695,13 +1821,9 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
- const struct fb_videomode *max_mode;
- const struct fb_videomode *mode;
-- struct fb_var_screeninfo *var;
-- struct fb_info *info;
-+ unsigned int num_modes;
- unsigned int max_size;
-- int num_modes;
-- void *buf;
-- int ret;
-- int i;
-+ unsigned int i;
-
- mutex_init(&ch->open_lock);
- ch->notify = sh_mobile_lcdc_display_notify;
-@@ -1715,19 +1837,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
-
- ch->format = format;
-
-- /* Allocate the frame buffer device. */
-- ch->info = framebuffer_alloc(0, priv->dev);
-- if (!ch->info) {
-- dev_err(priv->dev, "unable to allocate fb_info\n");
-- return -ENOMEM;
-- }
--
-- info = ch->info;
-- info->fbops = &sh_mobile_lcdc_ops;
-- info->par = ch;
-- info->pseudo_palette = &ch->pseudo_palette;
-- info->flags = FBINFO_FLAG_DEFAULT;
--
- /* Iterate through the modes to validate them and find the highest
- * resolution.
- */
-@@ -1757,7 +1866,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- dev_dbg(priv->dev, "Found largest videomode %ux%u\n",
- max_mode->xres, max_mode->yres);
-
-- /* Create the mode list. */
- if (cfg->lcd_modes == NULL) {
- mode = &default_720p;
- num_modes = 1;
-@@ -1766,7 +1874,18 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- num_modes = cfg->num_modes;
- }
-
-- fb_videomode_to_modelist(mode, num_modes, &info->modelist);
-+ ch->display.width = cfg->panel_cfg.width;
-+ ch->display.height = cfg->panel_cfg.height;
-+ ch->display.mode = *mode;
-+
-+ /* Allocate frame buffer memory. */
-+ ch->fb_size = max_size * format->bpp / 8 * 2;
-+ ch->fb_mem = dma_alloc_coherent(priv->dev, ch->fb_size, &ch->dma_handle,
-+ GFP_KERNEL);
-+ if (ch->fb_mem == NULL) {
-+ dev_err(priv->dev, "unable to allocate buffer\n");
-+ return -ENOMEM;
-+ }
-
- /* Initialize the transmitter device if present. */
- if (cfg->tx_dev) {
-@@ -1781,76 +1900,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- ch->tx_dev->def_mode = *mode;
- }
-
-- /* Initialize variable screen information using the first mode as
-- * default. The default Y virtual resolution is twice the panel size to
-- * allow for double-buffering.
-- */
-- var = &info->var;
-- fb_videomode_to_var(var, mode);
-- var->width = cfg->panel_cfg.width;
-- var->height = cfg->panel_cfg.height;
-- var->yres_virtual = var->yres * 2;
-- var->activate = FB_ACTIVATE_NOW;
--
-- /* Use the legacy API by default for RGB formats, and the FOURCC API
-- * for YUV formats.
-- */
-- if (!format->yuv)
-- var->bits_per_pixel = format->bpp;
-- else
-- var->grayscale = cfg->fourcc;
--
-- /* Make sure the memory size check won't fail. smem_len is initialized
-- * later based on var.
-- */
-- info->fix.smem_len = UINT_MAX;
-- ret = sh_mobile_check_var(var, info);
-- if (ret)
-- return ret;
--
-- max_size = max_size * var->bits_per_pixel / 8 * 2;
--
-- /* Allocate frame buffer memory and color map. */
-- buf = dma_alloc_coherent(priv->dev, max_size, &ch->dma_handle,
-- GFP_KERNEL);
-- if (!buf) {
-- dev_err(priv->dev, "unable to allocate buffer\n");
-- return -ENOMEM;
-- }
--
-- ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
-- if (ret < 0) {
-- dev_err(priv->dev, "unable to allocate cmap\n");
-- dma_free_coherent(priv->dev, max_size, buf, ch->dma_handle);
-- return ret;
-- }
--
-- /* Initialize fixed screen information. Restrict pan to 2 lines steps
-- * for NV12 and NV21.
-- */
-- info->fix = sh_mobile_lcdc_fix;
-- info->fix.smem_start = ch->dma_handle;
-- info->fix.smem_len = max_size;
-- if (cfg->fourcc == V4L2_PIX_FMT_NV12 ||
-- cfg->fourcc == V4L2_PIX_FMT_NV21)
-- info->fix.ypanstep = 2;
--
-- if (format->yuv) {
-- info->fix.line_length = var->xres;
-- info->fix.visual = FB_VISUAL_FOURCC;
-- } else {
-- info->fix.line_length = var->xres * var->bits_per_pixel / 8;
-- info->fix.visual = FB_VISUAL_TRUECOLOR;
-- }
--
-- info->screen_base = buf;
-- info->device = priv->dev;
--
-- ch->display.width = cfg->panel_cfg.width;
-- ch->display.height = cfg->panel_cfg.height;
-- ch->display.mode = *mode;
--
-- return 0;
-+ return sh_mobile_lcdc_channel_fb_init(ch, mode, num_modes);
- }
-
- static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-@@ -1966,31 +2016,10 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
-
- for (i = 0; i < num_channels; i++) {
- struct sh_mobile_lcdc_chan *ch = priv->ch + i;
-- struct fb_info *info = ch->info;
--
-- if (info->fbdefio) {
-- ch->sglist = vmalloc(sizeof(struct scatterlist) *
-- info->fix.smem_len >> PAGE_SHIFT);
-- if (!ch->sglist) {
-- dev_err(&pdev->dev, "cannot allocate sglist\n");
-- goto err1;
-- }
-- }
-
-- info->bl_dev = ch->bl;
--
-- error = register_framebuffer(info);
-- if (error < 0)
-+ error = sh_mobile_lcdc_channel_fb_register(ch);
-+ if (error)
- goto err1;
--
-- dev_info(&pdev->dev, "registered %s/%s as %dx%d %dbpp.\n",
-- pdev->name, (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
-- "mainlcd" : "sublcd", info->var.xres, info->var.yres,
-- info->var.bits_per_pixel);
--
-- /* deferred io mode: disable clock to save power */
-- if (info->fbdefio || info->state == FBINFO_STATE_SUSPENDED)
-- sh_mobile_lcdc_clk_off(priv);
- }
-
- /* Failure ignored */
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 5ef7559..cc22b9e 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -64,6 +64,8 @@ struct sh_mobile_lcdc_chan {
- struct mutex open_lock; /* protects the use counter */
- int use_count;
-
-+ void *fb_mem;
-+ unsigned long fb_size;
- dma_addr_t dma_handle;
- unsigned long pan_offset;
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0179-fbdev-sh_mobile_lcdc-Pass-physical-device-pointer-to.patch b/patches.armadillo800eva/0179-fbdev-sh_mobile_lcdc-Pass-physical-device-pointer-to.patch
deleted file mode 100644
index db0c9f199f34ed..00000000000000
--- a/patches.armadillo800eva/0179-fbdev-sh_mobile_lcdc-Pass-physical-device-pointer-to.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 856a88bd9aaccdbce8d98adf7b85bd58422cc86d Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 29 Nov 2011 14:37:35 +0100
-Subject: fbdev: sh_mobile_lcdc: Pass physical device pointer to DMA functions
-
-The dma_map_sg() and dma_unmap_sg() functions need a pointer to the
-physical device.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit e8363140c02c92c122210e03103aef72dd836664)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 1f8dd83..fc12e37 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -313,11 +313,12 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
- unsigned int nr_pages = sh_mobile_lcdc_sginit(info, pagelist);
-
- /* trigger panel update */
-- dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
-+ dma_map_sg(ch->lcdc->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
- if (panel->start_transfer)
- panel->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
- lcdc_write_chan(ch, LDSM2R, LDSM2R_OSTRG);
-- dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
-+ dma_unmap_sg(ch->lcdc->dev, ch->sglist, nr_pages,
-+ DMA_TO_DEVICE);
- } else {
- if (panel->start_transfer)
- panel->start_transfer(ch, &sh_mobile_lcdc_sys_bus_ops);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0180-fbdev-sh_mobile_lcdc-Store-configuration-in-channel-.patch b/patches.armadillo800eva/0180-fbdev-sh_mobile_lcdc-Store-configuration-in-channel-.patch
deleted file mode 100644
index 15e721bb1cd16c..00000000000000
--- a/patches.armadillo800eva/0180-fbdev-sh_mobile_lcdc-Store-configuration-in-channel-.patch
+++ /dev/null
@@ -1,278 +0,0 @@
-From 7d659e1a7850c113bb68b5f49600d2682ab5be26 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 30 Nov 2011 23:07:30 +0100
-Subject: fbdev: sh_mobile_lcdc: Store configuration in channel structure
-
-Store the frame buffer configuration (colorspace, visible/virtual
-horizontal and vertical resolutions and line pitch) in the
-sh_mobile_lcdc_chan structure, and use it instead of accessing fb_info.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 58f03d998de08bb15ce50ad875e41bdc281d77dd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 109 +++++++++++++++++++-------------------
- drivers/video/sh_mobile_lcdcfb.h | 8 ++-
- 2 files changed, 61 insertions(+), 56 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index fc12e37..6d377b4 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -273,7 +273,7 @@ static int sh_mobile_lcdc_sginit(struct fb_info *info,
- struct list_head *pagelist)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-- unsigned int nr_pages_max = info->fix.smem_len >> PAGE_SHIFT;
-+ unsigned int nr_pages_max = ch->fb_size >> PAGE_SHIFT;
- struct page *page;
- int nr_pages = 0;
-
-@@ -541,17 +541,6 @@ static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
- return var->grayscale > 1;
- }
-
--static bool sh_mobile_format_is_yuv(const struct fb_var_screeninfo *var)
--{
-- const struct sh_mobile_lcdc_format_info *format;
--
-- if (var->grayscale <= 1)
-- return false;
--
-- format = sh_mobile_format_info(var->grayscale);
-- return format ? format->yuv : false;
--}
--
- /* -----------------------------------------------------------------------------
- * Start, stop and IRQ
- */
-@@ -650,7 +639,7 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- h_total = mode->xres + mode->hsync_len + mode->left_margin
- + mode->right_margin;
- tmp = h_total / 8; /* HTCN */
-- tmp |= (min(mode->xres, var->xres) / 8) << 16; /* HDCN */
-+ tmp |= (min(mode->xres, ch->xres) / 8) << 16; /* HDCN */
- lcdc_write_chan(ch, LDHCNR, tmp);
-
- hsync_pos = mode->xres + mode->right_margin;
-@@ -661,7 +650,7 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- /* vertical configuration */
- tmp = mode->yres + mode->vsync_len + mode->upper_margin
- + mode->lower_margin; /* VTLN */
-- tmp |= min(mode->yres, var->yres) << 16; /* VDLN */
-+ tmp |= min(mode->yres, ch->yres) << 16; /* VDLN */
- lcdc_write_chan(ch, LDVLNR, tmp);
-
- tmp = mode->yres + mode->lower_margin; /* VSYNP */
-@@ -738,7 +727,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- tmp = ch->format->lddfr;
-
- if (ch->format->yuv) {
-- switch (ch->info->var.colorspace) {
-+ switch (ch->colorspace) {
- case V4L2_COLORSPACE_REC709:
- tmp |= LDDFR_CF1;
- break;
-@@ -836,11 +825,8 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- if (!ch->enabled)
- continue;
-
-- ch->base_addr_y = ch->info->fix.smem_start;
-- ch->base_addr_c = ch->base_addr_y
-- + ch->info->var.xres
-- * ch->info->var.yres_virtual;
-- ch->pitch = ch->info->fix.line_length;
-+ ch->base_addr_y = ch->dma_handle;
-+ ch->base_addr_c = ch->base_addr_y + ch->xres * ch->yres_virtual;
-
- /* Enable MERAM if possible. */
- cfg = ch->cfg.meram_cfg;
-@@ -875,7 +861,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- }
-
- ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
-- ch->info->var.yres, pixelformat,
-+ ch->yres, pixelformat,
- ch->base_addr_y, ch->base_addr_c,
- &ch->base_addr_y, &ch->base_addr_c,
- &ch->pitch);
-@@ -1037,14 +1023,12 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- unsigned long new_pan_offset;
- unsigned long base_addr_y, base_addr_c;
- unsigned long c_offset;
-- bool yuv = sh_mobile_format_is_yuv(&info->var);
-
-- if (!yuv)
-- new_pan_offset = var->yoffset * info->fix.line_length
-- + var->xoffset * (info->var.bits_per_pixel / 8);
-+ if (!ch->format->yuv)
-+ new_pan_offset = var->yoffset * ch->pitch
-+ + var->xoffset * (ch->format->bpp / 8);
- else
-- new_pan_offset = var->yoffset * info->fix.line_length
-- + var->xoffset;
-+ new_pan_offset = var->yoffset * ch->pitch + var->xoffset;
-
- if (new_pan_offset == ch->pan_offset)
- return 0; /* No change, do nothing */
-@@ -1053,12 +1037,11 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
-
- /* Set the source address for the next refresh */
- base_addr_y = ch->dma_handle + new_pan_offset;
-- if (yuv) {
-+ if (ch->format->yuv) {
- /* Set y offset */
-- c_offset = var->yoffset * info->fix.line_length
-- * (info->var.bits_per_pixel - 8) / 8;
-- base_addr_c = ch->dma_handle
-- + info->var.xres * info->var.yres_virtual
-+ c_offset = var->yoffset * ch->pitch
-+ * (ch->format->bpp - 8) / 8;
-+ base_addr_c = ch->dma_handle + ch->xres * ch->yres_virtual
- + c_offset;
- /* Set x offset */
- if (ch->format->fourcc == V4L2_PIX_FMT_NV24)
-@@ -1085,7 +1068,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- ch->base_addr_c = base_addr_c;
-
- lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
-- if (yuv)
-+ if (ch->format->yuv)
- lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
-
- if (lcdc_chan_is_sublcd(ch))
-@@ -1338,24 +1321,28 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- static int sh_mobile_set_par(struct fb_info *info)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-- u32 line_length = info->fix.line_length;
- int ret;
-
- sh_mobile_lcdc_stop(ch->lcdc);
-
-- if (sh_mobile_format_is_yuv(&info->var))
-- info->fix.line_length = info->var.xres;
-- else
-- info->fix.line_length = info->var.xres
-- * info->var.bits_per_pixel / 8;
--
- ch->format = sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
-+ ch->colorspace = info->var.colorspace;
-+
-+ ch->xres = info->var.xres;
-+ ch->xres_virtual = info->var.xres_virtual;
-+ ch->yres = info->var.yres;
-+ ch->yres_virtual = info->var.yres_virtual;
-+
-+ if (ch->format->yuv)
-+ ch->pitch = info->var.xres;
-+ else
-+ ch->pitch = info->var.xres * ch->format->bpp / 8;
-
- ret = sh_mobile_lcdc_start(ch->lcdc);
-- if (ret < 0) {
-+ if (ret < 0)
- dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
-- info->fix.line_length = line_length;
-- }
-+
-+ info->fix.line_length = ch->pitch;
-
- if (sh_mobile_format_is_fourcc(&info->var)) {
- info->fix.type = FB_TYPE_FOURCC;
-@@ -1384,8 +1371,8 @@ static int sh_mobile_lcdc_blank(int blank, struct fb_info *info)
- /* blank the screen? */
- if (blank > FB_BLANK_UNBLANK && ch->blank_status == FB_BLANK_UNBLANK) {
- struct fb_fillrect rect = {
-- .width = info->var.xres,
-- .height = info->var.yres,
-+ .width = ch->xres,
-+ .height = ch->yres,
- };
- sh_mobile_lcdc_fillrect(info, &rect);
- }
-@@ -1525,6 +1512,13 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
- info->fix = sh_mobile_lcdc_fix;
- info->fix.smem_start = ch->dma_handle;
- info->fix.smem_len = ch->fb_size;
-+ info->fix.line_length = ch->pitch;
-+
-+ if (ch->format->yuv)
-+ info->fix.visual = FB_VISUAL_FOURCC;
-+ else
-+ info->fix.visual = FB_VISUAL_TRUECOLOR;
-+
- if (ch->format->fourcc == V4L2_PIX_FMT_NV12 ||
- ch->format->fourcc == V4L2_PIX_FMT_NV21)
- info->fix.ypanstep = 2;
-@@ -1552,14 +1546,6 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
- if (ret)
- return ret;
-
-- if (ch->format->yuv) {
-- info->fix.line_length = var->xres;
-- info->fix.visual = FB_VISUAL_FOURCC;
-- } else {
-- info->fix.line_length = var->xres * ch->format->bpp / 8;
-- info->fix.visual = FB_VISUAL_TRUECOLOR;
-- }
--
- return 0;
- }
-
-@@ -1836,8 +1822,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- return -EINVAL;
- }
-
-- ch->format = format;
--
- /* Iterate through the modes to validate them and find the highest
- * resolution.
- */
-@@ -1875,6 +1859,21 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- num_modes = cfg->num_modes;
- }
-
-+ /* Use the first mode as default. */
-+ ch->format = format;
-+ ch->xres = mode->xres;
-+ ch->xres_virtual = mode->xres;
-+ ch->yres = mode->yres;
-+ ch->yres_virtual = mode->yres * 2;
-+
-+ if (!format->yuv) {
-+ ch->colorspace = V4L2_COLORSPACE_SRGB;
-+ ch->pitch = ch->xres * format->bpp / 8;
-+ } else {
-+ ch->colorspace = V4L2_COLORSPACE_REC709;
-+ ch->pitch = ch->xres;
-+ }
-+
- ch->display.width = cfg->panel_cfg.width;
- ch->display.height = cfg->panel_cfg.height;
- ch->display.mode = *mode;
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index cc22b9e..19a4cd7 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -74,9 +74,15 @@ struct sh_mobile_lcdc_chan {
- struct completion vsync_completion;
-
- const struct sh_mobile_lcdc_format_info *format;
-+ u32 colorspace;
-+ unsigned int xres;
-+ unsigned int xres_virtual;
-+ unsigned int yres;
-+ unsigned int yres_virtual;
-+ unsigned int pitch;
-+
- unsigned long base_addr_y;
- unsigned long base_addr_c;
-- unsigned int pitch;
-
- int (*notify)(struct sh_mobile_lcdc_chan *ch,
- enum sh_mobile_lcdc_entity_event event,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0181-fbdev-sh_mobile_lcdc-Pass-channel-pointer-to-sh_mobi.patch b/patches.armadillo800eva/0181-fbdev-sh_mobile_lcdc-Pass-channel-pointer-to-sh_mobi.patch
deleted file mode 100644
index 529d8fc9b07723..00000000000000
--- a/patches.armadillo800eva/0181-fbdev-sh_mobile_lcdc-Pass-channel-pointer-to-sh_mobi.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 365ac6c239a1902178990d3b2488dadbad2f777c Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Wed, 30 Nov 2011 23:07:30 +0100
-Subject: fbdev: sh_mobile_lcdc: Pass channel pointer to
- sh_mobile_wait_for_vsync
-
-The sh_mobile_wait_for_vsync() function isn't related to the fbdev API,
-make it generic by passing a channel pointer instead of an fb_info
-pointer.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 4976677f4d34df74d7207cae934b27f5d86feace)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 47 +++++++++++++++++++-------------------
- 1 file changed, 23 insertions(+), 24 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 6d377b4..adc911f 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -585,6 +585,26 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
- return IRQ_HANDLED;
- }
-
-+static int sh_mobile_wait_for_vsync(struct sh_mobile_lcdc_chan *ch)
-+{
-+ unsigned long ldintr;
-+ int ret;
-+
-+ /* Enable VSync End interrupt and be careful not to acknowledge any
-+ * pending interrupt.
-+ */
-+ ldintr = lcdc_read(ch->lcdc, _LDINTR);
-+ ldintr |= LDINTR_VEE | LDINTR_STATUS_MASK;
-+ lcdc_write(ch->lcdc, _LDINTR, ldintr);
-+
-+ ret = wait_for_completion_interruptible_timeout(&ch->vsync_completion,
-+ msecs_to_jiffies(100));
-+ if (!ret)
-+ return -ETIMEDOUT;
-+
-+ return 0;
-+}
-+
- static void sh_mobile_lcdc_start_stop(struct sh_mobile_lcdc_priv *priv,
- int start)
- {
-@@ -1083,27 +1103,6 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- return 0;
- }
-
--static int sh_mobile_wait_for_vsync(struct fb_info *info)
--{
-- struct sh_mobile_lcdc_chan *ch = info->par;
-- unsigned long ldintr;
-- int ret;
--
-- /* Enable VSync End interrupt and be careful not to acknowledge any
-- * pending interrupt.
-- */
-- ldintr = lcdc_read(ch->lcdc, _LDINTR);
-- ldintr |= LDINTR_VEE | LDINTR_STATUS_MASK;
-- lcdc_write(ch->lcdc, _LDINTR, ldintr);
--
-- ret = wait_for_completion_interruptible_timeout(&ch->vsync_completion,
-- msecs_to_jiffies(100));
-- if (!ret)
-- return -ETIMEDOUT;
--
-- return 0;
--}
--
- static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd,
- unsigned long arg)
- {
-@@ -1111,7 +1110,7 @@ static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd,
-
- switch (cmd) {
- case FBIO_WAITFORVSYNC:
-- retval = sh_mobile_wait_for_vsync(info);
-+ retval = sh_mobile_wait_for_vsync(info->par);
- break;
-
- default:
-@@ -1388,8 +1387,8 @@ static int sh_mobile_lcdc_blank(int blank, struct fb_info *info)
- * mode will reenable the clocks and update the screen in time,
- * so it does not need this. */
- if (!info->fbdefio) {
-- sh_mobile_wait_for_vsync(info);
-- sh_mobile_wait_for_vsync(info);
-+ sh_mobile_wait_for_vsync(ch);
-+ sh_mobile_wait_for_vsync(ch);
- }
- sh_mobile_lcdc_clk_off(p);
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0182-fbdev-sh_mobile_meram-Request-memory-regions-for-mem.patch b/patches.armadillo800eva/0182-fbdev-sh_mobile_meram-Request-memory-regions-for-mem.patch
deleted file mode 100644
index a6aa35ac3ff09b..00000000000000
--- a/patches.armadillo800eva/0182-fbdev-sh_mobile_meram-Request-memory-regions-for-mem.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From b7bde9b546d8f18367982ef055ba833b8107e542 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Request memory regions for memory resources
-
-Make sure the registers and MERAM spaces are reserved before using them.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit e1d1144eb92e69394958e59ff2a0fd22d58094d4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 53 +++++++++++++++++++++++++++------------
- 1 file changed, 37 insertions(+), 16 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index f45d83e..dbf5c43 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -596,13 +596,12 @@ static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
- * initialize MERAM
- */
-
--static int sh_mobile_meram_remove(struct platform_device *pdev);
--
- static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- {
- struct sh_mobile_meram_priv *priv;
- struct sh_mobile_meram_info *pdata = pdev->dev.platform_data;
-- struct resource *res;
-+ struct resource *regs;
-+ struct resource *meram;
- int error;
-
- if (!pdata) {
-@@ -610,8 +609,9 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- return -EINVAL;
- }
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- if (!res) {
-+ regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ meram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+ if (regs == NULL || meram == NULL) {
- dev_err(&pdev->dev, "cannot get platform resources\n");
- return -ENOENT;
- }
-@@ -622,32 +622,50 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- return -ENOMEM;
- }
-
-- platform_set_drvdata(pdev, priv);
--
- /* initialize private data */
- mutex_init(&priv->lock);
-- priv->base = ioremap_nocache(res->start, resource_size(res));
-+ pdata->ops = &sh_mobile_meram_ops;
-+ pdata->priv = priv;
-+ pdata->pdev = pdev;
-+
-+ if (!request_mem_region(regs->start, resource_size(regs), pdev->name)) {
-+ dev_err(&pdev->dev, "MERAM registers region already claimed\n");
-+ error = -EBUSY;
-+ goto err_req_regs;
-+ }
-+
-+ if (!request_mem_region(meram->start, resource_size(meram),
-+ pdev->name)) {
-+ dev_err(&pdev->dev, "MERAM memory region already claimed\n");
-+ error = -EBUSY;
-+ goto err_req_meram;
-+ }
-+
-+ priv->base = ioremap_nocache(regs->start, resource_size(regs));
- if (!priv->base) {
- dev_err(&pdev->dev, "ioremap failed\n");
- error = -EFAULT;
-- goto err;
-+ goto err_ioremap;
- }
-- pdata->ops = &sh_mobile_meram_ops;
-- pdata->priv = priv;
-- pdata->pdev = pdev;
-
- /* initialize ICB addressing mode */
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE1)
- meram_write_reg(priv->base, MEVCR1, MEVCR1_AMD1);
-
-+ platform_set_drvdata(pdev, priv);
- pm_runtime_enable(&pdev->dev);
-
- dev_info(&pdev->dev, "sh_mobile_meram initialized.");
-
- return 0;
-
--err:
-- sh_mobile_meram_remove(pdev);
-+err_ioremap:
-+ release_mem_region(meram->start, resource_size(meram));
-+err_req_meram:
-+ release_mem_region(regs->start, resource_size(regs));
-+err_req_regs:
-+ mutex_destroy(&priv->lock);
-+ kfree(priv);
-
- return error;
- }
-@@ -656,11 +674,14 @@ err:
- static int sh_mobile_meram_remove(struct platform_device *pdev)
- {
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-+ struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ struct resource *meram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-
- pm_runtime_disable(&pdev->dev);
-
-- if (priv->base)
-- iounmap(priv->base);
-+ iounmap(priv->base);
-+ release_mem_region(meram->start, resource_size(meram));
-+ release_mem_region(regs->start, resource_size(regs));
-
- mutex_destroy(&priv->lock);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0183-fbdev-sh_mobile_meram-Add-_cfg-suffix-to-struct-sh_m.patch b/patches.armadillo800eva/0183-fbdev-sh_mobile_meram-Add-_cfg-suffix-to-struct-sh_m.patch
deleted file mode 100644
index 0fb53d3090d49d..00000000000000
--- a/patches.armadillo800eva/0183-fbdev-sh_mobile_meram-Add-_cfg-suffix-to-struct-sh_m.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From 610b8ff9f3751459a209dd2c961279e9524f2e4c Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Add _cfg suffix to struct
- sh_mobile_meram_icb
-
-The structure describe ICB configuration, no ICB objects themselves.
-Rename it to sh_mobile_meram_icb_cfg in preparation for the addition of
-an ICB structure.
-
-All the structure fields are unsigned integers, make them so.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d272f428fac77ec57049a3293583ab3353928b1c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 10 +++++-----
- include/video/sh_mobile_meram.h | 14 +++++++-------
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index dbf5c43..2ad5a45 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -156,7 +156,7 @@ static inline unsigned long meram_read_reg(void __iomem *base, int off)
- */
-
- static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb *new)
-+ struct sh_mobile_meram_icb_cfg *new)
- {
- int i;
- int used_start, used_end, meram_start, meram_end;
-@@ -188,7 +188,7 @@ static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- */
-
- static inline void meram_mark(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb *new)
-+ struct sh_mobile_meram_icb_cfg *new)
- {
- int n;
-
-@@ -211,7 +211,7 @@ static inline void meram_mark(struct sh_mobile_meram_priv *priv,
- */
-
- static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb *icb)
-+ struct sh_mobile_meram_icb_cfg *icb)
- {
- int i;
- unsigned long pattern;
-@@ -303,7 +303,7 @@ static inline void meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- */
-
- static int meram_init(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb *icb,
-+ struct sh_mobile_meram_icb_cfg *icb,
- int xres, int yres, int *out_pitch)
- {
- unsigned long total_byte_count = MERAM_CALC_BYTECOUNT(xres, yres);
-@@ -370,7 +370,7 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- }
-
- static void meram_deinit(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb *icb)
-+ struct sh_mobile_meram_icb_cfg *icb)
- {
- /* disable ICB */
- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index af602d6..caae558 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -25,17 +25,17 @@ struct sh_mobile_meram_info {
- };
-
- /* icb config */
--struct sh_mobile_meram_icb {
-- int marker_icb; /* ICB # for Marker ICB */
-- int cache_icb; /* ICB # for Cache ICB */
-- int meram_offset; /* MERAM Buffer Offset to use */
-- int meram_size; /* MERAM Buffer Size to use */
-+struct sh_mobile_meram_icb_cfg {
-+ unsigned int marker_icb; /* ICB # for Marker ICB */
-+ unsigned int cache_icb; /* ICB # for Cache ICB */
-+ unsigned int meram_offset; /* MERAM Buffer Offset to use */
-+ unsigned int meram_size; /* MERAM Buffer Size to use */
-
-- int cache_unit; /* bytes to cache per ICB */
-+ unsigned int cache_unit; /* bytes to cache per ICB */
- };
-
- struct sh_mobile_meram_cfg {
-- struct sh_mobile_meram_icb icb[2];
-+ struct sh_mobile_meram_icb_cfg icb[2];
- int pixelformat;
- int current_reg;
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0184-fbdev-sh_mobile_meram-Make-variables-unsigned-where-.patch b/patches.armadillo800eva/0184-fbdev-sh_mobile_meram-Make-variables-unsigned-where-.patch
deleted file mode 100644
index 89d41979bfc41f..00000000000000
--- a/patches.armadillo800eva/0184-fbdev-sh_mobile_meram-Make-variables-unsigned-where-.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 6ac80761a92140cfed244b8135d45228bf8ed59b Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Make variables unsigned where applicable
-
-Many variables, such as loop counters, sizes and offsets, should be
-unsigned integers. Make them so.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 05432837ae0dfc6c7de93d081b1377ced4eb866b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 80 +++++++++++++++++++++------------------
- include/video/sh_mobile_meram.h | 6 ++-
- 2 files changed, 47 insertions(+), 39 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 2ad5a45..548f700 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -104,7 +104,7 @@ struct sh_mobile_meram_priv {
- void __iomem *base;
- struct mutex lock;
- unsigned long used_icb;
-- int used_meram_cache_regions;
-+ unsigned int used_meram_cache_regions;
- unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
- unsigned long cmn_saved_regs[CMN_REGS_SIZE];
- unsigned long icb_saved_regs[ICB_REGS_SIZE * SH_MOBILE_MERAM_ICB_NUM];
-@@ -120,24 +120,25 @@ struct sh_mobile_meram_priv {
-
- #define MERAM_ICB_OFFSET(base, idx, off) ((base) + (off) + (idx) * 0x20)
-
--static inline void meram_write_icb(void __iomem *base, int idx, int off,
-- unsigned long val)
-+static inline void meram_write_icb(void __iomem *base, unsigned int idx,
-+ unsigned int off, unsigned long val)
- {
- iowrite32(val, MERAM_ICB_OFFSET(base, idx, off));
- }
-
--static inline unsigned long meram_read_icb(void __iomem *base, int idx, int off)
-+static inline unsigned long meram_read_icb(void __iomem *base, unsigned int idx,
-+ unsigned int off)
- {
- return ioread32(MERAM_ICB_OFFSET(base, idx, off));
- }
-
--static inline void meram_write_reg(void __iomem *base, int off,
-- unsigned long val)
-+static inline void meram_write_reg(void __iomem *base, unsigned int off,
-+ unsigned long val)
- {
- iowrite32(val, base + off);
- }
-
--static inline unsigned long meram_read_reg(void __iomem *base, int off)
-+static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- {
- return ioread32(base + off);
- }
-@@ -158,8 +159,8 @@ static inline unsigned long meram_read_reg(void __iomem *base, int off)
- static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- struct sh_mobile_meram_icb_cfg *new)
- {
-- int i;
-- int used_start, used_end, meram_start, meram_end;
-+ unsigned int used_start, used_end, meram_start, meram_end;
-+ unsigned int i;
-
- /* valid ICB? */
- if (new->marker_icb & ~0x1f || new->cache_icb & ~0x1f)
-@@ -190,7 +191,7 @@ static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- static inline void meram_mark(struct sh_mobile_meram_priv *priv,
- struct sh_mobile_meram_icb_cfg *new)
- {
-- int n;
-+ unsigned int n;
-
- if (new->marker_icb < 0 || new->cache_icb < 0)
- return;
-@@ -213,8 +214,8 @@ static inline void meram_mark(struct sh_mobile_meram_priv *priv,
- static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
- struct sh_mobile_meram_icb_cfg *icb)
- {
-- int i;
- unsigned long pattern;
-+ unsigned int i;
-
- if (icb->marker_icb < 0 || icb->cache_icb < 0)
- return;
-@@ -304,12 +305,15 @@ static inline void meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
-
- static int meram_init(struct sh_mobile_meram_priv *priv,
- struct sh_mobile_meram_icb_cfg *icb,
-- int xres, int yres, int *out_pitch)
-+ unsigned int xres, unsigned int yres,
-+ unsigned int *out_pitch)
- {
- unsigned long total_byte_count = MERAM_CALC_BYTECOUNT(xres, yres);
- unsigned long bnm;
-- int lcdc_pitch, xpitch, line_cnt;
-- int save_lines;
-+ unsigned int lcdc_pitch;
-+ unsigned int xpitch;
-+ unsigned int line_cnt;
-+ unsigned int save_lines;
-
- /* adjust pitch to 1024, 2048, 4096 or 8192 */
- lcdc_pitch = (xres - 1) | 1023;
-@@ -386,16 +390,18 @@ static void meram_deinit(struct sh_mobile_meram_priv *priv,
-
- static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- struct sh_mobile_meram_cfg *cfg,
-- int xres, int yres, int pixelformat,
-+ unsigned int xres, unsigned int yres,
-+ unsigned int pixelformat,
- unsigned long base_addr_y,
- unsigned long base_addr_c,
- unsigned long *icb_addr_y,
- unsigned long *icb_addr_c,
-- int *pitch)
-+ unsigned int *pitch)
- {
- struct platform_device *pdev;
- struct sh_mobile_meram_priv *priv;
-- int n, out_pitch;
-+ unsigned int out_pitch;
-+ unsigned int n;
- int error = 0;
-
- if (!pdata || !pdata->priv || !pdata->pdev || !cfg)
-@@ -538,21 +544,21 @@ static int sh_mobile_meram_runtime_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-- int k, j;
-+ unsigned int i, j;
-
-- for (k = 0; k < CMN_REGS_SIZE; k++)
-- priv->cmn_saved_regs[k] = meram_read_reg(priv->base,
-- common_regs[k]);
-+ for (i = 0; i < CMN_REGS_SIZE; i++)
-+ priv->cmn_saved_regs[i] = meram_read_reg(priv->base,
-+ common_regs[i]);
-
-- for (j = 0; j < 32; j++) {
-- if (!test_bit(j, &priv->used_icb))
-+ for (i = 0; i < 32; i++) {
-+ if (!test_bit(i, &priv->used_icb))
- continue;
-- for (k = 0; k < ICB_REGS_SIZE; k++) {
-- priv->icb_saved_regs[j * ICB_REGS_SIZE + k] =
-- meram_read_icb(priv->base, j, icb_regs[k]);
-+ for (j = 0; j < ICB_REGS_SIZE; j++) {
-+ priv->icb_saved_regs[i * ICB_REGS_SIZE + j] =
-+ meram_read_icb(priv->base, i, icb_regs[j]);
- /* Reset ICB on resume */
-- if (icb_regs[k] == MExxCTL)
-- priv->icb_saved_regs[j * ICB_REGS_SIZE + k] |=
-+ if (icb_regs[j] == MExxCTL)
-+ priv->icb_saved_regs[i * ICB_REGS_SIZE + j] |=
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF;
- }
- }
-@@ -563,20 +569,20 @@ static int sh_mobile_meram_runtime_resume(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-- int k, j;
-+ unsigned int i, j;
-
-- for (j = 0; j < 32; j++) {
-- if (!test_bit(j, &priv->used_icb))
-+ for (i = 0; i < 32; i++) {
-+ if (!test_bit(i, &priv->used_icb))
- continue;
-- for (k = 0; k < ICB_REGS_SIZE; k++) {
-- meram_write_icb(priv->base, j, icb_regs[k],
-- priv->icb_saved_regs[j * ICB_REGS_SIZE + k]);
-+ for (j = 0; j < ICB_REGS_SIZE; j++) {
-+ meram_write_icb(priv->base, i, icb_regs[j],
-+ priv->icb_saved_regs[i * ICB_REGS_SIZE + j]);
- }
- }
-
-- for (k = 0; k < CMN_REGS_SIZE; k++)
-- meram_write_reg(priv->base, common_regs[k],
-- priv->cmn_saved_regs[k]);
-+ for (i = 0; i < CMN_REGS_SIZE; i++)
-+ meram_write_reg(priv->base, common_regs[i],
-+ priv->cmn_saved_regs[i]);
- return 0;
- }
-
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index caae558..6755e3f 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -46,11 +46,13 @@ struct sh_mobile_meram_ops {
- /* register usage of meram */
- int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
- struct sh_mobile_meram_cfg *cfg,
-- int xres, int yres, int pixelformat,
-+ unsigned int xres, unsigned int yres,
-+ unsigned int pixelformat,
- unsigned long base_addr_y,
- unsigned long base_addr_c,
- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c, int *pitch);
-+ unsigned long *icb_addr_c,
-+ unsigned int *pitch);
-
- /* unregister usage of meram */
- int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0185-fbdev-sh_mobile_meram-Make-current_reg-field-store-t.patch b/patches.armadillo800eva/0185-fbdev-sh_mobile_meram-Make-current_reg-field-store-t.patch
deleted file mode 100644
index 7b7df7a786f80c..00000000000000
--- a/patches.armadillo800eva/0185-fbdev-sh_mobile_meram-Make-current_reg-field-store-t.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From e4e4366a35b394fd7ef7940651413be206adb5ff Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Make current_reg field store the current reg
- set
-
-Make sure current_reg == 0/1 always mean register set A/B through all
-the code.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit eb4f2304ba029f78516c2fe23213d7e2d0f8d58f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 548f700..7af2ffe 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -259,8 +259,8 @@ static inline void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
- {
- unsigned long target;
-
-- target = (cfg->current_reg) ? MExxSARA : MExxSARB;
- cfg->current_reg ^= 1;
-+ target = cfg->current_reg ? MExxSARB : MExxSARA;
-
- /* set the next address to fetch */
- meram_write_icb(priv->base, cfg->icb[0].cache_icb, target,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0186-fbdev-sh_mobile_meram-Add-struct-sh_mobile_meram_icb.patch b/patches.armadillo800eva/0186-fbdev-sh_mobile_meram-Add-struct-sh_mobile_meram_icb.patch
deleted file mode 100644
index 04ba16dfed7bda..00000000000000
--- a/patches.armadillo800eva/0186-fbdev-sh_mobile_meram-Add-struct-sh_mobile_meram_icb.patch
+++ /dev/null
@@ -1,444 +0,0 @@
-From 9e0c96f06f5d74213714fa03fa9ea1f35ad75cb2 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Add struct sh_mobile_meram_icb
-
-The new structure stores ICB parameters for ICBs.
-
-Instead of modifying the struct sh_mobile_meram_cfg instances passed by
-callers, store the ICB parameters internally and make the public API
-take const pointers to sh_mobile_meram_cfg.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 2a618e0333f5d1d27bbd4d90d70f07e0a8dc0ba7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 178 ++++++++++++++++++++-------------------
- include/video/sh_mobile_meram.h | 12 +--
- 2 files changed, 94 insertions(+), 96 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 7af2ffe..cddb180 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -100,14 +100,38 @@ static unsigned long icb_regs[] = {
- };
- #define ICB_REGS_SIZE ARRAY_SIZE(icb_regs)
-
-+/*
-+ * sh_mobile_meram_icb - MERAM ICB information
-+ * @regs: Registers cache
-+ * @region: Start and end addresses of the MERAM region
-+ * @cache_unit: Bytes to cache per ICB
-+ * @pixelformat: Video pixel format of the data stored in the ICB
-+ * @current_reg: Which of Start Address Register A (0) or B (1) is in use
-+ */
-+struct sh_mobile_meram_icb {
-+ unsigned long regs[ICB_REGS_SIZE];
-+
-+ unsigned long region;
-+ unsigned int cache_unit;
-+ unsigned int pixelformat;
-+ unsigned int current_reg;
-+};
-+
-+/*
-+ * sh_mobile_meram_priv - MERAM device
-+ * @base: Registers base address
-+ * @regs: Registers cache
-+ * @lock: Protects used_icb and icbs
-+ * @used_icb: Bitmask of used ICBs
-+ * @icbs: ICBs
-+ */
- struct sh_mobile_meram_priv {
-- void __iomem *base;
-- struct mutex lock;
-- unsigned long used_icb;
-- unsigned int used_meram_cache_regions;
-- unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
-- unsigned long cmn_saved_regs[CMN_REGS_SIZE];
-- unsigned long icb_saved_regs[ICB_REGS_SIZE * SH_MOBILE_MERAM_ICB_NUM];
-+ void __iomem *base;
-+ unsigned long regs[CMN_REGS_SIZE];
-+
-+ struct mutex lock;
-+ unsigned long used_icb;
-+ struct sh_mobile_meram_icb icbs[SH_MOBILE_MERAM_ICB_NUM];
- };
-
- /* settings */
-@@ -157,7 +181,7 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- */
-
- static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb_cfg *new)
-+ const struct sh_mobile_meram_icb_cfg *new)
- {
- unsigned int used_start, used_end, meram_start, meram_end;
- unsigned int i;
-@@ -167,17 +191,20 @@ static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- return 1;
-
- if (test_bit(new->marker_icb, &priv->used_icb) ||
-- test_bit(new->cache_icb, &priv->used_icb))
-+ test_bit(new->cache_icb, &priv->used_icb))
- return 1;
-
-- for (i = 0; i < priv->used_meram_cache_regions; i++) {
-- used_start = MERAM_CACHE_START(priv->used_meram_cache[i]);
-- used_end = MERAM_CACHE_END(priv->used_meram_cache[i]);
-+ for (i = 0; i < SH_MOBILE_MERAM_ICB_NUM; i++) {
-+ if (!test_bit(i, &priv->used_icb))
-+ continue;
-+
-+ used_start = MERAM_CACHE_START(priv->icbs[i].region);
-+ used_end = MERAM_CACHE_END(priv->icbs[i].region);
- meram_start = new->meram_offset;
- meram_end = new->meram_offset + new->meram_size;
-
- if ((meram_start >= used_start && meram_start < used_end) ||
-- (meram_end > used_start && meram_end < used_end))
-+ (meram_end > used_start && meram_end < used_end))
- return 1;
- }
-
-@@ -189,22 +216,18 @@ static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- */
-
- static inline void meram_mark(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb_cfg *new)
-+ const struct sh_mobile_meram_icb_cfg *new,
-+ int pixelformat)
- {
-- unsigned int n;
--
-- if (new->marker_icb < 0 || new->cache_icb < 0)
-- return;
--
- __set_bit(new->marker_icb, &priv->used_icb);
- __set_bit(new->cache_icb, &priv->used_icb);
-
-- n = priv->used_meram_cache_regions;
--
-- priv->used_meram_cache[n] = MERAM_CACHE_SET(new->meram_offset,
-- new->meram_size);
--
-- priv->used_meram_cache_regions++;
-+ priv->icbs[new->marker_icb].region = MERAM_CACHE_SET(new->meram_offset,
-+ new->meram_size);
-+ priv->icbs[new->cache_icb].region = MERAM_CACHE_SET(new->meram_offset,
-+ new->meram_size);
-+ priv->icbs[new->marker_icb].current_reg = 1;
-+ priv->icbs[new->marker_icb].pixelformat = pixelformat;
- }
-
- /*
-@@ -212,30 +235,10 @@ static inline void meram_mark(struct sh_mobile_meram_priv *priv,
- */
-
- static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb_cfg *icb)
-+ const struct sh_mobile_meram_icb_cfg *icb)
- {
-- unsigned long pattern;
-- unsigned int i;
--
-- if (icb->marker_icb < 0 || icb->cache_icb < 0)
-- return;
--
- __clear_bit(icb->marker_icb, &priv->used_icb);
- __clear_bit(icb->cache_icb, &priv->used_icb);
--
-- pattern = MERAM_CACHE_SET(icb->meram_offset, icb->meram_size);
-- for (i = 0; i < priv->used_meram_cache_regions; i++) {
-- if (priv->used_meram_cache[i] == pattern) {
-- while (i < priv->used_meram_cache_regions - 1) {
-- priv->used_meram_cache[i] =
-- priv->used_meram_cache[i + 1] ;
-- i++;
-- }
-- priv->used_meram_cache[i] = 0;
-- priv->used_meram_cache_regions--;
-- break;
-- }
-- }
- }
-
- /*
-@@ -244,7 +247,7 @@ static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
- static inline int is_nvcolor(int cspace)
- {
- if (cspace == SH_MOBILE_MERAM_PF_NV ||
-- cspace == SH_MOBILE_MERAM_PF_NV24)
-+ cspace == SH_MOBILE_MERAM_PF_NV24)
- return 1;
- return 0;
- }
-@@ -253,46 +256,51 @@ static inline int is_nvcolor(int cspace)
- * set the next address to fetch
- */
- static inline void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_cfg *cfg,
-+ const struct sh_mobile_meram_cfg *cfg,
- unsigned long base_addr_y,
- unsigned long base_addr_c)
- {
-+ struct sh_mobile_meram_icb *icb = &priv->icbs[cfg->icb[0].marker_icb];
- unsigned long target;
-
-- cfg->current_reg ^= 1;
-- target = cfg->current_reg ? MExxSARB : MExxSARA;
-+ icb->current_reg ^= 1;
-+ target = icb->current_reg ? MExxSARB : MExxSARA;
-
- /* set the next address to fetch */
-- meram_write_icb(priv->base, cfg->icb[0].cache_icb, target,
-+ meram_write_icb(priv->base, cfg->icb[0].cache_icb, target,
- base_addr_y);
- meram_write_icb(priv->base, cfg->icb[0].marker_icb, target,
-- base_addr_y + cfg->icb[0].cache_unit);
-+ base_addr_y +
-+ priv->icbs[cfg->icb[0].marker_icb].cache_unit);
-
-- if (is_nvcolor(cfg->pixelformat)) {
-+ if (is_nvcolor(icb->pixelformat)) {
- meram_write_icb(priv->base, cfg->icb[1].cache_icb, target,
- base_addr_c);
- meram_write_icb(priv->base, cfg->icb[1].marker_icb, target,
-- base_addr_c + cfg->icb[1].cache_unit);
-+ base_addr_c +
-+ priv->icbs[cfg->icb[1].marker_icb].cache_unit);
- }
- }
-
- /*
- * get the next ICB address
- */
--static inline void meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
-- struct sh_mobile_meram_cfg *cfg,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c)
-+static inline void
-+meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
-+ const struct sh_mobile_meram_cfg *cfg,
-+ unsigned long *icb_addr_y, unsigned long *icb_addr_c)
- {
-+ struct sh_mobile_meram_priv *priv = pdata->priv;
-+ struct sh_mobile_meram_icb *icb = &priv->icbs[cfg->icb[0].marker_icb];
- unsigned long icb_offset;
-
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE0)
-- icb_offset = 0x80000000 | (cfg->current_reg << 29);
-+ icb_offset = 0x80000000 | (icb->current_reg << 29);
- else
-- icb_offset = 0xc0000000 | (cfg->current_reg << 23);
-+ icb_offset = 0xc0000000 | (icb->current_reg << 23);
-
- *icb_addr_y = icb_offset | (cfg->icb[0].marker_icb << 24);
-- if (is_nvcolor(cfg->pixelformat))
-+ if (is_nvcolor(icb->pixelformat))
- *icb_addr_c = icb_offset | (cfg->icb[1].marker_icb << 24);
- }
-
-@@ -304,7 +312,7 @@ static inline void meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- */
-
- static int meram_init(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb_cfg *icb,
-+ const struct sh_mobile_meram_icb_cfg *icb,
- unsigned int xres, unsigned int yres,
- unsigned int *out_pitch)
- {
-@@ -352,7 +360,8 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- meram_write_icb(priv->base, icb->marker_icb, MExxSBSIZE, xpitch);
-
- /* save a cache unit size */
-- icb->cache_unit = xres * save_lines;
-+ priv->icbs[icb->cache_icb].cache_unit = xres * save_lines;
-+ priv->icbs[icb->marker_icb].cache_unit = xres * save_lines;
-
- /*
- * Set MERAM for framebuffer
-@@ -374,14 +383,16 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- }
-
- static void meram_deinit(struct sh_mobile_meram_priv *priv,
-- struct sh_mobile_meram_icb_cfg *icb)
-+ const struct sh_mobile_meram_icb_cfg *icb)
- {
- /* disable ICB */
- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
- meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
-- icb->cache_unit = 0;
-+
-+ priv->icbs[icb->cache_icb].cache_unit = 0;
-+ priv->icbs[icb->marker_icb].cache_unit = 0;
- }
-
- /*
-@@ -389,7 +400,7 @@ static void meram_deinit(struct sh_mobile_meram_priv *priv,
- */
-
- static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
-- struct sh_mobile_meram_cfg *cfg,
-+ const struct sh_mobile_meram_cfg *cfg,
- unsigned int xres, unsigned int yres,
- unsigned int pixelformat,
- unsigned long base_addr_y,
-@@ -433,12 +444,6 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
-
- mutex_lock(&priv->lock);
-
-- if (priv->used_meram_cache_regions + 2 > SH_MOBILE_MERAM_ICB_NUM) {
-- dev_err(&pdev->dev, "no more ICB available.");
-- error = -EINVAL;
-- goto err;
-- }
--
- /* make sure that there's no overlaps */
- if (meram_check_overlap(priv, &cfg->icb[0])) {
- dev_err(&pdev->dev, "conflicting config detected.");
-@@ -464,10 +469,9 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- }
-
- /* we now register the ICB */
-- cfg->pixelformat = pixelformat;
-- meram_mark(priv, &cfg->icb[0]);
-+ meram_mark(priv, &cfg->icb[0], pixelformat);
- if (is_nvcolor(pixelformat))
-- meram_mark(priv, &cfg->icb[1]);
-+ meram_mark(priv, &cfg->icb[1], pixelformat);
-
- /* initialize MERAM */
- meram_init(priv, &cfg->icb[0], xres, yres, &out_pitch);
-@@ -479,7 +483,6 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- meram_init(priv, &cfg->icb[1], 2 * xres, (yres + 1) / 2,
- &out_pitch);
-
-- cfg->current_reg = 1;
- meram_set_next_addr(priv, cfg, base_addr_y, base_addr_c);
- meram_get_next_icb_addr(pdata, cfg, icb_addr_y, icb_addr_c);
-
-@@ -492,19 +495,21 @@ err:
- }
-
- static int sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata,
-- struct sh_mobile_meram_cfg *cfg)
-+ const struct sh_mobile_meram_cfg *cfg)
- {
- struct sh_mobile_meram_priv *priv;
-+ struct sh_mobile_meram_icb *icb;
-
- if (!pdata || !pdata->priv || !cfg)
- return -EINVAL;
-
- priv = pdata->priv;
-+ icb = &priv->icbs[cfg->icb[0].marker_icb];
-
- mutex_lock(&priv->lock);
-
- /* deinit & unmark */
-- if (is_nvcolor(cfg->pixelformat)) {
-+ if (is_nvcolor(icb->pixelformat)) {
- meram_deinit(priv, &cfg->icb[1]);
- meram_unmark(priv, &cfg->icb[1]);
- }
-@@ -517,7 +522,7 @@ static int sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata,
- }
-
- static int sh_mobile_meram_update(struct sh_mobile_meram_info *pdata,
-- struct sh_mobile_meram_cfg *cfg,
-+ const struct sh_mobile_meram_cfg *cfg,
- unsigned long base_addr_y,
- unsigned long base_addr_c,
- unsigned long *icb_addr_y,
-@@ -547,18 +552,17 @@ static int sh_mobile_meram_runtime_suspend(struct device *dev)
- unsigned int i, j;
-
- for (i = 0; i < CMN_REGS_SIZE; i++)
-- priv->cmn_saved_regs[i] = meram_read_reg(priv->base,
-- common_regs[i]);
-+ priv->regs[i] = meram_read_reg(priv->base, common_regs[i]);
-
- for (i = 0; i < 32; i++) {
- if (!test_bit(i, &priv->used_icb))
- continue;
- for (j = 0; j < ICB_REGS_SIZE; j++) {
-- priv->icb_saved_regs[i * ICB_REGS_SIZE + j] =
-+ priv->icbs[i].regs[j] =
- meram_read_icb(priv->base, i, icb_regs[j]);
- /* Reset ICB on resume */
- if (icb_regs[j] == MExxCTL)
-- priv->icb_saved_regs[i * ICB_REGS_SIZE + j] |=
-+ priv->icbs[i].regs[j] |=
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF;
- }
- }
-@@ -574,15 +578,13 @@ static int sh_mobile_meram_runtime_resume(struct device *dev)
- for (i = 0; i < 32; i++) {
- if (!test_bit(i, &priv->used_icb))
- continue;
-- for (j = 0; j < ICB_REGS_SIZE; j++) {
-+ for (j = 0; j < ICB_REGS_SIZE; j++)
- meram_write_icb(priv->base, i, icb_regs[j],
-- priv->icb_saved_regs[i * ICB_REGS_SIZE + j]);
-- }
-+ priv->icbs[i].regs[j]);
- }
-
- for (i = 0; i < CMN_REGS_SIZE; i++)
-- meram_write_reg(priv->base, common_regs[i],
-- priv->cmn_saved_regs[i]);
-+ meram_write_reg(priv->base, common_regs[i], priv->regs[i]);
- return 0;
- }
-
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index 6755e3f..05ca3f9 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -30,14 +30,10 @@ struct sh_mobile_meram_icb_cfg {
- unsigned int cache_icb; /* ICB # for Cache ICB */
- unsigned int meram_offset; /* MERAM Buffer Offset to use */
- unsigned int meram_size; /* MERAM Buffer Size to use */
--
-- unsigned int cache_unit; /* bytes to cache per ICB */
- };
-
- struct sh_mobile_meram_cfg {
-- struct sh_mobile_meram_icb_cfg icb[2];
-- int pixelformat;
-- int current_reg;
-+ struct sh_mobile_meram_icb_cfg icb[2];
- };
-
- struct module;
-@@ -45,7 +41,7 @@ struct sh_mobile_meram_ops {
- struct module *module;
- /* register usage of meram */
- int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
-- struct sh_mobile_meram_cfg *cfg,
-+ const struct sh_mobile_meram_cfg *cfg,
- unsigned int xres, unsigned int yres,
- unsigned int pixelformat,
- unsigned long base_addr_y,
-@@ -56,11 +52,11 @@ struct sh_mobile_meram_ops {
-
- /* unregister usage of meram */
- int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
-- struct sh_mobile_meram_cfg *cfg);
-+ const struct sh_mobile_meram_cfg *cfg);
-
- /* update meram settings */
- int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
-- struct sh_mobile_meram_cfg *cfg,
-+ const struct sh_mobile_meram_cfg *cfg,
- unsigned long base_addr_y,
- unsigned long base_addr_c,
- unsigned long *icb_addr_y,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0187-fbdev-sh_mobile_meram-Don-t-inline-everything.patch b/patches.armadillo800eva/0187-fbdev-sh_mobile_meram-Don-t-inline-everything.patch
deleted file mode 100644
index a266eba42b9057..00000000000000
--- a/patches.armadillo800eva/0187-fbdev-sh_mobile_meram-Don-t-inline-everything.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 3474589f40e2aecd6206d923372daab7713b8981 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Don't inline everything
-
-Let the compiler decide which complex functions to inline, and constify
-constant static arrays.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 762f7cc94bc5c5c8c54f9d0073a07a275b106d89)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index cddb180..0c5b301 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -83,14 +83,14 @@
-
- #define SH_MOBILE_MERAM_ICB_NUM 32
-
--static unsigned long common_regs[] = {
-+static const unsigned long common_regs[] = {
- MEVCR1,
- MEQSEL1,
- MEQSEL2,
- };
- #define CMN_REGS_SIZE ARRAY_SIZE(common_regs)
-
--static unsigned long icb_regs[] = {
-+static const unsigned long icb_regs[] = {
- MExxCTL,
- MExxBSIZE,
- MExxMNCF,
-@@ -180,8 +180,8 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- * check if there's no overlaps in MERAM allocation.
- */
-
--static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *new)
-+static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_icb_cfg *new)
- {
- unsigned int used_start, used_end, meram_start, meram_end;
- unsigned int i;
-@@ -215,9 +215,9 @@ static inline int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- * mark the specified ICB as used
- */
-
--static inline void meram_mark(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *new,
-- int pixelformat)
-+static void meram_mark(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_icb_cfg *new,
-+ int pixelformat)
- {
- __set_bit(new->marker_icb, &priv->used_icb);
- __set_bit(new->cache_icb, &priv->used_icb);
-@@ -234,8 +234,8 @@ static inline void meram_mark(struct sh_mobile_meram_priv *priv,
- * unmark the specified ICB as used
- */
-
--static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *icb)
-+static void meram_unmark(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_icb_cfg *icb)
- {
- __clear_bit(icb->marker_icb, &priv->used_icb);
- __clear_bit(icb->cache_icb, &priv->used_icb);
-@@ -244,7 +244,7 @@ static inline void meram_unmark(struct sh_mobile_meram_priv *priv,
- /*
- * is this a YCbCr(NV12, NV16 or NV24) colorspace
- */
--static inline int is_nvcolor(int cspace)
-+static int is_nvcolor(int cspace)
- {
- if (cspace == SH_MOBILE_MERAM_PF_NV ||
- cspace == SH_MOBILE_MERAM_PF_NV24)
-@@ -255,10 +255,10 @@ static inline int is_nvcolor(int cspace)
- /*
- * set the next address to fetch
- */
--static inline void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_cfg *cfg,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c)
-+static void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_cfg *cfg,
-+ unsigned long base_addr_y,
-+ unsigned long base_addr_c)
- {
- struct sh_mobile_meram_icb *icb = &priv->icbs[cfg->icb[0].marker_icb];
- unsigned long target;
-@@ -285,7 +285,7 @@ static inline void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
- /*
- * get the next ICB address
- */
--static inline void
-+static void
- meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- const struct sh_mobile_meram_cfg *cfg,
- unsigned long *icb_addr_y, unsigned long *icb_addr_c)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0188-fbdev-sh_mobile_meram-Divide-the-code-into-sections.patch b/patches.armadillo800eva/0188-fbdev-sh_mobile_meram-Divide-the-code-into-sections.patch
deleted file mode 100644
index 170c6a1f34c923..00000000000000
--- a/patches.armadillo800eva/0188-fbdev-sh_mobile_meram-Divide-the-code-into-sections.patch
+++ /dev/null
@@ -1,263 +0,0 @@
-From 47eaa67abf18167b2b31e32d33c8c88230b61993 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Divide the code into sections
-
-And rename a couple of constants to make prefixes more uniform.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 7554340c7acae4a719b1b70b0defa3c67149610b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 98 ++++++++++++++++++---------------------
- 1 file changed, 44 insertions(+), 54 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 0c5b301..30a3305 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -9,16 +9,20 @@
- * for more details.
- */
-
-+#include <linux/device.h>
-+#include <linux/io.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
--#include <linux/device.h>
-+#include <linux/platform_device.h>
- #include <linux/pm_runtime.h>
--#include <linux/io.h>
- #include <linux/slab.h>
--#include <linux/platform_device.h>
-+
- #include <video/sh_mobile_meram.h>
-
--/* meram registers */
-+/* -----------------------------------------------------------------------------
-+ * MERAM registers
-+ */
-+
- #define MEVCR1 0x4
- #define MEVCR1_RST (1 << 31)
- #define MEVCR1_WD (1 << 30)
-@@ -81,14 +85,12 @@
- ((yszm1) << MExxBSIZE_YSZM1_SHIFT) | \
- ((xszm1) << MExxBSIZE_XSZM1_SHIFT))
-
--#define SH_MOBILE_MERAM_ICB_NUM 32
--
- static const unsigned long common_regs[] = {
- MEVCR1,
- MEQSEL1,
- MEQSEL2,
- };
--#define CMN_REGS_SIZE ARRAY_SIZE(common_regs)
-+#define MERAM_REGS_SIZE ARRAY_SIZE(common_regs)
-
- static const unsigned long icb_regs[] = {
- MExxCTL,
-@@ -117,6 +119,8 @@ struct sh_mobile_meram_icb {
- unsigned int current_reg;
- };
-
-+#define MERAM_ICB_NUM 32
-+
- /*
- * sh_mobile_meram_priv - MERAM device
- * @base: Registers base address
-@@ -127,19 +131,19 @@ struct sh_mobile_meram_icb {
- */
- struct sh_mobile_meram_priv {
- void __iomem *base;
-- unsigned long regs[CMN_REGS_SIZE];
-+ unsigned long regs[MERAM_REGS_SIZE];
-
- struct mutex lock;
- unsigned long used_icb;
-- struct sh_mobile_meram_icb icbs[SH_MOBILE_MERAM_ICB_NUM];
-+ struct sh_mobile_meram_icb icbs[MERAM_ICB_NUM];
- };
-
- /* settings */
--#define MERAM_SEC_LINE 15
--#define MERAM_LINE_WIDTH 2048
-+#define MERAM_SEC_LINE 15
-+#define MERAM_LINE_WIDTH 2048
-
--/*
-- * MERAM/ICB access functions
-+/* -----------------------------------------------------------------------------
-+ * Registers access
- */
-
- #define MERAM_ICB_OFFSET(base, idx, off) ((base) + (off) + (idx) * 0x20)
-@@ -167,8 +171,8 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- return ioread32(base + off);
- }
-
--/*
-- * register ICB
-+/* -----------------------------------------------------------------------------
-+ * Allocation
- */
-
- #define MERAM_CACHE_START(p) ((p) >> 16)
-@@ -176,10 +180,7 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- #define MERAM_CACHE_SET(o, s) ((((o) & 0xffff) << 16) | \
- (((o) + (s) - 1) & 0xffff))
-
--/*
-- * check if there's no overlaps in MERAM allocation.
-- */
--
-+/* Check if there's no overlaps in MERAM allocation. */
- static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *new)
- {
-@@ -194,7 +195,7 @@ static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- test_bit(new->cache_icb, &priv->used_icb))
- return 1;
-
-- for (i = 0; i < SH_MOBILE_MERAM_ICB_NUM; i++) {
-+ for (i = 0; i < MERAM_ICB_NUM; i++) {
- if (!test_bit(i, &priv->used_icb))
- continue;
-
-@@ -211,10 +212,7 @@ static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- return 0;
- }
-
--/*
-- * mark the specified ICB as used
-- */
--
-+/* Mark the specified ICB as used. */
- static void meram_mark(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *new,
- int pixelformat)
-@@ -230,10 +228,7 @@ static void meram_mark(struct sh_mobile_meram_priv *priv,
- priv->icbs[new->marker_icb].pixelformat = pixelformat;
- }
-
--/*
-- * unmark the specified ICB as used
-- */
--
-+/* Unmark the specified ICB as used. */
- static void meram_unmark(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *icb)
- {
-@@ -241,9 +236,7 @@ static void meram_unmark(struct sh_mobile_meram_priv *priv,
- __clear_bit(icb->cache_icb, &priv->used_icb);
- }
-
--/*
-- * is this a YCbCr(NV12, NV16 or NV24) colorspace
-- */
-+/* Is this a YCbCr(NV12, NV16 or NV24) colorspace? */
- static int is_nvcolor(int cspace)
- {
- if (cspace == SH_MOBILE_MERAM_PF_NV ||
-@@ -252,9 +245,7 @@ static int is_nvcolor(int cspace)
- return 0;
- }
-
--/*
-- * set the next address to fetch
-- */
-+/* Set the next address to fetch. */
- static void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_cfg *cfg,
- unsigned long base_addr_y,
-@@ -282,9 +273,7 @@ static void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
- }
- }
-
--/*
-- * get the next ICB address
-- */
-+/* Get the next ICB address. */
- static void
- meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- const struct sh_mobile_meram_cfg *cfg,
-@@ -307,10 +296,7 @@ meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- #define MERAM_CALC_BYTECOUNT(x, y) \
- (((x) * (y) + (MERAM_LINE_WIDTH - 1)) & ~(MERAM_LINE_WIDTH - 1))
-
--/*
-- * initialize MERAM
-- */
--
-+/* Initialize MERAM. */
- static int meram_init(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *icb,
- unsigned int xres, unsigned int yres,
-@@ -395,8 +381,8 @@ static void meram_deinit(struct sh_mobile_meram_priv *priv,
- priv->icbs[icb->marker_icb].cache_unit = 0;
- }
-
--/*
-- * register the ICB
-+/* -----------------------------------------------------------------------------
-+ * Registration/unregistration
- */
-
- static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
-@@ -545,13 +531,24 @@ static int sh_mobile_meram_update(struct sh_mobile_meram_info *pdata,
- return 0;
- }
-
-+static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
-+ .module = THIS_MODULE,
-+ .meram_register = sh_mobile_meram_register,
-+ .meram_unregister = sh_mobile_meram_unregister,
-+ .meram_update = sh_mobile_meram_update,
-+};
-+
-+/* -----------------------------------------------------------------------------
-+ * Power management
-+ */
-+
- static int sh_mobile_meram_runtime_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
- unsigned int i, j;
-
-- for (i = 0; i < CMN_REGS_SIZE; i++)
-+ for (i = 0; i < MERAM_REGS_SIZE; i++)
- priv->regs[i] = meram_read_reg(priv->base, common_regs[i]);
-
- for (i = 0; i < 32; i++) {
-@@ -583,7 +580,7 @@ static int sh_mobile_meram_runtime_resume(struct device *dev)
- priv->icbs[i].regs[j]);
- }
-
-- for (i = 0; i < CMN_REGS_SIZE; i++)
-+ for (i = 0; i < MERAM_REGS_SIZE; i++)
- meram_write_reg(priv->base, common_regs[i], priv->regs[i]);
- return 0;
- }
-@@ -593,15 +590,8 @@ static const struct dev_pm_ops sh_mobile_meram_dev_pm_ops = {
- .runtime_resume = sh_mobile_meram_runtime_resume,
- };
-
--static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
-- .module = THIS_MODULE,
-- .meram_register = sh_mobile_meram_register,
-- .meram_unregister = sh_mobile_meram_unregister,
-- .meram_update = sh_mobile_meram_update,
--};
--
--/*
-- * initialize MERAM
-+/* -----------------------------------------------------------------------------
-+ * Probe/remove and driver init/exit
- */
-
- static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0189-fbdev-sh_mobile_meram-Use-genalloc-to-manage-MERAM-a.patch b/patches.armadillo800eva/0189-fbdev-sh_mobile_meram-Use-genalloc-to-manage-MERAM-a.patch
deleted file mode 100644
index ecd5a725040ff1..00000000000000
--- a/patches.armadillo800eva/0189-fbdev-sh_mobile_meram-Use-genalloc-to-manage-MERAM-a.patch
+++ /dev/null
@@ -1,366 +0,0 @@
-From 07e420f34a6c0bc33d43d82dd2cd4098df0ee623 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 19 Sep 2011 11:40:31 +0200
-Subject: fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation
-
-Instead of requiring the users to hardcode MERAM allocation in platform
-data, allocate blocks at runtime using genalloc.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 974d250be2c70c7bf899275b23b241685d4ed7f8)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ap4evb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 4 --
- arch/arm/mach-shmobile/board-mackerel.c | 4 --
- drivers/video/Kconfig | 1 +
- drivers/video/sh_mobile_meram.c | 112 +++++++++++++++++++------------
- include/video/sh_mobile_meram.h | 1 -
- 5 files changed, 71 insertions(+), 51 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 3cf12de..5f2735b 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -474,13 +474,11 @@ static struct sh_mobile_meram_cfg lcd_meram_cfg = {
- .icb[0] = {
- .marker_icb = 28,
- .cache_icb = 24,
-- .meram_offset = 0x0,
- .meram_size = 0x40,
- },
- .icb[1] = {
- .marker_icb = 29,
- .cache_icb = 25,
-- .meram_offset = 0x40,
- .meram_size = 0x40,
- },
- };
-@@ -769,13 +767,11 @@ static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
- .icb[0] = {
- .marker_icb = 30,
- .cache_icb = 26,
-- .meram_offset = 0x80,
- .meram_size = 0x100,
- },
- .icb[1] = {
- .marker_icb = 31,
- .cache_icb = 27,
-- .meram_offset = 0x180,
- .meram_size = 0x100,
- },
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 31d99e5..1fd4423 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -371,13 +371,11 @@ static struct sh_mobile_meram_cfg lcd_meram_cfg = {
- .icb[0] = {
- .marker_icb = 28,
- .cache_icb = 24,
-- .meram_offset = 0x0,
- .meram_size = 0x40,
- },
- .icb[1] = {
- .marker_icb = 29,
- .cache_icb = 25,
-- .meram_offset = 0x40,
- .meram_size = 0x40,
- },
- };
-@@ -434,13 +432,11 @@ static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
- .icb[0] = {
- .marker_icb = 30,
- .cache_icb = 26,
-- .meram_offset = 0x80,
- .meram_size = 0x100,
- },
- .icb[1] = {
- .marker_icb = 31,
- .cache_icb = 27,
-- .meram_offset = 0x180,
- .meram_size = 0x100,
- },
- };
-diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
-index 549b960..2316535 100644
---- a/drivers/video/Kconfig
-+++ b/drivers/video/Kconfig
-@@ -1994,6 +1994,7 @@ config FB_SH_MOBILE_HDMI
- config FB_SH_MOBILE_MERAM
- tristate "SuperH Mobile MERAM read ahead support for LCDC"
- depends on FB_SH_MOBILE_LCDC
-+ select GENERIC_ALLOCATOR
- default y
- ---help---
- Enable MERAM support for the SH-Mobile LCD controller.
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 30a3305..92dc9bd 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -10,6 +10,7 @@
- */
-
- #include <linux/device.h>
-+#include <linux/genalloc.h>
- #include <linux/io.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
-@@ -105,15 +106,17 @@ static const unsigned long icb_regs[] = {
- /*
- * sh_mobile_meram_icb - MERAM ICB information
- * @regs: Registers cache
-- * @region: Start and end addresses of the MERAM region
-+ * @offset: MERAM block offset
-+ * @size: MERAM block size in bytes
- * @cache_unit: Bytes to cache per ICB
- * @pixelformat: Video pixel format of the data stored in the ICB
- * @current_reg: Which of Start Address Register A (0) or B (1) is in use
- */
- struct sh_mobile_meram_icb {
- unsigned long regs[ICB_REGS_SIZE];
-+ unsigned long offset;
-+ unsigned int size;
-
-- unsigned long region;
- unsigned int cache_unit;
- unsigned int pixelformat;
- unsigned int current_reg;
-@@ -124,21 +127,27 @@ struct sh_mobile_meram_icb {
- /*
- * sh_mobile_meram_priv - MERAM device
- * @base: Registers base address
-+ * @meram: MERAM physical address
- * @regs: Registers cache
- * @lock: Protects used_icb and icbs
- * @used_icb: Bitmask of used ICBs
- * @icbs: ICBs
-+ * @pool: Allocation pool to manage the MERAM
- */
- struct sh_mobile_meram_priv {
- void __iomem *base;
-+ unsigned long meram;
- unsigned long regs[MERAM_REGS_SIZE];
-
- struct mutex lock;
- unsigned long used_icb;
- struct sh_mobile_meram_icb icbs[MERAM_ICB_NUM];
-+
-+ struct gen_pool *pool;
- };
-
- /* settings */
-+#define MERAM_GRANULARITY 1024
- #define MERAM_SEC_LINE 15
- #define MERAM_LINE_WIDTH 2048
-
-@@ -175,18 +184,10 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- * Allocation
- */
-
--#define MERAM_CACHE_START(p) ((p) >> 16)
--#define MERAM_CACHE_END(p) ((p) & 0xffff)
--#define MERAM_CACHE_SET(o, s) ((((o) & 0xffff) << 16) | \
-- (((o) + (s) - 1) & 0xffff))
--
- /* Check if there's no overlaps in MERAM allocation. */
- static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *new)
- {
-- unsigned int used_start, used_end, meram_start, meram_end;
-- unsigned int i;
--
- /* valid ICB? */
- if (new->marker_icb & ~0x1f || new->cache_icb & ~0x1f)
- return 1;
-@@ -195,43 +196,40 @@ static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
- test_bit(new->cache_icb, &priv->used_icb))
- return 1;
-
-- for (i = 0; i < MERAM_ICB_NUM; i++) {
-- if (!test_bit(i, &priv->used_icb))
-- continue;
--
-- used_start = MERAM_CACHE_START(priv->icbs[i].region);
-- used_end = MERAM_CACHE_END(priv->icbs[i].region);
-- meram_start = new->meram_offset;
-- meram_end = new->meram_offset + new->meram_size;
--
-- if ((meram_start >= used_start && meram_start < used_end) ||
-- (meram_end > used_start && meram_end < used_end))
-- return 1;
-- }
--
- return 0;
- }
-
--/* Mark the specified ICB as used. */
--static void meram_mark(struct sh_mobile_meram_priv *priv,
-+/* Allocate memory for the ICBs and mark them as used. */
-+static int meram_alloc(struct sh_mobile_meram_priv *priv,
- const struct sh_mobile_meram_icb_cfg *new,
- int pixelformat)
- {
-+ struct sh_mobile_meram_icb *marker = &priv->icbs[new->marker_icb];
-+ unsigned long mem;
-+
-+ mem = gen_pool_alloc(priv->pool, new->meram_size * 1024);
-+ if (mem == 0)
-+ return -ENOMEM;
-+
- __set_bit(new->marker_icb, &priv->used_icb);
- __set_bit(new->cache_icb, &priv->used_icb);
-
-- priv->icbs[new->marker_icb].region = MERAM_CACHE_SET(new->meram_offset,
-- new->meram_size);
-- priv->icbs[new->cache_icb].region = MERAM_CACHE_SET(new->meram_offset,
-- new->meram_size);
-- priv->icbs[new->marker_icb].current_reg = 1;
-- priv->icbs[new->marker_icb].pixelformat = pixelformat;
-+ marker->offset = mem - priv->meram;
-+ marker->size = new->meram_size * 1024;
-+ marker->current_reg = 1;
-+ marker->pixelformat = pixelformat;
-+
-+ return 0;
- }
-
- /* Unmark the specified ICB as used. */
--static void meram_unmark(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *icb)
-+static void meram_free(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_icb_cfg *icb)
- {
-+ struct sh_mobile_meram_icb *marker = &priv->icbs[icb->marker_icb];
-+
-+ gen_pool_free(priv->pool, priv->meram + marker->offset, marker->size);
-+
- __clear_bit(icb->marker_icb, &priv->used_icb);
- __clear_bit(icb->cache_icb, &priv->used_icb);
- }
-@@ -302,6 +300,7 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- unsigned int xres, unsigned int yres,
- unsigned int *out_pitch)
- {
-+ struct sh_mobile_meram_icb *marker = &priv->icbs[icb->marker_icb];
- unsigned long total_byte_count = MERAM_CALC_BYTECOUNT(xres, yres);
- unsigned long bnm;
- unsigned int lcdc_pitch;
-@@ -356,11 +355,11 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- * we also split the allocated MERAM buffer between two ICBs.
- */
- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(icb->marker_icb, icb->meram_offset) |
-+ MERAM_MExxCTL_VAL(icb->marker_icb, marker->offset) |
- MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
- MExxCTL_MD_FB);
- meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(icb->cache_icb, icb->meram_offset +
-+ MERAM_MExxCTL_VAL(icb->cache_icb, marker->offset +
- icb->meram_size / 2) |
- MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
- MExxCTL_MD_FB);
-@@ -454,10 +453,18 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- goto err;
- }
-
-- /* we now register the ICB */
-- meram_mark(priv, &cfg->icb[0], pixelformat);
-- if (is_nvcolor(pixelformat))
-- meram_mark(priv, &cfg->icb[1], pixelformat);
-+ /* We now register the ICBs and allocate the MERAM regions. */
-+ error = meram_alloc(priv, &cfg->icb[0], pixelformat);
-+ if (error < 0)
-+ goto err;
-+
-+ if (is_nvcolor(pixelformat)) {
-+ error = meram_alloc(priv, &cfg->icb[1], pixelformat);
-+ if (error < 0) {
-+ meram_free(priv, &cfg->icb[0]);
-+ goto err;
-+ }
-+ }
-
- /* initialize MERAM */
- meram_init(priv, &cfg->icb[0], xres, yres, &out_pitch);
-@@ -497,10 +504,10 @@ static int sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata,
- /* deinit & unmark */
- if (is_nvcolor(icb->pixelformat)) {
- meram_deinit(priv, &cfg->icb[1]);
-- meram_unmark(priv, &cfg->icb[1]);
-+ meram_free(priv, &cfg->icb[1]);
- }
- meram_deinit(priv, &cfg->icb[0]);
-- meram_unmark(priv, &cfg->icb[0]);
-+ meram_free(priv, &cfg->icb[0]);
-
- mutex_unlock(&priv->lock);
-
-@@ -626,6 +633,7 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- pdata->priv = priv;
- pdata->pdev = pdev;
-
-+ /* Request memory regions and remap the registers. */
- if (!request_mem_region(regs->start, resource_size(regs), pdev->name)) {
- dev_err(&pdev->dev, "MERAM registers region already claimed\n");
- error = -EBUSY;
-@@ -646,6 +654,20 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- goto err_ioremap;
- }
-
-+ priv->meram = meram->start;
-+
-+ /* Create and initialize the MERAM memory pool. */
-+ priv->pool = gen_pool_create(ilog2(MERAM_GRANULARITY), -1);
-+ if (priv->pool == NULL) {
-+ error = -ENOMEM;
-+ goto err_genpool;
-+ }
-+
-+ error = gen_pool_add(priv->pool, meram->start, resource_size(meram),
-+ -1);
-+ if (error < 0)
-+ goto err_genpool;
-+
- /* initialize ICB addressing mode */
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE1)
- meram_write_reg(priv->base, MEVCR1, MEVCR1_AMD1);
-@@ -657,6 +679,10 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
-
- return 0;
-
-+err_genpool:
-+ if (priv->pool)
-+ gen_pool_destroy(priv->pool);
-+ iounmap(priv->base);
- err_ioremap:
- release_mem_region(meram->start, resource_size(meram));
- err_req_meram:
-@@ -677,6 +703,8 @@ static int sh_mobile_meram_remove(struct platform_device *pdev)
-
- pm_runtime_disable(&pdev->dev);
-
-+ gen_pool_destroy(priv->pool);
-+
- iounmap(priv->base);
- release_mem_region(meram->start, resource_size(meram));
- release_mem_region(regs->start, resource_size(regs));
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index 05ca3f9..f7700fc 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -28,7 +28,6 @@ struct sh_mobile_meram_info {
- struct sh_mobile_meram_icb_cfg {
- unsigned int marker_icb; /* ICB # for Marker ICB */
- unsigned int cache_icb; /* ICB # for Cache ICB */
-- unsigned int meram_offset; /* MERAM Buffer Offset to use */
- unsigned int meram_size; /* MERAM Buffer Size to use */
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0190-fbdev-sh_mobile_meram-Allocate-ICBs-automatically.patch b/patches.armadillo800eva/0190-fbdev-sh_mobile_meram-Allocate-ICBs-automatically.patch
deleted file mode 100644
index ded459307495a9..00000000000000
--- a/patches.armadillo800eva/0190-fbdev-sh_mobile_meram-Allocate-ICBs-automatically.patch
+++ /dev/null
@@ -1,740 +0,0 @@
-From f5284c79b76aaa4ee85b22de136984d21654f3c2 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 12 Dec 2011 16:36:13 +0100
-Subject: fbdev: sh_mobile_meram: Allocate ICBs automatically
-
-Instead of manually specifying the ICBs to use in platform data,
-allocate them automatically at runtime. The range of reserved ICBs (for
-instance to be used through UIO), if any, is passed in the platform data
-reserved_icbs field as a bitmask.
-
-The MERAM registration function now returns a pointer to an opaque MERAM
-object, which is passed to the update and unregistration functions.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 481100506b34d666243832c3f2aee905c03cb8e7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 27 ++-
- drivers/video/sh_mobile_lcdcfb.h | 2 +-
- drivers/video/sh_mobile_meram.c | 345 ++++++++++++++++++++------------------
- include/video/sh_mobile_meram.h | 27 +--
- 4 files changed, 215 insertions(+), 186 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index adc911f..d0c9026 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -840,6 +840,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
- struct sh_mobile_meram_cfg *cfg;
- int pixelformat;
-+ void *meram;
-
- ch = &priv->ch[k];
- if (!ch->enabled)
-@@ -856,9 +857,9 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- /* we need to de-init configured ICBs before we can
- * re-initialize them.
- */
-- if (ch->meram_enabled) {
-- mdev->ops->meram_unregister(mdev, cfg);
-- ch->meram_enabled = 0;
-+ if (ch->meram) {
-+ mdev->ops->meram_unregister(mdev, ch->meram);
-+ ch->meram = NULL;
- }
-
- switch (ch->format->fourcc) {
-@@ -880,13 +881,13 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- break;
- }
-
-- ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
-+ meram = mdev->ops->meram_register(mdev, cfg, ch->pitch,
- ch->yres, pixelformat,
- ch->base_addr_y, ch->base_addr_c,
- &ch->base_addr_y, &ch->base_addr_c,
- &ch->pitch);
-- if (!ret)
-- ch->meram_enabled = 1;
-+ if (!IS_ERR(meram))
-+ ch->meram = meram;
- }
-
- /* Start the LCDC. */
-@@ -951,13 +952,11 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
- sh_mobile_lcdc_display_off(ch);
-
- /* disable the meram */
-- if (ch->meram_enabled) {
-- struct sh_mobile_meram_cfg *cfg;
-+ if (ch->meram) {
- struct sh_mobile_meram_info *mdev;
-- cfg = ch->cfg.meram_cfg;
- mdev = priv->meram_dev;
-- mdev->ops->meram_unregister(mdev, cfg);
-- ch->meram_enabled = 0;
-+ mdev->ops->meram_unregister(mdev, ch->meram);
-+ ch->meram = 0;
- }
-
- }
-@@ -1070,14 +1069,12 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
- base_addr_c += var->xoffset;
- }
-
-- if (ch->meram_enabled) {
-- struct sh_mobile_meram_cfg *cfg;
-+ if (ch->meram) {
- struct sh_mobile_meram_info *mdev;
- int ret;
-
-- cfg = ch->cfg.meram_cfg;
- mdev = priv->meram_dev;
-- ret = mdev->ops->meram_update(mdev, cfg,
-+ ret = mdev->ops->meram_update(mdev, ch->meram,
- base_addr_y, base_addr_c,
- &base_addr_y, &base_addr_c);
- if (ret)
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index 19a4cd7..bf1707c 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -59,7 +59,7 @@ struct sh_mobile_lcdc_chan {
- unsigned long *reg_offs;
- unsigned long ldmt1r_value;
- unsigned long enabled; /* ME and SE in LDCNT2R */
-- int meram_enabled;
-+ void *meram;
-
- struct mutex open_lock; /* protects the use counter */
- int use_count;
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 92dc9bd..085c49a 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -10,6 +10,7 @@
- */
-
- #include <linux/device.h>
-+#include <linux/err.h>
- #include <linux/genalloc.h>
- #include <linux/io.h>
- #include <linux/kernel.h>
-@@ -106,14 +107,16 @@ static const unsigned long icb_regs[] = {
- /*
- * sh_mobile_meram_icb - MERAM ICB information
- * @regs: Registers cache
-+ * @index: ICB index
- * @offset: MERAM block offset
-- * @size: MERAM block size in bytes
-+ * @size: MERAM block size in KiB
- * @cache_unit: Bytes to cache per ICB
- * @pixelformat: Video pixel format of the data stored in the ICB
- * @current_reg: Which of Start Address Register A (0) or B (1) is in use
- */
- struct sh_mobile_meram_icb {
- unsigned long regs[ICB_REGS_SIZE];
-+ unsigned int index;
- unsigned long offset;
- unsigned int size;
-
-@@ -124,6 +127,16 @@ struct sh_mobile_meram_icb {
-
- #define MERAM_ICB_NUM 32
-
-+struct sh_mobile_meram_fb_plane {
-+ struct sh_mobile_meram_icb *marker;
-+ struct sh_mobile_meram_icb *cache;
-+};
-+
-+struct sh_mobile_meram_fb_cache {
-+ unsigned int nplanes;
-+ struct sh_mobile_meram_fb_plane planes[2];
-+};
-+
- /*
- * sh_mobile_meram_priv - MERAM device
- * @base: Registers base address
-@@ -184,54 +197,46 @@ static inline unsigned long meram_read_reg(void __iomem *base, unsigned int off)
- * Allocation
- */
-
--/* Check if there's no overlaps in MERAM allocation. */
--static int meram_check_overlap(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *new)
-+/* Allocate ICBs and MERAM for a plane. */
-+static int __meram_alloc(struct sh_mobile_meram_priv *priv,
-+ struct sh_mobile_meram_fb_plane *plane,
-+ size_t size)
- {
-- /* valid ICB? */
-- if (new->marker_icb & ~0x1f || new->cache_icb & ~0x1f)
-- return 1;
--
-- if (test_bit(new->marker_icb, &priv->used_icb) ||
-- test_bit(new->cache_icb, &priv->used_icb))
-- return 1;
-+ unsigned long mem;
-+ unsigned long idx;
-
-- return 0;
--}
-+ idx = find_first_zero_bit(&priv->used_icb, 28);
-+ if (idx == 28)
-+ return -ENOMEM;
-+ plane->cache = &priv->icbs[idx];
-
--/* Allocate memory for the ICBs and mark them as used. */
--static int meram_alloc(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *new,
-- int pixelformat)
--{
-- struct sh_mobile_meram_icb *marker = &priv->icbs[new->marker_icb];
-- unsigned long mem;
-+ idx = find_next_zero_bit(&priv->used_icb, 32, 28);
-+ if (idx == 32)
-+ return -ENOMEM;
-+ plane->marker = &priv->icbs[idx];
-
-- mem = gen_pool_alloc(priv->pool, new->meram_size * 1024);
-+ mem = gen_pool_alloc(priv->pool, size * 1024);
- if (mem == 0)
- return -ENOMEM;
-
-- __set_bit(new->marker_icb, &priv->used_icb);
-- __set_bit(new->cache_icb, &priv->used_icb);
-+ __set_bit(plane->marker->index, &priv->used_icb);
-+ __set_bit(plane->cache->index, &priv->used_icb);
-
-- marker->offset = mem - priv->meram;
-- marker->size = new->meram_size * 1024;
-- marker->current_reg = 1;
-- marker->pixelformat = pixelformat;
-+ plane->marker->offset = mem - priv->meram;
-+ plane->marker->size = size;
-
- return 0;
- }
-
--/* Unmark the specified ICB as used. */
--static void meram_free(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *icb)
-+/* Free ICBs and MERAM for a plane. */
-+static void __meram_free(struct sh_mobile_meram_priv *priv,
-+ struct sh_mobile_meram_fb_plane *plane)
- {
-- struct sh_mobile_meram_icb *marker = &priv->icbs[icb->marker_icb];
-+ gen_pool_free(priv->pool, priv->meram + plane->marker->offset,
-+ plane->marker->size * 1024);
-
-- gen_pool_free(priv->pool, priv->meram + marker->offset, marker->size);
--
-- __clear_bit(icb->marker_icb, &priv->used_icb);
-- __clear_bit(icb->cache_icb, &priv->used_icb);
-+ __clear_bit(plane->marker->index, &priv->used_icb);
-+ __clear_bit(plane->cache->index, &priv->used_icb);
- }
-
- /* Is this a YCbCr(NV12, NV16 or NV24) colorspace? */
-@@ -243,42 +248,96 @@ static int is_nvcolor(int cspace)
- return 0;
- }
-
-+/* Allocate memory for the ICBs and mark them as used. */
-+static struct sh_mobile_meram_fb_cache *
-+meram_alloc(struct sh_mobile_meram_priv *priv,
-+ const struct sh_mobile_meram_cfg *cfg,
-+ int pixelformat)
-+{
-+ struct sh_mobile_meram_fb_cache *cache;
-+ unsigned int nplanes = is_nvcolor(pixelformat) ? 2 : 1;
-+ int ret;
-+
-+ if (cfg->icb[0].meram_size == 0)
-+ return ERR_PTR(-EINVAL);
-+
-+ if (nplanes == 2 && cfg->icb[1].meram_size == 0)
-+ return ERR_PTR(-EINVAL);
-+
-+ cache = kzalloc(sizeof(*cache), GFP_KERNEL);
-+ if (cache == NULL)
-+ return ERR_PTR(-ENOMEM);
-+
-+ cache->nplanes = nplanes;
-+
-+ ret = __meram_alloc(priv, &cache->planes[0], cfg->icb[0].meram_size);
-+ if (ret < 0)
-+ goto error;
-+
-+ cache->planes[0].marker->current_reg = 1;
-+ cache->planes[0].marker->pixelformat = pixelformat;
-+
-+ if (cache->nplanes == 1)
-+ return cache;
-+
-+ ret = __meram_alloc(priv, &cache->planes[1], cfg->icb[1].meram_size);
-+ if (ret < 0) {
-+ __meram_free(priv, &cache->planes[0]);
-+ goto error;
-+ }
-+
-+ return cache;
-+
-+error:
-+ kfree(cache);
-+ return ERR_PTR(-ENOMEM);
-+}
-+
-+/* Unmark the specified ICB as used. */
-+static void meram_free(struct sh_mobile_meram_priv *priv,
-+ struct sh_mobile_meram_fb_cache *cache)
-+{
-+ __meram_free(priv, &cache->planes[0]);
-+ if (cache->nplanes == 2)
-+ __meram_free(priv, &cache->planes[1]);
-+
-+ kfree(cache);
-+}
-+
- /* Set the next address to fetch. */
- static void meram_set_next_addr(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_cfg *cfg,
-+ struct sh_mobile_meram_fb_cache *cache,
- unsigned long base_addr_y,
- unsigned long base_addr_c)
- {
-- struct sh_mobile_meram_icb *icb = &priv->icbs[cfg->icb[0].marker_icb];
-+ struct sh_mobile_meram_icb *icb = cache->planes[0].marker;
- unsigned long target;
-
- icb->current_reg ^= 1;
- target = icb->current_reg ? MExxSARB : MExxSARA;
-
- /* set the next address to fetch */
-- meram_write_icb(priv->base, cfg->icb[0].cache_icb, target,
-+ meram_write_icb(priv->base, cache->planes[0].cache->index, target,
- base_addr_y);
-- meram_write_icb(priv->base, cfg->icb[0].marker_icb, target,
-- base_addr_y +
-- priv->icbs[cfg->icb[0].marker_icb].cache_unit);
--
-- if (is_nvcolor(icb->pixelformat)) {
-- meram_write_icb(priv->base, cfg->icb[1].cache_icb, target,
-- base_addr_c);
-- meram_write_icb(priv->base, cfg->icb[1].marker_icb, target,
-- base_addr_c +
-- priv->icbs[cfg->icb[1].marker_icb].cache_unit);
-+ meram_write_icb(priv->base, cache->planes[0].marker->index, target,
-+ base_addr_y + cache->planes[0].marker->cache_unit);
-+
-+ if (cache->nplanes == 2) {
-+ meram_write_icb(priv->base, cache->planes[1].cache->index,
-+ target, base_addr_c);
-+ meram_write_icb(priv->base, cache->planes[1].marker->index,
-+ target, base_addr_c +
-+ cache->planes[1].marker->cache_unit);
- }
- }
-
- /* Get the next ICB address. */
- static void
- meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
-- const struct sh_mobile_meram_cfg *cfg,
-+ struct sh_mobile_meram_fb_cache *cache,
- unsigned long *icb_addr_y, unsigned long *icb_addr_c)
- {
-- struct sh_mobile_meram_priv *priv = pdata->priv;
-- struct sh_mobile_meram_icb *icb = &priv->icbs[cfg->icb[0].marker_icb];
-+ struct sh_mobile_meram_icb *icb = cache->planes[0].marker;
- unsigned long icb_offset;
-
- if (pdata->addr_mode == SH_MOBILE_MERAM_MODE0)
-@@ -286,9 +345,10 @@ meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
- else
- icb_offset = 0xc0000000 | (icb->current_reg << 23);
-
-- *icb_addr_y = icb_offset | (cfg->icb[0].marker_icb << 24);
-- if (is_nvcolor(icb->pixelformat))
-- *icb_addr_c = icb_offset | (cfg->icb[1].marker_icb << 24);
-+ *icb_addr_y = icb_offset | (cache->planes[0].marker->index << 24);
-+ if (cache->nplanes == 2)
-+ *icb_addr_c = icb_offset
-+ | (cache->planes[1].marker->index << 24);
- }
-
- #define MERAM_CALC_BYTECOUNT(x, y) \
-@@ -296,11 +356,11 @@ meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata,
-
- /* Initialize MERAM. */
- static int meram_init(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *icb,
-+ struct sh_mobile_meram_fb_plane *plane,
- unsigned int xres, unsigned int yres,
- unsigned int *out_pitch)
- {
-- struct sh_mobile_meram_icb *marker = &priv->icbs[icb->marker_icb];
-+ struct sh_mobile_meram_icb *marker = plane->marker;
- unsigned long total_byte_count = MERAM_CALC_BYTECOUNT(xres, yres);
- unsigned long bnm;
- unsigned int lcdc_pitch;
-@@ -319,13 +379,13 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- lcdc_pitch = xpitch = MERAM_LINE_WIDTH;
- line_cnt = total_byte_count >> 11;
- *out_pitch = xres;
-- save_lines = (icb->meram_size / 16 / MERAM_SEC_LINE);
-+ save_lines = plane->marker->size / 16 / MERAM_SEC_LINE;
- save_lines *= MERAM_SEC_LINE;
- } else {
- xpitch = xres;
- line_cnt = yres;
- *out_pitch = lcdc_pitch;
-- save_lines = icb->meram_size / (lcdc_pitch >> 10) / 2;
-+ save_lines = plane->marker->size / (lcdc_pitch >> 10) / 2;
- save_lines &= 0xff;
- }
- bnm = (save_lines - 1) << 16;
-@@ -333,20 +393,20 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- /* TODO: we better to check if we have enough MERAM buffer size */
-
- /* set up ICB */
-- meram_write_icb(priv->base, icb->cache_icb, MExxBSIZE,
-+ meram_write_icb(priv->base, plane->cache->index, MExxBSIZE,
- MERAM_MExxBSIZE_VAL(0x0, line_cnt - 1, xpitch - 1));
-- meram_write_icb(priv->base, icb->marker_icb, MExxBSIZE,
-+ meram_write_icb(priv->base, plane->marker->index, MExxBSIZE,
- MERAM_MExxBSIZE_VAL(0xf, line_cnt - 1, xpitch - 1));
-
-- meram_write_icb(priv->base, icb->cache_icb, MExxMNCF, bnm);
-- meram_write_icb(priv->base, icb->marker_icb, MExxMNCF, bnm);
-+ meram_write_icb(priv->base, plane->cache->index, MExxMNCF, bnm);
-+ meram_write_icb(priv->base, plane->marker->index, MExxMNCF, bnm);
-
-- meram_write_icb(priv->base, icb->cache_icb, MExxSBSIZE, xpitch);
-- meram_write_icb(priv->base, icb->marker_icb, MExxSBSIZE, xpitch);
-+ meram_write_icb(priv->base, plane->cache->index, MExxSBSIZE, xpitch);
-+ meram_write_icb(priv->base, plane->marker->index, MExxSBSIZE, xpitch);
-
- /* save a cache unit size */
-- priv->icbs[icb->cache_icb].cache_unit = xres * save_lines;
-- priv->icbs[icb->marker_icb].cache_unit = xres * save_lines;
-+ plane->cache->cache_unit = xres * save_lines;
-+ plane->marker->cache_unit = xres * save_lines;
-
- /*
- * Set MERAM for framebuffer
-@@ -354,13 +414,13 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- * we also chain the cache_icb and the marker_icb.
- * we also split the allocated MERAM buffer between two ICBs.
- */
-- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(icb->marker_icb, marker->offset) |
-- MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
-+ meram_write_icb(priv->base, plane->cache->index, MExxCTL,
-+ MERAM_MExxCTL_VAL(plane->marker->index, marker->offset)
-+ | MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
- MExxCTL_MD_FB);
-- meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
-- MERAM_MExxCTL_VAL(icb->cache_icb, marker->offset +
-- icb->meram_size / 2) |
-+ meram_write_icb(priv->base, plane->marker->index, MExxCTL,
-+ MERAM_MExxCTL_VAL(plane->cache->index, marker->offset +
-+ plane->marker->size / 2) |
- MExxCTL_WD1 | MExxCTL_WD0 | MExxCTL_WS | MExxCTL_CM |
- MExxCTL_MD_FB);
-
-@@ -368,45 +428,44 @@ static int meram_init(struct sh_mobile_meram_priv *priv,
- }
-
- static void meram_deinit(struct sh_mobile_meram_priv *priv,
-- const struct sh_mobile_meram_icb_cfg *icb)
-+ struct sh_mobile_meram_fb_plane *plane)
- {
- /* disable ICB */
-- meram_write_icb(priv->base, icb->cache_icb, MExxCTL,
-+ meram_write_icb(priv->base, plane->cache->index, MExxCTL,
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
-- meram_write_icb(priv->base, icb->marker_icb, MExxCTL,
-+ meram_write_icb(priv->base, plane->marker->index, MExxCTL,
- MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF);
-
-- priv->icbs[icb->cache_icb].cache_unit = 0;
-- priv->icbs[icb->marker_icb].cache_unit = 0;
-+ plane->cache->cache_unit = 0;
-+ plane->marker->cache_unit = 0;
- }
-
- /* -----------------------------------------------------------------------------
- * Registration/unregistration
- */
-
--static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
-- const struct sh_mobile_meram_cfg *cfg,
-- unsigned int xres, unsigned int yres,
-- unsigned int pixelformat,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c,
-- unsigned int *pitch)
-+static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
-+ const struct sh_mobile_meram_cfg *cfg,
-+ unsigned int xres, unsigned int yres,
-+ unsigned int pixelformat,
-+ unsigned long base_addr_y,
-+ unsigned long base_addr_c,
-+ unsigned long *icb_addr_y,
-+ unsigned long *icb_addr_c,
-+ unsigned int *pitch)
- {
-- struct platform_device *pdev;
-+ struct sh_mobile_meram_fb_cache *cache;
- struct sh_mobile_meram_priv *priv;
-+ struct platform_device *pdev;
- unsigned int out_pitch;
-- unsigned int n;
-- int error = 0;
-
- if (!pdata || !pdata->priv || !pdata->pdev || !cfg)
-- return -EINVAL;
-+ return ERR_PTR(-EINVAL);
-
- if (pixelformat != SH_MOBILE_MERAM_PF_NV &&
- pixelformat != SH_MOBILE_MERAM_PF_NV24 &&
- pixelformat != SH_MOBILE_MERAM_PF_RGB)
-- return -EINVAL;
-+ return ERR_PTR(-EINVAL);
-
- priv = pdata->priv;
- pdev = pdata->pdev;
-@@ -418,120 +477,82 @@ static int sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- /* we can't handle wider than 8192px */
- if (xres > 8192) {
- dev_err(&pdev->dev, "width exceeding the limit (> 8192).");
-- return -EINVAL;
-- }
--
-- /* do we have at least one ICB config? */
-- if (cfg->icb[0].marker_icb < 0 || cfg->icb[0].cache_icb < 0) {
-- dev_err(&pdev->dev, "at least one ICB is required.");
-- return -EINVAL;
-+ return ERR_PTR(-EINVAL);
- }
-
- mutex_lock(&priv->lock);
-
-- /* make sure that there's no overlaps */
-- if (meram_check_overlap(priv, &cfg->icb[0])) {
-- dev_err(&pdev->dev, "conflicting config detected.");
-- error = -EINVAL;
-- goto err;
-- }
-- n = 1;
--
-- /* do the same if we have the second ICB set */
-- if (cfg->icb[1].marker_icb >= 0 && cfg->icb[1].cache_icb >= 0) {
-- if (meram_check_overlap(priv, &cfg->icb[1])) {
-- dev_err(&pdev->dev, "conflicting config detected.");
-- error = -EINVAL;
-- goto err;
-- }
-- n = 2;
-- }
--
-- if (is_nvcolor(pixelformat) && n != 2) {
-- dev_err(&pdev->dev, "requires two ICB sets for planar Y/C.");
-- error = -EINVAL;
-- goto err;
-- }
--
- /* We now register the ICBs and allocate the MERAM regions. */
-- error = meram_alloc(priv, &cfg->icb[0], pixelformat);
-- if (error < 0)
-+ cache = meram_alloc(priv, cfg, pixelformat);
-+ if (IS_ERR(cache)) {
-+ dev_err(&pdev->dev, "MERAM allocation failed (%ld).",
-+ PTR_ERR(cache));
- goto err;
--
-- if (is_nvcolor(pixelformat)) {
-- error = meram_alloc(priv, &cfg->icb[1], pixelformat);
-- if (error < 0) {
-- meram_free(priv, &cfg->icb[0]);
-- goto err;
-- }
- }
-
- /* initialize MERAM */
-- meram_init(priv, &cfg->icb[0], xres, yres, &out_pitch);
-+ meram_init(priv, &cache->planes[0], xres, yres, &out_pitch);
- *pitch = out_pitch;
- if (pixelformat == SH_MOBILE_MERAM_PF_NV)
-- meram_init(priv, &cfg->icb[1], xres, (yres + 1) / 2,
-+ meram_init(priv, &cache->planes[1], xres, (yres + 1) / 2,
- &out_pitch);
- else if (pixelformat == SH_MOBILE_MERAM_PF_NV24)
-- meram_init(priv, &cfg->icb[1], 2 * xres, (yres + 1) / 2,
-+ meram_init(priv, &cache->planes[1], 2 * xres, (yres + 1) / 2,
- &out_pitch);
-
-- meram_set_next_addr(priv, cfg, base_addr_y, base_addr_c);
-- meram_get_next_icb_addr(pdata, cfg, icb_addr_y, icb_addr_c);
-+ meram_set_next_addr(priv, cache, base_addr_y, base_addr_c);
-+ meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c);
-
- dev_dbg(&pdev->dev, "registered - can access via y=%08lx, c=%08lx",
- *icb_addr_y, *icb_addr_c);
-
- err:
- mutex_unlock(&priv->lock);
-- return error;
-+ return cache;
- }
-
--static int sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata,
-- const struct sh_mobile_meram_cfg *cfg)
-+static int
-+sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data)
- {
-+ struct sh_mobile_meram_fb_cache *cache = data;
- struct sh_mobile_meram_priv *priv;
-- struct sh_mobile_meram_icb *icb;
-
-- if (!pdata || !pdata->priv || !cfg)
-+ if (!pdata || !pdata->priv || !data)
- return -EINVAL;
-
- priv = pdata->priv;
-- icb = &priv->icbs[cfg->icb[0].marker_icb];
-
- mutex_lock(&priv->lock);
-
-- /* deinit & unmark */
-- if (is_nvcolor(icb->pixelformat)) {
-- meram_deinit(priv, &cfg->icb[1]);
-- meram_free(priv, &cfg->icb[1]);
-- }
-- meram_deinit(priv, &cfg->icb[0]);
-- meram_free(priv, &cfg->icb[0]);
-+ /* deinit & free */
-+ meram_deinit(priv, &cache->planes[0]);
-+ if (cache->nplanes == 2)
-+ meram_deinit(priv, &cache->planes[1]);
-+
-+ meram_free(priv, cache);
-
- mutex_unlock(&priv->lock);
-
- return 0;
- }
-
--static int sh_mobile_meram_update(struct sh_mobile_meram_info *pdata,
-- const struct sh_mobile_meram_cfg *cfg,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c)
-+static int
-+sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data,
-+ unsigned long base_addr_y, unsigned long base_addr_c,
-+ unsigned long *icb_addr_y, unsigned long *icb_addr_c)
- {
-+ struct sh_mobile_meram_fb_cache *cache = data;
- struct sh_mobile_meram_priv *priv;
-
-- if (!pdata || !pdata->priv || !cfg)
-+ if (!pdata || !pdata->priv || !data)
- return -EINVAL;
-
- priv = pdata->priv;
-
- mutex_lock(&priv->lock);
-
-- meram_set_next_addr(priv, cfg, base_addr_y, base_addr_c);
-- meram_get_next_icb_addr(pdata, cfg, icb_addr_y, icb_addr_c);
-+ meram_set_next_addr(priv, cache, base_addr_y, base_addr_c);
-+ meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c);
-
- mutex_unlock(&priv->lock);
-
-@@ -607,6 +628,7 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- struct sh_mobile_meram_info *pdata = pdev->dev.platform_data;
- struct resource *regs;
- struct resource *meram;
-+ unsigned int i;
- int error;
-
- if (!pdata) {
-@@ -627,8 +649,13 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
- return -ENOMEM;
- }
-
-- /* initialize private data */
-+ /* Initialize private data. */
- mutex_init(&priv->lock);
-+ priv->used_icb = pdata->reserved_icbs;
-+
-+ for (i = 0; i < MERAM_ICB_NUM; ++i)
-+ priv->icbs[i].index = i;
-+
- pdata->ops = &sh_mobile_meram_ops;
- pdata->priv = priv;
- pdata->pdev = pdev;
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index f7700fc..e0f650c 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -17,8 +17,13 @@ enum {
- struct sh_mobile_meram_priv;
- struct sh_mobile_meram_ops;
-
-+/*
-+ * struct sh_mobile_meram_info - MERAM platform data
-+ * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
-+ */
- struct sh_mobile_meram_info {
- int addr_mode;
-+ u32 reserved_icbs;
- struct sh_mobile_meram_ops *ops;
- struct sh_mobile_meram_priv *priv;
- struct platform_device *pdev;
-@@ -39,23 +44,23 @@ struct module;
- struct sh_mobile_meram_ops {
- struct module *module;
- /* register usage of meram */
-- int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
-- const struct sh_mobile_meram_cfg *cfg,
-- unsigned int xres, unsigned int yres,
-- unsigned int pixelformat,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c,
-- unsigned int *pitch);
-+ void *(*meram_register)(struct sh_mobile_meram_info *meram_dev,
-+ const struct sh_mobile_meram_cfg *cfg,
-+ unsigned int xres, unsigned int yres,
-+ unsigned int pixelformat,
-+ unsigned long base_addr_y,
-+ unsigned long base_addr_c,
-+ unsigned long *icb_addr_y,
-+ unsigned long *icb_addr_c,
-+ unsigned int *pitch);
-
- /* unregister usage of meram */
- int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
-- const struct sh_mobile_meram_cfg *cfg);
-+ void *data);
-
- /* update meram settings */
- int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
-- const struct sh_mobile_meram_cfg *cfg,
-+ void *data,
- unsigned long base_addr_y,
- unsigned long base_addr_c,
- unsigned long *icb_addr_y,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0191-arm-mach-shmobile-Don-t-set-MERAM-ICB-numbers-in-pla.patch b/patches.armadillo800eva/0191-arm-mach-shmobile-Don-t-set-MERAM-ICB-numbers-in-pla.patch
deleted file mode 100644
index e8bbb54109f2bb..00000000000000
--- a/patches.armadillo800eva/0191-arm-mach-shmobile-Don-t-set-MERAM-ICB-numbers-in-pla.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From b98cf20fdb3a2c39ed58add64ec9524c04cd005e Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sun, 11 Sep 2011 23:30:45 +0200
-Subject: arm: mach-shmobile: Don't set MERAM ICB numbers in platform data
-
-The marker and cache ICBs are now allocated automatically, there's no
-need to specify them manually anymore.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit b0a49d98fa4315c17a098cb60ccc626645ed9756)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ap4evb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 8 --------
- arch/arm/mach-shmobile/board-mackerel.c | 8 --------
- 2 files changed, 16 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 5f2735b..629b0f4 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -472,13 +472,9 @@ const static struct fb_videomode ap4evb_lcdc_modes[] = {
- };
- static struct sh_mobile_meram_cfg lcd_meram_cfg = {
- .icb[0] = {
-- .marker_icb = 28,
-- .cache_icb = 24,
- .meram_size = 0x40,
- },
- .icb[1] = {
-- .marker_icb = 29,
-- .cache_icb = 25,
- .meram_size = 0x40,
- },
- };
-@@ -765,13 +761,9 @@ static struct platform_device fsi_ak4643_device = {
- };
- static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
- .icb[0] = {
-- .marker_icb = 30,
-- .cache_icb = 26,
- .meram_size = 0x100,
- },
- .icb[1] = {
-- .marker_icb = 31,
-- .cache_icb = 27,
- .meram_size = 0x100,
- },
- };
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 1fd4423..6d4bc29 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -369,13 +369,9 @@ static int mackerel_get_brightness(void)
-
- static struct sh_mobile_meram_cfg lcd_meram_cfg = {
- .icb[0] = {
-- .marker_icb = 28,
-- .cache_icb = 24,
- .meram_size = 0x40,
- },
- .icb[1] = {
-- .marker_icb = 29,
-- .cache_icb = 25,
- .meram_size = 0x40,
- },
- };
-@@ -430,13 +426,9 @@ static struct platform_device lcdc_device = {
-
- static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
- .icb[0] = {
-- .marker_icb = 30,
-- .cache_icb = 26,
- .meram_size = 0x100,
- },
- .icb[1] = {
-- .marker_icb = 31,
-- .cache_icb = 27,
- .meram_size = 0x100,
- },
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0192-fbdev-sh_mobile_meram-Remove-unused-sh_mobile_meram_.patch b/patches.armadillo800eva/0192-fbdev-sh_mobile_meram-Remove-unused-sh_mobile_meram_.patch
deleted file mode 100644
index 9ffed12f911bf8..00000000000000
--- a/patches.armadillo800eva/0192-fbdev-sh_mobile_meram-Remove-unused-sh_mobile_meram_.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From baf08efb7772e44a9227b0ddfdbd7a3c1c3f6ce0 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Mon, 12 Dec 2011 16:36:13 +0100
-Subject: fbdev: sh_mobile_meram: Remove unused sh_mobile_meram_icb_cfg fields
-
-The marker_icb and cache_icb fields are not used anymore, remove them.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit d81d5fa8adfb0ba19f44bb6c4c04a2a23effac3f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/video/sh_mobile_meram.h | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index e0f650c..8979607 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -31,8 +31,6 @@ struct sh_mobile_meram_info {
-
- /* icb config */
- struct sh_mobile_meram_icb_cfg {
-- unsigned int marker_icb; /* ICB # for Marker ICB */
-- unsigned int cache_icb; /* ICB # for Cache ICB */
- unsigned int meram_size; /* MERAM Buffer Size to use */
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0193-fbdev-sh_mobile_lcdc-Don-t-store-copy-of-platform-da.patch b/patches.armadillo800eva/0193-fbdev-sh_mobile_lcdc-Don-t-store-copy-of-platform-da.patch
deleted file mode 100644
index 42e3dc3c5478cc..00000000000000
--- a/patches.armadillo800eva/0193-fbdev-sh_mobile_lcdc-Don-t-store-copy-of-platform-da.patch
+++ /dev/null
@@ -1,315 +0,0 @@
-From 9fd77506008ee3c8390fe994023441bdc2dfd13a Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 22 Nov 2011 00:56:58 +0100
-Subject: fbdev: sh_mobile_lcdc: Don't store copy of platform data
-
-Instead of copying the whole platform data structure to struct
-sh_mobile_lcdc_chan, store a const pointer to the channel platform data.
-
-MERAM configuration information needs to be changed at runtime, so copy
-it to struct sh_mobile_lcdc_chan.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit b5ef967df13d4d243a2954c32bdd9181a1ee7382)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 71 +++++++++++++++++++-------------------
- drivers/video/sh_mobile_lcdcfb.h | 3 +-
- include/video/sh_mobile_lcdc.h | 2 +-
- 3 files changed, 38 insertions(+), 38 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index d0c9026..0338516 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -116,7 +116,7 @@ static bool banked(int reg_nr)
-
- static int lcdc_chan_is_sublcd(struct sh_mobile_lcdc_chan *chan)
- {
-- return chan->cfg.chan == LCDC_CHAN_SUBLCD;
-+ return chan->cfg->chan == LCDC_CHAN_SUBLCD;
- }
-
- static void lcdc_write_chan(struct sh_mobile_lcdc_chan *chan,
-@@ -289,7 +289,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
- struct list_head *pagelist)
- {
- struct sh_mobile_lcdc_chan *ch = info->par;
-- struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-+ const struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg->panel_cfg;
-
- /* enable clocks before accessing hardware */
- sh_mobile_lcdc_clk_on(ch->lcdc);
-@@ -336,7 +336,7 @@ static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
-
- static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
- {
-- struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-+ const struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg->panel_cfg;
-
- if (ch->tx_dev) {
- int ret;
-@@ -356,7 +356,7 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
-
- static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
- {
-- struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
-+ const struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg->panel_cfg;
-
- if (panel->display_off)
- panel->display_off();
-@@ -644,16 +644,16 @@ static void sh_mobile_lcdc_geometry(struct sh_mobile_lcdc_chan *ch)
- tmp = ch->ldmt1r_value;
- tmp |= (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : LDMT1R_VPOL;
- tmp |= (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : LDMT1R_HPOL;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DWPOL) ? LDMT1R_DWPOL : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DIPOL) ? LDMT1R_DIPOL : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DAPOL) ? LDMT1R_DAPOL : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_HSCNT) ? LDMT1R_HSCNT : 0;
-- tmp |= (ch->cfg.flags & LCDC_FLAGS_DWCNT) ? LDMT1R_DWCNT : 0;
-+ tmp |= (ch->cfg->flags & LCDC_FLAGS_DWPOL) ? LDMT1R_DWPOL : 0;
-+ tmp |= (ch->cfg->flags & LCDC_FLAGS_DIPOL) ? LDMT1R_DIPOL : 0;
-+ tmp |= (ch->cfg->flags & LCDC_FLAGS_DAPOL) ? LDMT1R_DAPOL : 0;
-+ tmp |= (ch->cfg->flags & LCDC_FLAGS_HSCNT) ? LDMT1R_HSCNT : 0;
-+ tmp |= (ch->cfg->flags & LCDC_FLAGS_DWCNT) ? LDMT1R_DWCNT : 0;
- lcdc_write_chan(ch, LDMT1R, tmp);
-
- /* setup SYS bus */
-- lcdc_write_chan(ch, LDMT2R, ch->cfg.sys_bus_cfg.ldmt2r);
-- lcdc_write_chan(ch, LDMT3R, ch->cfg.sys_bus_cfg.ldmt3r);
-+ lcdc_write_chan(ch, LDMT2R, ch->cfg->sys_bus_cfg.ldmt2r);
-+ lcdc_write_chan(ch, LDMT3R, ch->cfg->sys_bus_cfg.ldmt3r);
-
- /* horizontal configuration */
- h_total = mode->xres + mode->hsync_len + mode->left_margin
-@@ -717,7 +717,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- /* Power supply */
- lcdc_write_chan(ch, LDPMR, 0);
-
-- m = ch->cfg.clock_divider;
-+ m = ch->cfg->clock_divider;
- if (!m)
- continue;
-
-@@ -768,7 +768,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- * continuous read mode.
- */
- if (ch->ldmt1r_value & LDMT1R_IFM &&
-- ch->cfg.sys_bus_cfg.deferred_io_msec) {
-+ ch->cfg->sys_bus_cfg.deferred_io_msec) {
- lcdc_write_chan(ch, LDSM1R, LDSM1R_OS);
- lcdc_write(priv, _LDINTR, LDINTR_FE);
- } else {
-@@ -822,13 +822,13 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- lcdc_wait_bit(priv, _LDCNT2R, LDCNT2R_BR, 0);
-
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- struct sh_mobile_lcdc_panel_cfg *panel;
-+ const struct sh_mobile_lcdc_panel_cfg *panel;
-
- ch = &priv->ch[k];
- if (!ch->enabled)
- continue;
-
-- panel = &ch->cfg.panel_cfg;
-+ panel = &ch->cfg->panel_cfg;
- if (panel->setup_sys) {
- ret = panel->setup_sys(ch, &sh_mobile_lcdc_sys_bus_ops);
- if (ret)
-@@ -838,7 +838,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- /* Compute frame buffer base address and pitch for each channel. */
- for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
-- struct sh_mobile_meram_cfg *cfg;
- int pixelformat;
- void *meram;
-
-@@ -850,8 +849,8 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- ch->base_addr_c = ch->base_addr_y + ch->xres * ch->yres_virtual;
-
- /* Enable MERAM if possible. */
-- cfg = ch->cfg.meram_cfg;
-- if (mdev == NULL || mdev->ops == NULL || cfg == NULL)
-+ if (mdev == NULL || mdev->ops == NULL ||
-+ ch->cfg->meram_cfg == NULL)
- continue;
-
- /* we need to de-init configured ICBs before we can
-@@ -881,8 +880,8 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- break;
- }
-
-- meram = mdev->ops->meram_register(mdev, cfg, ch->pitch,
-- ch->yres, pixelformat,
-+ meram = mdev->ops->meram_register(mdev, ch->cfg->meram_cfg,
-+ ch->pitch, ch->yres, pixelformat,
- ch->base_addr_y, ch->base_addr_c,
- &ch->base_addr_y, &ch->base_addr_c,
- &ch->pitch);
-@@ -901,7 +900,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
- if (!ch->enabled)
- continue;
-
-- tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
-+ tmp = ch->cfg->sys_bus_cfg.deferred_io_msec;
- if (ch->ldmt1r_value & LDMT1R_IFM && tmp) {
- ch->defio.deferred_io = sh_mobile_lcdc_deferred_io;
- ch->defio.delay = msecs_to_jiffies(tmp);
-@@ -1210,8 +1209,8 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- * distance between two modes is defined as the size of the
- * non-overlapping parts of the two rectangles.
- */
-- for (i = 0; i < ch->cfg.num_modes; ++i) {
-- const struct fb_videomode *mode = &ch->cfg.lcd_modes[i];
-+ for (i = 0; i < ch->cfg->num_modes; ++i) {
-+ const struct fb_videomode *mode = &ch->cfg->lcd_modes[i];
- unsigned int dist;
-
- /* We can only round up. */
-@@ -1230,7 +1229,7 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
- }
-
- /* If no available mode can be used, return an error. */
-- if (ch->cfg.num_modes != 0) {
-+ if (ch->cfg->num_modes != 0) {
- if (best_dist == (unsigned int)-1)
- return -EINVAL;
-
-@@ -1440,7 +1439,7 @@ sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
- return ret;
-
- dev_info(ch->lcdc->dev, "registered %s/%s as %dx%d %dbpp.\n",
-- dev_name(ch->lcdc->dev), (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
-+ dev_name(ch->lcdc->dev), (ch->cfg->chan == LCDC_CHAN_MAINLCD) ?
- "mainlcd" : "sublcd", info->var.xres, info->var.yres,
- info->var.bits_per_pixel);
-
-@@ -1525,8 +1524,8 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
- */
- var = &info->var;
- fb_videomode_to_var(var, mode);
-- var->width = ch->cfg.panel_cfg.width;
-- var->height = ch->cfg.panel_cfg.height;
-+ var->width = ch->cfg->panel_cfg.width;
-+ var->height = ch->cfg->panel_cfg.height;
- var->yres_virtual = var->yres * 2;
- var->activate = FB_ACTIVATE_NOW;
-
-@@ -1558,14 +1557,14 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
- bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
- brightness = 0;
-
-- return ch->cfg.bl_info.set_brightness(brightness);
-+ return ch->cfg->bl_info.set_brightness(brightness);
- }
-
- static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
- {
- struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
-
-- return ch->cfg.bl_info.get_brightness();
-+ return ch->cfg->bl_info.get_brightness();
- }
-
- static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
-@@ -1586,7 +1585,7 @@ static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent,
- {
- struct backlight_device *bl;
-
-- bl = backlight_device_register(ch->cfg.bl_info.name, parent, ch,
-+ bl = backlight_device_register(ch->cfg->bl_info.name, parent, ch,
- &sh_mobile_lcdc_bl_ops, NULL);
- if (IS_ERR(bl)) {
- dev_err(parent, "unable to register backlight device: %ld\n",
-@@ -1594,7 +1593,7 @@ static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent,
- return NULL;
- }
-
-- bl->props.max_brightness = ch->cfg.bl_info.max_brightness;
-+ bl->props.max_brightness = ch->cfg->bl_info.max_brightness;
- bl->props.brightness = bl->props.max_brightness;
- backlight_update_status(bl);
-
-@@ -1727,7 +1726,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
-
- if (ch->tx_dev) {
- ch->tx_dev->lcdc = NULL;
-- module_put(ch->cfg.tx_dev->dev.driver->owner);
-+ module_put(ch->cfg->tx_dev->dev.driver->owner);
- }
-
- sh_mobile_lcdc_channel_fb_cleanup(ch);
-@@ -1758,7 +1757,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
-
- static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
- {
-- int interface_type = ch->cfg.interface_type;
-+ int interface_type = ch->cfg->interface_type;
-
- switch (interface_type) {
- case RGB8:
-@@ -1801,7 +1800,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
- struct sh_mobile_lcdc_chan *ch)
- {
- const struct sh_mobile_lcdc_format_info *format;
-- struct sh_mobile_lcdc_chan_cfg *cfg = &ch->cfg;
-+ const struct sh_mobile_lcdc_chan_cfg *cfg = ch->cfg;
- const struct fb_videomode *max_mode;
- const struct fb_videomode *mode;
- unsigned int num_modes;
-@@ -1944,7 +1943,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- struct sh_mobile_lcdc_chan *ch = priv->ch + num_channels;
-
- ch->lcdc = priv;
-- memcpy(&ch->cfg, &pdata->ch[i], sizeof(pdata->ch[i]));
-+ ch->cfg = &pdata->ch[i];
-
- error = sh_mobile_lcdc_check_interface(ch);
- if (error) {
-@@ -1956,7 +1955,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
- ch->pan_offset = 0;
-
- /* probe the backlight is there is one defined */
-- if (ch->cfg.bl_info.max_brightness)
-+ if (ch->cfg->bl_info.max_brightness)
- ch->bl = sh_mobile_lcdc_bl_probe(&pdev->dev, ch);
-
- switch (pdata->ch[i].chan) {
-diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
-index bf1707c..da1c26e 100644
---- a/drivers/video/sh_mobile_lcdcfb.h
-+++ b/drivers/video/sh_mobile_lcdcfb.h
-@@ -54,7 +54,7 @@ struct sh_mobile_lcdc_entity {
- struct sh_mobile_lcdc_chan {
- struct sh_mobile_lcdc_priv *lcdc;
- struct sh_mobile_lcdc_entity *tx_dev;
-- struct sh_mobile_lcdc_chan_cfg cfg;
-+ const struct sh_mobile_lcdc_chan_cfg *cfg;
-
- unsigned long *reg_offs;
- unsigned long ldmt1r_value;
-@@ -66,6 +66,7 @@ struct sh_mobile_lcdc_chan {
-
- void *fb_mem;
- unsigned long fb_size;
-+
- dma_addr_t dma_handle;
- unsigned long pan_offset;
-
-diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
-index 484b0a2..7571b27 100644
---- a/include/video/sh_mobile_lcdc.h
-+++ b/include/video/sh_mobile_lcdc.h
-@@ -178,7 +178,7 @@ struct sh_mobile_lcdc_chan_cfg {
- struct sh_mobile_lcdc_panel_cfg panel_cfg;
- struct sh_mobile_lcdc_bl_info bl_info;
- struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
-- struct sh_mobile_meram_cfg *meram_cfg;
-+ const struct sh_mobile_meram_cfg *meram_cfg;
-
- struct platform_device *tx_dev; /* HDMI/DSI transmitter device */
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0194-fbdev-sh_mobile_meram-Don-t-perform-update-in-regist.patch b/patches.armadillo800eva/0194-fbdev-sh_mobile_meram-Don-t-perform-update-in-regist.patch
deleted file mode 100644
index 1b28302e864d1c..00000000000000
--- a/patches.armadillo800eva/0194-fbdev-sh_mobile_meram-Don-t-perform-update-in-regist.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From ea1779467738995fccbefe4e65c1b42204e3b922 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 22 Nov 2011 00:56:58 +0100
-Subject: fbdev: sh_mobile_meram: Don't perform update in register operation
-
-Remove the RGB or Y/C base address update from the meram_register()
-operation, as this belongs to the meram_update() operation.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit 97d16fe69b6499a14a0c85c053f7bef54ce992a4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 8 +++++---
- drivers/video/sh_mobile_meram.c | 15 ++-------------
- include/video/sh_mobile_meram.h | 4 ----
- 3 files changed, 7 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 0338516..4b54cd5 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -882,11 +882,13 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
-
- meram = mdev->ops->meram_register(mdev, ch->cfg->meram_cfg,
- ch->pitch, ch->yres, pixelformat,
-- ch->base_addr_y, ch->base_addr_c,
-- &ch->base_addr_y, &ch->base_addr_c,
- &ch->pitch);
-- if (!IS_ERR(meram))
-+ if (!IS_ERR(meram)) {
-+ mdev->ops->meram_update(mdev, meram,
-+ ch->base_addr_y, ch->base_addr_c,
-+ &ch->base_addr_y, &ch->base_addr_c);
- ch->meram = meram;
-+ }
- }
-
- /* Start the LCDC. */
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 085c49a..2ce0d8f 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -448,10 +448,6 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- const struct sh_mobile_meram_cfg *cfg,
- unsigned int xres, unsigned int yres,
- unsigned int pixelformat,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c,
- unsigned int *pitch)
- {
- struct sh_mobile_meram_fb_cache *cache;
-@@ -470,9 +466,8 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- priv = pdata->priv;
- pdev = pdata->pdev;
-
-- dev_dbg(&pdev->dev, "registering %dx%d (%s) (y=%08lx, c=%08lx)",
-- xres, yres, (!pixelformat) ? "yuv" : "rgb",
-- base_addr_y, base_addr_c);
-+ dev_dbg(&pdev->dev, "registering %dx%d (%s)", xres, yres,
-+ !pixelformat ? "yuv" : "rgb");
-
- /* we can't handle wider than 8192px */
- if (xres > 8192) {
-@@ -500,12 +495,6 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- meram_init(priv, &cache->planes[1], 2 * xres, (yres + 1) / 2,
- &out_pitch);
-
-- meram_set_next_addr(priv, cache, base_addr_y, base_addr_c);
-- meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c);
--
-- dev_dbg(&pdev->dev, "registered - can access via y=%08lx, c=%08lx",
-- *icb_addr_y, *icb_addr_c);
--
- err:
- mutex_unlock(&priv->lock);
- return cache;
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index 8979607..553335c 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -46,10 +46,6 @@ struct sh_mobile_meram_ops {
- const struct sh_mobile_meram_cfg *cfg,
- unsigned int xres, unsigned int yres,
- unsigned int pixelformat,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c,
- unsigned int *pitch);
-
- /* unregister usage of meram */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0195-fbdev-sh_mobile_meram-Remove-unneeded-sanity-checks.patch b/patches.armadillo800eva/0195-fbdev-sh_mobile_meram-Remove-unneeded-sanity-checks.patch
deleted file mode 100644
index 59eb81b81b2762..00000000000000
--- a/patches.armadillo800eva/0195-fbdev-sh_mobile_meram-Remove-unneeded-sanity-checks.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From b8aa2bcf6cfc6bf1963af975d01066952ecd194d Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 22 Nov 2011 00:56:58 +0100
-Subject: fbdev: sh_mobile_meram: Remove unneeded sanity checks
-
-The meram_register(), meram_unregister() and meram_update() operations
-check that the pointers they get from the caller are not NULL. Those
-checks can be remove, as the caller already ensures that the pointers
-are valid.
-
-The platform sanity checks can also be removed, as the operations can't
-be accessed without valid platform data anyway.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit cdf88b9072a86545611b9c3f5597ebc47e50ffc1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_lcdcfb.c | 5 +----
- drivers/video/sh_mobile_meram.c | 32 ++++++--------------------------
- include/video/sh_mobile_meram.h | 15 +++++++--------
- 3 files changed, 14 insertions(+), 38 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
-index 4b54cd5..7a0b301 100644
---- a/drivers/video/sh_mobile_lcdcfb.c
-+++ b/drivers/video/sh_mobile_lcdcfb.c
-@@ -1072,14 +1072,11 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
-
- if (ch->meram) {
- struct sh_mobile_meram_info *mdev;
-- int ret;
-
- mdev = priv->meram_dev;
-- ret = mdev->ops->meram_update(mdev, ch->meram,
-+ mdev->ops->meram_update(mdev, ch->meram,
- base_addr_y, base_addr_c,
- &base_addr_y, &base_addr_c);
-- if (ret)
-- return ret;
- }
-
- ch->base_addr_y = base_addr_y;
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index 2ce0d8f..d9f7a44 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -451,21 +451,15 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
- unsigned int *pitch)
- {
- struct sh_mobile_meram_fb_cache *cache;
-- struct sh_mobile_meram_priv *priv;
-- struct platform_device *pdev;
-+ struct sh_mobile_meram_priv *priv = pdata->priv;
-+ struct platform_device *pdev = pdata->pdev;
- unsigned int out_pitch;
-
-- if (!pdata || !pdata->priv || !pdata->pdev || !cfg)
-- return ERR_PTR(-EINVAL);
--
- if (pixelformat != SH_MOBILE_MERAM_PF_NV &&
- pixelformat != SH_MOBILE_MERAM_PF_NV24 &&
- pixelformat != SH_MOBILE_MERAM_PF_RGB)
- return ERR_PTR(-EINVAL);
-
-- priv = pdata->priv;
-- pdev = pdata->pdev;
--
- dev_dbg(&pdev->dev, "registering %dx%d (%s)", xres, yres,
- !pixelformat ? "yuv" : "rgb");
-
-@@ -500,16 +494,11 @@ err:
- return cache;
- }
-
--static int
-+static void
- sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data)
- {
- struct sh_mobile_meram_fb_cache *cache = data;
-- struct sh_mobile_meram_priv *priv;
--
-- if (!pdata || !pdata->priv || !data)
-- return -EINVAL;
--
-- priv = pdata->priv;
-+ struct sh_mobile_meram_priv *priv = pdata->priv;
-
- mutex_lock(&priv->lock);
-
-@@ -521,22 +510,15 @@ sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data)
- meram_free(priv, cache);
-
- mutex_unlock(&priv->lock);
--
-- return 0;
- }
-
--static int
-+static void
- sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data,
- unsigned long base_addr_y, unsigned long base_addr_c,
- unsigned long *icb_addr_y, unsigned long *icb_addr_c)
- {
- struct sh_mobile_meram_fb_cache *cache = data;
-- struct sh_mobile_meram_priv *priv;
--
-- if (!pdata || !pdata->priv || !data)
-- return -EINVAL;
--
-- priv = pdata->priv;
-+ struct sh_mobile_meram_priv *priv = pdata->priv;
-
- mutex_lock(&priv->lock);
-
-@@ -544,8 +526,6 @@ sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data,
- meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c);
-
- mutex_unlock(&priv->lock);
--
-- return 0;
- }
-
- static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
-diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
-index 553335c..29b2fd3 100644
---- a/include/video/sh_mobile_meram.h
-+++ b/include/video/sh_mobile_meram.h
-@@ -49,16 +49,15 @@ struct sh_mobile_meram_ops {
- unsigned int *pitch);
-
- /* unregister usage of meram */
-- int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
-- void *data);
-+ void (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
-+ void *data);
-
- /* update meram settings */
-- int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
-- void *data,
-- unsigned long base_addr_y,
-- unsigned long base_addr_c,
-- unsigned long *icb_addr_y,
-- unsigned long *icb_addr_c);
-+ void (*meram_update)(struct sh_mobile_meram_info *meram_dev, void *data,
-+ unsigned long base_addr_y,
-+ unsigned long base_addr_c,
-+ unsigned long *icb_addr_y,
-+ unsigned long *icb_addr_c);
- };
-
- #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0196-fbdev-sh_mobile_meram-Implement-system-suspend-resum.patch b/patches.armadillo800eva/0196-fbdev-sh_mobile_meram-Implement-system-suspend-resum.patch
deleted file mode 100644
index 402db64380dbaf..00000000000000
--- a/patches.armadillo800eva/0196-fbdev-sh_mobile_meram-Implement-system-suspend-resum.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 8981c1230376999c7f440d751775d650811342b7 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Tue, 22 Nov 2011 00:56:58 +0100
-Subject: fbdev: sh_mobile_meram: Implement system suspend/resume
-
-Supporting runtime PM is very nice, but that's not a reason not to
-implement system suspend/resume properly.
-
-Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-(cherry picked from commit af89956be14ae5bb304872756a47309edc2c94fb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mobile_meram.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
-index d9f7a44..82ba830 100644
---- a/drivers/video/sh_mobile_meram.c
-+++ b/drivers/video/sh_mobile_meram.c
-@@ -539,7 +539,7 @@ static struct sh_mobile_meram_ops sh_mobile_meram_ops = {
- * Power management
- */
-
--static int sh_mobile_meram_runtime_suspend(struct device *dev)
-+static int sh_mobile_meram_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-@@ -563,7 +563,7 @@ static int sh_mobile_meram_runtime_suspend(struct device *dev)
- return 0;
- }
-
--static int sh_mobile_meram_runtime_resume(struct device *dev)
-+static int sh_mobile_meram_resume(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
- struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev);
-@@ -582,10 +582,9 @@ static int sh_mobile_meram_runtime_resume(struct device *dev)
- return 0;
- }
-
--static const struct dev_pm_ops sh_mobile_meram_dev_pm_ops = {
-- .runtime_suspend = sh_mobile_meram_runtime_suspend,
-- .runtime_resume = sh_mobile_meram_runtime_resume,
--};
-+static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
-+ sh_mobile_meram_suspend,
-+ sh_mobile_meram_resume, NULL);
-
- /* -----------------------------------------------------------------------------
- * Probe/remove and driver init/exit
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0197-fbdev-sh_mipi_dsi-add-extra-phyctrl-for-sh_mipi_dsi_.patch b/patches.armadillo800eva/0197-fbdev-sh_mipi_dsi-add-extra-phyctrl-for-sh_mipi_dsi_.patch
deleted file mode 100644
index a60316a5e6a94b..00000000000000
--- a/patches.armadillo800eva/0197-fbdev-sh_mipi_dsi-add-extra-phyctrl-for-sh_mipi_dsi_.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 40b02e1ce5b088dbee79db5cc99f7482caf4ffb9 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 20 Mar 2012 18:34:10 -0700
-Subject: fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info
-
-sh_mipi uses some clocks, but the method of setup depends on CPU.
-
-Current SuperH (like sh73a0) can control all of these clocks
-by CPG (Clock Pulse Generator).
-It means we can control it by clock framework only.
-But on sh7372, it needs CPG settings AND sh_mipi PHYCTRL::PLLDS,
-and only sh7372 has PHYCTRL::PLLDS.
-
-But on current sh_mipi driver, PHYCTRL::PLLDS of sh7372 was
-overwrote since the callback timing of clock setting was changed
-by c2658b70f06108361aa5024798f9c1bf47c73374
-(fbdev: sh_mipi_dsi: fixup setup timing of sh_mipi_setup()).
-To solve this issue, this patch adds extra .phyctrl.
-
-This patch adds detail explanation for unclear mipi settings
-and fixup wrong PHYCTRL::PLLDS value for ap4evb (0xb -> 0x6).
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-(cherry picked from commit 8f9c60f2e29717155227f225b557d3f1fda442bd)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ap4evb.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/video/sh_mipi_dsi.c | 2 +-
- include/video/sh_mipi_dsi.h | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
-index 42ad0f7..4c6b844 100644
---- a/drivers/video/sh_mipi_dsi.c
-+++ b/drivers/video/sh_mipi_dsi.c
-@@ -273,7 +273,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
- iowrite32(0x00000001, base + PHYCTRL);
- udelay(200);
- /* Deassert resets, power on */
-- iowrite32(0x03070001, base + PHYCTRL);
-+ iowrite32(0x03070001 | pdata->phyctrl, base + PHYCTRL);
-
- /*
- * Default = ULPS enable |
-diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
-index 434d56b..06c67fb 100644
---- a/include/video/sh_mipi_dsi.h
-+++ b/include/video/sh_mipi_dsi.h
-@@ -51,6 +51,7 @@ struct sh_mipi_dsi_info {
- int lane;
- unsigned long flags;
- u32 clksrc;
-+ u32 phyctrl; /* for extra setting */
- unsigned int vsynw_offset;
- int (*set_dot_clock)(struct platform_device *pdev,
- void __iomem *base,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0198-serial-sh-sci-Kill-off-bitrotted-H8-300-support.patch b/patches.armadillo800eva/0198-serial-sh-sci-Kill-off-bitrotted-H8-300-support.patch
deleted file mode 100644
index 5b9f9bbb704f9e..00000000000000
--- a/patches.armadillo800eva/0198-serial-sh-sci-Kill-off-bitrotted-H8-300-support.patch
+++ /dev/null
@@ -1,263 +0,0 @@
-From d220e25de0fcd549d5f8d518a05f57a4bd1e292b Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 1 Jun 2011 14:47:42 +0900
-Subject: serial: sh-sci: Kill off bitrotted H8/300 support.
-
-h8300 has never been updated upstream to support the conversion to the
-driver model (which happened mid-2.5), and it doesn't seem likely that it
-ever will. Kill off the remaining bitrotted support to reduce the
-maintenance burden going forward.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit ab7cfb5548d22604fafeaaa95950be2f97869f1e)
-
-Conflicts:
-
- drivers/tty/serial/Kconfig
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 30 +------------
- drivers/tty/serial/sh-sci.h | 103 +++++--------------------------------------
- 2 files changed, 13 insertions(+), 120 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index bead17e..5174d2f 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -54,10 +54,6 @@
- #include <asm/sh_bios.h>
- #endif
-
--#ifdef CONFIG_H8300
--#include <asm/gpio.h>
--#endif
--
- #include "sh-sci.h"
-
- struct sci_port {
-@@ -164,23 +160,7 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
- }
- #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
-
--#if defined(__H8300H__) || defined(__H8300S__)
--static void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- int ch = (port->mapbase - SMR0) >> 3;
--
-- /* set DDR regs */
-- H8300_GPIO_DDR(h8300_sci_pins[ch].port,
-- h8300_sci_pins[ch].rx,
-- H8300_GPIO_INPUT);
-- H8300_GPIO_DDR(h8300_sci_pins[ch].port,
-- h8300_sci_pins[ch].tx,
-- H8300_GPIO_OUTPUT);
--
-- /* tx mark output*/
-- H8300_SCI_DR(ch) |= h8300_sci_pins[ch].tx;
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-+#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
- static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
- {
- if (port->mapbase == 0xA4400000) {
-@@ -1868,14 +1848,8 @@ static int __devinit serial_console_setup(struct console *co, char *options)
- if (options)
- uart_parse_options(options, &baud, &parity, &bits, &flow);
-
-- ret = uart_set_options(port, co, baud, parity, bits, flow);
--#if defined(__H8300H__) || defined(__H8300S__)
-- /* disable rx interrupt */
-- if (ret == 0)
-- sci_stop_rx(port);
--#endif
- /* TODO: disable clock */
-- return ret;
-+ return uart_set_options(port, co, baud, parity, bits, flow);
- }
-
- static struct console serial_console = {
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index 1bb7130..e1ceebb 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -2,13 +2,6 @@
- #include <linux/io.h>
- #include <linux/gpio.h>
-
--#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
--#include <asm/regs306x.h>
--#endif
--#if defined(CONFIG_H8S2678)
--#include <asm/regs267x.h>
--#endif
--
- #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
- defined(CONFIG_CPU_SUBTYPE_SH7707) || \
- defined(CONFIG_CPU_SUBTYPE_SH7708) || \
-@@ -72,10 +65,6 @@
- #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
- # define SCSPTR2 0xffe80020 /* 16 bit SCIF */
- # define SCIF_ORER 0x0001 /* overrun error bit */
--#elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
--# define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
--#elif defined(CONFIG_H8S2678)
--# define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
- #elif defined(CONFIG_CPU_SUBTYPE_SH7757)
- # define SCSPTR0 0xfe4b0020
- # define SCIF_ORER 0x0001
-@@ -225,17 +214,6 @@
- } \
- }
-
--#ifdef CONFIG_H8300
--/* h8300 don't have SCIF */
--#define CPU_SCIF_FNS(name) \
-- static inline unsigned int sci_##name##_in(struct uart_port *port) \
-- { \
-- return 0; \
-- } \
-- static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
-- { \
-- }
--#else
- #define CPU_SCIF_FNS(name, scif_offset, scif_size) \
- static inline unsigned int sci_##name##_in(struct uart_port *port) \
- { \
-@@ -245,7 +223,6 @@
- { \
- SCI_OUT(scif_size, scif_offset, value); \
- }
--#endif
-
- #define CPU_SCI_FNS(name, sci_offset, sci_size) \
- static inline unsigned int sci_##name##_in(struct uart_port* port) \
-@@ -264,8 +241,7 @@
- defined(CONFIG_ARCH_SH7372)
- #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
- #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
-- h8_sci_offset, h8_sci_size) \
-+ sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
- #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
-@@ -284,19 +260,11 @@
- CPU_SCIF_FNS(name, scif_offset, scif_size)
- #else
- #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
-- h8_sci_offset, h8_sci_size) \
-+ sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
- #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIF_FNS(name, sh3_scif_offset, sh3_scif_size)
- #endif
--#elif defined(__H8300H__) || defined(__H8300S__)
--#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
-- h8_sci_offset, h8_sci_size) \
-- CPU_SCI_FNS(name, h8_sci_offset, h8_sci_size)
--#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIF_FNS(name)
- #elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
- defined(CONFIG_CPU_SUBTYPE_SH7724)
- #define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
-@@ -305,8 +273,7 @@
- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
- #else
- #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
-- h8_sci_offset, h8_sci_size) \
-+ sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
- #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
-@@ -355,14 +322,14 @@ SCIF_FNS(SCFCR, 0x18, 16)
- SCIF_FNS(SCFDR, 0x1c, 16)
- SCIF_FNS(SCLSR, 0x24, 16)
- #else
--/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 SCI/H8*/
--/* name off sz off sz off sz off sz off sz*/
--SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16, 0x00, 8)
--SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8, 0x01, 8)
--SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16, 0x02, 8)
--SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8, 0x03, 8)
--SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16, 0x04, 8)
--SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8, 0x05, 8)
-+/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 */
-+/* name off sz off sz off sz off sz */
-+SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16)
-+SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8)
-+SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16)
-+SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8)
-+SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16)
-+SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8)
- SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
- #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
- defined(CONFIG_CPU_SUBTYPE_SH7780) || \
-@@ -392,48 +359,6 @@ SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
- #define sci_in(port, reg) sci_##reg##_in(port)
- #define sci_out(port, reg, value) sci_##reg##_out(port, value)
-
--/* H8/300 series SCI pins assignment */
--#if defined(__H8300H__) || defined(__H8300S__)
--static const struct __attribute__((packed)) {
-- int port; /* GPIO port no */
-- unsigned short rx,tx; /* GPIO bit no */
--} h8300_sci_pins[] = {
--#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
-- { /* SCI0 */
-- .port = H8300_GPIO_P9,
-- .rx = H8300_GPIO_B2,
-- .tx = H8300_GPIO_B0,
-- },
-- { /* SCI1 */
-- .port = H8300_GPIO_P9,
-- .rx = H8300_GPIO_B3,
-- .tx = H8300_GPIO_B1,
-- },
-- { /* SCI2 */
-- .port = H8300_GPIO_PB,
-- .rx = H8300_GPIO_B7,
-- .tx = H8300_GPIO_B6,
-- }
--#elif defined(CONFIG_H8S2678)
-- { /* SCI0 */
-- .port = H8300_GPIO_P3,
-- .rx = H8300_GPIO_B2,
-- .tx = H8300_GPIO_B0,
-- },
-- { /* SCI1 */
-- .port = H8300_GPIO_P3,
-- .rx = H8300_GPIO_B3,
-- .tx = H8300_GPIO_B1,
-- },
-- { /* SCI2 */
-- .port = H8300_GPIO_P5,
-- .rx = H8300_GPIO_B1,
-- .tx = H8300_GPIO_B0,
-- }
--#endif
--};
--#endif
--
- #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
- defined(CONFIG_CPU_SUBTYPE_SH7707) || \
- defined(CONFIG_CPU_SUBTYPE_SH7708) || \
-@@ -456,12 +381,6 @@ static inline int sci_rxd_in(struct uart_port *port)
- return __raw_readb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */
- return 1;
- }
--#elif defined(__H8300H__) || defined(__H8300S__)
--static inline int sci_rxd_in(struct uart_port *port)
--{
-- int ch = (port->mapbase - SMR0) >> 3;
-- return (H8300_SCI_DR(ch) & h8300_sci_pins[ch].rx) ? 1 : 0;
--}
- #else /* default case for non-SCI processors */
- static inline int sci_rxd_in(struct uart_port *port)
- {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0199-serial-sh-sci-Tidy-up-ioread-write-wrappers-kill-off.patch b/patches.armadillo800eva/0199-serial-sh-sci-Tidy-up-ioread-write-wrappers-kill-off.patch
deleted file mode 100644
index 765f7e3eba1a2c..00000000000000
--- a/patches.armadillo800eva/0199-serial-sh-sci-Tidy-up-ioread-write-wrappers-kill-off.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 931612e926da91a2fe197b43ed0294bd04ce1fd1 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 8 Jun 2011 17:06:25 +0900
-Subject: serial: sh-sci: Tidy up ioread/write wrappers, kill off unused SCI
- helper.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a01cdc10689f5d252530d14474528ea785ecfde4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.h | 35 +++++++++--------------------------
- 1 file changed, 9 insertions(+), 26 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index e1ceebb..2d667ab 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -183,32 +183,25 @@
- #define SCI_MAJOR 204
- #define SCI_MINOR_START 8
-
--#define SCI_IN(size, offset) \
-- if ((size) == 8) { \
-- return ioread8(port->membase + (offset)); \
-- } else { \
-- return ioread16(port->membase + (offset)); \
-- }
--#define SCI_OUT(size, offset, value) \
-- if ((size) == 8) { \
-- iowrite8(value, port->membase + (offset)); \
-- } else if ((size) == 16) { \
-- iowrite16(value, port->membase + (offset)); \
-- }
-+#define SCI_IN(size, offset) \
-+ ioread##size(port->membase + (offset))
-+
-+#define SCI_OUT(size, offset, value) \
-+ iowrite##size(value, port->membase + (offset))
-
- #define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
- static inline unsigned int sci_##name##_in(struct uart_port *port) \
- { \
- if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
-- SCI_IN(scif_size, scif_offset) \
-+ return SCI_IN(scif_size, scif_offset); \
- } else { /* PORT_SCI or PORT_SCIFA */ \
-- SCI_IN(sci_size, sci_offset); \
-+ return SCI_IN(sci_size, sci_offset); \
- } \
- } \
- static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
- { \
- if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
-- SCI_OUT(scif_size, scif_offset, value) \
-+ SCI_OUT(scif_size, scif_offset, value); \
- } else { /* PORT_SCI or PORT_SCIFA */ \
- SCI_OUT(sci_size, sci_offset, value); \
- } \
-@@ -217,23 +210,13 @@
- #define CPU_SCIF_FNS(name, scif_offset, scif_size) \
- static inline unsigned int sci_##name##_in(struct uart_port *port) \
- { \
-- SCI_IN(scif_size, scif_offset); \
-+ return SCI_IN(scif_size, scif_offset); \
- } \
- static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
- { \
- SCI_OUT(scif_size, scif_offset, value); \
- }
-
--#define CPU_SCI_FNS(name, sci_offset, sci_size) \
-- static inline unsigned int sci_##name##_in(struct uart_port* port) \
-- { \
-- SCI_IN(sci_size, sci_offset); \
-- } \
-- static inline void sci_##name##_out(struct uart_port* port, unsigned int value) \
-- { \
-- SCI_OUT(sci_size, sci_offset, value); \
-- }
--
- #if defined(CONFIG_CPU_SH3) || \
- defined(CONFIG_ARCH_SH73A0) || \
- defined(CONFIG_ARCH_SH7367) || \
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0200-serial-sh-sci-Kill-off-some-more-unused-definitions.patch b/patches.armadillo800eva/0200-serial-sh-sci-Kill-off-some-more-unused-definitions.patch
deleted file mode 100644
index 238db2b8a081c7..00000000000000
--- a/patches.armadillo800eva/0200-serial-sh-sci-Kill-off-some-more-unused-definitions.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 055087947c54ebcc250135502ffcc149f2a910b0 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 8 Jun 2011 17:13:20 +0900
-Subject: serial: sh-sci: Kill off some more unused definitions.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit b03034016184b7e9fd19f2a24ffb131953fdcc41)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.h | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index 2d667ab..a64beaf 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -9,8 +9,6 @@
- # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */
- # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7705)
--# define SCIF0 0xA4400000
--# define SCIF2 0xA4410000
- # define SCPCR 0xA4000116
- # define SCPDR 0xA4000136
- #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-@@ -48,8 +46,6 @@
- #elif defined(CONFIG_CPU_SUBTYPE_SH7343)
- # define SCSPTR0 0xffe00010 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7722)
--# define PADR 0xA4050120
--# define PSDR 0xA405013e
- # define PWDR 0xA4050166
- # define PSCR 0xA405011E
- # define SCIF_ORER 0x0001 /* overrun error bit */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0201-serial-sh-sci-Generalize-overrun-handling.patch b/patches.armadillo800eva/0201-serial-sh-sci-Generalize-overrun-handling.patch
deleted file mode 100644
index fbb6a00e4e71c1..00000000000000
--- a/patches.armadillo800eva/0201-serial-sh-sci-Generalize-overrun-handling.patch
+++ /dev/null
@@ -1,304 +0,0 @@
-From 7dec2c8e8106f9d403696a7e361e4b7ecbc4194e Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 8 Jun 2011 18:19:37 +0900
-Subject: serial: sh-sci: Generalize overrun handling.
-
-This consolidates all of the broken out overrun handling and ensures that
-we have sensible defaults per-port type, in addition to making sure that
-overruns are flagged appropriately in the error mask for parts that
-haven't explicitly disabled support for it.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit debf9507166eede1e676d27d3298cdfb27399cb4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 51 +++++++++++++++++++++++++++++++++++++-----
- drivers/tty/serial/sh-sci.h | 52 ++-----------------------------------------
- include/linux/serial_sci.h | 30 +++++++++++++++++++++++++
- 3 files changed, 77 insertions(+), 56 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 5174d2f..b2c424b 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -563,13 +563,19 @@ static int sci_handle_errors(struct uart_port *port)
- int copied = 0;
- unsigned short status = sci_in(port, SCxSR);
- struct tty_struct *tty = port->state->port.tty;
-+ struct sci_port *s = to_sci_port(port);
-
-- if (status & SCxSR_ORER(port)) {
-- /* overrun error */
-- if (tty_insert_flip_char(tty, 0, TTY_OVERRUN))
-- copied++;
-+ /*
-+ * Handle overruns, if supported.
-+ */
-+ if (s->cfg->overrun_bit != SCIx_NOT_SUPPORTED) {
-+ if (status & (1 << s->cfg->overrun_bit)) {
-+ /* overrun error */
-+ if (tty_insert_flip_char(tty, 0, TTY_OVERRUN))
-+ copied++;
-
-- dev_notice(port->dev, "overrun error");
-+ dev_notice(port->dev, "overrun error");
-+ }
- }
-
- if (status & SCxSR_FER(port)) {
-@@ -617,12 +623,19 @@ static int sci_handle_errors(struct uart_port *port)
- static int sci_handle_fifo_overrun(struct uart_port *port)
- {
- struct tty_struct *tty = port->state->port.tty;
-+ struct sci_port *s = to_sci_port(port);
- int copied = 0;
-
-+ /*
-+ * XXX: Technically not limited to non-SCIFs, it's simply the
-+ * SCLSR check that is for the moment SCIF-specific. This
-+ * probably wants to be revisited for SCIFA/B as well as for
-+ * factoring in SCI overrun detection.
-+ */
- if (port->type != PORT_SCIF)
- return 0;
-
-- if ((sci_in(port, SCLSR) & SCIF_ORER) != 0) {
-+ if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {
- sci_out(port, SCLSR, 0);
-
- tty_insert_flip_char(tty, 0, TTY_OVERRUN);
-@@ -1760,6 +1773,32 @@ static int __devinit sci_init_single(struct platform_device *dev,
- sci_port->break_timer.function = sci_break_timer;
- init_timer(&sci_port->break_timer);
-
-+ /*
-+ * Establish some sensible defaults for the error detection.
-+ */
-+ if (!p->error_mask)
-+ p->error_mask = (p->type == PORT_SCI) ?
-+ SCI_DEFAULT_ERROR_MASK : SCIF_DEFAULT_ERROR_MASK;
-+
-+ /*
-+ * Establish sensible defaults for the overrun detection, unless
-+ * the part has explicitly disabled support for it.
-+ */
-+ if (p->overrun_bit != SCIx_NOT_SUPPORTED) {
-+ if (p->type == PORT_SCI)
-+ p->overrun_bit = 5;
-+ else if (p->scbrr_algo_id == SCBRR_ALGO_4)
-+ p->overrun_bit = 9;
-+ else
-+ p->overrun_bit = 0;
-+
-+ /*
-+ * Make the error mask inclusive of overrun detection, if
-+ * supported.
-+ */
-+ p->error_mask |= (1 << p->overrun_bit);
-+ }
-+
- sci_port->cfg = p;
-
- port->mapbase = p->mapbase;
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index a64beaf..a2f69f8 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -19,11 +19,9 @@
- defined(CONFIG_ARCH_SH7372)
- # define PORT_PTCR 0xA405011EUL
- # define PORT_PVCR 0xA4050122UL
--# define SCIF_ORER 0x0200 /* overrun error bit */
- #elif defined(CONFIG_SH_RTS7751R2D)
- # define SCSPTR1 0xFFE0001C /* 8 bit SCIF */
- # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
- defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
- defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
-@@ -32,15 +30,12 @@
- defined(CONFIG_CPU_SUBTYPE_SH7751R)
- # define SCSPTR1 0xffe0001c /* 8 bit SCI */
- # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
- # define SCSPTR0 0xfe600024 /* 16 bit SCIF */
- # define SCSPTR1 0xfe610024 /* 16 bit SCIF */
- # define SCSPTR2 0xfe620024 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
- # define SCSPTR0 0xA4400000 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- # define PACR 0xa4050100
- # define PBCR 0xa4050102
- #elif defined(CONFIG_CPU_SUBTYPE_SH7343)
-@@ -48,35 +43,24 @@
- #elif defined(CONFIG_CPU_SUBTYPE_SH7722)
- # define PWDR 0xA4050166
- # define PSCR 0xA405011E
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7366)
- # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */
- # define SCSPTR0 SCPDR0
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7723)
- # define SCSPTR0 0xa4050160
--# define SCIF_ORER 0x0001 /* overrun error bit */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
- # define SCSPTR2 0xffe80020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7757)
- # define SCSPTR0 0xfe4b0020
--# define SCIF_ORER 0x0001
- #elif defined(CONFIG_CPU_SUBTYPE_SH7763)
- # define SCSPTR0 0xffe00024 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7770)
- # define SCSPTR0 0xff923020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
- # define SCSPTR0 0xffe00024 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* Overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
- defined(CONFIG_CPU_SUBTYPE_SH7786)
- # define SCSPTR0 0xffea0024 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* Overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
- defined(CONFIG_CPU_SUBTYPE_SH7203) || \
- defined(CONFIG_CPU_SUBTYPE_SH7206) || \
-@@ -84,36 +68,12 @@
- # define SCSPTR0 0xfffe8020 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
- # define SCSPTR0 0xf8400020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* overrun error bit */
- #elif defined(CONFIG_CPU_SUBTYPE_SHX3)
- # define SCSPTR0 0xffc30020 /* 16 bit SCIF */
--# define SCIF_ORER 0x0001 /* Overrun error bit */
- #else
- # error CPU subtype not defined
- #endif
-
--/* SCxSR SCI */
--#define SCI_TDRE 0x80 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--#define SCI_RDRF 0x40 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--#define SCI_ORER 0x20 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--#define SCI_FER 0x10 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--#define SCI_PER 0x08 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--#define SCI_TEND 0x04 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--/* SCI_MPB 0x02 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--/* SCI_MPBT 0x01 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
--
--#define SCI_ERRORS ( SCI_PER | SCI_FER | SCI_ORER)
--
--/* SCxSR SCIF */
--#define SCIF_ER 0x0080 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_TEND 0x0040 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_TDFE 0x0020 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_BRK 0x0010 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_FER 0x0008 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_PER 0x0004 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_RDF 0x0002 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--#define SCIF_DR 0x0001 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */
--
- #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
-@@ -121,35 +81,27 @@
- defined(CONFIG_ARCH_SH7367) || \
- defined(CONFIG_ARCH_SH7377) || \
- defined(CONFIG_ARCH_SH7372)
--# define SCIF_ORER 0x0200
--# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER)
- # define SCIF_RFDC_MASK 0x007f
- # define SCIF_TXROOM_MAX 64
- #elif defined(CONFIG_CPU_SUBTYPE_SH7763)
--# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK )
- # define SCIF_RFDC_MASK 0x007f
- # define SCIF_TXROOM_MAX 64
- /* SH7763 SCIF2 support */
- # define SCIF2_RFDC_MASK 0x001f
- # define SCIF2_TXROOM_MAX 16
- #else
--# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
- # define SCIF_RFDC_MASK 0x001f
- # define SCIF_TXROOM_MAX 16
- #endif
-
--#ifndef SCIF_ORER
--#define SCIF_ORER 0x0000
--#endif
--
- #define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND)
--#define SCxSR_ERRORS(port) (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS)
- #define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF)
- #define SCxSR_TDxE(port) (((port)->type == PORT_SCI) ? SCI_TDRE : SCIF_TDFE)
- #define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER)
- #define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
- #define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
--#define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : SCIF_ORER)
-+
-+#define SCxSR_ERRORS(port) (to_sci_port(port)->cfg->error_mask)
-
- #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index a2afc9f..5fac3bc 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -8,6 +8,8 @@
- * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
- */
-
-+#define SCIx_NOT_SUPPORTED (-1)
-+
- enum {
- SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
- SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
-@@ -25,6 +27,28 @@ enum {
- #define SCSCR_CKE1 (1 << 1)
- #define SCSCR_CKE0 (1 << 0)
-
-+/* SCxSR SCI */
-+#define SCI_TDRE 0x80
-+#define SCI_RDRF 0x40
-+#define SCI_ORER 0x20
-+#define SCI_FER 0x10
-+#define SCI_PER 0x08
-+#define SCI_TEND 0x04
-+
-+#define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
-+
-+/* SCxSR SCIF */
-+#define SCIF_ER 0x0080
-+#define SCIF_TEND 0x0040
-+#define SCIF_TDFE 0x0020
-+#define SCIF_BRK 0x0010
-+#define SCIF_FER 0x0008
-+#define SCIF_PER 0x0004
-+#define SCIF_RDF 0x0002
-+#define SCIF_DR 0x0001
-+
-+#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
-+
- /* Offsets into the sci_port->irqs array */
- enum {
- SCIx_ERI_IRQ,
-@@ -56,6 +80,12 @@ struct plat_sci_port {
- unsigned int scbrr_algo_id; /* SCBRR calculation algo */
- unsigned int scscr; /* SCSCR initialization */
-
-+ /*
-+ * Platform overrides if necessary, defaults otherwise.
-+ */
-+ int overrun_bit;
-+ unsigned int error_mask;
-+
- struct device *dma_dev;
-
- unsigned int dma_slave_tx;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0202-serial-sh-sci-Consolidate-RXD-pin-handling.patch b/patches.armadillo800eva/0202-serial-sh-sci-Consolidate-RXD-pin-handling.patch
deleted file mode 100644
index 10fd4707d21cd4..00000000000000
--- a/patches.armadillo800eva/0202-serial-sh-sci-Consolidate-RXD-pin-handling.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From f310bca4c5b0a4dbaf6bf4c4f17068cab7a74d9c Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 8 Jun 2011 18:51:32 +0900
-Subject: serial: sh-sci: Consolidate RXD pin handling.
-
-Non-SCI parts do not have the special port reg necessary for cases where
-the RX and SCI pins are muxed and need to be manually polled, so these
-like always fall back on the normal FIFO processing paths. SH7760 is in a
-class in and of itself with regards to mapping its SIM card interface via
-the SCI port class despite not having any of the RXD lines wired up and
-so implicitly behaving more like a SCIF in this regard. Out of the other
-CPUs, some support the port check via the same block while others do it
-through an external SuperI/O, so it's not even possible to perform the
-check relative to the ioremapped cookie offset, so the separate read
-semantics are preserved here, too.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 514820eb982eb85677ed2ecef9710e90e24fbdab)
-
-Conflicts:
-
- arch/sh/kernel/cpu/sh3/setup-sh770x.c
- arch/sh/kernel/cpu/sh4/setup-sh7750.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 13 +++++++++++++
- drivers/tty/serial/sh-sci.h | 29 -----------------------------
- include/linux/serial_sci.h | 2 ++
- 3 files changed, 15 insertions(+), 29 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index b2c424b..92ad023 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -363,6 +363,19 @@ static int sci_rxfill(struct uart_port *port)
- return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0;
- }
-
-+/*
-+ * SCI helper for checking the state of the muxed port/RXD pins.
-+ */
-+static inline int sci_rxd_in(struct uart_port *port)
-+{
-+ struct sci_port *s = to_sci_port(port);
-+
-+ if (s->cfg->port_reg <= 0)
-+ return 1;
-+
-+ return !!__raw_readb(s->cfg->port_reg);
-+}
-+
- /* ********************************************************************** *
- * the interrupt related routines *
- * ********************************************************************** */
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index a2f69f8..4c67c9a 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -289,32 +289,3 @@ SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
- #endif
- #define sci_in(port, reg) sci_##reg##_in(port)
- #define sci_out(port, reg, value) sci_##reg##_out(port, value)
--
--#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7707) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7708) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7709)
--static inline int sci_rxd_in(struct uart_port *port)
--{
-- if (port->mapbase == 0xfffffe80)
-- return __raw_readb(SCPDR)&0x01 ? 1 : 0; /* SCI */
-- return 1;
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7751) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7091)
--static inline int sci_rxd_in(struct uart_port *port)
--{
-- if (port->mapbase == 0xffe00000)
-- return __raw_readb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */
-- return 1;
--}
--#else /* default case for non-SCI processors */
--static inline int sci_rxd_in(struct uart_port *port)
--{
-- return 1;
--}
--#endif
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 5fac3bc..ecefec7 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -86,6 +86,8 @@ struct plat_sci_port {
- int overrun_bit;
- unsigned int error_mask;
-
-+ int port_reg;
-+
- struct device *dma_dev;
-
- unsigned int dma_slave_tx;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0203-serial-sh-sci-More-unused-define-purging.patch b/patches.armadillo800eva/0203-serial-sh-sci-More-unused-define-purging.patch
deleted file mode 100644
index 1d28a967b7cd2e..00000000000000
--- a/patches.armadillo800eva/0203-serial-sh-sci-More-unused-define-purging.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From deb74f85329e5db4bc1827b104badf18d13a992f Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 8 Jun 2011 19:13:06 +0900
-Subject: serial: sh-sci: More unused define purging.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit e13198894bf6308c097e5678ee315e12b2e1b7a8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.h | 21 ++++++---------------
- 1 file changed, 6 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index 4c67c9a..25788c4 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -2,15 +2,13 @@
- #include <linux/io.h>
- #include <linux/gpio.h>
-
--#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
-+#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-+ defined(CONFIG_CPU_SUBTYPE_SH7706) || \
- defined(CONFIG_CPU_SUBTYPE_SH7707) || \
- defined(CONFIG_CPU_SUBTYPE_SH7708) || \
- defined(CONFIG_CPU_SUBTYPE_SH7709)
- # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */
- # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
--# define SCPCR 0xA4000116
--# define SCPDR 0xA4000136
- #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
- defined(CONFIG_ARCH_SH73A0) || \
-@@ -19,20 +17,16 @@
- defined(CONFIG_ARCH_SH7372)
- # define PORT_PTCR 0xA405011EUL
- # define PORT_PVCR 0xA4050122UL
--#elif defined(CONFIG_SH_RTS7751R2D)
--# define SCSPTR1 0xFFE0001C /* 8 bit SCIF */
--# define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
- defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
- defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
- defined(CONFIG_CPU_SUBTYPE_SH7091) || \
- defined(CONFIG_CPU_SUBTYPE_SH7751) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7751R)
--# define SCSPTR1 0xffe0001c /* 8 bit SCI */
-+ defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
-+ defined(CONFIG_CPU_SUBTYPE_SH4_202)
- # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
- # define SCSPTR0 0xfe600024 /* 16 bit SCIF */
--# define SCSPTR1 0xfe610024 /* 16 bit SCIF */
- # define SCSPTR2 0xfe620024 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
- # define SCSPTR0 0xA4400000 /* 16 bit SCIF */
-@@ -48,16 +42,13 @@
- # define SCSPTR0 SCPDR0
- #elif defined(CONFIG_CPU_SUBTYPE_SH7723)
- # define SCSPTR0 0xa4050160
--#elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
--# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7757)
- # define SCSPTR0 0xfe4b0020
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
-+#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-+ defined(CONFIG_CPU_SUBTYPE_SH7780)
- # define SCSPTR0 0xffe00024 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7770)
- # define SCSPTR0 0xff923020 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
--# define SCSPTR0 0xffe00024 /* 16 bit SCIF */
- #elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
- defined(CONFIG_CPU_SUBTYPE_SH7786)
- # define SCSPTR0 0xffea0024 /* 16 bit SCIF */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0204-serial-sh-sci-Abstract-register-maps.patch b/patches.armadillo800eva/0204-serial-sh-sci-Abstract-register-maps.patch
deleted file mode 100644
index afb06357f9d7ac..00000000000000
--- a/patches.armadillo800eva/0204-serial-sh-sci-Abstract-register-maps.patch
+++ /dev/null
@@ -1,766 +0,0 @@
-From 87a637a00d37956fffc06dac76e0678cc21f4cd2 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 14 Jun 2011 12:40:19 +0900
-Subject: serial: sh-sci: Abstract register maps.
-
-This takes a bit of a sledgehammer to the horribly CPU subtype
-ifdef-ridden header and abstracts all of the different register layouts
-in to distinct types which in turn can be overriden on a per-port basis,
-or permitted to default to the map matching the port type at probe time.
-
-In the process this ultimately fixes up inumerable bugs with mismatches
-on various CPU types (particularly the legacy ones that were obviously
-broken years ago and no one noticed) and provides a more tightly coupled
-and consolidated platform for extending and implementing generic
-features.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 61a6976bf19a6cf5dfcf37c3536665b316f22d49)
-
-Conflicts:
-
- arch/sh/Makefile
- arch/sh/include/cpu-sh3/cpu/serial.h
- arch/sh/include/cpu-sh4a/cpu/serial.h
- arch/sh/kernel/cpu/sh3/Makefile
- arch/sh/kernel/cpu/sh3/serial-sh770x.c
- arch/sh/kernel/cpu/sh3/serial-sh7710.c
- arch/sh/kernel/cpu/sh3/serial-sh7720.c
- arch/sh/kernel/cpu/sh3/setup-sh7705.c
- arch/sh/kernel/cpu/sh3/setup-sh770x.c
- arch/sh/kernel/cpu/sh3/setup-sh7720.c
- arch/sh/kernel/cpu/sh4/setup-sh7750.c
- arch/sh/kernel/cpu/sh4/setup-sh7760.c
- arch/sh/kernel/cpu/sh4a/Makefile
- arch/sh/kernel/cpu/sh4a/serial-sh7722.c
- arch/sh/kernel/cpu/sh4a/setup-sh7366.c
- arch/sh/kernel/cpu/sh4a/setup-sh7722.c
- arch/sh/kernel/cpu/sh4a/setup-sh7723.c
- arch/sh/kernel/cpu/sh4a/setup-sh7724.c
- arch/sh/kernel/cpu/sh4a/setup-sh7763.c
- arch/sh/kernel/cpu/sh4a/setup-sh7780.c
- arch/sh/kernel/cpu/sh4a/setup-sh7785.c
- arch/sh/kernel/cpu/sh4a/setup-sh7786.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 364 ++++++++++++++++++++++++++++++++-----------
- drivers/tty/serial/sh-sci.h | 222 --------------------------
- include/linux/serial_sci.h | 36 +++++
- 3 files changed, 309 insertions(+), 313 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 92ad023..5979668 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -117,6 +117,255 @@ to_sci_port(struct uart_port *uart)
- return container_of(uart, struct sci_port, port);
- }
-
-+struct plat_sci_reg {
-+ u8 offset, size;
-+};
-+
-+/* Helper for invalidating specific entries of an inherited map. */
-+#define sci_reg_invalid { .offset = 0, .size = 0 }
-+
-+static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
-+ [SCIx_PROBE_REGTYPE] = {
-+ [0 ... SCIx_NR_REGS - 1] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common SCI definitions, dependent on the port's regshift
-+ * value.
-+ */
-+ [SCIx_SCI_REGTYPE] = {
-+ [SCSMR] = { 0x00, 8 },
-+ [SCBRR] = { 0x01, 8 },
-+ [SCSCR] = { 0x02, 8 },
-+ [SCxTDR] = { 0x03, 8 },
-+ [SCxSR] = { 0x04, 8 },
-+ [SCxRDR] = { 0x05, 8 },
-+ [SCFCR] = sci_reg_invalid,
-+ [SCFDR] = sci_reg_invalid,
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common definitions for legacy IrDA ports, dependent on
-+ * regshift value.
-+ */
-+ [SCIx_IRDA_REGTYPE] = {
-+ [SCSMR] = { 0x00, 8 },
-+ [SCBRR] = { 0x01, 8 },
-+ [SCSCR] = { 0x02, 8 },
-+ [SCxTDR] = { 0x03, 8 },
-+ [SCxSR] = { 0x04, 8 },
-+ [SCxRDR] = { 0x05, 8 },
-+ [SCFCR] = { 0x06, 8 },
-+ [SCFDR] = { 0x07, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common SCIFA definitions.
-+ */
-+ [SCIx_SCIFA_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x20, 8 },
-+ [SCxSR] = { 0x14, 16 },
-+ [SCxRDR] = { 0x24, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common SCIFB definitions.
-+ */
-+ [SCIx_SCIFB_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x40, 8 },
-+ [SCxSR] = { 0x14, 16 },
-+ [SCxRDR] = { 0x60, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common SH-3 SCIF definitions.
-+ */
-+ [SCIx_SH3_SCIF_REGTYPE] = {
-+ [SCSMR] = { 0x00, 8 },
-+ [SCBRR] = { 0x02, 8 },
-+ [SCSCR] = { 0x04, 8 },
-+ [SCxTDR] = { 0x06, 8 },
-+ [SCxSR] = { 0x08, 16 },
-+ [SCxRDR] = { 0x0a, 8 },
-+ [SCFCR] = { 0x0c, 8 },
-+ [SCFDR] = { 0x0e, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+
-+ /*
-+ * Common SH-4(A) SCIF(B) definitions.
-+ */
-+ [SCIx_SH4_SCIF_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x0c, 8 },
-+ [SCxSR] = { 0x10, 16 },
-+ [SCxRDR] = { 0x14, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = { 0x20, 16 },
-+ [SCLSR] = { 0x24, 16 },
-+ },
-+
-+ /*
-+ * Common SH-4(A) SCIF(B) definitions for ports without an SCSPTR
-+ * register.
-+ */
-+ [SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x0c, 8 },
-+ [SCxSR] = { 0x10, 16 },
-+ [SCxRDR] = { 0x14, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = { 0x24, 16 },
-+ },
-+
-+ /*
-+ * Common SH-4(A) SCIF(B) definitions for ports with FIFO data
-+ * count registers.
-+ */
-+ [SCIx_SH4_SCIF_FIFODATA_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x0c, 8 },
-+ [SCxSR] = { 0x10, 16 },
-+ [SCxRDR] = { 0x14, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = { 0x1c, 16 }, /* aliased to SCFDR */
-+ [SCRFDR] = { 0x20, 16 },
-+ [SCSPTR] = { 0x24, 16 },
-+ [SCLSR] = { 0x28, 16 },
-+ },
-+
-+ /*
-+ * SH7705-style SCIF(B) ports, lacking both SCSPTR and SCLSR
-+ * registers.
-+ */
-+ [SCIx_SH7705_SCIF_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x20, 8 },
-+ [SCxSR] = { 0x14, 16 },
-+ [SCxRDR] = { 0x24, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = sci_reg_invalid,
-+ [SCLSR] = sci_reg_invalid,
-+ },
-+};
-+
-+/*
-+ * The "offset" here is rather misleading, in that it refers to an enum
-+ * value relative to the port mapping rather than the fixed offset
-+ * itself, which needs to be manually retrieved from the platform's
-+ * register map for the given port.
-+ */
-+static unsigned int sci_serial_in(struct uart_port *p, int offset)
-+{
-+ struct sci_port *s = to_sci_port(p);
-+ struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + offset;
-+
-+ if (reg->size == 8)
-+ return ioread8(p->membase + (reg->offset << p->regshift));
-+ else if (reg->size == 16)
-+ return ioread16(p->membase + (reg->offset << p->regshift));
-+ else
-+ WARN(1, "Invalid register access\n");
-+
-+ return 0;
-+}
-+
-+static void sci_serial_out(struct uart_port *p, int offset, int value)
-+{
-+ struct sci_port *s = to_sci_port(p);
-+ struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + offset;
-+
-+ if (reg->size == 8)
-+ iowrite8(value, p->membase + (reg->offset << p->regshift));
-+ else if (reg->size == 16)
-+ iowrite16(value, p->membase + (reg->offset << p->regshift));
-+ else
-+ WARN(1, "Invalid register access\n");
-+}
-+
-+#define sci_in(up, offset) (up->serial_in(up, offset))
-+#define sci_out(up, offset, value) (up->serial_out(up, offset, value))
-+
-+static int sci_probe_regmap(struct plat_sci_port *cfg)
-+{
-+ switch (cfg->type) {
-+ case PORT_SCI:
-+ cfg->regtype = SCIx_SCI_REGTYPE;
-+ break;
-+ case PORT_IRDA:
-+ cfg->regtype = SCIx_IRDA_REGTYPE;
-+ break;
-+ case PORT_SCIFA:
-+ cfg->regtype = SCIx_SCIFA_REGTYPE;
-+ break;
-+ case PORT_SCIFB:
-+ cfg->regtype = SCIx_SCIFB_REGTYPE;
-+ break;
-+ case PORT_SCIF:
-+ /*
-+ * The SH-4 is a bit of a misnomer here, although that's
-+ * where this particular port layout originated. This
-+ * configuration (or some slight variation thereof)
-+ * remains the dominant model for all SCIFs.
-+ */
-+ cfg->regtype = SCIx_SH4_SCIF_REGTYPE;
-+ break;
-+ default:
-+ printk(KERN_ERR "Can't probe register map for given port\n");
-+ return -EINVAL;
-+ }
-+
-+ return 0;
-+}
-+
- #if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_SH_SCI_CONSOLE)
-
- #ifdef CONFIG_CONSOLE_POLL
-@@ -160,103 +409,29 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
- }
- #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
-
--#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- if (port->mapbase == 0xA4400000) {
-- __raw_writew(__raw_readw(PACR) & 0xffc0, PACR);
-- __raw_writew(__raw_readw(PBCR) & 0x0fff, PBCR);
-- } else if (port->mapbase == 0xA4410000)
-- __raw_writew(__raw_readw(PBCR) & 0xf003, PBCR);
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7721)
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- unsigned short data;
--
-- if (cflag & CRTSCTS) {
-- /* enable RTS/CTS */
-- if (port->mapbase == 0xa4430000) { /* SCIF0 */
-- /* Clear PTCR bit 9-2; enable all scif pins but sck */
-- data = __raw_readw(PORT_PTCR);
-- __raw_writew((data & 0xfc03), PORT_PTCR);
-- } else if (port->mapbase == 0xa4438000) { /* SCIF1 */
-- /* Clear PVCR bit 9-2 */
-- data = __raw_readw(PORT_PVCR);
-- __raw_writew((data & 0xfc03), PORT_PVCR);
-- }
-- } else {
-- if (port->mapbase == 0xa4430000) { /* SCIF0 */
-- /* Clear PTCR bit 5-2; enable only tx and rx */
-- data = __raw_readw(PORT_PTCR);
-- __raw_writew((data & 0xffc3), PORT_PTCR);
-- } else if (port->mapbase == 0xa4438000) { /* SCIF1 */
-- /* Clear PVCR bit 5-2 */
-- data = __raw_readw(PORT_PVCR);
-- __raw_writew((data & 0xffc3), PORT_PVCR);
-- }
-- }
--}
--#elif defined(CONFIG_CPU_SH3)
--/* For SH7705, SH7706, SH7707, SH7709, SH7709A, SH7729 */
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
-+static void sci_init_pins(struct uart_port *port, unsigned int cflag)
- {
-- unsigned short data;
--
-- /* We need to set SCPCR to enable RTS/CTS */
-- data = __raw_readw(SCPCR);
-- /* Clear out SCP7MD1,0, SCP6MD1,0, SCP4MD1,0*/
-- __raw_writew(data & 0x0fcf, SCPCR);
--
-- if (!(cflag & CRTSCTS)) {
-- /* We need to set SCPCR to enable RTS/CTS */
-- data = __raw_readw(SCPCR);
-- /* Clear out SCP7MD1,0, SCP4MD1,0,
-- Set SCP6MD1,0 = {01} (output) */
-- __raw_writew((data & 0x0fcf) | 0x1000, SCPCR);
-+ struct sci_port *s = to_sci_port(port);
-+ struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
-
-- data = __raw_readb(SCPDR);
-- /* Set /RTS2 (bit6) = 0 */
-- __raw_writeb(data & 0xbf, SCPDR);
-+ /*
-+ * Use port-specific handler if provided.
-+ */
-+ if (s->cfg->ops && s->cfg->ops->init_pins) {
-+ s->cfg->ops->init_pins(port, cflag);
-+ return;
- }
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- unsigned short data;
-
-- if (port->mapbase == 0xffe00000) {
-- data = __raw_readw(PSCR);
-- data &= ~0x03cf;
-- if (!(cflag & CRTSCTS))
-- data |= 0x0340;
-+ /*
-+ * For the generic path SCSPTR is necessary. Bail out if that's
-+ * unavailable, too.
-+ */
-+ if (!reg->size)
-+ return;
-
-- __raw_writew(data, PSCR);
-- }
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7780) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7785) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7786) || \
-- defined(CONFIG_CPU_SUBTYPE_SHX3)
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- if (!(cflag & CRTSCTS))
-- __raw_writew(0x0080, SCSPTR0); /* Set RTS = 1 */
--}
--#elif defined(CONFIG_CPU_SH4) && !defined(CONFIG_CPU_SH4A)
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
- if (!(cflag & CRTSCTS))
-- __raw_writew(0x0080, SCSPTR2); /* Set RTS = 1 */
-+ sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */
- }
--#else
--static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
--{
-- /* Nothing to do */
--}
--#endif
-
- #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
- defined(CONFIG_CPU_SUBTYPE_SH7780) || \
-@@ -1757,6 +1932,9 @@ static int __devinit sci_init_single(struct platform_device *dev,
- break;
- }
-
-+ if (p->regtype == SCIx_PROBE_REGTYPE)
-+ BUG_ON(sci_probe_regmap(p) != 0);
-+
- if (dev) {
- sci_port->iclk = clk_get(&dev->dev, "sci_ick");
- if (IS_ERR(sci_port->iclk)) {
-@@ -1817,9 +1995,10 @@ static int __devinit sci_init_single(struct platform_device *dev,
- port->mapbase = p->mapbase;
- port->type = p->type;
- port->flags = p->flags;
-+ port->regshift = p->regshift;
-
- /*
-- * The UART port needs an IRQ value, so we peg this to the TX IRQ
-+ * The UART port needs an IRQ value, so we peg this to the RX IRQ
- * for the multi-IRQ ports, which is where we are primarily
- * concerned with the shutdown path synchronization.
- *
-@@ -1827,6 +2006,9 @@ static int __devinit sci_init_single(struct platform_device *dev,
- */
- port->irq = p->irqs[SCIx_RXI_IRQ];
-
-+ port->serial_in = sci_serial_in;
-+ port->serial_out = sci_serial_out;
-+
- if (p->dma_dev)
- dev_dbg(port->dev, "DMA device %p, tx %d, rx %d\n",
- p->dma_dev, p->dma_slave_tx, p->dma_slave_rx);
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index 25788c4..f46fd23 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -3,69 +3,6 @@
- #include <linux/gpio.h>
-
- #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7706) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7707) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7708) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7709)
--# define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */
--# define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
-- defined(CONFIG_ARCH_SH73A0) || \
-- defined(CONFIG_ARCH_SH7367) || \
-- defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372)
--# define PORT_PTCR 0xA405011EUL
--# define PORT_PVCR 0xA4050122UL
--#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7091) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7751) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
-- defined(CONFIG_CPU_SUBTYPE_SH4_202)
--# define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
--# define SCSPTR0 0xfe600024 /* 16 bit SCIF */
--# define SCSPTR2 0xfe620024 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
--# define SCSPTR0 0xA4400000 /* 16 bit SCIF */
--# define PACR 0xa4050100
--# define PBCR 0xa4050102
--#elif defined(CONFIG_CPU_SUBTYPE_SH7343)
--# define SCSPTR0 0xffe00010 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
--# define PWDR 0xA4050166
--# define PSCR 0xA405011E
--#elif defined(CONFIG_CPU_SUBTYPE_SH7366)
--# define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */
--# define SCSPTR0 SCPDR0
--#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
--# define SCSPTR0 0xa4050160
--#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
--# define SCSPTR0 0xfe4b0020
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7780)
--# define SCSPTR0 0xffe00024 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7770)
--# define SCSPTR0 0xff923020 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7786)
--# define SCSPTR0 0xffea0024 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7203) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7206) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7263)
--# define SCSPTR0 0xfffe8020 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
--# define SCSPTR0 0xf8400020 /* 16 bit SCIF */
--#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
--# define SCSPTR0 0xffc30020 /* 16 bit SCIF */
--#else
--# error CPU subtype not defined
--#endif
--
--#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
- defined(CONFIG_ARCH_SH73A0) || \
-@@ -121,162 +58,3 @@
-
- #define SCI_MAJOR 204
- #define SCI_MINOR_START 8
--
--#define SCI_IN(size, offset) \
-- ioread##size(port->membase + (offset))
--
--#define SCI_OUT(size, offset, value) \
-- iowrite##size(value, port->membase + (offset))
--
--#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
-- static inline unsigned int sci_##name##_in(struct uart_port *port) \
-- { \
-- if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
-- return SCI_IN(scif_size, scif_offset); \
-- } else { /* PORT_SCI or PORT_SCIFA */ \
-- return SCI_IN(sci_size, sci_offset); \
-- } \
-- } \
-- static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
-- { \
-- if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
-- SCI_OUT(scif_size, scif_offset, value); \
-- } else { /* PORT_SCI or PORT_SCIFA */ \
-- SCI_OUT(sci_size, sci_offset, value); \
-- } \
-- }
--
--#define CPU_SCIF_FNS(name, scif_offset, scif_size) \
-- static inline unsigned int sci_##name##_in(struct uart_port *port) \
-- { \
-- return SCI_IN(scif_size, scif_offset); \
-- } \
-- static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
-- { \
-- SCI_OUT(scif_size, scif_offset, value); \
-- }
--
--#if defined(CONFIG_CPU_SH3) || \
-- defined(CONFIG_ARCH_SH73A0) || \
-- defined(CONFIG_ARCH_SH7367) || \
-- defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372)
--#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
--#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
--#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
--#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
-- defined(CONFIG_ARCH_SH7367)
--#define SCIF_FNS(name, scif_offset, scif_size) \
-- CPU_SCIF_FNS(name, scif_offset, scif_size)
--#elif defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372) || \
-- defined(CONFIG_ARCH_SH73A0)
--#define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scifb_offset, sh4_scifb_size) \
-- CPU_SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scifb_offset, sh4_scifb_size)
--#define SCIF_FNS(name, scif_offset, scif_size) \
-- CPU_SCIF_FNS(name, scif_offset, scif_size)
--#else
--#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
--#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIF_FNS(name, sh3_scif_offset, sh3_scif_size)
--#endif
--#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
-- defined(CONFIG_CPU_SUBTYPE_SH7724)
-- #define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size)
-- #define SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
--#else
--#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
-- sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
--#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
-- CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
--#endif
--
--#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
-- defined(CONFIG_ARCH_SH7367)
--
--SCIF_FNS(SCSMR, 0x00, 16)
--SCIF_FNS(SCBRR, 0x04, 8)
--SCIF_FNS(SCSCR, 0x08, 16)
--SCIF_FNS(SCxSR, 0x14, 16)
--SCIF_FNS(SCFCR, 0x18, 16)
--SCIF_FNS(SCFDR, 0x1c, 16)
--SCIF_FNS(SCxTDR, 0x20, 8)
--SCIF_FNS(SCxRDR, 0x24, 8)
--SCIF_FNS(SCLSR, 0x00, 0)
--#elif defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372) || \
-- defined(CONFIG_ARCH_SH73A0)
--SCIF_FNS(SCSMR, 0x00, 16)
--SCIF_FNS(SCBRR, 0x04, 8)
--SCIF_FNS(SCSCR, 0x08, 16)
--SCIF_FNS(SCTDSR, 0x0c, 16)
--SCIF_FNS(SCFER, 0x10, 16)
--SCIF_FNS(SCxSR, 0x14, 16)
--SCIF_FNS(SCFCR, 0x18, 16)
--SCIF_FNS(SCFDR, 0x1c, 16)
--SCIF_FNS(SCTFDR, 0x38, 16)
--SCIF_FNS(SCRFDR, 0x3c, 16)
--SCIx_FNS(SCxTDR, 0x20, 8, 0x40, 8)
--SCIx_FNS(SCxRDR, 0x24, 8, 0x60, 8)
--SCIF_FNS(SCLSR, 0x00, 0)
--#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
-- defined(CONFIG_CPU_SUBTYPE_SH7724)
--SCIx_FNS(SCSMR, 0x00, 16, 0x00, 16)
--SCIx_FNS(SCBRR, 0x04, 8, 0x04, 8)
--SCIx_FNS(SCSCR, 0x08, 16, 0x08, 16)
--SCIx_FNS(SCxTDR, 0x20, 8, 0x0c, 8)
--SCIx_FNS(SCxSR, 0x14, 16, 0x10, 16)
--SCIx_FNS(SCxRDR, 0x24, 8, 0x14, 8)
--SCIx_FNS(SCSPTR, 0, 0, 0, 0)
--SCIF_FNS(SCFCR, 0x18, 16)
--SCIF_FNS(SCFDR, 0x1c, 16)
--SCIF_FNS(SCLSR, 0x24, 16)
--#else
--/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 */
--/* name off sz off sz off sz off sz */
--SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16)
--SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8)
--SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16)
--SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8)
--SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16)
--SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8)
--SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
--#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7780) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7785) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7786)
--SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
--SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
--SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
--SCIF_FNS(SCSPTR, 0, 0, 0x24, 16)
--SCIF_FNS(SCLSR, 0, 0, 0x28, 16)
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
--SCIF_FNS(SCFDR, 0, 0, 0x1C, 16)
--SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
--SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
--SCIF_FNS(SCSPTR, 0, 0, 0x24, 16)
--SCIF_FNS(SCLSR, 0, 0, 0x28, 16)
--#else
--SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
--#if defined(CONFIG_CPU_SUBTYPE_SH7722)
--SCIF_FNS(SCSPTR, 0, 0, 0, 0)
--#else
--SCIF_FNS(SCSPTR, 0, 0, 0x20, 16)
--#endif
--SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
--#endif
--#endif
--#define sci_in(port, reg) sci_##reg##_in(port)
--#define sci_out(port, reg, value) sci_##reg##_out(port, value)
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index ecefec7..4ca130a 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -58,6 +58,22 @@ enum {
- SCIx_NR_IRQS,
- };
-
-+enum {
-+ SCIx_PROBE_REGTYPE,
-+
-+ SCIx_SCI_REGTYPE,
-+ SCIx_IRDA_REGTYPE,
-+ SCIx_SCIFA_REGTYPE,
-+ SCIx_SCIFB_REGTYPE,
-+ SCIx_SH3_SCIF_REGTYPE,
-+ SCIx_SH4_SCIF_REGTYPE,
-+ SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
-+ SCIx_SH4_SCIF_FIFODATA_REGTYPE,
-+ SCIx_SH7705_SCIF_REGTYPE,
-+
-+ SCIx_NR_REGTYPES,
-+};
-+
- #define SCIx_IRQ_MUXED(irq) \
- { \
- [SCIx_ERI_IRQ] = (irq), \
-@@ -66,8 +82,24 @@ enum {
- [SCIx_BRI_IRQ] = (irq), \
- }
-
-+/*
-+ * SCI register subset common for all port types.
-+ * Not all registers will exist on all parts.
-+ */
-+enum {
-+ SCSMR, SCBRR, SCSCR, SCxSR,
-+ SCFCR, SCFDR, SCxTDR, SCxRDR,
-+ SCLSR, SCTFDR, SCRFDR, SCSPTR,
-+
-+ SCIx_NR_REGS,
-+};
-+
- struct device;
-
-+struct plat_sci_port_ops {
-+ void (*init_pins)(struct uart_port *, unsigned int cflag);
-+};
-+
- /*
- * Platform device specific platform_data struct
- */
-@@ -87,6 +119,10 @@ struct plat_sci_port {
- unsigned int error_mask;
-
- int port_reg;
-+ unsigned char regshift;
-+ unsigned char regtype;
-+
-+ struct plat_sci_port_ops *ops;
-
- struct device *dma_dev;
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0205-serial-sh-sci-FIFO-sizing-helper-consolidation.patch b/patches.armadillo800eva/0205-serial-sh-sci-FIFO-sizing-helper-consolidation.patch
deleted file mode 100644
index 97fb7dcf17df0b..00000000000000
--- a/patches.armadillo800eva/0205-serial-sh-sci-FIFO-sizing-helper-consolidation.patch
+++ /dev/null
@@ -1,255 +0,0 @@
-From 9668c7330aa5432fbb3582ba16909fc203d6b8c1 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 14 Jun 2011 17:38:19 +0900
-Subject: serial: sh-sci: FIFO sizing helper consolidation.
-
-This consolidates all of the TX/RX fill/room nonsense in to a single set
-of fairly heavyweight definitions. The implementation goes in descending
-order of complexity, testing the register map for capabilities until we
-run out of options and do it the legacy SCI way. Masks are derived
-directly from the per-port FIFO size, meaning that platforms with FIFO
-sizes not matching the standard port types will still need to manually
-fix them up.
-
-This also fixes up a number of issues such as tx_empty being completely
-bogus for SCI and IrDA ports, some ports using masks smaller or greater
-than their FIFO size, and so forth.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 72b294cf76dcd6d37891387049ddbe3c25043cb8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 126 +++++++++----------------------------------
- drivers/tty/serial/sh-sci.h | 20 -------
- 2 files changed, 24 insertions(+), 122 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 5979668..f47c534 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -297,6 +297,8 @@ static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
- },
- };
-
-+#define sci_getreg(up, offset) (sci_regmap[to_sci_port(up)->cfg->regtype] + offset)
-+
- /*
- * The "offset" here is rather misleading, in that it refers to an enum
- * value relative to the port mapping rather than the fixed offset
-@@ -305,8 +307,7 @@ static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
- */
- static unsigned int sci_serial_in(struct uart_port *p, int offset)
- {
-- struct sci_port *s = to_sci_port(p);
-- struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + offset;
-+ struct plat_sci_reg *reg = sci_getreg(p, offset);
-
- if (reg->size == 8)
- return ioread8(p->membase + (reg->offset << p->regshift));
-@@ -320,8 +321,7 @@ static unsigned int sci_serial_in(struct uart_port *p, int offset)
-
- static void sci_serial_out(struct uart_port *p, int offset, int value)
- {
-- struct sci_port *s = to_sci_port(p);
-- struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + offset;
-+ struct plat_sci_reg *reg = sci_getreg(p, offset);
-
- if (reg->size == 8)
- iowrite8(value, p->membase + (reg->offset << p->regshift));
-@@ -433,108 +433,38 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
- sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */
- }
-
--#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7780) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7785) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7786)
--static int scif_txfill(struct uart_port *port)
--{
-- return sci_in(port, SCTFDR) & 0xff;
--}
--
--static int scif_txroom(struct uart_port *port)
-+static int sci_txfill(struct uart_port *port)
- {
-- return SCIF_TXROOM_MAX - scif_txfill(port);
--}
-+ struct plat_sci_reg *reg;
-
--static int scif_rxfill(struct uart_port *port)
--{
-- return sci_in(port, SCRFDR) & 0xff;
--}
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
--static int scif_txfill(struct uart_port *port)
--{
-- if (port->mapbase == 0xffe00000 ||
-- port->mapbase == 0xffe08000)
-- /* SCIF0/1*/
-+ reg = sci_getreg(port, SCTFDR);
-+ if (reg->size)
- return sci_in(port, SCTFDR) & 0xff;
-- else
-- /* SCIF2 */
-- return sci_in(port, SCFDR) >> 8;
--}
-
--static int scif_txroom(struct uart_port *port)
--{
-- if (port->mapbase == 0xffe00000 ||
-- port->mapbase == 0xffe08000)
-- /* SCIF0/1*/
-- return SCIF_TXROOM_MAX - scif_txfill(port);
-- else
-- /* SCIF2 */
-- return SCIF2_TXROOM_MAX - scif_txfill(port);
--}
--
--static int scif_rxfill(struct uart_port *port)
--{
-- if ((port->mapbase == 0xffe00000) ||
-- (port->mapbase == 0xffe08000)) {
-- /* SCIF0/1*/
-- return sci_in(port, SCRFDR) & 0xff;
-- } else {
-- /* SCIF2 */
-- return sci_in(port, SCFDR) & SCIF2_RFDC_MASK;
-- }
--}
--#elif defined(CONFIG_ARCH_SH7372)
--static int scif_txfill(struct uart_port *port)
--{
-- if (port->type == PORT_SCIFA)
-+ reg = sci_getreg(port, SCFDR);
-+ if (reg->size)
- return sci_in(port, SCFDR) >> 8;
-- else
-- return sci_in(port, SCTFDR);
--}
--
--static int scif_txroom(struct uart_port *port)
--{
-- return port->fifosize - scif_txfill(port);
--}
-
--static int scif_rxfill(struct uart_port *port)
--{
-- if (port->type == PORT_SCIFA)
-- return sci_in(port, SCFDR) & SCIF_RFDC_MASK;
-- else
-- return sci_in(port, SCRFDR);
--}
--#else
--static int scif_txfill(struct uart_port *port)
--{
-- return sci_in(port, SCFDR) >> 8;
--}
--
--static int scif_txroom(struct uart_port *port)
--{
-- return SCIF_TXROOM_MAX - scif_txfill(port);
--}
--
--static int scif_rxfill(struct uart_port *port)
--{
-- return sci_in(port, SCFDR) & SCIF_RFDC_MASK;
--}
--#endif
--
--static int sci_txfill(struct uart_port *port)
--{
- return !(sci_in(port, SCxSR) & SCI_TDRE);
- }
-
- static int sci_txroom(struct uart_port *port)
- {
-- return !sci_txfill(port);
-+ return port->fifosize - sci_txfill(port);
- }
-
- static int sci_rxfill(struct uart_port *port)
- {
-+ struct plat_sci_reg *reg;
-+
-+ reg = sci_getreg(port, SCRFDR);
-+ if (reg->size)
-+ return sci_in(port, SCRFDR) & 0xff;
-+
-+ reg = sci_getreg(port, SCFDR);
-+ if (reg->size)
-+ return sci_in(port, SCFDR) & ((port->fifosize << 1) - 1);
-+
- return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0;
- }
-
-@@ -574,10 +504,7 @@ static void sci_transmit_chars(struct uart_port *port)
- return;
- }
-
-- if (port->type == PORT_SCI)
-- count = sci_txroom(port);
-- else
-- count = scif_txroom(port);
-+ count = sci_txroom(port);
-
- do {
- unsigned char c;
-@@ -632,13 +559,8 @@ static void sci_receive_chars(struct uart_port *port)
- return;
-
- while (1) {
-- if (port->type == PORT_SCI)
-- count = sci_rxfill(port);
-- else
-- count = scif_rxfill(port);
--
- /* Don't copy more bytes than there is room for in the buffer */
-- count = tty_buffer_request_room(tty, count);
-+ count = tty_buffer_request_room(tty, sci_rxfill(port));
-
- /* If for any reason we can't copy more data, we're done! */
- if (count == 0)
-@@ -1096,7 +1018,7 @@ static void sci_free_irq(struct sci_port *port)
- static unsigned int sci_tx_empty(struct uart_port *port)
- {
- unsigned short status = sci_in(port, SCxSR);
-- unsigned short in_tx_fifo = scif_txfill(port);
-+ unsigned short in_tx_fifo = sci_txfill(port);
-
- return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0;
- }
-diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
-index f46fd23..a1a2d36 100644
---- a/drivers/tty/serial/sh-sci.h
-+++ b/drivers/tty/serial/sh-sci.h
-@@ -2,26 +2,6 @@
- #include <linux/io.h>
- #include <linux/gpio.h>
-
--#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7720) || \
-- defined(CONFIG_CPU_SUBTYPE_SH7721) || \
-- defined(CONFIG_ARCH_SH73A0) || \
-- defined(CONFIG_ARCH_SH7367) || \
-- defined(CONFIG_ARCH_SH7377) || \
-- defined(CONFIG_ARCH_SH7372)
--# define SCIF_RFDC_MASK 0x007f
--# define SCIF_TXROOM_MAX 64
--#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
--# define SCIF_RFDC_MASK 0x007f
--# define SCIF_TXROOM_MAX 64
--/* SH7763 SCIF2 support */
--# define SCIF2_RFDC_MASK 0x001f
--# define SCIF2_TXROOM_MAX 16
--#else
--# define SCIF_RFDC_MASK 0x001f
--# define SCIF_TXROOM_MAX 16
--#endif
--
- #define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND)
- #define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF)
- #define SCxSR_TDxE(port) (((port)->type == PORT_SCI) ? SCI_TDRE : SCIF_TDFE)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0206-serial-sh-sci-Support-generic-SCLSR-overrun-detectio.patch b/patches.armadillo800eva/0206-serial-sh-sci-Support-generic-SCLSR-overrun-detectio.patch
deleted file mode 100644
index 402c2e7aec111a..00000000000000
--- a/patches.armadillo800eva/0206-serial-sh-sci-Support-generic-SCLSR-overrun-detectio.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From b25362ad1844d24c75f3550d5184f890362f987b Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 14 Jun 2011 17:53:34 +0900
-Subject: serial: sh-sci: Support generic SCLSR overrun detection.
-
-For all ports with a valid SCLSR register we can use the generic FIFO
-overrun detection logic. Test the validity of the SCLSR register rather
-than depending explicitly on port type, which can be ambiguous for the
-SCIFA/B types.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 4b8c59a3d83e9cf2b65b16999a0c704fc72de056)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 10 +++-------
- 1 file changed, 3 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index f47c534..78efe80 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -734,15 +734,11 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
- {
- struct tty_struct *tty = port->state->port.tty;
- struct sci_port *s = to_sci_port(port);
-+ struct plat_sci_reg *reg;
- int copied = 0;
-
-- /*
-- * XXX: Technically not limited to non-SCIFs, it's simply the
-- * SCLSR check that is for the moment SCIF-specific. This
-- * probably wants to be revisited for SCIFA/B as well as for
-- * factoring in SCI overrun detection.
-- */
-- if (port->type != PORT_SCIF)
-+ reg = sci_getreg(port, SCLSR);
-+ if (!reg->size)
- return 0;
-
- if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0207-serial-sh-sci-Regtype-probing-doesn-t-need-to-be-fat.patch b/patches.armadillo800eva/0207-serial-sh-sci-Regtype-probing-doesn-t-need-to-be-fat.patch
deleted file mode 100644
index 891ee02e12d2e0..00000000000000
--- a/patches.armadillo800eva/0207-serial-sh-sci-Regtype-probing-doesn-t-need-to-be-fat.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 936cfe796afcee603bab904a7a71942b4edcaded Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 28 Jun 2011 13:44:37 +0900
-Subject: serial: sh-sci: Regtype probing doesn't need to be fatal.
-
-This was using a BUG_ON(), but it's not strictly necessary, so relax the
-constraints a bit.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 3127c6b225c6893bdfcd4db64d4316ce317fc10f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 78efe80..2b3d82c 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1830,6 +1830,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
- struct plat_sci_port *p)
- {
- struct uart_port *port = &sci_port->port;
-+ int ret;
-
- port->ops = &sci_uart_ops;
- port->iotype = UPIO_MEM;
-@@ -1850,8 +1851,11 @@ static int __devinit sci_init_single(struct platform_device *dev,
- break;
- }
-
-- if (p->regtype == SCIx_PROBE_REGTYPE)
-- BUG_ON(sci_probe_regmap(p) != 0);
-+ if (p->regtype == SCIx_PROBE_REGTYPE) {
-+ ret = sci_probe_regmap(p);
-+ if (unlikely(!ret))
-+ return ret;
-+ }
-
- if (dev) {
- sci_port->iclk = clk_get(&dev->dev, "sci_ick");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0208-serial-sh-sci-Add-missing-module-description-author-.patch b/patches.armadillo800eva/0208-serial-sh-sci-Add-missing-module-description-author-.patch
deleted file mode 100644
index 9785180be2563f..00000000000000
--- a/patches.armadillo800eva/0208-serial-sh-sci-Add-missing-module-description-author-.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From a8d9b329c7a7913a35fcbbe28c177a2daffa4609 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 28 Jun 2011 13:47:40 +0900
-Subject: serial: sh-sci: Add missing module description/author bits.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 7f405f9c3117acfa8a9775c467ab433b23abc5a7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 2b3d82c..eca1821 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -2216,3 +2216,5 @@ module_exit(sci_exit);
-
- MODULE_LICENSE("GPL");
- MODULE_ALIAS("platform:sh-sci");
-+MODULE_AUTHOR("Paul Mundt");
-+MODULE_DESCRIPTION("SuperH SCI(F) serial driver");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0209-serial-sh-sci-Kill-off-per-port-enable-disable-callb.patch b/patches.armadillo800eva/0209-serial-sh-sci-Kill-off-per-port-enable-disable-callb.patch
deleted file mode 100644
index 7370c74d28e9d8..00000000000000
--- a/patches.armadillo800eva/0209-serial-sh-sci-Kill-off-per-port-enable-disable-callb.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-From cac09064f541adde9cb3121adb996e91a8d645a0 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 28 Jun 2011 13:55:31 +0900
-Subject: serial: sh-sci: Kill off per-port enable/disable callbacks.
-
-Ultimately we want everything to be going through the clock framework and
-runtime pm, so kill off the per-port callbacks that enabled ports to
-bypass the common infrastructure.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 23241d43eac88f63a7f0bf4d5c12bbc496651585)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 79 ++++++++++++++++++-------------------------
- 1 file changed, 32 insertions(+), 47 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index eca1821..b78a261 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -62,12 +62,6 @@ struct sci_port {
- /* Platform configuration */
- struct plat_sci_port *cfg;
-
-- /* Port enable callback */
-- void (*enable)(struct uart_port *port);
--
-- /* Port disable callback */
-- void (*disable)(struct uart_port *port);
--
- /* Break timer */
- struct timer_list break_timer;
- int break_flag;
-@@ -366,6 +360,29 @@ static int sci_probe_regmap(struct plat_sci_port *cfg)
- return 0;
- }
-
-+static void sci_port_enable(struct sci_port *sci_port)
-+{
-+ if (!sci_port->port.dev)
-+ return;
-+
-+ pm_runtime_get_sync(sci_port->port.dev);
-+
-+ clk_enable(sci_port->iclk);
-+ sci_port->port.uartclk = clk_get_rate(sci_port->iclk);
-+ clk_enable(sci_port->fclk);
-+}
-+
-+static void sci_port_disable(struct sci_port *sci_port)
-+{
-+ if (!sci_port->port.dev)
-+ return;
-+
-+ clk_disable(sci_port->fclk);
-+ clk_disable(sci_port->iclk);
-+
-+ pm_runtime_put_sync(sci_port->port.dev);
-+}
-+
- #if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_SH_SCI_CONSOLE)
-
- #ifdef CONFIG_CONSOLE_POLL
-@@ -651,8 +668,7 @@ static void sci_break_timer(unsigned long data)
- {
- struct sci_port *port = (struct sci_port *)data;
-
-- if (port->enable)
-- port->enable(&port->port);
-+ sci_port_enable(port);
-
- if (sci_rxd_in(&port->port) == 0) {
- port->break_flag = 1;
-@@ -664,8 +680,7 @@ static void sci_break_timer(unsigned long data)
- } else
- port->break_flag = 0;
-
-- if (port->disable)
-- port->disable(&port->port);
-+ sci_port_disable(port);
- }
-
- static int sci_handle_errors(struct uart_port *port)
-@@ -939,27 +954,6 @@ static int sci_notifier(struct notifier_block *self,
- return NOTIFY_OK;
- }
-
--static void sci_clk_enable(struct uart_port *port)
--{
-- struct sci_port *sci_port = to_sci_port(port);
--
-- pm_runtime_get_sync(port->dev);
--
-- clk_enable(sci_port->iclk);
-- sci_port->port.uartclk = clk_get_rate(sci_port->iclk);
-- clk_enable(sci_port->fclk);
--}
--
--static void sci_clk_disable(struct uart_port *port)
--{
-- struct sci_port *sci_port = to_sci_port(port);
--
-- clk_disable(sci_port->fclk);
-- clk_disable(sci_port->iclk);
--
-- pm_runtime_put_sync(port->dev);
--}
--
- static int sci_request_irq(struct sci_port *port)
- {
- int i;
-@@ -1542,8 +1536,7 @@ static int sci_startup(struct uart_port *port)
-
- dev_dbg(port->dev, "%s(%d)\n", __func__, port->line);
-
-- if (s->enable)
-- s->enable(port);
-+ sci_port_enable(s);
-
- ret = sci_request_irq(s);
- if (unlikely(ret < 0))
-@@ -1569,8 +1562,7 @@ static void sci_shutdown(struct uart_port *port)
- sci_free_dma(port);
- sci_free_irq(s);
-
-- if (s->disable)
-- s->disable(port);
-+ sci_port_disable(s);
- }
-
- static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
-@@ -1617,8 +1609,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
- if (likely(baud && port->uartclk))
- t = sci_scbrr_calc(s->cfg->scbrr_algo_id, baud, port->uartclk);
-
-- if (s->enable)
-- s->enable(port);
-+ sci_port_enable(s);
-
- do {
- status = sci_in(port, SCxSR);
-@@ -1688,8 +1679,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
- if ((termios->c_cflag & CREAD) != 0)
- sci_start_rx(port);
-
-- if (s->disable)
-- s->disable(port);
-+ sci_port_disable(s);
- }
-
- static const char *sci_type(struct uart_port *port)
-@@ -1875,8 +1865,6 @@ static int __devinit sci_init_single(struct platform_device *dev,
- if (IS_ERR(sci_port->fclk))
- sci_port->fclk = NULL;
-
-- sci_port->enable = sci_clk_enable;
-- sci_port->disable = sci_clk_disable;
- port->dev = &dev->dev;
-
- pm_runtime_enable(&dev->dev);
-@@ -1955,8 +1943,7 @@ static void serial_console_write(struct console *co, const char *s,
- struct uart_port *port = &sci_port->port;
- unsigned short bits;
-
-- if (sci_port->enable)
-- sci_port->enable(port);
-+ sci_port_enable(sci_port);
-
- uart_console_write(port, s, count, serial_console_putchar);
-
-@@ -1965,8 +1952,7 @@ static void serial_console_write(struct console *co, const char *s,
- while ((sci_in(port, SCxSR) & bits) != bits)
- cpu_relax();
-
-- if (sci_port->disable)
-- sci_port->disable(port);
-+ sci_port_disable(sci_port);
- }
-
- static int __devinit serial_console_setup(struct console *co, char *options)
-@@ -1998,8 +1984,7 @@ static int __devinit serial_console_setup(struct console *co, char *options)
- if (unlikely(ret != 0))
- return ret;
-
-- if (sci_port->enable)
-- sci_port->enable(port);
-+ sci_port_enable(sci_port);
-
- if (options)
- uart_parse_options(options, &baud, &parity, &bits, &flow);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0210-serial-sh-sci-Fix-up-pretty-name-printing-for-port-I.patch b/patches.armadillo800eva/0210-serial-sh-sci-Fix-up-pretty-name-printing-for-port-I.patch
deleted file mode 100644
index 3ae6864eb74098..00000000000000
--- a/patches.armadillo800eva/0210-serial-sh-sci-Fix-up-pretty-name-printing-for-port-I.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From 85a65afb2bda6509a378e48512b2f7faa3ea3494 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 28 Jun 2011 15:25:36 +0900
-Subject: serial: sh-sci: Fix up pretty name printing for port IRQs.
-
-Presently these were all using the same static string with no regard to
-dev_name() and the like. This implements a bit of rework to name the IRQ
-dynamically, as it should have been doing all along anyways.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 9174fc8f111982e024a00512c521ad8f1056fccb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 118 +++++++++++++++++++++++++++++++------------
- include/linux/serial_sci.h | 7 +++
- 2 files changed, 92 insertions(+), 33 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index b78a261..a0a1943 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -71,6 +71,8 @@ struct sci_port {
- /* Function clock */
- struct clk *fclk;
-
-+ char *irqstr[SCIx_NR_IRQS];
-+
- struct dma_chan *chan_tx;
- struct dma_chan *chan_rx;
-
-@@ -954,53 +956,102 @@ static int sci_notifier(struct notifier_block *self,
- return NOTIFY_OK;
- }
-
-+static struct sci_irq_desc {
-+ const char *desc;
-+ irq_handler_t handler;
-+} sci_irq_desc[] = {
-+ /*
-+ * Split out handlers, the default case.
-+ */
-+ [SCIx_ERI_IRQ] = {
-+ .desc = "rx err",
-+ .handler = sci_er_interrupt,
-+ },
-+
-+ [SCIx_RXI_IRQ] = {
-+ .desc = "rx full",
-+ .handler = sci_rx_interrupt,
-+ },
-+
-+ [SCIx_TXI_IRQ] = {
-+ .desc = "tx empty",
-+ .handler = sci_tx_interrupt,
-+ },
-+
-+ [SCIx_BRI_IRQ] = {
-+ .desc = "break",
-+ .handler = sci_br_interrupt,
-+ },
-+
-+ /*
-+ * Special muxed handler.
-+ */
-+ [SCIx_MUX_IRQ] = {
-+ .desc = "mux",
-+ .handler = sci_mpxed_interrupt,
-+ },
-+};
-+
- static int sci_request_irq(struct sci_port *port)
- {
-- int i;
-- irqreturn_t (*handlers[4])(int irq, void *ptr) = {
-- sci_er_interrupt, sci_rx_interrupt, sci_tx_interrupt,
-- sci_br_interrupt,
-- };
-- const char *desc[] = { "SCI Receive Error", "SCI Receive Data Full",
-- "SCI Transmit Data Empty", "SCI Break" };
--
-- if (port->cfg->irqs[0] == port->cfg->irqs[1]) {
-- if (unlikely(!port->cfg->irqs[0]))
-- return -ENODEV;
--
-- if (request_irq(port->cfg->irqs[0], sci_mpxed_interrupt,
-- IRQF_DISABLED, "sci", port)) {
-- dev_err(port->port.dev, "Can't allocate IRQ\n");
-- return -ENODEV;
-+ struct uart_port *up = &port->port;
-+ int i, j, ret = 0;
-+
-+ for (i = j = 0; i < SCIx_NR_IRQS; i++, j++) {
-+ struct sci_irq_desc *desc;
-+ unsigned int irq;
-+
-+ if (SCIx_IRQ_IS_MUXED(port)) {
-+ i = SCIx_MUX_IRQ;
-+ irq = up->irq;
-+ } else
-+ irq = port->cfg->irqs[i];
-+
-+ desc = sci_irq_desc + i;
-+ port->irqstr[j] = kasprintf(GFP_KERNEL, "%s:%s",
-+ dev_name(up->dev), desc->desc);
-+ if (!port->irqstr[j]) {
-+ dev_err(up->dev, "Failed to allocate %s IRQ string\n",
-+ desc->desc);
-+ goto out_nomem;
- }
-- } else {
-- for (i = 0; i < ARRAY_SIZE(handlers); i++) {
-- if (unlikely(!port->cfg->irqs[i]))
-- continue;
--
-- if (request_irq(port->cfg->irqs[i], handlers[i],
-- IRQF_DISABLED, desc[i], port)) {
-- dev_err(port->port.dev, "Can't allocate IRQ\n");
-- return -ENODEV;
-- }
-+
-+ ret = request_irq(irq, desc->handler, up->irqflags,
-+ port->irqstr[j], port);
-+ if (unlikely(ret)) {
-+ dev_err(up->dev, "Can't allocate %s IRQ\n", desc->desc);
-+ goto out_noirq;
- }
- }
-
- return 0;
-+
-+out_noirq:
-+ while (--i >= 0)
-+ free_irq(port->cfg->irqs[i], port);
-+
-+out_nomem:
-+ while (--j >= 0)
-+ kfree(port->irqstr[j]);
-+
-+ return ret;
- }
-
- static void sci_free_irq(struct sci_port *port)
- {
- int i;
-
-- if (port->cfg->irqs[0] == port->cfg->irqs[1])
-- free_irq(port->cfg->irqs[0], port);
-- else {
-- for (i = 0; i < ARRAY_SIZE(port->cfg->irqs); i++) {
-- if (!port->cfg->irqs[i])
-- continue;
-+ /*
-+ * Intentionally in reverse order so we iterate over the muxed
-+ * IRQ first.
-+ */
-+ for (i = 0; i < SCIx_NR_IRQS; i++) {
-+ free_irq(port->cfg->irqs[i], port);
-+ kfree(port->irqstr[i]);
-
-- free_irq(port->cfg->irqs[i], port);
-+ if (SCIx_IRQ_IS_MUXED(port)) {
-+ /* If there's only one IRQ, we're done. */
-+ return;
- }
- }
- }
-@@ -1915,6 +1966,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
- * For the muxed case there's nothing more to do.
- */
- port->irq = p->irqs[SCIx_RXI_IRQ];
-+ port->irqflags = IRQF_DISABLED;
-
- port->serial_in = sci_serial_in;
- port->serial_out = sci_serial_out;
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 4ca130a..8bffe9a 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -56,6 +56,8 @@ enum {
- SCIx_TXI_IRQ,
- SCIx_BRI_IRQ,
- SCIx_NR_IRQS,
-+
-+ SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
- };
-
- enum {
-@@ -82,6 +84,11 @@ enum {
- [SCIx_BRI_IRQ] = (irq), \
- }
-
-+#define SCIx_IRQ_IS_MUXED(port) \
-+ ((port)->cfg->irqs[SCIx_ERI_IRQ] == \
-+ (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
-+ ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
-+ !(port)->cfg->irqs[SCIx_RXI_IRQ])
- /*
- * SCI register subset common for all port types.
- * Not all registers will exist on all parts.
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0211-serial-sh-sci-Fix-up-default-regtype-probing.patch b/patches.armadillo800eva/0211-serial-sh-sci-Fix-up-default-regtype-probing.patch
deleted file mode 100644
index 8d1af298b65bff..00000000000000
--- a/patches.armadillo800eva/0211-serial-sh-sci-Fix-up-default-regtype-probing.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 09dfd1ebc4ac759bc43ff50debf53ffe339135f8 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Wed, 3 Aug 2011 12:33:20 +0900
-Subject: serial: sh-sci: Fix up default regtype probing.
-
-Presently the default regtype probing inadvertently bails out due to an
-inverted error check. This fixes it up, and gets platforms without
-explicit regtype specifications working again.
-
-Reported-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit ad75b88ac3792ae6a541d9b9fa84e379bd0b29dd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index a0a1943..013b894 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1894,7 +1894,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
-
- if (p->regtype == SCIx_PROBE_REGTYPE) {
- ret = sci_probe_regmap(p);
-- if (unlikely(!ret))
-+ if (unlikely(ret != 0))
- return ret;
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0212-serial-sh-sci-fix-DMA-build-by-including-dma-mapping.patch b/patches.armadillo800eva/0212-serial-sh-sci-fix-DMA-build-by-including-dma-mapping.patch
deleted file mode 100644
index 3064a6fccc7bc0..00000000000000
--- a/patches.armadillo800eva/0212-serial-sh-sci-fix-DMA-build-by-including-dma-mapping.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 976f0f69e849e1e3dfd5e588f4937141c78f7744 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 2 Aug 2011 09:42:54 +0000
-Subject: serial: sh-sci: fix DMA build by including dma-mapping.h
-
-Include dma-mapping.h to fix build of the sh-sci driver on
-SH-Mobile ARM (sh73a0) when CONFIG_SERIAL_SH_SCI_DMA=y:
-
-drivers/tty/serial/sh-sci.c: In function 'sci_rx_dma_release':
-drivers/tty/serial/sh-sci.c:1182:3: error: implicit declaration of function 'dma_free_coherent'
-drivers/tty/serial/sh-sci.c: In function 'work_fn_tx':
-drivers/tty/serial/sh-sci.c:1333:2: error: implicit declaration of function 'dma_sync_sg_for_device'
-drivers/tty/serial/sh-sci.c: In function 'sci_request_dma':
-drivers/tty/serial/sh-sci.c:1498:3: error: implicit declaration of function 'dma_map_sg'
-drivers/tty/serial/sh-sci.c:1527:3: error: implicit declaration of function 'dma_alloc_coherent'
-drivers/tty/serial/sh-sci.c:1527:10: warning: assignment makes pointer from integer without a cast
-make[3]: *** [drivers/tty/serial/sh-sci.o] Error 1
-make[2]: *** [drivers/tty/serial] Error 2
-make[1]: *** [drivers/tty] Error 2
-make: *** [drivers] Error 2
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Tested-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 5beabc7fcd99856084e232b37d3280ce353eaf41)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 013b894..fea0f85 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -47,6 +47,7 @@
- #include <linux/ctype.h>
- #include <linux/err.h>
- #include <linux/dmaengine.h>
-+#include <linux/dma-mapping.h>
- #include <linux/scatterlist.h>
- #include <linux/slab.h>
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0213-serial-sh-sci-console-Runtime-PM-support.patch b/patches.armadillo800eva/0213-serial-sh-sci-console-Runtime-PM-support.patch
deleted file mode 100644
index 8cd72900755326..00000000000000
--- a/patches.armadillo800eva/0213-serial-sh-sci-console-Runtime-PM-support.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From 54f57537acd2b7a287c2fef8cb13d5c092e2af75 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 3 Aug 2011 03:47:36 +0000
-Subject: serial: sh-sci: console Runtime PM support
-
-Add Runtime PM context save/restore support to
-the SCIF driver. Tested on the AP4EVB console.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 1ba762209491e2496e58baffa3fd65d661f54404)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 68 ++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 58 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index fea0f85..0ccd33d 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -96,6 +96,12 @@ struct sci_port {
- #endif
-
- struct notifier_block freq_transition;
-+
-+#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
-+ unsigned short saved_smr;
-+ unsigned short saved_fcr;
-+ unsigned char saved_brr;
-+#endif
- };
-
- /* Function prototypes */
-@@ -1639,11 +1645,25 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
- return ((freq + 16 * bps) / (32 * bps) - 1);
- }
-
-+static void sci_reset(struct uart_port *port)
-+{
-+ unsigned int status;
-+
-+ do {
-+ status = sci_in(port, SCxSR);
-+ } while (!(status & SCxSR_TEND(port)));
-+
-+ sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */
-+
-+ if (port->type != PORT_SCI)
-+ sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
-+}
-+
- static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
- struct ktermios *old)
- {
- struct sci_port *s = to_sci_port(port);
-- unsigned int status, baud, smr_val, max_baud;
-+ unsigned int baud, smr_val, max_baud;
- int t = -1;
- u16 scfcr = 0;
-
-@@ -1663,14 +1683,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
-
- sci_port_enable(s);
-
-- do {
-- status = sci_in(port, SCxSR);
-- } while (!(status & SCxSR_TEND(port)));
--
-- sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */
--
-- if (port->type != PORT_SCI)
-- sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST);
-+ sci_reset(port);
-
- smr_val = sci_in(port, SCSMR) & 3;
-
-@@ -2042,7 +2055,8 @@ static int __devinit serial_console_setup(struct console *co, char *options)
- if (options)
- uart_parse_options(options, &baud, &parity, &bits, &flow);
-
-- /* TODO: disable clock */
-+ sci_port_disable(sci_port);
-+
- return uart_set_options(port, co, baud, parity, bits, flow);
- }
-
-@@ -2085,6 +2099,36 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
- return 0;
- }
-
-+#define uart_console(port) ((port)->cons->index == (port)->line)
-+
-+static int sci_runtime_suspend(struct device *dev)
-+{
-+ struct sci_port *sci_port = dev_get_drvdata(dev);
-+ struct uart_port *port = &sci_port->port;
-+
-+ if (uart_console(port)) {
-+ sci_port->saved_smr = sci_in(port, SCSMR);
-+ sci_port->saved_brr = sci_in(port, SCBRR);
-+ sci_port->saved_fcr = sci_in(port, SCFCR);
-+ }
-+ return 0;
-+}
-+
-+static int sci_runtime_resume(struct device *dev)
-+{
-+ struct sci_port *sci_port = dev_get_drvdata(dev);
-+ struct uart_port *port = &sci_port->port;
-+
-+ if (uart_console(port)) {
-+ sci_reset(port);
-+ sci_out(port, SCSMR, sci_port->saved_smr);
-+ sci_out(port, SCBRR, sci_port->saved_brr);
-+ sci_out(port, SCFCR, sci_port->saved_fcr);
-+ sci_out(port, SCSCR, sci_port->cfg->scscr);
-+ }
-+ return 0;
-+}
-+
- #define SCI_CONSOLE (&serial_console)
-
- #else
-@@ -2094,6 +2138,8 @@ static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
- }
-
- #define SCI_CONSOLE NULL
-+#define sci_runtime_suspend NULL
-+#define sci_runtime_resume NULL
-
- #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
-
-@@ -2209,6 +2255,8 @@ static int sci_resume(struct device *dev)
- }
-
- static const struct dev_pm_ops sci_dev_pm_ops = {
-+ .runtime_suspend = sci_runtime_suspend,
-+ .runtime_resume = sci_runtime_resume,
- .suspend = sci_suspend,
- .resume = sci_resume,
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0214-sh-sci-PM-Use-power.irq_safe.patch b/patches.armadillo800eva/0214-sh-sci-PM-Use-power.irq_safe.patch
deleted file mode 100644
index f52dea5da1fb8d..00000000000000
--- a/patches.armadillo800eva/0214-sh-sci-PM-Use-power.irq_safe.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 766abd46766d85d3c4e930138ff6acf86ece806f Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 24 Aug 2011 21:41:08 +0200
-Subject: sh-sci / PM: Use power.irq_safe
-
-Since sci_port_enable() and sci_port_disable() may be run with
-interrupts off and they execute pm_runtime_get_sync() and
-pm_runtime_put_sync(), respectively, the SCI device's
-power.irq_safe flag has to be set to indicate that it is safe
-to execute runtime PM callbacks for this device with interrupts off.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit 5a50a01bf00c8191073fdf518e1af1e950ac3af5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 0ccd33d..bd16da5 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1932,6 +1932,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
-
- port->dev = &dev->dev;
-
-+ pm_runtime_irq_safe(&dev->dev);
- pm_runtime_enable(&dev->dev);
- }
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0215-serial-sh-sci-report-CTS-as-active-for-get_mctrl.patch b/patches.armadillo800eva/0215-serial-sh-sci-report-CTS-as-active-for-get_mctrl.patch
deleted file mode 100644
index f8f21cc1211adb..00000000000000
--- a/patches.armadillo800eva/0215-serial-sh-sci-report-CTS-as-active-for-get_mctrl.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 77fdbc761d302a90de221ea25ef6bbb47eb64a95 Mon Sep 17 00:00:00 2001
-From: Yoshii Takashi <takashi.yoshii.zj@renesas.com>
-Date: Tue, 23 Aug 2011 08:27:18 +0000
-Subject: serial: sh-sci: report CTS as active for get_mctrl
-
-sh-sci.c sets hardware up and then let the HW do all flow controls.
-There is no software code, nor needs to get/set real CTS signal.
-
-But, when turning CRTSCTS on through termios, uart_set_termios() in
-serial_core.c checks CTS, and stops TX if it is inactive at the moment.
-
-Because sci_get_mctrl() returns a fixed value DTR|RTS|DSR but CTS,
-the sequence
- open -> set CRTSCTS -> write
-hit the case and stop working, no more outputs.
-
-This patch makes sci_get_mctrl() report CTS in addition.
-
-Signed-off-by: Takashi YOSHII <takashi.yoshii.zj@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 4480a688b2beaa82ecac269b6e21bf1a26251bf9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index bd16da5..afc48ba 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1083,7 +1083,7 @@ static unsigned int sci_get_mctrl(struct uart_port *port)
- /* This routine is used for getting signals of: DTR, DCD, DSR, RI,
- and CTS/RTS */
-
-- return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR;
-+ return TIOCM_DTR | TIOCM_RTS | TIOCM_CTS | TIOCM_DSR;
- }
-
- #ifdef CONFIG_SERIAL_SH_SCI_DMA
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0216-serial-sh-sci-don-t-filter-on-DMA-device-use-only-ch.patch b/patches.armadillo800eva/0216-serial-sh-sci-don-t-filter-on-DMA-device-use-only-ch.patch
deleted file mode 100644
index e28c79f1f171eb..00000000000000
--- a/patches.armadillo800eva/0216-serial-sh-sci-don-t-filter-on-DMA-device-use-only-ch.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 7d534d91a324c4e626a0e4ccc318f0ffe997724f Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Fri, 24 Jun 2011 13:56:15 +0200
-Subject: serial: sh-sci: don't filter on DMA device, use only channel ID
-
-On some sh-mobile systems there are more than one DMA controllers, that
-can be used for serial ports. Specifying a DMA device in sh-sci platform
-data unnecessarily restricts the driver to only use one DMA controller.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-[Fixed the trivial conflict in include/linux/serial_sci.h]
-Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-(cherry picked from commit 937bb6e4c676fecbfbc1939b942241c3f27bf5d8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 25 ++++++++-----------------
- include/linux/serial_sci.h | 2 --
- 2 files changed, 8 insertions(+), 19 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index afc48ba..16914a1 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1451,12 +1451,8 @@ static bool filter(struct dma_chan *chan, void *slave)
- dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__,
- param->slave_id);
-
-- if (param->dma_dev == chan->device->dev) {
-- chan->private = param;
-- return true;
-- } else {
-- return false;
-- }
-+ chan->private = param;
-+ return true;
- }
-
- static void rx_timer_fn(unsigned long arg)
-@@ -1482,10 +1478,10 @@ static void sci_request_dma(struct uart_port *port)
- dma_cap_mask_t mask;
- int nent;
-
-- dev_dbg(port->dev, "%s: port %d DMA %p\n", __func__,
-- port->line, s->cfg->dma_dev);
-+ dev_dbg(port->dev, "%s: port %d\n", __func__,
-+ port->line);
-
-- if (!s->cfg->dma_dev)
-+ if (s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0)
- return;
-
- dma_cap_zero(mask);
-@@ -1495,7 +1491,6 @@ static void sci_request_dma(struct uart_port *port)
-
- /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_TX */
- param->slave_id = s->cfg->dma_slave_tx;
-- param->dma_dev = s->cfg->dma_dev;
-
- s->cookie_tx = -EINVAL;
- chan = dma_request_channel(mask, filter, param);
-@@ -1524,7 +1519,6 @@ static void sci_request_dma(struct uart_port *port)
-
- /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_RX */
- param->slave_id = s->cfg->dma_slave_rx;
-- param->dma_dev = s->cfg->dma_dev;
-
- chan = dma_request_channel(mask, filter, param);
- dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan);
-@@ -1569,9 +1563,6 @@ static void sci_free_dma(struct uart_port *port)
- {
- struct sci_port *s = to_sci_port(port);
-
-- if (!s->cfg->dma_dev)
-- return;
--
- if (s->chan_tx)
- sci_tx_dma_release(s, false);
- if (s->chan_rx)
-@@ -1986,9 +1977,9 @@ static int __devinit sci_init_single(struct platform_device *dev,
- port->serial_in = sci_serial_in;
- port->serial_out = sci_serial_out;
-
-- if (p->dma_dev)
-- dev_dbg(port->dev, "DMA device %p, tx %d, rx %d\n",
-- p->dma_dev, p->dma_slave_tx, p->dma_slave_rx);
-+ if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0)
-+ dev_dbg(port->dev, "DMA tx %d, rx %d\n",
-+ p->dma_slave_tx, p->dma_slave_rx);
-
- return 0;
- }
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 8bffe9a..0efa1f1 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -131,8 +131,6 @@ struct plat_sci_port {
-
- struct plat_sci_port_ops *ops;
-
-- struct device *dma_dev;
--
- unsigned int dma_slave_tx;
- unsigned int dma_slave_rx;
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0217-TTY-irq-Remove-IRQF_DISABLED.patch b/patches.armadillo800eva/0217-TTY-irq-Remove-IRQF_DISABLED.patch
deleted file mode 100644
index 9b3bf2450d259b..00000000000000
--- a/patches.armadillo800eva/0217-TTY-irq-Remove-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 8dc42793344c479e89a130235da8a26ee3684079 Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Thu, 22 Sep 2011 16:59:15 +0800
-Subject: TTY: irq: Remove IRQF_DISABLED
-
-Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
-We run all interrupt handlers with interrupts disabled
-and we even check and yell when an interrupt handler
-returns with interrupts enabled (see commit [b738a50a:
-genirq: Warn when handler enables interrupts]).
-
-So now this flag is a NOOP and can be removed.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Acked-by: Tobias Klauser <tklauser@distanz.ch>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 9cfb5c05fee914cc65d4706801f6bc424082b5f5)
-
-Conflicts:
-
- drivers/tty/serial/bfin_uart.c
- drivers/tty/amiserial.c
- drivers/tty/cyclades.c
- drivers/tty/hvc/hvc_irq.c
- drivers/tty/hvc/hvcs.c
- drivers/tty/hvc/hvsi.c
- drivers/tty/isicom.c
- drivers/tty/serial/68328serial.c
- drivers/tty/serial/altera_jtaguart.c
- drivers/tty/serial/altera_uart.c
- drivers/tty/serial/bfin_sport_uart.c
- drivers/tty/serial/crisv10.c
- drivers/tty/serial/icom.c
- drivers/tty/serial/lantiq.c
- drivers/tty/serial/mcf.c
- drivers/tty/serial/mpc52xx_uart.c
- drivers/tty/serial/serial_ks8695.c
- drivers/tty/serial/sn_console.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 16914a1..a385564f 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1972,7 +1972,7 @@ static int __devinit sci_init_single(struct platform_device *dev,
- * For the muxed case there's nothing more to do.
- */
- port->irq = p->irqs[SCIx_RXI_IRQ];
-- port->irqflags = IRQF_DISABLED;
-+ port->irqflags = 0;
-
- port->serial_in = sci_serial_in;
- port->serial_out = sci_serial_out;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0218-serial-sh-sci-Fix-up-SH-2A-SCIF-support.patch b/patches.armadillo800eva/0218-serial-sh-sci-Fix-up-SH-2A-SCIF-support.patch
deleted file mode 100644
index c26f8da9609f65..00000000000000
--- a/patches.armadillo800eva/0218-serial-sh-sci-Fix-up-SH-2A-SCIF-support.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From e7e97512e6f8a4744aa7113d61f4503dca244abf Mon Sep 17 00:00:00 2001
-From: Phil Edworthy <phil.edworthy@renesas.com>
-Date: Mon, 3 Oct 2011 15:16:47 +0100
-Subject: serial: sh-sci: Fix up SH-2A SCIF support.
-
-This fixes up support for SH-2(A) SCIFs by introducing a new regtype. As
-expected, it's close to the SH-4A SCIF with fifodata, but still different
-enough to warrant its own type.
-
-Fixes up a number of FIFO overflows and similar for both SH7203/SH7264.
-
-Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
-Tested-by: Federico Fuga <fuga@studiofuga.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 3af1f8a41feab47b232b0c3d3b2322426672480d)
-
-Conflicts:
-
- arch/sh/kernel/cpu/sh2a/setup-sh7203.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 19 +++++++++++++++++++
- include/linux/serial_sci.h | 1 +
- 2 files changed, 20 insertions(+)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index a385564f..a1d1666 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -207,6 +207,25 @@ static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
- },
-
- /*
-+ * Common SH-2(A) SCIF definitions for ports with FIFO data
-+ * count registers.
-+ */
-+ [SCIx_SH2_SCIF_FIFODATA_REGTYPE] = {
-+ [SCSMR] = { 0x00, 16 },
-+ [SCBRR] = { 0x04, 8 },
-+ [SCSCR] = { 0x08, 16 },
-+ [SCxTDR] = { 0x0c, 8 },
-+ [SCxSR] = { 0x10, 16 },
-+ [SCxRDR] = { 0x14, 8 },
-+ [SCFCR] = { 0x18, 16 },
-+ [SCFDR] = { 0x1c, 16 },
-+ [SCTFDR] = sci_reg_invalid,
-+ [SCRFDR] = sci_reg_invalid,
-+ [SCSPTR] = { 0x20, 16 },
-+ [SCLSR] = { 0x24, 16 },
-+ },
-+
-+ /*
- * Common SH-3 SCIF definitions.
- */
- [SCIx_SH3_SCIF_REGTYPE] = {
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 0efa1f1..369273a 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -67,6 +67,7 @@ enum {
- SCIx_IRDA_REGTYPE,
- SCIx_SCIFA_REGTYPE,
- SCIx_SCIFB_REGTYPE,
-+ SCIx_SH2_SCIF_FIFODATA_REGTYPE,
- SCIx_SH3_SCIF_REGTYPE,
- SCIx_SH4_SCIF_REGTYPE,
- SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0219-serial-sh-sci-Fix-up-SCFCR-handling.patch b/patches.armadillo800eva/0219-serial-sh-sci-Fix-up-SCFCR-handling.patch
deleted file mode 100644
index 497b9440300769..00000000000000
--- a/patches.armadillo800eva/0219-serial-sh-sci-Fix-up-SCFCR-handling.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From daabf4daf83a752389b9c93ce640881a5d03b53d Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 24 Nov 2011 18:35:49 +0900
-Subject: serial: sh-sci: Fix up SCFCR handling.
-
-Presently there are a few places that make assumptions about the
-existence of SCFCR, which doesn't hold true for several port types. While
-generally harmless, this does lead to bogus reads/writes in both the
-termios/runtime PM cases that are better off simply never being made in
-the first place.
-
-While we're at it, also get rid of a straggling PORT_SCI check that
-infers all non-SCI ports contain SCFCR. This doesn't presently have any
-impact, but as we're now able to test for the existence of registers
-without defering to the port type we future proof for additional port
-types.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 0979e0e641d21d3bb318da90a64fc0024a95f50e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 33 ++++++++++++++++++++++++++++-----
- 1 file changed, 28 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index a1d1666..7df9235 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1657,6 +1657,7 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
-
- static void sci_reset(struct uart_port *port)
- {
-+ struct plat_sci_reg *reg;
- unsigned int status;
-
- do {
-@@ -1665,7 +1666,8 @@ static void sci_reset(struct uart_port *port)
-
- sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */
-
-- if (port->type != PORT_SCI)
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size)
- sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
- }
-
-@@ -1673,9 +1675,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
- struct ktermios *old)
- {
- struct sci_port *s = to_sci_port(port);
-+ struct plat_sci_reg *reg;
- unsigned int baud, smr_val, max_baud;
- int t = -1;
-- u16 scfcr = 0;
-
- /*
- * earlyprintk comes here early on with port->uartclk set to zero.
-@@ -1725,7 +1727,18 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
- }
-
- sci_init_pins(port, termios->c_cflag);
-- sci_out(port, SCFCR, scfcr | ((termios->c_cflag & CRTSCTS) ? SCFCR_MCE : 0));
-+
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size) {
-+ unsigned short ctrl;
-+
-+ ctrl = sci_in(port, SCFCR);
-+ if (termios->c_cflag & CRTSCTS)
-+ ctrl |= SCFCR_MCE;
-+ else
-+ ctrl &= ~SCFCR_MCE;
-+ sci_out(port, SCFCR, ctrl);
-+ }
-
- sci_out(port, SCSCR, s->cfg->scscr);
-
-@@ -2118,9 +2131,16 @@ static int sci_runtime_suspend(struct device *dev)
- struct uart_port *port = &sci_port->port;
-
- if (uart_console(port)) {
-+ struct plat_sci_reg *reg;
-+
- sci_port->saved_smr = sci_in(port, SCSMR);
- sci_port->saved_brr = sci_in(port, SCBRR);
-- sci_port->saved_fcr = sci_in(port, SCFCR);
-+
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size)
-+ sci_port->saved_fcr = sci_in(port, SCFCR);
-+ else
-+ sci_port->saved_fcr = 0;
- }
- return 0;
- }
-@@ -2134,7 +2154,10 @@ static int sci_runtime_resume(struct device *dev)
- sci_reset(port);
- sci_out(port, SCSMR, sci_port->saved_smr);
- sci_out(port, SCBRR, sci_port->saved_brr);
-- sci_out(port, SCFCR, sci_port->saved_fcr);
-+
-+ if (sci_port->saved_fcr)
-+ sci_out(port, SCFCR, sci_port->saved_fcr);
-+
- sci_out(port, SCSCR, sci_port->cfg->scscr);
- }
- return 0;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0220-serial-sh-sci-Support-icount-statistics-for-error-ca.patch b/patches.armadillo800eva/0220-serial-sh-sci-Support-icount-statistics-for-error-ca.patch
deleted file mode 100644
index 4b62e3f592978e..00000000000000
--- a/patches.armadillo800eva/0220-serial-sh-sci-Support-icount-statistics-for-error-ca.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From c172df9d3931d6a7c1b454cb7e57afbae81d9421 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 24 Nov 2011 19:15:06 +0900
-Subject: serial: sh-sci: Support icount statistics for error cases.
-
-Presently the icount stats are only adjusted for the rx/tx case, this
-makes sure that they're updated appropriately for the non-tx/rx cases,
-too (specifically overruns, breaks, as well as frame and parity errors).
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit d97fbbed6e5bb37df75be8993bb0c61adb7d3558)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 7df9235..635dd54 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -621,6 +621,7 @@ static void sci_receive_chars(struct uart_port *port)
- } else {
- for (i = 0; i < count; i++) {
- char c = sci_in(port, SCxRDR);
-+
- status = sci_in(port, SCxSR);
- #if defined(CONFIG_CPU_SH3)
- /* Skip "chars" during break */
-@@ -649,9 +650,11 @@ static void sci_receive_chars(struct uart_port *port)
- /* Store data and status */
- if (status & SCxSR_FER(port)) {
- flag = TTY_FRAME;
-+ port->icount.frame++;
- dev_notice(port->dev, "frame error\n");
- } else if (status & SCxSR_PER(port)) {
- flag = TTY_PARITY;
-+ port->icount.parity++;
- dev_notice(port->dev, "parity error\n");
- } else
- flag = TTY_NORMAL;
-@@ -723,6 +726,8 @@ static int sci_handle_errors(struct uart_port *port)
- */
- if (s->cfg->overrun_bit != SCIx_NOT_SUPPORTED) {
- if (status & (1 << s->cfg->overrun_bit)) {
-+ port->icount.overrun++;
-+
- /* overrun error */
- if (tty_insert_flip_char(tty, 0, TTY_OVERRUN))
- copied++;
-@@ -737,6 +742,8 @@ static int sci_handle_errors(struct uart_port *port)
- struct sci_port *sci_port = to_sci_port(port);
-
- if (!sci_port->break_flag) {
-+ port->icount.brk++;
-+
- sci_port->break_flag = 1;
- sci_schedule_break_timer(sci_port);
-
-@@ -752,6 +759,8 @@ static int sci_handle_errors(struct uart_port *port)
-
- } else {
- /* frame error */
-+ port->icount.frame++;
-+
- if (tty_insert_flip_char(tty, 0, TTY_FRAME))
- copied++;
-
-@@ -761,6 +770,8 @@ static int sci_handle_errors(struct uart_port *port)
-
- if (status & SCxSR_PER(port)) {
- /* parity error */
-+ port->icount.parity++;
-+
- if (tty_insert_flip_char(tty, 0, TTY_PARITY))
- copied++;
-
-@@ -787,6 +798,8 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
- if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {
- sci_out(port, SCLSR, 0);
-
-+ port->icount.overrun++;
-+
- tty_insert_flip_char(tty, 0, TTY_OVERRUN);
- tty_flip_buffer_push(tty);
-
-@@ -812,6 +825,9 @@ static int sci_handle_breaks(struct uart_port *port)
- /* Debounce break */
- s->break_flag = 1;
- #endif
-+
-+ port->icount.brk++;
-+
- /* Notify of BREAK */
- if (tty_insert_flip_char(tty, 0, TTY_BREAK))
- copied++;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0221-serial-sh-sci-Clarify-enable_ms-break_ctl-comments.patch b/patches.armadillo800eva/0221-serial-sh-sci-Clarify-enable_ms-break_ctl-comments.patch
deleted file mode 100644
index 32228f5cfe00a5..00000000000000
--- a/patches.armadillo800eva/0221-serial-sh-sci-Clarify-enable_ms-break_ctl-comments.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 9dda1e58ff6cbbb085d6d4d7a24983b9f23b3285 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 24 Nov 2011 19:36:46 +0900
-Subject: serial: sh-sci: Clarify enable_ms/break_ctl comments.
-
-Technically there's nothing we can do for either of these, so update the
-comments to reflect this, rather than infering that there's additional
-work to be done.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit d39ec6ce34f130d582880d1f3cbe2b38e723cafe)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 635dd54..993180f 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1470,12 +1470,17 @@ static void sci_stop_rx(struct uart_port *port)
-
- static void sci_enable_ms(struct uart_port *port)
- {
-- /* Nothing here yet .. */
-+ /*
-+ * Not supported by hardware, always a nop.
-+ */
- }
-
- static void sci_break_ctl(struct uart_port *port, int break_state)
- {
-- /* Nothing here yet .. */
-+ /*
-+ * Not supported by hardware. Most parts couple break and rx
-+ * interrupts together, with break detection always enabled.
-+ */
- }
-
- #ifdef CONFIG_SERIAL_SH_SCI_DMA
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0222-serial-sh-sci-Fix-up-modem-control-handling.patch b/patches.armadillo800eva/0222-serial-sh-sci-Fix-up-modem-control-handling.patch
deleted file mode 100644
index 2db50359c7a2f4..00000000000000
--- a/patches.armadillo800eva/0222-serial-sh-sci-Fix-up-modem-control-handling.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From ec7963824e42768f9049fef194b9d63ca5241c32 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 24 Nov 2011 20:18:32 +0900
-Subject: serial: sh-sci: Fix up modem control handling.
-
-At the moment things like CTS/RTS are reported for all ports, while the
-vast majority of them do not implement support at all (and others
-implement support entirely in hardware). Fix up the ->get_mctrl()
-reporting to simply assert DSR/CAR as other drivers without control
-lines do.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit cdf7c42fece7c641fcb85cfbf190fdc2a95d19ac)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 993180f..a60ccdb 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1106,19 +1106,26 @@ static unsigned int sci_tx_empty(struct uart_port *port)
- return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0;
- }
-
-+/*
-+ * Modem control is a bit of a mixed bag for SCI(F) ports. Generally
-+ * CTS/RTS is supported in hardware by at least one port and controlled
-+ * via SCSPTR (SCxPCR for SCIFA/B parts), or external pins (presently
-+ * handled via the ->init_pins() op, which is a bit of a one-way street,
-+ * lacking any ability to defer pin control -- this will later be
-+ * converted over to the GPIO framework).
-+ */
- static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
- {
-- /* This routine is used for seting signals of: DTR, DCD, CTS/RTS */
-- /* We use SCIF's hardware for CTS/RTS, so don't need any for that. */
-- /* If you have signals for DTR and DCD, please implement here. */
-+ /* Nothing to do here. */
- }
-
- static unsigned int sci_get_mctrl(struct uart_port *port)
- {
-- /* This routine is used for getting signals of: DTR, DCD, DSR, RI,
-- and CTS/RTS */
--
-- return TIOCM_DTR | TIOCM_RTS | TIOCM_CTS | TIOCM_DSR;
-+ /*
-+ * CTS/RTS is handled in hardware when supported, while nothing
-+ * else is wired up. Keep it simple and simply assert DSR/CAR.
-+ */
-+ return TIOCM_DSR | TIOCM_CAR;
- }
-
- #ifdef CONFIG_SERIAL_SH_SCI_DMA
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0223-serial-sh-sci-Add-support-for-loopback-mode.patch b/patches.armadillo800eva/0223-serial-sh-sci-Add-support-for-loopback-mode.patch
deleted file mode 100644
index d7f4bbfbc95ce5..00000000000000
--- a/patches.armadillo800eva/0223-serial-sh-sci-Add-support-for-loopback-mode.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From c649509d4b4a91a603c8185ab72f99427579f50c Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Thu, 24 Nov 2011 20:20:53 +0900
-Subject: serial: sh-sci: Add support for loopback mode.
-
-This plugs in loopback control for SCFCR-enabled ports and plugs it in
-via the TIOCM_LOOP control, as others do.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit dc7e3ef7dade7041fb1809f2a5403efac655a791)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index a60ccdb..b519332 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1113,10 +1113,23 @@ static unsigned int sci_tx_empty(struct uart_port *port)
- * handled via the ->init_pins() op, which is a bit of a one-way street,
- * lacking any ability to defer pin control -- this will later be
- * converted over to the GPIO framework).
-+ *
-+ * Other modes (such as loopback) are supported generically on certain
-+ * port types, but not others. For these it's sufficient to test for the
-+ * existence of the support register and simply ignore the port type.
- */
- static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
- {
-- /* Nothing to do here. */
-+ if (mctrl & TIOCM_LOOP) {
-+ struct plat_sci_reg *reg;
-+
-+ /*
-+ * Standard loopback mode for SCFCR ports.
-+ */
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size)
-+ sci_out(port, SCFCR, sci_in(port, SCFCR) | 1);
-+ }
- }
-
- static unsigned int sci_get_mctrl(struct uart_port *port)
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0224-serial-sh-sci-per-port-modem-control.patch b/patches.armadillo800eva/0224-serial-sh-sci-per-port-modem-control.patch
deleted file mode 100644
index 8cda4f92227908..00000000000000
--- a/patches.armadillo800eva/0224-serial-sh-sci-per-port-modem-control.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From b9eae3d68de564c46de49a1347bffa6f03103705 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 2 Dec 2011 17:44:50 +0900
-Subject: serial: sh-sci: per-port modem control.
-
-The bulk of the ports do not support any sort of modem control, so
-blindly twiddling the MCE bit doesn't accomplish much. We now require
-ports to manually specify which line supports modem control signals.
-
-While at it, tidy up the RTS/CTSIO handling in SCSPTR parts so it's a bit
-more obvious what's going on (and without clobbering other configurations
-in the process).
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit faf02f8fee5563ea7f950b3f5f08c654aa6c4525)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 31 ++++++++++++++++++++-----------
- include/linux/serial_sci.h | 10 ++++++++++
- 2 files changed, 30 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index b519332..b2891bb 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -474,8 +474,15 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
- if (!reg->size)
- return;
-
-- if (!(cflag & CRTSCTS))
-- sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */
-+ if ((s->cfg->capabilities & SCIx_HAVE_RTSCTS) &&
-+ ((!(cflag & CRTSCTS)))) {
-+ unsigned short status;
-+
-+ status = sci_in(port, SCSPTR);
-+ status &= ~SCSPTR_CTSIO;
-+ status |= SCSPTR_RTSIO;
-+ sci_out(port, SCSPTR, status); /* Set RTS = 1 */
-+ }
- }
-
- static int sci_txfill(struct uart_port *port)
-@@ -1769,16 +1776,18 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
-
- sci_init_pins(port, termios->c_cflag);
-
-- reg = sci_getreg(port, SCFCR);
-- if (reg->size) {
-- unsigned short ctrl;
-+ if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size) {
-+ unsigned short ctrl;
-
-- ctrl = sci_in(port, SCFCR);
-- if (termios->c_cflag & CRTSCTS)
-- ctrl |= SCFCR_MCE;
-- else
-- ctrl &= ~SCFCR_MCE;
-- sci_out(port, SCFCR, ctrl);
-+ ctrl = sci_in(port, SCFCR);
-+ if (termios->c_cflag & CRTSCTS)
-+ ctrl |= SCFCR_MCE;
-+ else
-+ ctrl &= ~SCFCR_MCE;
-+ sci_out(port, SCFCR, ctrl);
-+ }
- }
-
- sci_out(port, SCSCR, s->cfg->scscr);
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 369273a..15b1bdc 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -49,6 +49,10 @@ enum {
-
- #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
-
-+/* SCSPTR, optional */
-+#define SCSPTR_RTSIO (1 << 7)
-+#define SCSPTR_CTSIO (1 << 5)
-+
- /* Offsets into the sci_port->irqs array */
- enum {
- SCIx_ERI_IRQ,
-@@ -109,6 +113,11 @@ struct plat_sci_port_ops {
- };
-
- /*
-+ * Port-specific capabilities
-+ */
-+#define SCIx_HAVE_RTSCTS (1 << 0)
-+
-+/*
- * Platform device specific platform_data struct
- */
- struct plat_sci_port {
-@@ -116,6 +125,7 @@ struct plat_sci_port {
- unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
- unsigned int type; /* SCI / SCIF / IRDA */
- upf_t flags; /* UPF_* flags */
-+ unsigned long capabilities; /* Port features/capabilities */
-
- unsigned int scbrr_algo_id; /* SCBRR calculation algo */
- unsigned int scscr; /* SCSCR initialization */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0225-serial-sh-sci-Avoid-FIFO-clear-for-MCE-toggle.patch b/patches.armadillo800eva/0225-serial-sh-sci-Avoid-FIFO-clear-for-MCE-toggle.patch
deleted file mode 100644
index 6434e196fca2bb..00000000000000
--- a/patches.armadillo800eva/0225-serial-sh-sci-Avoid-FIFO-clear-for-MCE-toggle.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 992ee1e9d43621e7b239937606d65cf8abb38d11 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 2 Dec 2011 19:02:06 +0900
-Subject: serial: sh-sci: Avoid FIFO clear for MCE toggle.
-
-When toggling the MCE support we don't want to concern ourselves with the
-FIFO state, so ensure that the clearing bits are masked out when updating
-the MCE state.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 73c3d53f38e0a8e6c67b0d12d77a8e77c082cd03)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 19 +++++++++++++------
- 1 file changed, 13 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index b2891bb..5d9ae22 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -1776,18 +1776,25 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
-
- sci_init_pins(port, termios->c_cflag);
-
-- if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
-- reg = sci_getreg(port, SCFCR);
-- if (reg->size) {
-- unsigned short ctrl;
-+ reg = sci_getreg(port, SCFCR);
-+ if (reg->size) {
-+ unsigned short ctrl = sci_in(port, SCFCR);
-
-- ctrl = sci_in(port, SCFCR);
-+ if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
- if (termios->c_cflag & CRTSCTS)
- ctrl |= SCFCR_MCE;
- else
- ctrl &= ~SCFCR_MCE;
-- sci_out(port, SCFCR, ctrl);
- }
-+
-+ /*
-+ * As we've done a sci_reset() above, ensure we don't
-+ * interfere with the FIFOs while toggling MCE. As the
-+ * reset values could still be set, simply mask them out.
-+ */
-+ ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST);
-+
-+ sci_out(port, SCFCR, ctrl);
- }
-
- sci_out(port, SCSCR, s->cfg->scscr);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0226-serial-sh-sci-Handle-GPIO-function-requests.patch b/patches.armadillo800eva/0226-serial-sh-sci-Handle-GPIO-function-requests.patch
deleted file mode 100644
index b7fbf2ca0f6311..00000000000000
--- a/patches.armadillo800eva/0226-serial-sh-sci-Handle-GPIO-function-requests.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 0baeaee9d22ae143cc48456dfc1131fcb4acad2f Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 2 Dec 2011 20:09:48 +0900
-Subject: serial: sh-sci: Handle GPIO function requests.
-
-This adds initial support for requesting the various GPIO functions
-necessary for certain ports. This just plugs in dumb request/free logic,
-but serves as a building block for migrating off of the ->init_pins mess
-to a wholly gpiolib backed solution (primarily parts with external
-RTS/CTS pins, but will also allow us to clean up RXD pin testing).
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 50f0959ad4f9ac1c5ee208bb820de299a1b3730b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/sh-sci.c | 71 +++++++++++++++++++++++++++++++++++++++++--
- include/linux/serial_sci.h | 12 ++++++++
- 2 files changed, 81 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index 5d9ae22..c8014d1 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -50,6 +50,7 @@
- #include <linux/dma-mapping.h>
- #include <linux/scatterlist.h>
- #include <linux/slab.h>
-+#include <linux/gpio.h>
-
- #ifdef CONFIG_SUPERH
- #include <asm/sh_bios.h>
-@@ -73,6 +74,7 @@ struct sci_port {
- struct clk *fclk;
-
- char *irqstr[SCIx_NR_IRQS];
-+ char *gpiostr[SCIx_NR_FNS];
-
- struct dma_chan *chan_tx;
- struct dma_chan *chan_rx;
-@@ -1105,6 +1107,67 @@ static void sci_free_irq(struct sci_port *port)
- }
- }
-
-+static const char *sci_gpio_names[SCIx_NR_FNS] = {
-+ "sck", "rxd", "txd", "cts", "rts",
-+};
-+
-+static const char *sci_gpio_str(unsigned int index)
-+{
-+ return sci_gpio_names[index];
-+}
-+
-+static void __devinit sci_init_gpios(struct sci_port *port)
-+{
-+ struct uart_port *up = &port->port;
-+ int i;
-+
-+ if (!port->cfg)
-+ return;
-+
-+ for (i = 0; i < SCIx_NR_FNS; i++) {
-+ const char *desc;
-+ int ret;
-+
-+ if (!port->cfg->gpios[i])
-+ continue;
-+
-+ desc = sci_gpio_str(i);
-+
-+ port->gpiostr[i] = kasprintf(GFP_KERNEL, "%s:%s",
-+ dev_name(up->dev), desc);
-+
-+ /*
-+ * If we've failed the allocation, we can still continue
-+ * on with a NULL string.
-+ */
-+ if (!port->gpiostr[i])
-+ dev_notice(up->dev, "%s string allocation failure\n",
-+ desc);
-+
-+ ret = gpio_request(port->cfg->gpios[i], port->gpiostr[i]);
-+ if (unlikely(ret != 0)) {
-+ dev_notice(up->dev, "failed %s gpio request\n", desc);
-+
-+ /*
-+ * If we can't get the GPIO for whatever reason,
-+ * no point in keeping the verbose string around.
-+ */
-+ kfree(port->gpiostr[i]);
-+ }
-+ }
-+}
-+
-+static void sci_free_gpios(struct sci_port *port)
-+{
-+ int i;
-+
-+ for (i = 0; i < SCIx_NR_FNS; i++)
-+ if (port->cfg->gpios[i]) {
-+ gpio_free(port->cfg->gpios[i]);
-+ kfree(port->gpiostr[i]);
-+ }
-+}
-+
- static unsigned int sci_tx_empty(struct uart_port *port)
- {
- unsigned short status = sci_in(port, SCxSR);
-@@ -1967,6 +2030,8 @@ static int __devinit sci_init_single(struct platform_device *dev,
- struct uart_port *port = &sci_port->port;
- int ret;
-
-+ sci_port->cfg = p;
-+
- port->ops = &sci_uart_ops;
- port->iotype = UPIO_MEM;
- port->line = index;
-@@ -2012,6 +2077,8 @@ static int __devinit sci_init_single(struct platform_device *dev,
-
- port->dev = &dev->dev;
-
-+ sci_init_gpios(sci_port);
-+
- pm_runtime_irq_safe(&dev->dev);
- pm_runtime_enable(&dev->dev);
- }
-@@ -2046,8 +2113,6 @@ static int __devinit sci_init_single(struct platform_device *dev,
- p->error_mask |= (1 << p->overrun_bit);
- }
-
-- sci_port->cfg = p;
--
- port->mapbase = p->mapbase;
- port->type = p->type;
- port->flags = p->flags;
-@@ -2254,6 +2319,8 @@ static int sci_remove(struct platform_device *dev)
- cpufreq_unregister_notifier(&port->freq_transition,
- CPUFREQ_TRANSITION_NOTIFIER);
-
-+ sci_free_gpios(port);
-+
- uart_remove_one_port(&sci_uart_driver, &port->port);
-
- clk_put(port->iclk);
-diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
-index 15b1bdc..7877907 100644
---- a/include/linux/serial_sci.h
-+++ b/include/linux/serial_sci.h
-@@ -64,6 +64,17 @@ enum {
- SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
- };
-
-+/* Offsets into the sci_port->gpios array */
-+enum {
-+ SCIx_SCK,
-+ SCIx_RXD,
-+ SCIx_TXD,
-+ SCIx_CTS,
-+ SCIx_RTS,
-+
-+ SCIx_NR_FNS,
-+};
-+
- enum {
- SCIx_PROBE_REGTYPE,
-
-@@ -123,6 +134,7 @@ struct plat_sci_port_ops {
- struct plat_sci_port {
- unsigned long mapbase; /* resource base */
- unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
-+ unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */
- unsigned int type; /* SCI / SCIF / IRDA */
- upf_t flags; /* UPF_* flags */
- unsigned long capabilities; /* Port features/capabilities */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0227-Input-gpio_keys-switch-to-using-threaded-IRQs.patch b/patches.armadillo800eva/0227-Input-gpio_keys-switch-to-using-threaded-IRQs.patch
deleted file mode 100644
index d9f645f3c6440d..00000000000000
--- a/patches.armadillo800eva/0227-Input-gpio_keys-switch-to-using-threaded-IRQs.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 369137dc876a3f37aa6fb2173433241a3756a70c Mon Sep 17 00:00:00 2001
-From: David Jander <david@protonic.nl>
-Date: Tue, 21 Jun 2011 14:26:18 -0700
-Subject: Input: gpio_keys - switch to using threaded IRQs
-
-Use a threaded interrupt handler in order to permit the handler to use
-a GPIO driver that causes things like I2C transactions being done inside
-the handler context.
-
-Signed-off-by: David Jander <david@protonic.nl>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 7e2ecdf438bb479e2b4667fc16b1a84d6348da04)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 6e6145b..6d0e2f6 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -415,7 +415,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- if (!button->can_disable)
- irqflags |= IRQF_SHARED;
-
-- error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
-+ error = request_threaded_irq(irq, NULL, gpio_keys_isr, irqflags, desc, bdata);
- if (error < 0) {
- dev_err(dev, "Unable to claim irq %d; error %d\n",
- irq, error);
-@@ -649,5 +649,5 @@ module_exit(gpio_keys_exit);
-
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>");
--MODULE_DESCRIPTION("Keyboard driver for CPU GPIOs");
-+MODULE_DESCRIPTION("Keyboard driver for GPIOs");
- MODULE_ALIAS("platform:gpio-keys");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0228-Input-gpio_keys-move-to-late_initcall.patch b/patches.armadillo800eva/0228-Input-gpio_keys-move-to-late_initcall.patch
deleted file mode 100644
index eeb2bbe187e01f..00000000000000
--- a/patches.armadillo800eva/0228-Input-gpio_keys-move-to-late_initcall.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From dbcdd14547f3abb2e5ae97806c7624896ab84e88 Mon Sep 17 00:00:00 2001
-From: David Jander <david@protonic.nl>
-Date: Thu, 23 Jun 2011 01:30:09 -0700
-Subject: Input: gpio_keys - move to late_initcall
-
-Initialize gpio_keys driver at late_initcall level, to give it a chance to
-work with GPIO expanders that might not be ready yet if we initialize the
-driver at module_init time.
-
-This is strictly a band-aid until there is a better way to specify
-inter-device dependencies.
-
-Signed-off-by: David Jander <david@protonic.nl>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit b23302052d96a3945e4c72aca77b5fd28884c353)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 6d0e2f6..320b59a 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -644,7 +644,7 @@ static void __exit gpio_keys_exit(void)
- platform_driver_unregister(&gpio_keys_device_driver);
- }
-
--module_init(gpio_keys_init);
-+late_initcall(gpio_keys_init);
- module_exit(gpio_keys_exit);
-
- MODULE_LICENSE("GPL");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0229-Input-gpio_keys-fix-a-memory-leak.patch b/patches.armadillo800eva/0229-Input-gpio_keys-fix-a-memory-leak.patch
deleted file mode 100644
index 1432224f5d625d..00000000000000
--- a/patches.armadillo800eva/0229-Input-gpio_keys-fix-a-memory-leak.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9c9df13f1a600712533169e0f5b0d7ee82822f08 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Tue, 28 Jun 2011 14:23:30 -0700
-Subject: Input: gpio_keys - fix a memory leak
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 1638207910019368253fc4c4a930c49ce2e98432)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 320b59a..97bada4 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -569,6 +569,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
- }
-
- input_unregister_device(input);
-+ kfree(ddata);
-
- return 0;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0230-Input-gpio_keys-add-support-for-device-tree-platform.patch b/patches.armadillo800eva/0230-Input-gpio_keys-add-support-for-device-tree-platform.patch
deleted file mode 100644
index 9fb38c91844437..00000000000000
--- a/patches.armadillo800eva/0230-Input-gpio_keys-add-support-for-device-tree-platform.patch
+++ /dev/null
@@ -1,305 +0,0 @@
-From 021bf10e7177aa806915d634054101dd9e60d7fd Mon Sep 17 00:00:00 2001
-From: David Jander <david@protonic.nl>
-Date: Sat, 9 Jul 2011 12:41:46 -0700
-Subject: Input: gpio_keys - add support for device-tree platform data
-
-This patch enables fetching configuration data, which is normally provided
-via platform_data, from the device-tree instead.
-
-If the device is configured from device-tree data, the platform_data struct
-is not used, and button data needs to be allocated dynamically. Big part of
-this patch deals with confining pdata usage to the probe function, to make
-this possible.
-
-Signed-off-by: David Jander <david@protonic.nl>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit fd05d08920b54d189aa247c5c5701a08e539ed0b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- .../devicetree/bindings/gpio/gpio_keys.txt | 36 +++++
- drivers/input/keyboard/gpio_keys.c | 148 +++++++++++++++++---
- 2 files changed, 168 insertions(+), 16 deletions(-)
- create mode 100644 Documentation/devicetree/bindings/gpio/gpio_keys.txt
-
-diff --git a/Documentation/devicetree/bindings/gpio/gpio_keys.txt b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
-new file mode 100644
-index 0000000..7190c99
---- /dev/null
-+++ b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
-@@ -0,0 +1,36 @@
-+Device-Tree bindings for input/gpio_keys.c keyboard driver
-+
-+Required properties:
-+ - compatible = "gpio-keys";
-+
-+Optional properties:
-+ - autorepeat: Boolean, Enable auto repeat feature of Linux input
-+ subsystem.
-+
-+Each button (key) is represented as a sub-node of "gpio-keys":
-+Subnode properties:
-+
-+ - gpios: OF devcie-tree gpio specificatin.
-+ - label: Descriptive name of the key.
-+ - linux,code: Keycode to emit.
-+
-+Optional subnode-properties:
-+ - linux,input-type: Specify event type this button/key generates.
-+ If not specified defaults to <1> == EV_KEY.
-+ - debounce-interval: Debouncing interval time in milliseconds.
-+ If not specified defaults to 5.
-+ - gpio-key,wakeup: Boolean, button can wake-up the system.
-+
-+Example nodes:
-+
-+ gpio_keys {
-+ compatible = "gpio-keys";
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ autorepeat;
-+ button@21 {
-+ label = "GPIO Key UP";
-+ linux,code = <103>;
-+ gpios = <&gpio1 0 1>;
-+ };
-+ ...
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 97bada4..ad11e86 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -2,6 +2,7 @@
- * Driver for keys on GPIO lines capable of generating interrupts.
- *
- * Copyright 2005 Phil Blundell
-+ * Copyright 2010, 2011 David Jander <david@protonic.nl>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
-@@ -25,6 +26,8 @@
- #include <linux/gpio_keys.h>
- #include <linux/workqueue.h>
- #include <linux/gpio.h>
-+#include <linux/of_platform.h>
-+#include <linux/of_gpio.h>
-
- struct gpio_button_data {
- struct gpio_keys_button *button;
-@@ -445,15 +448,120 @@ static void gpio_keys_close(struct input_dev *input)
- ddata->disable(input->dev.parent);
- }
-
-+/*
-+ * Handlers for alternative sources of platform_data
-+ */
-+#ifdef CONFIG_OF
-+/*
-+ * Translate OpenFirmware node properties into platform_data
-+ */
-+static int gpio_keys_get_devtree_pdata(struct device *dev,
-+ struct gpio_keys_platform_data *pdata)
-+{
-+ struct device_node *node, *pp;
-+ int i;
-+ struct gpio_keys_button *buttons;
-+ const u32 *reg;
-+ int len;
-+
-+ node = dev->of_node;
-+ if (node == NULL)
-+ return -ENODEV;
-+
-+ memset(pdata, 0, sizeof *pdata);
-+
-+ pdata->rep = !!of_get_property(node, "autorepeat", &len);
-+
-+ /* First count the subnodes */
-+ pdata->nbuttons = 0;
-+ pp = NULL;
-+ while ((pp = of_get_next_child(node, pp)))
-+ pdata->nbuttons++;
-+
-+ if (pdata->nbuttons == 0)
-+ return -ENODEV;
-+
-+ buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
-+ if (!buttons)
-+ return -ENODEV;
-+
-+ pp = NULL;
-+ i = 0;
-+ while ((pp = of_get_next_child(node, pp))) {
-+ enum of_gpio_flags flags;
-+
-+ if (!of_find_property(pp, "gpios", NULL)) {
-+ pdata->nbuttons--;
-+ dev_warn(dev, "Found button without gpios\n");
-+ continue;
-+ }
-+ buttons[i].gpio = of_get_gpio_flags(pp, 0, &flags);
-+ buttons[i].active_low = flags & OF_GPIO_ACTIVE_LOW;
-+
-+ reg = of_get_property(pp, "linux,code", &len);
-+ if (!reg) {
-+ dev_err(dev, "Button without keycode: 0x%x\n", buttons[i].gpio);
-+ goto out_fail;
-+ }
-+ buttons[i].code = be32_to_cpup(reg);
-+
-+ buttons[i].desc = of_get_property(pp, "label", &len);
-+
-+ reg = of_get_property(pp, "linux,input-type", &len);
-+ buttons[i].type = reg ? be32_to_cpup(reg) : EV_KEY;
-+
-+ buttons[i].wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);
-+
-+ reg = of_get_property(pp, "debounce-interval", &len);
-+ buttons[i].debounce_interval = reg ? be32_to_cpup(reg) : 5;
-+
-+ i++;
-+ }
-+
-+ pdata->buttons = buttons;
-+
-+ return 0;
-+
-+out_fail:
-+ kfree(buttons);
-+ return -ENODEV;
-+}
-+
-+static struct of_device_id gpio_keys_of_match[] = {
-+ { .compatible = "gpio-keys", },
-+ { },
-+};
-+MODULE_DEVICE_TABLE(of, gpio_keys_of_match);
-+
-+#else
-+
-+static int gpio_keys_get_devtree_pdata(struct device *dev,
-+ struct gpio_keys_platform_data *altp)
-+{
-+ return -ENODEV;
-+}
-+
-+#define gpio_keys_of_match NULL
-+
-+#endif
-+
- static int __devinit gpio_keys_probe(struct platform_device *pdev)
- {
- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
- struct gpio_keys_drvdata *ddata;
- struct device *dev = &pdev->dev;
-+ struct gpio_keys_platform_data alt_pdata;
- struct input_dev *input;
- int i, error;
- int wakeup = 0;
-
-+ if (!pdata) {
-+ error = gpio_keys_get_devtree_pdata(dev, &alt_pdata);
-+ if (error)
-+ return error;
-+ pdata = &alt_pdata;
-+ }
-+
- ddata = kzalloc(sizeof(struct gpio_keys_drvdata) +
- pdata->nbuttons * sizeof(struct gpio_button_data),
- GFP_KERNEL);
-@@ -544,13 +652,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
- fail1:
- input_free_device(input);
- kfree(ddata);
-+ /* If we have no platform_data, we allocated buttons dynamically. */
-+ if (!pdev->dev.platform_data)
-+ kfree(pdata->buttons);
-
- return error;
- }
-
- static int __devexit gpio_keys_remove(struct platform_device *pdev)
- {
-- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
- struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev);
- struct input_dev *input = ddata->input;
- int i;
-@@ -559,32 +669,39 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
-
- device_init_wakeup(&pdev->dev, 0);
-
-- for (i = 0; i < pdata->nbuttons; i++) {
-- int irq = gpio_to_irq(pdata->buttons[i].gpio);
-+ for (i = 0; i < ddata->n_buttons; i++) {
-+ int irq = gpio_to_irq(ddata->data[i].button->gpio);
- free_irq(irq, &ddata->data[i]);
- if (ddata->data[i].timer_debounce)
- del_timer_sync(&ddata->data[i].timer);
- cancel_work_sync(&ddata->data[i].work);
-- gpio_free(pdata->buttons[i].gpio);
-+ gpio_free(ddata->data[i].button->gpio);
- }
-
- input_unregister_device(input);
-+
-+ /*
-+ * If we had no platform_data, we allocated buttons dynamically, and
-+ * must free them here. ddata->data[0].button is the pointer to the
-+ * beginning of the allocated array.
-+ */
-+ if (!pdev->dev.platform_data)
-+ kfree(ddata->data[0].button);
-+
- kfree(ddata);
-
- return 0;
- }
-
--
- #ifdef CONFIG_PM
- static int gpio_keys_suspend(struct device *dev)
- {
-- struct platform_device *pdev = to_platform_device(dev);
-- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
-+ struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
- int i;
-
-- if (device_may_wakeup(&pdev->dev)) {
-- for (i = 0; i < pdata->nbuttons; i++) {
-- struct gpio_keys_button *button = &pdata->buttons[i];
-+ if (device_may_wakeup(dev)) {
-+ for (i = 0; i < ddata->n_buttons; i++) {
-+ struct gpio_keys_button *button = ddata->data[i].button;
- if (button->wakeup) {
- int irq = gpio_to_irq(button->gpio);
- enable_irq_wake(irq);
-@@ -597,15 +714,13 @@ static int gpio_keys_suspend(struct device *dev)
-
- static int gpio_keys_resume(struct device *dev)
- {
-- struct platform_device *pdev = to_platform_device(dev);
-- struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev);
-- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
-+ struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
- int i;
-
-- for (i = 0; i < pdata->nbuttons; i++) {
-+ for (i = 0; i < ddata->n_buttons; i++) {
-
-- struct gpio_keys_button *button = &pdata->buttons[i];
-- if (button->wakeup && device_may_wakeup(&pdev->dev)) {
-+ struct gpio_keys_button *button = ddata->data[i].button;
-+ if (button->wakeup && device_may_wakeup(dev)) {
- int irq = gpio_to_irq(button->gpio);
- disable_irq_wake(irq);
- }
-@@ -632,6 +747,7 @@ static struct platform_driver gpio_keys_device_driver = {
- #ifdef CONFIG_PM
- .pm = &gpio_keys_pm_ops,
- #endif
-+ .of_match_table = gpio_keys_of_match,
- }
- };
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0231-Input-gpio_keys-switch-to-using-SIMPLE_DEV_PM_OPS.patch b/patches.armadillo800eva/0231-Input-gpio_keys-switch-to-using-SIMPLE_DEV_PM_OPS.patch
deleted file mode 100644
index bc221e93bb29ce..00000000000000
--- a/patches.armadillo800eva/0231-Input-gpio_keys-switch-to-using-SIMPLE_DEV_PM_OPS.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From a66ecd7dbf6e5f44d65e7dbaef8362621fa61084 Mon Sep 17 00:00:00 2001
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Date: Sat, 9 Jul 2011 12:41:46 -0700
-Subject: Input: gpio_keys - switch to using SIMPLE_DEV_PM_OPS
-
-This reduces amount #ifdeds in the code.
-
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit bdda82162837a20e591ac01b306dc8f052270510)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 11 +++--------
- 1 file changed, 3 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index ad11e86..ce281d1 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -693,7 +693,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
- return 0;
- }
-
--#ifdef CONFIG_PM
-+#ifdef CONFIG_PM_SLEEP
- static int gpio_keys_suspend(struct device *dev)
- {
- struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
-@@ -731,22 +731,17 @@ static int gpio_keys_resume(struct device *dev)
-
- return 0;
- }
--
--static const struct dev_pm_ops gpio_keys_pm_ops = {
-- .suspend = gpio_keys_suspend,
-- .resume = gpio_keys_resume,
--};
- #endif
-
-+static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
-+
- static struct platform_driver gpio_keys_device_driver = {
- .probe = gpio_keys_probe,
- .remove = __devexit_p(gpio_keys_remove),
- .driver = {
- .name = "gpio-keys",
- .owner = THIS_MODULE,
--#ifdef CONFIG_PM
- .pm = &gpio_keys_pm_ops,
--#endif
- .of_match_table = gpio_keys_of_match,
- }
- };
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0232-Input-gpio_keys-return-proper-error-code-if-memory-a.patch b/patches.armadillo800eva/0232-Input-gpio_keys-return-proper-error-code-if-memory-a.patch
deleted file mode 100644
index c823f8bd68d538..00000000000000
--- a/patches.armadillo800eva/0232-Input-gpio_keys-return-proper-error-code-if-memory-a.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 66b7ed0e60fecd1c328be3c0de453e18d9dc3993 Mon Sep 17 00:00:00 2001
-From: Tobias Klauser <tklauser@distanz.ch>
-Date: Sat, 30 Jul 2011 12:08:10 -0700
-Subject: Input: gpio_keys - return proper error code if memory allocation
- fails
-
-Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata().
-
-Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 1f4bb066433322f6f189b084ceebdfb4add77292)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index ce281d1..67df91a 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -483,7 +483,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
-
- buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL);
- if (!buttons)
-- return -ENODEV;
-+ return -ENOMEM;
-
- pp = NULL;
- i = 0;
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0233-Input-gpio_keys-fix-two-typos-in-devicetree-document.patch b/patches.armadillo800eva/0233-Input-gpio_keys-fix-two-typos-in-devicetree-document.patch
deleted file mode 100644
index afff4cdaa86865..00000000000000
--- a/patches.armadillo800eva/0233-Input-gpio_keys-fix-two-typos-in-devicetree-document.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From fa3c3b98a1c54fff047c6fc0110a5309623cc051 Mon Sep 17 00:00:00 2001
-From: Tobias Klauser <tklauser@distanz.ch>
-Date: Tue, 2 Aug 2011 15:40:22 -0700
-Subject: Input: gpio_keys - fix two typos in devicetree documentation
-
-Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 0a7a8fff7b8a3bc2d3528af07c9c88083250303d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/devicetree/bindings/gpio/gpio_keys.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Documentation/devicetree/bindings/gpio/gpio_keys.txt b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
-index 7190c99..5c2c021 100644
---- a/Documentation/devicetree/bindings/gpio/gpio_keys.txt
-+++ b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
-@@ -10,7 +10,7 @@ Optional properties:
- Each button (key) is represented as a sub-node of "gpio-keys":
- Subnode properties:
-
-- - gpios: OF devcie-tree gpio specificatin.
-+ - gpios: OF device-tree gpio specification.
- - label: Descriptive name of the key.
- - linux,code: Keycode to emit.
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0234-Input-gpio_keys-use-of_property_read_u32.patch b/patches.armadillo800eva/0234-Input-gpio_keys-use-of_property_read_u32.patch
deleted file mode 100644
index 1a9637b7eede82..00000000000000
--- a/patches.armadillo800eva/0234-Input-gpio_keys-use-of_property_read_u32.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From c66be10095b0ce9d065cd49b3344e884c0b5fd22 Mon Sep 17 00:00:00 2001
-From: Tobias Klauser <tklauser@distanz.ch>
-Date: Fri, 9 Sep 2011 11:09:50 -0700
-Subject: Input: gpio_keys - use of_property_read_u32()
-
-Use the of_property_read_u32() helper function to retrieve u32 values
-from the device tree. Also do not pass the len parameter to
-of_get_property if it isn't checked afterwards.
-
-Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit cca84699a079a91b0a0cb4f2da8548e56859376a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 24 +++++++++++++-----------
- 1 file changed, 13 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 67df91a..ed1ed46 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -461,8 +461,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
- struct device_node *node, *pp;
- int i;
- struct gpio_keys_button *buttons;
-- const u32 *reg;
-- int len;
-+ u32 reg;
-
- node = dev->of_node;
- if (node == NULL)
-@@ -470,7 +469,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
-
- memset(pdata, 0, sizeof *pdata);
-
-- pdata->rep = !!of_get_property(node, "autorepeat", &len);
-+ pdata->rep = !!of_get_property(node, "autorepeat", NULL);
-
- /* First count the subnodes */
- pdata->nbuttons = 0;
-@@ -498,22 +497,25 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
- buttons[i].gpio = of_get_gpio_flags(pp, 0, &flags);
- buttons[i].active_low = flags & OF_GPIO_ACTIVE_LOW;
-
-- reg = of_get_property(pp, "linux,code", &len);
-- if (!reg) {
-+ if (of_property_read_u32(pp, "linux,code", &reg)) {
- dev_err(dev, "Button without keycode: 0x%x\n", buttons[i].gpio);
- goto out_fail;
- }
-- buttons[i].code = be32_to_cpup(reg);
-+ buttons[i].code = reg;
-
-- buttons[i].desc = of_get_property(pp, "label", &len);
-+ buttons[i].desc = of_get_property(pp, "label", NULL);
-
-- reg = of_get_property(pp, "linux,input-type", &len);
-- buttons[i].type = reg ? be32_to_cpup(reg) : EV_KEY;
-+ if (of_property_read_u32(pp, "linux,input-type", &reg) == 0)
-+ buttons[i].type = reg;
-+ else
-+ buttons[i].type = EV_KEY;
-
- buttons[i].wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);
-
-- reg = of_get_property(pp, "debounce-interval", &len);
-- buttons[i].debounce_interval = reg ? be32_to_cpup(reg) : 5;
-+ if (of_property_read_u32(pp, "debounce-interval", &reg) == 0)
-+ buttons[i].debounce_interval = reg;
-+ else
-+ buttons[i].debounce_interval = 5;
-
- i++;
- }
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0235-Input-gpio_keys-fix-struct-device-declared-inside-pa.patch b/patches.armadillo800eva/0235-Input-gpio_keys-fix-struct-device-declared-inside-pa.patch
deleted file mode 100644
index 8ae605895c7b0f..00000000000000
--- a/patches.armadillo800eva/0235-Input-gpio_keys-fix-struct-device-declared-inside-pa.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 52b2cc635112808cfcc06713b5c9423858bc40a9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Heiko=20St=C3=BCbner?= <heiko@sntech.de>
-Date: Wed, 1 Feb 2012 09:12:24 -0800
-Subject: Input: gpio_keys - fix struct device declared inside parameter list
-
-A struct device parameter is used in the enable and disable callbacks to
-distinguish between different gpio_keys devices.
-
-Platforms that don't use these callbacks may not include struct device
-at all, as seen on arch/arm/mach-s3c2410/mach-n30.c
-
-Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit b18db3d91234c03ad080d317878c7c77672ba326)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/gpio_keys.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
-index b5ca4b2..004ff33 100644
---- a/include/linux/gpio_keys.h
-+++ b/include/linux/gpio_keys.h
-@@ -1,6 +1,8 @@
- #ifndef _GPIO_KEYS_H
- #define _GPIO_KEYS_H
-
-+struct device;
-+
- struct gpio_keys_button {
- /* Configuration parameters */
- unsigned int code; /* input event code (KEY_*, SW_*) */
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0236-Input-gpio_keys-constify-platform-data.patch b/patches.armadillo800eva/0236-Input-gpio_keys-constify-platform-data.patch
deleted file mode 100644
index 99ac7f582d73b5..00000000000000
--- a/patches.armadillo800eva/0236-Input-gpio_keys-constify-platform-data.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 816b88a54fd13e92637012b7ead64a709c2faa64 Mon Sep 17 00:00:00 2001
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Date: Sun, 18 Mar 2012 23:36:29 -0700
-Subject: Input: gpio_keys - constify platform data
-
-The platform data should not be altered and therefore should be
-accessed through const pointers.
-
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit d9080921aa32c70a95476ce387e973787b892591)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 31 +++++++++++++++----------------
- 1 file changed, 15 insertions(+), 16 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index ed1ed46..19887fc 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -30,7 +30,7 @@
- #include <linux/of_gpio.h>
-
- struct gpio_button_data {
-- struct gpio_keys_button *button;
-+ const struct gpio_keys_button *button;
- struct input_dev *input;
- struct timer_list timer;
- struct work_struct work;
-@@ -322,7 +322,7 @@ static struct attribute_group gpio_keys_attr_group = {
-
- static void gpio_keys_report_event(struct gpio_button_data *bdata)
- {
-- struct gpio_keys_button *button = bdata->button;
-+ const struct gpio_keys_button *button = bdata->button;
- struct input_dev *input = bdata->input;
- unsigned int type = button->type ?: EV_KEY;
- int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;
-@@ -354,7 +354,7 @@ static void gpio_keys_timer(unsigned long _data)
- static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
- {
- struct gpio_button_data *bdata = dev_id;
-- struct gpio_keys_button *button = bdata->button;
-+ const struct gpio_keys_button *button = bdata->button;
-
- BUG_ON(irq != gpio_to_irq(button->gpio));
-
-@@ -368,8 +368,9 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
- }
-
- static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
-+ struct input_dev *input,
- struct gpio_button_data *bdata,
-- struct gpio_keys_button *button)
-+ const struct gpio_keys_button *button)
- {
- const char *desc = button->desc ? button->desc : "gpio_keys";
- struct device *dev = &pdev->dev;
-@@ -378,6 +379,8 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
-
- setup_timer(&bdata->timer, gpio_keys_timer, (unsigned long)bdata);
- INIT_WORK(&bdata->work, gpio_keys_work_func);
-+ bdata->input = input;
-+ bdata->button = button;
-
- error = gpio_request(button->gpio, desc);
- if (error < 0) {
-@@ -425,6 +428,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- goto fail3;
- }
-
-+ input_set_capability(input, button->type ?: EV_KEY, button->code);
- return 0;
-
- fail3:
-@@ -549,7 +553,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
-
- static int __devinit gpio_keys_probe(struct platform_device *pdev)
- {
-- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
-+ const struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
- struct gpio_keys_drvdata *ddata;
- struct device *dev = &pdev->dev;
- struct gpio_keys_platform_data alt_pdata;
-@@ -599,21 +603,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
- __set_bit(EV_REP, input->evbit);
-
- for (i = 0; i < pdata->nbuttons; i++) {
-- struct gpio_keys_button *button = &pdata->buttons[i];
-+ const struct gpio_keys_button *button = &pdata->buttons[i];
- struct gpio_button_data *bdata = &ddata->data[i];
-- unsigned int type = button->type ?: EV_KEY;
-
-- bdata->input = input;
-- bdata->button = button;
--
-- error = gpio_keys_setup_key(pdev, bdata, button);
-+ error = gpio_keys_setup_key(pdev, input, bdata, button);
- if (error)
- goto fail2;
-
- if (button->wakeup)
- wakeup = 1;
--
-- input_set_capability(input, type, button->code);
- }
-
- error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group);
-@@ -699,11 +697,12 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
- static int gpio_keys_suspend(struct device *dev)
- {
- struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
-+ const struct gpio_keys_button *button;
- int i;
-
- if (device_may_wakeup(dev)) {
- for (i = 0; i < ddata->n_buttons; i++) {
-- struct gpio_keys_button *button = ddata->data[i].button;
-+ button = ddata->data[i].button;
- if (button->wakeup) {
- int irq = gpio_to_irq(button->gpio);
- enable_irq_wake(irq);
-@@ -717,11 +716,11 @@ static int gpio_keys_suspend(struct device *dev)
- static int gpio_keys_resume(struct device *dev)
- {
- struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
-+ const struct gpio_keys_button *button;
- int i;
-
- for (i = 0; i < ddata->n_buttons; i++) {
--
-- struct gpio_keys_button *button = ddata->data[i].button;
-+ button = ddata->data[i].button;
- if (button->wakeup && device_may_wakeup(dev)) {
- int irq = gpio_to_irq(button->gpio);
- disable_irq_wake(irq);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0237-Input-revert-gpio_keys-switch-to-using-threaded-IRQs.patch b/patches.armadillo800eva/0237-Input-revert-gpio_keys-switch-to-using-threaded-IRQs.patch
deleted file mode 100644
index 7a611d36b3f254..00000000000000
--- a/patches.armadillo800eva/0237-Input-revert-gpio_keys-switch-to-using-threaded-IRQs.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 6683b1b58dc6d1d688f870aafd83546174604a35 Mon Sep 17 00:00:00 2001
-From: David Jander <david@protonic.nl>
-Date: Sun, 18 Mar 2012 23:36:29 -0700
-Subject: Input: revert "gpio_keys - switch to using threaded IRQs"
-
-request_any_context_irq() should handle the case when using GPIO expanders
-that themselves use threaded IRQs, and so the premise of change
-7e2ecdf438bb479e2b4667fc16b1a84d6348da04 is incorrect.
-
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 6709c9a5d8c53092cbe89128df4e0a549e93133b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 19887fc..6f06758 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -421,7 +421,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- if (!button->can_disable)
- irqflags |= IRQF_SHARED;
-
-- error = request_threaded_irq(irq, NULL, gpio_keys_isr, irqflags, desc, bdata);
-+ error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
- if (error < 0) {
- dev_err(dev, "Unable to claim irq %d; error %d\n",
- irq, error);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0238-Input-gpio_keys-consolidate-key-destructor-code.patch b/patches.armadillo800eva/0238-Input-gpio_keys-consolidate-key-destructor-code.patch
deleted file mode 100644
index 0d78205e5862e4..00000000000000
--- a/patches.armadillo800eva/0238-Input-gpio_keys-consolidate-key-destructor-code.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 777e41f4fbca9b1118637d80835af61d3dfa2d74 Mon Sep 17 00:00:00 2001
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Date: Sun, 18 Mar 2012 23:36:30 -0700
-Subject: Input: gpio_keys - consolidate key destructor code
-
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit a16ca23935afc0d72215b139720bd07df3162a9f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 30 ++++++++++++++----------------
- 1 file changed, 14 insertions(+), 16 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 6f06758..8f44f7b 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -195,7 +195,7 @@ static ssize_t gpio_keys_attr_show_helper(struct gpio_keys_drvdata *ddata,
- * @type: button type (%EV_KEY, %EV_SW)
- *
- * This function parses stringified bitmap from @buf and disables/enables
-- * GPIO buttons accordinly. Returns 0 on success and negative error
-+ * GPIO buttons accordingly. Returns 0 on success and negative error
- * on failure.
- */
- static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata,
-@@ -551,6 +551,15 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
-
- #endif
-
-+static void gpio_remove_key(struct gpio_button_data *bdata)
-+{
-+ free_irq(gpio_to_irq(bdata->button->gpio), bdata);
-+ if (bdata->timer_debounce)
-+ del_timer_sync(&bdata->timer);
-+ cancel_work_sync(&bdata->work);
-+ gpio_free(bdata->button->gpio);
-+}
-+
- static int __devinit gpio_keys_probe(struct platform_device *pdev)
- {
- const struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
-@@ -640,13 +649,8 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
- fail3:
- sysfs_remove_group(&pdev->dev.kobj, &gpio_keys_attr_group);
- fail2:
-- while (--i >= 0) {
-- free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]);
-- if (ddata->data[i].timer_debounce)
-- del_timer_sync(&ddata->data[i].timer);
-- cancel_work_sync(&ddata->data[i].work);
-- gpio_free(pdata->buttons[i].gpio);
-- }
-+ while (--i >= 0)
-+ gpio_remove_key(&ddata->data[i]);
-
- platform_set_drvdata(pdev, NULL);
- fail1:
-@@ -669,14 +673,8 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
-
- device_init_wakeup(&pdev->dev, 0);
-
-- for (i = 0; i < ddata->n_buttons; i++) {
-- int irq = gpio_to_irq(ddata->data[i].button->gpio);
-- free_irq(irq, &ddata->data[i]);
-- if (ddata->data[i].timer_debounce)
-- del_timer_sync(&ddata->data[i].timer);
-- cancel_work_sync(&ddata->data[i].work);
-- gpio_free(ddata->data[i].button->gpio);
-- }
-+ for (i = 0; i < ddata->n_buttons; i++)
-+ gpio_remove_key(&ddata->data[i]);
-
- input_unregister_device(input);
-
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0239-Input-gpio_keys-add-support-for-interrupt-only-keys.patch b/patches.armadillo800eva/0239-Input-gpio_keys-add-support-for-interrupt-only-keys.patch
deleted file mode 100644
index ea4c66c3a4b3c8..00000000000000
--- a/patches.armadillo800eva/0239-Input-gpio_keys-add-support-for-interrupt-only-keys.patch
+++ /dev/null
@@ -1,395 +0,0 @@
-From 2c51d9b9e4804ea4d2b37d18910a7f1e7df2642f Mon Sep 17 00:00:00 2001
-From: Laxman Dewangan <ldewangan@nvidia.com>
-Date: Mon, 19 Mar 2012 17:54:31 -0700
-Subject: Input: gpio_keys - add support for interrupt only keys
-
-Some of buttons, like power-on key or onkey, may only generate interrupts
-when pressed and not actually be mapped as gpio in the system. Allow
-setting gpio to invalid value and specify IRQ instead to support such
-keys. The debounce timer is used not to debounce but to ignore new IRQs
-coming while button is kept pressed.
-
-Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit d8ee4a1c90529ed06e1aa43d034986649f7b670b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/gpio_keys.c | 214 +++++++++++++++++++++++++-----------
- include/linux/gpio_keys.h | 3 +-
- 2 files changed, 150 insertions(+), 67 deletions(-)
-
-diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
-index 8f44f7b..62bfce4 100644
---- a/drivers/input/keyboard/gpio_keys.c
-+++ b/drivers/input/keyboard/gpio_keys.c
-@@ -28,14 +28,18 @@
- #include <linux/gpio.h>
- #include <linux/of_platform.h>
- #include <linux/of_gpio.h>
-+#include <linux/spinlock.h>
-
- struct gpio_button_data {
- const struct gpio_keys_button *button;
- struct input_dev *input;
- struct timer_list timer;
- struct work_struct work;
-- int timer_debounce; /* in msecs */
-+ unsigned int timer_debounce; /* in msecs */
-+ unsigned int irq;
-+ spinlock_t lock;
- bool disabled;
-+ bool key_pressed;
- };
-
- struct gpio_keys_drvdata {
-@@ -114,7 +118,7 @@ static void gpio_keys_disable_button(struct gpio_button_data *bdata)
- /*
- * Disable IRQ and possible debouncing timer.
- */
-- disable_irq(gpio_to_irq(bdata->button->gpio));
-+ disable_irq(bdata->irq);
- if (bdata->timer_debounce)
- del_timer_sync(&bdata->timer);
-
-@@ -135,7 +139,7 @@ static void gpio_keys_disable_button(struct gpio_button_data *bdata)
- static void gpio_keys_enable_button(struct gpio_button_data *bdata)
- {
- if (bdata->disabled) {
-- enable_irq(gpio_to_irq(bdata->button->gpio));
-+ enable_irq(bdata->irq);
- bdata->disabled = false;
- }
- }
-@@ -320,7 +324,7 @@ static struct attribute_group gpio_keys_attr_group = {
- .attrs = gpio_keys_attrs,
- };
-
--static void gpio_keys_report_event(struct gpio_button_data *bdata)
-+static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
- {
- const struct gpio_keys_button *button = bdata->button;
- struct input_dev *input = bdata->input;
-@@ -336,27 +340,26 @@ static void gpio_keys_report_event(struct gpio_button_data *bdata)
- input_sync(input);
- }
-
--static void gpio_keys_work_func(struct work_struct *work)
-+static void gpio_keys_gpio_work_func(struct work_struct *work)
- {
- struct gpio_button_data *bdata =
- container_of(work, struct gpio_button_data, work);
-
-- gpio_keys_report_event(bdata);
-+ gpio_keys_gpio_report_event(bdata);
- }
-
--static void gpio_keys_timer(unsigned long _data)
-+static void gpio_keys_gpio_timer(unsigned long _data)
- {
-- struct gpio_button_data *data = (struct gpio_button_data *)_data;
-+ struct gpio_button_data *bdata = (struct gpio_button_data *)_data;
-
-- schedule_work(&data->work);
-+ schedule_work(&bdata->work);
- }
-
--static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
-+static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
- {
- struct gpio_button_data *bdata = dev_id;
-- const struct gpio_keys_button *button = bdata->button;
-
-- BUG_ON(irq != gpio_to_irq(button->gpio));
-+ BUG_ON(irq != bdata->irq);
-
- if (bdata->timer_debounce)
- mod_timer(&bdata->timer,
-@@ -367,6 +370,53 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
- return IRQ_HANDLED;
- }
-
-+static void gpio_keys_irq_timer(unsigned long _data)
-+{
-+ struct gpio_button_data *bdata = (struct gpio_button_data *)_data;
-+ struct input_dev *input = bdata->input;
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&bdata->lock, flags);
-+ if (bdata->key_pressed) {
-+ input_event(input, EV_KEY, bdata->button->code, 0);
-+ input_sync(input);
-+ bdata->key_pressed = false;
-+ }
-+ spin_unlock_irqrestore(&bdata->lock, flags);
-+}
-+
-+static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id)
-+{
-+ struct gpio_button_data *bdata = dev_id;
-+ const struct gpio_keys_button *button = bdata->button;
-+ struct input_dev *input = bdata->input;
-+ unsigned long flags;
-+
-+ BUG_ON(irq != bdata->irq);
-+
-+ spin_lock_irqsave(&bdata->lock, flags);
-+
-+ if (!bdata->key_pressed) {
-+ input_event(input, EV_KEY, button->code, 1);
-+ input_sync(input);
-+
-+ if (!bdata->timer_debounce) {
-+ input_event(input, EV_KEY, button->code, 0);
-+ input_sync(input);
-+ goto out;
-+ }
-+
-+ bdata->key_pressed = true;
-+ }
-+
-+ if (bdata->timer_debounce)
-+ mod_timer(&bdata->timer,
-+ jiffies + msecs_to_jiffies(bdata->timer_debounce));
-+out:
-+ spin_unlock_irqrestore(&bdata->lock, flags);
-+ return IRQ_HANDLED;
-+}
-+
- static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- struct input_dev *input,
- struct gpio_button_data *bdata,
-@@ -374,46 +424,79 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- {
- const char *desc = button->desc ? button->desc : "gpio_keys";
- struct device *dev = &pdev->dev;
-+ irq_handler_t isr;
- unsigned long irqflags;
- int irq, error;
-
-- setup_timer(&bdata->timer, gpio_keys_timer, (unsigned long)bdata);
-- INIT_WORK(&bdata->work, gpio_keys_work_func);
- bdata->input = input;
- bdata->button = button;
-+ spin_lock_init(&bdata->lock);
-
-- error = gpio_request(button->gpio, desc);
-- if (error < 0) {
-- dev_err(dev, "failed to request GPIO %d, error %d\n",
-- button->gpio, error);
-- goto fail2;
-- }
-+ if (gpio_is_valid(button->gpio)) {
-
-- error = gpio_direction_input(button->gpio);
-- if (error < 0) {
-- dev_err(dev, "failed to configure"
-- " direction for GPIO %d, error %d\n",
-- button->gpio, error);
-- goto fail3;
-- }
-+ error = gpio_request(button->gpio, desc);
-+ if (error < 0) {
-+ dev_err(dev, "Failed to request GPIO %d, error %d\n",
-+ button->gpio, error);
-+ return error;
-+ }
-
-- if (button->debounce_interval) {
-- error = gpio_set_debounce(button->gpio,
-- button->debounce_interval * 1000);
-- /* use timer if gpiolib doesn't provide debounce */
-- if (error < 0)
-- bdata->timer_debounce = button->debounce_interval;
-- }
-+ error = gpio_direction_input(button->gpio);
-+ if (error < 0) {
-+ dev_err(dev,
-+ "Failed to configure direction for GPIO %d, error %d\n",
-+ button->gpio, error);
-+ goto fail;
-+ }
-
-- irq = gpio_to_irq(button->gpio);
-- if (irq < 0) {
-- error = irq;
-- dev_err(dev, "Unable to get irq number for GPIO %d, error %d\n",
-- button->gpio, error);
-- goto fail3;
-+ if (button->debounce_interval) {
-+ error = gpio_set_debounce(button->gpio,
-+ button->debounce_interval * 1000);
-+ /* use timer if gpiolib doesn't provide debounce */
-+ if (error < 0)
-+ bdata->timer_debounce =
-+ button->debounce_interval;
-+ }
-+
-+ irq = gpio_to_irq(button->gpio);
-+ if (irq < 0) {
-+ error = irq;
-+ dev_err(dev,
-+ "Unable to get irq number for GPIO %d, error %d\n",
-+ button->gpio, error);
-+ goto fail;
-+ }
-+ bdata->irq = irq;
-+
-+ INIT_WORK(&bdata->work, gpio_keys_gpio_work_func);
-+ setup_timer(&bdata->timer,
-+ gpio_keys_gpio_timer, (unsigned long)bdata);
-+
-+ isr = gpio_keys_gpio_isr;
-+ irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
-+
-+ } else {
-+ if (!button->irq) {
-+ dev_err(dev, "No IRQ specified\n");
-+ return -EINVAL;
-+ }
-+ bdata->irq = button->irq;
-+
-+ if (button->type && button->type != EV_KEY) {
-+ dev_err(dev, "Only EV_KEY allowed for IRQ buttons.\n");
-+ return -EINVAL;
-+ }
-+
-+ bdata->timer_debounce = button->debounce_interval;
-+ setup_timer(&bdata->timer,
-+ gpio_keys_irq_timer, (unsigned long)bdata);
-+
-+ isr = gpio_keys_irq_isr;
-+ irqflags = 0;
- }
-
-- irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
-+ input_set_capability(input, button->type ?: EV_KEY, button->code);
-+
- /*
- * If platform has specified that the button can be disabled,
- * we don't want it to share the interrupt line.
-@@ -421,19 +504,19 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
- if (!button->can_disable)
- irqflags |= IRQF_SHARED;
-
-- error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
-+ error = request_any_context_irq(bdata->irq, isr, irqflags, desc, bdata);
- if (error < 0) {
- dev_err(dev, "Unable to claim irq %d; error %d\n",
-- irq, error);
-- goto fail3;
-+ bdata->irq, error);
-+ goto fail;
- }
-
-- input_set_capability(input, button->type ?: EV_KEY, button->code);
- return 0;
-
--fail3:
-- gpio_free(button->gpio);
--fail2:
-+fail:
-+ if (gpio_is_valid(button->gpio))
-+ gpio_free(button->gpio);
-+
- return error;
- }
-
-@@ -553,11 +636,12 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
-
- static void gpio_remove_key(struct gpio_button_data *bdata)
- {
-- free_irq(gpio_to_irq(bdata->button->gpio), bdata);
-+ free_irq(bdata->irq, bdata);
- if (bdata->timer_debounce)
- del_timer_sync(&bdata->timer);
- cancel_work_sync(&bdata->work);
-- gpio_free(bdata->button->gpio);
-+ if (gpio_is_valid(bdata->button->gpio))
-+ gpio_free(bdata->button->gpio);
- }
-
- static int __devinit gpio_keys_probe(struct platform_device *pdev)
-@@ -637,9 +721,12 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
- goto fail3;
- }
-
-- /* get current state of buttons */
-- for (i = 0; i < pdata->nbuttons; i++)
-- gpio_keys_report_event(&ddata->data[i]);
-+ /* get current state of buttons that are connected to GPIOs */
-+ for (i = 0; i < pdata->nbuttons; i++) {
-+ struct gpio_button_data *bdata = &ddata->data[i];
-+ if (gpio_is_valid(bdata->button->gpio))
-+ gpio_keys_gpio_report_event(bdata);
-+ }
- input_sync(input);
-
- device_init_wakeup(&pdev->dev, wakeup);
-@@ -695,16 +782,13 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
- static int gpio_keys_suspend(struct device *dev)
- {
- struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
-- const struct gpio_keys_button *button;
- int i;
-
- if (device_may_wakeup(dev)) {
- for (i = 0; i < ddata->n_buttons; i++) {
-- button = ddata->data[i].button;
-- if (button->wakeup) {
-- int irq = gpio_to_irq(button->gpio);
-- enable_irq_wake(irq);
-- }
-+ struct gpio_button_data *bdata = &ddata->data[i];
-+ if (bdata->button->wakeup)
-+ enable_irq_wake(bdata->irq);
- }
- }
-
-@@ -714,17 +798,15 @@ static int gpio_keys_suspend(struct device *dev)
- static int gpio_keys_resume(struct device *dev)
- {
- struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
-- const struct gpio_keys_button *button;
- int i;
-
- for (i = 0; i < ddata->n_buttons; i++) {
-- button = ddata->data[i].button;
-- if (button->wakeup && device_may_wakeup(dev)) {
-- int irq = gpio_to_irq(button->gpio);
-- disable_irq_wake(irq);
-- }
-+ struct gpio_button_data *bdata = &ddata->data[i];
-+ if (bdata->button->wakeup && device_may_wakeup(dev))
-+ disable_irq_wake(bdata->irq);
-
-- gpio_keys_report_event(&ddata->data[i]);
-+ if (gpio_is_valid(bdata->button->gpio))
-+ gpio_keys_gpio_report_event(bdata);
- }
- input_sync(ddata->input);
-
-diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
-index 004ff33..a7e977f 100644
---- a/include/linux/gpio_keys.h
-+++ b/include/linux/gpio_keys.h
-@@ -6,7 +6,7 @@ struct device;
- struct gpio_keys_button {
- /* Configuration parameters */
- unsigned int code; /* input event code (KEY_*, SW_*) */
-- int gpio;
-+ int gpio; /* -1 if this key does not support gpio */
- int active_low;
- const char *desc;
- unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */
-@@ -14,6 +14,7 @@ struct gpio_keys_button {
- int debounce_interval; /* debounce ticks interval in msecs */
- bool can_disable;
- int value; /* axis value for EV_ABS */
-+ unsigned int irq; /* Irq number in case of interrupt keys */
- };
-
- struct gpio_keys_platform_data {
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0240-Input-sh_keysc-fix-compile-warning.patch b/patches.armadillo800eva/0240-Input-sh_keysc-fix-compile-warning.patch
deleted file mode 100644
index ed58a9c9c8707b..00000000000000
--- a/patches.armadillo800eva/0240-Input-sh_keysc-fix-compile-warning.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 27c816af3d05cf011b9aeb03dca0023cc918b896 Mon Sep 17 00:00:00 2001
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Date: Mon, 4 Jul 2011 06:34:48 -0700
-Subject: Input: sh_keysc - fix compile warning
-
-The "#if" above should really be an "#ifdef" to avoid this warning:
-
- CC drivers/input/keyboard/sh_keysc.o
-drivers/input/keyboard/sh_keysc.c:294:5: warning: "CONFIG_PM_SLEEP" is
-not defined
-
-Reported-by: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit cca8edfd2ec2a34d9f50f593bc753bb11e1bc1f5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/sh_keysc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
-index 6876700..934aeb583 100644
---- a/drivers/input/keyboard/sh_keysc.c
-+++ b/drivers/input/keyboard/sh_keysc.c
-@@ -291,7 +291,7 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev)
- return 0;
- }
-
--#if CONFIG_PM_SLEEP
-+#ifdef CONFIG_PM_SLEEP
- static int sh_keysc_suspend(struct device *dev)
- {
- struct platform_device *pdev = to_platform_device(dev);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0241-Input-keyboard-use-macro-module_platform_driver.patch b/patches.armadillo800eva/0241-Input-keyboard-use-macro-module_platform_driver.patch
deleted file mode 100644
index d9ba4910dd65f2..00000000000000
--- a/patches.armadillo800eva/0241-Input-keyboard-use-macro-module_platform_driver.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 132c9aae9ea700652f3542eb322a3df52d720df9 Mon Sep 17 00:00:00 2001
-From: JJ Ding <dgdunix@gmail.com>
-Date: Tue, 29 Nov 2011 11:08:39 -0800
-Subject: Input: keyboard - use macro module_platform_driver()
-
-Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to
-save some platform_driver boilerplate code. Use it.
-
-Signed-off-by: JJ Ding <dgdunix@gmail.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-(cherry picked from commit 5146c84f87c8aa3d115cea0d77ed3553df426752)
-
-Conflicts:
-
- drivers/input/keyboard/adp5520-keys.c
- drivers/input/keyboard/amikbd.c
- drivers/input/keyboard/bf54x-keys.c
- drivers/input/keyboard/davinci_keyscan.c
- drivers/input/keyboard/ep93xx_keypad.c
- drivers/input/keyboard/gpio_keys_polled.c
- drivers/input/keyboard/imx_keypad.c
- drivers/input/keyboard/jornada680_kbd.c
- drivers/input/keyboard/jornada720_kbd.c
- drivers/input/keyboard/matrix_keypad.c
- drivers/input/keyboard/nomadik-ske-keypad.c
- drivers/input/keyboard/omap-keypad.c
- drivers/input/keyboard/omap4-keypad.c
- drivers/input/keyboard/opencores-kbd.c
- drivers/input/keyboard/pmic8xxx-keypad.c
- drivers/input/keyboard/pxa27x_keypad.c
- drivers/input/keyboard/pxa930_rotary.c
- drivers/input/keyboard/samsung-keypad.c
- drivers/input/keyboard/spear-keyboard.c
- drivers/input/keyboard/stmpe-keypad.c
- drivers/input/keyboard/tc3589x-keypad.c
- drivers/input/keyboard/tegra-kbc.c
- drivers/input/keyboard/tnetv107x-keypad.c
- drivers/input/keyboard/twl4030_keypad.c
- drivers/input/keyboard/w90p910_keypad.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/input/keyboard/sh_keysc.c | 14 +-------------
- 1 file changed, 1 insertion(+), 13 deletions(-)
-
-diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
-index 934aeb583..da54ad5 100644
---- a/drivers/input/keyboard/sh_keysc.c
-+++ b/drivers/input/keyboard/sh_keysc.c
-@@ -337,19 +337,7 @@ static struct platform_driver sh_keysc_device_driver = {
- .pm = &sh_keysc_dev_pm_ops,
- }
- };
--
--static int __init sh_keysc_init(void)
--{
-- return platform_driver_register(&sh_keysc_device_driver);
--}
--
--static void __exit sh_keysc_exit(void)
--{
-- platform_driver_unregister(&sh_keysc_device_driver);
--}
--
--module_init(sh_keysc_init);
--module_exit(sh_keysc_exit);
-+module_platform_driver(sh_keysc_device_driver);
-
- MODULE_AUTHOR("Magnus Damm");
- MODULE_DESCRIPTION("SuperH KEYSC Keypad Driver");
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0242-Update-Nook-Color-machine-3284-to-common-Encore-name.patch b/patches.armadillo800eva/0242-Update-Nook-Color-machine-3284-to-common-Encore-name.patch
deleted file mode 100644
index db031b262f86fa..00000000000000
--- a/patches.armadillo800eva/0242-Update-Nook-Color-machine-3284-to-common-Encore-name.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 5c0e066e0529e0045b01c48fbcb12599fc0d2290 Mon Sep 17 00:00:00 2001
-From: Oleg Drokin <green@linuxhacker.ru>
-Date: Tue, 9 Aug 2011 03:10:22 -0700
-Subject: Update Nook Color machine 3284 to common Encore name
-
-Machine database already updated:
-http://www.arm.linux.org.uk/developer/machines/list.php?id=3284
-
-Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
-Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
-Signed-off-by: Tony Lindgren <tony@atomide.com>
-(cherry picked from commit 1d08fd9f6a7f2541a7b28a21fc638c4640d9cabb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index 3b3776d..fff68d0 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -910,7 +910,7 @@ omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280
- uemd MACH_UEMD UEMD 3281
- ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282
- rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283
--nookcolor MACH_NOOKCOLOR NOOKCOLOR 3284
-+encore MACH_ENCORE ENCORE 3284
- hkdkc100 MACH_HKDKC100 HKDKC100 3285
- ts42xx MACH_TS42XX TS42XX 3286
- aebl MACH_AEBL AEBL 3287
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0243-ARM-7051-1-cpuimx-boards-fix-mach-types-errors.patch b/patches.armadillo800eva/0243-ARM-7051-1-cpuimx-boards-fix-mach-types-errors.patch
deleted file mode 100644
index 964174457c9ef3..00000000000000
--- a/patches.armadillo800eva/0243-ARM-7051-1-cpuimx-boards-fix-mach-types-errors.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 6aa24bab1055ca1b44a4b68816796c6b5f641a06 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
-Date: Mon, 22 Aug 2011 15:41:46 +0100
-Subject: ARM: 7051/1: cpuimx* boards: fix mach-types errors
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I made some changes to the entry in the ARM Machine Registry after
-submission which was the wrong thing to do.
-This patch should help to fix this error.
-
-Signed-off-by: Eric Bénard <eric@eukrea.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 0d6cfa3a75f5cde5b3ca0dde748fd22625b4f34c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-imx/mach-cpuimx27.c | 2 +-
- arch/arm/mach-imx/mach-cpuimx35.c | 2 +-
- arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 2 +-
- arch/arm/tools/mach-types | 6 +++---
- 4 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
-index 46a2e41..8183755 100644
---- a/arch/arm/mach-imx/mach-cpuimx27.c
-+++ b/arch/arm/mach-imx/mach-cpuimx27.c
-@@ -308,7 +308,7 @@ static struct sys_timer eukrea_cpuimx27_timer = {
- .init = eukrea_cpuimx27_timer_init,
- };
-
--MACHINE_START(CPUIMX27, "EUKREA CPUIMX27")
-+MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
- .boot_params = MX27_PHYS_OFFSET + 0x100,
- .map_io = mx27_map_io,
- .init_early = imx27_init_early,
-diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
-index 3f8ef82..7810222 100644
---- a/arch/arm/mach-imx/mach-cpuimx35.c
-+++ b/arch/arm/mach-imx/mach-cpuimx35.c
-@@ -190,7 +190,7 @@ struct sys_timer eukrea_cpuimx35_timer = {
- .init = eukrea_cpuimx35_timer_init,
- };
-
--MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35")
-+MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
- /* Maintainer: Eukrea Electromatique */
- .boot_params = MX3x_PHYS_OFFSET + 0x100,
- .map_io = mx35_map_io,
-diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
-index 148cff2..19ffa9a 100644
---- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
-+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
-@@ -159,7 +159,7 @@ static struct sys_timer eukrea_cpuimx25_timer = {
- .init = eukrea_cpuimx25_timer_init,
- };
-
--MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25")
-+MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
- /* Maintainer: Eukrea Electromatique */
- .boot_params = MX25_PHYS_OFFSET + 0x100,
- .map_io = mx25_map_io,
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index fff68d0..62cc8f9 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -351,7 +351,7 @@ centro MACH_CENTRO CENTRO 1944
- nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955
- omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967
- cpuat9260 MACH_CPUAT9260 CPUAT9260 1973
--eukrea_cpuimx27 MACH_CPUIMX27 CPUIMX27 1975
-+eukrea_cpuimx27 MACH_EUKREA_CPUIMX27 EUKREA_CPUIMX27 1975
- acs5k MACH_ACS5K ACS5K 1982
- snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987
- dsm320 MACH_DSM320 DSM320 1988
-@@ -476,8 +476,8 @@ cns3420vb MACH_CNS3420VB CNS3420VB 2776
- omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791
- ti8168evm MACH_TI8168EVM TI8168EVM 2800
- teton_bga MACH_TETON_BGA TETON_BGA 2816
--eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25 EUKREA_CPUIMX25 2820
--eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35 EUKREA_CPUIMX35 2821
-+eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25SD EUKREA_CPUIMX25SD 2820
-+eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821
- eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
- eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
- smdkc210 MACH_SMDKC210 SMDKC210 2838
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0244-ARM-Add-a-few-machine-types-to-mach-types.patch b/patches.armadillo800eva/0244-ARM-Add-a-few-machine-types-to-mach-types.patch
deleted file mode 100644
index 44eb8b56251fd8..00000000000000
--- a/patches.armadillo800eva/0244-ARM-Add-a-few-machine-types-to-mach-types.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From e12b022730fe5c700fe8d1872a2bda4ea41c6abe Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Mon, 17 Oct 2011 10:26:51 +0100
-Subject: ARM: Add a few machine types to mach-types
-
-Add vision_ep9307, rwi_ews, usb_a9g20, karo, apf9328, tx37, tx25,
-tx51, mx51_m2id, pca101, gplugd, smdk4212 and smdk4412.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 628e1110feebeb834359fd6f44ec7e346bdf9611)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 20 ++++++++++++++++----
- 1 file changed, 16 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index 62cc8f9..5bdeef9 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -12,10 +12,9 @@
- #
- # http://www.arm.linux.org.uk/developer/machines/?action=new
- #
--# XXX: This is a cut-down version of the file; it contains only machines that
--# XXX: are in mainline or have been submitted to the machine database within
--# XXX: the last 12 months. If your entry is missing please email rmk at
--# XXX: <linux@arm.linux.org.uk>
-+# This is a cut-down version of the file; it contains only machines that
-+# are merged into mainline or have been edited in the machine database
-+# within the last 12 months. References to machine_is_NAME() do not count!
- #
- # Last update: Sat May 7 08:48:24 2011
- #
-@@ -65,6 +64,7 @@ h7201 ARCH_H7201 H7201 161
- h7202 ARCH_H7202 H7202 162
- iq80321 ARCH_IQ80321 IQ80321 169
- ks8695 ARCH_KS8695 KS8695 180
-+karo ARCH_KARO KARO 190
- smdk2410 ARCH_SMDK2410 SMDK2410 193
- ceiva ARCH_CEIVA CEIVA 200
- voiceblue MACH_VOICEBLUE VOICEBLUE 218
-@@ -188,6 +188,7 @@ omap_2430sdp MACH_OMAP_2430SDP OMAP_2430SDP 900
- davinci_evm MACH_DAVINCI_EVM DAVINCI_EVM 901
- palmz72 MACH_PALMZ72 PALMZ72 904
- nxdb500 MACH_NXDB500 NXDB500 905
-+apf9328 MACH_APF9328 APF9328 906
- palmt5 MACH_PALMT5 PALMT5 917
- palmtc MACH_PALMTC PALMTC 918
- omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919
-@@ -271,10 +272,12 @@ pcm038 MACH_PCM038 PCM038 1551
- ts_x09 MACH_TS209 TS209 1565
- at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566
- mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574
-+vision_ep9307 MACH_VISION_EP9307 VISION_EP9307 1578
- terastation_pro2 MACH_TERASTATION_PRO2 TERASTATION_PRO2 1584
- linkstation_pro MACH_LINKSTATION_PRO LINKSTATION_PRO 1585
- e350 MACH_E350 E350 1596
- ts409 MACH_TS409 TS409 1601
-+rsi_ews MACH_RSI_EWS RSI_EWS 1609
- cm_x300 MACH_CM_X300 CM_X300 1616
- at91sam9g20ek MACH_AT91SAM9G20EK AT91SAM9G20EK 1624
- smdk6410 MACH_SMDK6410 SMDK6410 1626
-@@ -331,6 +334,7 @@ smdkc100 MACH_SMDKC100 SMDKC100 1826
- tavorevb MACH_TAVOREVB TAVOREVB 1827
- saar MACH_SAAR SAAR 1828
- at91sam9m10g45ek MACH_AT91SAM9M10G45EK AT91SAM9M10G45EK 1830
-+usb_a9g20 MACH_USB_A9G20 USB_A9G20 1841
- mxlads MACH_MXLADS MXLADS 1851
- linkstation_mini MACH_LINKSTATION_MINI LINKSTATION_MINI 1858
- afeb9260 MACH_AFEB9260 AFEB9260 1859
-@@ -369,6 +373,7 @@ pcm043 MACH_PCM043 PCM043 2072
- sheevaplug MACH_SHEEVAPLUG SHEEVAPLUG 2097
- avengers_lite MACH_AVENGERS_LITE AVENGERS_LITE 2104
- mx51_babbage MACH_MX51_BABBAGE MX51_BABBAGE 2125
-+tx37 MACH_TX37 TX37 2127
- rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135
- dm355_leopard MACH_DM355_LEOPARD DM355_LEOPARD 2138
- ts219 MACH_TS219 TS219 2139
-@@ -379,6 +384,7 @@ omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160
- magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162
- btmavb101 MACH_BTMAVB101 BTMAVB101 2172
- btmawb101 MACH_BTMAWB101 BTMAWB101 2173
-+tx25 MACH_TX25 TX25 2177
- omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178
- anw6410 MACH_ANW6410 ANW6410 2183
- imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187
-@@ -423,6 +429,7 @@ raumfeld_rc MACH_RAUMFELD_RC RAUMFELD_RC 2413
- raumfeld_connector MACH_RAUMFELD_CONNECTOR RAUMFELD_CONNECTOR 2414
- raumfeld_speaker MACH_RAUMFELD_SPEAKER RAUMFELD_SPEAKER 2415
- tnetv107x MACH_TNETV107X TNETV107X 2418
-+mx51_m2id MACH_MX51_M2ID MX51_M2ID 2428
- smdkv210 MACH_SMDKV210 SMDKV210 2456
- omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464
- omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465
-@@ -433,14 +440,17 @@ omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495
- ts41x MACH_TS41X TS41X 2502
- phy3250 MACH_PHY3250 PHY3250 2511
- mini6410 MACH_MINI6410 MINI6410 2520
-+tx51 MACH_TX51 TX51 2529
- mx28evk MACH_MX28EVK MX28EVK 2531
- smartq5 MACH_SMARTQ5 SMARTQ5 2534
- davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
- mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
- riot_bei2 MACH_RIOT_BEI2 RIOT_BEI2 2576
- riot_x37 MACH_RIOT_X37 RIOT_X37 2578
-+pca101 MACH_PCA101 PCA101 2595
- capc7117 MACH_CAPC7117 CAPC7117 2612
- icontrol MACH_ICONTROL ICONTROL 2624
-+gplugd MACH_GPLUGD GPLUGD 2625
- qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627
- mx23evk MACH_MX23EVK MX23EVK 2629
- ap4evb MACH_AP4EVB AP4EVB 2630
-@@ -1113,3 +1123,5 @@ blissc MACH_BLISSC BLISSC 3491
- thales_adc MACH_THALES_ADC THALES_ADC 3492
- ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493
- atdgp318 MACH_ATDGP318 ATDGP318 3494
-+smdk4212 MACH_SMDK4212 SMDK4212 3638
-+smdk4412 MACH_SMDK4412 SMDK4412 3765
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0245-ARM-Update-mach-types-to-fix-mxs-build-breakage.patch b/patches.armadillo800eva/0245-ARM-Update-mach-types-to-fix-mxs-build-breakage.patch
deleted file mode 100644
index 8395f2657de65a..00000000000000
--- a/patches.armadillo800eva/0245-ARM-Update-mach-types-to-fix-mxs-build-breakage.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 51199f058ed4376aeea7ab3340b67d49d71d2a56 Mon Sep 17 00:00:00 2001
-From: Shawn Guo <shawn.guo@linaro.org>
-Date: Wed, 16 Nov 2011 21:44:33 +0800
-Subject: ARM: Update mach-types to fix mxs build breakage
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add entry m28evk to fix the following mxs build breakage.
-
- CHK include/generated/compile.h
- CC arch/arm/mach-mxs/clock-mx28.o
-arch/arm/mach-mxs/clock-mx28.c: In function 'clk_misc_init':
-arch/arm/mach-mxs/clock-mx28.c:748: error: implicit declaration of
-function 'machine_is_m28evk'
-make[1]: *** [arch/arm/mach-mxs/clock-mx28.o] Error 1
-make: *** [arch/arm/mach-mxs] Error 2
-
-Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-(cherry picked from commit 9b7c547f7747991fe62f622698ea1bf470f256f4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index 5bdeef9..ccbe16f 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -1123,5 +1123,6 @@ blissc MACH_BLISSC BLISSC 3491
- thales_adc MACH_THALES_ADC THALES_ADC 3492
- ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493
- atdgp318 MACH_ATDGP318 ATDGP318 3494
-+m28evk MACH_M28EVK M28EVK 3613
- smdk4212 MACH_SMDK4212 SMDK4212 3638
- smdk4412 MACH_SMDK4412 SMDK4412 3765
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0246-ARM-7193-1-Fix-machine_is_xxx-naming-for-eSata-Sheev.patch b/patches.armadillo800eva/0246-ARM-7193-1-Fix-machine_is_xxx-naming-for-eSata-Sheev.patch
deleted file mode 100644
index 0687ca9739cdcc..00000000000000
--- a/patches.armadillo800eva/0246-ARM-7193-1-Fix-machine_is_xxx-naming-for-eSata-Sheev.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 9bdfe76b0554ab2c6e657ec2c294ab8c43d34a28 Mon Sep 17 00:00:00 2001
-From: "Jon Medhurst (Tixy)" <tixy@yxit.co.uk>
-Date: Tue, 6 Dec 2011 09:59:38 +0100
-Subject: ARM: 7193/1: Fix machine_is_xxx() naming for eSata SheevaPlug and
- QNAP TS-209
-
-The eSata SheevaPlug and QNAP TS-209 devices were removed from
-mach-types due to naming mismatches between machine_is_xxx(), CONFIG_XXX
-and MACH_TYPE_XXX.
-
-This patch fixes those mismatches and adds the devices back into
-mach-types.
-
-Acked-by: Nicolas Pitre <nico@linaro.org>
-Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit d22759ed5680055fdecbdcf6644dbc8a467ab801)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-kirkwood/sheevaplug-setup.c | 6 +++---
- arch/arm/mach-orion5x/ts209-setup.c | 2 +-
- arch/arm/tools/mach-types | 4 ++--
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
-index 17de0bf..d989c0d 100644
---- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
-+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
-@@ -107,7 +107,7 @@ static void __init sheevaplug_init(void)
- kirkwood_init();
-
- /* setup gpio pin select */
-- if (machine_is_sheeva_esata())
-+ if (machine_is_esata_sheevaplug())
- kirkwood_mpp_conf(sheeva_esata_mpp_config);
- else
- kirkwood_mpp_conf(sheevaplug_mpp_config);
-@@ -123,11 +123,11 @@ static void __init sheevaplug_init(void)
- kirkwood_ge00_init(&sheevaplug_ge00_data);
-
- /* honor lower power consumption for plugs with out eSATA */
-- if (machine_is_sheeva_esata())
-+ if (machine_is_esata_sheevaplug())
- kirkwood_sata_init(&sheeva_esata_sata_data);
-
- /* enable sd wp and sd cd on plugs with esata */
-- if (machine_is_sheeva_esata())
-+ if (machine_is_esata_sheevaplug())
- kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
- else
- kirkwood_sdio_init(&sheevaplug_mvsdio_data);
-diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
-index 47162fd..6749c2c 100644
---- a/arch/arm/mach-orion5x/ts209-setup.c
-+++ b/arch/arm/mach-orion5x/ts209-setup.c
-@@ -178,7 +178,7 @@ static struct hw_pci qnap_ts209_pci __initdata = {
-
- static int __init qnap_ts209_pci_init(void)
- {
-- if (machine_is_ts_x09())
-+ if (machine_is_ts209())
- pci_common_init(&qnap_ts209_pci);
-
- return 0;
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index ccbe16f..9e66ebc 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -269,7 +269,7 @@ dns323 MACH_DNS323 DNS323 1542
- omap3_beagle MACH_OMAP3_BEAGLE OMAP3_BEAGLE 1546
- nokia_n810 MACH_NOKIA_N810 NOKIA_N810 1548
- pcm038 MACH_PCM038 PCM038 1551
--ts_x09 MACH_TS209 TS209 1565
-+ts209 MACH_TS209 TS209 1565
- at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566
- mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574
- vision_ep9307 MACH_VISION_EP9307 VISION_EP9307 1578
-@@ -459,7 +459,7 @@ guruplug MACH_GURUPLUG GURUPLUG 2659
- spear310 MACH_SPEAR310 SPEAR310 2660
- spear320 MACH_SPEAR320 SPEAR320 2661
- aquila MACH_AQUILA AQUILA 2676
--sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
-+esata_sheevaplug MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
- msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679
- ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683
- terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0247-ARM-Update-mach-types.patch b/patches.armadillo800eva/0247-ARM-Update-mach-types.patch
deleted file mode 100644
index e1a51778c35bd7..00000000000000
--- a/patches.armadillo800eva/0247-ARM-Update-mach-types.patch
+++ /dev/null
@@ -1,828 +0,0 @@
-From f334a3eb18b1b4a67b78d645fda928fdb805f7bf Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Tue, 6 Dec 2011 11:07:38 +0000
-Subject: ARM: Update mach-types
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit a3c2b511a844641f6d0b60bd84cd6076143b3f2d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 709 ++++++++++++++++++++++++---------------------
- 1 file changed, 376 insertions(+), 333 deletions(-)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index 9e66ebc..f9c9f33 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -16,7 +16,7 @@
- # are merged into mainline or have been edited in the machine database
- # within the last 12 months. References to machine_is_NAME() do not count!
- #
--# Last update: Sat May 7 08:48:24 2011
-+# Last update: Tue Dec 6 11:07:38 2011
- #
- # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
- #
-@@ -321,7 +321,6 @@ lb88rc8480 MACH_LB88RC8480 LB88RC8480 1769
- mx25_3ds MACH_MX25_3DS MX25_3DS 1771
- omap3530_lv_som MACH_OMAP3530_LV_SOM OMAP3530_LV_SOM 1773
- davinci_da830_evm MACH_DAVINCI_DA830_EVM DAVINCI_DA830_EVM 1781
--at572d940hfek MACH_AT572D940HFEB AT572D940HFEB 1783
- dove_db MACH_DOVE_DB DOVE_DB 1788
- overo MACH_OVERO OVERO 1798
- at2440evb MACH_AT2440EVB AT2440EVB 1799
-@@ -491,380 +490,53 @@ eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821
- eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
- eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
- smdkc210 MACH_SMDKC210 SMDKC210 2838
--omap3_braillo MACH_OMAP3_BRAILLO OMAP3_BRAILLO 2839
--spyplug MACH_SPYPLUG SPYPLUG 2840
--ginger MACH_GINGER GINGER 2841
--tny_t3530 MACH_TNY_T3530 TNY_T3530 2842
- pca102 MACH_PCA102 PCA102 2843
--spade MACH_SPADE SPADE 2844
--mxc25_topaz MACH_MXC25_TOPAZ MXC25_TOPAZ 2845
- t5325 MACH_T5325 T5325 2846
--gw2361 MACH_GW2361 GW2361 2847
--elog MACH_ELOG ELOG 2848
- income MACH_INCOME INCOME 2849
--bcm589x MACH_BCM589X BCM589X 2850
--etna MACH_ETNA ETNA 2851
--hawks MACH_HAWKS HAWKS 2852
--meson MACH_MESON MESON 2853
--xsbase255 MACH_XSBASE255 XSBASE255 2854
--pvm2030 MACH_PVM2030 PVM2030 2855
--mioa502 MACH_MIOA502 MIOA502 2856
- vvbox_sdorig2 MACH_VVBOX_SDORIG2 VVBOX_SDORIG2 2857
- vvbox_sdlite2 MACH_VVBOX_SDLITE2 VVBOX_SDLITE2 2858
- vvbox_sdpro4 MACH_VVBOX_SDPRO4 VVBOX_SDPRO4 2859
--htc_spv_m700 MACH_HTC_SPV_M700 HTC_SPV_M700 2860
- mx257sx MACH_MX257SX MX257SX 2861
- goni MACH_GONI GONI 2862
--msm8x55_svlte_ffa MACH_MSM8X55_SVLTE_FFA MSM8X55_SVLTE_FFA 2863
--msm8x55_svlte_surf MACH_MSM8X55_SVLTE_SURF MSM8X55_SVLTE_SURF 2864
--quickstep MACH_QUICKSTEP QUICKSTEP 2865
--dmw96 MACH_DMW96 DMW96 2866
--hammerhead MACH_HAMMERHEAD HAMMERHEAD 2867
--trident MACH_TRIDENT TRIDENT 2868
--lightning MACH_LIGHTNING LIGHTNING 2869
--iconnect MACH_ICONNECT ICONNECT 2870
--autobot MACH_AUTOBOT AUTOBOT 2871
--coconut MACH_COCONUT COCONUT 2872
--durian MACH_DURIAN DURIAN 2873
--cayenne MACH_CAYENNE CAYENNE 2874
--fuji MACH_FUJI FUJI 2875
--synology_6282 MACH_SYNOLOGY_6282 SYNOLOGY_6282 2876
--em1sy MACH_EM1SY EM1SY 2877
--m502 MACH_M502 M502 2878
--matrix518 MACH_MATRIX518 MATRIX518 2879
--tiny_gurnard MACH_TINY_GURNARD TINY_GURNARD 2880
--spear1310 MACH_SPEAR1310 SPEAR1310 2881
- bv07 MACH_BV07 BV07 2882
--mxt_td61 MACH_MXT_TD61 MXT_TD61 2883
- openrd_ultimate MACH_OPENRD_ULTIMATE OPENRD_ULTIMATE 2884
- devixp MACH_DEVIXP DEVIXP 2885
- miccpt MACH_MICCPT MICCPT 2886
- mic256 MACH_MIC256 MIC256 2887
--as1167 MACH_AS1167 AS1167 2888
--omap3_ibiza MACH_OMAP3_IBIZA OMAP3_IBIZA 2889
- u5500 MACH_U5500 U5500 2890
--davinci_picto MACH_DAVINCI_PICTO DAVINCI_PICTO 2891
--mecha MACH_MECHA MECHA 2892
--bubba3 MACH_BUBBA3 BUBBA3 2893
--pupitre MACH_PUPITRE PUPITRE 2894
--tegra_vogue MACH_TEGRA_VOGUE TEGRA_VOGUE 2896
--tegra_e1165 MACH_TEGRA_E1165 TEGRA_E1165 2897
--simplenet MACH_SIMPLENET SIMPLENET 2898
--ec4350tbm MACH_EC4350TBM EC4350TBM 2899
--pec_tc MACH_PEC_TC PEC_TC 2900
--pec_hc2 MACH_PEC_HC2 PEC_HC2 2901
--esl_mobilis_a MACH_ESL_MOBILIS_A ESL_MOBILIS_A 2902
--esl_mobilis_b MACH_ESL_MOBILIS_B ESL_MOBILIS_B 2903
--esl_wave_a MACH_ESL_WAVE_A ESL_WAVE_A 2904
--esl_wave_b MACH_ESL_WAVE_B ESL_WAVE_B 2905
--unisense_mmm MACH_UNISENSE_MMM UNISENSE_MMM 2906
--blueshark MACH_BLUESHARK BLUESHARK 2907
--e10 MACH_E10 E10 2908
--app3k_robin MACH_APP3K_ROBIN APP3K_ROBIN 2909
--pov15hd MACH_POV15HD POV15HD 2910
--stella MACH_STELLA STELLA 2911
- linkstation_lschl MACH_LINKSTATION_LSCHL LINKSTATION_LSCHL 2913
--netwalker MACH_NETWALKER NETWALKER 2914
--acsx106 MACH_ACSX106 ACSX106 2915
--atlas5_c1 MACH_ATLAS5_C1 ATLAS5_C1 2916
--nsb3ast MACH_NSB3AST NSB3AST 2917
--gnet_slc MACH_GNET_SLC GNET_SLC 2918
--af4000 MACH_AF4000 AF4000 2919
--ark9431 MACH_ARK9431 ARK9431 2920
--fs_s5pc100 MACH_FS_S5PC100 FS_S5PC100 2921
--omap3505nova8 MACH_OMAP3505NOVA8 OMAP3505NOVA8 2922
--omap3621_edp1 MACH_OMAP3621_EDP1 OMAP3621_EDP1 2923
--oratisaes MACH_ORATISAES ORATISAES 2924
- smdkv310 MACH_SMDKV310 SMDKV310 2925
--siemens_l0 MACH_SIEMENS_L0 SIEMENS_L0 2926
--ventana MACH_VENTANA VENTANA 2927
- wm8505_7in_netbook MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK 2928
--ec4350sdb MACH_EC4350SDB EC4350SDB 2929
--mimas MACH_MIMAS MIMAS 2930
--titan MACH_TITAN TITAN 2931
- craneboard MACH_CRANEBOARD CRANEBOARD 2932
--es2440 MACH_ES2440 ES2440 2933
--najay_a9263 MACH_NAJAY_A9263 NAJAY_A9263 2934
--htctornado MACH_HTCTORNADO HTCTORNADO 2935
--dimm_mx257 MACH_DIMM_MX257 DIMM_MX257 2936
--jigen301 MACH_JIGEN JIGEN 2937
- smdk6450 MACH_SMDK6450 SMDK6450 2938
--meno_qng MACH_MENO_QNG MENO_QNG 2939
--ns2416 MACH_NS2416 NS2416 2940
--rpc353 MACH_RPC353 RPC353 2941
--tq6410 MACH_TQ6410 TQ6410 2942
--sky6410 MACH_SKY6410 SKY6410 2943
--dynasty MACH_DYNASTY DYNASTY 2944
--vivo MACH_VIVO VIVO 2945
--bury_bl7582 MACH_BURY_BL7582 BURY_BL7582 2946
--bury_bps5270 MACH_BURY_BPS5270 BURY_BPS5270 2947
--basi MACH_BASI BASI 2948
--tn200 MACH_TN200 TN200 2949
--c2mmi MACH_C2MMI C2MMI 2950
--meson_6236m MACH_MESON_6236M MESON_6236M 2951
--meson_8626m MACH_MESON_8626M MESON_8626M 2952
--tube MACH_TUBE TUBE 2953
--messina MACH_MESSINA MESSINA 2954
--mx50_arm2 MACH_MX50_ARM2 MX50_ARM2 2955
--cetus9263 MACH_CETUS9263 CETUS9263 2956
- brownstone MACH_BROWNSTONE BROWNSTONE 2957
--vmx25 MACH_VMX25 VMX25 2958
--vmx51 MACH_VMX51 VMX51 2959
--abacus MACH_ABACUS ABACUS 2960
--cm4745 MACH_CM4745 CM4745 2961
--oratislink MACH_ORATISLINK ORATISLINK 2962
--davinci_dm365_dvr MACH_DAVINCI_DM365_DVR DAVINCI_DM365_DVR 2963
--netviz MACH_NETVIZ NETVIZ 2964
- flexibity MACH_FLEXIBITY FLEXIBITY 2965
--wlan_computer MACH_WLAN_COMPUTER WLAN_COMPUTER 2966
--lpc24xx MACH_LPC24XX LPC24XX 2967
--spica MACH_SPICA SPICA 2968
--gpsdisplay MACH_GPSDISPLAY GPSDISPLAY 2969
--bipnet MACH_BIPNET BIPNET 2970
--overo_ctu_inertial MACH_OVERO_CTU_INERTIAL OVERO_CTU_INERTIAL 2971
--davinci_dm355_mmm MACH_DAVINCI_DM355_MMM DAVINCI_DM355_MMM 2972
--pc9260_v2 MACH_PC9260_V2 PC9260_V2 2973
--ptx7545 MACH_PTX7545 PTX7545 2974
--tm_efdc MACH_TM_EFDC TM_EFDC 2975
--omap3_waldo1 MACH_OMAP3_WALDO1 OMAP3_WALDO1 2977
--flyer MACH_FLYER FLYER 2978
--tornado3240 MACH_TORNADO3240 TORNADO3240 2979
--soli_01 MACH_SOLI_01 SOLI_01 2980
--omapl138_europalc MACH_OMAPL138_EUROPALC OMAPL138_EUROPALC 2981
--helios_v1 MACH_HELIOS_V1 HELIOS_V1 2982
--netspace_lite_v2 MACH_NETSPACE_LITE_V2 NETSPACE_LITE_V2 2983
--ssc MACH_SSC SSC 2984
--premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985
--wasabi MACH_WASABI WASABI 2986
- mx50_rdp MACH_MX50_RDP MX50_RDP 2988
- universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989
- real6410 MACH_REAL6410 REAL6410 2990
--spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991
--ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992
--omap3_bc10 MACH_OMAP3_BC10 OMAP3_BC10 2993
--thebe MACH_THEBE THEBE 2994
--rv082 MACH_RV082 RV082 2995
--armlguest MACH_ARMLGUEST ARMLGUEST 2996
--tjinc1000 MACH_TJINC1000 TJINC1000 2997
- dockstar MACH_DOCKSTAR DOCKSTAR 2998
--ax8008 MACH_AX8008 AX8008 2999
--gnet_sgce MACH_GNET_SGCE GNET_SGCE 3000
--pxwnas_500_1000 MACH_PXWNAS_500_1000 PXWNAS_500_1000 3001
--ea20 MACH_EA20 EA20 3002
--awm2 MACH_AWM2 AWM2 3003
- ti8148evm MACH_TI8148EVM TI8148EVM 3004
- seaboard MACH_SEABOARD SEABOARD 3005
--linkstation_chlv2 MACH_LINKSTATION_CHLV2 LINKSTATION_CHLV2 3006
--tera_pro2_rack MACH_TERA_PRO2_RACK TERA_PRO2_RACK 3007
--rubys MACH_RUBYS RUBYS 3008
--aquarius MACH_AQUARIUS AQUARIUS 3009
- mx53_ard MACH_MX53_ARD MX53_ARD 3010
- mx53_smd MACH_MX53_SMD MX53_SMD 3011
--lswxl MACH_LSWXL LSWXL 3012
--dove_avng_v3 MACH_DOVE_AVNG_V3 DOVE_AVNG_V3 3013
--sdi_ess_9263 MACH_SDI_ESS_9263 SDI_ESS_9263 3014
--jocpu550 MACH_JOCPU550 JOCPU550 3015
- msm8x60_rumi3 MACH_MSM8X60_RUMI3 MSM8X60_RUMI3 3016
- msm8x60_ffa MACH_MSM8X60_FFA MSM8X60_FFA 3017
--yanomami MACH_YANOMAMI YANOMAMI 3018
--gta04 MACH_GTA04 GTA04 3019
- cm_a510 MACH_CM_A510 CM_A510 3020
--omap3_rfs200 MACH_OMAP3_RFS200 OMAP3_RFS200 3021
--kx33xx MACH_KX33XX KX33XX 3022
--ptx7510 MACH_PTX7510 PTX7510 3023
--top9000 MACH_TOP9000 TOP9000 3024
--teenote MACH_TEENOTE TEENOTE 3025
--ts3 MACH_TS3 TS3 3026
--a0 MACH_A0 A0 3027
--fsm9xxx_surf MACH_FSM9XXX_SURF FSM9XXX_SURF 3028
--fsm9xxx_ffa MACH_FSM9XXX_FFA FSM9XXX_FFA 3029
--frrhwcdma60w MACH_FRRHWCDMA60W FRRHWCDMA60W 3030
--remus MACH_REMUS REMUS 3031
--at91cap7xdk MACH_AT91CAP7XDK AT91CAP7XDK 3032
--at91cap7stk MACH_AT91CAP7STK AT91CAP7STK 3033
--kt_sbc_sam9_1 MACH_KT_SBC_SAM9_1 KT_SBC_SAM9_1 3034
--armada_xp_db MACH_ARMADA_XP_DB ARMADA_XP_DB 3036
--spdm MACH_SPDM SPDM 3037
--gtib MACH_GTIB GTIB 3038
--dgm3240 MACH_DGM3240 DGM3240 3039
--htcmega MACH_HTCMEGA HTCMEGA 3041
--tricorder MACH_TRICORDER TRICORDER 3042
- tx28 MACH_TX28 TX28 3043
--bstbrd MACH_BSTBRD BSTBRD 3044
--pwb3090 MACH_PWB3090 PWB3090 3045
--idea6410 MACH_IDEA6410 IDEA6410 3046
--qbc9263 MACH_QBC9263 QBC9263 3047
--borabora MACH_BORABORA BORABORA 3048
--valdez MACH_VALDEZ VALDEZ 3049
--ls9g20 MACH_LS9G20 LS9G20 3050
--mios_v1 MACH_MIOS_V1 MIOS_V1 3051
--s5pc110_crespo MACH_S5PC110_CRESPO S5PC110_CRESPO 3052
--controltek9g20 MACH_CONTROLTEK9G20 CONTROLTEK9G20 3053
--tin307 MACH_TIN307 TIN307 3054
--tin510 MACH_TIN510 TIN510 3055
--bluecheese MACH_BLUECHEESE BLUECHEESE 3057
--tem3x30 MACH_TEM3X30 TEM3X30 3058
--harvest_desoto MACH_HARVEST_DESOTO HARVEST_DESOTO 3059
--msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060
--spear900 MACH_SPEAR900 SPEAR900 3061
- pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062
--rdstor MACH_RDSTOR RDSTOR 3063
--usdloader MACH_USDLOADER USDLOADER 3064
--tsoploader MACH_TSOPLOADER TSOPLOADER 3065
--kronos MACH_KRONOS KRONOS 3066
--ffcore MACH_FFCORE FFCORE 3067
--mone MACH_MONE MONE 3068
--unit2s MACH_UNIT2S UNIT2S 3069
--acer_a5 MACH_ACER_A5 ACER_A5 3070
--etherpro_isp MACH_ETHERPRO_ISP ETHERPRO_ISP 3071
--stretchs7000 MACH_STRETCHS7000 STRETCHS7000 3072
--p87_smartsim MACH_P87_SMARTSIM P87_SMARTSIM 3073
--tulip MACH_TULIP TULIP 3074
--sunflower MACH_SUNFLOWER SUNFLOWER 3075
--rib MACH_RIB RIB 3076
--clod MACH_CLOD CLOD 3077
--rump MACH_RUMP RUMP 3078
--tenderloin MACH_TENDERLOIN TENDERLOIN 3079
--shortloin MACH_SHORTLOIN SHORTLOIN 3080
--antares MACH_ANTARES ANTARES 3082
--wb40n MACH_WB40N WB40N 3083
--herring MACH_HERRING HERRING 3084
--naxy400 MACH_NAXY400 NAXY400 3085
--naxy1200 MACH_NAXY1200 NAXY1200 3086
- vpr200 MACH_VPR200 VPR200 3087
--bug20 MACH_BUG20 BUG20 3088
--goflexnet MACH_GOFLEXNET GOFLEXNET 3089
- torbreck MACH_TORBRECK TORBRECK 3090
--saarb_mg1 MACH_SAARB_MG1 SAARB_MG1 3091
--callisto MACH_CALLISTO CALLISTO 3092
--multhsu MACH_MULTHSU MULTHSU 3093
--saluda MACH_SALUDA SALUDA 3094
--pemp_omap3_apollo MACH_PEMP_OMAP3_APOLLO PEMP_OMAP3_APOLLO 3095
--vc0718 MACH_VC0718 VC0718 3096
--mvblx MACH_MVBLX MVBLX 3097
--inhand_apeiron MACH_INHAND_APEIRON INHAND_APEIRON 3098
--inhand_fury MACH_INHAND_FURY INHAND_FURY 3099
--inhand_siren MACH_INHAND_SIREN INHAND_SIREN 3100
--hdnvp MACH_HDNVP HDNVP 3101
--softwinner MACH_SOFTWINNER SOFTWINNER 3102
- prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
--nas6210 MACH_NAS6210 NAS6210 3104
--unisdev MACH_UNISDEV UNISDEV 3105
--sbca11 MACH_SBCA11 SBCA11 3106
--saga MACH_SAGA SAGA 3107
--ns_k330 MACH_NS_K330 NS_K330 3108
--tanna MACH_TANNA TANNA 3109
--imate8502 MACH_IMATE8502 IMATE8502 3110
--aspen MACH_ASPEN ASPEN 3111
--daintree_cwac MACH_DAINTREE_CWAC DAINTREE_CWAC 3112
--zmx25 MACH_ZMX25 ZMX25 3113
--maple1 MACH_MAPLE1 MAPLE1 3114
--qsd8x72_surf MACH_QSD8X72_SURF QSD8X72_SURF 3115
--qsd8x72_ffa MACH_QSD8X72_FFA QSD8X72_FFA 3116
--abilene MACH_ABILENE ABILENE 3117
--eigen_ttr MACH_EIGEN_TTR EIGEN_TTR 3118
--iomega_ix2_200 MACH_IOMEGA_IX2_200 IOMEGA_IX2_200 3119
--coretec_vcx7400 MACH_CORETEC_VCX7400 CORETEC_VCX7400 3120
--santiago MACH_SANTIAGO SANTIAGO 3121
--mx257sol MACH_MX257SOL MX257SOL 3122
--strasbourg MACH_STRASBOURG STRASBOURG 3123
--msm8x60_fluid MACH_MSM8X60_FLUID MSM8X60_FLUID 3124
--smartqv5 MACH_SMARTQV5 SMARTQV5 3125
--smartqv3 MACH_SMARTQV3 SMARTQV3 3126
--smartqv7 MACH_SMARTQV7 SMARTQV7 3127
- paz00 MACH_PAZ00 PAZ00 3128
- acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
--fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131
--hdgu MACH_HDGU HDGU 3132
--pyramid MACH_PYRAMID PYRAMID 3133
--epiphan MACH_EPIPHAN EPIPHAN 3134
--omap_bender MACH_OMAP_BENDER OMAP_BENDER 3135
--gurnard MACH_GURNARD GURNARD 3136
--gtl_it5100 MACH_GTL_IT5100 GTL_IT5100 3137
--bcm2708 MACH_BCM2708 BCM2708 3138
--mx51_ggc MACH_MX51_GGC MX51_GGC 3139
--sharespace MACH_SHARESPACE SHARESPACE 3140
--haba_knx_explorer MACH_HABA_KNX_EXPLORER HABA_KNX_EXPLORER 3141
--simtec_kirkmod MACH_SIMTEC_KIRKMOD SIMTEC_KIRKMOD 3142
--crux MACH_CRUX CRUX 3143
--mx51_bravo MACH_MX51_BRAVO MX51_BRAVO 3144
--charon MACH_CHARON CHARON 3145
--picocom3 MACH_PICOCOM3 PICOCOM3 3146
--picocom4 MACH_PICOCOM4 PICOCOM4 3147
--serrano MACH_SERRANO SERRANO 3148
--doubleshot MACH_DOUBLESHOT DOUBLESHOT 3149
--evsy MACH_EVSY EVSY 3150
--huashan MACH_HUASHAN HUASHAN 3151
--lausanne MACH_LAUSANNE LAUSANNE 3152
--emerald MACH_EMERALD EMERALD 3153
--tqma35 MACH_TQMA35 TQMA35 3154
--marvel MACH_MARVEL MARVEL 3155
--manuae MACH_MANUAE MANUAE 3156
--chacha MACH_CHACHA CHACHA 3157
--lemon MACH_LEMON LEMON 3158
--csc MACH_CSC CSC 3159
--gira_knxip_router MACH_GIRA_KNXIP_ROUTER GIRA_KNXIP_ROUTER 3160
--t20 MACH_T20 T20 3161
--hdmini MACH_HDMINI HDMINI 3162
--sciphone_g2 MACH_SCIPHONE_G2 SCIPHONE_G2 3163
--express MACH_EXPRESS EXPRESS 3164
--express_kt MACH_EXPRESS_KT EXPRESS_KT 3165
--maximasp MACH_MAXIMASP MAXIMASP 3166
--nitrogen_imx51 MACH_NITROGEN_IMX51 NITROGEN_IMX51 3167
--nitrogen_imx53 MACH_NITROGEN_IMX53 NITROGEN_IMX53 3168
--sunfire MACH_SUNFIRE SUNFIRE 3169
--arowana MACH_AROWANA AROWANA 3170
--tegra_daytona MACH_TEGRA_DAYTONA TEGRA_DAYTONA 3171
--tegra_swordfish MACH_TEGRA_SWORDFISH TEGRA_SWORDFISH 3172
--edison MACH_EDISON EDISON 3173
--svp8500v1 MACH_SVP8500V1 SVP8500V1 3174
--svp8500v2 MACH_SVP8500V2 SVP8500V2 3175
--svp5500 MACH_SVP5500 SVP5500 3176
--b5500 MACH_B5500 B5500 3177
--s5500 MACH_S5500 S5500 3178
--icon MACH_ICON ICON 3179
--elephant MACH_ELEPHANT ELEPHANT 3180
--shooter MACH_SHOOTER SHOOTER 3182
--spade_lte MACH_SPADE_LTE SPADE_LTE 3183
--philhwani MACH_PHILHWANI PHILHWANI 3184
--gsncomm MACH_GSNCOMM GSNCOMM 3185
--strasbourg_a2 MACH_STRASBOURG_A2 STRASBOURG_A2 3186
--mmm MACH_MMM MMM 3187
--davinci_dm365_bv MACH_DAVINCI_DM365_BV DAVINCI_DM365_BV 3188
- ag5evm MACH_AG5EVM AG5EVM 3189
--sc575plc MACH_SC575PLC SC575PLC 3190
--sc575hmi MACH_SC575IPC SC575IPC 3191
--omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192
--top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194
--top9000_su MACH_TOP9000_SU TOP9000_SU 3195
--utm300 MACH_UTM300 UTM300 3196
- tsunagi MACH_TSUNAGI TSUNAGI 3197
--ts75xx MACH_TS75XX TS75XX 3198
--ts47xx MACH_TS47XX TS47XX 3200
--da850_k5 MACH_DA850_K5 DA850_K5 3201
--ax502 MACH_AX502 AX502 3202
--igep0032 MACH_IGEP0032 IGEP0032 3203
--antero MACH_ANTERO ANTERO 3204
--synergy MACH_SYNERGY SYNERGY 3205
- ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206
- wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207
--punica MACH_PUNICA PUNICA 3208
- trimslice MACH_TRIMSLICE TRIMSLICE 3209
--mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210
- mackerel MACH_MACKEREL MACKEREL 3211
--fa9x27 MACH_FA9X27 FA9X27 3213
--ns2816tb MACH_NS2816TB NS2816TB 3214
--ns2816_ntpad MACH_NS2816_NTPAD NS2816_NTPAD 3215
--ns2816_ntnb MACH_NS2816_NTNB NS2816_NTNB 3216
- kaen MACH_KAEN KAEN 3217
--nv1000 MACH_NV1000 NV1000 3218
--nuc950ts MACH_NUC950TS NUC950TS 3219
- nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220
--ast2200 MACH_AST2200 AST2200 3221
--lead MACH_LEAD LEAD 3222
--unino1 MACH_UNINO1 UNINO1 3223
--greeco MACH_GREECO GREECO 3224
--verdi MACH_VERDI VERDI 3225
- dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226
- quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227
- abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228
-@@ -949,13 +621,11 @@ koi MACH_KOI KOI 3312
- ts4800 MACH_TS4800 TS4800 3313
- tqma9263 MACH_TQMA9263 TQMA9263 3314
- holiday MACH_HOLIDAY HOLIDAY 3315
--dma_6410 MACH_DMA6410 DMA6410 3316
- pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317
- hwgw6410 MACH_HWGW6410 HWGW6410 3318
- shenzhou MACH_SHENZHOU SHENZHOU 3319
- cwme9210 MACH_CWME9210 CWME9210 3320
- cwme9210js MACH_CWME9210JS CWME9210JS 3321
--pgs_v1 MACH_PGS_SITARA PGS_SITARA 3322
- colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323
- w21 MACH_W21 W21 3324
- polysat1 MACH_POLYSAT1 POLYSAT1 3325
-@@ -1021,13 +691,11 @@ viprinet MACH_VIPRINET VIPRINET 3385
- bockw MACH_BOCKW BOCKW 3386
- eva2000 MACH_EVA2000 EVA2000 3387
- steelyard MACH_STEELYARD STEELYARD 3388
--sdh001 MACH_MACH_SDH001 MACH_SDH001 3390
- nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392
- geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393
- spear1340 MACH_SPEAR1340 SPEAR1340 3394
- rexmas MACH_REXMAS REXMAS 3395
- msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396
--msm8960_mdp MACH_MSM8960_MDP MSM8960_MDP 3397
- msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398
- msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399
- helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400
-@@ -1123,6 +791,381 @@ blissc MACH_BLISSC BLISSC 3491
- thales_adc MACH_THALES_ADC THALES_ADC 3492
- ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493
- atdgp318 MACH_ATDGP318 ATDGP318 3494
-+dma210u MACH_DMA210U DMA210U 3495
-+em_t3 MACH_EM_T3 EM_T3 3496
-+htx3250 MACH_HTX3250 HTX3250 3497
-+g50 MACH_G50 G50 3498
-+eco5 MACH_ECO5 ECO5 3499
-+wintergrasp MACH_WINTERGRASP WINTERGRASP 3500
-+puro MACH_PURO PURO 3501
-+shooter_k MACH_SHOOTER_K SHOOTER_K 3502
-+nspire MACH_NSPIRE NSPIRE 3503
-+mickxx MACH_MICKXX MICKXX 3504
-+lxmb MACH_LXMB LXMB 3505
-+adam MACH_ADAM ADAM 3507
-+b1004 MACH_B1004 B1004 3508
-+oboea MACH_OBOEA OBOEA 3509
-+a1015 MACH_A1015 A1015 3510
-+robin_vbdt30 MACH_ROBIN_VBDT30 ROBIN_VBDT30 3511
-+tegra_enterprise MACH_TEGRA_ENTERPRISE TEGRA_ENTERPRISE 3512
-+rfl108200_mk10 MACH_RFL108200_MK10 RFL108200_MK10 3513
-+rfl108300_mk16 MACH_RFL108300_MK16 RFL108300_MK16 3514
-+rover_v7 MACH_ROVER_V7 ROVER_V7 3515
-+miphone MACH_MIPHONE MIPHONE 3516
-+femtobts MACH_FEMTOBTS FEMTOBTS 3517
-+monopoli MACH_MONOPOLI MONOPOLI 3518
-+boss MACH_BOSS BOSS 3519
-+davinci_dm368_vtam MACH_DAVINCI_DM368_VTAM DAVINCI_DM368_VTAM 3520
-+clcon MACH_CLCON CLCON 3521
-+nokia_rm696 MACH_NOKIA_RM696 NOKIA_RM696 3522
-+tahiti MACH_TAHITI TAHITI 3523
-+fighter MACH_FIGHTER FIGHTER 3524
-+sgh_i710 MACH_SGH_I710 SGH_I710 3525
-+integreproscb MACH_INTEGREPROSCB INTEGREPROSCB 3526
-+monza MACH_MONZA MONZA 3527
-+calimain MACH_CALIMAIN CALIMAIN 3528
-+mx6q_sabreauto MACH_MX6Q_SABREAUTO MX6Q_SABREAUTO 3529
-+gma01x MACH_GMA01X GMA01X 3530
-+sbc51 MACH_SBC51 SBC51 3531
-+fit MACH_FIT FIT 3532
-+steelhead MACH_STEELHEAD STEELHEAD 3533
-+panther MACH_PANTHER PANTHER 3534
-+msm8960_liquid MACH_MSM8960_LIQUID MSM8960_LIQUID 3535
-+lexikonct MACH_LEXIKONCT LEXIKONCT 3536
-+ns2816_stb MACH_NS2816_STB NS2816_STB 3537
-+sei_mm2_lpc3250 MACH_SEI_MM2_LPC3250 SEI_MM2_LPC3250 3538
-+cmimx53 MACH_CMIMX53 CMIMX53 3539
-+sandwich MACH_SANDWICH SANDWICH 3540
-+chief MACH_CHIEF CHIEF 3541
-+pogo_e02 MACH_POGO_E02 POGO_E02 3542
-+mikrap_x168 MACH_MIKRAP_X168 MIKRAP_X168 3543
-+htcmozart MACH_HTCMOZART HTCMOZART 3544
-+htcgold MACH_HTCGOLD HTCGOLD 3545
-+mt72xx MACH_MT72XX MT72XX 3546
-+mx51_ivy MACH_MX51_IVY MX51_IVY 3547
-+mx51_lvd MACH_MX51_LVD MX51_LVD 3548
-+omap3_wiser2 MACH_OMAP3_WISER2 OMAP3_WISER2 3549
-+dreamplug MACH_DREAMPLUG DREAMPLUG 3550
-+cobas_c_111 MACH_COBAS_C_111 COBAS_C_111 3551
-+cobas_u_411 MACH_COBAS_U_411 COBAS_U_411 3552
-+hssd MACH_HSSD HSSD 3553
-+iom35x MACH_IOM35X IOM35X 3554
-+psom_omap MACH_PSOM_OMAP PSOM_OMAP 3555
-+iphone_2g MACH_IPHONE_2G IPHONE_2G 3556
-+iphone_3g MACH_IPHONE_3G IPHONE_3G 3557
-+ipod_touch_1g MACH_IPOD_TOUCH_1G IPOD_TOUCH_1G 3558
-+pharos_tpc MACH_PHAROS_TPC PHAROS_TPC 3559
-+mx53_hydra MACH_MX53_HYDRA MX53_HYDRA 3560
-+ns2816_dev_board MACH_NS2816_DEV_BOARD NS2816_DEV_BOARD 3561
-+iphone_3gs MACH_IPHONE_3GS IPHONE_3GS 3562
-+iphone_4 MACH_IPHONE_4 IPHONE_4 3563
-+ipod_touch_4g MACH_IPOD_TOUCH_4G IPOD_TOUCH_4G 3564
-+dragon_e1100 MACH_DRAGON_E1100 DRAGON_E1100 3565
-+topside MACH_TOPSIDE TOPSIDE 3566
-+irisiii MACH_IRISIII IRISIII 3567
-+deto_macarm9 MACH_DETO_MACARM9 DETO_MACARM9 3568
-+eti_d1 MACH_ETI_D1 ETI_D1 3569
-+som3530sdk MACH_SOM3530SDK SOM3530SDK 3570
-+oc_engine MACH_OC_ENGINE OC_ENGINE 3571
-+apq8064_sim MACH_APQ8064_SIM APQ8064_SIM 3572
-+alps MACH_ALPS ALPS 3575
-+tny_t3730 MACH_TNY_T3730 TNY_T3730 3576
-+geryon_nfe MACH_GERYON_NFE GERYON_NFE 3577
-+ns2816_ref_board MACH_NS2816_REF_BOARD NS2816_REF_BOARD 3578
-+silverstone MACH_SILVERSTONE SILVERSTONE 3579
-+mtt2440 MACH_MTT2440 MTT2440 3580
-+ynicdb MACH_YNICDB YNICDB 3581
-+bct MACH_BCT BCT 3582
-+tuscan MACH_TUSCAN TUSCAN 3583
-+xbt_sam9g45 MACH_XBT_SAM9G45 XBT_SAM9G45 3584
-+enbw_cmc MACH_ENBW_CMC ENBW_CMC 3585
-+ch104mx257 MACH_CH104MX257 CH104MX257 3587
-+openpri MACH_OPENPRI OPENPRI 3588
-+am335xevm MACH_AM335XEVM AM335XEVM 3589
-+picodmb MACH_PICODMB PICODMB 3590
-+waluigi MACH_WALUIGI WALUIGI 3591
-+punicag7 MACH_PUNICAG7 PUNICAG7 3592
-+ipad_1g MACH_IPAD_1G IPAD_1G 3593
-+appletv_2g MACH_APPLETV_2G APPLETV_2G 3594
-+mach_ecog45 MACH_MACH_ECOG45 MACH_ECOG45 3595
-+ait_cam_enc_4xx MACH_AIT_CAM_ENC_4XX AIT_CAM_ENC_4XX 3596
-+runnymede MACH_RUNNYMEDE RUNNYMEDE 3597
-+play MACH_PLAY PLAY 3598
-+hw90260 MACH_HW90260 HW90260 3599
-+tagh MACH_TAGH TAGH 3600
-+filbert MACH_FILBERT FILBERT 3601
-+getinge_netcomv3 MACH_GETINGE_NETCOMV3 GETINGE_NETCOMV3 3602
-+cw20 MACH_CW20 CW20 3603
-+cinema MACH_CINEMA CINEMA 3604
-+cinema_tea MACH_CINEMA_TEA CINEMA_TEA 3605
-+cinema_coffee MACH_CINEMA_COFFEE CINEMA_COFFEE 3606
-+cinema_juice MACH_CINEMA_JUICE CINEMA_JUICE 3607
-+mx53_mirage2 MACH_MX53_MIRAGE2 MX53_MIRAGE2 3609
-+mx53_efikasb MACH_MX53_EFIKASB MX53_EFIKASB 3610
-+stm_b2000 MACH_STM_B2000 STM_B2000 3612
- m28evk MACH_M28EVK M28EVK 3613
-+pda MACH_PDA PDA 3614
-+meraki_mr58 MACH_MERAKI_MR58 MERAKI_MR58 3615
-+kota2 MACH_KOTA2 KOTA2 3616
-+letcool MACH_LETCOOL LETCOOL 3617
-+mx27iat MACH_MX27IAT MX27IAT 3618
-+apollo_td MACH_APOLLO_TD APOLLO_TD 3619
-+arena MACH_ARENA ARENA 3620
-+gsngateway MACH_GSNGATEWAY GSNGATEWAY 3621
-+lf2000 MACH_LF2000 LF2000 3622
-+bonito MACH_BONITO BONITO 3623
-+asymptote MACH_ASYMPTOTE ASYMPTOTE 3624
-+bst2brd MACH_BST2BRD BST2BRD 3625
-+tx335s MACH_TX335S TX335S 3626
-+pelco_tesla MACH_PELCO_TESLA PELCO_TESLA 3627
-+rrhtestplat MACH_RRHTESTPLAT RRHTESTPLAT 3628
-+vidtonic_pro MACH_VIDTONIC_PRO VIDTONIC_PRO 3629
-+pl_apollo MACH_PL_APOLLO PL_APOLLO 3630
-+pl_phoenix MACH_PL_PHOENIX PL_PHOENIX 3631
-+m28cu3 MACH_M28CU3 M28CU3 3632
-+vvbox_hd MACH_VVBOX_HD VVBOX_HD 3633
-+coreware_sam9260_ MACH_COREWARE_SAM9260_ COREWARE_SAM9260_ 3634
-+marmaduke MACH_MARMADUKE MARMADUKE 3635
-+amg_xlcore_camera MACH_AMG_XLCORE_CAMERA AMG_XLCORE_CAMERA 3636
-+omap3_egf MACH_OMAP3_EGF OMAP3_EGF 3637
- smdk4212 MACH_SMDK4212 SMDK4212 3638
-+dnp9200 MACH_DNP9200 DNP9200 3639
-+tf101 MACH_TF101 TF101 3640
-+omap3silvio MACH_OMAP3SILVIO OMAP3SILVIO 3641
-+picasso2 MACH_PICASSO2 PICASSO2 3642
-+vangogh2 MACH_VANGOGH2 VANGOGH2 3643
-+olpc_xo_1_75 MACH_OLPC_XO_1_75 OLPC_XO_1_75 3644
-+gx400 MACH_GX400 GX400 3645
-+gs300 MACH_GS300 GS300 3646
-+acer_a9 MACH_ACER_A9 ACER_A9 3647
-+vivow_evm MACH_VIVOW_EVM VIVOW_EVM 3648
-+veloce_cxq MACH_VELOCE_CXQ VELOCE_CXQ 3649
-+veloce_cxm MACH_VELOCE_CXM VELOCE_CXM 3650
-+p1852 MACH_P1852 P1852 3651
-+naxy100 MACH_NAXY100 NAXY100 3652
-+taishan MACH_TAISHAN TAISHAN 3653
-+touchlink MACH_TOUCHLINK TOUCHLINK 3654
-+stm32f103ze MACH_STM32F103ZE STM32F103ZE 3655
-+mcx MACH_MCX MCX 3656
-+stm_nmhdk_fli7610 MACH_STM_NMHDK_FLI7610 STM_NMHDK_FLI7610 3657
-+top28x MACH_TOP28X TOP28X 3658
-+okl4vp_microvisor MACH_OKL4VP_MICROVISOR OKL4VP_MICROVISOR 3659
-+pop MACH_POP POP 3660
-+layer MACH_LAYER LAYER 3661
-+trondheim MACH_TRONDHEIM TRONDHEIM 3662
-+eva MACH_EVA EVA 3663
-+trust_taurus MACH_TRUST_TAURUS TRUST_TAURUS 3664
-+ns2816_huashan MACH_NS2816_HUASHAN NS2816_HUASHAN 3665
-+ns2816_yangcheng MACH_NS2816_YANGCHENG NS2816_YANGCHENG 3666
-+p852 MACH_P852 P852 3667
-+flea3 MACH_FLEA3 FLEA3 3668
-+bowfin MACH_BOWFIN BOWFIN 3669
-+mv88de3100 MACH_MV88DE3100 MV88DE3100 3670
-+pia_am35x MACH_PIA_AM35X PIA_AM35X 3671
-+cedar MACH_CEDAR CEDAR 3672
-+picasso_e MACH_PICASSO_E PICASSO_E 3673
-+samsung_e60 MACH_SAMSUNG_E60 SAMSUNG_E60 3674
-+sdvr_mini MACH_SDVR_MINI SDVR_MINI 3676
-+omap3_ij3k MACH_OMAP3_IJ3K OMAP3_IJ3K 3677
-+modasmc1 MACH_MODASMC1 MODASMC1 3678
-+apq8064_rumi3 MACH_APQ8064_RUMI3 APQ8064_RUMI3 3679
-+matrix506 MACH_MATRIX506 MATRIX506 3680
-+msm9615_mtp MACH_MSM9615_MTP MSM9615_MTP 3681
-+dm36x_spawndc MACH_DM36X_SPAWNDC DM36X_SPAWNDC 3682
-+sff792 MACH_SFF792 SFF792 3683
-+am335xiaevm MACH_AM335XIAEVM AM335XIAEVM 3684
-+g3c2440 MACH_G3C2440 G3C2440 3685
-+tion270 MACH_TION270 TION270 3686
-+w22q7arm02 MACH_W22Q7ARM02 W22Q7ARM02 3687
-+omap_cat MACH_OMAP_CAT OMAP_CAT 3688
-+at91sam9n12ek MACH_AT91SAM9N12EK AT91SAM9N12EK 3689
-+morrison MACH_MORRISON MORRISON 3690
-+svdu MACH_SVDU SVDU 3691
-+lpp01 MACH_LPP01 LPP01 3692
-+ubc283 MACH_UBC283 UBC283 3693
-+zeppelin MACH_ZEPPELIN ZEPPELIN 3694
-+motus MACH_MOTUS MOTUS 3695
-+neomainboard MACH_NEOMAINBOARD NEOMAINBOARD 3696
-+devkit3250 MACH_DEVKIT3250 DEVKIT3250 3697
-+devkit7000 MACH_DEVKIT7000 DEVKIT7000 3698
-+fmc_uic MACH_FMC_UIC FMC_UIC 3699
-+fmc_dcm MACH_FMC_DCM FMC_DCM 3700
-+batwm MACH_BATWM BATWM 3701
-+atlas6cb MACH_ATLAS6CB ATLAS6CB 3702
-+blue MACH_BLUE BLUE 3705
-+colorado MACH_COLORADO COLORADO 3706
-+popc MACH_POPC POPC 3707
-+promwad_jade MACH_PROMWAD_JADE PROMWAD_JADE 3708
-+amp MACH_AMP AMP 3709
-+gnet_amp MACH_GNET_AMP GNET_AMP 3710
-+toques MACH_TOQUES TOQUES 3711
-+dct_storm MACH_DCT_STORM DCT_STORM 3713
-+owl MACH_OWL OWL 3715
-+cogent_csb1741 MACH_COGENT_CSB1741 COGENT_CSB1741 3716
-+adillustra610 MACH_ADILLUSTRA610 ADILLUSTRA610 3718
-+ecafe_na04 MACH_ECAFE_NA04 ECAFE_NA04 3719
-+popct MACH_POPCT POPCT 3720
-+omap3_helena MACH_OMAP3_HELENA OMAP3_HELENA 3721
-+ach MACH_ACH ACH 3722
-+module_dtb MACH_MODULE_DTB MODULE_DTB 3723
-+oslo_elisabeth MACH_OSLO_ELISABETH OSLO_ELISABETH 3725
-+tt01 MACH_TT01 TT01 3726
-+msm8930_cdp MACH_MSM8930_CDP MSM8930_CDP 3727
-+msm8930_mtp MACH_MSM8930_MTP MSM8930_MTP 3728
-+msm8930_fluid MACH_MSM8930_FLUID MSM8930_FLUID 3729
-+ltu11 MACH_LTU11 LTU11 3730
-+am1808_spawnco MACH_AM1808_SPAWNCO AM1808_SPAWNCO 3731
-+flx6410 MACH_FLX6410 FLX6410 3732
-+mx6q_qsb MACH_MX6Q_QSB MX6Q_QSB 3733
-+mx53_plt424 MACH_MX53_PLT424 MX53_PLT424 3734
-+jasmine MACH_JASMINE JASMINE 3735
-+l138_owlboard_plus MACH_L138_OWLBOARD_PLUS L138_OWLBOARD_PLUS 3736
-+wr21 MACH_WR21 WR21 3737
-+peaboy MACH_PEABOY PEABOY 3739
-+mx28_plato MACH_MX28_PLATO MX28_PLATO 3740
-+kacom2 MACH_KACOM2 KACOM2 3741
-+slco MACH_SLCO SLCO 3742
-+imx51pico MACH_IMX51PICO IMX51PICO 3743
-+glink1 MACH_GLINK1 GLINK1 3744
-+diamond MACH_DIAMOND DIAMOND 3745
-+d9000 MACH_D9000 D9000 3746
-+w5300e01 MACH_W5300E01 W5300E01 3747
-+im6000 MACH_IM6000 IM6000 3748
-+mx51_fred51 MACH_MX51_FRED51 MX51_FRED51 3749
-+stm32f2 MACH_STM32F2 STM32F2 3750
-+ville MACH_VILLE VILLE 3751
-+ptip_murnau MACH_PTIP_MURNAU PTIP_MURNAU 3752
-+ptip_classic MACH_PTIP_CLASSIC PTIP_CLASSIC 3753
-+mx53grb MACH_MX53GRB MX53GRB 3754
-+gagarin MACH_GAGARIN GAGARIN 3755
-+nas2big MACH_NAS2BIG NAS2BIG 3757
-+superfemto MACH_SUPERFEMTO SUPERFEMTO 3758
-+teufel MACH_TEUFEL TEUFEL 3759
-+dinara MACH_DINARA DINARA 3760
-+vanquish MACH_VANQUISH VANQUISH 3761
-+zipabox1 MACH_ZIPABOX1 ZIPABOX1 3762
-+u9540 MACH_U9540 U9540 3763
-+jet MACH_JET JET 3764
- smdk4412 MACH_SMDK4412 SMDK4412 3765
-+elite MACH_ELITE ELITE 3766
-+spear320_hmi MACH_SPEAR320_HMI SPEAR320_HMI 3767
-+ontario MACH_ONTARIO ONTARIO 3768
-+mx6q_sabrelite MACH_MX6Q_SABRELITE MX6Q_SABRELITE 3769
-+vc200 MACH_VC200 VC200 3770
-+msm7625a_ffa MACH_MSM7625A_FFA MSM7625A_FFA 3771
-+msm7625a_surf MACH_MSM7625A_SURF MSM7625A_SURF 3772
-+benthossbp MACH_BENTHOSSBP BENTHOSSBP 3773
-+smdk5210 MACH_SMDK5210 SMDK5210 3774
-+empq2300 MACH_EMPQ2300 EMPQ2300 3775
-+minipos MACH_MINIPOS MINIPOS 3776
-+omap5_sevm MACH_OMAP5_SEVM OMAP5_SEVM 3777
-+shelter MACH_SHELTER SHELTER 3778
-+omap3_devkit8500 MACH_OMAP3_DEVKIT8500 OMAP3_DEVKIT8500 3779
-+edgetd MACH_EDGETD EDGETD 3780
-+copperyard MACH_COPPERYARD COPPERYARD 3781
-+edge MACH_EDGE EDGE 3782
-+edge_u MACH_EDGE_U EDGE_U 3783
-+edge_td MACH_EDGE_TD EDGE_TD 3784
-+wdss MACH_WDSS WDSS 3785
-+dl_pb25 MACH_DL_PB25 DL_PB25 3786
-+dss11 MACH_DSS11 DSS11 3787
-+cpa MACH_CPA CPA 3788
-+aptp2000 MACH_APTP2000 APTP2000 3789
-+marzen MACH_MARZEN MARZEN 3790
-+st_turbine MACH_ST_TURBINE ST_TURBINE 3791
-+gtl_it3300 MACH_GTL_IT3300 GTL_IT3300 3792
-+mx6_mule MACH_MX6_MULE MX6_MULE 3793
-+v7pxa_dt MACH_V7PXA_DT V7PXA_DT 3794
-+v7mmp_dt MACH_V7MMP_DT V7MMP_DT 3795
-+dragon7 MACH_DRAGON7 DRAGON7 3796
-+krome MACH_KROME KROME 3797
-+oratisdante MACH_ORATISDANTE ORATISDANTE 3798
-+fathom MACH_FATHOM FATHOM 3799
-+dns325 MACH_DNS325 DNS325 3800
-+sarnen MACH_SARNEN SARNEN 3801
-+ubisys_g1 MACH_UBISYS_G1 UBISYS_G1 3802
-+mx53_pf1 MACH_MX53_PF1 MX53_PF1 3803
-+asanti MACH_ASANTI ASANTI 3804
-+volta MACH_VOLTA VOLTA 3805
-+knight MACH_KNIGHT KNIGHT 3807
-+beaglebone MACH_BEAGLEBONE BEAGLEBONE 3808
-+becker MACH_BECKER BECKER 3809
-+fc360 MACH_FC360 FC360 3810
-+pmi2_xls MACH_PMI2_XLS PMI2_XLS 3811
-+taranto MACH_TARANTO TARANTO 3812
-+plutux MACH_PLUTUX PLUTUX 3813
-+ipmp_medcom MACH_IPMP_MEDCOM IPMP_MEDCOM 3814
-+absolut MACH_ABSOLUT ABSOLUT 3815
-+awpb3 MACH_AWPB3 AWPB3 3816
-+nfp32xx_dt MACH_NFP32XX_DT NFP32XX_DT 3817
-+dl_pb53 MACH_DL_PB53 DL_PB53 3818
-+acu_ii MACH_ACU_II ACU_II 3819
-+avalon MACH_AVALON AVALON 3820
-+sphinx MACH_SPHINX SPHINX 3821
-+titan_t MACH_TITAN_T TITAN_T 3822
-+harvest_boris MACH_HARVEST_BORIS HARVEST_BORIS 3823
-+mach_msm7x30_m3s MACH_MACH_MSM7X30_M3S MACH_MSM7X30_M3S 3824
-+smdk5250 MACH_SMDK5250 SMDK5250 3825
-+imxt_lite MACH_IMXT_LITE IMXT_LITE 3826
-+imxt_std MACH_IMXT_STD IMXT_STD 3827
-+imxt_log MACH_IMXT_LOG IMXT_LOG 3828
-+imxt_nav MACH_IMXT_NAV IMXT_NAV 3829
-+imxt_full MACH_IMXT_FULL IMXT_FULL 3830
-+ag09015 MACH_AG09015 AG09015 3831
-+am3517_mt_ventoux MACH_AM3517_MT_VENTOUX AM3517_MT_VENTOUX 3832
-+dp1arm9 MACH_DP1ARM9 DP1ARM9 3833
-+picasso_m MACH_PICASSO_M PICASSO_M 3834
-+video_gadget MACH_VIDEO_GADGET VIDEO_GADGET 3835
-+mtt_om3x MACH_MTT_OM3X MTT_OM3X 3836
-+mx6q_arm2 MACH_MX6Q_ARM2 MX6Q_ARM2 3837
-+picosam9g45 MACH_PICOSAM9G45 PICOSAM9G45 3838
-+vpm_dm365 MACH_VPM_DM365 VPM_DM365 3839
-+bonfire MACH_BONFIRE BONFIRE 3840
-+mt2p2d MACH_MT2P2D MT2P2D 3841
-+sigpda01 MACH_SIGPDA01 SIGPDA01 3842
-+cn27 MACH_CN27 CN27 3843
-+mx25_cwtap MACH_MX25_CWTAP MX25_CWTAP 3844
-+apf28 MACH_APF28 APF28 3845
-+pelco_maxwell MACH_PELCO_MAXWELL PELCO_MAXWELL 3846
-+ge_phoenix MACH_GE_PHOENIX GE_PHOENIX 3847
-+empc_a500 MACH_EMPC_A500 EMPC_A500 3848
-+ims_arm9 MACH_IMS_ARM9 IMS_ARM9 3849
-+mini2416 MACH_MINI2416 MINI2416 3850
-+mini2450 MACH_MINI2450 MINI2450 3851
-+mini310 MACH_MINI310 MINI310 3852
-+spear_hurricane MACH_SPEAR_HURRICANE SPEAR_HURRICANE 3853
-+mt7208 MACH_MT7208 MT7208 3854
-+lpc178x MACH_LPC178X LPC178X 3855
-+farleys MACH_FARLEYS FARLEYS 3856
-+efm32gg_dk3750 MACH_EFM32GG_DK3750 EFM32GG_DK3750 3857
-+zeus_board MACH_ZEUS_BOARD ZEUS_BOARD 3858
-+cc51 MACH_CC51 CC51 3859
-+fxi_c210 MACH_FXI_C210 FXI_C210 3860
-+msm8627_cdp MACH_MSM8627_CDP MSM8627_CDP 3861
-+msm8627_mtp MACH_MSM8627_MTP MSM8627_MTP 3862
-+armadillo800eva MACH_ARMADILLO800EVA ARMADILLO800EVA 3863
-+primou MACH_PRIMOU PRIMOU 3864
-+primoc MACH_PRIMOC PRIMOC 3865
-+primoct MACH_PRIMOCT PRIMOCT 3866
-+a9500 MACH_A9500 A9500 3867
-+pluto MACH_PLUTO PLUTO 3869
-+acfx100 MACH_ACFX100 ACFX100 3870
-+msm8625_rumi3 MACH_MSM8625_RUMI3 MSM8625_RUMI3 3871
-+valente MACH_VALENTE VALENTE 3872
-+crfs_rfeye MACH_CRFS_RFEYE CRFS_RFEYE 3873
-+rfeye MACH_RFEYE RFEYE 3874
-+phidget_sbc3 MACH_PHIDGET_SBC3 PHIDGET_SBC3 3875
-+tcw_mika MACH_TCW_MIKA TCW_MIKA 3876
-+imx28_egf MACH_IMX28_EGF IMX28_EGF 3877
-+valente_wx MACH_VALENTE_WX VALENTE_WX 3878
-+huangshans MACH_HUANGSHANS HUANGSHANS 3879
-+bosphorus1 MACH_BOSPHORUS1 BOSPHORUS1 3880
-+prima MACH_PRIMA PRIMA 3881
-+evita_ulk MACH_EVITA_ULK EVITA_ULK 3884
-+merisc600 MACH_MERISC600 MERISC600 3885
-+dolak MACH_DOLAK DOLAK 3886
-+sbc53 MACH_SBC53 SBC53 3887
-+elite_ulk MACH_ELITE_ULK ELITE_ULK 3888
-+pov2 MACH_POV2 POV2 3889
-+ipod_touch_2g MACH_IPOD_TOUCH_2G IPOD_TOUCH_2G 3890
-+da850_pqab MACH_DA850_PQAB DA850_PQAB 3891
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0248-ARM-mach-shmobile-add-armadillo800eva-board-support.patch b/patches.armadillo800eva/0248-ARM-mach-shmobile-add-armadillo800eva-board-support.patch
deleted file mode 100644
index c3361f29a74e63..00000000000000
--- a/patches.armadillo800eva/0248-ARM-mach-shmobile-add-armadillo800eva-board-support.patch
+++ /dev/null
@@ -1,235 +0,0 @@
-From ec162728d99e6a7bf4cb77588700519c7e991934 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:28:59 -0700
-Subject: ARM: mach-shmobile: add armadillo800eva board support.
-
-This adds very basic armadillo800eva board (R-Mobile A1) support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 092928a134e4a5a78b8dff9ce58cb6832da14a9d)
-
-Conflicts:
-
- arch/arm/mach-shmobile/Kconfig
- arch/arm/mach-shmobile/Makefile
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 10 +-
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/board-armadillo800eva.c | 154 ++++++++++++++++++++++++
- 3 files changed, 163 insertions(+), 2 deletions(-)
- create mode 100644 arch/arm/mach-shmobile/board-armadillo800eva.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 193f011..7a1b589 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -75,6 +75,11 @@ config MACH_MACKEREL
- depends on ARCH_SH7372
- select ARCH_REQUIRE_GPIOLIB
-
-+config MACH_ARMADILLO800EVA
-+ bool "Armadillo-800 EVA board"
-+ depends on ARCH_R8A7740
-+ select ARCH_REQUIRE_GPIOLIB
-+
- comment "SH-Mobile System Configuration"
-
- config CPU_HAS_INTEVT
-@@ -87,7 +92,8 @@ config MEMORY_START
- hex "Physical memory start address"
- default "0x50000000" if MACH_G3EVM
- default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
-- MACH_MACKEREL
-+ MACH_MACKEREL || MACH_ARMADILLO800EVA
-+ default "0x41000000" if MACH_KOTA2
- default "0x00000000"
- ---help---
- Tweak this only when porting to a new machine which does not
-@@ -98,7 +104,7 @@ config MEMORY_SIZE
- hex "Physical memory size"
- default "0x08000000" if MACH_G3EVM
- default "0x08000000" if MACH_G4EVM
-- default "0x20000000" if MACH_AG5EVM
-+ default "0x20000000" if MACH_AG5EVM || MACH_ARMADILLO800EVA
- default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
- default "0x04000000"
- help
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index d76ad60..c599c5c 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -44,6 +44,7 @@ obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
- obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
- obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
- obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
-+obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
-
- # Framework support
- obj-$(CONFIG_SMP) += $(smp-y)
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-new file mode 100644
-index 0000000..28bc259
---- /dev/null
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -0,0 +1,154 @@
-+/*
-+ * armadillo 800 eva board support
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ *
-+ */
-+
-+#include <linux/clk.h>
-+#include <linux/err.h>
-+#include <linux/kernel.h>
-+#include <linux/platform_device.h>
-+#include <linux/gpio.h>
-+#include <mach/common.h>
-+#include <mach/irqs.h>
-+#include <asm/page.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/time.h>
-+#include <asm/hardware/cache-l2x0.h>
-+#include <mach/r8a7740.h>
-+
-+/*
-+ * CON1 Camera Module
-+ * CON2 Extension Bus
-+ * CON3 HDMI Output
-+ * CON4 Composite Video Output
-+ * CON5 H-UDI JTAG
-+ * CON6 ARM JTAG
-+ * CON7 SD1
-+ * CON8 SD2
-+ * CON9 RTC BackUp
-+ * CON10 Monaural Mic Input
-+ * CON11 Stereo Headphone Output
-+ * CON12 Audio Line Output(L)
-+ * CON13 Audio Line Output(R)
-+ * CON14 AWL13 Module
-+ * CON15 Extension
-+ * CON16 LCD1
-+ * CON17 LCD2
-+ * CON19 Power Input
-+ * CON20 USB1
-+ * CON21 USB2
-+ * CON22 Serial
-+ * CON23 LAN
-+ * CON24 USB3
-+ * LED1 Camera LED(Yellow)
-+ * LED2 Power LED (Green)
-+ * ED3-LED6 User LED(Yellow)
-+ * LED7 LAN link LED(Green)
-+ * LED8 LAN activity LED(Yellow)
-+ */
-+
-+/*
-+ * DipSwitch
-+ *
-+ * SW1
-+ *
-+ * -12345678-+---------------+----------------------------
-+ * 1 | boot | hermit
-+ * 0 | boot | OS auto boot
-+ * -12345678-+---------------+----------------------------
-+ * 00 | boot device | eMMC
-+ * 10 | boot device | SDHI0 (CON7)
-+ * 01 | boot device | -
-+ * 11 | boot device | Extension Buss (CS0)
-+ * -12345678-+---------------+----------------------------
-+ * 0 | Extension Bus | D8-D15 disable, eMMC enable
-+ * 1 | Extension Bus | D8-D15 enable, eMMC disable
-+ * -12345678-+---------------+----------------------------
-+ * 0 | SDHI1 | COM8 enable, COM14 disable
-+ * 1 | SDHI1 | COM8 enable, COM14 disable
-+ * -12345678-+---------------+----------------------------
-+ * 00 | JTAG | SH-X2
-+ * 10 | JTAG | ARM
-+ * 01 | JTAG | -
-+ * 11 | JTAG | Boundary Scan
-+ *-----------+---------------+----------------------------
-+ */
-+
-+/*
-+ * board devices
-+ */
-+static struct platform_device *eva_devices[] __initdata = {
-+};
-+
-+/*
-+ * board init
-+ */
-+static void __init eva_init(void)
-+{
-+ r8a7740_pinmux_init();
-+
-+ /* SCIFA1 */
-+ gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
-+ gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
-+
-+#ifdef CONFIG_CACHE_L2X0
-+ /* Early BRESP enable, Shared attribute override enable, 32K*8way */
-+ l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
-+#endif
-+
-+ r8a7740_add_standard_devices();
-+
-+ platform_add_devices(eva_devices,
-+ ARRAY_SIZE(eva_devices));
-+}
-+
-+static void __init eva_earlytimer_init(void)
-+{
-+ struct clk *xtal1;
-+
-+ r8a7740_clock_init(MD_CK0 | MD_CK2);
-+
-+ xtal1 = clk_get(NULL, "extal1");
-+ if (!IS_ERR(xtal1)) {
-+ /* armadillo 800 eva extal1 is 24MHz */
-+ clk_set_rate(xtal1, 24000000);
-+ clk_put(xtal1);
-+ }
-+
-+ shmobile_earlytimer_init();
-+}
-+
-+static void __init eva_add_early_devices(void)
-+{
-+ r8a7740_add_early_devices();
-+
-+ /* override timer setup with board-specific code */
-+ shmobile_timer.init = eva_earlytimer_init;
-+}
-+
-+MACHINE_START(ARMADILLO800EVA, "armadillo800eva")
-+ .map_io = r8a7740_map_io,
-+ .init_early = eva_add_early_devices,
-+ .init_irq = r8a7740_init_irq,
-+ .handle_irq = shmobile_handle_irq_intc,
-+ .init_machine = eva_init,
-+ .timer = &shmobile_timer,
-+MACHINE_END
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0249-ARM-mach-shmobile-armadillo800eva-add-defconfig.patch b/patches.armadillo800eva/0249-ARM-mach-shmobile-armadillo800eva-add-defconfig.patch
deleted file mode 100644
index 9193ee488d6836..00000000000000
--- a/patches.armadillo800eva/0249-ARM-mach-shmobile-armadillo800eva-add-defconfig.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From 230fd371ea4a506ebb29bfdbb693e80044cb2382 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:29:36 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add defconfig
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 5cb573538167cf45a9f9019efed1e8da244a19ed)
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/configs/armadillo800eva_defconfig | 143 ++++++++++++++++++++++++++++
- 1 file changed, 143 insertions(+)
- create mode 100644 arch/arm/configs/armadillo800eva_defconfig
-
-diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
-new file mode 100644
-index 0000000..0d20749
---- /dev/null
-+++ b/arch/arm/configs/armadillo800eva_defconfig
-@@ -0,0 +1,143 @@
-+CONFIG_EXPERIMENTAL=y
-+CONFIG_SYSVIPC=y
-+CONFIG_IKCONFIG=y
-+CONFIG_IKCONFIG_PROC=y
-+CONFIG_LOG_BUF_SHIFT=16
-+# CONFIG_UTS_NS is not set
-+# CONFIG_IPC_NS is not set
-+# CONFIG_USER_NS is not set
-+# CONFIG_PID_NS is not set
-+CONFIG_SYSFS_DEPRECATED=y
-+CONFIG_SYSFS_DEPRECATED_V2=y
-+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-+CONFIG_KALLSYMS_ALL=y
-+CONFIG_SLAB=y
-+CONFIG_MODULES=y
-+CONFIG_MODULE_UNLOAD=y
-+CONFIG_MODULE_FORCE_UNLOAD=y
-+# CONFIG_BLK_DEV_BSG is not set
-+# CONFIG_IOSCHED_DEADLINE is not set
-+# CONFIG_IOSCHED_CFQ is not set
-+CONFIG_ARCH_SHMOBILE=y
-+CONFIG_ARCH_R8A7740=y
-+CONFIG_MACH_ARMADILLO800EVA=y
-+# CONFIG_SH_TIMER_TMU is not set
-+# CONFIG_ARM_THUMB is not set
-+CONFIG_CPU_BPREDICT_DISABLE=y
-+# CONFIG_CACHE_L2X0 is not set
-+CONFIG_ARM_ERRATA_430973=y
-+CONFIG_ARM_ERRATA_458693=y
-+CONFIG_ARM_ERRATA_460075=y
-+CONFIG_ARM_ERRATA_720789=y
-+CONFIG_ARM_ERRATA_743622=y
-+CONFIG_ARM_ERRATA_751472=y
-+CONFIG_ARM_ERRATA_754322=y
-+CONFIG_AEABI=y
-+# CONFIG_OABI_COMPAT is not set
-+CONFIG_FORCE_MAX_ZONEORDER=13
-+CONFIG_ZBOOT_ROM_TEXT=0x0
-+CONFIG_ZBOOT_ROM_BSS=0x0
-+CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
-+CONFIG_CMDLINE_FORCE=y
-+CONFIG_KEXEC=y
-+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-+# CONFIG_SUSPEND is not set
-+CONFIG_NET=y
-+CONFIG_PACKET=y
-+CONFIG_UNIX=y
-+CONFIG_INET=y
-+CONFIG_IP_PNP=y
-+CONFIG_IP_PNP_DHCP=y
-+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-+# CONFIG_INET_XFRM_MODE_BEET is not set
-+# CONFIG_INET_LRO is not set
-+# CONFIG_INET_DIAG is not set
-+# CONFIG_IPV6 is not set
-+# CONFIG_WIRELESS is not set
-+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-+CONFIG_SCSI=y
-+CONFIG_BLK_DEV_SD=y
-+CONFIG_MD=y
-+CONFIG_BLK_DEV_DM=y
-+CONFIG_NETDEVICES=y
-+# CONFIG_NET_VENDOR_BROADCOM is not set
-+# CONFIG_NET_VENDOR_CHELSIO is not set
-+# CONFIG_NET_VENDOR_FARADAY is not set
-+# CONFIG_NET_VENDOR_INTEL is not set
-+# CONFIG_NET_VENDOR_MARVELL is not set
-+# CONFIG_NET_VENDOR_MICREL is not set
-+# CONFIG_NET_VENDOR_NATSEMI is not set
-+CONFIG_SH_ETH=y
-+# CONFIG_NET_VENDOR_SEEQ is not set
-+# CONFIG_NET_VENDOR_STMICRO is not set
-+# CONFIG_WLAN is not set
-+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-+CONFIG_INPUT_EVDEV=y
-+# CONFIG_KEYBOARD_ATKBD is not set
-+CONFIG_KEYBOARD_GPIO=y
-+# CONFIG_INPUT_MOUSE is not set
-+CONFIG_INPUT_TOUCHSCREEN=y
-+CONFIG_TOUCHSCREEN_ST1232=y
-+# CONFIG_SERIO is not set
-+# CONFIG_LEGACY_PTYS is not set
-+CONFIG_SERIAL_SH_SCI=y
-+CONFIG_SERIAL_SH_SCI_NR_UARTS=8
-+CONFIG_SERIAL_SH_SCI_CONSOLE=y
-+# CONFIG_HW_RANDOM is not set
-+CONFIG_I2C=y
-+CONFIG_I2C_SH_MOBILE=y
-+# CONFIG_HWMON is not set
-+CONFIG_FB=y
-+CONFIG_FB_MODE_HELPERS=y
-+CONFIG_FB_SH_MOBILE_LCDC=y
-+CONFIG_LCD_CLASS_DEVICE=y
-+CONFIG_FRAMEBUFFER_CONSOLE=y
-+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-+CONFIG_LOGO=y
-+# CONFIG_LOGO_LINUX_MONO is not set
-+# CONFIG_LOGO_LINUX_VGA16 is not set
-+CONFIG_SOUND=y
-+CONFIG_SND=y
-+# CONFIG_SND_SUPPORT_OLD_API is not set
-+# CONFIG_SND_VERBOSE_PROCFS is not set
-+# CONFIG_SND_DRIVERS is not set
-+# CONFIG_SND_ARM is not set
-+CONFIG_SND_SOC=y
-+CONFIG_SND_SOC_SH4_FSI=y
-+# CONFIG_HID_SUPPORT is not set
-+# CONFIG_USB_SUPPORT is not set
-+CONFIG_UIO=y
-+CONFIG_UIO_PDRV_GENIRQ=y
-+# CONFIG_DNOTIFY is not set
-+CONFIG_MSDOS_FS=y
-+CONFIG_VFAT_FS=y
-+CONFIG_TMPFS=y
-+# CONFIG_MISC_FILESYSTEMS is not set
-+CONFIG_NFS_FS=y
-+CONFIG_NFS_V3=y
-+CONFIG_NFS_V3_ACL=y
-+CONFIG_NFS_V4=y
-+CONFIG_NFS_V4_1=y
-+CONFIG_ROOT_NFS=y
-+CONFIG_NLS_CODEPAGE_437=y
-+CONFIG_NLS_ISO8859_1=y
-+# CONFIG_ENABLE_WARN_DEPRECATED is not set
-+# CONFIG_ENABLE_MUST_CHECK is not set
-+CONFIG_MAGIC_SYSRQ=y
-+CONFIG_DEBUG_SECTION_MISMATCH=y
-+CONFIG_DEBUG_KERNEL=y
-+CONFIG_LOCKUP_DETECTOR=y
-+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
-+# CONFIG_DETECT_HUNG_TASK is not set
-+# CONFIG_SCHED_DEBUG is not set
-+CONFIG_DEBUG_KMEMLEAK=y
-+CONFIG_DEBUG_SPINLOCK=y
-+CONFIG_DEBUG_INFO=y
-+# CONFIG_FTRACE is not set
-+CONFIG_CRYPTO=y
-+CONFIG_CRYPTO_CBC=y
-+CONFIG_CRYPTO_MD5=y
-+CONFIG_CRYPTO_DES=y
-+CONFIG_CRYPTO_ANSI_CPRNG=y
-+CONFIG_XZ_DEC=y
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0250-ARM-mach-shmobile-armadillo800eva-add-support-LCDC0.patch b/patches.armadillo800eva/0250-ARM-mach-shmobile-armadillo800eva-add-support-LCDC0.patch
deleted file mode 100644
index 48eced779711a9..00000000000000
--- a/patches.armadillo800eva/0250-ARM-mach-shmobile-armadillo800eva-add-support-LCDC0.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From a622587f6d7ca484b22fb50badafe8a377bc8456 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:30:09 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add support LCDC0
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 9699241a8c9b249a9d970cc81a5d4b2dbbcdad68)
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 105 ++++++++++++++++++++++++
- 1 file changed, 105 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index 28bc259..5cc17a8 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -24,6 +24,7 @@
- #include <linux/kernel.h>
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
-+#include <linux/videodev2.h>
- #include <mach/common.h>
- #include <mach/irqs.h>
- #include <asm/page.h>
-@@ -33,6 +34,7 @@
- #include <asm/mach/time.h>
- #include <asm/hardware/cache-l2x0.h>
- #include <mach/r8a7740.h>
-+#include <video/sh_mobile_lcdc.h>
-
- /*
- * CON1 Camera Module
-@@ -92,10 +94,66 @@
- *-----------+---------------+----------------------------
- */
-
-+/* LCDC */
-+static struct fb_videomode lcdc0_mode = {
-+ .name = "AMPIER/AM-800480",
-+ .xres = 800,
-+ .yres = 480,
-+ .left_margin = 88,
-+ .right_margin = 40,
-+ .hsync_len = 128,
-+ .upper_margin = 20,
-+ .lower_margin = 5,
-+ .vsync_len = 5,
-+ .sync = 0,
-+};
-+
-+static struct sh_mobile_lcdc_info lcdc0_info = {
-+ .clock_source = LCDC_CLK_BUS,
-+ .ch[0] = {
-+ .chan = LCDC_CHAN_MAINLCD,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
-+ .interface_type = RGB24,
-+ .clock_divider = 5,
-+ .flags = 0,
-+ .lcd_modes = &lcdc0_mode,
-+ .num_modes = 1,
-+ .panel_cfg = {
-+ .width = 111,
-+ .height = 68,
-+ },
-+ },
-+};
-+
-+static struct resource lcdc0_resources[] = {
-+ [0] = {
-+ .name = "LCD0",
-+ .start = 0xfe940000,
-+ .end = 0xfe943fff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = intcs_evt2irq(0x580),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device lcdc0_device = {
-+ .name = "sh_mobile_lcdc_fb",
-+ .num_resources = ARRAY_SIZE(lcdc0_resources),
-+ .resource = lcdc0_resources,
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &lcdc0_info,
-+ .coherent_dma_mask = ~0,
-+ },
-+};
-+
- /*
- * board devices
- */
- static struct platform_device *eva_devices[] __initdata = {
-+ &lcdc0_device,
- };
-
- /*
-@@ -109,6 +167,53 @@ static void __init eva_init(void)
- gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
- gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
-
-+ /* LCDC0 */
-+ gpio_request(GPIO_FN_LCDC0_SELECT, NULL);
-+ gpio_request(GPIO_FN_LCD0_D0, NULL);
-+ gpio_request(GPIO_FN_LCD0_D1, NULL);
-+ gpio_request(GPIO_FN_LCD0_D2, NULL);
-+ gpio_request(GPIO_FN_LCD0_D3, NULL);
-+ gpio_request(GPIO_FN_LCD0_D4, NULL);
-+ gpio_request(GPIO_FN_LCD0_D5, NULL);
-+ gpio_request(GPIO_FN_LCD0_D6, NULL);
-+ gpio_request(GPIO_FN_LCD0_D7, NULL);
-+ gpio_request(GPIO_FN_LCD0_D8, NULL);
-+ gpio_request(GPIO_FN_LCD0_D9, NULL);
-+ gpio_request(GPIO_FN_LCD0_D10, NULL);
-+ gpio_request(GPIO_FN_LCD0_D11, NULL);
-+ gpio_request(GPIO_FN_LCD0_D12, NULL);
-+ gpio_request(GPIO_FN_LCD0_D13, NULL);
-+ gpio_request(GPIO_FN_LCD0_D14, NULL);
-+ gpio_request(GPIO_FN_LCD0_D15, NULL);
-+ gpio_request(GPIO_FN_LCD0_D16, NULL);
-+ gpio_request(GPIO_FN_LCD0_D17, NULL);
-+ gpio_request(GPIO_FN_LCD0_D18_PORT40, NULL);
-+ gpio_request(GPIO_FN_LCD0_D19_PORT4, NULL);
-+ gpio_request(GPIO_FN_LCD0_D20_PORT3, NULL);
-+ gpio_request(GPIO_FN_LCD0_D21_PORT2, NULL);
-+ gpio_request(GPIO_FN_LCD0_D22_PORT0, NULL);
-+ gpio_request(GPIO_FN_LCD0_D23_PORT1, NULL);
-+ gpio_request(GPIO_FN_LCD0_DCK, NULL);
-+ gpio_request(GPIO_FN_LCD0_VSYN, NULL);
-+ gpio_request(GPIO_FN_LCD0_HSYN, NULL);
-+ gpio_request(GPIO_FN_LCD0_DISP, NULL);
-+ gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
-+
-+ gpio_request(GPIO_PORT61, NULL); /* LCDDON */
-+ gpio_direction_output(GPIO_PORT61, 1);
-+
-+ gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
-+ gpio_direction_output(GPIO_PORT202, 0);
-+
-+ /*
-+ * CAUTION
-+ *
-+ * DBGMD/LCDC0/FSIA MUX
-+ * DBGMD_SELECT_B should be set after setting PFC Function.
-+ */
-+ gpio_request(GPIO_PORT176, NULL);
-+ gpio_direction_output(GPIO_PORT176, 1);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 32K*8way */
- l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0251-ARM-mach-shmobile-armadillo800eva-add-support-ST1232.patch b/patches.armadillo800eva/0251-ARM-mach-shmobile-armadillo800eva-add-support-ST1232.patch
deleted file mode 100644
index 6e266bad504fb0..00000000000000
--- a/patches.armadillo800eva/0251-ARM-mach-shmobile-armadillo800eva-add-support-ST1232.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From bbe0b11d8e7e4bae235e6e4297f6c7338937e919 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:30:42 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add support ST1232
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 5f0c97e98875539868fd11a0432cb9460bf75b6d)
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index 5cc17a8..74213e3 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -149,6 +149,14 @@ static struct platform_device lcdc0_device = {
- },
- };
-
-+/* I2C */
-+static struct i2c_board_info i2c0_devices[] = {
-+ {
-+ I2C_BOARD_INFO("st1232-ts", 0x55),
-+ .irq = evt2irq(0x0340),
-+ },
-+};
-+
- /*
- * board devices
- */
-@@ -205,6 +213,11 @@ static void __init eva_init(void)
- gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
- gpio_direction_output(GPIO_PORT202, 0);
-
-+ /* Touchscreen */
-+ gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
-+ gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */
-+ gpio_direction_output(GPIO_PORT166, 1);
-+
- /*
- * CAUTION
- *
-@@ -219,6 +232,8 @@ static void __init eva_init(void)
- l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
- #endif
-
-+ i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
-+
- r8a7740_add_standard_devices();
-
- platform_add_devices(eva_devices,
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0252-ARM-mach-shmobile-armadillo800eva-add-support-gpio_k.patch b/patches.armadillo800eva/0252-ARM-mach-shmobile-armadillo800eva-add-support-gpio_k.patch
deleted file mode 100644
index 2b86687181843a..00000000000000
--- a/patches.armadillo800eva/0252-ARM-mach-shmobile-armadillo800eva-add-support-gpio_k.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 602cf848bee1f0c0c6493c160f382e1cdc976c74 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:31:33 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add support gpio_key
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 8afd7b1b2111c2a1375f197af4ceb77e3348a25c)
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 26 ++++++++++++++++++++++++
- 1 file changed, 26 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index 74213e3..8bb4d27 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -22,8 +22,10 @@
- #include <linux/clk.h>
- #include <linux/err.h>
- #include <linux/kernel.h>
-+#include <linux/input.h>
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
-+#include <linux/gpio_keys.h>
- #include <linux/videodev2.h>
- #include <mach/common.h>
- #include <mach/irqs.h>
-@@ -157,11 +159,35 @@ static struct i2c_board_info i2c0_devices[] = {
- },
- };
-
-+/* GPIO KEY */
-+#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
-+
-+static struct gpio_keys_button gpio_buttons[] = {
-+ GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"),
-+ GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"),
-+ GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"),
-+ GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"),
-+};
-+
-+static struct gpio_keys_platform_data gpio_key_info = {
-+ .buttons = gpio_buttons,
-+ .nbuttons = ARRAY_SIZE(gpio_buttons),
-+};
-+
-+static struct platform_device gpio_keys_device = {
-+ .name = "gpio-keys",
-+ .id = -1,
-+ .dev = {
-+ .platform_data = &gpio_key_info,
-+ },
-+};
-+
- /*
- * board devices
- */
- static struct platform_device *eva_devices[] __initdata = {
- &lcdc0_device,
-+ &gpio_keys_device,
- };
-
- /*
---
-1.7.10
-
diff --git a/patches.armadillo800eva/0253-ARM-mach-shmobile-armadillo800eva-add-support-sh_eth.patch b/patches.armadillo800eva/0253-ARM-mach-shmobile-armadillo800eva-add-support-sh_eth.patch
deleted file mode 100644
index 16daeeb30cfa51..00000000000000
--- a/patches.armadillo800eva/0253-ARM-mach-shmobile-armadillo800eva-add-support-sh_eth.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 449c76dabd617e3f6c4f852dae7562dcf63e4c6d Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 6 Apr 2012 01:32:02 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add support sh_eth
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-(cherry picked from commit 8d6c8699cce91d5e221a4869e263ee0f7afcdca4)
-
-N.B: This patch is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 58 ++++++++++++++++++++++++
- 1 file changed, 58 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index 8bb4d27..c2affc4 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -26,6 +26,7 @@
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
- #include <linux/gpio_keys.h>
-+#include <linux/sh_eth.h>
- #include <linux/videodev2.h>
- #include <mach/common.h>
- #include <mach/irqs.h>
-@@ -96,6 +97,38 @@
- *-----------+---------------+----------------------------
- */
-
-+/* Ether */
-+static struct sh_eth_plat_data sh_eth_platdata = {
-+ .phy = 0x00, /* LAN8710A */
-+ .edmac_endian = EDMAC_LITTLE_ENDIAN,
-+ .register_type = SH_ETH_REG_GIGABIT,
-+ .phy_interface = PHY_INTERFACE_MODE_MII,
-+};
-+
-+static struct resource sh_eth_resources[] = {
-+ {
-+ .start = 0xe9a00000,
-+ .end = 0xe9a00800 - 1,
-+ .flags = IORESOURCE_MEM,
-+ }, {
-+ .start = 0xe9a01800,
-+ .end = 0xe9a02000 - 1,
-+ .flags = IORESOURCE_MEM,
-+ }, {
-+ .start = evt2irq(0x0500),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sh_eth_device = {
-+ .name = "sh-eth",
-+ .dev = {
-+ .platform_data = &sh_eth_platdata,
-+ },
-+ .resource = sh_eth_resources,
-+ .num_resources = ARRAY_SIZE(sh_eth_resources),
-+};
-+
- /* LCDC */
- static struct fb_videomode lcdc0_mode = {
- .name = "AMPIER/AM-800480",
-@@ -188,6 +221,7 @@ static struct platform_device gpio_keys_device = {
- static struct platform_device *eva_devices[] __initdata = {
- &lcdc0_device,
- &gpio_keys_device,
-+ &sh_eth_device,
- };
-
- /*
-@@ -244,6 +278,30 @@ static void __init eva_init(void)
- gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */
- gpio_direction_output(GPIO_PORT166, 1);
-
-+ /* GETHER */
-+ gpio_request(GPIO_FN_ET_CRS, NULL);
-+ gpio_request(GPIO_FN_ET_MDC, NULL);
-+ gpio_request(GPIO_FN_ET_MDIO, NULL);
-+ gpio_request(GPIO_FN_ET_TX_ER, NULL);
-+ gpio_request(GPIO_FN_ET_RX_ER, NULL);
-+ gpio_request(GPIO_FN_ET_ERXD0, NULL);
-+ gpio_request(GPIO_FN_ET_ERXD1, NULL);
-+ gpio_request(GPIO_FN_ET_ERXD2, NULL);
-+ gpio_request(GPIO_FN_ET_ERXD3, NULL);
-+ gpio_request(GPIO_FN_ET_TX_CLK, NULL);
-+ gpio_request(GPIO_FN_ET_TX_EN, NULL);
-+ gpio_request(GPIO_FN_ET_ETXD0, NULL);
-+ gpio_request(GPIO_FN_ET_ETXD1, NULL);
-+ gpio_request(GPIO_FN_ET_ETXD2, NULL);
-+ gpio_request(GPIO_FN_ET_ETXD3, NULL);
-+ gpio_request(GPIO_FN_ET_PHY_INT, NULL);
-+ gpio_request(GPIO_FN_ET_COL, NULL);
-+ gpio_request(GPIO_FN_ET_RX_DV, NULL);
-+ gpio_request(GPIO_FN_ET_RX_CLK, NULL);
-+
-+ gpio_request(GPIO_PORT18, NULL); /* PHY_RST */
-+ gpio_direction_output(GPIO_PORT18, 1);
-+
- /*
- * CAUTION
- *
---
-1.7.10
-
diff --git a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-allow-use-of-armhf-userspace.patch b/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-allow-use-of-armhf-userspace.patch
deleted file mode 100644
index b4172a7fb7834e..00000000000000
--- a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-allow-use-of-armhf-userspace.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Fri Jul 6 05:10:18 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 6 Jul 2012 21:09:57 +0900
-Subject: ARM: mach-shmobile: armadillo800eva: defconfig Allow use of armhf userspace
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Message-ID: <1341576597-13986-1-git-send-email-horms@verge.net.au>
-
-
-This allows use a Debian armhf usespace
-as well as the existing ability to use a Debian armel userspace.
-
-N.B: Not present upstream yet
-
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
----
-
-Hi Greg,
-
-please consider this for inclusion in LTSI.
----
- arch/arm/configs/armadillo800eva_defconfig | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/arch/arm/configs/armadillo800eva_defconfig
-+++ b/arch/arm/configs/armadillo800eva_defconfig
-@@ -21,7 +21,7 @@ CONFIG_ARCH_SHMOBILE=y
- CONFIG_ARCH_R8A7740=y
- CONFIG_MACH_ARMADILLO800EVA=y
- # CONFIG_SH_TIMER_TMU is not set
--# CONFIG_ARM_THUMB is not set
-+CONFIG_ARM_THUMB=y
- CONFIG_CPU_BPREDICT_DISABLE=y
- # CONFIG_CACHE_L2X0 is not set
- CONFIG_ARM_ERRATA_430973=y
-@@ -39,6 +39,7 @@ CONFIG_ZBOOT_ROM_BSS=0x0
- CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
- CONFIG_CMDLINE_FORCE=y
- CONFIG_KEXEC=y
-+CONFIG_VFP=y
- # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
- # CONFIG_SUSPEND is not set
- CONFIG_NET=y
diff --git a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-disable-config_sysfs_deprecated.patch b/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-disable-config_sysfs_deprecated.patch
deleted file mode 100644
index 5a5df82415fe39..00000000000000
--- a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-disable-config_sysfs_deprecated.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Fri Jul 6 07:29:37 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 6 Jul 2012 23:29:18 +0900
-Subject: ARM: mach-shmobile: armadillo800eva: defconfig disable CONFIG_SYSFS_DEPRECATED
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Message-ID: <1341584958-17096-1-git-send-email-horms@verge.net.au>
-
-
-In adition to the change proposed for upstream, LTSI requires that
-CONFIG_SYSFS_DEPRECATED be removed from the defconfig in order to allow
-allows use a Debian armhf usespace as well as the existing ability to use a
-Debian armel userspace.
-
-N.B: Not necessary upstream: CONFIG_SYSFS_DEPRECATED is not in the defconfig
-
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
----
-
-Hi Greg,
-
-please consider this for inclusion in LTSI.
----
- arch/arm/configs/armadillo800eva_defconfig | 1 -
- 1 file changed, 1 deletion(-)
-
---- a/arch/arm/configs/armadillo800eva_defconfig
-+++ b/arch/arm/configs/armadillo800eva_defconfig
-@@ -7,7 +7,6 @@ CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_IPC_NS is not set
- # CONFIG_USER_NS is not set
- # CONFIG_PID_NS is not set
--CONFIG_SYSFS_DEPRECATED=y
- CONFIG_SYSFS_DEPRECATED_V2=y
- CONFIG_CC_OPTIMIZE_FOR_SIZE=y
- CONFIG_SLAB=y
diff --git a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-update.patch b/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-update.patch
deleted file mode 100644
index 86356236fdaae3..00000000000000
--- a/patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-update.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Fri Jul 6 00:43:54 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 6 Jul 2012 16:43:40 +0900
-Subject: ARM: mach-shmobile: armadillo800eva: defconfig update
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <1341560620-31790-1-git-send-email-horms@verge.net.au>
-
-
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-This patch enable USBFunc/SHDI/MMCIF,
-remove debug settings,
-and cleanuped by c2330e286f68f1c408b4aa6515ba49d57f05beae script
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9183857d503f915ee05abb6e03cea7253dcbace6)
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
-
-Hi Greg,
-
-please consider this patch for LTSI. It enables SDHI and MMCIF for the
-armadillo800eva: board, both of which work in the LTSI kernel. It also
-enables USB which is not particularly useful in for LTSI but harmless.
----
- arch/arm/configs/armadillo800eva_defconfig | 25 ++++++++++++-------------
- 1 file changed, 12 insertions(+), 13 deletions(-)
-
---- a/arch/arm/configs/armadillo800eva_defconfig
-+++ b/arch/arm/configs/armadillo800eva_defconfig
-@@ -10,7 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
- CONFIG_SYSFS_DEPRECATED=y
- CONFIG_SYSFS_DEPRECATED_V2=y
- CONFIG_CC_OPTIMIZE_FOR_SIZE=y
--CONFIG_KALLSYMS_ALL=y
- CONFIG_SLAB=y
- CONFIG_MODULES=y
- CONFIG_MODULE_UNLOAD=y
-@@ -63,6 +62,7 @@ CONFIG_BLK_DEV_DM=y
- CONFIG_NETDEVICES=y
- # CONFIG_NET_VENDOR_BROADCOM is not set
- # CONFIG_NET_VENDOR_CHELSIO is not set
-+# CONFIG_NET_VENDOR_CIRRUS is not set
- # CONFIG_NET_VENDOR_FARADAY is not set
- # CONFIG_NET_VENDOR_INTEL is not set
- # CONFIG_NET_VENDOR_MARVELL is not set
-@@ -71,6 +71,7 @@ CONFIG_NETDEVICES=y
- CONFIG_NET_ETHERNET=y
- CONFIG_SH_ETH=y
- # CONFIG_NET_VENDOR_SEEQ is not set
-+# CONFIG_NET_VENDOR_SMSC is not set
- # CONFIG_NET_VENDOR_STMICRO is not set
- # CONFIG_WLAN is not set
- # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-@@ -107,7 +108,15 @@ CONFIG_SND=y
- CONFIG_SND_SOC=y
- CONFIG_SND_SOC_SH4_FSI=y
- # CONFIG_HID_SUPPORT is not set
--# CONFIG_USB_SUPPORT is not set
-+CONFIG_USB=y
-+# CONFIG_USB_DEVICE_CLASS is not set
-+CONFIG_USB_RENESAS_USBHS=y
-+CONFIG_USB_GADGET=y
-+CONFIG_USB_RENESAS_USBHS_UDC=y
-+CONFIG_USB_ETH=m
-+CONFIG_MMC=y
-+CONFIG_MMC_SDHI=y
-+CONFIG_MMC_SH_MMCIF=y
- CONFIG_UIO=y
- CONFIG_UIO_PDRV_GENIRQ=y
- # CONFIG_DNOTIFY is not set
-@@ -125,17 +134,7 @@ CONFIG_NLS_CODEPAGE_437=y
- CONFIG_NLS_ISO8859_1=y
- # CONFIG_ENABLE_WARN_DEPRECATED is not set
- # CONFIG_ENABLE_MUST_CHECK is not set
--CONFIG_MAGIC_SYSRQ=y
--CONFIG_DEBUG_SECTION_MISMATCH=y
--CONFIG_DEBUG_KERNEL=y
--CONFIG_LOCKUP_DETECTOR=y
--CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
--# CONFIG_DETECT_HUNG_TASK is not set
--# CONFIG_SCHED_DEBUG is not set
--CONFIG_DEBUG_KMEMLEAK=y
--CONFIG_DEBUG_SPINLOCK=y
--CONFIG_DEBUG_INFO=y
--# CONFIG_FTRACE is not set
-+# CONFIG_ARM_UNWIND is not set
- CONFIG_CRYPTO=y
- CONFIG_CRYPTO_CBC=y
- CONFIG_CRYPTO_MD5=y
diff --git a/patches.armadillo800eva/arm-mach-shmobile-sh7372-ap4evb-and-mackerel-timer-rework.patch b/patches.armadillo800eva/arm-mach-shmobile-sh7372-ap4evb-and-mackerel-timer-rework.patch
deleted file mode 100644
index 9854a18225d548..00000000000000
--- a/patches.armadillo800eva/arm-mach-shmobile-sh7372-ap4evb-and-mackerel-timer-rework.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From horms@vergenet.net Tue May 29 17:45:19 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Wed, 30 May 2012 09:45:07 +0900
-Subject: [PATCH] ARM: mach-shmobile: sh7372, AP4EVB and Mackerel timer rework
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Greg KH <gregkh@linuxfoundation.org>, Magnus Damm <magnus.damm@gmail.com>, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>, Simon Horman <horms@verge.net.au>
-Message-ID: <1338338707-29333-2-git-send-email-horms@verge.net.au>
-
-
-From: Magnus Damm <damm@opensource.se>
-
-Move the SoC specific timer code from AP4EVB and Mackerel
-to sh7372 setup code. This makes is possible to share
-the SoC specific timer code across boards and it also
-removes the need for a board specific timer structure.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 17254bffd6e4fda97d825acec153614f09bb33e7)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ap4evb.c
- arch/arm/mach-shmobile/board-mackerel.c
- arch/arm/mach-shmobile/setup-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-sh7372.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
-index 8ddef91..42d9619 100644
---- a/arch/arm/mach-shmobile/setup-sh7372.c
-+++ b/arch/arm/mach-shmobile/setup-sh7372.c
-@@ -32,8 +32,10 @@
- #include <linux/sh_timer.h>
- #include <mach/hardware.h>
- #include <mach/sh7372.h>
-+#include <mach/common.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
-+#include <asm/mach/time.h>
-
- /* SCIFA0 */
- static struct plat_sci_port scif0_platform_data = {
-@@ -848,8 +850,17 @@ void __init sh7372_add_standard_devices(void)
- ARRAY_SIZE(sh7372_late_devices));
- }
-
-+static void __init sh7372_earlytimer_init(void)
-+{
-+ sh7372_clock_init();
-+ shmobile_earlytimer_init();
-+}
-+
- void __init sh7372_add_early_devices(void)
- {
- early_platform_add_devices(sh7372_early_devices,
- ARRAY_SIZE(sh7372_early_devices));
-+
-+ /* override timer setup with soc-specific code */
-+ shmobile_timer.init = sh7372_earlytimer_init;
- }
---
-1.7.10.2.484.gcd07cc5
-
diff --git a/patches.armadillo800eva/ltsi-bugfix-armadillo800eva-sh_eth-needs-net_ethernet-on-defconfig.patch b/patches.armadillo800eva/ltsi-bugfix-armadillo800eva-sh_eth-needs-net_ethernet-on-defconfig.patch
deleted file mode 100644
index 6a1f951e05c927..00000000000000
--- a/patches.armadillo800eva/ltsi-bugfix-armadillo800eva-sh_eth-needs-net_ethernet-on-defconfig.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From kuninori.morimoto.gx@gmail.com Tue Jun 12 21:51:16 2012
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 12 Jun 2012 21:51:14 -0700 (PDT)
-Subject: [PATCH 1/2] LTSI: bugfix: armadillo800eva: SH_ETH needs NET_ETHERNET on defconfig
-To: Greg KH <gregkh@linuxfoundation.org>, ltsi-dev@lists.linuxfoundation.org
-Cc: Simon <horms@verge.net.au>, Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>, (KMC)tuji <kunihiko@kmckk.co.jp>
-Message-ID: <87zk877r29.wl%kuninori.morimoto.gx@renesas.com>
-
-
-On LTSI, sh_eth driver was backported from latest kernel.
-But the ethernet driver dependency was modified between
-latest kernel and 3.0.x kernel.
-Then, LTSI kernel lost NET_ETHERNET which was required
-from SH_ETH on defconfig.
-This patch fix it up for LTSI.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
----
- arch/arm/configs/armadillo800eva_defconfig | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
-index 0d20749..f29893a 100644
---- a/arch/arm/configs/armadillo800eva_defconfig
-+++ b/arch/arm/configs/armadillo800eva_defconfig
-@@ -68,6 +68,7 @@ CONFIG_NETDEVICES=y
- # CONFIG_NET_VENDOR_MARVELL is not set
- # CONFIG_NET_VENDOR_MICREL is not set
- # CONFIG_NET_VENDOR_NATSEMI is not set
-+CONFIG_NET_ETHERNET=y
- CONFIG_SH_ETH=y
- # CONFIG_NET_VENDOR_SEEQ is not set
- # CONFIG_NET_VENDOR_STMICRO is not set
---
-1.7.5.4
-
diff --git a/patches.kzm9g/0001-net-remove-mm.h-inclusion-from-netdevice.h.patch b/patches.kzm9g/0001-net-remove-mm.h-inclusion-from-netdevice.h.patch
deleted file mode 100644
index 87178759729ae8..00000000000000
--- a/patches.kzm9g/0001-net-remove-mm.h-inclusion-from-netdevice.h.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 49d759919c99a3cb5391a446f5541f606c65e3c1 Mon Sep 17 00:00:00 2001
-From: Alexey Dobriyan <adobriyan@gmail.com>
-Date: Thu, 16 Jun 2011 11:01:34 +0000
-Subject: net: remove mm.h inclusion from netdevice.h
-
-Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).
-
-To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
-definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
-via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
-Removal of mm.h from scatterlist.h was tried and was found not feasible
-on most archs, so the link was cutoff earlier.
-
-Hope people are OK with tiny include file.
-
-Note, that mm_types.h is still dragged in, but it is a separate story.
-
-Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit b7f080cfe223b3b7424872639d153695615a9255)
-
-Conflicts:
-
- arch/arm/mach-davinci/board-mityomapl138.c
- arch/arm/mach-davinci/dm646x.c
- arch/arm/mach-davinci/pm.c
- arch/arm/mach-imx/dma-v1.c
- arch/arm/mach-imx/mach-mx31_3ds.c
- arch/arm/mach-iop13xx/setup.c
- arch/arm/mach-mxs/devices/platform-auart.c
- arch/arm/mach-mxs/devices/platform-dma.c
- arch/arm/mach-mxs/devices/platform-fec.c
- arch/arm/plat-mxc/devices/platform-fec.c
- arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
- arch/arm/plat-mxc/devices/platform-imx-fb.c
- arch/arm/plat-mxc/devices/platform-ipu-core.c
- arch/arm/plat-mxc/devices/platform-mxc-ehci.c
- arch/arm/plat-mxc/devices/platform-mxc-mmc.c
- arch/arm/plat-nomadik/include/plat/ste_dma40.h
- arch/x86/kernel/tboot.c
- crypto/async_tx/raid6test.c
- drivers/dma/coh901318.c
- drivers/dma/dmatest.c
- drivers/dma/ipu/ipu_idmac.c
- drivers/dma/ste_dma40.c
- drivers/media/dvb/mantis/mantis_ca.c
- drivers/media/dvb/mantis/mantis_evm.c
- drivers/media/dvb/mantis/mantis_hif.c
- drivers/media/dvb/mantis/mantis_ioc.c
- drivers/media/dvb/mantis/mantis_pcmcia.c
- drivers/media/dvb/mantis/mantis_uart.c
- drivers/media/dvb/mantis/mantis_vp1034.c
- drivers/mmc/host/tmio_mmc_dma.c
- drivers/mtd/nand/atmel_nand.c
- drivers/net/arm/ks8695net.c
- drivers/net/bnx2x/bnx2x.h
- drivers/net/can/janz-ican3.c
- drivers/net/can/softing/softing_fw.c
- drivers/net/can/softing/softing_main.c
- drivers/net/ethoc.c
- drivers/net/fec_mpc52xx.c
- drivers/net/greth.c
- drivers/net/irda/pxaficp_ir.c
- drivers/net/ks8851_mll.c
- drivers/net/sgiseeq.c
- drivers/net/stmmac/dwmac1000_core.c
- drivers/net/stmmac/dwmac1000_dma.c
- drivers/net/stmmac/dwmac100_core.c
- drivers/net/stmmac/dwmac100_dma.c
- drivers/net/stmmac/stmmac_ethtool.c
- drivers/net/stmmac/stmmac_mdio.c
- drivers/net/usb/cdc-phonet.c
- drivers/net/vxge/vxge-config.h
- drivers/net/wireless/ath/ath5k/base.c
- drivers/net/wireless/ath/ath9k/beacon.c
- drivers/net/wireless/ath/ath9k/init.c
- drivers/net/wireless/ath/ath9k/recv.c
- drivers/net/wireless/ath/ath9k/xmit.c
- drivers/staging/pohmelfs/crypto.c
- drivers/tty/serial/ifx6x60.c
- drivers/usb/gadget/f_phonet.c
- include/crypto/if_alg.h
- include/linux/netdevice.h
- net/sched/sch_netem.c
- security/apparmor/lib.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/dmaengine.c | 1 +
- include/linux/dma-direction.h | 13 +++++++++++++
- include/linux/dma-mapping.h | 10 +---------
- include/linux/dmaengine.h | 4 +++-
- 4 files changed, 18 insertions(+), 10 deletions(-)
- create mode 100644 include/linux/dma-direction.h
-
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index 8bcb15f..48694c3 100644
---- a/drivers/dma/dmaengine.c
-+++ b/drivers/dma/dmaengine.c
-@@ -45,6 +45,7 @@
- * See Documentation/dmaengine.txt for more details
- */
-
-+#include <linux/dma-mapping.h>
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/mm.h>
-diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
-new file mode 100644
-index 0000000..95b6a82
---- /dev/null
-+++ b/include/linux/dma-direction.h
-@@ -0,0 +1,13 @@
-+#ifndef _LINUX_DMA_DIRECTION_H
-+#define _LINUX_DMA_DIRECTION_H
-+/*
-+ * These definitions mirror those in pci.h, so they can be used
-+ * interchangeably with their PCI_ counterparts.
-+ */
-+enum dma_data_direction {
-+ DMA_BIDIRECTIONAL = 0,
-+ DMA_TO_DEVICE = 1,
-+ DMA_FROM_DEVICE = 2,
-+ DMA_NONE = 3,
-+};
-+#endif
-diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
-index ba8319a..1a167c4 100644
---- a/include/linux/dma-mapping.h
-+++ b/include/linux/dma-mapping.h
-@@ -4,17 +4,9 @@
- #include <linux/device.h>
- #include <linux/err.h>
- #include <linux/dma-attrs.h>
-+#include <linux/dma-direction.h>
- #include <linux/scatterlist.h>
-
--/* These definitions mirror those in pci.h, so they can be used
-- * interchangeably with their PCI_ counterparts */
--enum dma_data_direction {
-- DMA_BIDIRECTIONAL = 0,
-- DMA_TO_DEVICE = 1,
-- DMA_FROM_DEVICE = 2,
-- DMA_NONE = 3,
--};
--
- struct dma_map_ops {
- void* (*alloc_coherent)(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t gfp);
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index eee7add..8fbf40e 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -23,7 +23,9 @@
-
- #include <linux/device.h>
- #include <linux/uio.h>
--#include <linux/dma-mapping.h>
-+#include <linux/dma-direction.h>
-+
-+struct scatterlist;
-
- /**
- * typedef dma_cookie_t - an opaque DMA cookie
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0001-tty-serial-allow-ports-to-override-the-irq-handler.patch b/patches.kzm9g/0001-tty-serial-allow-ports-to-override-the-irq-handler.patch
deleted file mode 100644
index 3d7f126e8a3640..00000000000000
--- a/patches.kzm9g/0001-tty-serial-allow-ports-to-override-the-irq-handler.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From bc8d01eecbc317f8f39268b1e5e4fcb9ac1d89af Mon Sep 17 00:00:00 2001
-From: Jamie Iles <jamie@jamieiles.com>
-Date: Mon, 15 Aug 2011 10:17:51 +0100
-Subject: tty: serial: allow ports to override the irq handler
-
-Some serial ports may have unusal requirements for interrupt handling
-(e.g. the Synopsys DesignWare 8250-alike port and it's busy detect
-interrupt). Add a .handle_irq callback that can be used for platforms
-to override the interrupt behaviour in a similar fashion to the
-.serial_out and .serial_in callbacks.
-
-Signed-off-by: Jamie Iles <jamie@jamieiles.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit a74036f51272975e9538e80cd1bb64dce164b208)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/serial_core.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
-index a5c3114..b6fa317 100644
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -300,6 +300,7 @@ struct uart_port {
- void (*set_termios)(struct uart_port *,
- struct ktermios *new,
- struct ktermios *old);
-+ int (*handle_irq)(struct uart_port *);
- void (*pm)(struct uart_port *, unsigned int state,
- unsigned int old);
- unsigned int irq; /* irq number */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0002-Include-linux-dma-mapping.h-in-linux-dmaengine.h.patch b/patches.kzm9g/0002-Include-linux-dma-mapping.h-in-linux-dmaengine.h.patch
deleted file mode 100644
index 049d91e5123c18..00000000000000
--- a/patches.kzm9g/0002-Include-linux-dma-mapping.h-in-linux-dmaengine.h.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 0056ad033559371f0ce04d68fffc30c92fb551e8 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 17 Feb 2012 16:16:28 +0900
-Subject: Include linux/dma-mapping.h in linux/dmaengine.h
-
-This reverses the effect of b7f080cfe223b3b7424872639d153695615a9255 (net:
-remove mm.h inclusion from netdevice.h) while leaving almost all of the
-code changes in place, in particular the creation of linux/dma-diretion.h
-which is a dependency of subsequent patches that will be backported.
-
-The motivation for this it to unbreak multiple drivers.
-This patch cam be reverted if backports to all relevant drivers
-are made.
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 8fbf40e..8bf1032 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -23,7 +23,7 @@
-
- #include <linux/device.h>
- #include <linux/uio.h>
--#include <linux/dma-direction.h>
-+#include <linux/dma-mapping.h>
-
- struct scatterlist;
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0002-serial-introduce-generic-port-in-out-helpers.patch b/patches.kzm9g/0002-serial-introduce-generic-port-in-out-helpers.patch
deleted file mode 100644
index 377a496df1eb0e..00000000000000
--- a/patches.kzm9g/0002-serial-introduce-generic-port-in-out-helpers.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 790111bbb9291b79c960d33b406ccc7ab9833a76 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:12 -0500
-Subject: serial: introduce generic port in/out helpers
-
-Looking at the existing serial drivers (esp. the 8250 derived
-variants) we see a common trend. They create a hardware specific
-port struct, which in turn contains a generic serial_port struct.
-
-The other trend, is that they all create some sort of shortcut
-to go through the hardware specific struct, to the serial_port
-struct, which has the basic in/out operations within. Looking
-for the serial_in and serial_out in several drivers shows this.
-
-Rather than let this continue, lets create a generic set of
-similar helper wrappers that can be used on a struct port, so
-we can eliminate bouncing out through hardware specific struct
-pointers just to come back into struct port where possible.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 927353a75602dd97144352f53177e18093fdd198)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/serial_core.h | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
-index b6fa317..1cb6309 100644
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -376,6 +376,16 @@ struct uart_port {
- void *private_data; /* generic platform data pointer */
- };
-
-+static inline int serial_port_in(struct uart_port *up, int offset)
-+{
-+ return up->serial_in(up, offset);
-+}
-+
-+static inline void serial_port_out(struct uart_port *up, int offset, int value)
-+{
-+ up->serial_out(up, offset, value);
-+}
-+
- /*
- * This is the state information which is persistent across opens.
- */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0003-dmaengine-failure-to-get-a-specific-DMA-channel-is-n.patch b/patches.kzm9g/0003-dmaengine-failure-to-get-a-specific-DMA-channel-is-n.patch
deleted file mode 100644
index a57dbe97cab20a..00000000000000
--- a/patches.kzm9g/0003-dmaengine-failure-to-get-a-specific-DMA-channel-is-n.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From d607a7087661613a9c1e4a45ae548570061bc6b8 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Mon, 20 Jun 2011 17:02:47 +0200
-Subject: dmaengine: failure to get a specific DMA channel is not critical
-
-There exist systems with multiple DMA controllers with different
-capabilities. For example, on some sh-mobile / rmobile systems there are
-DMA controllers, whose channels can be configured to be used with
-SD- and MMC-host controllers, serial ports etc. Besides there are also
-DMA controllers, that can only be used for one special function, e.g.,
-for USB. In such cases the DMA client filter function can just choose
-to specify to the DMA driver, which channel it needs. Then the
-.device_alloc_chan_resources() method of the DMA driver will check,
-whether it can provide that dunction. If not, it will fail and the loop
-in __dma_request_channel() will continue to the next DMA device, until
-it finds a suitable one. This works fine with just one minor glitch:
-the kernel logs error messages like
-
-dmaengine: failed to get <channel name>: (-<error code>)
-
-after each such non-critical failure. This patch lowers priority of
-this message to the debug level.
-
-Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-(cherry picked from commit a03a202e95fdaa3ff52ccfc2594ec531e5917816)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/dmaengine.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index 48694c3..26374b2 100644
---- a/drivers/dma/dmaengine.c
-+++ b/drivers/dma/dmaengine.c
-@@ -510,8 +510,8 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
- dma_chan_name(chan));
- list_del_rcu(&device->global_node);
- } else if (err)
-- pr_err("dmaengine: failed to get %s: (%d)\n",
-- dma_chan_name(chan), err);
-+ pr_debug("dmaengine: failed to get %s: (%d)\n",
-+ dma_chan_name(chan), err);
- else
- break;
- if (--device->privatecnt == 0)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0003-serial-8250-increase-PASS_LIMIT.patch b/patches.kzm9g/0003-serial-8250-increase-PASS_LIMIT.patch
deleted file mode 100644
index f2433d9055fa8a..00000000000000
--- a/patches.kzm9g/0003-serial-8250-increase-PASS_LIMIT.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 0028c21552eb37ad26e53e0d6d0a977d886b0abf Mon Sep 17 00:00:00 2001
-From: Jiri Slaby <jirislaby@gmail.com>
-Date: Sun, 5 Jun 2011 22:51:49 +0200
-Subject: serial: 8250, increase PASS_LIMIT
-
-With virtual machines like qemu, it's pretty common to see "too much
-work for irq4" messages nowadays. This happens when a bunch of output
-is printed on the emulated serial console. This is caused by too low
-PASS_LIMIT. When ISR loops more than the limit, it spits the message.
-
-I've been using a kernel with doubled the limit and I couldn't see no
-problems. Maybe it's time to get rid of the message now?
-
-Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
-Cc: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit e7328ae1848966181a7ac47e8ae6cddbd2cf55f3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 762ce72..7f50999 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -81,7 +81,7 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
- #define DEBUG_INTR(fmt...) do { } while (0)
- #endif
-
--#define PASS_LIMIT 256
-+#define PASS_LIMIT 512
-
- #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0004-Improve-slave-cyclic-DMA-engine-documentation.patch b/patches.kzm9g/0004-Improve-slave-cyclic-DMA-engine-documentation.patch
deleted file mode 100644
index 66ba26c33f5787..00000000000000
--- a/patches.kzm9g/0004-Improve-slave-cyclic-DMA-engine-documentation.patch
+++ /dev/null
@@ -1,279 +0,0 @@
-From 8c0defafbf160e399767547d7b08b19fba273026 Mon Sep 17 00:00:00 2001
-From: Russell King - ARM Linux <linux@arm.linux.org.uk>
-Date: Tue, 26 Jul 2011 14:25:10 +0100
-Subject: Improve slave/cyclic DMA engine documentation
-
-Improve the documentation for the slave and cyclic DMA engine support
-reformatting it for easier reading, adding further APIs, splitting it
-into five steps, and including references to the documentation in
-dmaengine.h.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-[Fixed the index title to reflect new changes]
-Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-(cherry picked from commit 5a42fb93e6a33224774786691027ef2d9795c245)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/dmaengine.txt | 234 +++++++++++++++++++++++++++++++-------------
- 1 file changed, 164 insertions(+), 70 deletions(-)
-
-diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt
-index 5a0cb1e..94b7e0f 100644
---- a/Documentation/dmaengine.txt
-+++ b/Documentation/dmaengine.txt
-@@ -10,87 +10,181 @@ NOTE: For DMA Engine usage in async_tx please see:
- Below is a guide to device driver writers on how to use the Slave-DMA API of the
- DMA Engine. This is applicable only for slave DMA usage only.
-
--The slave DMA usage consists of following steps
-+The slave DMA usage consists of following steps:
- 1. Allocate a DMA slave channel
- 2. Set slave and controller specific parameters
- 3. Get a descriptor for transaction
--4. Submit the transaction and wait for callback notification
-+4. Submit the transaction
-+5. Issue pending requests and wait for callback notification
-
- 1. Allocate a DMA slave channel
--Channel allocation is slightly different in the slave DMA context, client
--drivers typically need a channel from a particular DMA controller only and even
--in some cases a specific channel is desired. To request a channel
--dma_request_channel() API is used.
--
--Interface:
--struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
-- dma_filter_fn filter_fn,
-- void *filter_param);
--where dma_filter_fn is defined as:
--typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
--
--When the optional 'filter_fn' parameter is set to NULL dma_request_channel
--simply returns the first channel that satisfies the capability mask. Otherwise,
--when the mask parameter is insufficient for specifying the necessary channel,
--the filter_fn routine can be used to disposition the available channels in the
--system. The filter_fn routine is called once for each free channel in the
--system. Upon seeing a suitable channel filter_fn returns DMA_ACK which flags
--that channel to be the return value from dma_request_channel. A channel
--allocated via this interface is exclusive to the caller, until
--dma_release_channel() is called.
-+
-+ Channel allocation is slightly different in the slave DMA context,
-+ client drivers typically need a channel from a particular DMA
-+ controller only and even in some cases a specific channel is desired.
-+ To request a channel dma_request_channel() API is used.
-+
-+ Interface:
-+ struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
-+ dma_filter_fn filter_fn,
-+ void *filter_param);
-+ where dma_filter_fn is defined as:
-+ typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
-+
-+ The 'filter_fn' parameter is optional, but highly recommended for
-+ slave and cyclic channels as they typically need to obtain a specific
-+ DMA channel.
-+
-+ When the optional 'filter_fn' parameter is NULL, dma_request_channel()
-+ simply returns the first channel that satisfies the capability mask.
-+
-+ Otherwise, the 'filter_fn' routine will be called once for each free
-+ channel which has a capability in 'mask'. 'filter_fn' is expected to
-+ return 'true' when the desired DMA channel is found.
-+
-+ A channel allocated via this interface is exclusive to the caller,
-+ until dma_release_channel() is called.
-
- 2. Set slave and controller specific parameters
--Next step is always to pass some specific information to the DMA driver. Most of
--the generic information which a slave DMA can use is in struct dma_slave_config.
--It allows the clients to specify DMA direction, DMA addresses, bus widths, DMA
--burst lengths etc. If some DMA controllers have more parameters to be sent then
--they should try to embed struct dma_slave_config in their controller specific
--structure. That gives flexibility to client to pass more parameters, if
--required.
--
--Interface:
--int dmaengine_slave_config(struct dma_chan *chan,
-- struct dma_slave_config *config)
-+
-+ Next step is always to pass some specific information to the DMA
-+ driver. Most of the generic information which a slave DMA can use
-+ is in struct dma_slave_config. This allows the clients to specify
-+ DMA direction, DMA addresses, bus widths, DMA burst lengths etc
-+ for the peripheral.
-+
-+ If some DMA controllers have more parameters to be sent then they
-+ should try to embed struct dma_slave_config in their controller
-+ specific structure. That gives flexibility to client to pass more
-+ parameters, if required.
-+
-+ Interface:
-+ int dmaengine_slave_config(struct dma_chan *chan,
-+ struct dma_slave_config *config)
-+
-+ Please see the dma_slave_config structure definition in dmaengine.h
-+ for a detailed explaination of the struct members. Please note
-+ that the 'direction' member will be going away as it duplicates the
-+ direction given in the prepare call.
-
- 3. Get a descriptor for transaction
--For slave usage the various modes of slave transfers supported by the
--DMA-engine are:
--slave_sg - DMA a list of scatter gather buffers from/to a peripheral
--dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the
-+
-+ For slave usage the various modes of slave transfers supported by the
-+ DMA-engine are:
-+
-+ slave_sg - DMA a list of scatter gather buffers from/to a peripheral
-+ dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the
- operation is explicitly stopped.
--The non NULL return of this transfer API represents a "descriptor" for the given
--transaction.
--
--Interface:
--struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_sg)(
-- struct dma_chan *chan,
-- struct scatterlist *dst_sg, unsigned int dst_nents,
-- struct scatterlist *src_sg, unsigned int src_nents,
-+
-+ A non-NULL return of this transfer API represents a "descriptor" for
-+ the given transaction.
-+
-+ Interface:
-+ struct dma_async_tx_descriptor *(*chan->device->device_prep_slave_sg)(
-+ struct dma_chan *chan, struct scatterlist *sgl,
-+ unsigned int sg_len, enum dma_data_direction direction,
- unsigned long flags);
--struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_cyclic)(
-+
-+ struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_cyclic)(
- struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
- size_t period_len, enum dma_data_direction direction);
-
--4. Submit the transaction and wait for callback notification
--To schedule the transaction to be scheduled by dma device, the "descriptor"
--returned in above (3) needs to be submitted.
--To tell the dma driver that a transaction is ready to be serviced, the
--descriptor->submit() callback needs to be invoked. This chains the descriptor to
--the pending queue.
--The transactions in the pending queue can be activated by calling the
--issue_pending API. If channel is idle then the first transaction in queue is
--started and subsequent ones queued up.
--On completion of the DMA operation the next in queue is submitted and a tasklet
--triggered. The tasklet would then call the client driver completion callback
--routine for notification, if set.
--Interface:
--void dma_async_issue_pending(struct dma_chan *chan);
--
--==============================================================================
--
--Additional usage notes for dma driver writers
--1/ Although DMA engine specifies that completion callback routines cannot submit
--any new operations, but typically for slave DMA subsequent transaction may not
--be available for submit prior to callback routine being called. This requirement
--is not a requirement for DMA-slave devices. But they should take care to drop
--the spin-lock they might be holding before calling the callback routine
-+ The peripheral driver is expected to have mapped the scatterlist for
-+ the DMA operation prior to calling device_prep_slave_sg, and must
-+ keep the scatterlist mapped until the DMA operation has completed.
-+ The scatterlist must be mapped using the DMA struct device. So,
-+ normal setup should look like this:
-+
-+ nr_sg = dma_map_sg(chan->device->dev, sgl, sg_len);
-+ if (nr_sg == 0)
-+ /* error */
-+
-+ desc = chan->device->device_prep_slave_sg(chan, sgl, nr_sg,
-+ direction, flags);
-+
-+ Once a descriptor has been obtained, the callback information can be
-+ added and the descriptor must then be submitted. Some DMA engine
-+ drivers may hold a spinlock between a successful preparation and
-+ submission so it is important that these two operations are closely
-+ paired.
-+
-+ Note:
-+ Although the async_tx API specifies that completion callback
-+ routines cannot submit any new operations, this is not the
-+ case for slave/cyclic DMA.
-+
-+ For slave DMA, the subsequent transaction may not be available
-+ for submission prior to callback function being invoked, so
-+ slave DMA callbacks are permitted to prepare and submit a new
-+ transaction.
-+
-+ For cyclic DMA, a callback function may wish to terminate the
-+ DMA via dmaengine_terminate_all().
-+
-+ Therefore, it is important that DMA engine drivers drop any
-+ locks before calling the callback function which may cause a
-+ deadlock.
-+
-+ Note that callbacks will always be invoked from the DMA
-+ engines tasklet, never from interrupt context.
-+
-+4. Submit the transaction
-+
-+ Once the descriptor has been prepared and the callback information
-+ added, it must be placed on the DMA engine drivers pending queue.
-+
-+ Interface:
-+ dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
-+
-+ This returns a cookie can be used to check the progress of DMA engine
-+ activity via other DMA engine calls not covered in this document.
-+
-+ dmaengine_submit() will not start the DMA operation, it merely adds
-+ it to the pending queue. For this, see step 5, dma_async_issue_pending.
-+
-+5. Issue pending DMA requests and wait for callback notification
-+
-+ The transactions in the pending queue can be activated by calling the
-+ issue_pending API. If channel is idle then the first transaction in
-+ queue is started and subsequent ones queued up.
-+
-+ On completion of each DMA operation, the next in queue is started and
-+ a tasklet triggered. The tasklet will then call the client driver
-+ completion callback routine for notification, if set.
-+
-+ Interface:
-+ void dma_async_issue_pending(struct dma_chan *chan);
-+
-+Further APIs:
-+
-+1. int dmaengine_terminate_all(struct dma_chan *chan)
-+
-+ This causes all activity for the DMA channel to be stopped, and may
-+ discard data in the DMA FIFO which hasn't been fully transferred.
-+ No callback functions will be called for any incomplete transfers.
-+
-+2. int dmaengine_pause(struct dma_chan *chan)
-+
-+ This pauses activity on the DMA channel without data loss.
-+
-+3. int dmaengine_resume(struct dma_chan *chan)
-+
-+ Resume a previously paused DMA channel. It is invalid to resume a
-+ channel which is not currently paused.
-+
-+4. enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
-+ dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
-+
-+ This can be used to check the status of the channel. Please see
-+ the documentation in include/linux/dmaengine.h for a more complete
-+ description of this API.
-+
-+ This can be used in conjunction with dma_async_is_complete() and
-+ the cookie returned from 'descriptor->submit()' to check for
-+ completion of a specific DMA transaction.
-+
-+ Note:
-+ Not all DMA engine drivers can return reliable information for
-+ a running DMA channel. It is recommended that DMA engine users
-+ pause or stop (via dmaengine_terminate_all) the channel before
-+ using this API.
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0004-serial-Fix-wakeup-init-logic-to-speed-up-startup.patch b/patches.kzm9g/0004-serial-Fix-wakeup-init-logic-to-speed-up-startup.patch
deleted file mode 100644
index 6a58103c6edb37..00000000000000
--- a/patches.kzm9g/0004-serial-Fix-wakeup-init-logic-to-speed-up-startup.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From da29566854e9ffb6770255fbd915184073d2d0b1 Mon Sep 17 00:00:00 2001
-From: Simon Glass <sjg@chromium.org>
-Date: Thu, 19 Jan 2012 11:28:56 -0800
-Subject: serial: Fix wakeup init logic to speed up startup
-
-The synchronize_rcu() call resulting from making every serial driver
-wake-up capable (commit b3b708fa) slows boot down on my Tegra2x system
-(with CONFIG_PREEMPT disabled).
-
-But this is avoidable since it is the device_set_wakeup_enable() and then
-subsequence disable which causes the delay. We might as well just make
-the device wakeup capable but not actually enable it for wakeup until
-needed.
-
-Effectively the current code does this:
-
- device_set_wakeup_capable(dev, 1);
- device_set_wakeup_enable(dev, 1);
- device_set_wakeup_enable(dev, 0);
-
-We can just drop the last two lines.
-
-Before this change my boot log says:
-[ 0.227062] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
-[ 0.702928] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra
-
-after:
-[ 0.227264] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
-[ 0.227983] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra
-
-for saving of 450ms.
-
-Suggested-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
-Signed-off-by: Simon Glass <sjg@chromium.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 773598357c0baf03081cf87f2b444f97744faf1e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/serial_core.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/tty/serial/serial_core.c
-+++ b/drivers/tty/serial/serial_core.c
-@@ -2391,11 +2391,11 @@ int uart_add_one_port(struct uart_driver
- */
- tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev);
- if (likely(!IS_ERR(tty_dev))) {
-- device_init_wakeup(tty_dev, 1);
-- device_set_wakeup_enable(tty_dev, 0);
-- } else
-+ device_set_wakeup_capable(tty_dev, 1);
-+ } else {
- printk(KERN_ERR "Cannot register tty device on line %d\n",
- uport->line);
-+ }
-
- /*
- * Ensure UPF_DEAD is not set.
diff --git a/patches.kzm9g/0005-dmaengine-use-DEFINE_IDR-for-static-initialization.patch b/patches.kzm9g/0005-dmaengine-use-DEFINE_IDR-for-static-initialization.patch
deleted file mode 100644
index d954e2422daa19..00000000000000
--- a/patches.kzm9g/0005-dmaengine-use-DEFINE_IDR-for-static-initialization.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From b30e6b9e041ba92ec2ce074eff1e7094e047f036 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Wed, 20 Jul 2011 11:32:28 +0800
-Subject: dmaengine: use DEFINE_IDR for static initialization
-
-We could use DEFINE_IDR for statically allocated idr
-that allow us to save a few lines of code.
-
-And also remove unneeded mutex_init() for dma_list_mutex, as
-dma_list_mutex is initialized automatically by DEFINE_MUTEX().
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-(cherry picked from commit 21ef4b8b7a7d59a995bf44382de38c95587767d4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/dmaengine.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index 26374b2..b48967b 100644
---- a/drivers/dma/dmaengine.c
-+++ b/drivers/dma/dmaengine.c
-@@ -62,9 +62,9 @@
- #include <linux/slab.h>
-
- static DEFINE_MUTEX(dma_list_mutex);
-+static DEFINE_IDR(dma_idr);
- static LIST_HEAD(dma_device_list);
- static long dmaengine_ref_count;
--static struct idr dma_idr;
-
- /* --- sysfs implementation --- */
-
-@@ -1050,8 +1050,6 @@ EXPORT_SYMBOL_GPL(dma_run_dependencies);
-
- static int __init dma_bus_init(void)
- {
-- idr_init(&dma_idr);
-- mutex_init(&dma_list_mutex);
- return class_register(&dma_devclass);
- }
- arch_initcall(dma_bus_init);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0005-tty-serial8250-allow-platforms-to-override-irq-handl.patch b/patches.kzm9g/0005-tty-serial8250-allow-platforms-to-override-irq-handl.patch
deleted file mode 100644
index a12baef1285a9a..00000000000000
--- a/patches.kzm9g/0005-tty-serial8250-allow-platforms-to-override-irq-handl.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From 5d815ba3618efabed3571204df30a309d2471aee Mon Sep 17 00:00:00 2001
-From: Jamie Iles <jamie@jamieiles.com>
-Date: Mon, 15 Aug 2011 10:17:52 +0100
-Subject: tty: serial8250: allow platforms to override irq handler
-
-Some ports (e.g. Synopsys DesignWare 8250) have special requirements for
-handling the interrupts. Allow these platforms to specify their own
-interrupt handler that will override the default.
-serial8250_handle_irq() is provided so that platforms can extend the IRQ
-handler rather than completely replacing it.
-
-Signed-off-by: Jamie Iles <jamie@jamieiles.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 583d28e92f667eb6cc81ea87daaa7e321c23fe14)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 39 +++++++++++++++++++++++++++++++++++----
- include/linux/serial_8250.h | 2 ++
- 2 files changed, 37 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 7f50999..97007e5 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -509,6 +509,8 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
- outb(value, p->iobase + offset);
- }
-
-+static int serial8250_default_handle_irq(struct uart_port *port);
-+
- static void set_io_from_upio(struct uart_port *p)
- {
- struct uart_8250_port *up =
-@@ -557,6 +559,7 @@ static void set_io_from_upio(struct uart_port *p)
- }
- /* Remember loaded iotype */
- up->cur_iotype = p->iotype;
-+ p->handle_irq = serial8250_default_handle_irq;
- }
-
- static void
-@@ -1621,6 +1624,28 @@ static void serial8250_handle_port(struct uart_8250_port *up)
- spin_unlock_irqrestore(&up->port.lock, flags);
- }
-
-+int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
-+{
-+ struct uart_8250_port *up =
-+ container_of(port, struct uart_8250_port, port);
-+
-+ if (!(iir & UART_IIR_NO_INT)) {
-+ serial8250_handle_port(up);
-+ return 1;
-+ }
-+
-+ return 0;
-+}
-+
-+static int serial8250_default_handle_irq(struct uart_port *port)
-+{
-+ struct uart_8250_port *up =
-+ container_of(port, struct uart_8250_port, port);
-+ unsigned int iir = serial_in(up, UART_IIR);
-+
-+ return serial8250_handle_irq(port, iir);
-+}
-+
- /*
- * This is the serial driver's interrupt routine.
- *
-@@ -1648,13 +1673,12 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
- l = i->head;
- do {
- struct uart_8250_port *up;
-- unsigned int iir;
-+ struct uart_port *port;
-
- up = list_entry(l, struct uart_8250_port, list);
-+ port = &up->port;
-
-- iir = serial_in(up, UART_IIR);
-- if (!(iir & UART_IIR_NO_INT)) {
-- serial8250_handle_port(up);
-+ if (port->handle_irq(port)) {
-
- handled = 1;
-
-@@ -3050,6 +3074,10 @@ int __init early_serial_setup(struct uart_port *port)
- p->serial_in = port->serial_in;
- if (port->serial_out)
- p->serial_out = port->serial_out;
-+ if (port->handle_irq)
-+ p->handle_irq = port->handle_irq;
-+ else
-+ p->handle_irq = serial8250_default_handle_irq;
-
- return 0;
- }
-@@ -3118,6 +3146,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
- port.type = p->type;
- port.serial_in = p->serial_in;
- port.serial_out = p->serial_out;
-+ port.handle_irq = p->handle_irq;
- port.set_termios = p->set_termios;
- port.pm = p->pm;
- port.dev = &dev->dev;
-@@ -3283,6 +3312,8 @@ int serial8250_register_port(struct uart_port *port)
- uart->port.serial_in = port->serial_in;
- if (port->serial_out)
- uart->port.serial_out = port->serial_out;
-+ if (port->handle_irq)
-+ uart->port.handle_irq = port->handle_irq;
- /* Possibly override set_termios call */
- if (port->set_termios)
- uart->port.set_termios = port->set_termios;
-diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
-index 97f5b45..1f05bbe 100644
---- a/include/linux/serial_8250.h
-+++ b/include/linux/serial_8250.h
-@@ -35,6 +35,7 @@ struct plat_serial8250_port {
- void (*set_termios)(struct uart_port *,
- struct ktermios *new,
- struct ktermios *old);
-+ int (*handle_irq)(struct uart_port *);
- void (*pm)(struct uart_port *, unsigned int state,
- unsigned old);
- };
-@@ -80,6 +81,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
- struct ktermios *termios, struct ktermios *old);
- extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate);
-+int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
-
- extern void serial8250_set_isa_configurator(void (*v)
- (int port, struct uart_port *up,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0006-dmaengine-add-helper-function-for-slave_single.patch b/patches.kzm9g/0006-dmaengine-add-helper-function-for-slave_single.patch
deleted file mode 100644
index f16c73a718e7dc..00000000000000
--- a/patches.kzm9g/0006-dmaengine-add-helper-function-for-slave_single.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 1259f8b41cee5c445fd905087ec351f3e3f6524d Mon Sep 17 00:00:00 2001
-From: Vinod Koul <vinod.koul@intel.com>
-Date: Mon, 25 Jul 2011 19:57:52 +0530
-Subject: dmaengine: add helper function for slave_single
-
-For clients which require a single slave transfer and dont want to be bothered
-about the scatterlist api, this helper gives simple API for this transfer and
-creates single scatterlist for DMA API
-
-Idea from Russell King
-
-Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-(cherry picked from commit 90b44f8ffdf6c66d190ee71b330009bf7f11a208)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 8bf1032..2ae9e01 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -24,6 +24,7 @@
- #include <linux/device.h>
- #include <linux/uio.h>
- #include <linux/dma-mapping.h>
-+#include <linux/scatterlist.h>
-
- struct scatterlist;
-
-@@ -519,6 +520,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
- (unsigned long)config);
- }
-
-+static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
-+ struct dma_chan *chan, void *buf, size_t len,
-+ enum dma_data_direction dir, unsigned long flags)
-+{
-+ struct scatterlist sg;
-+ sg_init_one(&sg, buf, len);
-+
-+ return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
-+}
-+
- static inline int dmaengine_terminate_all(struct dma_chan *chan)
- {
- return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0006-tty-serial8250-remove-UPIO_DWAPB-32.patch b/patches.kzm9g/0006-tty-serial8250-remove-UPIO_DWAPB-32.patch
deleted file mode 100644
index 098799ff62900b..00000000000000
--- a/patches.kzm9g/0006-tty-serial8250-remove-UPIO_DWAPB-32.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From ea7db772ed2f7cf3ce5d40ea3da4f4ead0505fb2 Mon Sep 17 00:00:00 2001
-From: Jamie Iles <jamie@jamieiles.com>
-Date: Mon, 15 Aug 2011 10:17:55 +0100
-Subject: tty: serial8250: remove UPIO_DWAPB{,32}
-
-Now that platforms can override the port IRQ handler and the only user
-of these UPIO modes has been converted over, kill off UPIO_DWAPB and
-UPIO_DWAPB32.
-
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Jamie Iles <jamie@jamieiles.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 4834d028978583dfe8e1fc19f1180ceb03d8dfb7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 68 ---------------------------------------
- drivers/tty/serial/serial_core.c | 4 --
- include/linux/serial_core.h | 4 --
- 3 files changed, 1 insertion(+), 75 deletions(-)
-
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -461,42 +461,6 @@ static void tsi_serial_out(struct uart_p
- writeb(value, p->membase + offset);
- }
-
--/* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */
--static inline void dwapb_save_out_value(struct uart_port *p, int offset,
-- int value)
--{
-- struct uart_8250_port *up =
-- container_of(p, struct uart_8250_port, port);
--
-- if (offset == UART_LCR)
-- up->lcr = value;
--}
--
--/* Read the IER to ensure any interrupt is cleared before returning from ISR. */
--static inline void dwapb_check_clear_ier(struct uart_port *p, int offset)
--{
-- if (offset == UART_TX || offset == UART_IER)
-- p->serial_in(p, UART_IER);
--}
--
--static void dwapb_serial_out(struct uart_port *p, int offset, int value)
--{
-- int save_offset = offset;
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-- dwapb_save_out_value(p, save_offset, value);
-- writeb(value, p->membase + offset);
-- dwapb_check_clear_ier(p, save_offset);
--}
--
--static void dwapb32_serial_out(struct uart_port *p, int offset, int value)
--{
-- int save_offset = offset;
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-- dwapb_save_out_value(p, save_offset, value);
-- writel(value, p->membase + offset);
-- dwapb_check_clear_ier(p, save_offset);
--}
--
- static unsigned int io_serial_in(struct uart_port *p, int offset)
- {
- offset = map_8250_in_reg(p, offset) << p->regshift;
-@@ -542,16 +506,6 @@ static void set_io_from_upio(struct uart
- p->serial_out = tsi_serial_out;
- break;
-
-- case UPIO_DWAPB:
-- p->serial_in = mem_serial_in;
-- p->serial_out = dwapb_serial_out;
-- break;
--
-- case UPIO_DWAPB32:
-- p->serial_in = mem32_serial_in;
-- p->serial_out = dwapb32_serial_out;
-- break;
--
- default:
- p->serial_in = io_serial_in;
- p->serial_out = io_serial_out;
-@@ -570,8 +524,6 @@ serial_out_sync(struct uart_8250_port *u
- case UPIO_MEM:
- case UPIO_MEM32:
- case UPIO_AU:
-- case UPIO_DWAPB:
-- case UPIO_DWAPB32:
- p->serial_out(p, offset, value);
- p->serial_in(p, UART_LCR); /* safe, no side-effects */
- break;
-@@ -1679,23 +1631,7 @@ static irqreturn_t serial8250_interrupt(
- port = &up->port;
-
- if (port->handle_irq(port)) {
--
- handled = 1;
--
-- end = NULL;
-- } else if ((up->port.iotype == UPIO_DWAPB ||
-- up->port.iotype == UPIO_DWAPB32) &&
-- (iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
-- /* The DesignWare APB UART has an Busy Detect (0x07)
-- * interrupt meaning an LCR write attempt occurred while the
-- * UART was busy. The interrupt must be cleared by reading
-- * the UART status register (USR) and the LCR re-written. */
-- unsigned int status;
-- status = *(volatile u32 *)up->port.private_data;
-- serial_out(up, UART_LCR, up->lcr);
--
-- handled = 1;
--
- end = NULL;
- } else if (end == NULL)
- end = l;
-@@ -2594,8 +2530,6 @@ static int serial8250_request_std_resour
- case UPIO_TSI:
- case UPIO_MEM32:
- case UPIO_MEM:
-- case UPIO_DWAPB:
-- case UPIO_DWAPB32:
- if (!up->port.mapbase)
- break;
-
-@@ -2632,8 +2566,6 @@ static void serial8250_release_std_resou
- case UPIO_TSI:
- case UPIO_MEM32:
- case UPIO_MEM:
-- case UPIO_DWAPB:
-- case UPIO_DWAPB32:
- if (!up->port.mapbase)
- break;
-
---- a/drivers/tty/serial/serial_core.c
-+++ b/drivers/tty/serial/serial_core.c
-@@ -2065,8 +2065,6 @@ uart_report_port(struct uart_driver *drv
- case UPIO_MEM32:
- case UPIO_AU:
- case UPIO_TSI:
-- case UPIO_DWAPB:
-- case UPIO_DWAPB32:
- snprintf(address, sizeof(address),
- "MMIO 0x%llx", (unsigned long long)port->mapbase);
- break;
-@@ -2487,8 +2485,6 @@ int uart_match_port(struct uart_port *po
- case UPIO_MEM32:
- case UPIO_AU:
- case UPIO_TSI:
-- case UPIO_DWAPB:
-- case UPIO_DWAPB32:
- return (port1->mapbase == port2->mapbase);
- }
- return 0;
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -318,9 +318,7 @@ struct uart_port {
- #define UPIO_MEM32 (3)
- #define UPIO_AU (4) /* Au1x00 type IO */
- #define UPIO_TSI (5) /* Tsi108/109 type IO */
--#define UPIO_DWAPB (6) /* DesignWare APB UART */
--#define UPIO_RM9000 (7) /* RM9000 type IO */
--#define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */
-+#define UPIO_RM9000 (6) /* RM9000 type IO */
-
- unsigned int read_status_mask; /* driver specific */
- unsigned int ignore_status_mask; /* driver specific */
diff --git a/patches.kzm9g/0007-dmaengine-remove-struct-scatterlist-for-header.patch b/patches.kzm9g/0007-dmaengine-remove-struct-scatterlist-for-header.patch
deleted file mode 100644
index 90fd360233b3bf..00000000000000
--- a/patches.kzm9g/0007-dmaengine-remove-struct-scatterlist-for-header.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d8000e0bf432de5c7bb8454e660c6d6d75f7df0c Mon Sep 17 00:00:00 2001
-From: Vinod Koul <vinod.koul@intel.com>
-Date: Tue, 9 Aug 2011 10:08:10 +0530
-Subject: dmaengine: remove struct scatterlist for header
-
-Commit 90b44f8 introduces dmaengine_prep_slave_single API which adds
-scatterlist.h in dmaengine.h, so defining struct scatterlist is not required
-
-Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-Acked-by: Dan Williams <dan.j.williams@intel.com>
-(cherry picked from commit a16e470caa173d323ef68dcac98c899b95fa4f84)
-
-Conflicts:
-
- include/linux/dmaengine.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 2ae9e01..0d079a4 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -26,8 +26,6 @@
- #include <linux/dma-mapping.h>
- #include <linux/scatterlist.h>
-
--struct scatterlist;
--
- /**
- * typedef dma_cookie_t - an opaque DMA cookie
- *
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0007-tty-8250-export-serial8250_handle_irq.patch b/patches.kzm9g/0007-tty-8250-export-serial8250_handle_irq.patch
deleted file mode 100644
index 3d88d9e48044bb..00000000000000
--- a/patches.kzm9g/0007-tty-8250-export-serial8250_handle_irq.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e54750f312943c2135375552a80f417f969ec95f Mon Sep 17 00:00:00 2001
-From: Jamie Iles <jamie@jamieiles.com>
-Date: Fri, 26 Aug 2011 19:04:49 +0100
-Subject: tty: 8250: export serial8250_handle_irq
-
-Allow modules to use the normal 8250 irq handler inside their own.
-
-Cc: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Jamie Iles <jamie@jamieiles.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit c7a1bdc5c951aae15021d13e3f5c0b2fe9d56112)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 5d92b93..454fc92 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -1588,6 +1588,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
-
- return 0;
- }
-+EXPORT_SYMBOL_GPL(serial8250_handle_irq);
-
- static int serial8250_default_handle_irq(struct uart_port *port)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0008-dmaengine-add-new-enum-dma_transfer_direction.patch b/patches.kzm9g/0008-dmaengine-add-new-enum-dma_transfer_direction.patch
deleted file mode 100644
index 24bd2ec0feaa0f..00000000000000
--- a/patches.kzm9g/0008-dmaengine-add-new-enum-dma_transfer_direction.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From f506f696ecb0ca3f9f34ea0bffbece7ed2c79342 Mon Sep 17 00:00:00 2001
-From: Vinod Koul <vinod.koul@linux.intel.com>
-Date: Thu, 13 Oct 2011 15:15:27 +0530
-Subject: dmaengine: add new enum dma_transfer_direction
-
-This new enum removes usage of dma_data_direction for dma direction. The new
-enum cleans tells the DMA direction and mode
-This further paves way for merging the dmaengine _prep operations and also for
-interleaved dma
-
-Suggested-by: Jassi Brar <jaswinder.singh@linaro.org>
-Reviewed-by: Barry Song <Baohua.Song@csr.com>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit 49920bc66984a512f4bcc7735a61642cd0e4d6f2)
-
-Conflicts:
-
- include/linux/dmaengine.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 21 +++++++++++++++++----
- 1 file changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 0d079a4..7a51acb 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -75,6 +75,19 @@ enum dma_transaction_type {
- /* last transaction type for creation of the capabilities mask */
- #define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
-
-+/**
-+ * enum dma_transfer_direction - dma transfer mode and direction indicator
-+ * @DMA_MEM_TO_MEM: Async/Memcpy mode
-+ * @DMA_MEM_TO_DEV: Slave mode & From Memory to Device
-+ * @DMA_DEV_TO_MEM: Slave mode & From Device to Memory
-+ * @DMA_DEV_TO_DEV: Slave mode & From Device to Device
-+ */
-+enum dma_transfer_direction {
-+ DMA_MEM_TO_MEM,
-+ DMA_MEM_TO_DEV,
-+ DMA_DEV_TO_MEM,
-+ DMA_DEV_TO_DEV,
-+};
-
- /**
- * enum dma_ctrl_flags - DMA flags to augment operation preparation,
-@@ -267,7 +280,7 @@ enum dma_slave_buswidth {
- * struct, if applicable.
- */
- struct dma_slave_config {
-- enum dma_data_direction direction;
-+ enum dma_transfer_direction direction;
- dma_addr_t src_addr;
- dma_addr_t dst_addr;
- enum dma_slave_buswidth src_addr_width;
-@@ -490,11 +503,11 @@ struct dma_device {
-
- struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
- struct dma_chan *chan, struct scatterlist *sgl,
-- unsigned int sg_len, enum dma_data_direction direction,
-+ unsigned int sg_len, enum dma_transfer_direction direction,
- unsigned long flags);
- struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
- struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
-- size_t period_len, enum dma_data_direction direction);
-+ size_t period_len, enum dma_transfer_direction direction);
- int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
- unsigned long arg);
-
-@@ -520,7 +533,7 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
-
- static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
- struct dma_chan *chan, void *buf, size_t len,
-- enum dma_data_direction dir, unsigned long flags)
-+ enum dma_transfer_direction dir, unsigned long flags)
- {
- struct scatterlist sg;
- sg_init_one(&sg, buf, len);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0008-serial-8250-Move-UPIO_TSI-to-powerpc.patch b/patches.kzm9g/0008-serial-8250-Move-UPIO_TSI-to-powerpc.patch
deleted file mode 100644
index c6b2a860b26229..00000000000000
--- a/patches.kzm9g/0008-serial-8250-Move-UPIO_TSI-to-powerpc.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From 173bc58b2e469e0f92a58de4b3644e171895300f Mon Sep 17 00:00:00 2001
-From: Arnd Bergmann <arnd@arndb.de>
-Date: Mon, 27 Jun 2011 11:45:16 +0000
-Subject: serial/8250: Move UPIO_TSI to powerpc
-
-This iotype is only used by the legacy_serial code in powerpc, so the
-code should live there, rather than be compiled in for every 8250
-driver.
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Cc: linuxppc-dev@lists.ozlabs.org
-Cc: Greg Kroah-Hartman <gregkh@suse.de>
-Cc: linux-serial@vger.kernel.org
-Acked-by: David Daney <david.daney@cavium.com>
-Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-(cherry picked from commit 7df5659eefad9b6d457ccdee016bd78bd064cfc0)
-
-Conflicts:
-
- drivers/tty/serial/8250.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/powerpc/kernel/legacy_serial.c | 25 +++++++++++++++++++++++++
- drivers/tty/serial/8250.c | 23 -----------------------
- 2 files changed, 25 insertions(+), 23 deletions(-)
-
-diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
-index 2b97b80..c7b5afe 100644
---- a/arch/powerpc/kernel/legacy_serial.c
-+++ b/arch/powerpc/kernel/legacy_serial.c
-@@ -6,6 +6,7 @@
- #include <linux/pci.h>
- #include <linux/of_address.h>
- #include <linux/of_device.h>
-+#include <linux/serial_reg.h>
- #include <asm/io.h>
- #include <asm/mmu.h>
- #include <asm/prom.h>
-@@ -47,6 +48,24 @@ static struct __initdata of_device_id legacy_serial_parents[] = {
- static unsigned int legacy_serial_count;
- static int legacy_serial_console = -1;
-
-+static unsigned int tsi_serial_in(struct uart_port *p, int offset)
-+{
-+ unsigned int tmp;
-+ offset = offset << p->regshift;
-+ if (offset == UART_IIR) {
-+ tmp = readl(p->membase + (UART_IIR & ~3));
-+ return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
-+ } else
-+ return readb(p->membase + offset);
-+}
-+
-+static void tsi_serial_out(struct uart_port *p, int offset, int value)
-+{
-+ offset = offset << p->regshift;
-+ if (!((offset == UART_IER) && (value & UART_IER_UUE)))
-+ writeb(value, p->membase + offset);
-+}
-+
- static int __init add_legacy_port(struct device_node *np, int want_index,
- int iotype, phys_addr_t base,
- phys_addr_t taddr, unsigned long irq,
-@@ -102,6 +121,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
- legacy_serial_ports[index].iobase = base;
- else
- legacy_serial_ports[index].mapbase = base;
-+
- legacy_serial_ports[index].iotype = iotype;
- legacy_serial_ports[index].uartclk = clock;
- legacy_serial_ports[index].irq = irq;
-@@ -112,6 +132,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
- legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0;
- legacy_serial_infos[index].irq_check_parent = irq_check_parent;
-
-+ if (iotype == UPIO_TSI) {
-+ legacy_serial_ports[index].serial_in = tsi_serial_in;
-+ legacy_serial_ports[index].serial_out = tsi_serial_out;
-+ }
-+
- printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
- index, np->full_name);
- printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 454fc92..a0e502b 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -443,24 +443,6 @@ static void au_serial_out(struct uart_port *p, int offset, int value)
- __raw_writel(value, p->membase + offset);
- }
-
--static unsigned int tsi_serial_in(struct uart_port *p, int offset)
--{
-- unsigned int tmp;
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-- if (offset == UART_IIR) {
-- tmp = readl(p->membase + (UART_IIR & ~3));
-- return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
-- } else
-- return readb(p->membase + offset);
--}
--
--static void tsi_serial_out(struct uart_port *p, int offset, int value)
--{
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-- if (!((offset == UART_IER) && (value & UART_IER_UUE)))
-- writeb(value, p->membase + offset);
--}
--
- static unsigned int io_serial_in(struct uart_port *p, int offset)
- {
- offset = map_8250_in_reg(p, offset) << p->regshift;
-@@ -501,11 +483,6 @@ static void set_io_from_upio(struct uart_port *p)
- p->serial_out = au_serial_out;
- break;
-
-- case UPIO_TSI:
-- p->serial_in = tsi_serial_in;
-- p->serial_out = tsi_serial_out;
-- break;
--
- default:
- p->serial_in = io_serial_in;
- p->serial_out = io_serial_out;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0009-linux-dmaengine.h-fix-implicit-use-of-bitmap.h-and-a.patch b/patches.kzm9g/0009-linux-dmaengine.h-fix-implicit-use-of-bitmap.h-and-a.patch
deleted file mode 100644
index 7845d6bbf189ba..00000000000000
--- a/patches.kzm9g/0009-linux-dmaengine.h-fix-implicit-use-of-bitmap.h-and-a.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 7f472b5f26b7ca5024aa78e636ecce48c03c3dc2 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Fri, 29 Jul 2011 16:55:11 +1000
-Subject: linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
-
-The implicit presence of module.h and all its sub-includes was
-masking these implicit header usages:
-
-include/linux/dmaengine.h:684: warning: 'struct page' declared inside parameter list
-include/linux/dmaengine.h:684: warning: its scope is only this definition or declaration, which is probably not what you want
-include/linux/dmaengine.h:687: warning: 'struct page' declared inside parameter list
-include/linux/dmaengine.h:736:2: error: implicit declaration of function 'bitmap_zero'
-
-With input from Stephen Rothwell <sfr@canb.auug.org.au>
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit a8efa9d6bf00fbe9597dd3352dc062a998bf9b15)
-
-Conflicts:
-
- include/linux/dmaengine.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 7a51acb..79d6881 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -25,6 +25,10 @@
- #include <linux/uio.h>
- #include <linux/dma-mapping.h>
- #include <linux/scatterlist.h>
-+#include <linux/bitmap.h>
-+#include <asm/page.h>
-+
-+struct scatterlist;
-
- /**
- * typedef dma_cookie_t - an opaque DMA cookie
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0009-serial-Support-the-EFR-register-of-XR1715x-uarts.patch b/patches.kzm9g/0009-serial-Support-the-EFR-register-of-XR1715x-uarts.patch
deleted file mode 100644
index 43c28f5c3a3329..00000000000000
--- a/patches.kzm9g/0009-serial-Support-the-EFR-register-of-XR1715x-uarts.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 5df029e7baab27a7b6f848739659865a006820f9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?S=C3=B8ren=20Holm?= <sgh@sgh.dk>
-Date: Fri, 2 Sep 2011 22:55:37 +0200
-Subject: serial: Support the EFR-register of XR1715x uarts.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The EFR (Enhenced-Features-Register) is located at a different offset
-than the other devices supporting UART_CAP_EFR. This change add a special
-setup quick to set UPF_EXAR_EFR on the port. UPF_EXAR_EFR is then used to
-the port type to PORT_XR17D15X since it is for sure a XR17D15X uart.
-
-Signed-off-by: Søren Holm <sgh@sgh.dk>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 06315348b16178e4c006e7892ef8e5e65f49c66a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 20 +++++++++++++++++++-
- drivers/tty/serial/8250_pci.c | 33 +++++++++++++++++++++++++++++++++
- include/linux/serial_core.h | 4 +++-
- include/linux/serial_reg.h | 1 +
- 4 files changed, 56 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index a0e502b..69802bd 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -309,6 +309,13 @@ static const struct serial8250_config uart_config[] = {
- UART_FCR_T_TRIG_01,
- .flags = UART_CAP_FIFO | UART_CAP_RTOIE,
- },
-+ [PORT_XR17D15X] = {
-+ .name = "XR17D15X",
-+ .fifo_size = 64,
-+ .tx_loadsz = 64,
-+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
-+ .flags = UART_CAP_FIFO | UART_CAP_AFE | UART_CAP_EFR,
-+ },
- };
-
- #if defined(CONFIG_MIPS_ALCHEMY)
-@@ -1052,6 +1059,14 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- serial_outp(up, UART_IER, iersave);
-
- /*
-+ * Exar uarts have EFR in a weird location
-+ */
-+ if (up->port.flags & UPF_EXAR_EFR) {
-+ up->port.type = PORT_XR17D15X;
-+ up->capabilities |= UART_CAP_AFE | UART_CAP_EFR;
-+ }
-+
-+ /*
- * We distinguish between 16550A and U6 16550A by counting
- * how many bytes are in the FIFO.
- */
-@@ -2396,7 +2411,10 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- efr |= UART_EFR_CTS;
-
- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(up, UART_EFR, efr);
-+ if (up->port.flags & UPF_EXAR_EFR)
-+ serial_outp(up, UART_XR_EFR, efr);
-+ else
-+ serial_outp(up, UART_EFR, efr);
- }
-
- #ifdef CONFIG_ARCH_OMAP
-diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
-index ff48fdb..a213f38 100644
---- a/drivers/tty/serial/8250_pci.c
-+++ b/drivers/tty/serial/8250_pci.c
-@@ -1003,6 +1003,15 @@ static int pci_eg20t_init(struct pci_dev *dev)
- #endif
- }
-
-+static int
-+pci_xr17c154_setup(struct serial_private *priv,
-+ const struct pciserial_board *board,
-+ struct uart_port *port, int idx)
-+{
-+ port->flags |= UPF_EXAR_EFR;
-+ return pci_default_setup(priv, board, port, idx);
-+}
-+
- /* This should be in linux/pci_ids.h */
- #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
- #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
-@@ -1407,6 +1416,30 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
- .setup = pci_timedia_setup,
- },
- /*
-+ * Exar cards
-+ */
-+ {
-+ .vendor = PCI_VENDOR_ID_EXAR,
-+ .device = PCI_DEVICE_ID_EXAR_XR17C152,
-+ .subvendor = PCI_ANY_ID,
-+ .subdevice = PCI_ANY_ID,
-+ .setup = pci_xr17c154_setup,
-+ },
-+ {
-+ .vendor = PCI_VENDOR_ID_EXAR,
-+ .device = PCI_DEVICE_ID_EXAR_XR17C154,
-+ .subvendor = PCI_ANY_ID,
-+ .subdevice = PCI_ANY_ID,
-+ .setup = pci_xr17c154_setup,
-+ },
-+ {
-+ .vendor = PCI_VENDOR_ID_EXAR,
-+ .device = PCI_DEVICE_ID_EXAR_XR17C158,
-+ .subvendor = PCI_ANY_ID,
-+ .subdevice = PCI_ANY_ID,
-+ .setup = pci_xr17c154_setup,
-+ },
-+ /*
- * Xircom cards
- */
- {
-diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
-index 4880024..d611ca0 100644
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -46,7 +46,8 @@
- #define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
- #define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
- #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
--#define PORT_MAX_8250 20 /* max port ID */
-+#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
-+#define PORT_MAX_8250 21 /* max port ID */
-
- /*
- * ARM specific type numbers. These are not currently guaranteed
-@@ -349,6 +350,7 @@ struct uart_port {
- #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
- #define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
- #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
-+#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
- /* The exact UART type is known and should not be probed. */
- #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
- #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
-diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
-index c75bda3..8ce70d7 100644
---- a/include/linux/serial_reg.h
-+++ b/include/linux/serial_reg.h
-@@ -152,6 +152,7 @@
- * LCR=0xBF (or DLAB=1 for 16C660)
- */
- #define UART_EFR 2 /* I/O: Extended Features Register */
-+#define UART_XR_EFR 9 /* I/O: Extended Features Register (XR17D15x) */
- #define UART_EFR_CTS 0x80 /* CTS flow control */
- #define UART_EFR_RTS 0x40 /* RTS flow control */
- #define UART_EFR_SCD 0x20 /* Special character detect */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/001-ltsi-backport-arm-mach-shmobile-kzm9g-add-smsc-9221-support.patch b/patches.kzm9g/001-ltsi-backport-arm-mach-shmobile-kzm9g-add-smsc-9221-support.patch
deleted file mode 100644
index 19dc86158db1ec..00000000000000
--- a/patches.kzm9g/001-ltsi-backport-arm-mach-shmobile-kzm9g-add-smsc-9221-support.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jun 26 04:09:54 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Tue, 26 Jun 2012 20:09:49 +0900
-Subject: [LTSI-dev] [PATCH 1/4] LTSI: backport: ARM: mach-shmobile: kzm9g: add SMSC 9221 support
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: kuninori.morimoto.gx@gmail.com
-Message-ID: <4FE9987D.9080304@kmckk.co.jp>
-
-
-This is backport of
-commit c15c4257a7858c6670f54c667f804df86a9fff1c
-
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 38 ++++++++++++++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index e0fd6e2..35af2f8 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -30,6 +30,7 @@
- #include <linux/mmc/sh_mobile_sdhi.h>
- #include <linux/mfd/tmio.h>
- #include <linux/platform_device.h>
-+#include <linux/smsc911x.h>
- #include <linux/videodev2.h>
- #include <sound/sh_fsi.h>
- #include <sound/simple_card.h>
-@@ -62,6 +63,35 @@
- * # amixer set "LINEOUT Mixer DACL" on
- */
-
-+/* SMSC 9221 */
-+static struct resource smsc9221_resources[] = {
-+ [0] = {
-+ .start = 0x10000000, /* CS4 */
-+ .end = 0x100000ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = intcs_evt2irq(0x260), /* IRQ3 */
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct smsc911x_platform_config smsc9221_platdata = {
-+ .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
-+ .phy_interface = PHY_INTERFACE_MODE_MII,
-+ .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-+ .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
-+};
-+
-+static struct platform_device smsc_device = {
-+ .name = "smsc911x",
-+ .dev = {
-+ .platform_data = &smsc9221_platdata,
-+ },
-+ .resource = smsc9221_resources,
-+ .num_resources = ARRAY_SIZE(smsc9221_resources),
-+};
-+
- /* LCDC */
- static struct fb_videomode kzm_lcdc_mode = {
- .name = "WVGA Panel",
-@@ -299,6 +329,7 @@ static struct i2c_board_info i2c3_devices[] = {
- };
-
- static struct platform_device *kzm_devices[] __initdata = {
-+ &smsc_device,
- &lcdc_device,
- &mmc_device,
- &sdhi0_device,
-@@ -443,6 +474,13 @@ static void __init kzm_init(void)
- gpio_request(GPIO_FN_FSIAISLD, NULL);
- gpio_request(GPIO_FN_FSIAOSLD, NULL);
-
-+ /* CS4 for SMSC/USB */
-+ gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */
-+
-+ /* SMSC */
-+ gpio_request(GPIO_PORT224, NULL); /* IRQ3 */
-+ gpio_direction_input(GPIO_PORT224);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
---
-1.7.9.5
-
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.kzm9g/0010-8250-ratelimit-LSR-safety-check-engaged-warning.patch b/patches.kzm9g/0010-8250-ratelimit-LSR-safety-check-engaged-warning.patch
deleted file mode 100644
index 14fcdd5e5e0251..00000000000000
--- a/patches.kzm9g/0010-8250-ratelimit-LSR-safety-check-engaged-warning.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 72ad6d3c5d84c98203676d587b25898690591ab7 Mon Sep 17 00:00:00 2001
-From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-Date: Mon, 26 Sep 2011 09:14:34 -0400
-Subject: 8250: ratelimit LSR safety check engaged warning.
-
-On my BIOSTAR TA890FXE the ttyS0 ends up spewing:
-
-[904682.485933] ttyS0: LSR safety check engaged!
-[904692.505895] ttyS0: LSR safety check engaged!
-[904702.525972] ttyS0: LSR safety check engaged!
-[904712.545967] ttyS0: LSR safety check engaged!
-[904722.566125] ttyS0: LSR safety check engaged!
-..
-lets limit it so it won't be the only thing visible
-in the ring buffer.
-
-CC: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 7808a4c4853fa0203085cf2217e01823d9f0c70c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 69802bd..eeadf1b 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -2034,8 +2034,8 @@ static int serial8250_startup(struct uart_port *port)
- */
- if (!(up->port.flags & UPF_BUGGY_UART) &&
- (serial_inp(up, UART_LSR) == 0xff)) {
-- printk(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
-- serial_index(&up->port));
-+ printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
-+ serial_index(&up->port));
- return -ENODEV;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0010-DMAEngine-Define-interleaved-transfer-request-api.patch b/patches.kzm9g/0010-DMAEngine-Define-interleaved-transfer-request-api.patch
deleted file mode 100644
index 53cc2f6ec6fba3..00000000000000
--- a/patches.kzm9g/0010-DMAEngine-Define-interleaved-transfer-request-api.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-From c6e7f820f97455f1f4320f3a9a925ee9e3a9c0c1 Mon Sep 17 00:00:00 2001
-From: Jassi Brar <jaswinder.singh@linaro.org>
-Date: Thu, 13 Oct 2011 12:33:30 +0530
-Subject: DMAEngine: Define interleaved transfer request api
-
-Define a new api that could be used for doing fancy data transfers
-like interleaved to contiguous copy and vice-versa.
-Traditional SG_list based transfers tend to be very inefficient in
-such cases as where the interleave and chunk are only a few bytes,
-which call for a very condensed api to convey pattern of the transfer.
-This api supports all 4 variants of scatter-gather and contiguous transfer.
-
-Of course, neither can this api help transfers that don't lend to DMA by
-nature, i.e, scattered tiny read/writes with no periodic pattern.
-
-Also since now we support SLAVE channels that might not provide
-device_prep_slave_sg callback but device_prep_interleaved_dma,
-remove the BUG_ON check.
-
-Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-Acked-by: Barry Song <Baohua.Song@csr.com>
-[renamed dmaxfer_template to dma_interleaved_template
- did fixup after the enum dma_transfer_merge]
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit b14dab792dee3245b628e046d80a7fad5573fea6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/dmaengine.txt | 8 +++++
- drivers/dma/dmaengine.c | 4 +--
- include/linux/dmaengine.h | 78 +++++++++++++++++++++++++++++++++++++++++++--
- 3 files changed, 85 insertions(+), 5 deletions(-)
-
-diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt
-index 94b7e0f..bbe6cb3 100644
---- a/Documentation/dmaengine.txt
-+++ b/Documentation/dmaengine.txt
-@@ -75,6 +75,10 @@ The slave DMA usage consists of following steps:
- slave_sg - DMA a list of scatter gather buffers from/to a peripheral
- dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the
- operation is explicitly stopped.
-+ interleaved_dma - This is common to Slave as well as M2M clients. For slave
-+ address of devices' fifo could be already known to the driver.
-+ Various types of operations could be expressed by setting
-+ appropriate values to the 'dma_interleaved_template' members.
-
- A non-NULL return of this transfer API represents a "descriptor" for
- the given transaction.
-@@ -89,6 +93,10 @@ The slave DMA usage consists of following steps:
- struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
- size_t period_len, enum dma_data_direction direction);
-
-+ struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
-+ struct dma_chan *chan, struct dma_interleaved_template *xt,
-+ unsigned long flags);
-+
- The peripheral driver is expected to have mapped the scatterlist for
- the DMA operation prior to calling device_prep_slave_sg, and must
- keep the scatterlist mapped until the DMA operation has completed.
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index b48967b..a6c6051 100644
---- a/drivers/dma/dmaengine.c
-+++ b/drivers/dma/dmaengine.c
-@@ -693,12 +693,12 @@ int dma_async_device_register(struct dma_device *device)
- !device->device_prep_dma_interrupt);
- BUG_ON(dma_has_cap(DMA_SG, device->cap_mask) &&
- !device->device_prep_dma_sg);
-- BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
-- !device->device_prep_slave_sg);
- BUG_ON(dma_has_cap(DMA_CYCLIC, device->cap_mask) &&
- !device->device_prep_dma_cyclic);
- BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
- !device->device_control);
-+ BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
-+ !device->device_prep_interleaved_dma);
-
- BUG_ON(!device->device_alloc_chan_resources);
- BUG_ON(!device->device_free_chan_resources);
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 79d6881..3489430 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -74,10 +74,10 @@ enum dma_transaction_type {
- DMA_ASYNC_TX,
- DMA_SLAVE,
- DMA_CYCLIC,
--};
--
-+ DMA_INTERLEAVE,
- /* last transaction type for creation of the capabilities mask */
--#define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
-+ DMA_TX_TYPE_END,
-+};
-
- /**
- * enum dma_transfer_direction - dma transfer mode and direction indicator
-@@ -94,6 +94,74 @@ enum dma_transfer_direction {
- };
-
- /**
-+ * Interleaved Transfer Request
-+ * ----------------------------
-+ * A chunk is collection of contiguous bytes to be transfered.
-+ * The gap(in bytes) between two chunks is called inter-chunk-gap(ICG).
-+ * ICGs may or maynot change between chunks.
-+ * A FRAME is the smallest series of contiguous {chunk,icg} pairs,
-+ * that when repeated an integral number of times, specifies the transfer.
-+ * A transfer template is specification of a Frame, the number of times
-+ * it is to be repeated and other per-transfer attributes.
-+ *
-+ * Practically, a client driver would have ready a template for each
-+ * type of transfer it is going to need during its lifetime and
-+ * set only 'src_start' and 'dst_start' before submitting the requests.
-+ *
-+ *
-+ * | Frame-1 | Frame-2 | ~ | Frame-'numf' |
-+ * |====....==.===...=...|====....==.===...=...| ~ |====....==.===...=...|
-+ *
-+ * == Chunk size
-+ * ... ICG
-+ */
-+
-+/**
-+ * struct data_chunk - Element of scatter-gather list that makes a frame.
-+ * @size: Number of bytes to read from source.
-+ * size_dst := fn(op, size_src), so doesn't mean much for destination.
-+ * @icg: Number of bytes to jump after last src/dst address of this
-+ * chunk and before first src/dst address for next chunk.
-+ * Ignored for dst(assumed 0), if dst_inc is true and dst_sgl is false.
-+ * Ignored for src(assumed 0), if src_inc is true and src_sgl is false.
-+ */
-+struct data_chunk {
-+ size_t size;
-+ size_t icg;
-+};
-+
-+/**
-+ * struct dma_interleaved_template - Template to convey DMAC the transfer pattern
-+ * and attributes.
-+ * @src_start: Bus address of source for the first chunk.
-+ * @dst_start: Bus address of destination for the first chunk.
-+ * @dir: Specifies the type of Source and Destination.
-+ * @src_inc: If the source address increments after reading from it.
-+ * @dst_inc: If the destination address increments after writing to it.
-+ * @src_sgl: If the 'icg' of sgl[] applies to Source (scattered read).
-+ * Otherwise, source is read contiguously (icg ignored).
-+ * Ignored if src_inc is false.
-+ * @dst_sgl: If the 'icg' of sgl[] applies to Destination (scattered write).
-+ * Otherwise, destination is filled contiguously (icg ignored).
-+ * Ignored if dst_inc is false.
-+ * @numf: Number of frames in this template.
-+ * @frame_size: Number of chunks in a frame i.e, size of sgl[].
-+ * @sgl: Array of {chunk,icg} pairs that make up a frame.
-+ */
-+struct dma_interleaved_template {
-+ dma_addr_t src_start;
-+ dma_addr_t dst_start;
-+ enum dma_transfer_direction dir;
-+ bool src_inc;
-+ bool dst_inc;
-+ bool src_sgl;
-+ bool dst_sgl;
-+ size_t numf;
-+ size_t frame_size;
-+ struct data_chunk sgl[0];
-+};
-+
-+/**
- * enum dma_ctrl_flags - DMA flags to augment operation preparation,
- * control completion, and communicate status.
- * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
-@@ -448,6 +516,7 @@ struct dma_tx_state {
- * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
- * The function takes a buffer of size buf_len. The callback function will
- * be called after period_len bytes have been transferred.
-+ * @device_prep_interleaved_dma: Transfer expression in a generic way.
- * @device_control: manipulate all pending operations on a channel, returns
- * zero or error code
- * @device_tx_status: poll for transaction completion, the optional
-@@ -512,6 +581,9 @@ struct dma_device {
- struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
- struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
- size_t period_len, enum dma_transfer_direction direction);
-+ struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
-+ struct dma_chan *chan, struct dma_interleaved_template *xt,
-+ unsigned long flags);
- int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
- unsigned long arg);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0011-dmaengine-add-DMA_TRANS_NONE-to-dma_transfer_directi.patch b/patches.kzm9g/0011-dmaengine-add-DMA_TRANS_NONE-to-dma_transfer_directi.patch
deleted file mode 100644
index b3bc13296a62a5..00000000000000
--- a/patches.kzm9g/0011-dmaengine-add-DMA_TRANS_NONE-to-dma_transfer_directi.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From d063219e6c8f9f5ec4f6b03c874f0e77d4ffc686 Mon Sep 17 00:00:00 2001
-From: Shawn Guo <shawn.guo@linaro.org>
-Date: Tue, 13 Dec 2011 23:48:03 +0800
-Subject: dmaengine: add DMA_TRANS_NONE to dma_transfer_direction
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before dma_transfer_direction was introduced to replace
-dma_data_direction, some dmaengine device uses DMA_NONE of
-dma_data_direction for some talk with its client drivers.
-The mxs-dma and its clients mxs-mmc and gpmi-nand are such case.
-
-This patch adds DMA_TRANS_NONE to dma_transfer_direction and
-migrate the DMA_NONE use in mxs-dma to it.
-
-It also fixes the compile warning below.
-
-CC drivers/dma/mxs-dma.o
-drivers/dma/mxs-dma.c: In function ‘mxs_dma_prep_slave_sg’:
-drivers/dma/mxs-dma.c:420:16: warning: comparison between ‘enum dma_transfer_direction’ and ‘enum dma_data_direction’
-
-Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit 62268ce9170c5466332c046ff6ddafcb67751502)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/mxs-dma.c | 2 +-
- include/linux/dmaengine.h | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
-index 88aad4f..428903d 100644
---- a/drivers/dma/mxs-dma.c
-+++ b/drivers/dma/mxs-dma.c
-@@ -412,7 +412,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
- idx = 0;
- }
-
-- if (direction == DMA_NONE) {
-+ if (direction == DMA_TRANS_NONE) {
- ccw = &mxs_chan->ccw[idx++];
- pio = (u32 *) sgl;
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 3489430..18e71fd 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -91,6 +91,7 @@ enum dma_transfer_direction {
- DMA_MEM_TO_DEV,
- DMA_DEV_TO_MEM,
- DMA_DEV_TO_DEV,
-+ DMA_TRANS_NONE,
- };
-
- /**
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0011-serial-8250-replace-hardcoded-0xbf-with-define.patch b/patches.kzm9g/0011-serial-8250-replace-hardcoded-0xbf-with-define.patch
deleted file mode 100644
index 97c8003f6ac0d1..00000000000000
--- a/patches.kzm9g/0011-serial-8250-replace-hardcoded-0xbf-with-define.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 698dcc00ab4b72502d3b69bf1167b7c3977f5e5a Mon Sep 17 00:00:00 2001
-From: Wolfram Sang <w.sang@pengutronix.de>
-Date: Fri, 9 Dec 2011 18:07:13 +0100
-Subject: serial: 8250: replace hardcoded 0xbf with #define
-
-Makes it easier to find all occurences requesting CONF_MODE_B.
-
-Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 7d73aaf1d45d9bd95638680361db4d019ebb75bb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index eeadf1b..f8f2320 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -2000,7 +2000,7 @@ static int serial8250_startup(struct uart_port *port)
- serial_outp(up, UART_IER, 0);
- serial_outp(up, UART_LCR, 0);
- serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
-- serial_outp(up, UART_LCR, 0xBF);
-+ serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
- serial_outp(up, UART_EFR, UART_EFR_ECB);
- serial_outp(up, UART_LCR, 0);
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0012-dmaengine-Add-flow-controller-information-to-dma_sla.patch b/patches.kzm9g/0012-dmaengine-Add-flow-controller-information-to-dma_sla.patch
deleted file mode 100644
index 11538f96799a0c..00000000000000
--- a/patches.kzm9g/0012-dmaengine-Add-flow-controller-information-to-dma_sla.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From f7b36b70b02e3a82938758b9975c41dbe6aa331d Mon Sep 17 00:00:00 2001
-From: Viresh Kumar <viresh.kumar@st.com>
-Date: Wed, 1 Feb 2012 16:12:18 +0530
-Subject: dmaengine: Add flow controller information to dma_slave_config
-
-Flow controller is programmable for few controllers and there are few
-intelligent peripherals like, Synopsys JPEG controller, that needs to be a flow
-controller of DMA transfers on dest side.
-
-For this, currently two drivers, pl08x and dw_dmac, support flow controller to
-be passed from platform to these drivers.
-
-Perhaps, this should be a part of struct dma_slave_config. This patch adds
-another field device_fc to this structure. User drivers must pass this as true
-if they want to be flow controller of certain transfers.
-
-Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
-Acked-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit dcc043dc0c60046cf6b75ca04a462314cf64e2ba)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 18e71fd..b8b4a84 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -26,6 +26,7 @@
- #include <linux/dma-mapping.h>
- #include <linux/scatterlist.h>
- #include <linux/bitmap.h>
-+#include <linux/types.h>
- #include <asm/page.h>
-
- struct scatterlist;
-@@ -334,6 +335,9 @@ enum dma_slave_buswidth {
- * may or may not be applicable on memory sources.
- * @dst_maxburst: same as src_maxburst but for destination target
- * mutatis mutandis.
-+ * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill
-+ * with 'true' if peripheral should be flow controller. Direction will be
-+ * selected at Runtime.
- *
- * This struct is passed in as configuration data to a DMA engine
- * in order to set up a certain channel for DMA transport at runtime.
-@@ -360,6 +364,7 @@ struct dma_slave_config {
- enum dma_slave_buswidth dst_addr_width;
- u32 src_maxburst;
- u32 dst_maxburst;
-+ bool device_fc;
- };
-
- static inline const char *dma_chan_name(struct dma_chan *chan)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0012-serial-move-struct-uart_8250_port-from-8250.c-to-825.patch b/patches.kzm9g/0012-serial-move-struct-uart_8250_port-from-8250.c-to-825.patch
deleted file mode 100644
index 1c8f17df539bfc..00000000000000
--- a/patches.kzm9g/0012-serial-move-struct-uart_8250_port-from-8250.c-to-825.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 028e3de52cdfd054b54d0ff7c2b576aaf299a1df Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 4 Dec 2011 18:42:18 -0500
-Subject: serial: move struct uart_8250_port from 8250.c to 8250.h
-
-Since we want to promote sharing and move away from one single
-uart driver with a bunch of platform specific bugfixes all
-munged into one, relocate some header like material from
-the C file to the header.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 850624c15da4651f4c6b821723419d8777659577)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 26 --------------------------
- drivers/tty/serial/8250.h | 26 ++++++++++++++++++++++++++
- 2 files changed, 26 insertions(+), 26 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index f8f2320..4a60d74 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -129,32 +129,6 @@ static unsigned long probe_rsa[PORT_RSA_MAX];
- static unsigned int probe_rsa_count;
- #endif /* CONFIG_SERIAL_8250_RSA */
-
--struct uart_8250_port {
-- struct uart_port port;
-- struct timer_list timer; /* "no irq" timer */
-- struct list_head list; /* ports on this IRQ */
-- unsigned short capabilities; /* port capabilities */
-- unsigned short bugs; /* port bugs */
-- unsigned int tx_loadsz; /* transmit fifo load size */
-- unsigned char acr;
-- unsigned char ier;
-- unsigned char lcr;
-- unsigned char mcr;
-- unsigned char mcr_mask; /* mask of user bits */
-- unsigned char mcr_force; /* mask of forced bits */
-- unsigned char cur_iotype; /* Running I/O type */
--
-- /*
-- * Some bits in registers are cleared on a read, so they must
-- * be saved whenever the register is read but the bits will not
-- * be immediately processed.
-- */
--#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
-- unsigned char lsr_saved_flags;
--#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
-- unsigned char msr_saved_flags;
--};
--
- struct irq_info {
- struct hlist_node node;
- int irq;
-diff --git a/drivers/tty/serial/8250.h b/drivers/tty/serial/8250.h
-index 6edf4a6..ae027be 100644
---- a/drivers/tty/serial/8250.h
-+++ b/drivers/tty/serial/8250.h
-@@ -13,6 +13,32 @@
-
- #include <linux/serial_8250.h>
-
-+struct uart_8250_port {
-+ struct uart_port port;
-+ struct timer_list timer; /* "no irq" timer */
-+ struct list_head list; /* ports on this IRQ */
-+ unsigned short capabilities; /* port capabilities */
-+ unsigned short bugs; /* port bugs */
-+ unsigned int tx_loadsz; /* transmit fifo load size */
-+ unsigned char acr;
-+ unsigned char ier;
-+ unsigned char lcr;
-+ unsigned char mcr;
-+ unsigned char mcr_mask; /* mask of user bits */
-+ unsigned char mcr_force; /* mask of forced bits */
-+ unsigned char cur_iotype; /* Running I/O type */
-+
-+ /*
-+ * Some bits in registers are cleared on a read, so they must
-+ * be saved whenever the register is read but the bits will not
-+ * be immediately processed.
-+ */
-+#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
-+ unsigned char lsr_saved_flags;
-+#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
-+ unsigned char msr_saved_flags;
-+};
-+
- struct old_serial_port {
- unsigned int uart;
- unsigned int baud_base;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0013-dma-dmaengine-Distinguish-between-dmaengine-failed-t.patch b/patches.kzm9g/0013-dma-dmaengine-Distinguish-between-dmaengine-failed-t.patch
deleted file mode 100644
index 25327e73ecd196..00000000000000
--- a/patches.kzm9g/0013-dma-dmaengine-Distinguish-between-dmaengine-failed-t.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 081cbf58313406bddf98861bb72e9d97a9343e83 Mon Sep 17 00:00:00 2001
-From: Fabio Estevam <festevam@gmail.com>
-Date: Tue, 21 Feb 2012 12:51:59 -0200
-Subject: dma: dmaengine: Distinguish between 'dmaengine: failed to get'
- messages
-
-The message "dmaengine: failed to get" can come from two possible locations within dmaengine.c.
-
-In order to distinguish between them, replace "dmaengine" with __func__ string so that the
-source function of the error message can be easily identified.
-
-Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit d8b53489d4c80490a70327fce6657816e33fafb3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/dmaengine.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
-index a6c6051..767bcc3 100644
---- a/drivers/dma/dmaengine.c
-+++ b/drivers/dma/dmaengine.c
-@@ -510,8 +510,8 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
- dma_chan_name(chan));
- list_del_rcu(&device->global_node);
- } else if (err)
-- pr_debug("dmaengine: failed to get %s: (%d)\n",
-- dma_chan_name(chan), err);
-+ pr_debug("%s: failed to get %s: (%d)\n",
-+ __func__, dma_chan_name(chan), err);
- else
- break;
- if (--device->privatecnt == 0)
-@@ -564,8 +564,8 @@ void dmaengine_get(void)
- list_del_rcu(&device->global_node);
- break;
- } else if (err)
-- pr_err("dmaengine: failed to get %s: (%d)\n",
-- dma_chan_name(chan), err);
-+ pr_err("%s: failed to get %s: (%d)\n",
-+ __func__, dma_chan_name(chan), err);
- }
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0013-serial-clean-up-parameter-passing-for-8250-Rx-IRQ-ha.patch b/patches.kzm9g/0013-serial-clean-up-parameter-passing-for-8250-Rx-IRQ-ha.patch
deleted file mode 100644
index 918651f8c8b27b..00000000000000
--- a/patches.kzm9g/0013-serial-clean-up-parameter-passing-for-8250-Rx-IRQ-ha.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 955d6b2ede1041858602dacb15c624bf8aa325f8 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 4 Dec 2011 18:42:19 -0500
-Subject: serial: clean up parameter passing for 8250 Rx IRQ handling
-
-The receive_chars() was taking a pointer to a passed in LSR value
-in status and knocking off bits as it processed them. But since
-receive_chars isn't returning a value, we can instead pass in
-a normal non-pointer value for LSR, and simply return the
-residual (unprocessed) LSR once it is done.
-
-The value in this cleanup, is that it clarifies the API of the
-receive_chars prior to exporting it to other 8250-like drivers
-for shared usage.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 0690f41fddd285c3473e4af2a42d15bce7ff3e68)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 17 +++++++++++------
- 1 file changed, 11 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index 4a60d74..fbcd8a5 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -1375,11 +1375,16 @@ static void clear_rx_fifo(struct uart_8250_port *up)
- } while (1);
- }
-
--static void
--receive_chars(struct uart_8250_port *up, unsigned int *status)
-+/*
-+ * receive_chars: processes according to the passed in LSR
-+ * value, and returns the remaining LSR bits not handled
-+ * by this Rx routine.
-+ */
-+static unsigned char
-+receive_chars(struct uart_8250_port *up, unsigned char lsr)
- {
- struct tty_struct *tty = up->port.state->port.tty;
-- unsigned char ch, lsr = *status;
-+ unsigned char ch;
- int max_count = 256;
- char flag;
-
-@@ -1455,7 +1460,7 @@ ignore_char:
- spin_unlock(&up->port.lock);
- tty_flip_buffer_push(tty);
- spin_lock(&up->port.lock);
-- *status = lsr;
-+ return lsr;
- }
-
- static void transmit_chars(struct uart_8250_port *up)
-@@ -1524,7 +1529,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
- */
- static void serial8250_handle_port(struct uart_8250_port *up)
- {
-- unsigned int status;
-+ unsigned char status;
- unsigned long flags;
-
- spin_lock_irqsave(&up->port.lock, flags);
-@@ -1534,7 +1539,7 @@ static void serial8250_handle_port(struct uart_8250_port *up)
- DEBUG_INTR("status = %x...", status);
-
- if (status & (UART_LSR_DR | UART_LSR_BI))
-- receive_chars(up, &status);
-+ status = receive_chars(up, status);
- check_modem_status(up);
- if (status & UART_LSR_THRE)
- transmit_chars(up);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0014-dmaengine-add-private-header-file.patch b/patches.kzm9g/0014-dmaengine-add-private-header-file.patch
deleted file mode 100644
index 805892068e3e12..00000000000000
--- a/patches.kzm9g/0014-dmaengine-add-private-header-file.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 49799aa5029a873211dda26d311c29fac21e9d58 Mon Sep 17 00:00:00 2001
-From: Russell King - ARM Linux <linux@arm.linux.org.uk>
-Date: Tue, 6 Mar 2012 22:34:26 +0000
-Subject: dmaengine: add private header file
-
-Add a local private header file to contain definitions and declarations
-which should only be used by DMA engine drivers.
-
-We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
-multiple inclusion.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-Tested-by: Linus Walleij <linus.walleij@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
-[imx-sdma.c & mxs-dma.c]
-Tested-by: Shawn Guo <shawn.guo@linaro.org>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit d2ebfb335b0426deb1a4fb14e4e926d81ecd8235)
-
-Conflicts:
-
- drivers/dma/amba-pl08x.c
- drivers/dma/at_hdmac.c
- drivers/dma/coh901318.c
- drivers/dma/dw_dmac.c
- drivers/dma/ep93xx_dma.c
- drivers/dma/fsldma.c
- drivers/dma/imx-dma.c
- drivers/dma/imx-sdma.c
- drivers/dma/intel_mid_dma.c
- drivers/dma/ioat/dma.c
- drivers/dma/ioat/dma_v2.c
- drivers/dma/iop-adma.c
- drivers/dma/ipu/ipu_idmac.c
- drivers/dma/mpc512x_dma.c
- drivers/dma/mv_xor.c
- drivers/dma/mxs-dma.c
- drivers/dma/pch_dma.c
- drivers/dma/pl330.c
- drivers/dma/ppc4xx/adma.c
- drivers/dma/shdma.c
- drivers/dma/ste_dma40.c
- drivers/dma/timb_dma.c
- drivers/dma/txx9dmac.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/dma/dmaengine.h | 10 ++++++++++
- include/linux/dmaengine.h | 4 ++--
- 2 files changed, 12 insertions(+), 2 deletions(-)
- create mode 100644 drivers/dma/dmaengine.h
-
-diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
-new file mode 100644
-index 0000000..968570d
---- /dev/null
-+++ b/drivers/dma/dmaengine.h
-@@ -0,0 +1,10 @@
-+/*
-+ * The contents of this file are private to DMA engine drivers, and is not
-+ * part of the API to be used by DMA engine users.
-+ */
-+#ifndef DMAENGINE_H
-+#define DMAENGINE_H
-+
-+#include <linux/dmaengine.h>
-+
-+#endif
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index b8b4a84..56628b2 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -18,8 +18,8 @@
- * The full GNU General Public License is included in this distribution in the
- * file called COPYING.
- */
--#ifndef DMAENGINE_H
--#define DMAENGINE_H
-+#ifndef LINUX_DMAENGINE_H
-+#define LINUX_DMAENGINE_H
-
- #include <linux/device.h>
- #include <linux/uio.h>
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0014-serial-export-the-key-functions-for-an-8250-IRQ-hand.patch b/patches.kzm9g/0014-serial-export-the-key-functions-for-an-8250-IRQ-hand.patch
deleted file mode 100644
index 04b2ab12162ff9..00000000000000
--- a/patches.kzm9g/0014-serial-export-the-key-functions-for-an-8250-IRQ-hand.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From d55f600016446155f3d9a86467566353071c7205 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 4 Dec 2011 18:42:20 -0500
-Subject: serial: export the key functions for an 8250 IRQ handler
-
-For drivers that need to construct their own IRQ handler, the
-three components are seen in the current handle_port -- i.e.
-Rx, Tx and modem_status.
-
-Make these exported symbols so that "almost" 8250 UARTs can
-construct their own IRQ handler with these shared components,
-while working around their own unique errata issues.
-
-The function names are given a serial8250 prefix, since they
-are now entering the global namespace.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 3986fb2ba67bb30cac18b0cff48c88d69ad37681)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 29 +++++++++++++++--------------
- include/linux/serial_8250.h | 4 ++++
- 2 files changed, 19 insertions(+), 14 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index fbcd8a5..d759fcc 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -1300,8 +1300,6 @@ static void serial8250_stop_tx(struct uart_port *port)
- }
- }
-
--static void transmit_chars(struct uart_8250_port *up);
--
- static void serial8250_start_tx(struct uart_port *port)
- {
- struct uart_8250_port *up =
-@@ -1318,7 +1316,7 @@ static void serial8250_start_tx(struct uart_port *port)
- if ((up->port.type == PORT_RM9000) ?
- (lsr & UART_LSR_THRE) :
- (lsr & UART_LSR_TEMT))
-- transmit_chars(up);
-+ serial8250_tx_chars(up);
- }
- }
-
-@@ -1376,12 +1374,12 @@ static void clear_rx_fifo(struct uart_8250_port *up)
- }
-
- /*
-- * receive_chars: processes according to the passed in LSR
-+ * serial8250_rx_chars: processes according to the passed in LSR
- * value, and returns the remaining LSR bits not handled
- * by this Rx routine.
- */
--static unsigned char
--receive_chars(struct uart_8250_port *up, unsigned char lsr)
-+unsigned char
-+serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- {
- struct tty_struct *tty = up->port.state->port.tty;
- unsigned char ch;
-@@ -1462,8 +1460,9 @@ ignore_char:
- spin_lock(&up->port.lock);
- return lsr;
- }
-+EXPORT_SYMBOL_GPL(serial8250_rx_chars);
-
--static void transmit_chars(struct uart_8250_port *up)
-+void serial8250_tx_chars(struct uart_8250_port *up)
- {
- struct circ_buf *xmit = &up->port.state->xmit;
- int count;
-@@ -1500,8 +1499,9 @@ static void transmit_chars(struct uart_8250_port *up)
- if (uart_circ_empty(xmit))
- __stop_tx(up);
- }
-+EXPORT_SYMBOL_GPL(serial8250_tx_chars);
-
--static unsigned int check_modem_status(struct uart_8250_port *up)
-+unsigned int serial8250_modem_status(struct uart_8250_port *up)
- {
- unsigned int status = serial_in(up, UART_MSR);
-
-@@ -1523,6 +1523,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
-
- return status;
- }
-+EXPORT_SYMBOL_GPL(serial8250_modem_status);
-
- /*
- * This handles the interrupt from one port.
-@@ -1539,10 +1540,10 @@ static void serial8250_handle_port(struct uart_8250_port *up)
- DEBUG_INTR("status = %x...", status);
-
- if (status & (UART_LSR_DR | UART_LSR_BI))
-- status = receive_chars(up, status);
-- check_modem_status(up);
-+ status = serial8250_rx_chars(up, status);
-+ serial8250_modem_status(up);
- if (status & UART_LSR_THRE)
-- transmit_chars(up);
-+ serial8250_tx_chars(up);
-
- spin_unlock_irqrestore(&up->port.lock, flags);
- }
-@@ -1780,7 +1781,7 @@ static void serial8250_backup_timeout(unsigned long data)
- }
-
- if (!(iir & UART_IIR_NO_INT))
-- transmit_chars(up);
-+ serial8250_tx_chars(up);
-
- if (is_real_interrupt(up->port.irq))
- serial_out(up, UART_IER, ier);
-@@ -1814,7 +1815,7 @@ static unsigned int serial8250_get_mctrl(struct uart_port *port)
- unsigned int status;
- unsigned int ret;
-
-- status = check_modem_status(up);
-+ status = serial8250_modem_status(up);
-
- ret = 0;
- if (status & UART_MSR_DCD)
-@@ -2861,7 +2862,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- * while processing with interrupts off.
- */
- if (up->msr_saved_flags)
-- check_modem_status(up);
-+ serial8250_modem_status(up);
-
- if (locked)
- spin_unlock(&up->port.lock);
-diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
-index 1f05bbe..b44034e 100644
---- a/include/linux/serial_8250.h
-+++ b/include/linux/serial_8250.h
-@@ -66,6 +66,7 @@ enum {
- * dependent on the 8250 driver.
- */
- struct uart_port;
-+struct uart_8250_port;
-
- int serial8250_register_port(struct uart_port *);
- void serial8250_unregister_port(int line);
-@@ -82,6 +83,9 @@ extern void serial8250_do_set_termios(struct uart_port *port,
- extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate);
- int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
-+unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
-+void serial8250_tx_chars(struct uart_8250_port *up);
-+unsigned int serial8250_modem_status(struct uart_8250_port *up);
-
- extern void serial8250_set_isa_configurator(void (*v)
- (int port, struct uart_port *up,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0015-dmaengine-dma_slave-introduce-inline-wrappers.patch b/patches.kzm9g/0015-dmaengine-dma_slave-introduce-inline-wrappers.patch
deleted file mode 100644
index 9acba60907eb7b..00000000000000
--- a/patches.kzm9g/0015-dmaengine-dma_slave-introduce-inline-wrappers.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 5a5c8a21c23c048134232d2daf8dc275c26c244d Mon Sep 17 00:00:00 2001
-From: Alexandre Bounine <alexandre.bounine@idt.com>
-Date: Thu, 8 Mar 2012 16:11:18 -0500
-Subject: dmaengine/dma_slave: introduce inline wrappers
-
-Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic()
-interfaces to hide new parameter from current users of affected interfaces.
-Convert current users to use new wrappers instead of direct calls.
-Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269].
-
-Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit 16052827d98fbc13c31ebad560af4bd53e2b4dd5)
-
-Conflicts:
-
- arch/arm/plat-samsung/dma-ops.c
- arch/arm/plat-nomadik/include/plat/ste_dma40.h
- drivers/media/video/mx3_camera.c
- drivers/media/video/timblogiw.c
- drivers/mmc/host/atmel-mci.c
- drivers/mmc/host/mmci.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/sh_mmcif.c
- drivers/mmc/host/tmio_mmc_dma.c
- drivers/mtd/nand/gpmi-nand/gpmi-lib.c
- drivers/usb/musb/ux500_dma.c
- drivers/net/ethernet/micrel/ks8842.c
- drivers/spi/spi-dw-mid.c
- drivers/spi/spi-ep93xx.c
- drivers/spi/spi-pl022.c
- drivers/spi/spi-topcliff-pch.c
- drivers/tty/serial/amba-pl011.c
- drivers/tty/serial/pch_uart.c
- drivers/tty/serial/sh-sci.c
- drivers/usb/renesas_usbhs/fifo.c
- drivers/video/mx3fb.c
- sound/soc/ep93xx/ep93xx-pcm.c
- sound/soc/imx/imx-pcm-dma-mx2.c
- sound/soc/mxs/mxs-pcm.c
- sound/soc/sh/siu_pcm.c
- sound/soc/txx9/txx9aclc.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/dmaengine.h | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 56628b2..ee123d2 100644
---- a/include/linux/dmaengine.h
-+++ b/include/linux/dmaengine.h
-@@ -623,6 +623,22 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
- return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
- }
-
-+static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
-+ struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len,
-+ enum dma_transfer_direction dir, unsigned long flags)
-+{
-+ return chan->device->device_prep_slave_sg(chan, sgl, sg_len,
-+ dir, flags);
-+}
-+
-+static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
-+ struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
-+ size_t period_len, enum dma_transfer_direction dir)
-+{
-+ return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
-+ period_len, dir);
-+}
-+
- static inline int dmaengine_terminate_all(struct dma_chan *chan)
- {
- return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0015-serial-make-8250-timeout-use-the-specified-IRQ-handl.patch b/patches.kzm9g/0015-serial-make-8250-timeout-use-the-specified-IRQ-handl.patch
deleted file mode 100644
index 7205efee649dcb..00000000000000
--- a/patches.kzm9g/0015-serial-make-8250-timeout-use-the-specified-IRQ-handl.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 6f7a0cbda97ea6ac36b334a2639275f60f830390 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 4 Dec 2011 18:42:21 -0500
-Subject: serial: make 8250 timeout use the specified IRQ handler
-
-The current 8250 timeout code duplicates the code path in
-serial8250_default_handle_irq and then serial8250_handle_irq
-i.e. reading iir, check for IIR_NO_INT, and then calling
-serial8250_handle_port.
-
-So the immediate thought is to replace the duplicated code
-with a call to serial8250_default_handle_irq.
-
-But this highlights a problem. We let 8250 driver variants
-use their own IRQ handler via specifying their own custom
-->handle_irq, but in the event of a timeout, we ignore their
-handler and implicitly run serial8250_default_handle_irq instead.
-
-So, go through the struct to get ->handle_irq and call that,
-which for most will still be serial8250_default_handle_irq.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit a0431476e95d18bb65349e7bcf98eb10b5ad00b9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index d759fcc..a5c6c7d 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -1738,11 +1738,8 @@ static void serial_unlink_irq_chain(struct uart_8250_port *up)
- static void serial8250_timeout(unsigned long data)
- {
- struct uart_8250_port *up = (struct uart_8250_port *)data;
-- unsigned int iir;
-
-- iir = serial_in(up, UART_IIR);
-- if (!(iir & UART_IIR_NO_INT))
-- serial8250_handle_port(up);
-+ up->port.handle_irq(&up->port);
- mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port));
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0016-ARM-Add-init_consistent_dma_size.patch b/patches.kzm9g/0016-ARM-Add-init_consistent_dma_size.patch
deleted file mode 100644
index 2679fb0230eaa4..00000000000000
--- a/patches.kzm9g/0016-ARM-Add-init_consistent_dma_size.patch
+++ /dev/null
@@ -1,195 +0,0 @@
-From 2690e41103fa44c11e9e435bb58121de3cf16350 Mon Sep 17 00:00:00 2001
-From: Jon Medhurst <tixy@yxit.co.uk>
-Date: Tue, 2 Aug 2011 17:28:27 +0100
-Subject: ARM: Add init_consistent_dma_size()
-
-This function can be called during boot to increase the size of the consistent
-DMA region above it's default value of 2MB. It must be called before the memory
-allocator is initialised, i.e. before any core_initcall.
-
-Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
-Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-(cherry picked from commit 99d1717dd7fecf2b10195b0d864323b952b4eba0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/dma-mapping.h | 7 ++++++
- arch/arm/include/asm/memory.h | 9 -------
- arch/arm/mm/dma-mapping.c | 49 +++++++++++++++++++++++++++++---------
- arch/arm/mm/init.c | 9 -------
- 4 files changed, 45 insertions(+), 29 deletions(-)
-
-diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
-index 4fff837..5f974f2 100644
---- a/arch/arm/include/asm/dma-mapping.h
-+++ b/arch/arm/include/asm/dma-mapping.h
-@@ -236,6 +236,13 @@ extern void *dma_alloc_writecombine(struct device *, size_t, dma_addr_t *,
- int dma_mmap_writecombine(struct device *, struct vm_area_struct *,
- void *, dma_addr_t, size_t);
-
-+/*
-+ * This can be called during boot to increase the size of the consistent
-+ * DMA region above it's default value of 2MB. It must be called before the
-+ * memory allocator is initialised, i.e. before any core_initcall.
-+ */
-+extern void __init init_consistent_dma_size(unsigned long size);
-+
-
- #ifdef CONFIG_DMABOUNCE
- /*
-diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
-index af44a8f..0b0aaa4 100644
---- a/arch/arm/include/asm/memory.h
-+++ b/arch/arm/include/asm/memory.h
-@@ -77,16 +77,7 @@
- */
- #define IOREMAP_MAX_ORDER 24
-
--/*
-- * Size of DMA-consistent memory region. Must be multiple of 2M,
-- * between 2MB and 14MB inclusive.
-- */
--#ifndef CONSISTENT_DMA_SIZE
--#define CONSISTENT_DMA_SIZE SZ_2M
--#endif
--
- #define CONSISTENT_END (0xffe00000UL)
--#define CONSISTENT_BASE (CONSISTENT_END - CONSISTENT_DMA_SIZE)
-
- #else /* CONFIG_MMU */
-
-diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
-index f96d2c7..c6e2c9f 100644
---- a/arch/arm/mm/dma-mapping.c
-+++ b/arch/arm/mm/dma-mapping.c
-@@ -18,12 +18,14 @@
- #include <linux/device.h>
- #include <linux/dma-mapping.h>
- #include <linux/highmem.h>
-+#include <linux/slab.h>
-
- #include <asm/memory.h>
- #include <asm/highmem.h>
- #include <asm/cacheflush.h>
- #include <asm/tlbflush.h>
- #include <asm/sizes.h>
-+#include <asm/mach/arch.h>
-
- static u64 get_coherent_dma_mask(struct device *dev)
- {
-@@ -115,26 +117,41 @@ static void __dma_free_buffer(struct page *page, size_t size)
- }
-
- #ifdef CONFIG_MMU
--/* Sanity check size */
--#if (CONSISTENT_DMA_SIZE % SZ_2M)
--#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
--#endif
-
--#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
--#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
--#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
-+
-+#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - consistent_base) >> PAGE_SHIFT)
-+#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - consistent_base) >> PGDIR_SHIFT)
-
- /*
- * These are the page tables (2MB each) covering uncached, DMA consistent allocations
- */
--static pte_t *consistent_pte[NUM_CONSISTENT_PTES];
-+static pte_t **consistent_pte;
-+
-+#ifdef CONSISTENT_DMA_SIZE
-+#define DEFAULT_CONSISTENT_DMA_SIZE CONSISTENT_DMA_SIZE
-+#else
-+#define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
-+#endif
-+
-+unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
-+
-+void __init init_consistent_dma_size(unsigned long size)
-+{
-+ unsigned long base = CONSISTENT_END - ALIGN(size, SZ_2M);
-+
-+ BUG_ON(consistent_pte); /* Check we're called before DMA region init */
-+ BUG_ON(base < VMALLOC_END);
-+
-+ /* Grow region to accommodate specified size */
-+ if (base < consistent_base)
-+ consistent_base = base;
-+}
-
- #include "vmregion.h"
-
- static struct arm_vmregion_head consistent_head = {
- .vm_lock = __SPIN_LOCK_UNLOCKED(&consistent_head.vm_lock),
- .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
-- .vm_start = CONSISTENT_BASE,
- .vm_end = CONSISTENT_END,
- };
-
-@@ -153,7 +170,17 @@ static int __init consistent_init(void)
- pmd_t *pmd;
- pte_t *pte;
- int i = 0;
-- u32 base = CONSISTENT_BASE;
-+ unsigned long base = consistent_base;
-+ unsigned long num_ptes = (CONSISTENT_END - base) >> PGDIR_SHIFT;
-+
-+ consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
-+ if (!consistent_pte) {
-+ pr_err("%s: no memory\n", __func__);
-+ return -ENOMEM;
-+ }
-+
-+ pr_debug("DMA memory: 0x%08lx - 0x%08lx:\n", base, CONSISTENT_END);
-+ consistent_head.vm_start = base;
-
- do {
- pgd = pgd_offset(&init_mm, base);
-@@ -196,7 +223,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
- size_t align;
- int bit;
-
-- if (!consistent_pte[0]) {
-+ if (!consistent_pte) {
- printk(KERN_ERR "%s: not initialised\n", __func__);
- dump_stack();
- return NULL;
-diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index e038b49..db04a3e5 100644
---- a/arch/arm/mm/init.c
-+++ b/arch/arm/mm/init.c
-@@ -638,9 +638,6 @@ void __init mem_init(void)
- " ITCM : 0x%08lx - 0x%08lx (%4ld kB)\n"
- #endif
- " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
--#ifdef CONFIG_MMU
-- " DMA : 0x%08lx - 0x%08lx (%4ld MB)\n"
--#endif
- " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
- " lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
- #ifdef CONFIG_HIGHMEM
-@@ -659,9 +656,6 @@ void __init mem_init(void)
- MLK(ITCM_OFFSET, (unsigned long) itcm_end),
- #endif
- MLK(FIXADDR_START, FIXADDR_TOP),
--#ifdef CONFIG_MMU
-- MLM(CONSISTENT_BASE, CONSISTENT_END),
--#endif
- MLM(VMALLOC_START, VMALLOC_END),
- MLM(PAGE_OFFSET, (unsigned long)high_memory),
- #ifdef CONFIG_HIGHMEM
-@@ -684,9 +678,6 @@ void __init mem_init(void)
- * be detected at build time already.
- */
- #ifdef CONFIG_MMU
-- BUILD_BUG_ON(VMALLOC_END > CONSISTENT_BASE);
-- BUG_ON(VMALLOC_END > CONSISTENT_BASE);
--
- BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
- BUG_ON(TASK_SIZE > MODULES_VADDR);
- #endif
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0016-serial-manually-inline-serial8250_handle_port.patch b/patches.kzm9g/0016-serial-manually-inline-serial8250_handle_port.patch
deleted file mode 100644
index e14803ceb1e44e..00000000000000
--- a/patches.kzm9g/0016-serial-manually-inline-serial8250_handle_port.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From f1e4b73758b9bead03589febddcb3dba5132ddf7 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 4 Dec 2011 18:42:22 -0500
-Subject: serial: manually inline serial8250_handle_port
-
-Currently serial8250_handle_irq is a trivial wrapper around
-serial8250_handle_port, which actually does all the work.
-
-Since there are no other callers of serial8250_handle_port, we
-can just move it inline into serial8250_handle_irq. This also
-makes it more clear what functionality any custom IRQ handlers
-need to provide if not using serial8250_default_handle_irq.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 86b21199fc45e0052e181fefc07c747e9dc903b3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250.c | 23 ++++++++---------------
- 1 file changed, 8 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
-index a5c6c7d..047221d 100644
---- a/drivers/tty/serial/8250.c
-+++ b/drivers/tty/serial/8250.c
-@@ -1528,10 +1528,15 @@ EXPORT_SYMBOL_GPL(serial8250_modem_status);
- /*
- * This handles the interrupt from one port.
- */
--static void serial8250_handle_port(struct uart_8250_port *up)
-+int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
- {
- unsigned char status;
- unsigned long flags;
-+ struct uart_8250_port *up =
-+ container_of(port, struct uart_8250_port, port);
-+
-+ if (iir & UART_IIR_NO_INT)
-+ return 0;
-
- spin_lock_irqsave(&up->port.lock, flags);
-
-@@ -1546,19 +1551,7 @@ static void serial8250_handle_port(struct uart_8250_port *up)
- serial8250_tx_chars(up);
-
- spin_unlock_irqrestore(&up->port.lock, flags);
--}
--
--int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
--{
-- struct uart_8250_port *up =
-- container_of(port, struct uart_8250_port, port);
--
-- if (!(iir & UART_IIR_NO_INT)) {
-- serial8250_handle_port(up);
-- return 1;
-- }
--
-- return 0;
-+ return 1;
- }
- EXPORT_SYMBOL_GPL(serial8250_handle_irq);
-
-@@ -2825,7 +2818,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
-
- local_irq_save(flags);
- if (up->port.sysrq) {
-- /* serial8250_handle_port() already took the lock */
-+ /* serial8250_handle_irq() already took the lock */
- locked = 0;
- } else if (oops_in_progress) {
- locked = spin_trylock(&up->port.lock);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0017-mmc-add-a-card-hotplug-handler-context.patch b/patches.kzm9g/0017-mmc-add-a-card-hotplug-handler-context.patch
deleted file mode 100644
index 6b31c7b051fa93..00000000000000
--- a/patches.kzm9g/0017-mmc-add-a-card-hotplug-handler-context.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 6ce12292dadb9a6064862a23cbda3ba144de06ff Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Sun, 25 Dec 2011 20:40:03 -0500
-Subject: mmc: add a card hotplug handler context
-
-SD/MMC controllers provide different card insertion and removal detection
-methods. On some of them the controller itself issues an interrupt, on
-others polling is used, on yet others auxiliary means are used for this
-purpose, e.g., a GPIO IRQ. Further, on some systems one of those methods
-can be chosen at driver probing time and configured in software. E.g., on
-some systems the SD/MMC controller card hot-plug detection pin can be
-configured either as a respective controller functions, or an IRQ-capable
-GPIO. To support such flexible configurations a card hot-plug context
-is added by this patch.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit b67e198073b2d2f16572f5fa77553fec14775f69)
-
-Conflicts:
-
- include/linux/mmc/host.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/mmc/host.h | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
-index 1ee4424..786bd1f 100644
---- a/include/linux/mmc/host.h
-+++ b/include/linux/mmc/host.h
-@@ -144,6 +144,11 @@ struct mmc_host_ops {
- struct mmc_card;
- struct device;
-
-+struct mmc_hotplug {
-+ unsigned int irq;
-+ void *handler_priv;
-+};
-+
- struct mmc_host {
- struct device *parent;
- struct device class_dev;
-@@ -261,6 +266,7 @@ struct mmc_host {
- int claim_cnt; /* "claim" nesting count */
-
- struct delayed_work detect;
-+ struct mmc_hotplug hotplug;
-
- const struct mmc_bus_ops *bus_ops; /* current bus driver */
- unsigned int bus_refs; /* reference counter */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0017-serial-group-all-the-8250-related-code-together.patch b/patches.kzm9g/0017-serial-group-all-the-8250-related-code-together.patch
deleted file mode 100644
index d045b50b493364..00000000000000
--- a/patches.kzm9g/0017-serial-group-all-the-8250-related-code-together.patch
+++ /dev/null
@@ -1,746 +0,0 @@
-From 1ab1670cb4d8cba1870f9dc3fd7806262f72a904 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 5 Jan 2012 18:21:43 -0500
-Subject: serial: group all the 8250 related code together
-
-The drivers/tty/serial dir is already getting rather busy.
-Relocate the 8250 related drivers to their own subdir to
-reduce the clutter.
-
-Note that sunsu.c is not included in this move -- it is
-8250-like hardware, but it does not use any of the existing
-infrastructure -- and does not depend on SERIAL_8250.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 9bef3d4197379a995fa80f81950bbbf8d32e9e8b)
-
-Conflicts:
-
- drivers/tty/serial/8250/Kconfig
- drivers/tty/serial/8250/Makefile
- drivers/tty/serial/8250/8250_dw.c
- drivers/tty/serial/8250/8250_fsl.c
- drivers/tty/serial/Kconfig
- drivers/tty/serial/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/{ => 8250}/8250.c | 0
- drivers/tty/serial/{ => 8250}/8250.h | 0
- drivers/tty/serial/{ => 8250}/8250_accent.c | 0
- drivers/tty/serial/{ => 8250}/8250_acorn.c | 0
- drivers/tty/serial/{ => 8250}/8250_boca.c | 0
- drivers/tty/serial/{ => 8250}/8250_early.c | 0
- drivers/tty/serial/{ => 8250}/8250_exar_st16c554.c | 0
- drivers/tty/serial/{ => 8250}/8250_fourport.c | 0
- drivers/tty/serial/{ => 8250}/8250_gsc.c | 0
- drivers/tty/serial/{ => 8250}/8250_hp300.c | 0
- drivers/tty/serial/{ => 8250}/8250_hub6.c | 0
- drivers/tty/serial/{ => 8250}/8250_mca.c | 0
- drivers/tty/serial/{ => 8250}/8250_pci.c | 0
- drivers/tty/serial/{ => 8250}/8250_pnp.c | 0
- drivers/tty/serial/8250/Kconfig | 268 ++++++++++++++++++++
- drivers/tty/serial/8250/Makefile | 18 ++
- drivers/tty/serial/{ => 8250}/m32r_sio.c | 0
- drivers/tty/serial/{ => 8250}/m32r_sio.h | 0
- drivers/tty/serial/{ => 8250}/m32r_sio_reg.h | 0
- drivers/tty/serial/{ => 8250}/serial_cs.c | 0
- drivers/tty/serial/Kconfig | 262 +------------------
- drivers/tty/serial/Makefile | 17 +-
- 22 files changed, 290 insertions(+), 275 deletions(-)
- rename drivers/tty/serial/{ => 8250}/8250.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250.h (100%)
- rename drivers/tty/serial/{ => 8250}/8250_accent.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_acorn.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_boca.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_early.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_exar_st16c554.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_fourport.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_gsc.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_hp300.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_hub6.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_mca.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_pci.c (100%)
- rename drivers/tty/serial/{ => 8250}/8250_pnp.c (100%)
- create mode 100644 drivers/tty/serial/8250/Kconfig
- create mode 100644 drivers/tty/serial/8250/Makefile
- rename drivers/tty/serial/{ => 8250}/m32r_sio.c (100%)
- rename drivers/tty/serial/{ => 8250}/m32r_sio.h (100%)
- rename drivers/tty/serial/{ => 8250}/m32r_sio_reg.h (100%)
- rename drivers/tty/serial/{ => 8250}/serial_cs.c (100%)
-
-diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250/8250.c
-similarity index 100%
-rename from drivers/tty/serial/8250.c
-rename to drivers/tty/serial/8250/8250.c
-diff --git a/drivers/tty/serial/8250.h b/drivers/tty/serial/8250/8250.h
-similarity index 100%
-rename from drivers/tty/serial/8250.h
-rename to drivers/tty/serial/8250/8250.h
-diff --git a/drivers/tty/serial/8250_accent.c b/drivers/tty/serial/8250/8250_accent.c
-similarity index 100%
-rename from drivers/tty/serial/8250_accent.c
-rename to drivers/tty/serial/8250/8250_accent.c
-diff --git a/drivers/tty/serial/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c
-similarity index 100%
-rename from drivers/tty/serial/8250_acorn.c
-rename to drivers/tty/serial/8250/8250_acorn.c
-diff --git a/drivers/tty/serial/8250_boca.c b/drivers/tty/serial/8250/8250_boca.c
-similarity index 100%
-rename from drivers/tty/serial/8250_boca.c
-rename to drivers/tty/serial/8250/8250_boca.c
-diff --git a/drivers/tty/serial/8250_early.c b/drivers/tty/serial/8250/8250_early.c
-similarity index 100%
-rename from drivers/tty/serial/8250_early.c
-rename to drivers/tty/serial/8250/8250_early.c
-diff --git a/drivers/tty/serial/8250_exar_st16c554.c b/drivers/tty/serial/8250/8250_exar_st16c554.c
-similarity index 100%
-rename from drivers/tty/serial/8250_exar_st16c554.c
-rename to drivers/tty/serial/8250/8250_exar_st16c554.c
-diff --git a/drivers/tty/serial/8250_fourport.c b/drivers/tty/serial/8250/8250_fourport.c
-similarity index 100%
-rename from drivers/tty/serial/8250_fourport.c
-rename to drivers/tty/serial/8250/8250_fourport.c
-diff --git a/drivers/tty/serial/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c
-similarity index 100%
-rename from drivers/tty/serial/8250_gsc.c
-rename to drivers/tty/serial/8250/8250_gsc.c
-diff --git a/drivers/tty/serial/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
-similarity index 100%
-rename from drivers/tty/serial/8250_hp300.c
-rename to drivers/tty/serial/8250/8250_hp300.c
-diff --git a/drivers/tty/serial/8250_hub6.c b/drivers/tty/serial/8250/8250_hub6.c
-similarity index 100%
-rename from drivers/tty/serial/8250_hub6.c
-rename to drivers/tty/serial/8250/8250_hub6.c
-diff --git a/drivers/tty/serial/8250_mca.c b/drivers/tty/serial/8250/8250_mca.c
-similarity index 100%
-rename from drivers/tty/serial/8250_mca.c
-rename to drivers/tty/serial/8250/8250_mca.c
-diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
-similarity index 100%
-rename from drivers/tty/serial/8250_pci.c
-rename to drivers/tty/serial/8250/8250_pci.c
-diff --git a/drivers/tty/serial/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
-similarity index 100%
-rename from drivers/tty/serial/8250_pnp.c
-rename to drivers/tty/serial/8250/8250_pnp.c
-diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
-new file mode 100644
-index 0000000..b1bb251
---- /dev/null
-+++ b/drivers/tty/serial/8250/Kconfig
-@@ -0,0 +1,268 @@
-+#
-+# The 8250/16550 serial drivers. You shouldn't be in this list unless
-+# you somehow have an implicit or explicit dependency on SERIAL_8250.
-+#
-+
-+config SERIAL_8250
-+ tristate "8250/16550 and compatible serial support"
-+ select SERIAL_CORE
-+ ---help---
-+ This selects whether you want to include the driver for the standard
-+ serial ports. The standard answer is Y. People who might say N
-+ here are those that are setting up dedicated Ethernet WWW/FTP
-+ servers, or users that have one of the various bus mice instead of a
-+ serial mouse and don't intend to use their machine's standard serial
-+ port for anything. (Note that the Cyclades and Stallion multi
-+ serial port drivers do not need this driver built in for them to
-+ work.)
-+
-+ To compile this driver as a module, choose M here: the
-+ module will be called 8250.
-+ [WARNING: Do not compile this driver as a module if you are using
-+ non-standard serial ports, since the configuration information will
-+ be lost when the driver is unloaded. This limitation may be lifted
-+ in the future.]
-+
-+ BTW1: If you have a mouseman serial mouse which is not recognized by
-+ the X window system, try running gpm first.
-+
-+ BTW2: If you intend to use a software modem (also called Winmodem)
-+ under Linux, forget it. These modems are crippled and require
-+ proprietary drivers which are only available under Windows.
-+
-+ Most people will say Y or M here, so that they can use serial mice,
-+ modems and similar devices connecting to the standard serial ports.
-+
-+config SERIAL_8250_CONSOLE
-+ bool "Console on 8250/16550 and compatible serial port"
-+ depends on SERIAL_8250=y
-+ select SERIAL_CORE_CONSOLE
-+ ---help---
-+ If you say Y here, it will be possible to use a serial port as the
-+ system console (the system console is the device which receives all
-+ kernel messages and warnings and which allows logins in single user
-+ mode). This could be useful if some terminal or printer is connected
-+ to that serial port.
-+
-+ Even if you say Y here, the currently visible virtual console
-+ (/dev/tty0) will still be used as the system console by default, but
-+ you can alter that using a kernel command line option such as
-+ "console=ttyS1". (Try "man bootparam" or see the documentation of
-+ your boot loader (grub or lilo or loadlin) about how to pass options
-+ to the kernel at boot time.)
-+
-+ If you don't have a VGA card installed and you say Y here, the
-+ kernel will automatically use the first serial line, /dev/ttyS0, as
-+ system console.
-+
-+ You can set that using a kernel command line option such as
-+ "console=uart8250,io,0x3f8,9600n8"
-+ "console=uart8250,mmio,0xff5e0000,115200n8".
-+ and it will switch to normal serial console when the corresponding
-+ port is ready.
-+ "earlycon=uart8250,io,0x3f8,9600n8"
-+ "earlycon=uart8250,mmio,0xff5e0000,115200n8".
-+ it will not only setup early console.
-+
-+ If unsure, say N.
-+
-+config FIX_EARLYCON_MEM
-+ bool
-+ depends on X86
-+ default y
-+
-+config SERIAL_8250_GSC
-+ tristate
-+ depends on SERIAL_8250 && GSC
-+ default SERIAL_8250
-+
-+config SERIAL_8250_PCI
-+ tristate "8250/16550 PCI device support" if EXPERT
-+ depends on SERIAL_8250 && PCI
-+ default SERIAL_8250
-+ help
-+ This builds standard PCI serial support. You may be able to
-+ disable this feature if you only need legacy serial support.
-+ Saves about 9K.
-+
-+config SERIAL_8250_PNP
-+ tristate "8250/16550 PNP device support" if EXPERT
-+ depends on SERIAL_8250 && PNP
-+ default SERIAL_8250
-+ help
-+ This builds standard PNP serial support. You may be able to
-+ disable this feature if you only need legacy serial support.
-+
-+config SERIAL_8250_HP300
-+ tristate
-+ depends on SERIAL_8250 && HP300
-+ default SERIAL_8250
-+
-+config SERIAL_8250_CS
-+ tristate "8250/16550 PCMCIA device support"
-+ depends on PCMCIA && SERIAL_8250
-+ ---help---
-+ Say Y here to enable support for 16-bit PCMCIA serial devices,
-+ including serial port cards, modems, and the modem functions of
-+ multi-function Ethernet/modem cards. (PCMCIA- or PC-cards are
-+ credit-card size devices often used with laptops.)
-+
-+ To compile this driver as a module, choose M here: the
-+ module will be called serial_cs.
-+
-+ If unsure, say N.
-+
-+config SERIAL_8250_NR_UARTS
-+ int "Maximum number of 8250/16550 serial ports"
-+ depends on SERIAL_8250
-+ default "4"
-+ help
-+ Set this to the number of serial ports you want the driver
-+ to support. This includes any ports discovered via ACPI or
-+ PCI enumeration and any ports that may be added at run-time
-+ via hot-plug, or any ISA multi-port serial cards.
-+
-+config SERIAL_8250_RUNTIME_UARTS
-+ int "Number of 8250/16550 serial ports to register at runtime"
-+ depends on SERIAL_8250
-+ range 0 SERIAL_8250_NR_UARTS
-+ default "4"
-+ help
-+ Set this to the maximum number of serial ports you want
-+ the kernel to register at boot time. This can be overridden
-+ with the module parameter "nr_uarts", or boot-time parameter
-+ 8250.nr_uarts
-+
-+config SERIAL_8250_EXTENDED
-+ bool "Extended 8250/16550 serial driver options"
-+ depends on SERIAL_8250
-+ help
-+ If you wish to use any non-standard features of the standard "dumb"
-+ driver, say Y here. This includes HUB6 support, shared serial
-+ interrupts, special multiport support, support for more than the
-+ four COM 1/2/3/4 boards, etc.
-+
-+ Note that the answer to this question won't directly affect the
-+ kernel: saying N will just cause the configurator to skip all
-+ the questions about serial driver options. If unsure, say N.
-+
-+config SERIAL_8250_MANY_PORTS
-+ bool "Support more than 4 legacy serial ports"
-+ depends on SERIAL_8250_EXTENDED && !IA64
-+ help
-+ Say Y here if you have dumb serial boards other than the four
-+ standard COM 1/2/3/4 ports. This may happen if you have an AST
-+ FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
-+ from <http://www.tldp.org/docs.html#howto>), or other custom
-+ serial port hardware which acts similar to standard serial port
-+ hardware. If you only use the standard COM 1/2/3/4 ports, you can
-+ say N here to save some memory. You can also say Y if you have an
-+ "intelligent" multiport card such as Cyclades, Digiboards, etc.
-+
-+#
-+# Multi-port serial cards
-+#
-+
-+config SERIAL_8250_FOURPORT
-+ tristate "Support Fourport cards"
-+ depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-+ help
-+ Say Y here if you have an AST FourPort serial board.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_fourport.
-+
-+config SERIAL_8250_ACCENT
-+ tristate "Support Accent cards"
-+ depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-+ help
-+ Say Y here if you have an Accent Async serial board.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_accent.
-+
-+config SERIAL_8250_BOCA
-+ tristate "Support Boca cards"
-+ depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-+ help
-+ Say Y here if you have a Boca serial board. Please read the Boca
-+ mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_boca.
-+
-+config SERIAL_8250_EXAR_ST16C554
-+ tristate "Support Exar ST16C554/554D Quad UART"
-+ depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-+ help
-+ The Uplogix Envoy TU301 uses this Exar Quad UART. If you are
-+ tinkering with your Envoy TU301, or have a machine with this UART,
-+ say Y here.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_exar_st16c554.
-+
-+config SERIAL_8250_HUB6
-+ tristate "Support Hub6 cards"
-+ depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-+ help
-+ Say Y here if you have a HUB6 serial board.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_hub6.
-+
-+#
-+# Misc. options/drivers.
-+#
-+
-+config SERIAL_8250_SHARE_IRQ
-+ bool "Support for sharing serial interrupts"
-+ depends on SERIAL_8250_EXTENDED
-+ help
-+ Some serial boards have hardware support which allows multiple dumb
-+ serial ports on the same board to share a single IRQ. To enable
-+ support for this in the serial driver, say Y here.
-+
-+config SERIAL_8250_DETECT_IRQ
-+ bool "Autodetect IRQ on standard ports (unsafe)"
-+ depends on SERIAL_8250_EXTENDED
-+ help
-+ Say Y here if you want the kernel to try to guess which IRQ
-+ to use for your serial port.
-+
-+ This is considered unsafe; it is far better to configure the IRQ in
-+ a boot script using the setserial command.
-+
-+ If unsure, say N.
-+
-+config SERIAL_8250_RSA
-+ bool "Support RSA serial ports"
-+ depends on SERIAL_8250_EXTENDED
-+ help
-+ ::: To be written :::
-+
-+config SERIAL_8250_MCA
-+ tristate "Support 8250-type ports on MCA buses"
-+ depends on SERIAL_8250 != n && MCA
-+ help
-+ Say Y here if you have a MCA serial ports.
-+
-+ To compile this driver as a module, choose M here: the module
-+ will be called 8250_mca.
-+
-+config SERIAL_8250_ACORN
-+ tristate "Acorn expansion card serial port support"
-+ depends on ARCH_ACORN && SERIAL_8250
-+ help
-+ If you have an Atomwide Serial card or Serial Port card for an Acorn
-+ system, say Y to this option. The driver can handle 1, 2, or 3 port
-+ cards. If unsure, say N.
-+
-+config SERIAL_8250_RM9K
-+ bool "Support for MIPS RM9xxx integrated serial port"
-+ depends on SERIAL_8250 != n && SERIAL_RM9000
-+ select SERIAL_8250_SHARE_IRQ
-+ help
-+ Selecting this option will add support for the integrated serial
-+ port hardware found on MIPS RM9122 and similar processors.
-+ If unsure, say N.
-diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
-new file mode 100644
-index 0000000..c0d0c29
---- /dev/null
-+++ b/drivers/tty/serial/8250/Makefile
-@@ -0,0 +1,18 @@
-+#
-+# Makefile for the 8250 serial device drivers.
-+#
-+
-+obj-$(CONFIG_SERIAL_8250) += 8250.o
-+obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o
-+obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
-+obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
-+obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
-+obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
-+obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
-+obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
-+obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
-+obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
-+obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
-+obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
-+obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
-+obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
-diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/8250/m32r_sio.c
-similarity index 100%
-rename from drivers/tty/serial/m32r_sio.c
-rename to drivers/tty/serial/8250/m32r_sio.c
-diff --git a/drivers/tty/serial/m32r_sio.h b/drivers/tty/serial/8250/m32r_sio.h
-similarity index 100%
-rename from drivers/tty/serial/m32r_sio.h
-rename to drivers/tty/serial/8250/m32r_sio.h
-diff --git a/drivers/tty/serial/m32r_sio_reg.h b/drivers/tty/serial/8250/m32r_sio_reg.h
-similarity index 100%
-rename from drivers/tty/serial/m32r_sio_reg.h
-rename to drivers/tty/serial/8250/m32r_sio_reg.h
-diff --git a/drivers/tty/serial/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
-similarity index 100%
-rename from drivers/tty/serial/serial_cs.c
-rename to drivers/tty/serial/8250/serial_cs.c
-diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
-index 9789293..69349bf 100644
---- a/drivers/tty/serial/Kconfig
-+++ b/drivers/tty/serial/Kconfig
-@@ -5,267 +5,7 @@
- menu "Serial drivers"
- depends on HAS_IOMEM
-
--#
--# The new 8250/16550 serial drivers
--config SERIAL_8250
-- tristate "8250/16550 and compatible serial support"
-- select SERIAL_CORE
-- ---help---
-- This selects whether you want to include the driver for the standard
-- serial ports. The standard answer is Y. People who might say N
-- here are those that are setting up dedicated Ethernet WWW/FTP
-- servers, or users that have one of the various bus mice instead of a
-- serial mouse and don't intend to use their machine's standard serial
-- port for anything. (Note that the Cyclades and Stallion multi
-- serial port drivers do not need this driver built in for them to
-- work.)
--
-- To compile this driver as a module, choose M here: the
-- module will be called 8250.
-- [WARNING: Do not compile this driver as a module if you are using
-- non-standard serial ports, since the configuration information will
-- be lost when the driver is unloaded. This limitation may be lifted
-- in the future.]
--
-- BTW1: If you have a mouseman serial mouse which is not recognized by
-- the X window system, try running gpm first.
--
-- BTW2: If you intend to use a software modem (also called Winmodem)
-- under Linux, forget it. These modems are crippled and require
-- proprietary drivers which are only available under Windows.
--
-- Most people will say Y or M here, so that they can use serial mice,
-- modems and similar devices connecting to the standard serial ports.
--
--config SERIAL_8250_CONSOLE
-- bool "Console on 8250/16550 and compatible serial port"
-- depends on SERIAL_8250=y
-- select SERIAL_CORE_CONSOLE
-- ---help---
-- If you say Y here, it will be possible to use a serial port as the
-- system console (the system console is the device which receives all
-- kernel messages and warnings and which allows logins in single user
-- mode). This could be useful if some terminal or printer is connected
-- to that serial port.
--
-- Even if you say Y here, the currently visible virtual console
-- (/dev/tty0) will still be used as the system console by default, but
-- you can alter that using a kernel command line option such as
-- "console=ttyS1". (Try "man bootparam" or see the documentation of
-- your boot loader (grub or lilo or loadlin) about how to pass options
-- to the kernel at boot time.)
--
-- If you don't have a VGA card installed and you say Y here, the
-- kernel will automatically use the first serial line, /dev/ttyS0, as
-- system console.
--
-- You can set that using a kernel command line option such as
-- "console=uart8250,io,0x3f8,9600n8"
-- "console=uart8250,mmio,0xff5e0000,115200n8".
-- and it will switch to normal serial console when the corresponding
-- port is ready.
-- "earlycon=uart8250,io,0x3f8,9600n8"
-- "earlycon=uart8250,mmio,0xff5e0000,115200n8".
-- it will not only setup early console.
--
-- If unsure, say N.
--
--config FIX_EARLYCON_MEM
-- bool
-- depends on X86
-- default y
--
--config SERIAL_8250_GSC
-- tristate
-- depends on SERIAL_8250 && GSC
-- default SERIAL_8250
--
--config SERIAL_8250_PCI
-- tristate "8250/16550 PCI device support" if EXPERT
-- depends on SERIAL_8250 && PCI
-- default SERIAL_8250
-- help
-- This builds standard PCI serial support. You may be able to
-- disable this feature if you only need legacy serial support.
-- Saves about 9K.
--
--config SERIAL_8250_PNP
-- tristate "8250/16550 PNP device support" if EXPERT
-- depends on SERIAL_8250 && PNP
-- default SERIAL_8250
-- help
-- This builds standard PNP serial support. You may be able to
-- disable this feature if you only need legacy serial support.
--
--config SERIAL_8250_HP300
-- tristate
-- depends on SERIAL_8250 && HP300
-- default SERIAL_8250
--
--config SERIAL_8250_CS
-- tristate "8250/16550 PCMCIA device support"
-- depends on PCMCIA && SERIAL_8250
-- ---help---
-- Say Y here to enable support for 16-bit PCMCIA serial devices,
-- including serial port cards, modems, and the modem functions of
-- multi-function Ethernet/modem cards. (PCMCIA- or PC-cards are
-- credit-card size devices often used with laptops.)
--
-- To compile this driver as a module, choose M here: the
-- module will be called serial_cs.
--
-- If unsure, say N.
--
--config SERIAL_8250_NR_UARTS
-- int "Maximum number of 8250/16550 serial ports"
-- depends on SERIAL_8250
-- default "4"
-- help
-- Set this to the number of serial ports you want the driver
-- to support. This includes any ports discovered via ACPI or
-- PCI enumeration and any ports that may be added at run-time
-- via hot-plug, or any ISA multi-port serial cards.
--
--config SERIAL_8250_RUNTIME_UARTS
-- int "Number of 8250/16550 serial ports to register at runtime"
-- depends on SERIAL_8250
-- range 0 SERIAL_8250_NR_UARTS
-- default "4"
-- help
-- Set this to the maximum number of serial ports you want
-- the kernel to register at boot time. This can be overridden
-- with the module parameter "nr_uarts", or boot-time parameter
-- 8250.nr_uarts
--
--config SERIAL_8250_EXTENDED
-- bool "Extended 8250/16550 serial driver options"
-- depends on SERIAL_8250
-- help
-- If you wish to use any non-standard features of the standard "dumb"
-- driver, say Y here. This includes HUB6 support, shared serial
-- interrupts, special multiport support, support for more than the
-- four COM 1/2/3/4 boards, etc.
--
-- Note that the answer to this question won't directly affect the
-- kernel: saying N will just cause the configurator to skip all
-- the questions about serial driver options. If unsure, say N.
--
--config SERIAL_8250_MANY_PORTS
-- bool "Support more than 4 legacy serial ports"
-- depends on SERIAL_8250_EXTENDED && !IA64
-- help
-- Say Y here if you have dumb serial boards other than the four
-- standard COM 1/2/3/4 ports. This may happen if you have an AST
-- FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
-- from <http://www.tldp.org/docs.html#howto>), or other custom
-- serial port hardware which acts similar to standard serial port
-- hardware. If you only use the standard COM 1/2/3/4 ports, you can
-- say N here to save some memory. You can also say Y if you have an
-- "intelligent" multiport card such as Cyclades, Digiboards, etc.
--
--#
--# Multi-port serial cards
--#
--
--config SERIAL_8250_FOURPORT
-- tristate "Support Fourport cards"
-- depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-- help
-- Say Y here if you have an AST FourPort serial board.
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_fourport.
--
--config SERIAL_8250_ACCENT
-- tristate "Support Accent cards"
-- depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-- help
-- Say Y here if you have an Accent Async serial board.
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_accent.
--
--config SERIAL_8250_BOCA
-- tristate "Support Boca cards"
-- depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-- help
-- Say Y here if you have a Boca serial board. Please read the Boca
-- mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_boca.
--
--config SERIAL_8250_EXAR_ST16C554
-- tristate "Support Exar ST16C554/554D Quad UART"
-- depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-- help
-- The Uplogix Envoy TU301 uses this Exar Quad UART. If you are
-- tinkering with your Envoy TU301, or have a machine with this UART,
-- say Y here.
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_exar_st16c554.
--
--config SERIAL_8250_HUB6
-- tristate "Support Hub6 cards"
-- depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
-- help
-- Say Y here if you have a HUB6 serial board.
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_hub6.
--
--config SERIAL_8250_SHARE_IRQ
-- bool "Support for sharing serial interrupts"
-- depends on SERIAL_8250_EXTENDED
-- help
-- Some serial boards have hardware support which allows multiple dumb
-- serial ports on the same board to share a single IRQ. To enable
-- support for this in the serial driver, say Y here.
--
--config SERIAL_8250_DETECT_IRQ
-- bool "Autodetect IRQ on standard ports (unsafe)"
-- depends on SERIAL_8250_EXTENDED
-- help
-- Say Y here if you want the kernel to try to guess which IRQ
-- to use for your serial port.
--
-- This is considered unsafe; it is far better to configure the IRQ in
-- a boot script using the setserial command.
--
-- If unsure, say N.
--
--config SERIAL_8250_RSA
-- bool "Support RSA serial ports"
-- depends on SERIAL_8250_EXTENDED
-- help
-- ::: To be written :::
--
--config SERIAL_8250_MCA
-- tristate "Support 8250-type ports on MCA buses"
-- depends on SERIAL_8250 != n && MCA
-- help
-- Say Y here if you have a MCA serial ports.
--
-- To compile this driver as a module, choose M here: the module
-- will be called 8250_mca.
--
--config SERIAL_8250_ACORN
-- tristate "Acorn expansion card serial port support"
-- depends on ARCH_ACORN && SERIAL_8250
-- help
-- If you have an Atomwide Serial card or Serial Port card for an Acorn
-- system, say Y to this option. The driver can handle 1, 2, or 3 port
-- cards. If unsure, say N.
--
--config SERIAL_8250_RM9K
-- bool "Support for MIPS RM9xxx integrated serial port"
-- depends on SERIAL_8250 != n && SERIAL_RM9000
-- select SERIAL_8250_SHARE_IRQ
-- help
-- Selecting this option will add support for the integrated serial
-- port hardware found on MIPS RM9122 and similar processors.
-- If unsure, say N.
-+source "drivers/tty/serial/8250/Kconfig"
-
- comment "Non-8250 serial port support"
-
-diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
-index cb2628f..b74267d 100644
---- a/drivers/tty/serial/Makefile
-+++ b/drivers/tty/serial/Makefile
-@@ -14,20 +14,9 @@ obj-$(CONFIG_SERIAL_SUNZILOG) += sunzilog.o
- obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o
- obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
-
--obj-$(CONFIG_SERIAL_8250) += 8250.o
--obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o
--obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
--obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
--obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
--obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
--obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
--obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
--obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
--obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
--obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
--obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
--obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
--obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
-+# Now bring in any enabled 8250/16450/16550 type drivers.
-+obj-$(CONFIG_SERIAL_8250) += 8250/
-+
- obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
- obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
- obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0018-mmc-add-a-generic-GPIO-card-detect-helper.patch b/patches.kzm9g/0018-mmc-add-a-generic-GPIO-card-detect-helper.patch
deleted file mode 100644
index e5901c4a52bbd5..00000000000000
--- a/patches.kzm9g/0018-mmc-add-a-generic-GPIO-card-detect-helper.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From e9d1edae3f34367442cab71753a0d1e55cbc439b Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Sun, 25 Dec 2011 21:36:02 +0100
-Subject: mmc: add a generic GPIO card-detect helper
-
-This patch adds a primitive helper to support card hotplug detection on
-platforms, where a GPIO, capable of producing interrupts, is used for
-detection of card-insertion and -removal events.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 349ab52446772a359bc7e7699cae3880d48fa5c9)
-
-Conflicts:
-
- drivers/mmc/core/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/core/Makefile | 1 +
- drivers/mmc/core/cd-gpio.c | 74 +++++++++++++++++++++++++++++++++++++++++++++
- include/linux/mmc/cd-gpio.h | 19 ++++++++++++
- 3 files changed, 94 insertions(+)
- create mode 100644 drivers/mmc/core/cd-gpio.c
- create mode 100644 include/linux/mmc/cd-gpio.h
-
-diff --git a/drivers/mmc/core/Makefile b/drivers/mmc/core/Makefile
-index 6395019..274b67c 100644
---- a/drivers/mmc/core/Makefile
-+++ b/drivers/mmc/core/Makefile
-@@ -9,4 +9,5 @@ mmc_core-y := core.o bus.o host.o \
- sdio_cis.o sdio_io.o sdio_irq.o \
- quirks.o
-
-+mmc_core-$(CONFIG_GPIOLIB) += cd-gpio.o
- mmc_core-$(CONFIG_DEBUG_FS) += debugfs.o
-diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
-new file mode 100644
-index 0000000..082202a
---- /dev/null
-+++ b/drivers/mmc/core/cd-gpio.c
-@@ -0,0 +1,74 @@
-+/*
-+ * Generic GPIO card-detect helper
-+ *
-+ * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/err.h>
-+#include <linux/gpio.h>
-+#include <linux/interrupt.h>
-+#include <linux/jiffies.h>
-+#include <linux/mmc/host.h>
-+#include <linux/module.h>
-+#include <linux/slab.h>
-+
-+struct mmc_cd_gpio {
-+ unsigned int gpio;
-+ char label[0];
-+};
-+
-+static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id)
-+{
-+ /* Schedule a card detection after a debounce timeout */
-+ mmc_detect_change(dev_id, msecs_to_jiffies(100));
-+ return IRQ_HANDLED;
-+}
-+
-+int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
-+ unsigned int irq, unsigned long flags)
-+{
-+ size_t len = strlen(dev_name(host->parent)) + 4;
-+ struct mmc_cd_gpio *cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
-+ int ret;
-+
-+ if (!cd)
-+ return -ENOMEM;
-+
-+ snprintf(cd->label, len, "%s cd", dev_name(host->parent));
-+
-+ ret = gpio_request_one(gpio, GPIOF_DIR_IN, cd->label);
-+ if (ret < 0)
-+ goto egpioreq;
-+
-+ ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt,
-+ flags, cd->label, host);
-+ if (ret < 0)
-+ goto eirqreq;
-+
-+ cd->gpio = gpio;
-+ host->hotplug.irq = irq;
-+ host->hotplug.handler_priv = cd;
-+
-+ return 0;
-+
-+eirqreq:
-+ gpio_free(gpio);
-+egpioreq:
-+ kfree(cd);
-+ return ret;
-+}
-+EXPORT_SYMBOL(mmc_cd_gpio_request);
-+
-+void mmc_cd_gpio_free(struct mmc_host *host)
-+{
-+ struct mmc_cd_gpio *cd = host->hotplug.handler_priv;
-+
-+ free_irq(host->hotplug.irq, host);
-+ gpio_free(cd->gpio);
-+ kfree(cd);
-+}
-+EXPORT_SYMBOL(mmc_cd_gpio_free);
-diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h
-new file mode 100644
-index 0000000..a8e4697
---- /dev/null
-+++ b/include/linux/mmc/cd-gpio.h
-@@ -0,0 +1,19 @@
-+/*
-+ * Generic GPIO card-detect helper header
-+ *
-+ * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#ifndef MMC_CD_GPIO_H
-+#define MMC_CD_GPIO_H
-+
-+struct mmc_host;
-+int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
-+ unsigned int irq, unsigned long flags);
-+void mmc_cd_gpio_free(struct mmc_host *host);
-+
-+#endif
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0018-serial-Kill-off-NO_IRQ.patch b/patches.kzm9g/0018-serial-Kill-off-NO_IRQ.patch
deleted file mode 100644
index 20a2b724db0863..00000000000000
--- a/patches.kzm9g/0018-serial-Kill-off-NO_IRQ.patch
+++ /dev/null
@@ -1,361 +0,0 @@
-From f2a0fc4b05410441cf28a4894bb7f1e1983a77bb Mon Sep 17 00:00:00 2001
-From: Alan Cox <alan@linux.intel.com>
-Date: Thu, 26 Jan 2012 17:44:09 +0000
-Subject: serial: Kill off NO_IRQ
-
-We transform the offenders into a test of irq <= 0 which will be ok while
-the ARM people get their platform sorted. Once that is done (or in a while
-if they don't do it anyway) then we will change them all to !irq checks.
-
-For arch specific drivers that are already using NO_IRQ = 0 we just test
-against zero so we don't need to re-review them later.
-
-Signed-off-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit d4e33fac2408d37f7b52e80ca2a89f9fb482914f)
-
-Conflicts:
-
- drivers/tty/serial/m32r_sio.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/hvc/hvc_beat.c | 2 +-
- drivers/tty/hvc/hvc_rtas.c | 2 +-
- drivers/tty/hvc/hvc_udbg.c | 2 +-
- drivers/tty/hvc/hvc_xen.c | 2 +-
- drivers/tty/hvc/hvcs.c | 4 ++--
- drivers/tty/hvc/hvsi.c | 2 +-
- drivers/tty/serial/21285.c | 4 ++--
- drivers/tty/serial/8250/8250.c | 21 +++++++--------------
- drivers/tty/serial/mpc52xx_uart.c | 4 ++--
- drivers/tty/serial/mux.c | 2 +-
- drivers/tty/serial/pmac_zilog.c | 2 +-
- drivers/tty/serial/sunzilog.c | 10 +++++-----
- drivers/tty/serial/ucc_uart.c | 2 +-
- drivers/tty/serial/vr41xx_siu.c | 4 ++--
- 14 files changed, 28 insertions(+), 35 deletions(-)
-
-diff --git a/drivers/tty/hvc/hvc_beat.c b/drivers/tty/hvc/hvc_beat.c
-index 5fe4631..1560d23 100644
---- a/drivers/tty/hvc/hvc_beat.c
-+++ b/drivers/tty/hvc/hvc_beat.c
-@@ -113,7 +113,7 @@ static int __init hvc_beat_init(void)
- if (!firmware_has_feature(FW_FEATURE_BEAT))
- return -ENODEV;
-
-- hp = hvc_alloc(0, NO_IRQ, &hvc_beat_get_put_ops, 16);
-+ hp = hvc_alloc(0, 0, &hvc_beat_get_put_ops, 16);
- if (IS_ERR(hp))
- return PTR_ERR(hp);
- hvc_beat_dev = hp;
-diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c
-index 61c4a61..0069bb8 100644
---- a/drivers/tty/hvc/hvc_rtas.c
-+++ b/drivers/tty/hvc/hvc_rtas.c
-@@ -94,7 +94,7 @@ static int __init hvc_rtas_init(void)
-
- /* Allocate an hvc_struct for the console device we instantiated
- * earlier. Save off hp so that we can return it on exit */
-- hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops, 16);
-+ hp = hvc_alloc(hvc_rtas_cookie, 0, &hvc_rtas_get_put_ops, 16);
- if (IS_ERR(hp))
- return PTR_ERR(hp);
-
-diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c
-index b0957e6..4c9b13e 100644
---- a/drivers/tty/hvc/hvc_udbg.c
-+++ b/drivers/tty/hvc/hvc_udbg.c
-@@ -69,7 +69,7 @@ static int __init hvc_udbg_init(void)
-
- BUG_ON(hvc_udbg_dev);
-
-- hp = hvc_alloc(0, NO_IRQ, &hvc_udbg_ops, 16);
-+ hp = hvc_alloc(0, 0, &hvc_udbg_ops, 16);
- if (IS_ERR(hp))
- return PTR_ERR(hp);
-
-diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
-index 52fdf60..a1b0a75 100644
---- a/drivers/tty/hvc/hvc_xen.c
-+++ b/drivers/tty/hvc/hvc_xen.c
-@@ -176,7 +176,7 @@ static int __init xen_hvc_init(void)
- xencons_irq = bind_evtchn_to_irq(xen_start_info->console.domU.evtchn);
- }
- if (xencons_irq < 0)
-- xencons_irq = 0; /* NO_IRQ */
-+ xencons_irq = 0;
- else
- irq_set_noprobe(xencons_irq);
-
-diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
-index 4c8b665..cb0bf44 100644
---- a/drivers/tty/hvc/hvcs.c
-+++ b/drivers/tty/hvc/hvcs.c
-@@ -1203,7 +1203,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
- {
- struct hvcs_struct *hvcsd;
- unsigned long flags;
-- int irq = NO_IRQ;
-+ int irq;
-
- /*
- * Is someone trying to close the file associated with this device after
-@@ -1264,7 +1264,7 @@ static void hvcs_hangup(struct tty_struct * tty)
- struct hvcs_struct *hvcsd = tty->driver_data;
- unsigned long flags;
- int temp_open_count;
-- int irq = NO_IRQ;
-+ int irq;
-
- spin_lock_irqsave(&hvcsd->lock, flags);
- /* Preserve this so that we know how many kref refs to put */
-diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
-index 8a8d637..8e1fbd3 100644
---- a/drivers/tty/hvc/hvsi.c
-+++ b/drivers/tty/hvc/hvsi.c
-@@ -1298,7 +1298,7 @@ static int __init hvsi_console_init(void)
- hp->state = HVSI_CLOSED;
- hp->vtermno = *vtermno;
- hp->virq = irq_create_mapping(NULL, irq[0]);
-- if (hp->virq == NO_IRQ) {
-+ if (hp->virq == 0) {
- printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n",
- __func__, irq[0]);
- continue;
-diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c
-index 1b37626..f899996 100644
---- a/drivers/tty/serial/21285.c
-+++ b/drivers/tty/serial/21285.c
-@@ -331,7 +331,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct
- int ret = 0;
- if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285)
- ret = -EINVAL;
-- if (ser->irq != NO_IRQ)
-+ if (ser->irq <= 0)
- ret = -EINVAL;
- if (ser->baud_base != port->uartclk / 16)
- ret = -EINVAL;
-@@ -360,7 +360,7 @@ static struct uart_ops serial21285_ops = {
- static struct uart_port serial21285_port = {
- .mapbase = 0x42000160,
- .iotype = UPIO_MEM,
-- .irq = NO_IRQ,
-+ .irq = 0,
- .fifosize = 16,
- .ops = &serial21285_ops,
- .flags = UPF_BOOT_AUTOCONF,
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 047221d..e7c1304 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -86,13 +86,6 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
- #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
-
-
--/*
-- * We default to IRQ0 for the "no irq" hack. Some
-- * machine types want others as well - they're free
-- * to redefine this in their header file.
-- */
--#define is_real_interrupt(irq) ((irq) != 0)
--
- #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
- #define CONFIG_SERIAL_DETECT_IRQ 1
- #endif
-@@ -1748,7 +1741,7 @@ static void serial8250_backup_timeout(unsigned long data)
- * Must disable interrupts or else we risk racing with the interrupt
- * based handler.
- */
-- if (is_real_interrupt(up->port.irq)) {
-+ if (up->port.irq) {
- ier = serial_in(up, UART_IER);
- serial_out(up, UART_IER, 0);
- }
-@@ -1773,7 +1766,7 @@ static void serial8250_backup_timeout(unsigned long data)
- if (!(iir & UART_IIR_NO_INT))
- serial8250_tx_chars(up);
-
-- if (is_real_interrupt(up->port.irq))
-+ if (up->port.irq)
- serial_out(up, UART_IER, ier);
-
- spin_unlock_irqrestore(&up->port.lock, flags);
-@@ -2026,7 +2019,7 @@ static int serial8250_startup(struct uart_port *port)
- serial_outp(up, UART_LCR, 0);
- }
-
-- if (is_real_interrupt(up->port.irq)) {
-+ if (up->port.irq) {
- unsigned char iir1;
- /*
- * Test for UARTs that do not reassert THRE when the
-@@ -2081,7 +2074,7 @@ static int serial8250_startup(struct uart_port *port)
- * hardware interrupt, we use a timer-based system. The original
- * driver used to do this with IRQ0.
- */
-- if (!is_real_interrupt(up->port.irq)) {
-+ if (!up->port.irq) {
- up->timer.data = (unsigned long)up;
- mod_timer(&up->timer, jiffies + uart_poll_timeout(port));
- } else {
-@@ -2097,13 +2090,13 @@ static int serial8250_startup(struct uart_port *port)
-
- spin_lock_irqsave(&up->port.lock, flags);
- if (up->port.flags & UPF_FOURPORT) {
-- if (!is_real_interrupt(up->port.irq))
-+ if (!up->port.irq)
- up->port.mctrl |= TIOCM_OUT1;
- } else
- /*
- * Most PC uarts need OUT2 raised to enable interrupts.
- */
-- if (is_real_interrupt(up->port.irq))
-+ if (up->port.irq)
- up->port.mctrl |= TIOCM_OUT2;
-
- serial8250_set_mctrl(&up->port, up->port.mctrl);
-@@ -2221,7 +2214,7 @@ static void serial8250_shutdown(struct uart_port *port)
-
- del_timer_sync(&up->timer);
- up->timer.function = serial8250_timeout;
-- if (is_real_interrupt(up->port.irq))
-+ if (up->port.irq)
- serial_unlink_irq_chain(up);
- }
-
-diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
-index a0bcd8a..0d0d859 100644
---- a/drivers/tty/serial/mpc52xx_uart.c
-+++ b/drivers/tty/serial/mpc52xx_uart.c
-@@ -506,7 +506,7 @@ static int __init mpc512x_psc_fifoc_init(void)
-
- psc_fifoc_irq = irq_of_parse_and_map(np, 0);
- of_node_put(np);
-- if (psc_fifoc_irq == NO_IRQ) {
-+ if (psc_fifoc_irq == 0) {
- pr_err("%s: Can't get FIFOC irq\n", __func__);
- iounmap(psc_fifoc);
- return -ENODEV;
-@@ -1353,7 +1353,7 @@ static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
- }
-
- psc_ops->get_irq(port, op->dev.of_node);
-- if (port->irq == NO_IRQ) {
-+ if (port->irq == 0) {
- dev_dbg(&op->dev, "Could not get irq\n");
- return -EINVAL;
- }
-diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c
-index 9711e06..3605c79 100644
---- a/drivers/tty/serial/mux.c
-+++ b/drivers/tty/serial/mux.c
-@@ -497,7 +497,7 @@ static int __init mux_probe(struct parisc_device *dev)
- port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
- port->iotype = UPIO_MEM;
- port->type = PORT_MUX;
-- port->irq = NO_IRQ;
-+ port->irq = 0;
- port->uartclk = 0;
- port->fifosize = MUX_FIFO_SIZE;
- port->ops = &mux_pops;
-diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
-index 5acd24a..22ef6b2 100644
---- a/drivers/tty/serial/pmac_zilog.c
-+++ b/drivers/tty/serial/pmac_zilog.c
-@@ -1565,7 +1565,7 @@ no_dma:
- * fixed up interrupt info, but we use the device-tree directly
- * here due to early probing so we need the fixup too.
- */
-- if (uap->port.irq == NO_IRQ &&
-+ if (uap->port.irq == 0 &&
- np->parent && np->parent->parent &&
- of_device_is_compatible(np->parent->parent, "gatwick")) {
- /* IRQs on gatwick are offset by 64 */
-diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
-index 8e916e7..5a47d1b 100644
---- a/drivers/tty/serial/sunzilog.c
-+++ b/drivers/tty/serial/sunzilog.c
-@@ -1397,7 +1397,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
- #endif
- }
-
--static int zilog_irq = -1;
-+static int zilog_irq;
-
- static int __devinit zs_probe(struct platform_device *op)
- {
-@@ -1425,7 +1425,7 @@ static int __devinit zs_probe(struct platform_device *op)
-
- rp = sunzilog_chip_regs[inst];
-
-- if (zilog_irq == -1)
-+ if (!zilog_irq)
- zilog_irq = op->archdata.irqs[0];
-
- up = &sunzilog_port_table[inst * 2];
-@@ -1580,7 +1580,7 @@ static int __init sunzilog_init(void)
- if (err)
- goto out_unregister_uart;
-
-- if (zilog_irq != -1) {
-+ if (!zilog_irq) {
- struct uart_sunzilog_port *up = sunzilog_irq_chain;
- err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
- "zs", sunzilog_irq_chain);
-@@ -1621,7 +1621,7 @@ static void __exit sunzilog_exit(void)
- {
- platform_driver_unregister(&zs_driver);
-
-- if (zilog_irq != -1) {
-+ if (!zilog_irq) {
- struct uart_sunzilog_port *up = sunzilog_irq_chain;
-
- /* Disable Interrupts */
-@@ -1637,7 +1637,7 @@ static void __exit sunzilog_exit(void)
- }
-
- free_irq(zilog_irq, sunzilog_irq_chain);
-- zilog_irq = -1;
-+ zilog_irq = 0;
- }
-
- if (sunzilog_reg.nr) {
-diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
-index c327218..d5b8e7e 100644
---- a/drivers/tty/serial/ucc_uart.c
-+++ b/drivers/tty/serial/ucc_uart.c
-@@ -1355,7 +1355,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
- }
-
- qe_port->port.irq = irq_of_parse_and_map(np, 0);
-- if (qe_port->port.irq == NO_IRQ) {
-+ if (qe_port->port.irq == 0) {
- dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
- qe_port->ucc_num + 1);
- ret = -EINVAL;
-diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
-index 3beb6ab..15be73d 100644
---- a/drivers/tty/serial/vr41xx_siu.c
-+++ b/drivers/tty/serial/vr41xx_siu.c
-@@ -61,7 +61,7 @@
- static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = {
- [0 ... SIU_PORTS_MAX-1] = {
- .lock = __SPIN_LOCK_UNLOCKED(siu_uart_ports->lock),
-- .irq = -1,
-+ .irq = 0,
- },
- };
-
-@@ -171,7 +171,7 @@ static inline unsigned int siu_check_type(struct uart_port *port)
- {
- if (port->line == 0)
- return PORT_VR41XX_SIU;
-- if (port->line == 1 && port->irq != -1)
-+ if (port->line == 1 && port->irq)
- return PORT_VR41XX_DSIU;
-
- return PORT_UNKNOWN;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0019-mmc-simplify-mmc_cd_gpio_request-by-removing-two-par.patch b/patches.kzm9g/0019-mmc-simplify-mmc_cd_gpio_request-by-removing-two-par.patch
deleted file mode 100644
index 8c85d61ce13f2c..00000000000000
--- a/patches.kzm9g/0019-mmc-simplify-mmc_cd_gpio_request-by-removing-two-par.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 6859f92c44996d7337c5d3a1dbfbbb43af00a3c4 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:07 +0100
-Subject: mmc: simplify mmc_cd_gpio_request() by removing two parameters
-
-Calculate the IRQ number, using gpio_to_irq() and use fixed flags: trigger
-on both edges. This makes two out of four arguments of the
-mmc_cd_gpio_request() function redundant.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit c9b0546a59293cabf54c85e1218da595af3274ff)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/core/cd-gpio.c | 13 +++++++++----
- include/linux/mmc/cd-gpio.h | 3 +--
- 2 files changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
-index 082202a..29de31e 100644
---- a/drivers/mmc/core/cd-gpio.c
-+++ b/drivers/mmc/core/cd-gpio.c
-@@ -28,13 +28,17 @@ static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id)
- return IRQ_HANDLED;
- }
-
--int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
-- unsigned int irq, unsigned long flags)
-+int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio)
- {
- size_t len = strlen(dev_name(host->parent)) + 4;
-- struct mmc_cd_gpio *cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
-+ struct mmc_cd_gpio *cd;
-+ int irq = gpio_to_irq(gpio);
- int ret;
-
-+ if (irq < 0)
-+ return irq;
-+
-+ cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
- if (!cd)
- return -ENOMEM;
-
-@@ -45,7 +49,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
- goto egpioreq;
-
- ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt,
-- flags, cd->label, host);
-+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-+ cd->label, host);
- if (ret < 0)
- goto eirqreq;
-
-diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h
-index a8e4697..cefaba0 100644
---- a/include/linux/mmc/cd-gpio.h
-+++ b/include/linux/mmc/cd-gpio.h
-@@ -12,8 +12,7 @@
- #define MMC_CD_GPIO_H
-
- struct mmc_host;
--int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
-- unsigned int irq, unsigned long flags);
-+int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio);
- void mmc_cd_gpio_free(struct mmc_host *host);
-
- #endif
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0019-tty-fix-a-build-failure-on-sparc.patch b/patches.kzm9g/0019-tty-fix-a-build-failure-on-sparc.patch
deleted file mode 100644
index 35a49625e5f4f7..00000000000000
--- a/patches.kzm9g/0019-tty-fix-a-build-failure-on-sparc.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 571708bcbfb19bb1d4916d2bbc4c5cc23b4a701a Mon Sep 17 00:00:00 2001
-From: Cong Wang <xiyou.wangcong@gmail.com>
-Date: Fri, 3 Feb 2012 13:22:10 +0800
-Subject: tty: fix a build failure on sparc
-
-On sparc, there is a build failure:
-
-drivers/tty/serial/8250/8250.c:48:21: error: suncore.h: No such file or directory
-drivers/tty/serial/8250/8250.c:3275: error: implicit declaration of function 'sunserial_register_minors'
-drivers/tty/serial/8250/8250.c:3305: error: implicit declaration of function 'sunserial_unregister_minors'
-
-this is due to commit 9bef3d4197379a995fa80f81950bbbf8d32e9e8b
-(serial: group all the 8250 related code together) moved these files
-into 8250/ subdirectory, but forgot to change the reference
-to drivers/tty/serial/suncore.h.
-
-Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit e7c9bba7999a8e55efb96d4279c025ca587c5ecd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index e7c1304..a154ba2 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -45,7 +45,7 @@
- #include "8250.h"
-
- #ifdef CONFIG_SPARC
--#include "suncore.h"
-+#include "../suncore.h"
- #endif
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/002-lsti-backport-arm-mach-shmobile-kzm9g-add-external-usb-host-support.patch b/patches.kzm9g/002-lsti-backport-arm-mach-shmobile-kzm9g-add-external-usb-host-support.patch
deleted file mode 100644
index 023be87566cfa1..00000000000000
--- a/patches.kzm9g/002-lsti-backport-arm-mach-shmobile-kzm9g-add-external-usb-host-support.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jun 26 04:10:44 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Tue, 26 Jun 2012 20:10:41 +0900
-Subject: [LTSI-dev] [PATCH 2/4] LSTI: backport: ARM: mach-shmobile: kzm9g: add external USB Host support
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: kuninori.morimoto.gx@gmail.com
-Message-ID: <4FE998B1.1050308@kmckk.co.jp>
-
-
-This is backport of
-commit dd818180f9303eed270513e8ccd4516bb3a577f5
-
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 31 +++++++++++++++++++++++++++++++
- 1 file changed, 31 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index 35af2f8..297cda9 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -31,6 +31,7 @@
- #include <linux/mfd/tmio.h>
- #include <linux/platform_device.h>
- #include <linux/smsc911x.h>
-+#include <linux/usb/r8a66597.h>
- #include <linux/videodev2.h>
- #include <sound/sh_fsi.h>
- #include <sound/simple_card.h>
-@@ -92,6 +93,35 @@ static struct platform_device smsc_device = {
- .num_resources = ARRAY_SIZE(smsc9221_resources),
- };
-
-+/* USB external chip */
-+static struct r8a66597_platdata usb_host_data = {
-+ .on_chip = 0,
-+ .xtal = R8A66597_PLATDATA_XTAL_48MHZ,
-+};
-+
-+static struct resource usb_resources[] = {
-+ [0] = {
-+ .start = 0x10010000,
-+ .end = 0x1001ffff - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = intcs_evt2irq(0x220), /* IRQ1 */
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device usb_host_device = {
-+ .name = "r8a66597_hcd",
-+ .dev = {
-+ .platform_data = &usb_host_data,
-+ .dma_mask = NULL,
-+ .coherent_dma_mask = 0xffffffff,
-+ },
-+ .num_resources = ARRAY_SIZE(usb_resources),
-+ .resource = usb_resources,
-+};
-+
- /* LCDC */
- static struct fb_videomode kzm_lcdc_mode = {
- .name = "WVGA Panel",
-@@ -330,6 +360,7 @@ static struct i2c_board_info i2c3_devices[] = {
-
- static struct platform_device *kzm_devices[] __initdata = {
- &smsc_device,
-+ &usb_host_device,
- &lcdc_device,
- &mmc_device,
- &sdhi0_device,
---
-1.7.9.5
-
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.kzm9g/0020-mmc-Standardize-header-file-inclusion-checks.patch b/patches.kzm9g/0020-mmc-Standardize-header-file-inclusion-checks.patch
deleted file mode 100644
index 560a4ac361d4b7..00000000000000
--- a/patches.kzm9g/0020-mmc-Standardize-header-file-inclusion-checks.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 062b1cec7113d11cddbead31195d74707b9c5bb8 Mon Sep 17 00:00:00 2001
-From: "Robert P. J. Day" <rpjday@crashcourse.ca>
-Date: Fri, 27 May 2011 16:04:03 -0400
-Subject: mmc: Standardize header file inclusion checks.
-
-Standardize the checks for multiple MMC header file inclusion,
-including adding comments to terminating #endif's, and fixing
-one incorrect comment.
-
-Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 100e918610b7487fa18db97b3879cd8d1fdd5974)
-
-Cherry-picked changes for:
- include/linux/mmc/sh_mobile_sdhi.h
- include/linux/mmc/tmio.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/mmc/sh_mobile_sdhi.h | 6 +++---
- include/linux/mmc/tmio.h | 6 +++---
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
-index faf32b6..bd50b36 100644
---- a/include/linux/mmc/sh_mobile_sdhi.h
-+++ b/include/linux/mmc/sh_mobile_sdhi.h
-@@ -1,5 +1,5 @@
--#ifndef __SH_MOBILE_SDHI_H__
--#define __SH_MOBILE_SDHI_H__
-+#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
-+#define LINUX_MMC_SH_MOBILE_SDHI_H
-
- #include <linux/types.h>
-
-@@ -17,4 +17,4 @@ struct sh_mobile_sdhi_info {
- int (*get_cd)(struct platform_device *pdev);
- };
-
--#endif /* __SH_MOBILE_SDHI_H__ */
-+#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
-diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
-index 19490b9..551490f 100644
---- a/include/linux/mmc/tmio.h
-+++ b/include/linux/mmc/tmio.h
-@@ -12,8 +12,8 @@
- *
- * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
- */
--#ifndef _LINUX_MMC_TMIO_H_
--#define _LINUX_MMC_TMIO_H_
-+#ifndef LINUX_MMC_TMIO_H
-+#define LINUX_MMC_TMIO_H
-
- #define CTL_SD_CMD 0x00
- #define CTL_ARG_REG 0x04
-@@ -60,4 +60,4 @@
-
- #define TMIO_BBS 512 /* Boot block size */
-
--#endif /* _LINUX_MMC_TMIO_H_ */
-+#endif /* LINUX_MMC_TMIO_H */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0020-tty-sparc-rename-drivers-tty-serial-suncore.h-includ.patch b/patches.kzm9g/0020-tty-sparc-rename-drivers-tty-serial-suncore.h-includ.patch
deleted file mode 100644
index 073454477bb0df..00000000000000
--- a/patches.kzm9g/0020-tty-sparc-rename-drivers-tty-serial-suncore.h-includ.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From 7242a5c3b6dae31b7d9fc687ece21d96aa27bead Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 9 Feb 2012 18:48:19 -0500
-Subject: tty: sparc: rename drivers/tty/serial/suncore.h ->
- include/linux/sunserialcore.h
-
-There are multiple users of this file from different source
-paths now, and rather than have ../ paths in include statements,
-just move the file to the linux header dir.
-
-Suggested-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 6816383a09b5be8d35f14f4c25dedb64498e4959)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- MAINTAINERS | 2 +-
- drivers/tty/serial/8250/8250.c | 7 +++----
- drivers/tty/serial/suncore.c | 2 +-
- drivers/tty/serial/suncore.h | 33 ---------------------------------
- drivers/tty/serial/sunhv.c | 3 +--
- drivers/tty/serial/sunsab.c | 2 +-
- drivers/tty/serial/sunsu.c | 3 +--
- drivers/tty/serial/sunzilog.c | 2 +-
- include/linux/sunserialcore.h | 33 +++++++++++++++++++++++++++++++++
- 9 files changed, 42 insertions(+), 45 deletions(-)
- rename drivers/tty/serial/suncore.h => include/linux/sunserialcore.h (98%)
-
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -5958,8 +5958,8 @@ L: sparclinux@vger.kernel.org
- T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
- T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
- S: Maintained
-+F: include/linux/sunserialcore.h
- F: drivers/tty/serial/suncore.c
--F: drivers/tty/serial/suncore.h
- F: drivers/tty/serial/sunhv.c
- F: drivers/tty/serial/sunsab.c
- F: drivers/tty/serial/sunsab.h
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -38,16 +38,15 @@
- #include <linux/nmi.h>
- #include <linux/mutex.h>
- #include <linux/slab.h>
-+#ifdef CONFIG_SPARC
-+#include <linux/sunserialcore.h>
-+#endif
-
- #include <asm/io.h>
- #include <asm/irq.h>
-
- #include "8250.h"
-
--#ifdef CONFIG_SPARC
--#include "../suncore.h"
--#endif
--
- /*
- * Configuration:
- * share_irqs - whether we pass IRQF_SHARED to request_irq(). This option
---- a/drivers/tty/serial/suncore.c
-+++ b/drivers/tty/serial/suncore.c
-@@ -17,11 +17,11 @@
- #include <linux/errno.h>
- #include <linux/string.h>
- #include <linux/serial_core.h>
-+#include <linux/sunserialcore.h>
- #include <linux/init.h>
-
- #include <asm/prom.h>
-
--#include "suncore.h"
-
- static int sunserial_current_minor = 64;
-
---- a/drivers/tty/serial/suncore.h
-+++ /dev/null
-@@ -1,33 +0,0 @@
--/* suncore.h
-- *
-- * Generic SUN serial/kbd/ms layer. Based entirely
-- * upon drivers/sbus/char/sunserial.h which is:
-- *
-- * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
-- *
-- * Port to new UART layer is:
-- *
-- * Copyright (C) 2002 David S. Miller (davem@redhat.com)
-- */
--
--#ifndef _SERIAL_SUN_H
--#define _SERIAL_SUN_H
--
--/* Serial keyboard defines for L1-A processing... */
--#define SUNKBD_RESET 0xff
--#define SUNKBD_L1 0x01
--#define SUNKBD_UP 0x80
--#define SUNKBD_A 0x4d
--
--extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
--extern int suncore_mouse_baud_detection(unsigned char, int);
--
--extern int sunserial_register_minors(struct uart_driver *, int);
--extern void sunserial_unregister_minors(struct uart_driver *, int);
--
--extern int sunserial_console_match(struct console *, struct device_node *,
-- struct uart_driver *, int, bool);
--extern void sunserial_console_termios(struct console *,
-- struct device_node *);
--
--#endif /* !(_SERIAL_SUN_H) */
---- a/drivers/tty/serial/sunhv.c
-+++ b/drivers/tty/serial/sunhv.c
-@@ -29,8 +29,7 @@
- #endif
-
- #include <linux/serial_core.h>
--
--#include "suncore.h"
-+#include <linux/sunserialcore.h>
-
- #define CON_BREAK ((long)-1)
- #define CON_HUP ((long)-2)
---- a/drivers/tty/serial/sunsab.c
-+++ b/drivers/tty/serial/sunsab.c
-@@ -43,8 +43,8 @@
- #endif
-
- #include <linux/serial_core.h>
-+#include <linux/sunserialcore.h>
-
--#include "suncore.h"
- #include "sunsab.h"
-
- struct uart_sunsab_port {
---- a/drivers/tty/serial/sunsu.c
-+++ b/drivers/tty/serial/sunsu.c
-@@ -47,8 +47,7 @@
- #endif
-
- #include <linux/serial_core.h>
--
--#include "suncore.h"
-+#include <linux/sunserialcore.h>
-
- /* We are on a NS PC87303 clocked with 24.0 MHz, which results
- * in a UART clock of 1.8462 MHz.
---- a/drivers/tty/serial/sunzilog.c
-+++ b/drivers/tty/serial/sunzilog.c
-@@ -43,8 +43,8 @@
- #endif
-
- #include <linux/serial_core.h>
-+#include <linux/sunserialcore.h>
-
--#include "suncore.h"
- #include "sunzilog.h"
-
- /* On 32-bit sparcs we need to delay after register accesses
---- /dev/null
-+++ b/include/linux/sunserialcore.h
-@@ -0,0 +1,33 @@
-+/* sunserialcore.h
-+ *
-+ * Generic SUN serial/kbd/ms layer. Based entirely
-+ * upon drivers/sbus/char/sunserial.h which is:
-+ *
-+ * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
-+ *
-+ * Port to new UART layer is:
-+ *
-+ * Copyright (C) 2002 David S. Miller (davem@redhat.com)
-+ */
-+
-+#ifndef _SERIAL_SUN_H
-+#define _SERIAL_SUN_H
-+
-+/* Serial keyboard defines for L1-A processing... */
-+#define SUNKBD_RESET 0xff
-+#define SUNKBD_L1 0x01
-+#define SUNKBD_UP 0x80
-+#define SUNKBD_A 0x4d
-+
-+extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
-+extern int suncore_mouse_baud_detection(unsigned char, int);
-+
-+extern int sunserial_register_minors(struct uart_driver *, int);
-+extern void sunserial_unregister_minors(struct uart_driver *, int);
-+
-+extern int sunserial_console_match(struct console *, struct device_node *,
-+ struct uart_driver *, int, bool);
-+extern void sunserial_console_termios(struct console *,
-+ struct device_node *);
-+
-+#endif /* !(_SERIAL_SUN_H) */
diff --git a/patches.kzm9g/0021-mmc-tmio-name-0xd8-as-CTL_DMA_ENABLE.patch b/patches.kzm9g/0021-mmc-tmio-name-0xd8-as-CTL_DMA_ENABLE.patch
deleted file mode 100644
index f218a6469806da..00000000000000
--- a/patches.kzm9g/0021-mmc-tmio-name-0xd8-as-CTL_DMA_ENABLE.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 92448997a8190180d93ffc4e48be91a99fca2c41 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Tue, 21 Jun 2011 08:00:08 +0900
-Subject: mmc: tmio: name 0xd8 as CTL_DMA_ENABLE
-
-This reflects at least the current usage of this register
-and I think it improves the readability of the code ever so slightly.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 95c7348d948dc4832434ddfaeba804ac14732f02)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_dma.c | 2 +-
- include/linux/mmc/tmio.h | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 25f1ad6..9c4da66 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -26,7 +26,7 @@ static void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
- {
- #if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
- /* Switch DMA mode on or off - SuperH specific? */
-- writew(enable ? 2 : 0, host->ctl + (0xd8 << host->bus_shift));
-+ writew(enable ? 2 : 0, host->ctl + (CTL_DMA_ENABLE << host->bus_shift));
- #endif
- }
-
-diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
-index 551490f..3ae3776 100644
---- a/include/linux/mmc/tmio.h
-+++ b/include/linux/mmc/tmio.h
-@@ -30,6 +30,7 @@
- #define CTL_TRANSACTION_CTL 0x34
- #define CTL_SDIO_STATUS 0x36
- #define CTL_SDIO_IRQ_MASK 0x38
-+#define CTL_DMA_ENABLE 0xd8
- #define CTL_RESET_SD 0xe0
- #define CTL_SDIO_REGS 0x100
- #define CTL_CLK_AND_WAIT_CTL 0x138
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0021-serial-delete-last-unused-traces-of-pausing-I-O-in-8.patch b/patches.kzm9g/0021-serial-delete-last-unused-traces-of-pausing-I-O-in-8.patch
deleted file mode 100644
index 5356b24616bf68..00000000000000
--- a/patches.kzm9g/0021-serial-delete-last-unused-traces-of-pausing-I-O-in-8.patch
+++ /dev/null
@@ -1,732 +0,0 @@
-From 6312e447e5cfbc4a17af35d1c1bb0b12df671ad2 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:08 -0500
-Subject: serial: delete last unused traces of pausing I/O in 8250
-
-This is the last traces of pausing I/O that we had back some
-twenty years ago. Probably was only required for 8MHz ISA
-cards running "on the edge" at 12MHz. Anyway it hasn't been
-in use for years, so lets just bury it for good.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 0acf519f3f22450ae8f90cdb0f77b046fc731624)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 308 +++++++++++++++++++---------------------
- 1 file changed, 150 insertions(+), 158 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 9e2e282..fe75134 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -486,26 +486,18 @@ serial_out_sync(struct uart_8250_port *up, int offset, int value)
- (up->port.serial_in(&(up)->port, (offset)))
- #define serial_out(up, offset, value) \
- (up->port.serial_out(&(up)->port, (offset), (value)))
--/*
-- * We used to support using pause I/O for certain machines. We
-- * haven't supported this for a while, but just in case it's badly
-- * needed for certain old 386 machines, I've left these #define's
-- * in....
-- */
--#define serial_inp(up, offset) serial_in(up, offset)
--#define serial_outp(up, offset, value) serial_out(up, offset, value)
-
- /* Uart divisor latch read */
- static inline int _serial_dl_read(struct uart_8250_port *up)
- {
-- return serial_inp(up, UART_DLL) | serial_inp(up, UART_DLM) << 8;
-+ return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
- }
-
- /* Uart divisor latch write */
- static inline void _serial_dl_write(struct uart_8250_port *up, int value)
- {
-- serial_outp(up, UART_DLL, value & 0xff);
-- serial_outp(up, UART_DLM, value >> 8 & 0xff);
-+ serial_out(up, UART_DLL, value & 0xff);
-+ serial_out(up, UART_DLM, value >> 8 & 0xff);
- }
-
- #if defined(CONFIG_MIPS_ALCHEMY)
-@@ -575,10 +567,10 @@ static unsigned int serial_icr_read(struct uart_8250_port *up, int offset)
- static void serial8250_clear_fifos(struct uart_8250_port *p)
- {
- if (p->capabilities & UART_CAP_FIFO) {
-- serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO);
-- serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO |
-+ serial_out(p, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_out(p, UART_FCR, UART_FCR_ENABLE_FIFO |
- UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
-- serial_outp(p, UART_FCR, 0);
-+ serial_out(p, UART_FCR, 0);
- }
- }
-
-@@ -591,15 +583,15 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
- {
- if (p->capabilities & UART_CAP_SLEEP) {
- if (p->capabilities & UART_CAP_EFR) {
-- serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(p, UART_EFR, UART_EFR_ECB);
-- serial_outp(p, UART_LCR, 0);
-+ serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(p, UART_EFR, UART_EFR_ECB);
-+ serial_out(p, UART_LCR, 0);
- }
-- serial_outp(p, UART_IER, sleep ? UART_IERX_SLEEP : 0);
-+ serial_out(p, UART_IER, sleep ? UART_IERX_SLEEP : 0);
- if (p->capabilities & UART_CAP_EFR) {
-- serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(p, UART_EFR, 0);
-- serial_outp(p, UART_LCR, 0);
-+ serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(p, UART_EFR, 0);
-+ serial_out(p, UART_LCR, 0);
- }
- }
- }
-@@ -614,12 +606,12 @@ static int __enable_rsa(struct uart_8250_port *up)
- unsigned char mode;
- int result;
-
-- mode = serial_inp(up, UART_RSA_MSR);
-+ mode = serial_in(up, UART_RSA_MSR);
- result = mode & UART_RSA_MSR_FIFO;
-
- if (!result) {
-- serial_outp(up, UART_RSA_MSR, mode | UART_RSA_MSR_FIFO);
-- mode = serial_inp(up, UART_RSA_MSR);
-+ serial_out(up, UART_RSA_MSR, mode | UART_RSA_MSR_FIFO);
-+ mode = serial_in(up, UART_RSA_MSR);
- result = mode & UART_RSA_MSR_FIFO;
- }
-
-@@ -638,7 +630,7 @@ static void enable_rsa(struct uart_8250_port *up)
- spin_unlock_irq(&up->port.lock);
- }
- if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16)
-- serial_outp(up, UART_RSA_FRR, 0);
-+ serial_out(up, UART_RSA_FRR, 0);
- }
- }
-
-@@ -657,12 +649,12 @@ static void disable_rsa(struct uart_8250_port *up)
- up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) {
- spin_lock_irq(&up->port.lock);
-
-- mode = serial_inp(up, UART_RSA_MSR);
-+ mode = serial_in(up, UART_RSA_MSR);
- result = !(mode & UART_RSA_MSR_FIFO);
-
- if (!result) {
-- serial_outp(up, UART_RSA_MSR, mode & ~UART_RSA_MSR_FIFO);
-- mode = serial_inp(up, UART_RSA_MSR);
-+ serial_out(up, UART_RSA_MSR, mode & ~UART_RSA_MSR_FIFO);
-+ mode = serial_in(up, UART_RSA_MSR);
- result = !(mode & UART_RSA_MSR_FIFO);
- }
-
-@@ -683,28 +675,28 @@ static int size_fifo(struct uart_8250_port *up)
- unsigned short old_dl;
- int count;
-
-- old_lcr = serial_inp(up, UART_LCR);
-- serial_outp(up, UART_LCR, 0);
-- old_fcr = serial_inp(up, UART_FCR);
-- old_mcr = serial_inp(up, UART_MCR);
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO |
-+ old_lcr = serial_in(up, UART_LCR);
-+ serial_out(up, UART_LCR, 0);
-+ old_fcr = serial_in(up, UART_FCR);
-+ old_mcr = serial_in(up, UART_MCR);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO |
- UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
-- serial_outp(up, UART_MCR, UART_MCR_LOOP);
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
-+ serial_out(up, UART_MCR, UART_MCR_LOOP);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
- old_dl = serial_dl_read(up);
- serial_dl_write(up, 0x0001);
-- serial_outp(up, UART_LCR, 0x03);
-+ serial_out(up, UART_LCR, 0x03);
- for (count = 0; count < 256; count++)
-- serial_outp(up, UART_TX, count);
-+ serial_out(up, UART_TX, count);
- mdelay(20);/* FIXME - schedule_timeout */
-- for (count = 0; (serial_inp(up, UART_LSR) & UART_LSR_DR) &&
-+ for (count = 0; (serial_in(up, UART_LSR) & UART_LSR_DR) &&
- (count < 256); count++)
-- serial_inp(up, UART_RX);
-- serial_outp(up, UART_FCR, old_fcr);
-- serial_outp(up, UART_MCR, old_mcr);
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
-+ serial_in(up, UART_RX);
-+ serial_out(up, UART_FCR, old_fcr);
-+ serial_out(up, UART_MCR, old_mcr);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
- serial_dl_write(up, old_dl);
-- serial_outp(up, UART_LCR, old_lcr);
-+ serial_out(up, UART_LCR, old_lcr);
-
- return count;
- }
-@@ -719,20 +711,20 @@ static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
- unsigned char old_dll, old_dlm, old_lcr;
- unsigned int id;
-
-- old_lcr = serial_inp(p, UART_LCR);
-- serial_outp(p, UART_LCR, UART_LCR_CONF_MODE_A);
-+ old_lcr = serial_in(p, UART_LCR);
-+ serial_out(p, UART_LCR, UART_LCR_CONF_MODE_A);
-
-- old_dll = serial_inp(p, UART_DLL);
-- old_dlm = serial_inp(p, UART_DLM);
-+ old_dll = serial_in(p, UART_DLL);
-+ old_dlm = serial_in(p, UART_DLM);
-
-- serial_outp(p, UART_DLL, 0);
-- serial_outp(p, UART_DLM, 0);
-+ serial_out(p, UART_DLL, 0);
-+ serial_out(p, UART_DLM, 0);
-
-- id = serial_inp(p, UART_DLL) | serial_inp(p, UART_DLM) << 8;
-+ id = serial_in(p, UART_DLL) | serial_in(p, UART_DLM) << 8;
-
-- serial_outp(p, UART_DLL, old_dll);
-- serial_outp(p, UART_DLM, old_dlm);
-- serial_outp(p, UART_LCR, old_lcr);
-+ serial_out(p, UART_DLL, old_dll);
-+ serial_out(p, UART_DLM, old_dlm);
-+ serial_out(p, UART_LCR, old_lcr);
-
- return id;
- }
-@@ -842,11 +834,11 @@ static void autoconfig_8250(struct uart_8250_port *up)
- up->port.type = PORT_8250;
-
- scratch = serial_in(up, UART_SCR);
-- serial_outp(up, UART_SCR, 0xa5);
-+ serial_out(up, UART_SCR, 0xa5);
- status1 = serial_in(up, UART_SCR);
-- serial_outp(up, UART_SCR, 0x5a);
-+ serial_out(up, UART_SCR, 0x5a);
- status2 = serial_in(up, UART_SCR);
-- serial_outp(up, UART_SCR, scratch);
-+ serial_out(up, UART_SCR, scratch);
-
- if (status1 == 0xa5 && status2 == 0x5a)
- up->port.type = PORT_16450;
-@@ -877,7 +869,7 @@ static inline int ns16550a_goto_highspeed(struct uart_8250_port *up)
- } else {
- status &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
- status |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
-- serial_outp(up, 0x04, status);
-+ serial_out(up, 0x04, status);
- }
- return 1;
- }
-@@ -900,9 +892,9 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- * Check for presence of the EFR when DLAB is set.
- * Only ST16C650V1 UARTs pass this test.
- */
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
- if (serial_in(up, UART_EFR) == 0) {
-- serial_outp(up, UART_EFR, 0xA8);
-+ serial_out(up, UART_EFR, 0xA8);
- if (serial_in(up, UART_EFR) != 0) {
- DEBUG_AUTOCONF("EFRv1 ");
- up->port.type = PORT_16650;
-@@ -910,7 +902,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- } else {
- DEBUG_AUTOCONF("Motorola 8xxx DUART ");
- }
-- serial_outp(up, UART_EFR, 0);
-+ serial_out(up, UART_EFR, 0);
- return;
- }
-
-@@ -918,7 +910,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- * Maybe it requires 0xbf to be written to the LCR.
- * (other ST16C650V2 UARTs, TI16C752A, etc)
- */
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
- if (serial_in(up, UART_EFR) == 0 && !broken_efr(up)) {
- DEBUG_AUTOCONF("EFRv2 ");
- autoconfig_has_efr(up);
-@@ -932,23 +924,23 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- * switch back to bank 2, read it from EXCR1 again and check
- * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2
- */
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, 0);
- status1 = serial_in(up, UART_MCR);
-- serial_outp(up, UART_LCR, 0xE0);
-+ serial_out(up, UART_LCR, 0xE0);
- status2 = serial_in(up, 0x02); /* EXCR1 */
-
- if (!((status2 ^ status1) & UART_MCR_LOOP)) {
-- serial_outp(up, UART_LCR, 0);
-- serial_outp(up, UART_MCR, status1 ^ UART_MCR_LOOP);
-- serial_outp(up, UART_LCR, 0xE0);
-+ serial_out(up, UART_LCR, 0);
-+ serial_out(up, UART_MCR, status1 ^ UART_MCR_LOOP);
-+ serial_out(up, UART_LCR, 0xE0);
- status2 = serial_in(up, 0x02); /* EXCR1 */
-- serial_outp(up, UART_LCR, 0);
-- serial_outp(up, UART_MCR, status1);
-+ serial_out(up, UART_LCR, 0);
-+ serial_out(up, UART_MCR, status1);
-
- if ((status2 ^ status1) & UART_MCR_LOOP) {
- unsigned short quot;
-
-- serial_outp(up, UART_LCR, 0xE0);
-+ serial_out(up, UART_LCR, 0xE0);
-
- quot = serial_dl_read(up);
- quot <<= 3;
-@@ -956,7 +948,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- if (ns16550a_goto_highspeed(up))
- serial_dl_write(up, quot);
-
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, 0);
-
- up->port.uartclk = 921600*16;
- up->port.type = PORT_NS16550A;
-@@ -971,15 +963,15 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- * Try setting it with and without DLAB set. Cheap clones
- * set bit 5 without DLAB set.
- */
-- serial_outp(up, UART_LCR, 0);
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
-+ serial_out(up, UART_LCR, 0);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
- status1 = serial_in(up, UART_IIR) >> 5;
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_A);
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
- status2 = serial_in(up, UART_IIR) >> 5;
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_out(up, UART_LCR, 0);
-
- DEBUG_AUTOCONF("iir1=%d iir2=%d ", status1, status2);
-
-@@ -998,13 +990,13 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- * already a 1 and maybe locked there before we even start start.
- */
- iersave = serial_in(up, UART_IER);
-- serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
-+ serial_out(up, UART_IER, iersave & ~UART_IER_UUE);
- if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
- /*
- * OK it's in a known zero state, try writing and reading
- * without disturbing the current state of the other bits.
- */
-- serial_outp(up, UART_IER, iersave | UART_IER_UUE);
-+ serial_out(up, UART_IER, iersave | UART_IER_UUE);
- if (serial_in(up, UART_IER) & UART_IER_UUE) {
- /*
- * It's an Xscale.
-@@ -1022,7 +1014,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
- */
- DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
- }
-- serial_outp(up, UART_IER, iersave);
-+ serial_out(up, UART_IER, iersave);
-
- /*
- * Exar uarts have EFR in a weird location
-@@ -1084,8 +1076,8 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- * Note: this is safe as long as MCR bit 4 is clear
- * and the device is in "PC" mode.
- */
-- scratch = serial_inp(up, UART_IER);
-- serial_outp(up, UART_IER, 0);
-+ scratch = serial_in(up, UART_IER);
-+ serial_out(up, UART_IER, 0);
- #ifdef __i386__
- outb(0xff, 0x080);
- #endif
-@@ -1093,13 +1085,13 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- * Mask out IER[7:4] bits for test as some UARTs (e.g. TL
- * 16C754B) allow only to modify them if an EFR bit is set.
- */
-- scratch2 = serial_inp(up, UART_IER) & 0x0f;
-- serial_outp(up, UART_IER, 0x0F);
-+ scratch2 = serial_in(up, UART_IER) & 0x0f;
-+ serial_out(up, UART_IER, 0x0F);
- #ifdef __i386__
- outb(0, 0x080);
- #endif
-- scratch3 = serial_inp(up, UART_IER) & 0x0f;
-- serial_outp(up, UART_IER, scratch);
-+ scratch3 = serial_in(up, UART_IER) & 0x0f;
-+ serial_out(up, UART_IER, scratch);
- if (scratch2 != 0 || scratch3 != 0x0F) {
- /*
- * We failed; there's nothing here
-@@ -1123,9 +1115,9 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- * that conflicts with COM 1-4 --- we hope!
- */
- if (!(up->port.flags & UPF_SKIP_TEST)) {
-- serial_outp(up, UART_MCR, UART_MCR_LOOP | 0x0A);
-- status1 = serial_inp(up, UART_MSR) & 0xF0;
-- serial_outp(up, UART_MCR, save_mcr);
-+ serial_out(up, UART_MCR, UART_MCR_LOOP | 0x0A);
-+ status1 = serial_in(up, UART_MSR) & 0xF0;
-+ serial_out(up, UART_MCR, save_mcr);
- if (status1 != 0x90) {
- DEBUG_AUTOCONF("LOOP test failed (%02x) ",
- status1);
-@@ -1142,11 +1134,11 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- * We also initialise the EFR (if any) to zero for later. The
- * EFR occupies the same register location as the FCR and IIR.
- */
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(up, UART_EFR, 0);
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_EFR, 0);
-+ serial_out(up, UART_LCR, 0);
-
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
- scratch = serial_in(up, UART_IIR) >> 6;
-
- DEBUG_AUTOCONF("iir=%d ", scratch);
-@@ -1183,7 +1175,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- }
- #endif
-
-- serial_outp(up, UART_LCR, save_lcr);
-+ serial_out(up, UART_LCR, save_lcr);
-
- if (up->capabilities != uart_config[up->port.type].flags) {
- printk(KERN_WARNING
-@@ -1204,15 +1196,15 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- */
- #ifdef CONFIG_SERIAL_8250_RSA
- if (up->port.type == PORT_RSA)
-- serial_outp(up, UART_RSA_FRR, 0);
-+ serial_out(up, UART_RSA_FRR, 0);
- #endif
-- serial_outp(up, UART_MCR, save_mcr);
-+ serial_out(up, UART_MCR, save_mcr);
- serial8250_clear_fifos(up);
- serial_in(up, UART_RX);
- if (up->capabilities & UART_CAP_UUE)
-- serial_outp(up, UART_IER, UART_IER_UUE);
-+ serial_out(up, UART_IER, UART_IER_UUE);
- else
-- serial_outp(up, UART_IER, 0);
-+ serial_out(up, UART_IER, 0);
-
- out:
- spin_unlock_irqrestore(&up->port.lock, flags);
-@@ -1236,31 +1228,31 @@ static void autoconfig_irq(struct uart_8250_port *up)
-
- /* forget possible initially masked and pending IRQ */
- probe_irq_off(probe_irq_on());
-- save_mcr = serial_inp(up, UART_MCR);
-- save_ier = serial_inp(up, UART_IER);
-- serial_outp(up, UART_MCR, UART_MCR_OUT1 | UART_MCR_OUT2);
-+ save_mcr = serial_in(up, UART_MCR);
-+ save_ier = serial_in(up, UART_IER);
-+ serial_out(up, UART_MCR, UART_MCR_OUT1 | UART_MCR_OUT2);
-
- irqs = probe_irq_on();
-- serial_outp(up, UART_MCR, 0);
-+ serial_out(up, UART_MCR, 0);
- udelay(10);
- if (up->port.flags & UPF_FOURPORT) {
-- serial_outp(up, UART_MCR,
-+ serial_out(up, UART_MCR,
- UART_MCR_DTR | UART_MCR_RTS);
- } else {
-- serial_outp(up, UART_MCR,
-+ serial_out(up, UART_MCR,
- UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2);
- }
-- serial_outp(up, UART_IER, 0x0f); /* enable all intrs */
-- (void)serial_inp(up, UART_LSR);
-- (void)serial_inp(up, UART_RX);
-- (void)serial_inp(up, UART_IIR);
-- (void)serial_inp(up, UART_MSR);
-- serial_outp(up, UART_TX, 0xFF);
-+ serial_out(up, UART_IER, 0x0f); /* enable all intrs */
-+ (void)serial_in(up, UART_LSR);
-+ (void)serial_in(up, UART_RX);
-+ (void)serial_in(up, UART_IIR);
-+ (void)serial_in(up, UART_MSR);
-+ serial_out(up, UART_TX, 0xFF);
- udelay(20);
- irq = probe_irq_off(irqs);
-
-- serial_outp(up, UART_MCR, save_mcr);
-- serial_outp(up, UART_IER, save_ier);
-+ serial_out(up, UART_MCR, save_mcr);
-+ serial_out(up, UART_IER, save_ier);
-
- if (up->port.flags & UPF_FOURPORT)
- outb_p(save_ICP, ICP);
-@@ -1380,7 +1372,7 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
-
- do {
- if (likely(lsr & UART_LSR_DR))
-- ch = serial_inp(up, UART_RX);
-+ ch = serial_in(up, UART_RX);
- else
- /*
- * Intel 82571 has a Serial Over Lan device that will
-@@ -1445,7 +1437,7 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- uart_insert_char(&up->port, lsr, UART_LSR_OE, ch, flag);
-
- ignore_char:
-- lsr = serial_inp(up, UART_LSR);
-+ lsr = serial_in(up, UART_LSR);
- } while ((lsr & (UART_LSR_DR | UART_LSR_BI)) && (max_count-- > 0));
- spin_unlock(&up->port.lock);
- tty_flip_buffer_push(tty);
-@@ -1460,7 +1452,7 @@ void serial8250_tx_chars(struct uart_8250_port *up)
- int count;
-
- if (up->port.x_char) {
-- serial_outp(up, UART_TX, up->port.x_char);
-+ serial_out(up, UART_TX, up->port.x_char);
- up->port.icount.tx++;
- up->port.x_char = 0;
- return;
-@@ -1532,7 +1524,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
-
- spin_lock_irqsave(&up->port.lock, flags);
-
-- status = serial_inp(up, UART_LSR);
-+ status = serial_in(up, UART_LSR);
-
- DEBUG_INTR("status = %x...", status);
-
-@@ -1892,12 +1884,12 @@ static int serial8250_get_poll_char(struct uart_port *port)
- {
- struct uart_8250_port *up =
- container_of(port, struct uart_8250_port, port);
-- unsigned char lsr = serial_inp(up, UART_LSR);
-+ unsigned char lsr = serial_in(up, UART_LSR);
-
- if (!(lsr & UART_LSR_DR))
- return NO_POLL_CHAR;
-
-- return serial_inp(up, UART_RX);
-+ return serial_in(up, UART_RX);
- }
-
-
-@@ -1957,14 +1949,14 @@ static int serial8250_startup(struct uart_port *port)
- if (up->port.type == PORT_16C950) {
- /* Wake up and initialize UART */
- up->acr = 0;
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(up, UART_EFR, UART_EFR_ECB);
-- serial_outp(up, UART_IER, 0);
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_EFR, UART_EFR_ECB);
-+ serial_out(up, UART_IER, 0);
-+ serial_out(up, UART_LCR, 0);
- serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_outp(up, UART_EFR, UART_EFR_ECB);
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_EFR, UART_EFR_ECB);
-+ serial_out(up, UART_LCR, 0);
- }
-
- #ifdef CONFIG_SERIAL_8250_RSA
-@@ -1984,10 +1976,10 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Clear the interrupt registers.
- */
-- (void) serial_inp(up, UART_LSR);
-- (void) serial_inp(up, UART_RX);
-- (void) serial_inp(up, UART_IIR);
-- (void) serial_inp(up, UART_MSR);
-+ (void) serial_in(up, UART_LSR);
-+ (void) serial_in(up, UART_RX);
-+ (void) serial_in(up, UART_IIR);
-+ (void) serial_in(up, UART_MSR);
-
- /*
- * At this point, there's no way the LSR could still be 0xff;
-@@ -1995,7 +1987,7 @@ static int serial8250_startup(struct uart_port *port)
- * here.
- */
- if (!(up->port.flags & UPF_BUGGY_UART) &&
-- (serial_inp(up, UART_LSR) == 0xff)) {
-+ (serial_in(up, UART_LSR) == 0xff)) {
- printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
- serial_index(&up->port));
- return -ENODEV;
-@@ -2007,15 +1999,15 @@ static int serial8250_startup(struct uart_port *port)
- if (up->port.type == PORT_16850) {
- unsigned char fctr;
-
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-
-- fctr = serial_inp(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
-- serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX);
-- serial_outp(up, UART_TRG, UART_TRG_96);
-- serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_TX);
-- serial_outp(up, UART_TRG, UART_TRG_96);
-+ fctr = serial_in(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
-+ serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX);
-+ serial_out(up, UART_TRG, UART_TRG_96);
-+ serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_TX);
-+ serial_out(up, UART_TRG, UART_TRG_96);
-
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, 0);
- }
-
- if (up->port.irq) {
-@@ -2085,7 +2077,7 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Now, initialize the UART
- */
-- serial_outp(up, UART_LCR, UART_LCR_WLEN8);
-+ serial_out(up, UART_LCR, UART_LCR_WLEN8);
-
- spin_lock_irqsave(&up->port.lock, flags);
- if (up->port.flags & UPF_FOURPORT) {
-@@ -2118,10 +2110,10 @@ static int serial8250_startup(struct uart_port *port)
- * Do a quick test to see if we receive an
- * interrupt when we enable the TX irq.
- */
-- serial_outp(up, UART_IER, UART_IER_THRI);
-+ serial_out(up, UART_IER, UART_IER_THRI);
- lsr = serial_in(up, UART_LSR);
- iir = serial_in(up, UART_IIR);
-- serial_outp(up, UART_IER, 0);
-+ serial_out(up, UART_IER, 0);
-
- if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
- if (!(up->bugs & UART_BUG_TXEN)) {
-@@ -2141,10 +2133,10 @@ dont_test_tx_en:
- * saved flags to avoid getting false values from polling
- * routines or the previous session.
- */
-- serial_inp(up, UART_LSR);
-- serial_inp(up, UART_RX);
-- serial_inp(up, UART_IIR);
-- serial_inp(up, UART_MSR);
-+ serial_in(up, UART_LSR);
-+ serial_in(up, UART_RX);
-+ serial_in(up, UART_IIR);
-+ serial_in(up, UART_MSR);
- up->lsr_saved_flags = 0;
- up->msr_saved_flags = 0;
-
-@@ -2154,7 +2146,7 @@ dont_test_tx_en:
- * anyway, so we don't enable them here.
- */
- up->ier = UART_IER_RLSI | UART_IER_RDI;
-- serial_outp(up, UART_IER, up->ier);
-+ serial_out(up, UART_IER, up->ier);
-
- if (up->port.flags & UPF_FOURPORT) {
- unsigned int icp;
-@@ -2179,7 +2171,7 @@ static void serial8250_shutdown(struct uart_port *port)
- * Disable interrupts from this port
- */
- up->ier = 0;
-- serial_outp(up, UART_IER, 0);
-+ serial_out(up, UART_IER, 0);
-
- spin_lock_irqsave(&up->port.lock, flags);
- if (up->port.flags & UPF_FOURPORT) {
-@@ -2195,7 +2187,7 @@ static void serial8250_shutdown(struct uart_port *port)
- /*
- * Disable break condition and FIFOs
- */
-- serial_out(up, UART_LCR, serial_inp(up, UART_LCR) & ~UART_LCR_SBC);
-+ serial_out(up, UART_LCR, serial_in(up, UART_LCR) & ~UART_LCR_SBC);
- serial8250_clear_fifos(up);
-
- #ifdef CONFIG_SERIAL_8250_RSA
-@@ -2372,11 +2364,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- if (termios->c_cflag & CRTSCTS)
- efr |= UART_EFR_CTS;
-
-- serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
- if (up->port.flags & UPF_EXAR_EFR)
-- serial_outp(up, UART_XR_EFR, efr);
-+ serial_out(up, UART_XR_EFR, efr);
- else
-- serial_outp(up, UART_EFR, efr);
-+ serial_out(up, UART_EFR, efr);
- }
-
- #ifdef CONFIG_ARCH_OMAP
-@@ -2392,9 +2384,9 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
-
- if (up->capabilities & UART_NATSEMI) {
- /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
-- serial_outp(up, UART_LCR, 0xe0);
-+ serial_out(up, UART_LCR, 0xe0);
- } else {
-- serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
-+ serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
- }
-
- serial_dl_write(up, quot);
-@@ -2404,16 +2396,16 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- * is written without DLAB set, this mode will be disabled.
- */
- if (up->port.type == PORT_16750)
-- serial_outp(up, UART_FCR, fcr);
-+ serial_out(up, UART_FCR, fcr);
-
-- serial_outp(up, UART_LCR, cval); /* reset DLAB */
-+ serial_out(up, UART_LCR, cval); /* reset DLAB */
- up->lcr = cval; /* Save LCR */
- if (up->port.type != PORT_16750) {
- if (fcr & UART_FCR_ENABLE_FIFO) {
- /* emulated UARTs (Lucent Venus 167x) need two steps */
-- serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
- }
-- serial_outp(up, UART_FCR, fcr); /* set fcr */
-+ serial_out(up, UART_FCR, fcr); /* set fcr */
- }
- serial8250_set_mctrl(&up->port, up->port.mctrl);
- spin_unlock_irqrestore(&up->port.lock, flags);
-@@ -2995,11 +2987,11 @@ void serial8250_resume_port(int line)
-
- if (up->capabilities & UART_NATSEMI) {
- /* Ensure it's still in high speed mode */
-- serial_outp(up, UART_LCR, 0xE0);
-+ serial_out(up, UART_LCR, 0xE0);
-
- ns16550a_goto_highspeed(up);
-
-- serial_outp(up, UART_LCR, 0);
-+ serial_out(up, UART_LCR, 0);
- up->port.uartclk = 921600*16;
- }
- uart_resume_port(&serial8250_reg, &up->port);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0022-mmc-tmio-Share-register-access-functions.patch b/patches.kzm9g/0022-mmc-tmio-Share-register-access-functions.patch
deleted file mode 100644
index 05bfa4654dee85..00000000000000
--- a/patches.kzm9g/0022-mmc-tmio-Share-register-access-functions.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 92d89dd2b2076ea2d981596de7753ce0ded0fb17 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Tue, 21 Jun 2011 08:00:09 +0900
-Subject: mmc: tmio: Share register access functions
-
-Move register access functions into a shared header.
-Use sd_ctrl_write16 in tmio_mmc_dma.c:tmio_mmc_enable_dma().
-
-Other than avoiding (trivial) open-coding, the motivation for
-this is to allow platform-hooks in access functions to
-be applied across all applicable accesses.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit a11862d3389d4304211eed0758f510d5e573f93c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 35 +++++++++++++++++++++++++++++++++++
- drivers/mmc/host/tmio_mmc_dma.c | 2 +-
- drivers/mmc/host/tmio_mmc_pio.c | 34 ----------------------------------
- 3 files changed, 36 insertions(+), 35 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 8260bc2..0c22df0 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -134,4 +134,39 @@ int tmio_mmc_host_resume(struct device *dev);
- int tmio_mmc_host_runtime_suspend(struct device *dev);
- int tmio_mmc_host_runtime_resume(struct device *dev);
-
-+static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
-+{
-+ return readw(host->ctl + (addr << host->bus_shift));
-+}
-+
-+static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
-+ u16 *buf, int count)
-+{
-+ readsw(host->ctl + (addr << host->bus_shift), buf, count);
-+}
-+
-+static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
-+{
-+ return readw(host->ctl + (addr << host->bus_shift)) |
-+ readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
-+}
-+
-+static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
-+{
-+ writew(val, host->ctl + (addr << host->bus_shift));
-+}
-+
-+static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
-+ u16 *buf, int count)
-+{
-+ writesw(host->ctl + (addr << host->bus_shift), buf, count);
-+}
-+
-+static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
-+{
-+ writew(val, host->ctl + (addr << host->bus_shift));
-+ writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
-+}
-+
-+
- #endif
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 9c4da66..f24a029 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -26,7 +26,7 @@ static void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
- {
- #if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
- /* Switch DMA mode on or off - SuperH specific? */
-- writew(enable ? 2 : 0, host->ctl + (CTL_DMA_ENABLE << host->bus_shift));
-+ sd_ctrl_write16(host, enable ? 2 : 0, CTL_DMA_ENABLE);
- #endif
- }
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 0b09e82..4d17807 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -46,40 +46,6 @@
-
- #include "tmio_mmc.h"
-
--static u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
--{
-- return readw(host->ctl + (addr << host->bus_shift));
--}
--
--static void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
-- u16 *buf, int count)
--{
-- readsw(host->ctl + (addr << host->bus_shift), buf, count);
--}
--
--static u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
--{
-- return readw(host->ctl + (addr << host->bus_shift)) |
-- readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
--}
--
--static void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
--{
-- writew(val, host->ctl + (addr << host->bus_shift));
--}
--
--static void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
-- u16 *buf, int count)
--{
-- writesw(host->ctl + (addr << host->bus_shift), buf, count);
--}
--
--static void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
--{
-- writew(val, host->ctl + (addr << host->bus_shift));
-- writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
--}
--
- void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i)
- {
- u32 mask = sd_ctrl_read32(host, CTL_IRQ_MASK) & ~(i & TMIO_MASK_IRQ);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0022-serial-make-8250-s-serial_in-shareable-to-other-driv.patch b/patches.kzm9g/0022-serial-make-8250-s-serial_in-shareable-to-other-driv.patch
deleted file mode 100644
index 5492bd40e93e39..00000000000000
--- a/patches.kzm9g/0022-serial-make-8250-s-serial_in-shareable-to-other-driv.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From aa16319bc84ef2b1c48898c340accb81575be000 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:09 -0500
-Subject: serial: make 8250's serial_in shareable to other drivers.
-
-Currently 8250.c has serial_in and serial_out as shortcuts
-to doing the port I/O. They are implemented as macros a
-ways down in the file. This isn't by accident, but is
-implicitly required, so cpp doesn't mangle other instances
-of the common string "serial_in", as it exists as a field
-in the port struct itself.
-
-The above mangling avoidance violates the principle of least
-surprise, and it also prevents the shortcuts from being
-relocated up to the top of file, or into 8250.h -- either
-being a better location than the current one.
-
-Move them to 8250.h so other 8250-like drivers can also use
-the shortcuts, and in the process, make the conflicting
-names go away by using static inlines instead of macros.
-The object file size remains unchanged with this modification.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 3f0ab32753b49ae7afc5b69e3f23152d92aa1f85)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 5 -----
- drivers/tty/serial/8250/8250.h | 10 ++++++++++
- 2 files changed, 10 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index fe75134..06e17d5 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -482,11 +482,6 @@ serial_out_sync(struct uart_8250_port *up, int offset, int value)
- }
- }
-
--#define serial_in(up, offset) \
-- (up->port.serial_in(&(up)->port, (offset)))
--#define serial_out(up, offset, value) \
-- (up->port.serial_out(&(up)->port, (offset), (value)))
--
- /* Uart divisor latch read */
- static inline int _serial_dl_read(struct uart_8250_port *up)
- {
-diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
-index ae027be..2868a1d 100644
---- a/drivers/tty/serial/8250/8250.h
-+++ b/drivers/tty/serial/8250/8250.h
-@@ -86,6 +86,16 @@ struct serial8250_config {
- #define SERIAL8250_SHARE_IRQS 0
- #endif
-
-+static inline int serial_in(struct uart_8250_port *up, int offset)
-+{
-+ return up->port.serial_in(&up->port, offset);
-+}
-+
-+static inline void serial_out(struct uart_8250_port *up, int offset, int value)
-+{
-+ up->port.serial_out(&up->port, offset, value);
-+}
-+
- #if defined(__alpha__) && !defined(CONFIG_PCI)
- /*
- * Digital did something really horribly wrong with the OUT1 and OUT2
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0023-mmc-sdhi-Add-write16_hook.patch b/patches.kzm9g/0023-mmc-sdhi-Add-write16_hook.patch
deleted file mode 100644
index ae80b0eede9db1..00000000000000
--- a/patches.kzm9g/0023-mmc-sdhi-Add-write16_hook.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From 337f49667f11fbdb1bcd1ca51816c812de84123f Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Tue, 21 Jun 2011 08:00:10 +0900
-Subject: mmc: sdhi: Add write16_hook
-
-Some controllers require waiting for the bus to become idle
-before writing to some registers. I have implemented this
-by adding a hook to sd_ctrl_write16() and implementing
-a hook for SDHI which waits for the bus to become idle.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 973ed3af1a570612771ed10dec6506c757767668)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 36 ++++++++++++++++++++++++++++++++++++
- drivers/mmc/host/tmio_mmc.h | 5 +++++
- include/linux/mfd/tmio.h | 8 ++++++++
- include/linux/mmc/tmio.h | 1 +
- 4 files changed, 50 insertions(+)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index ce500f0..774f643 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -26,6 +26,7 @@
- #include <linux/mmc/sh_mobile_sdhi.h>
- #include <linux/mfd/tmio.h>
- #include <linux/sh_dma.h>
-+#include <linux/delay.h>
-
- #include "tmio_mmc.h"
-
-@@ -55,6 +56,39 @@ static int sh_mobile_sdhi_get_cd(struct platform_device *pdev)
- return -ENOSYS;
- }
-
-+static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
-+{
-+ int timeout = 1000;
-+
-+ while (--timeout && !(sd_ctrl_read16(host, CTL_STATUS2) & (1 << 13)))
-+ udelay(1);
-+
-+ if (!timeout) {
-+ dev_warn(host->pdata->dev, "timeout waiting for SD bus idle\n");
-+ return -EBUSY;
-+ }
-+
-+ return 0;
-+}
-+
-+static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
-+{
-+ switch (addr)
-+ {
-+ case CTL_SD_CMD:
-+ case CTL_STOP_INTERNAL_ACTION:
-+ case CTL_XFER_BLK_COUNT:
-+ case CTL_SD_CARD_CLK_CTL:
-+ case CTL_SD_XFER_LEN:
-+ case CTL_SD_MEM_CARD_OPT:
-+ case CTL_TRANSACTION_CTL:
-+ case CTL_DMA_ENABLE:
-+ return sh_mobile_sdhi_wait_idle(host);
-+ }
-+
-+ return 0;
-+}
-+
- static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- {
- struct sh_mobile_sdhi *priv;
-@@ -86,6 +120,8 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- mmc_data->hclk = clk_get_rate(priv->clk);
- mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
- mmc_data->get_cd = sh_mobile_sdhi_get_cd;
-+ if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT)
-+ mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
- mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
- if (p) {
- mmc_data->flags = p->tmio_flags;
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 0c22df0..211ef6e 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -153,6 +153,11 @@ static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
-
- static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
- {
-+ /* If there is a hook and it returns non-zero then there
-+ * is an error and the write should be skipped
-+ */
-+ if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr))
-+ return;
- writew(val, host->ctl + (addr << host->bus_shift));
- }
-
-diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
-index 5a90266..0dc9804 100644
---- a/include/linux/mfd/tmio.h
-+++ b/include/linux/mfd/tmio.h
-@@ -68,6 +68,11 @@
- * controller and report the event to the driver.
- */
- #define TMIO_MMC_HAS_COLD_CD (1 << 3)
-+/*
-+ * Some controllers require waiting for the SD bus to become
-+ * idle before writing to some registers.
-+ */
-+#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
-
- int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
- int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
-@@ -80,6 +85,8 @@ struct tmio_mmc_dma {
- int alignment_shift;
- };
-
-+struct tmio_mmc_host;
-+
- /*
- * data for the MMC controller
- */
-@@ -94,6 +101,7 @@ struct tmio_mmc_data {
- void (*set_pwr)(struct platform_device *host, int state);
- void (*set_clk_div)(struct platform_device *host, int state);
- int (*get_cd)(struct platform_device *host);
-+ int (*write16_hook)(struct tmio_mmc_host *host, int addr);
- };
-
- static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
-diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
-index 3ae3776..a1c1f32 100644
---- a/include/linux/mmc/tmio.h
-+++ b/include/linux/mmc/tmio.h
-@@ -21,6 +21,7 @@
- #define CTL_XFER_BLK_COUNT 0xa
- #define CTL_RESPONSE 0x0c
- #define CTL_STATUS 0x1c
-+#define CTL_STATUS2 0x1e
- #define CTL_IRQ_MASK 0x20
- #define CTL_SD_CARD_CLK_CTL 0x24
- #define CTL_SD_XFER_LEN 0x26
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0023-serial-delete-useless-void-casts-in-8250.c.patch b/patches.kzm9g/0023-serial-delete-useless-void-casts-in-8250.c.patch
deleted file mode 100644
index ee3eaff5a34de7..00000000000000
--- a/patches.kzm9g/0023-serial-delete-useless-void-casts-in-8250.c.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From e5d5cfab51ec956d809d5951e2ec3b7d7fe7819c Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:10 -0500
-Subject: serial: delete useless void casts in 8250.c
-
-These might have worked some magic with an ancient gcc back in
-1992, but "objdump --disassemble" on gcc 4.6 on x86-64 shows
-identical output before and after this commit. Send the casts
-and their hysterical rasins to the bitbucket.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 0d263a264c4b8376ccf33248f6fac873310e5e05)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 22 +++++++++++-----------
- 1 file changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 06e17d5..5da9f99 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -1218,7 +1218,7 @@ static void autoconfig_irq(struct uart_8250_port *up)
- ICP = (up->port.iobase & 0xfe0) | 0x1f;
- save_ICP = inb_p(ICP);
- outb_p(0x80, ICP);
-- (void) inb_p(ICP);
-+ inb_p(ICP);
- }
-
- /* forget possible initially masked and pending IRQ */
-@@ -1238,10 +1238,10 @@ static void autoconfig_irq(struct uart_8250_port *up)
- UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2);
- }
- serial_out(up, UART_IER, 0x0f); /* enable all intrs */
-- (void)serial_in(up, UART_LSR);
-- (void)serial_in(up, UART_RX);
-- (void)serial_in(up, UART_IIR);
-- (void)serial_in(up, UART_MSR);
-+ serial_in(up, UART_LSR);
-+ serial_in(up, UART_RX);
-+ serial_in(up, UART_IIR);
-+ serial_in(up, UART_MSR);
- serial_out(up, UART_TX, 0xFF);
- udelay(20);
- irq = probe_irq_off(irqs);
-@@ -1971,10 +1971,10 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Clear the interrupt registers.
- */
-- (void) serial_in(up, UART_LSR);
-- (void) serial_in(up, UART_RX);
-- (void) serial_in(up, UART_IIR);
-- (void) serial_in(up, UART_MSR);
-+ serial_in(up, UART_LSR);
-+ serial_in(up, UART_RX);
-+ serial_in(up, UART_IIR);
-+ serial_in(up, UART_MSR);
-
- /*
- * At this point, there's no way the LSR could still be 0xff;
-@@ -2150,7 +2150,7 @@ dont_test_tx_en:
- */
- icp = (up->port.iobase & 0xfe0) | 0x01f;
- outb_p(0x80, icp);
-- (void) inb_p(icp);
-+ inb_p(icp);
- }
-
- return 0;
-@@ -2196,7 +2196,7 @@ static void serial8250_shutdown(struct uart_port *port)
- * Read data port to reset things, and then unlink from
- * the IRQ chain.
- */
-- (void) serial_in(up, UART_RX);
-+ serial_in(up, UART_RX);
-
- del_timer_sync(&up->timer);
- up->timer.function = serial8250_timeout;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0024-mmc-tmio-Fix-race-condition-resulting-in-spurious-in.patch b/patches.kzm9g/0024-mmc-tmio-Fix-race-condition-resulting-in-spurious-in.patch
deleted file mode 100644
index 3a2ce6eed2ab07..00000000000000
--- a/patches.kzm9g/0024-mmc-tmio-Fix-race-condition-resulting-in-spurious-in.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-From 95c27915c3f1955092a6cc2e5900a58aa2dfc7c0 Mon Sep 17 00:00:00 2001
-From: Paul Parsons <lost.distance@yahoo.com>
-Date: Sun, 15 May 2011 13:24:41 +0000
-Subject: mmc: tmio: Fix race condition resulting in spurious interrupts
-
-There is a race condition in the tmio_mmc_irq() interrupt handler,
-caused by the presence of a while loop, which results in warnings of
-spurious interrupts. This was found on an HP iPAQ hx4700 whose HTC
-ASIC3 reportedly incorporates the Toshiba TC6380AF controller.
-
-Towards the end of a multiple read (CMD18) operation the handler clears
-the final RXRDY status bit in the first loop iteration, sees the DATAEND
-status bit at the bottom of the loop, and so clears the DATAEND status
-bit in the second loop iteration. However the DATAEND interrupt is still
-queued in the system somewhere and can't be delivered until the handler
-has returned. This second interrupt is then reported as spurious in the
-next call to the handler. Likewise for single read (CMD17) operations.
-And something similar occurs for multiple write (CMD25) and single write
-(CMD24) operations, where CMDRESPEND and TXRQ status bits are cleared in
-a single call.
-
-In these cases the interrupt handler clears two separate interrupts when
-it should only clear the one interrupt for which it was invoked. The fix
-is to remove the while loop.
-
-Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit e312eb1e66e4357000e4e7438849d5a5fd738219)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 76 +++++++++++++++++------------------------
- 1 file changed, 32 insertions(+), 44 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 4d17807..f7dd3b1 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -569,58 +569,46 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- pr_debug_status(status);
- pr_debug_status(ireg);
-
-- if (!ireg) {
-- tmio_mmc_disable_mmc_irqs(host, status & ~irq_mask);
--
-- pr_warning("tmio_mmc: Spurious irq, disabling! "
-- "0x%08x 0x%08x 0x%08x\n", status, irq_mask, ireg);
-- pr_debug_status(status);
--
-+ /* Card insert / remove attempts */
-+ if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
-+ tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT |
-+ TMIO_STAT_CARD_REMOVE);
-+ mmc_detect_change(host->mmc, msecs_to_jiffies(100));
- goto out;
- }
-
-- while (ireg) {
-- /* Card insert / remove attempts */
-- if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
-- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT |
-- TMIO_STAT_CARD_REMOVE);
-- mmc_detect_change(host->mmc, msecs_to_jiffies(100));
-- }
--
-- /* CRC and other errors */
--/* if (ireg & TMIO_STAT_ERR_IRQ)
-- * handled |= tmio_error_irq(host, irq, stat);
-+ /* CRC and other errors */
-+/* if (ireg & TMIO_STAT_ERR_IRQ)
-+ * handled |= tmio_error_irq(host, irq, stat);
- */
-
-- /* Command completion */
-- if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
-- tmio_mmc_ack_mmc_irqs(host,
-- TMIO_STAT_CMDRESPEND |
-- TMIO_STAT_CMDTIMEOUT);
-- tmio_mmc_cmd_irq(host, status);
-- }
--
-- /* Data transfer */
-- if (ireg & (TMIO_STAT_RXRDY | TMIO_STAT_TXRQ)) {
-- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_RXRDY | TMIO_STAT_TXRQ);
-- tmio_mmc_pio_irq(host);
-- }
--
-- /* Data transfer completion */
-- if (ireg & TMIO_STAT_DATAEND) {
-- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_DATAEND);
-- tmio_mmc_data_irq(host);
-- }
-+ /* Command completion */
-+ if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
-+ tmio_mmc_ack_mmc_irqs(host,
-+ TMIO_STAT_CMDRESPEND |
-+ TMIO_STAT_CMDTIMEOUT);
-+ tmio_mmc_cmd_irq(host, status);
-+ goto out;
-+ }
-
-- /* Check status - keep going until we've handled it all */
-- status = sd_ctrl_read32(host, CTL_STATUS);
-- irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
-- ireg = status & TMIO_MASK_IRQ & ~irq_mask;
-+ /* Data transfer */
-+ if (ireg & (TMIO_STAT_RXRDY | TMIO_STAT_TXRQ)) {
-+ tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_RXRDY | TMIO_STAT_TXRQ);
-+ tmio_mmc_pio_irq(host);
-+ goto out;
-+ }
-
-- pr_debug("Status at end of loop: %08x\n", status);
-- pr_debug_status(status);
-+ /* Data transfer completion */
-+ if (ireg & TMIO_STAT_DATAEND) {
-+ tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_DATAEND);
-+ tmio_mmc_data_irq(host);
-+ goto out;
- }
-- pr_debug("MMC IRQ end\n");
-+
-+ pr_warning("tmio_mmc: Spurious irq, disabling! "
-+ "0x%08x 0x%08x 0x%08x\n", status, irq_mask, ireg);
-+ pr_debug_status(status);
-+ tmio_mmc_disable_mmc_irqs(host, status & ~irq_mask);
-
- out:
- return IRQ_HANDLED;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0024-serial-reduce-number-of-indirections-in-8250-code.patch b/patches.kzm9g/0024-serial-reduce-number-of-indirections-in-8250-code.patch
deleted file mode 100644
index f729a5591f1fc3..00000000000000
--- a/patches.kzm9g/0024-serial-reduce-number-of-indirections-in-8250-code.patch
+++ /dev/null
@@ -1,958 +0,0 @@
-From 83c841cec4163679900da8fa7845ef51fd8d9486 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:11 -0500
-Subject: serial: reduce number of indirections in 8250 code
-
-The serial_8250_port struct contains within a serial_port struct
-and many times one or the other, or both are in scope within
-functions via a passed in arg, or via container_of.
-
-However there are a lot of cases where we have access directly
-to the port pointer, but yet go through the parent 8250_port
-structure instead to get it. These should just use the port
-struct directly.
-
-Similarly there are cases where it makes sense (from a code
-cleanliness point of view) to declare a local for the port
-struct, so we aren't going through the parent 8250_port struct
-repeatedly to get to it.
-
-We get a small reduction in text size, but it appears that
-gcc was smart enough to internally be doing most of this
-already, so the readability improvement is the larger gain.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit dfe42443ea1d30c98db59b7b1f914bc147d31336)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 322 +++++++++++++++++++++-------------------
- 1 file changed, 167 insertions(+), 155 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 5da9f99..9ffb3cf 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -1040,24 +1040,25 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- {
- unsigned char status1, scratch, scratch2, scratch3;
- unsigned char save_lcr, save_mcr;
-+ struct uart_port *port = &up->port;
- unsigned long flags;
-
-- if (!up->port.iobase && !up->port.mapbase && !up->port.membase)
-+ if (!port->iobase && !port->mapbase && !port->membase)
- return;
-
- DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04lx, 0x%p): ",
-- serial_index(&up->port), up->port.iobase, up->port.membase);
-+ serial_index(port), port->iobase, port->membase);
-
- /*
- * We really do need global IRQs disabled here - we're going to
- * be frobbing the chips IRQ enable register to see if it exists.
- */
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
-
- up->capabilities = 0;
- up->bugs = 0;
-
-- if (!(up->port.flags & UPF_BUGGY_UART)) {
-+ if (!(port->flags & UPF_BUGGY_UART)) {
- /*
- * Do a simple existence test first; if we fail this,
- * there's no point trying anything else.
-@@ -1109,7 +1110,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- * manufacturer would be stupid enough to design a board
- * that conflicts with COM 1-4 --- we hope!
- */
-- if (!(up->port.flags & UPF_SKIP_TEST)) {
-+ if (!(port->flags & UPF_SKIP_TEST)) {
- serial_out(up, UART_MCR, UART_MCR_LOOP | 0x0A);
- status1 = serial_in(up, UART_MSR) & 0xF0;
- serial_out(up, UART_MCR, save_mcr);
-@@ -1143,10 +1144,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- autoconfig_8250(up);
- break;
- case 1:
-- up->port.type = PORT_UNKNOWN;
-+ port->type = PORT_UNKNOWN;
- break;
- case 2:
-- up->port.type = PORT_16550;
-+ port->type = PORT_16550;
- break;
- case 3:
- autoconfig_16550a(up);
-@@ -1157,13 +1158,12 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- /*
- * Only probe for RSA ports if we got the region.
- */
-- if (up->port.type == PORT_16550A && probeflags & PROBE_RSA) {
-+ if (port->type == PORT_16550A && probeflags & PROBE_RSA) {
- int i;
-
- for (i = 0 ; i < probe_rsa_count; ++i) {
-- if (probe_rsa[i] == up->port.iobase &&
-- __enable_rsa(up)) {
-- up->port.type = PORT_RSA;
-+ if (probe_rsa[i] == port->iobase && __enable_rsa(up)) {
-+ port->type = PORT_RSA;
- break;
- }
- }
-@@ -1172,25 +1172,25 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
-
- serial_out(up, UART_LCR, save_lcr);
-
-- if (up->capabilities != uart_config[up->port.type].flags) {
-+ if (up->capabilities != uart_config[port->type].flags) {
- printk(KERN_WARNING
- "ttyS%d: detected caps %08x should be %08x\n",
-- serial_index(&up->port), up->capabilities,
-- uart_config[up->port.type].flags);
-+ serial_index(port), up->capabilities,
-+ uart_config[port->type].flags);
- }
-
-- up->port.fifosize = uart_config[up->port.type].fifo_size;
-- up->capabilities = uart_config[up->port.type].flags;
-- up->tx_loadsz = uart_config[up->port.type].tx_loadsz;
-+ port->fifosize = uart_config[up->port.type].fifo_size;
-+ up->capabilities = uart_config[port->type].flags;
-+ up->tx_loadsz = uart_config[port->type].tx_loadsz;
-
-- if (up->port.type == PORT_UNKNOWN)
-+ if (port->type == PORT_UNKNOWN)
- goto out;
-
- /*
- * Reset the UART.
- */
- #ifdef CONFIG_SERIAL_8250_RSA
-- if (up->port.type == PORT_RSA)
-+ if (port->type == PORT_RSA)
- serial_out(up, UART_RSA_FRR, 0);
- #endif
- serial_out(up, UART_MCR, save_mcr);
-@@ -1202,20 +1202,21 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
- serial_out(up, UART_IER, 0);
-
- out:
-- spin_unlock_irqrestore(&up->port.lock, flags);
-- DEBUG_AUTOCONF("type=%s\n", uart_config[up->port.type].name);
-+ spin_unlock_irqrestore(&port->lock, flags);
-+ DEBUG_AUTOCONF("type=%s\n", uart_config[port->type].name);
- }
-
- static void autoconfig_irq(struct uart_8250_port *up)
- {
-+ struct uart_port *port = &up->port;
- unsigned char save_mcr, save_ier;
- unsigned char save_ICP = 0;
- unsigned int ICP = 0;
- unsigned long irqs;
- int irq;
-
-- if (up->port.flags & UPF_FOURPORT) {
-- ICP = (up->port.iobase & 0xfe0) | 0x1f;
-+ if (port->flags & UPF_FOURPORT) {
-+ ICP = (port->iobase & 0xfe0) | 0x1f;
- save_ICP = inb_p(ICP);
- outb_p(0x80, ICP);
- inb_p(ICP);
-@@ -1230,7 +1231,7 @@ static void autoconfig_irq(struct uart_8250_port *up)
- irqs = probe_irq_on();
- serial_out(up, UART_MCR, 0);
- udelay(10);
-- if (up->port.flags & UPF_FOURPORT) {
-+ if (port->flags & UPF_FOURPORT) {
- serial_out(up, UART_MCR,
- UART_MCR_DTR | UART_MCR_RTS);
- } else {
-@@ -1249,10 +1250,10 @@ static void autoconfig_irq(struct uart_8250_port *up)
- serial_out(up, UART_MCR, save_mcr);
- serial_out(up, UART_IER, save_ier);
-
-- if (up->port.flags & UPF_FOURPORT)
-+ if (port->flags & UPF_FOURPORT)
- outb_p(save_ICP, ICP);
-
-- up->port.irq = (irq > 0) ? irq : 0;
-+ port->irq = (irq > 0) ? irq : 0;
- }
-
- static inline void __stop_tx(struct uart_8250_port *p)
-@@ -1273,7 +1274,7 @@ static void serial8250_stop_tx(struct uart_port *port)
- /*
- * We really want to stop the transmitter from sending.
- */
-- if (up->port.type == PORT_16C950) {
-+ if (port->type == PORT_16C950) {
- up->acr |= UART_ACR_TXDIS;
- serial_icr_write(up, UART_ACR, up->acr);
- }
-@@ -1292,7 +1293,7 @@ static void serial8250_start_tx(struct uart_port *port)
- unsigned char lsr;
- lsr = serial_in(up, UART_LSR);
- up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
-- if ((up->port.type == PORT_RM9000) ?
-+ if ((port->type == PORT_RM9000) ?
- (lsr & UART_LSR_THRE) :
- (lsr & UART_LSR_TEMT))
- serial8250_tx_chars(up);
-@@ -1302,7 +1303,7 @@ static void serial8250_start_tx(struct uart_port *port)
- /*
- * Re-enable the transmitter if we disabled it.
- */
-- if (up->port.type == PORT_16C950 && up->acr & UART_ACR_TXDIS) {
-+ if (port->type == PORT_16C950 && up->acr & UART_ACR_TXDIS) {
- up->acr &= ~UART_ACR_TXDIS;
- serial_icr_write(up, UART_ACR, up->acr);
- }
-@@ -1360,7 +1361,8 @@ static void clear_rx_fifo(struct uart_8250_port *up)
- unsigned char
- serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- {
-- struct tty_struct *tty = up->port.state->port.tty;
-+ struct uart_port *port = &up->port;
-+ struct tty_struct *tty = port->state->port.tty;
- unsigned char ch;
- int max_count = 256;
- char flag;
-@@ -1379,7 +1381,7 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- ch = 0;
-
- flag = TTY_NORMAL;
-- up->port.icount.rx++;
-+ port->icount.rx++;
-
- lsr |= up->lsr_saved_flags;
- up->lsr_saved_flags = 0;
-@@ -1390,12 +1392,12 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- */
- if (lsr & UART_LSR_BI) {
- lsr &= ~(UART_LSR_FE | UART_LSR_PE);
-- up->port.icount.brk++;
-+ port->icount.brk++;
- /*
- * If tegra port then clear the rx fifo to
- * accept another break/character.
- */
-- if (up->port.type == PORT_TEGRA)
-+ if (port->type == PORT_TEGRA)
- clear_rx_fifo(up);
-
- /*
-@@ -1404,19 +1406,19 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- * may get masked by ignore_status_mask
- * or read_status_mask.
- */
-- if (uart_handle_break(&up->port))
-+ if (uart_handle_break(port))
- goto ignore_char;
- } else if (lsr & UART_LSR_PE)
-- up->port.icount.parity++;
-+ port->icount.parity++;
- else if (lsr & UART_LSR_FE)
-- up->port.icount.frame++;
-+ port->icount.frame++;
- if (lsr & UART_LSR_OE)
-- up->port.icount.overrun++;
-+ port->icount.overrun++;
-
- /*
- * Mask off conditions which should be ignored.
- */
-- lsr &= up->port.read_status_mask;
-+ lsr &= port->read_status_mask;
-
- if (lsr & UART_LSR_BI) {
- DEBUG_INTR("handling break....");
-@@ -1426,34 +1428,35 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
- else if (lsr & UART_LSR_FE)
- flag = TTY_FRAME;
- }
-- if (uart_handle_sysrq_char(&up->port, ch))
-+ if (uart_handle_sysrq_char(port, ch))
- goto ignore_char;
-
-- uart_insert_char(&up->port, lsr, UART_LSR_OE, ch, flag);
-+ uart_insert_char(port, lsr, UART_LSR_OE, ch, flag);
-
- ignore_char:
- lsr = serial_in(up, UART_LSR);
- } while ((lsr & (UART_LSR_DR | UART_LSR_BI)) && (max_count-- > 0));
-- spin_unlock(&up->port.lock);
-+ spin_unlock(&port->lock);
- tty_flip_buffer_push(tty);
-- spin_lock(&up->port.lock);
-+ spin_lock(&port->lock);
- return lsr;
- }
- EXPORT_SYMBOL_GPL(serial8250_rx_chars);
-
- void serial8250_tx_chars(struct uart_8250_port *up)
- {
-- struct circ_buf *xmit = &up->port.state->xmit;
-+ struct uart_port *port = &up->port;
-+ struct circ_buf *xmit = &port->state->xmit;
- int count;
-
-- if (up->port.x_char) {
-- serial_out(up, UART_TX, up->port.x_char);
-- up->port.icount.tx++;
-- up->port.x_char = 0;
-+ if (port->x_char) {
-+ serial_out(up, UART_TX, port->x_char);
-+ port->icount.tx++;
-+ port->x_char = 0;
- return;
- }
-- if (uart_tx_stopped(&up->port)) {
-- serial8250_stop_tx(&up->port);
-+ if (uart_tx_stopped(port)) {
-+ serial8250_stop_tx(port);
- return;
- }
- if (uart_circ_empty(xmit)) {
-@@ -1465,13 +1468,13 @@ void serial8250_tx_chars(struct uart_8250_port *up)
- do {
- serial_out(up, UART_TX, xmit->buf[xmit->tail]);
- xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-- up->port.icount.tx++;
-+ port->icount.tx++;
- if (uart_circ_empty(xmit))
- break;
- } while (--count > 0);
-
- if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
-- uart_write_wakeup(&up->port);
-+ uart_write_wakeup(port);
-
- DEBUG_INTR("THRE...");
-
-@@ -1482,22 +1485,23 @@ EXPORT_SYMBOL_GPL(serial8250_tx_chars);
-
- unsigned int serial8250_modem_status(struct uart_8250_port *up)
- {
-+ struct uart_port *port = &up->port;
- unsigned int status = serial_in(up, UART_MSR);
-
- status |= up->msr_saved_flags;
- up->msr_saved_flags = 0;
- if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI &&
-- up->port.state != NULL) {
-+ port->state != NULL) {
- if (status & UART_MSR_TERI)
-- up->port.icount.rng++;
-+ port->icount.rng++;
- if (status & UART_MSR_DDSR)
-- up->port.icount.dsr++;
-+ port->icount.dsr++;
- if (status & UART_MSR_DDCD)
-- uart_handle_dcd_change(&up->port, status & UART_MSR_DCD);
-+ uart_handle_dcd_change(port, status & UART_MSR_DCD);
- if (status & UART_MSR_DCTS)
-- uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
-+ uart_handle_cts_change(port, status & UART_MSR_CTS);
-
-- wake_up_interruptible(&up->port.state->port.delta_msr_wait);
-+ wake_up_interruptible(&port->state->port.delta_msr_wait);
- }
-
- return status;
-@@ -1517,7 +1521,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
- if (iir & UART_IIR_NO_INT)
- return 0;
-
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
-
- status = serial_in(up, UART_LSR);
-
-@@ -1529,7 +1533,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
- if (status & UART_LSR_THRE)
- serial8250_tx_chars(up);
-
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ spin_unlock_irqrestore(&port->lock, flags);
- return 1;
- }
- EXPORT_SYMBOL_GPL(serial8250_handle_irq);
-@@ -1769,10 +1773,10 @@ static unsigned int serial8250_tx_empty(struct uart_port *port)
- unsigned long flags;
- unsigned int lsr;
-
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
- lsr = serial_in(up, UART_LSR);
- up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ spin_unlock_irqrestore(&port->lock, flags);
-
- return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0;
- }
-@@ -1826,13 +1830,13 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
- container_of(port, struct uart_8250_port, port);
- unsigned long flags;
-
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
- if (break_state == -1)
- up->lcr |= UART_LCR_SBC;
- else
- up->lcr &= ~UART_LCR_SBC;
- serial_out(up, UART_LCR, up->lcr);
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ spin_unlock_irqrestore(&port->lock, flags);
- }
-
- /*
-@@ -1933,15 +1937,15 @@ static int serial8250_startup(struct uart_port *port)
- unsigned char lsr, iir;
- int retval;
-
-- up->port.fifosize = uart_config[up->port.type].fifo_size;
-+ port->fifosize = uart_config[up->port.type].fifo_size;
- up->tx_loadsz = uart_config[up->port.type].tx_loadsz;
- up->capabilities = uart_config[up->port.type].flags;
- up->mcr = 0;
-
-- if (up->port.iotype != up->cur_iotype)
-+ if (port->iotype != up->cur_iotype)
- set_io_from_upio(port);
-
-- if (up->port.type == PORT_16C950) {
-+ if (port->type == PORT_16C950) {
- /* Wake up and initialize UART */
- up->acr = 0;
- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-@@ -1981,17 +1985,17 @@ static int serial8250_startup(struct uart_port *port)
- * if it is, then bail out, because there's likely no UART
- * here.
- */
-- if (!(up->port.flags & UPF_BUGGY_UART) &&
-+ if (!(port->flags & UPF_BUGGY_UART) &&
- (serial_in(up, UART_LSR) == 0xff)) {
- printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
-- serial_index(&up->port));
-+ serial_index(port));
- return -ENODEV;
- }
-
- /*
- * For a XR16C850, we need to set the trigger levels
- */
-- if (up->port.type == PORT_16850) {
-+ if (port->type == PORT_16850) {
- unsigned char fctr;
-
- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-@@ -2005,7 +2009,7 @@ static int serial8250_startup(struct uart_port *port)
- serial_out(up, UART_LCR, 0);
- }
-
-- if (up->port.irq) {
-+ if (port->irq) {
- unsigned char iir1;
- /*
- * Test for UARTs that do not reassert THRE when the
-@@ -2015,9 +2019,9 @@ static int serial8250_startup(struct uart_port *port)
- * the interrupt is enabled. Delays are necessary to
- * allow register changes to become visible.
- */
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
- if (up->port.irqflags & IRQF_SHARED)
-- disable_irq_nosync(up->port.irq);
-+ disable_irq_nosync(port->irq);
-
- wait_for_xmitr(up, UART_LSR_THRE);
- serial_out_sync(up, UART_IER, UART_IER_THRI);
-@@ -2029,9 +2033,9 @@ static int serial8250_startup(struct uart_port *port)
- iir = serial_in(up, UART_IIR);
- serial_out(up, UART_IER, 0);
-
-- if (up->port.irqflags & IRQF_SHARED)
-- enable_irq(up->port.irq);
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ if (port->irqflags & IRQF_SHARED)
-+ enable_irq(port->irq);
-+ spin_unlock_irqrestore(&port->lock, flags);
-
- /*
- * If the interrupt is not reasserted, setup a timer to
-@@ -2060,7 +2064,7 @@ static int serial8250_startup(struct uart_port *port)
- * hardware interrupt, we use a timer-based system. The original
- * driver used to do this with IRQ0.
- */
-- if (!up->port.irq) {
-+ if (!port->irq) {
- up->timer.data = (unsigned long)up;
- mod_timer(&up->timer, jiffies + uart_poll_timeout(port));
- } else {
-@@ -2074,7 +2078,7 @@ static int serial8250_startup(struct uart_port *port)
- */
- serial_out(up, UART_LCR, UART_LCR_WLEN8);
-
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
- if (up->port.flags & UPF_FOURPORT) {
- if (!up->port.irq)
- up->port.mctrl |= TIOCM_OUT1;
-@@ -2082,10 +2086,10 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Most PC uarts need OUT2 raised to enable interrupts.
- */
-- if (up->port.irq)
-+ if (port->irq)
- up->port.mctrl |= TIOCM_OUT2;
-
-- serial8250_set_mctrl(&up->port, up->port.mctrl);
-+ serial8250_set_mctrl(port, port->mctrl);
-
- /* Serial over Lan (SoL) hack:
- Intel 8257x Gigabit ethernet chips have a
-@@ -2121,7 +2125,7 @@ static int serial8250_startup(struct uart_port *port)
- }
-
- dont_test_tx_en:
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ spin_unlock_irqrestore(&port->lock, flags);
-
- /*
- * Clear the interrupt registers again for luck, and clear the
-@@ -2143,12 +2147,12 @@ dont_test_tx_en:
- up->ier = UART_IER_RLSI | UART_IER_RDI;
- serial_out(up, UART_IER, up->ier);
-
-- if (up->port.flags & UPF_FOURPORT) {
-+ if (port->flags & UPF_FOURPORT) {
- unsigned int icp;
- /*
- * Enable interrupts on the AST Fourport board
- */
-- icp = (up->port.iobase & 0xfe0) | 0x01f;
-+ icp = (port->iobase & 0xfe0) | 0x01f;
- outb_p(0x80, icp);
- inb_p(icp);
- }
-@@ -2168,16 +2172,16 @@ static void serial8250_shutdown(struct uart_port *port)
- up->ier = 0;
- serial_out(up, UART_IER, 0);
-
-- spin_lock_irqsave(&up->port.lock, flags);
-- if (up->port.flags & UPF_FOURPORT) {
-+ spin_lock_irqsave(&port->lock, flags);
-+ if (port->flags & UPF_FOURPORT) {
- /* reset interrupts on the AST Fourport board */
-- inb((up->port.iobase & 0xfe0) | 0x1f);
-- up->port.mctrl |= TIOCM_OUT1;
-+ inb((port->iobase & 0xfe0) | 0x1f);
-+ port->mctrl |= TIOCM_OUT1;
- } else
-- up->port.mctrl &= ~TIOCM_OUT2;
-+ port->mctrl &= ~TIOCM_OUT2;
-
-- serial8250_set_mctrl(&up->port, up->port.mctrl);
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ serial8250_set_mctrl(port, port->mctrl);
-+ spin_unlock_irqrestore(&port->lock, flags);
-
- /*
- * Disable break condition and FIFOs
-@@ -2200,7 +2204,7 @@ static void serial8250_shutdown(struct uart_port *port)
-
- del_timer_sync(&up->timer);
- up->timer.function = serial8250_timeout;
-- if (up->port.irq)
-+ if (port->irq)
- serial_unlink_irq_chain(up);
- }
-
-@@ -2275,11 +2279,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- if (up->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
- quot++;
-
-- if (up->capabilities & UART_CAP_FIFO && up->port.fifosize > 1) {
-+ if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
- if (baud < 2400)
- fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
- else
-- fcr = uart_config[up->port.type].fcr;
-+ fcr = uart_config[port->type].fcr;
- }
-
- /*
-@@ -2290,7 +2294,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- * have sufficient FIFO entries for the latency of the remote
- * UART to respond. IOW, at least 32 bytes of FIFO.
- */
-- if (up->capabilities & UART_CAP_AFE && up->port.fifosize >= 32) {
-+ if (up->capabilities & UART_CAP_AFE && port->fifosize >= 32) {
- up->mcr &= ~UART_MCR_AFE;
- if (termios->c_cflag & CRTSCTS)
- up->mcr |= UART_MCR_AFE;
-@@ -2300,40 +2304,40 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- * Ok, we're now changing the port state. Do it with
- * interrupts disabled.
- */
-- spin_lock_irqsave(&up->port.lock, flags);
-+ spin_lock_irqsave(&port->lock, flags);
-
- /*
- * Update the per-port timeout.
- */
- uart_update_timeout(port, termios->c_cflag, baud);
-
-- up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
-+ port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
- if (termios->c_iflag & INPCK)
-- up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-+ port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
- if (termios->c_iflag & (BRKINT | PARMRK))
-- up->port.read_status_mask |= UART_LSR_BI;
-+ port->read_status_mask |= UART_LSR_BI;
-
- /*
- * Characteres to ignore
- */
-- up->port.ignore_status_mask = 0;
-+ port->ignore_status_mask = 0;
- if (termios->c_iflag & IGNPAR)
-- up->port.ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
-+ port->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
- if (termios->c_iflag & IGNBRK) {
-- up->port.ignore_status_mask |= UART_LSR_BI;
-+ port->ignore_status_mask |= UART_LSR_BI;
- /*
- * If we're ignoring parity and break indicators,
- * ignore overruns too (for real raw support).
- */
- if (termios->c_iflag & IGNPAR)
-- up->port.ignore_status_mask |= UART_LSR_OE;
-+ port->ignore_status_mask |= UART_LSR_OE;
- }
-
- /*
- * ignore all characters if CREAD is not set
- */
- if ((termios->c_cflag & CREAD) == 0)
-- up->port.ignore_status_mask |= UART_LSR_DR;
-+ port->ignore_status_mask |= UART_LSR_DR;
-
- /*
- * CTS flow control flag and modem status interrupts
-@@ -2360,7 +2364,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- efr |= UART_EFR_CTS;
-
- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- if (up->port.flags & UPF_EXAR_EFR)
-+ if (port->flags & UPF_EXAR_EFR)
- serial_out(up, UART_XR_EFR, efr);
- else
- serial_out(up, UART_EFR, efr);
-@@ -2390,20 +2394,20 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR
- * is written without DLAB set, this mode will be disabled.
- */
-- if (up->port.type == PORT_16750)
-+ if (port->type == PORT_16750)
- serial_out(up, UART_FCR, fcr);
-
- serial_out(up, UART_LCR, cval); /* reset DLAB */
- up->lcr = cval; /* Save LCR */
-- if (up->port.type != PORT_16750) {
-+ if (port->type != PORT_16750) {
- if (fcr & UART_FCR_ENABLE_FIFO) {
- /* emulated UARTs (Lucent Venus 167x) need two steps */
- serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
- }
- serial_out(up, UART_FCR, fcr); /* set fcr */
- }
-- serial8250_set_mctrl(&up->port, up->port.mctrl);
-- spin_unlock_irqrestore(&up->port.lock, flags);
-+ serial8250_set_mctrl(port, port->mctrl);
-+ spin_unlock_irqrestore(&port->lock, flags);
- /* Don't rewrite B0 */
- if (tty_termios_baud_rate(termios))
- tty_termios_encode_baud_rate(termios, baud, baud);
-@@ -2468,26 +2472,26 @@ static unsigned int serial8250_port_size(struct uart_8250_port *pt)
- static int serial8250_request_std_resource(struct uart_8250_port *up)
- {
- unsigned int size = serial8250_port_size(up);
-+ struct uart_port *port = &up->port;
- int ret = 0;
-
-- switch (up->port.iotype) {
-+ switch (port->iotype) {
- case UPIO_AU:
- case UPIO_TSI:
- case UPIO_MEM32:
- case UPIO_MEM:
-- if (!up->port.mapbase)
-+ if (!port->mapbase)
- break;
-
-- if (!request_mem_region(up->port.mapbase, size, "serial")) {
-+ if (!request_mem_region(port->mapbase, size, "serial")) {
- ret = -EBUSY;
- break;
- }
-
-- if (up->port.flags & UPF_IOREMAP) {
-- up->port.membase = ioremap_nocache(up->port.mapbase,
-- size);
-- if (!up->port.membase) {
-- release_mem_region(up->port.mapbase, size);
-+ if (port->flags & UPF_IOREMAP) {
-+ port->membase = ioremap_nocache(port->mapbase, size);
-+ if (!port->membase) {
-+ release_mem_region(port->mapbase, size);
- ret = -ENOMEM;
- }
- }
-@@ -2495,7 +2499,7 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
-
- case UPIO_HUB6:
- case UPIO_PORT:
-- if (!request_region(up->port.iobase, size, "serial"))
-+ if (!request_region(port->iobase, size, "serial"))
- ret = -EBUSY;
- break;
- }
-@@ -2505,26 +2509,27 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
- static void serial8250_release_std_resource(struct uart_8250_port *up)
- {
- unsigned int size = serial8250_port_size(up);
-+ struct uart_port *port = &up->port;
-
-- switch (up->port.iotype) {
-+ switch (port->iotype) {
- case UPIO_AU:
- case UPIO_TSI:
- case UPIO_MEM32:
- case UPIO_MEM:
-- if (!up->port.mapbase)
-+ if (!port->mapbase)
- break;
-
-- if (up->port.flags & UPF_IOREMAP) {
-- iounmap(up->port.membase);
-- up->port.membase = NULL;
-+ if (port->flags & UPF_IOREMAP) {
-+ iounmap(port->membase);
-+ port->membase = NULL;
- }
-
-- release_mem_region(up->port.mapbase, size);
-+ release_mem_region(port->mapbase, size);
- break;
-
- case UPIO_HUB6:
- case UPIO_PORT:
-- release_region(up->port.iobase, size);
-+ release_region(port->iobase, size);
- break;
- }
- }
-@@ -2533,12 +2538,13 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up)
- {
- unsigned long start = UART_RSA_BASE << up->port.regshift;
- unsigned int size = 8 << up->port.regshift;
-+ struct uart_port *port = &up->port;
- int ret = -EINVAL;
-
-- switch (up->port.iotype) {
-+ switch (port->iotype) {
- case UPIO_HUB6:
- case UPIO_PORT:
-- start += up->port.iobase;
-+ start += port->iobase;
- if (request_region(start, size, "serial-rsa"))
- ret = 0;
- else
-@@ -2553,11 +2559,12 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up)
- {
- unsigned long offset = UART_RSA_BASE << up->port.regshift;
- unsigned int size = 8 << up->port.regshift;
-+ struct uart_port *port = &up->port;
-
-- switch (up->port.iotype) {
-+ switch (port->iotype) {
- case UPIO_HUB6:
- case UPIO_PORT:
-- release_region(up->port.iobase + offset, size);
-+ release_region(port->iobase + offset, size);
- break;
- }
- }
-@@ -2568,7 +2575,7 @@ static void serial8250_release_port(struct uart_port *port)
- container_of(port, struct uart_8250_port, port);
-
- serial8250_release_std_resource(up);
-- if (up->port.type == PORT_RSA)
-+ if (port->type == PORT_RSA)
- serial8250_release_rsa_resource(up);
- }
-
-@@ -2579,7 +2586,7 @@ static int serial8250_request_port(struct uart_port *port)
- int ret = 0;
-
- ret = serial8250_request_std_resource(up);
-- if (ret == 0 && up->port.type == PORT_RSA) {
-+ if (ret == 0 && port->type == PORT_RSA) {
- ret = serial8250_request_rsa_resource(up);
- if (ret < 0)
- serial8250_release_std_resource(up);
-@@ -2607,22 +2614,22 @@ static void serial8250_config_port(struct uart_port *port, int flags)
- if (ret < 0)
- probeflags &= ~PROBE_RSA;
-
-- if (up->port.iotype != up->cur_iotype)
-+ if (port->iotype != up->cur_iotype)
- set_io_from_upio(port);
-
- if (flags & UART_CONFIG_TYPE)
- autoconfig(up, probeflags);
-
- /* if access method is AU, it is a 16550 with a quirk */
-- if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
-+ if (port->type == PORT_16550A && port->iotype == UPIO_AU)
- up->bugs |= UART_BUG_NOMSR;
-
-- if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
-+ if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
- autoconfig_irq(up);
-
-- if (up->port.type != PORT_RSA && probeflags & PROBE_RSA)
-+ if (port->type != PORT_RSA && probeflags & PROBE_RSA)
- serial8250_release_rsa_resource(up);
-- if (up->port.type == PORT_UNKNOWN)
-+ if (port->type == PORT_UNKNOWN)
- serial8250_release_std_resource(up);
- }
-
-@@ -2696,9 +2703,10 @@ static void __init serial8250_isa_init_ports(void)
-
- for (i = 0; i < nr_uarts; i++) {
- struct uart_8250_port *up = &serial8250_ports[i];
-+ struct uart_port *port = &up->port;
-
-- up->port.line = i;
-- spin_lock_init(&up->port.lock);
-+ port->line = i;
-+ spin_lock_init(&port->lock);
-
- init_timer(&up->timer);
- up->timer.function = serial8250_timeout;
-@@ -2709,7 +2717,7 @@ static void __init serial8250_isa_init_ports(void)
- up->mcr_mask = ~ALPHA_KLUDGE_MCR;
- up->mcr_force = ALPHA_KLUDGE_MCR;
-
-- up->port.ops = &serial8250_pops;
-+ port->ops = &serial8250_pops;
- }
-
- if (share_irqs)
-@@ -2718,17 +2726,19 @@ static void __init serial8250_isa_init_ports(void)
- for (i = 0, up = serial8250_ports;
- i < ARRAY_SIZE(old_serial_port) && i < nr_uarts;
- i++, up++) {
-- up->port.iobase = old_serial_port[i].port;
-- up->port.irq = irq_canonicalize(old_serial_port[i].irq);
-- up->port.irqflags = old_serial_port[i].irqflags;
-- up->port.uartclk = old_serial_port[i].baud_base * 16;
-- up->port.flags = old_serial_port[i].flags;
-- up->port.hub6 = old_serial_port[i].hub6;
-- up->port.membase = old_serial_port[i].iomem_base;
-- up->port.iotype = old_serial_port[i].io_type;
-- up->port.regshift = old_serial_port[i].iomem_reg_shift;
-- set_io_from_upio(&up->port);
-- up->port.irqflags |= irqflag;
-+ struct uart_port *port = &up->port;
-+
-+ port->iobase = old_serial_port[i].port;
-+ port->irq = irq_canonicalize(old_serial_port[i].irq);
-+ port->irqflags = old_serial_port[i].irqflags;
-+ port->uartclk = old_serial_port[i].baud_base * 16;
-+ port->flags = old_serial_port[i].flags;
-+ port->hub6 = old_serial_port[i].hub6;
-+ port->membase = old_serial_port[i].iomem_base;
-+ port->iotype = old_serial_port[i].io_type;
-+ port->regshift = old_serial_port[i].iomem_reg_shift;
-+ set_io_from_upio(port);
-+ port->irqflags |= irqflag;
- if (serial8250_isa_config != NULL)
- serial8250_isa_config(i, &up->port, &up->capabilities);
-
-@@ -2789,6 +2799,7 @@ static void
- serial8250_console_write(struct console *co, const char *s, unsigned int count)
- {
- struct uart_8250_port *up = &serial8250_ports[co->index];
-+ struct uart_port *port = &up->port;
- unsigned long flags;
- unsigned int ier;
- int locked = 1;
-@@ -2796,13 +2807,13 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- touch_nmi_watchdog();
-
- local_irq_save(flags);
-- if (up->port.sysrq) {
-+ if (port->sysrq) {
- /* serial8250_handle_irq() already took the lock */
- locked = 0;
- } else if (oops_in_progress) {
-- locked = spin_trylock(&up->port.lock);
-+ locked = spin_trylock(&port->lock);
- } else
-- spin_lock(&up->port.lock);
-+ spin_lock(&port->lock);
-
- /*
- * First save the IER then disable the interrupts
-@@ -2814,7 +2825,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- else
- serial_out(up, UART_IER, 0);
-
-- uart_console_write(&up->port, s, count, serial8250_console_putchar);
-+ uart_console_write(port, s, count, serial8250_console_putchar);
-
- /*
- * Finally, wait for transmitter to become empty
-@@ -2834,7 +2845,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- serial8250_modem_status(up);
-
- if (locked)
-- spin_unlock(&up->port.lock);
-+ spin_unlock(&port->lock);
- local_irq_restore(flags);
- }
-
-@@ -2979,6 +2990,7 @@ void serial8250_suspend_port(int line)
- void serial8250_resume_port(int line)
- {
- struct uart_8250_port *up = &serial8250_ports[line];
-+ struct uart_port *port = &up->port;
-
- if (up->capabilities & UART_NATSEMI) {
- /* Ensure it's still in high speed mode */
-@@ -2987,9 +2999,9 @@ void serial8250_resume_port(int line)
- ns16550a_goto_highspeed(up);
-
- serial_out(up, UART_LCR, 0);
-- up->port.uartclk = 921600*16;
-+ port->uartclk = 921600*16;
- }
-- uart_resume_port(&serial8250_reg, &up->port);
-+ uart_resume_port(&serial8250_reg, port);
- }
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0025-mmc-tmio-fix-recursive-spinlock-don-t-schedule-with-.patch b/patches.kzm9g/0025-mmc-tmio-fix-recursive-spinlock-don-t-schedule-with-.patch
deleted file mode 100644
index 30f595ec588b1b..00000000000000
--- a/patches.kzm9g/0025-mmc-tmio-fix-recursive-spinlock-don-t-schedule-with-.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From ea988b80417af51f72b175c2ec36c82b41b08b5d Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 14 Jul 2011 12:12:38 +0200
-Subject: mmc: tmio: fix recursive spinlock, don't schedule with interrupts
- disabled
-
-Calling mmc_request_done() under a spinlock with interrupts disabled
-leads to a recursive spin-lock on request retry path and to
-scheduling in atomic context. This patch fixes both these problems
-by moving mmc_request_done() to the scheduler workqueue.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit b9269fdd4f61aa4d185c982b0f84a3e7b7ccb4d2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 6 +++++-
- drivers/mmc/host/tmio_mmc_pio.c | 35 +++++++++++++++++++++++++++++------
- 2 files changed, 34 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 211ef6e..f0d7c43 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -18,6 +18,7 @@
-
- #include <linux/highmem.h>
- #include <linux/mmc/tmio.h>
-+#include <linux/mutex.h>
- #include <linux/pagemap.h>
- #include <linux/spinlock.h>
-
-@@ -73,8 +74,11 @@ struct tmio_mmc_host {
-
- /* Track lost interrupts */
- struct delayed_work delayed_reset_work;
-- spinlock_t lock;
-+ struct work_struct done;
-+
-+ spinlock_t lock; /* protect host private data */
- unsigned long last_req_ts;
-+ struct mutex ios_lock; /* protect set_ios() context */
- };
-
- int tmio_mmc_host_probe(struct tmio_mmc_host **host,
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index f7dd3b1..a2f76ad 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -250,10 +250,16 @@ static void tmio_mmc_reset_work(struct work_struct *work)
- /* called with host->lock held, interrupts disabled */
- static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
- {
-- struct mmc_request *mrq = host->mrq;
-+ struct mmc_request *mrq;
-+ unsigned long flags;
-
-- if (!mrq)
-+ spin_lock_irqsave(&host->lock, flags);
-+
-+ mrq = host->mrq;
-+ if (IS_ERR_OR_NULL(mrq)) {
-+ spin_unlock_irqrestore(&host->lock, flags);
- return;
-+ }
-
- host->cmd = NULL;
- host->data = NULL;
-@@ -262,11 +268,18 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
- cancel_delayed_work(&host->delayed_reset_work);
-
- host->mrq = NULL;
-+ spin_unlock_irqrestore(&host->lock, flags);
-
-- /* FIXME: mmc_request_done() can schedule! */
- mmc_request_done(host->mmc, mrq);
- }
-
-+static void tmio_mmc_done_work(struct work_struct *work)
-+{
-+ struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
-+ done);
-+ tmio_mmc_finish_request(host);
-+}
-+
- /* These are the bitmasks the tmio chip requires to implement the MMC response
- * types. Note that R1 and R6 are the same in this scheme. */
- #define APP_CMD 0x0040
-@@ -433,7 +446,7 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host)
- BUG();
- }
-
-- tmio_mmc_finish_request(host);
-+ schedule_work(&host->done);
- }
-
- static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
-@@ -523,7 +536,7 @@ static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
- tasklet_schedule(&host->dma_issue);
- }
- } else {
-- tmio_mmc_finish_request(host);
-+ schedule_work(&host->done);
- }
-
- out:
-@@ -573,7 +586,8 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT |
- TMIO_STAT_CARD_REMOVE);
-- mmc_detect_change(host->mmc, msecs_to_jiffies(100));
-+ if (!work_pending(&host->mmc->detect.work))
-+ mmc_detect_change(host->mmc, msecs_to_jiffies(100));
- goto out;
- }
-
-@@ -703,6 +717,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- struct tmio_mmc_data *pdata = host->pdata;
- unsigned long flags;
-
-+ mutex_lock(&host->ios_lock);
-+
- spin_lock_irqsave(&host->lock, flags);
- if (host->mrq) {
- if (IS_ERR(host->mrq)) {
-@@ -718,6 +734,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- host->mrq->cmd->opcode, host->last_req_ts, jiffies);
- }
- spin_unlock_irqrestore(&host->lock, flags);
-+
-+ mutex_unlock(&host->ios_lock);
- return;
- }
-
-@@ -771,6 +789,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- current->comm, task_pid_nr(current),
- ios->clock, ios->power_mode);
- host->mrq = NULL;
-+
-+ mutex_unlock(&host->ios_lock);
- }
-
- static int tmio_mmc_get_ro(struct mmc_host *mmc)
-@@ -867,9 +887,11 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- tmio_mmc_enable_sdio_irq(mmc, 0);
-
- spin_lock_init(&_host->lock);
-+ mutex_init(&_host->ios_lock);
-
- /* Init delayed work for request timeouts */
- INIT_DELAYED_WORK(&_host->delayed_reset_work, tmio_mmc_reset_work);
-+ INIT_WORK(&_host->done, tmio_mmc_done_work);
-
- /* See if we also get DMA */
- tmio_mmc_request_dma(_host, pdata);
-@@ -917,6 +939,7 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
- pm_runtime_get_sync(&pdev->dev);
-
- mmc_remove_host(host->mmc);
-+ cancel_work_sync(&host->done);
- cancel_delayed_work_sync(&host->delayed_reset_work);
- tmio_mmc_release_dma(host);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0025-serial-use-serial_port_in-out-vs-serial_in-out-in-82.patch b/patches.kzm9g/0025-serial-use-serial_port_in-out-vs-serial_in-out-in-82.patch
deleted file mode 100644
index 249a4282220bec..00000000000000
--- a/patches.kzm9g/0025-serial-use-serial_port_in-out-vs-serial_in-out-in-82.patch
+++ /dev/null
@@ -1,455 +0,0 @@
-From 291546c8ba381a8579bdcfc2a1dee3971c3ac9b9 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:13 -0500
-Subject: serial: use serial_port_in/out vs serial_in/out in 8250
-
-The serial_in and serial_out helpers are expecting to operate
-on an 8250_port struct. These in turn go after the contained
-normal port struct which actually has the actual in/out accessors.
-
-But what is happening in some cases, is that a function is passed
-in a port struct, and it runs container_of to get the 8250_port
-struct, and then it uses serial_in/out helpers on that. But when
-you do, it goes full circle, since it jumps back inside the 8250_port
-to find the contained port struct (which we already knew!).
-
-So, if we are operating in a scope where we know the struct port,
-then use the serial_port_in/out helpers and avoid the bouncing
-around. If we don't have the struct port handy, and it isn't
-worth making a local for it, then just leave things as-is which
-uses the serial_in/out helpers that will resolve the 8250_port
-onto the struct port.
-
-Mostly, gcc figures this out on its own -- so this doesn't bring to
-the table any revolutionary runtime delta. However, it is somewhat
-misleading to always hammer away on 8250 structs, when the actual
-underlying property isn't at all 8250 specific -- and this change
-makes that clear.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 4fd996a14660f56a6fd92ce7c8fb167d262c994f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 160 ++++++++++++++++++++--------------------
- 1 file changed, 80 insertions(+), 80 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 9ffb3cf..cb45a29 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -1287,7 +1287,7 @@ static void serial8250_start_tx(struct uart_port *port)
-
- if (!(up->ier & UART_IER_THRI)) {
- up->ier |= UART_IER_THRI;
-- serial_out(up, UART_IER, up->ier);
-+ serial_port_out(port, UART_IER, up->ier);
-
- if (up->bugs & UART_BUG_TXEN) {
- unsigned char lsr;
-@@ -1316,7 +1316,7 @@ static void serial8250_stop_rx(struct uart_port *port)
-
- up->ier &= ~UART_IER_RLSI;
- up->port.read_status_mask &= ~UART_LSR_DR;
-- serial_out(up, UART_IER, up->ier);
-+ serial_port_out(port, UART_IER, up->ier);
- }
-
- static void serial8250_enable_ms(struct uart_port *port)
-@@ -1329,7 +1329,7 @@ static void serial8250_enable_ms(struct uart_port *port)
- return;
-
- up->ier |= UART_IER_MSI;
-- serial_out(up, UART_IER, up->ier);
-+ serial_port_out(port, UART_IER, up->ier);
- }
-
- /*
-@@ -1523,7 +1523,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
-
- spin_lock_irqsave(&port->lock, flags);
-
-- status = serial_in(up, UART_LSR);
-+ status = serial_port_in(port, UART_LSR);
-
- DEBUG_INTR("status = %x...", status);
-
-@@ -1540,9 +1540,7 @@ EXPORT_SYMBOL_GPL(serial8250_handle_irq);
-
- static int serial8250_default_handle_irq(struct uart_port *port)
- {
-- struct uart_8250_port *up =
-- container_of(port, struct uart_8250_port, port);
-- unsigned int iir = serial_in(up, UART_IIR);
-+ unsigned int iir = serial_port_in(port, UART_IIR);
-
- return serial8250_handle_irq(port, iir);
- }
-@@ -1774,7 +1772,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port)
- unsigned int lsr;
-
- spin_lock_irqsave(&port->lock, flags);
-- lsr = serial_in(up, UART_LSR);
-+ lsr = serial_port_in(port, UART_LSR);
- up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
- spin_unlock_irqrestore(&port->lock, flags);
-
-@@ -1821,7 +1819,7 @@ static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
-
- mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr;
-
-- serial_out(up, UART_MCR, mcr);
-+ serial_port_out(port, UART_MCR, mcr);
- }
-
- static void serial8250_break_ctl(struct uart_port *port, int break_state)
-@@ -1835,7 +1833,7 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
- up->lcr |= UART_LCR_SBC;
- else
- up->lcr &= ~UART_LCR_SBC;
-- serial_out(up, UART_LCR, up->lcr);
-+ serial_port_out(port, UART_LCR, up->lcr);
- spin_unlock_irqrestore(&port->lock, flags);
- }
-
-@@ -1881,14 +1879,12 @@ static void wait_for_xmitr(struct uart_8250_port *up, int bits)
-
- static int serial8250_get_poll_char(struct uart_port *port)
- {
-- struct uart_8250_port *up =
-- container_of(port, struct uart_8250_port, port);
-- unsigned char lsr = serial_in(up, UART_LSR);
-+ unsigned char lsr = serial_port_in(port, UART_LSR);
-
- if (!(lsr & UART_LSR_DR))
- return NO_POLL_CHAR;
-
-- return serial_in(up, UART_RX);
-+ return serial_port_in(port, UART_RX);
- }
-
-
-@@ -1902,21 +1898,21 @@ static void serial8250_put_poll_char(struct uart_port *port,
- /*
- * First save the IER then disable the interrupts
- */
-- ier = serial_in(up, UART_IER);
-+ ier = serial_port_in(port, UART_IER);
- if (up->capabilities & UART_CAP_UUE)
-- serial_out(up, UART_IER, UART_IER_UUE);
-+ serial_port_out(port, UART_IER, UART_IER_UUE);
- else
-- serial_out(up, UART_IER, 0);
-+ serial_port_out(port, UART_IER, 0);
-
- wait_for_xmitr(up, BOTH_EMPTY);
- /*
- * Send the character out.
- * If a LF, also do CR...
- */
-- serial_out(up, UART_TX, c);
-+ serial_port_out(port, UART_TX, c);
- if (c == 10) {
- wait_for_xmitr(up, BOTH_EMPTY);
-- serial_out(up, UART_TX, 13);
-+ serial_port_out(port, UART_TX, 13);
- }
-
- /*
-@@ -1924,7 +1920,7 @@ static void serial8250_put_poll_char(struct uart_port *port,
- * and restore the IER
- */
- wait_for_xmitr(up, BOTH_EMPTY);
-- serial_out(up, UART_IER, ier);
-+ serial_port_out(port, UART_IER, ier);
- }
-
- #endif /* CONFIG_CONSOLE_POLL */
-@@ -1948,14 +1944,14 @@ static int serial8250_startup(struct uart_port *port)
- if (port->type == PORT_16C950) {
- /* Wake up and initialize UART */
- up->acr = 0;
-- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_out(up, UART_EFR, UART_EFR_ECB);
-- serial_out(up, UART_IER, 0);
-- serial_out(up, UART_LCR, 0);
-+ serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_port_out(port, UART_EFR, UART_EFR_ECB);
-+ serial_port_out(port, UART_IER, 0);
-+ serial_port_out(port, UART_LCR, 0);
- serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
-- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-- serial_out(up, UART_EFR, UART_EFR_ECB);
-- serial_out(up, UART_LCR, 0);
-+ serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_port_out(port, UART_EFR, UART_EFR_ECB);
-+ serial_port_out(port, UART_LCR, 0);
- }
-
- #ifdef CONFIG_SERIAL_8250_RSA
-@@ -1975,10 +1971,10 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Clear the interrupt registers.
- */
-- serial_in(up, UART_LSR);
-- serial_in(up, UART_RX);
-- serial_in(up, UART_IIR);
-- serial_in(up, UART_MSR);
-+ serial_port_in(port, UART_LSR);
-+ serial_port_in(port, UART_RX);
-+ serial_port_in(port, UART_IIR);
-+ serial_port_in(port, UART_MSR);
-
- /*
- * At this point, there's no way the LSR could still be 0xff;
-@@ -1986,7 +1982,7 @@ static int serial8250_startup(struct uart_port *port)
- * here.
- */
- if (!(port->flags & UPF_BUGGY_UART) &&
-- (serial_in(up, UART_LSR) == 0xff)) {
-+ (serial_port_in(port, UART_LSR) == 0xff)) {
- printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
- serial_index(port));
- return -ENODEV;
-@@ -2001,12 +1997,14 @@ static int serial8250_startup(struct uart_port *port)
- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-
- fctr = serial_in(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
-- serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX);
-- serial_out(up, UART_TRG, UART_TRG_96);
-- serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_TX);
-- serial_out(up, UART_TRG, UART_TRG_96);
-+ serial_port_out(port, UART_FCTR,
-+ fctr | UART_FCTR_TRGD | UART_FCTR_RX);
-+ serial_port_out(port, UART_TRG, UART_TRG_96);
-+ serial_port_out(port, UART_FCTR,
-+ fctr | UART_FCTR_TRGD | UART_FCTR_TX);
-+ serial_port_out(port, UART_TRG, UART_TRG_96);
-
-- serial_out(up, UART_LCR, 0);
-+ serial_port_out(port, UART_LCR, 0);
- }
-
- if (port->irq) {
-@@ -2026,12 +2024,12 @@ static int serial8250_startup(struct uart_port *port)
- wait_for_xmitr(up, UART_LSR_THRE);
- serial_out_sync(up, UART_IER, UART_IER_THRI);
- udelay(1); /* allow THRE to set */
-- iir1 = serial_in(up, UART_IIR);
-- serial_out(up, UART_IER, 0);
-+ iir1 = serial_port_in(port, UART_IIR);
-+ serial_port_out(port, UART_IER, 0);
- serial_out_sync(up, UART_IER, UART_IER_THRI);
- udelay(1); /* allow a working UART time to re-assert THRE */
-- iir = serial_in(up, UART_IIR);
-- serial_out(up, UART_IER, 0);
-+ iir = serial_port_in(port, UART_IIR);
-+ serial_port_out(port, UART_IER, 0);
-
- if (port->irqflags & IRQF_SHARED)
- enable_irq(port->irq);
-@@ -2076,7 +2074,7 @@ static int serial8250_startup(struct uart_port *port)
- /*
- * Now, initialize the UART
- */
-- serial_out(up, UART_LCR, UART_LCR_WLEN8);
-+ serial_port_out(port, UART_LCR, UART_LCR_WLEN8);
-
- spin_lock_irqsave(&port->lock, flags);
- if (up->port.flags & UPF_FOURPORT) {
-@@ -2109,10 +2107,10 @@ static int serial8250_startup(struct uart_port *port)
- * Do a quick test to see if we receive an
- * interrupt when we enable the TX irq.
- */
-- serial_out(up, UART_IER, UART_IER_THRI);
-- lsr = serial_in(up, UART_LSR);
-- iir = serial_in(up, UART_IIR);
-- serial_out(up, UART_IER, 0);
-+ serial_port_out(port, UART_IER, UART_IER_THRI);
-+ lsr = serial_port_in(port, UART_LSR);
-+ iir = serial_port_in(port, UART_IIR);
-+ serial_port_out(port, UART_IER, 0);
-
- if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
- if (!(up->bugs & UART_BUG_TXEN)) {
-@@ -2132,10 +2130,10 @@ dont_test_tx_en:
- * saved flags to avoid getting false values from polling
- * routines or the previous session.
- */
-- serial_in(up, UART_LSR);
-- serial_in(up, UART_RX);
-- serial_in(up, UART_IIR);
-- serial_in(up, UART_MSR);
-+ serial_port_in(port, UART_LSR);
-+ serial_port_in(port, UART_RX);
-+ serial_port_in(port, UART_IIR);
-+ serial_port_in(port, UART_MSR);
- up->lsr_saved_flags = 0;
- up->msr_saved_flags = 0;
-
-@@ -2145,7 +2143,7 @@ dont_test_tx_en:
- * anyway, so we don't enable them here.
- */
- up->ier = UART_IER_RLSI | UART_IER_RDI;
-- serial_out(up, UART_IER, up->ier);
-+ serial_port_out(port, UART_IER, up->ier);
-
- if (port->flags & UPF_FOURPORT) {
- unsigned int icp;
-@@ -2170,7 +2168,7 @@ static void serial8250_shutdown(struct uart_port *port)
- * Disable interrupts from this port
- */
- up->ier = 0;
-- serial_out(up, UART_IER, 0);
-+ serial_port_out(port, UART_IER, 0);
-
- spin_lock_irqsave(&port->lock, flags);
- if (port->flags & UPF_FOURPORT) {
-@@ -2186,7 +2184,8 @@ static void serial8250_shutdown(struct uart_port *port)
- /*
- * Disable break condition and FIFOs
- */
-- serial_out(up, UART_LCR, serial_in(up, UART_LCR) & ~UART_LCR_SBC);
-+ serial_port_out(port, UART_LCR,
-+ serial_port_in(port, UART_LCR) & ~UART_LCR_SBC);
- serial8250_clear_fifos(up);
-
- #ifdef CONFIG_SERIAL_8250_RSA
-@@ -2200,7 +2199,7 @@ static void serial8250_shutdown(struct uart_port *port)
- * Read data port to reset things, and then unlink from
- * the IRQ chain.
- */
-- serial_in(up, UART_RX);
-+ serial_port_in(port, UART_RX);
-
- del_timer_sync(&up->timer);
- up->timer.function = serial8250_timeout;
-@@ -2351,7 +2350,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- if (up->capabilities & UART_CAP_RTOIE)
- up->ier |= UART_IER_RTOIE;
-
-- serial_out(up, UART_IER, up->ier);
-+ serial_port_out(port, UART_IER, up->ier);
-
- if (up->capabilities & UART_CAP_EFR) {
- unsigned char efr = 0;
-@@ -2363,11 +2362,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- if (termios->c_cflag & CRTSCTS)
- efr |= UART_EFR_CTS;
-
-- serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
-+ serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
- if (port->flags & UPF_EXAR_EFR)
-- serial_out(up, UART_XR_EFR, efr);
-+ serial_port_out(port, UART_XR_EFR, efr);
- else
-- serial_out(up, UART_EFR, efr);
-+ serial_port_out(port, UART_EFR, efr);
- }
-
- #ifdef CONFIG_ARCH_OMAP
-@@ -2375,18 +2374,20 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- if (cpu_is_omap1510() && is_omap_port(up)) {
- if (baud == 115200) {
- quot = 1;
-- serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
-+ serial_port_out(port, UART_OMAP_OSC_12M_SEL, 1);
- } else
-- serial_out(up, UART_OMAP_OSC_12M_SEL, 0);
-+ serial_port_out(port, UART_OMAP_OSC_12M_SEL, 0);
- }
- #endif
-
-- if (up->capabilities & UART_NATSEMI) {
-- /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
-- serial_out(up, UART_LCR, 0xe0);
-- } else {
-- serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
-- }
-+ /*
-+ * For NatSemi, switch to bank 2 not bank 1, to avoid resetting EXCR2,
-+ * otherwise just set DLAB
-+ */
-+ if (up->capabilities & UART_NATSEMI)
-+ serial_port_out(port, UART_LCR, 0xe0);
-+ else
-+ serial_port_out(port, UART_LCR, cval | UART_LCR_DLAB);
-
- serial_dl_write(up, quot);
-
-@@ -2395,16 +2396,15 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- * is written without DLAB set, this mode will be disabled.
- */
- if (port->type == PORT_16750)
-- serial_out(up, UART_FCR, fcr);
-+ serial_port_out(port, UART_FCR, fcr);
-
-- serial_out(up, UART_LCR, cval); /* reset DLAB */
-+ serial_port_out(port, UART_LCR, cval); /* reset DLAB */
- up->lcr = cval; /* Save LCR */
- if (port->type != PORT_16750) {
-- if (fcr & UART_FCR_ENABLE_FIFO) {
-- /* emulated UARTs (Lucent Venus 167x) need two steps */
-- serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
-- }
-- serial_out(up, UART_FCR, fcr); /* set fcr */
-+ /* emulated UARTs (Lucent Venus 167x) need two steps */
-+ if (fcr & UART_FCR_ENABLE_FIFO)
-+ serial_port_out(port, UART_FCR, UART_FCR_ENABLE_FIFO);
-+ serial_port_out(port, UART_FCR, fcr); /* set fcr */
- }
- serial8250_set_mctrl(port, port->mctrl);
- spin_unlock_irqrestore(&port->lock, flags);
-@@ -2786,7 +2786,7 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
- container_of(port, struct uart_8250_port, port);
-
- wait_for_xmitr(up, UART_LSR_THRE);
-- serial_out(up, UART_TX, ch);
-+ serial_port_out(port, UART_TX, ch);
- }
-
- /*
-@@ -2818,12 +2818,12 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- /*
- * First save the IER then disable the interrupts
- */
-- ier = serial_in(up, UART_IER);
-+ ier = serial_port_in(port, UART_IER);
-
- if (up->capabilities & UART_CAP_UUE)
-- serial_out(up, UART_IER, UART_IER_UUE);
-+ serial_port_out(port, UART_IER, UART_IER_UUE);
- else
-- serial_out(up, UART_IER, 0);
-+ serial_port_out(port, UART_IER, 0);
-
- uart_console_write(port, s, count, serial8250_console_putchar);
-
-@@ -2832,7 +2832,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
- * and restore the IER
- */
- wait_for_xmitr(up, BOTH_EMPTY);
-- serial_out(up, UART_IER, ier);
-+ serial_port_out(port, UART_IER, ier);
-
- /*
- * The receive handling will happen properly because the
-@@ -2994,11 +2994,11 @@ void serial8250_resume_port(int line)
-
- if (up->capabilities & UART_NATSEMI) {
- /* Ensure it's still in high speed mode */
-- serial_out(up, UART_LCR, 0xE0);
-+ serial_port_out(port, UART_LCR, 0xE0);
-
- ns16550a_goto_highspeed(up);
-
-- serial_out(up, UART_LCR, 0);
-+ serial_port_out(port, UART_LCR, 0);
- port->uartclk = 921600*16;
- }
- uart_resume_port(&serial8250_reg, port);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0026-mmc-tmio-maximize-power-saving.patch b/patches.kzm9g/0026-mmc-tmio-maximize-power-saving.patch
deleted file mode 100644
index 5e9aaa562be870..00000000000000
--- a/patches.kzm9g/0026-mmc-tmio-maximize-power-saving.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From b3250d284d1eafa128d1955c4142697d9227e9e6 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 14 Jul 2011 12:16:59 +0200
-Subject: mmc: tmio: maximize power saving
-
-This patch uses runtime PM to allow the system to power down the MMC
-controller, when the MMC closk is switched off.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 71d111cd34ee119c93d056ad9e84dc0e82367f82)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 2 ++
- drivers/mmc/host/tmio_mmc_pio.c | 64 ++++++++++++++++++++++++-----------------
- 2 files changed, 39 insertions(+), 27 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index f0d7c43..ba0d8e6 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -53,6 +53,8 @@ struct tmio_mmc_host {
- void (*set_clk_div)(struct platform_device *host, int state);
-
- int pm_error;
-+ /* recognise system-wide suspend in runtime PM methods */
-+ bool pm_global;
-
- /* pio related stuff */
- struct scatterlist *sg_ptr;
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index a2f76ad..221ffb7 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -546,6 +546,7 @@ out:
- irqreturn_t tmio_mmc_irq(int irq, void *devid)
- {
- struct tmio_mmc_host *host = devid;
-+ struct mmc_host *mmc = host->mmc;
- struct tmio_mmc_data *pdata = host->pdata;
- unsigned int ireg, irq_mask, status;
- unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
-@@ -567,13 +568,13 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- if (sdio_ireg && !host->sdio_irq_enabled) {
- pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
- sdio_status, sdio_irq_mask, sdio_ireg);
-- tmio_mmc_enable_sdio_irq(host->mmc, 0);
-+ tmio_mmc_enable_sdio_irq(mmc, 0);
- goto out;
- }
-
-- if (host->mmc->caps & MMC_CAP_SDIO_IRQ &&
-+ if (mmc->caps & MMC_CAP_SDIO_IRQ &&
- sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
-- mmc_signal_sdio_irq(host->mmc);
-+ mmc_signal_sdio_irq(mmc);
-
- if (sdio_ireg)
- goto out;
-@@ -586,7 +587,9 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT |
- TMIO_STAT_CARD_REMOVE);
-- if (!work_pending(&host->mmc->detect.work))
-+ if ((((ireg & TMIO_STAT_CARD_REMOVE) && mmc->card) ||
-+ ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) &&
-+ !work_pending(&mmc->detect.work))
- mmc_detect_change(host->mmc, msecs_to_jiffies(100));
- goto out;
- }
-@@ -743,33 +746,30 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
-
- spin_unlock_irqrestore(&host->lock, flags);
-
-- if (ios->clock)
-- tmio_mmc_set_clock(host, ios->clock);
--
-- /* Power sequence - OFF -> UP -> ON */
-- if (ios->power_mode == MMC_POWER_UP) {
-- if ((pdata->flags & TMIO_MMC_HAS_COLD_CD) && !pdata->power) {
-+ /*
-+ * pdata->power == false only if COLD_CD is available, otherwise only
-+ * in short time intervals during probing or resuming
-+ */
-+ if (ios->power_mode == MMC_POWER_ON && ios->clock) {
-+ if (!pdata->power) {
- pm_runtime_get_sync(&host->pdev->dev);
- pdata->power = true;
- }
-+ tmio_mmc_set_clock(host, ios->clock);
- /* power up SD bus */
- if (host->set_pwr)
- host->set_pwr(host->pdev, 1);
-- } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
-- /* power down SD bus */
-- if (ios->power_mode == MMC_POWER_OFF) {
-- if (host->set_pwr)
-- host->set_pwr(host->pdev, 0);
-- if ((pdata->flags & TMIO_MMC_HAS_COLD_CD) &&
-- pdata->power) {
-- pdata->power = false;
-- pm_runtime_put(&host->pdev->dev);
-- }
-- }
-- tmio_mmc_clk_stop(host);
-- } else {
- /* start bus clock */
- tmio_mmc_clk_start(host);
-+ } else if (ios->power_mode != MMC_POWER_UP) {
-+ if (host->set_pwr)
-+ host->set_pwr(host->pdev, 0);
-+ if ((pdata->flags & TMIO_MMC_HAS_COLD_CD) &&
-+ pdata->power) {
-+ pdata->power = false;
-+ pm_runtime_put(&host->pdev->dev);
-+ }
-+ tmio_mmc_clk_stop(host);
- }
-
- switch (ios->bus_width) {
-@@ -897,8 +897,10 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- tmio_mmc_request_dma(_host, pdata);
-
- /* We have to keep the device powered for its card detection to work */
-- if (!(pdata->flags & TMIO_MMC_HAS_COLD_CD))
-+ if (!(pdata->flags & TMIO_MMC_HAS_COLD_CD)) {
-+ pdata->power = true;
- pm_runtime_get_noresume(&pdev->dev);
-+ }
-
- mmc_add_host(mmc);
-
-@@ -975,11 +977,16 @@ int tmio_mmc_host_resume(struct device *dev)
- /* The MMC core will perform the complete set up */
- host->pdata->power = false;
-
-+ host->pm_global = true;
- if (!host->pm_error)
- pm_runtime_get_sync(dev);
-
-- tmio_mmc_reset(mmc_priv(mmc));
-- tmio_mmc_request_dma(host, host->pdata);
-+ if (host->pm_global) {
-+ /* Runtime PM resume callback didn't run */
-+ tmio_mmc_reset(host);
-+ tmio_mmc_request_dma(host, host->pdata);
-+ host->pm_global = false;
-+ }
-
- return mmc_resume_host(mmc);
- }
-@@ -1000,12 +1007,15 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
- struct tmio_mmc_data *pdata = host->pdata;
-
- tmio_mmc_reset(host);
-+ tmio_mmc_request_dma(host, host->pdata);
-
- if (pdata->power) {
- /* Only entered after a card-insert interrupt */
-- tmio_mmc_set_ios(mmc, &mmc->ios);
-+ if (!mmc->card)
-+ tmio_mmc_set_ios(mmc, &mmc->ios);
- mmc_detect_change(mmc, msecs_to_jiffies(100));
- }
-+ host->pm_global = false;
-
- return 0;
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0026-serial-remove-back-and-forth-conversions-in-serial_o.patch b/patches.kzm9g/0026-serial-remove-back-and-forth-conversions-in-serial_o.patch
deleted file mode 100644
index efe8300234a695..00000000000000
--- a/patches.kzm9g/0026-serial-remove-back-and-forth-conversions-in-serial_o.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 51a2897e38814dc21408888a8d3ddd364e7686e2 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 8 Mar 2012 19:12:14 -0500
-Subject: serial: remove back and forth conversions in serial_out_sync
-
-The two callers to serial_out_sync() have a struct port right
-there in scope, but then pass in a struct 8250_port which then
-is locally resolved back to a struct port.
-
-Delete the needless back and forth and just pass in the struct
-port directly. Rename the function to have "_port" in its
-name, so the name <--> args relationship is consistent with the
-other serial_in/out vs serial_port_in/out function classes.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 55e4016dd055e262e4b078b81c80b55386ead0f4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index cb45a29..56492d2 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -467,9 +467,8 @@ static void set_io_from_upio(struct uart_port *p)
- }
-
- static void
--serial_out_sync(struct uart_8250_port *up, int offset, int value)
-+serial_port_out_sync(struct uart_port *p, int offset, int value)
- {
-- struct uart_port *p = &up->port;
- switch (p->iotype) {
- case UPIO_MEM:
- case UPIO_MEM32:
-@@ -2022,11 +2021,11 @@ static int serial8250_startup(struct uart_port *port)
- disable_irq_nosync(port->irq);
-
- wait_for_xmitr(up, UART_LSR_THRE);
-- serial_out_sync(up, UART_IER, UART_IER_THRI);
-+ serial_port_out_sync(port, UART_IER, UART_IER_THRI);
- udelay(1); /* allow THRE to set */
- iir1 = serial_port_in(port, UART_IIR);
- serial_port_out(port, UART_IER, 0);
-- serial_out_sync(up, UART_IER, UART_IER_THRI);
-+ serial_port_out_sync(port, UART_IER, UART_IER_THRI);
- udelay(1); /* allow a working UART time to re-assert THRE */
- iir = serial_port_in(port, UART_IIR);
- serial_port_out(port, UART_IER, 0);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0027-mmc-tmio-fix-a-recently-introduced-bug-in-DMA-code.patch b/patches.kzm9g/0027-mmc-tmio-fix-a-recently-introduced-bug-in-DMA-code.patch
deleted file mode 100644
index 283da7f0c71e0e..00000000000000
--- a/patches.kzm9g/0027-mmc-tmio-fix-a-recently-introduced-bug-in-DMA-code.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From c87079bc67dfd1e0aac3f5acf682085f6b65d266 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 14 Jul 2011 18:39:06 +0200
-Subject: mmc: tmio: fix a recently introduced bug in DMA code
-
-A recent commit "mmc: tmio: Share register access functions" has swapped
-arguments of a macro and broken DMA with TMIO MMC. This patch fixes the
-arguments back.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 332bdb506f800d177f6657247347a253dd5b5be8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_dma.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index f24a029..7e86662 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -26,7 +26,7 @@ static void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
- {
- #if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
- /* Switch DMA mode on or off - SuperH specific? */
-- sd_ctrl_write16(host, enable ? 2 : 0, CTL_DMA_ENABLE);
-+ sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
- #endif
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0027-serial-8250_pci-add-a-force-background-timer-flag-an.patch b/patches.kzm9g/0027-serial-8250_pci-add-a-force-background-timer-flag-an.patch
deleted file mode 100644
index 95b07cdfa19be1..00000000000000
--- a/patches.kzm9g/0027-serial-8250_pci-add-a-force-background-timer-flag-an.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From b503e9756dc79ffaf2b3160b79c1bf2aed842547 Mon Sep 17 00:00:00 2001
-From: Dan Williams <dan.j.williams@intel.com>
-Date: Fri, 6 Apr 2012 11:49:50 -0700
-Subject: serial/8250_pci: add a "force background timer" flag and use it for
- the "kt" serial port
-
-Workaround dropped notifications in the iir register. Register reads
-coincident with new interrupt notifications sometimes result in this
-device clearing the interrupt event without reporting it in the read
-data.
-
-The serial core already has a heuristic for determining when a device
-has an untrustworthy iir register. In this case when we apriori know
-that the iir is faulty use a flag (UPF_BUG_THRE) to bypass the test and
-force usage of the background timer.
-
-[stable: 3.3.x]
-Acked-by: Alan Cox <alan@linux.intel.com>
-Cc: stable <stable@vger.kernel.org>
-Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
-Reported-by: Sudhakar Mamillapalli <sudhakar@fb.com>
-Tested-by: Nhan H Mai <nhan.h.mai@intel.com>
-Tested-by: Sudhakar Mamillapalli <sudhakar@fb.com>
-Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit bc02d15a3452fdf9276e8fb89c5e504a88df888a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 8 +++++---
- drivers/tty/serial/8250/8250_pci.c | 17 ++++++++++++++++-
- include/linux/serial_core.h | 1 +
- 3 files changed, 22 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 56492d2..5c27f7e 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -2035,10 +2035,12 @@ static int serial8250_startup(struct uart_port *port)
- spin_unlock_irqrestore(&port->lock, flags);
-
- /*
-- * If the interrupt is not reasserted, setup a timer to
-- * kick the UART on a regular basis.
-+ * If the interrupt is not reasserted, or we otherwise
-+ * don't trust the iir, setup a timer to kick the UART
-+ * on a regular basis.
- */
-- if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
-+ if ((!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) ||
-+ up->port.flags & UPF_BUG_THRE) {
- up->bugs |= UART_BUG_THRE;
- pr_debug("ttyS%d - using backup timer\n",
- serial_index(port));
-diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
-index a213f38..107eff0 100644
---- a/drivers/tty/serial/8250/8250_pci.c
-+++ b/drivers/tty/serial/8250/8250_pci.c
-@@ -994,6 +994,14 @@ static int skip_tx_en_setup(struct serial_private *priv,
- return pci_default_setup(priv, board, port, idx);
- }
-
-+static int kt_serial_setup(struct serial_private *priv,
-+ const struct pciserial_board *board,
-+ struct uart_port *port, int idx)
-+{
-+ port->flags |= UPF_BUG_THRE;
-+ return skip_tx_en_setup(priv, board, port, idx);
-+}
-+
- static int pci_eg20t_init(struct pci_dev *dev)
- {
- #if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
-@@ -1012,7 +1020,6 @@ pci_xr17c154_setup(struct serial_private *priv,
- return pci_default_setup(priv, board, port, idx);
- }
-
--/* This should be in linux/pci_ids.h */
- #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
- #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
- #define PCI_DEVICE_ID_OCTPRO 0x0001
-@@ -1038,6 +1045,7 @@ pci_xr17c154_setup(struct serial_private *priv,
- #define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
- #define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
- #define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
-+#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
-
- /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
- #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
-@@ -1122,6 +1130,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
- .subdevice = PCI_ANY_ID,
- .setup = ce4100_serial_setup,
- },
-+ {
-+ .vendor = PCI_VENDOR_ID_INTEL,
-+ .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
-+ .subvendor = PCI_ANY_ID,
-+ .subdevice = PCI_ANY_ID,
-+ .setup = kt_serial_setup,
-+ },
- /*
- * ITE
- */
-diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
-index d611ca0..724fde0 100644
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -351,6 +351,7 @@ struct uart_port {
- #define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
- #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
- #define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
-+#define UPF_BUG_THRE ((__force upf_t) (1 << 26))
- /* The exact UART type is known and should not be probed. */
- #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
- #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0028-8250.c-less-than-2400-baud-fix.patch b/patches.kzm9g/0028-8250.c-less-than-2400-baud-fix.patch
deleted file mode 100644
index 44791ce2d1d895..00000000000000
--- a/patches.kzm9g/0028-8250.c-less-than-2400-baud-fix.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 5fbfa3c9a23c95bb26065fb7a6ee3d6256d2a410 Mon Sep 17 00:00:00 2001
-From: Christian Melki <christian.melki@ericsson.se>
-Date: Mon, 30 Apr 2012 11:21:26 +0200
-Subject: 8250.c: less than 2400 baud fix.
-
-We noticed that we were loosing data at speed less than 2400 baud.
-It turned out our (TI16750 compatible) uart with 64 byte outgoing fifo
-was truncated to 16 byte (bit 5 sets fifo len) when modifying the fcr
-reg.
-The input code still fills the buffer with 64 bytes if I remember
-correctly and thus data is lost.
-Our fix was to remove whiping of the fcr content and just add the
-TRIGGER_1 which we want for latency.
-I can't see why this would not work on less than 2400 always, for all
-uarts ...
-Otherwise one would have to make sure the filling of the fifo re-checks
-the current state of available fifo size (urrk).
-
-Signed-off-by: Christian Melki <christian.melki@ericsson.se>
-Cc: stable <stable@vger.kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit f9a9111b540fd67db5dab332f4b83d86c90e27b1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 5c27f7e..d537431 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -2280,10 +2280,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
- quot++;
-
- if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
-- if (baud < 2400)
-- fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
-- else
-- fcr = uart_config[port->type].fcr;
-+ fcr = uart_config[port->type].fcr;
-+ if (baud < 2400) {
-+ fcr &= ~UART_FCR_TRIGGER_MASK;
-+ fcr |= UART_FCR_TRIGGER_1;
-+ }
- }
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0028-mmc-tmio-fix-a-deadlock.patch b/patches.kzm9g/0028-mmc-tmio-fix-a-deadlock.patch
deleted file mode 100644
index 2b82b73c9d48c4..00000000000000
--- a/patches.kzm9g/0028-mmc-tmio-fix-a-deadlock.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 3d74cc1d62a8973298e5f559517f1f9cc362cfe4 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 14 Jul 2011 18:39:10 +0200
-Subject: mmc: tmio: fix a deadlock
-
-Currently the tmio-mmc driver contains a recursive runtime PM method
-invocation, which leads to a deadlock on a mutex. Avoid it by taking
-care not to request DMA too early.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 162f43e31c5a376ec16336e5d0ac973373d54c89)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 5 +++++
- drivers/mmc/host/tmio_mmc_dma.c | 5 ++++-
- drivers/mmc/host/tmio_mmc_pio.c | 4 ++--
- 3 files changed, 11 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index ba0d8e6..087d880 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -109,6 +109,7 @@ static inline void tmio_mmc_kunmap_atomic(struct scatterlist *sg,
-
- #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
- void tmio_mmc_start_dma(struct tmio_mmc_host *host, struct mmc_data *data);
-+void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable);
- void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata);
- void tmio_mmc_release_dma(struct tmio_mmc_host *host);
- #else
-@@ -117,6 +118,10 @@ static inline void tmio_mmc_start_dma(struct tmio_mmc_host *host,
- {
- }
-
-+static inline void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
-+{
-+}
-+
- static inline void tmio_mmc_request_dma(struct tmio_mmc_host *host,
- struct tmio_mmc_data *pdata)
- {
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 7e86662..2aa616d 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -22,8 +22,11 @@
-
- #define TMIO_MMC_MIN_DMA_LEN 8
-
--static void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
-+void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
- {
-+ if (!host->chan_tx || !host->chan_rx)
-+ return;
-+
- #if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
- /* Switch DMA mode on or off - SuperH specific? */
- sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 221ffb7..1f16357 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -984,7 +984,7 @@ int tmio_mmc_host_resume(struct device *dev)
- if (host->pm_global) {
- /* Runtime PM resume callback didn't run */
- tmio_mmc_reset(host);
-- tmio_mmc_request_dma(host, host->pdata);
-+ tmio_mmc_enable_dma(host, true);
- host->pm_global = false;
- }
-
-@@ -1007,7 +1007,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
- struct tmio_mmc_data *pdata = host->pdata;
-
- tmio_mmc_reset(host);
-- tmio_mmc_request_dma(host, host->pdata);
-+ tmio_mmc_enable_dma(host, true);
-
- if (pdata->power) {
- /* Only entered after a card-insert interrupt */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0029-net-remove-mm.h-inclusion-from-netdevice.h.patch b/patches.kzm9g/0029-net-remove-mm.h-inclusion-from-netdevice.h.patch
deleted file mode 100644
index 66dc4806ea641d..00000000000000
--- a/patches.kzm9g/0029-net-remove-mm.h-inclusion-from-netdevice.h.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From f079e5f73032b58caef775a101a141f45fed0915 Mon Sep 17 00:00:00 2001
-From: Alexey Dobriyan <adobriyan@gmail.com>
-Date: Thu, 16 Jun 2011 11:01:34 +0000
-Subject: net: remove mm.h inclusion from netdevice.h
-
-Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).
-
-To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
-definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
-via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
-Removal of mm.h from scatterlist.h was tried and was found not feasible
-on most archs, so the link was cutoff earlier.
-
-Hope people are OK with tiny include file.
-
-Note, that mm_types.h is still dragged in, but it is a separate story.
-
-Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-(cherry picked from commit b7f080cfe223b3b7424872639d153695615a9255)
-
-Conflicts:
-
- arch/arm/mach-davinci/board-mityomapl138.c
- arch/arm/mach-davinci/dm646x.c
- arch/arm/mach-davinci/pm.c
- arch/arm/mach-imx/dma-v1.c
- arch/arm/mach-imx/mach-mx31_3ds.c
- arch/arm/mach-iop13xx/setup.c
- arch/arm/mach-mxs/devices/platform-auart.c
- arch/arm/mach-mxs/devices/platform-dma.c
- arch/arm/mach-mxs/devices/platform-fec.c
- arch/arm/plat-mxc/devices/platform-fec.c
- arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
- arch/arm/plat-mxc/devices/platform-imx-fb.c
- arch/arm/plat-mxc/devices/platform-ipu-core.c
- arch/arm/plat-mxc/devices/platform-mxc-ehci.c
- arch/arm/plat-mxc/devices/platform-mxc-mmc.c
- arch/arm/plat-nomadik/include/plat/ste_dma40.h
- arch/x86/kernel/tboot.c
- crypto/async_tx/raid6test.c
- drivers/dma/coh901318.c
- drivers/dma/dmaengine.c
- drivers/dma/dmatest.c
- drivers/dma/ipu/ipu_idmac.c
- drivers/dma/ste_dma40.c
- drivers/media/dvb/mantis/mantis_ca.c
- drivers/media/dvb/mantis/mantis_evm.c
- drivers/media/dvb/mantis/mantis_hif.c
- drivers/media/dvb/mantis/mantis_ioc.c
- drivers/media/dvb/mantis/mantis_pcmcia.c
- drivers/media/dvb/mantis/mantis_uart.c
- drivers/media/dvb/mantis/mantis_vp1034.c
- drivers/mtd/nand/atmel_nand.c
- drivers/net/arm/ks8695net.c
- drivers/net/bnx2x/bnx2x.h
- drivers/net/can/janz-ican3.c
- drivers/net/can/softing/softing_fw.c
- drivers/net/can/softing/softing_main.c
- drivers/net/ethoc.c
- drivers/net/fec_mpc52xx.c
- drivers/net/greth.c
- drivers/net/irda/pxaficp_ir.c
- drivers/net/ks8851_mll.c
- drivers/net/sgiseeq.c
- drivers/net/stmmac/dwmac1000_core.c
- drivers/net/stmmac/dwmac1000_dma.c
- drivers/net/stmmac/dwmac100_core.c
- drivers/net/stmmac/dwmac100_dma.c
- drivers/net/stmmac/stmmac_ethtool.c
- drivers/net/stmmac/stmmac_mdio.c
- drivers/net/usb/cdc-phonet.c
- drivers/net/vxge/vxge-config.h
- drivers/net/wireless/ath/ath5k/base.c
- drivers/net/wireless/ath/ath9k/beacon.c
- drivers/net/wireless/ath/ath9k/init.c
- drivers/net/wireless/ath/ath9k/recv.c
- drivers/net/wireless/ath/ath9k/xmit.c
- drivers/staging/pohmelfs/crypto.c
- drivers/tty/serial/ifx6x60.c
- drivers/usb/gadget/f_phonet.c
- include/crypto/if_alg.h
- include/linux/dma-direction.h
- include/linux/dma-mapping.h
- include/linux/dmaengine.h
- include/linux/netdevice.h
- net/sched/sch_netem.c
- security/apparmor/lib.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_dma.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 2aa616d..86f259c 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -11,6 +11,7 @@
- */
-
- #include <linux/device.h>
-+#include <linux/dma-mapping.h>
- #include <linux/dmaengine.h>
- #include <linux/mfd/tmio.h>
- #include <linux/mmc/host.h>
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0029-serial8250-Add-dl_read-dl_write-callbacks.patch b/patches.kzm9g/0029-serial8250-Add-dl_read-dl_write-callbacks.patch
deleted file mode 100644
index b1eb8440605ba8..00000000000000
--- a/patches.kzm9g/0029-serial8250-Add-dl_read-dl_write-callbacks.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From c7fbe0d5b21bad7ee177f745bfd423f0ed57243d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 2 May 2012 21:46:51 +0900
-Subject: serial8250: Add dl_read()/dl_write() callbacks
-
-Convert serial_dl_read() and serial_dl_write() from macro
-to 8250 specific callbacks. This change makes it easier to
-support 8250 hardware with non-standard DLL and DLM register
-configurations such as Alchemy, RM9K and upcoming Emma Mobile
-UART hardware.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit cc419fa0d38c425e4ea7bffeed931b07b0a3e461)
-
-Conflicts:
- drivers/tty/serial/8250/8250.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 117 ++++++++++++++++++++++------------------
- drivers/tty/serial/8250/8250.h | 14 +++++
- 2 files changed, 78 insertions(+), 53 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index d537431..7a31149 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -284,6 +284,66 @@ static const struct serial8250_config uart_config[] = {
- },
- };
-
-+/* Uart divisor latch read */
-+static int default_dl_read(struct uart_8250_port *up)
-+{
-+ return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
-+}
-+
-+/* Uart divisor latch write */
-+static void default_dl_write(struct uart_8250_port *up, int value)
-+{
-+ serial_out(up, UART_DLL, value & 0xff);
-+ serial_out(up, UART_DLM, value >> 8 & 0xff);
-+}
-+
-+#if defined(CONFIG_MIPS_ALCHEMY)
-+/* Au1x00 haven't got a standard divisor latch */
-+static int _serial_dl_read(struct uart_8250_port *up)
-+{
-+ if (up->port.iotype == UPIO_AU)
-+ return __raw_readl(up->port.membase + 0x28);
-+ else
-+ return default_dl_read(up);
-+}
-+
-+static void _serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ if (up->port.iotype == UPIO_AU)
-+ __raw_writel(value, up->port.membase + 0x28);
-+ else
-+ default_dl_write(up, value);
-+}
-+#elif defined(CONFIG_SERIAL_8250_RM9K)
-+static int _serial_dl_read(struct uart_8250_port *up)
-+{
-+ return (up->port.iotype == UPIO_RM9000) ?
-+ (((__raw_readl(up->port.membase + 0x10) << 8) |
-+ (__raw_readl(up->port.membase + 0x08) & 0xff)) & 0xffff) :
-+ default_dl_read(up);
-+}
-+
-+static void _serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ if (up->port.iotype == UPIO_RM9000) {
-+ __raw_writel(value, up->port.membase + 0x08);
-+ __raw_writel(value >> 8, up->port.membase + 0x10);
-+ } else {
-+ default_dl_write(up, value);
-+ }
-+}
-+#else
-+static int _serial_dl_read(struct uart_8250_port *up)
-+{
-+ return default_dl_read(up);
-+}
-+
-+static void _serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ default_dl_write(up, value);
-+}
-+#endif
-+
- #if defined(CONFIG_MIPS_ALCHEMY)
-
- /* Au1x00 UART hardware has a weird register layout */
-@@ -434,6 +494,10 @@ static void set_io_from_upio(struct uart_port *p)
- {
- struct uart_8250_port *up =
- container_of(p, struct uart_8250_port, port);
-+
-+ up->dl_read = _serial_dl_read;
-+ up->dl_write = _serial_dl_write;
-+
- switch (p->iotype) {
- case UPIO_HUB6:
- p->serial_in = hub6_serial_in;
-@@ -481,59 +545,6 @@ serial_port_out_sync(struct uart_port *p, int offset, int value)
- }
- }
-
--/* Uart divisor latch read */
--static inline int _serial_dl_read(struct uart_8250_port *up)
--{
-- return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
--}
--
--/* Uart divisor latch write */
--static inline void _serial_dl_write(struct uart_8250_port *up, int value)
--{
-- serial_out(up, UART_DLL, value & 0xff);
-- serial_out(up, UART_DLM, value >> 8 & 0xff);
--}
--
--#if defined(CONFIG_MIPS_ALCHEMY)
--/* Au1x00 haven't got a standard divisor latch */
--static int serial_dl_read(struct uart_8250_port *up)
--{
-- if (up->port.iotype == UPIO_AU)
-- return __raw_readl(up->port.membase + 0x28);
-- else
-- return _serial_dl_read(up);
--}
--
--static void serial_dl_write(struct uart_8250_port *up, int value)
--{
-- if (up->port.iotype == UPIO_AU)
-- __raw_writel(value, up->port.membase + 0x28);
-- else
-- _serial_dl_write(up, value);
--}
--#elif defined(CONFIG_SERIAL_8250_RM9K)
--static int serial_dl_read(struct uart_8250_port *up)
--{
-- return (up->port.iotype == UPIO_RM9000) ?
-- (((__raw_readl(up->port.membase + 0x10) << 8) |
-- (__raw_readl(up->port.membase + 0x08) & 0xff)) & 0xffff) :
-- _serial_dl_read(up);
--}
--
--static void serial_dl_write(struct uart_8250_port *up, int value)
--{
-- if (up->port.iotype == UPIO_RM9000) {
-- __raw_writel(value, up->port.membase + 0x08);
-- __raw_writel(value >> 8, up->port.membase + 0x10);
-- } else {
-- _serial_dl_write(up, value);
-- }
--}
--#else
--#define serial_dl_read(up) _serial_dl_read(up)
--#define serial_dl_write(up, value) _serial_dl_write(up, value)
--#endif
--
- /*
- * For the 16C950
- */
-diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
-index 2868a1d..bafe034 100644
---- a/drivers/tty/serial/8250/8250.h
-+++ b/drivers/tty/serial/8250/8250.h
-@@ -37,6 +37,10 @@ struct uart_8250_port {
- unsigned char lsr_saved_flags;
- #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
- unsigned char msr_saved_flags;
-+
-+ /* 8250 specific callbacks */
-+ int (*dl_read)(struct uart_8250_port *);
-+ void (*dl_write)(struct uart_8250_port *, int);
- };
-
- struct old_serial_port {
-@@ -96,6 +100,16 @@ static inline void serial_out(struct uart_8250_port *up, int offset, int value)
- up->port.serial_out(&up->port, offset, value);
- }
-
-+static inline int serial_dl_read(struct uart_8250_port *up)
-+{
-+ return up->dl_read(up);
-+}
-+
-+static inline void serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ up->dl_write(up, value);
-+}
-+
- #if defined(__alpha__) && !defined(CONFIG_PCI)
- /*
- * Digital did something really horribly wrong with the OUT1 and OUT2
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/003-ltsi-bugfix-sh73a0-add-lost-clk_enable_on_init-for-div6_zb1.patch b/patches.kzm9g/003-ltsi-bugfix-sh73a0-add-lost-clk_enable_on_init-for-div6_zb1.patch
deleted file mode 100644
index a2c38d49cd6794..00000000000000
--- a/patches.kzm9g/003-ltsi-bugfix-sh73a0-add-lost-clk_enable_on_init-for-div6_zb1.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jun 26 04:11:21 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Tue, 26 Jun 2012 20:11:18 +0900
-Subject: [LTSI-dev] [PATCH 3/4] LTSI: bugfix: sh73a0: add lost CLK_ENABLE_ON_INIT for DIV6_ZB1
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: kuninori.morimoto.gx@gmail.com
-Message-ID: <4FE998D6.9050209@kmckk.co.jp>
-
-
-On upstream kernel, on one branch,
-CLK_ENABLE_ON_INIT was added to DIV6_ZB1 clock by
-9bcc0a5d0de137b3a154dc951c5ff70dce815879
-(ARM: mach-shmobile: SH73A0 external Ethernet fix)
-
-On the other branch, below commit modified dev6_clks[] controlling method.
-d4775356bb39eaa305844cc6cc4c267236535956
-(sh: clkfwk: clock-sh73a0: all div6_clks use SH_CLK_DIV6_EXT())
-
-These 2 commit had conflict, and were solved when merge window
-timing on upstream kernel.
-But unfortunately, this solution seems had be lost on backporting.
-This patch fixes it up for LTSI.
-
-Reported-by: Kunihiko Tsuji <kunihiko at kmckk.co.jp>
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 012b284..fcecbdc 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -328,7 +328,7 @@ static struct clk div6_clks[DIV6_NR] = {
- vck_parent, ARRAY_SIZE(vck_parent), 12, 3),
- [DIV6_VCK3] = SH_CLK_DIV6_EXT(VCLKCR3, 0,
- vck_parent, ARRAY_SIZE(vck_parent), 12, 3),
-- [DIV6_ZB1] = SH_CLK_DIV6_EXT(ZBCKCR, 0,
-+ [DIV6_ZB1] = SH_CLK_DIV6_EXT(ZBCKCR, CLK_ENABLE_ON_INIT,
- pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
- [DIV6_FLCTL] = SH_CLK_DIV6_EXT(FLCKCR, 0,
- pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
---
-1.7.9.5
-
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.kzm9g/0030-MMC-TMIO-Fix-build-issue-related-to-struct-scatterli.patch b/patches.kzm9g/0030-MMC-TMIO-Fix-build-issue-related-to-struct-scatterli.patch
deleted file mode 100644
index 8d59531622e57f..00000000000000
--- a/patches.kzm9g/0030-MMC-TMIO-Fix-build-issue-related-to-struct-scatterli.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 5f95cc2e38f83f6ce91e1312e078cbcc5ee839b1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 26 Jul 2011 20:50:23 +0200
-Subject: MMC / TMIO: Fix build issue related to struct scatterlist
-
-Fix build issue caused by undefined struct scatterlist in
-drivers/mmc/host/tmio_mmc.c.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit 6c0cbef6662aa685c6a47a18039b9d4f1d5abcb1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 087d880..eeaf643 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -21,6 +21,7 @@
- #include <linux/mutex.h>
- #include <linux/pagemap.h>
- #include <linux/spinlock.h>
-+#include <linux/scatterlist.h>
-
- /* Definitions for values the CTRL_SDIO_STATUS register can take. */
- #define TMIO_SDIO_STAT_IOIRQ 0x0001
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0030-serial8250-Use-dl_read-dl_write-on-Alchemy.patch b/patches.kzm9g/0030-serial8250-Use-dl_read-dl_write-on-Alchemy.patch
deleted file mode 100644
index d543de7ec41cc8..00000000000000
--- a/patches.kzm9g/0030-serial8250-Use-dl_read-dl_write-on-Alchemy.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From c5c260031fff81671154c36017619be60bd9db4d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 2 May 2012 21:47:00 +0900
-Subject: serial8250: Use dl_read()/dl_write() on Alchemy
-
-Convert the 8250 Alchemy support code to make
-use of the new dl_read()/dl_write() callbacks.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 6b4160313c239d61c3907b2aaaeeec156911c9d1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 67 ++++++++++++++++------------------------
- 1 file changed, 26 insertions(+), 41 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 7a31149..ce7717c 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -297,24 +297,7 @@ static void default_dl_write(struct uart_8250_port *up, int value)
- serial_out(up, UART_DLM, value >> 8 & 0xff);
- }
-
--#if defined(CONFIG_MIPS_ALCHEMY)
--/* Au1x00 haven't got a standard divisor latch */
--static int _serial_dl_read(struct uart_8250_port *up)
--{
-- if (up->port.iotype == UPIO_AU)
-- return __raw_readl(up->port.membase + 0x28);
-- else
-- return default_dl_read(up);
--}
--
--static void _serial_dl_write(struct uart_8250_port *up, int value)
--{
-- if (up->port.iotype == UPIO_AU)
-- __raw_writel(value, up->port.membase + 0x28);
-- else
-- default_dl_write(up, value);
--}
--#elif defined(CONFIG_SERIAL_8250_RM9K)
-+#if defined(CONFIG_SERIAL_8250_RM9K)
- static int _serial_dl_read(struct uart_8250_port *up)
- {
- return (up->port.iotype == UPIO_RM9000) ?
-@@ -344,7 +327,7 @@ static void _serial_dl_write(struct uart_8250_port *up, int value)
- }
- #endif
-
--#if defined(CONFIG_MIPS_ALCHEMY)
-+#ifdef CONFIG_MIPS_ALCHEMY
-
- /* Au1x00 UART hardware has a weird register layout */
- static const u8 au_io_in_map[] = {
-@@ -365,22 +348,32 @@ static const u8 au_io_out_map[] = {
- [UART_MCR] = 6,
- };
-
--/* sane hardware needs no mapping */
--static inline int map_8250_in_reg(struct uart_port *p, int offset)
-+static unsigned int au_serial_in(struct uart_port *p, int offset)
- {
-- if (p->iotype != UPIO_AU)
-- return offset;
-- return au_io_in_map[offset];
-+ offset = au_io_in_map[offset] << p->regshift;
-+ return __raw_readl(p->membase + offset);
- }
-
--static inline int map_8250_out_reg(struct uart_port *p, int offset)
-+static void au_serial_out(struct uart_port *p, int offset, int value)
- {
-- if (p->iotype != UPIO_AU)
-- return offset;
-- return au_io_out_map[offset];
-+ offset = au_io_out_map[offset] << p->regshift;
-+ __raw_writel(value, p->membase + offset);
-+}
-+
-+/* Au1x00 haven't got a standard divisor latch */
-+static int au_serial_dl_read(struct uart_8250_port *up)
-+{
-+ return __raw_readl(up->port.membase + 0x28);
- }
-
--#elif defined(CONFIG_SERIAL_8250_RM9K)
-+static void au_serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ __raw_writel(value, up->port.membase + 0x28);
-+}
-+
-+#endif
-+
-+#if defined(CONFIG_SERIAL_8250_RM9K)
-
- static const u8
- regmap_in[8] = {
-@@ -464,18 +457,6 @@ static unsigned int mem32_serial_in(struct uart_port *p, int offset)
- return readl(p->membase + offset);
- }
-
--static unsigned int au_serial_in(struct uart_port *p, int offset)
--{
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-- return __raw_readl(p->membase + offset);
--}
--
--static void au_serial_out(struct uart_port *p, int offset, int value)
--{
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-- __raw_writel(value, p->membase + offset);
--}
--
- static unsigned int io_serial_in(struct uart_port *p, int offset)
- {
- offset = map_8250_in_reg(p, offset) << p->regshift;
-@@ -515,10 +496,14 @@ static void set_io_from_upio(struct uart_port *p)
- p->serial_out = mem32_serial_out;
- break;
-
-+#ifdef CONFIG_MIPS_ALCHEMY
- case UPIO_AU:
- p->serial_in = au_serial_in;
- p->serial_out = au_serial_out;
-+ up->dl_read = au_serial_dl_read;
-+ up->dl_write = au_serial_dl_write;
- break;
-+#endif
-
- default:
- p->serial_in = io_serial_in;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0031-mmc-tmio-eliminate-unused-variable-mmc-warning.patch b/patches.kzm9g/0031-mmc-tmio-eliminate-unused-variable-mmc-warning.patch
deleted file mode 100644
index 554251e6533874..00000000000000
--- a/patches.kzm9g/0031-mmc-tmio-eliminate-unused-variable-mmc-warning.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 37284ff5509343e2d777637a23487da3335c2f31 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Wed, 3 Aug 2011 14:48:58 +0800
-Subject: mmc: tmio: eliminate unused variable 'mmc' warning
-
-Fix below compile warning:
- CC drivers/mmc/host/tmio_mmc.o
-drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_suspend':
-drivers/mmc/host/tmio_mmc.c:30: warning: unused variable 'mmc'
-drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_resume':
-drivers/mmc/host/tmio_mmc.c:45: warning: unused variable 'mmc'
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 4906baf080623b4971bdeeac0a9fec5b8885d3ac)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
-index 8d185de..44a9668 100644
---- a/drivers/mmc/host/tmio_mmc.c
-+++ b/drivers/mmc/host/tmio_mmc.c
-@@ -27,7 +27,6 @@
- static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
- {
- const struct mfd_cell *cell = mfd_get_cell(dev);
-- struct mmc_host *mmc = platform_get_drvdata(dev);
- int ret;
-
- ret = tmio_mmc_host_suspend(&dev->dev);
-@@ -42,7 +41,6 @@ static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
- static int tmio_mmc_resume(struct platform_device *dev)
- {
- const struct mfd_cell *cell = mfd_get_cell(dev);
-- struct mmc_host *mmc = platform_get_drvdata(dev);
- int ret = 0;
-
- /* Tell the MFD core we are ready to be enabled */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0031-serial8250-Use-dl_read-dl_write-on-RM9K.patch b/patches.kzm9g/0031-serial8250-Use-dl_read-dl_write-on-RM9K.patch
deleted file mode 100644
index 11c12350a223cd..00000000000000
--- a/patches.kzm9g/0031-serial8250-Use-dl_read-dl_write-on-RM9K.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From b2a0b1532958cbf0ef8e7078c78558b2e78bb524 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 2 May 2012 21:47:09 +0900
-Subject: serial8250: Use dl_read()/dl_write() on RM9K
-
-Convert the 8250 RM9K support code to make
-use of the new dl_read()/dl_write() callbacks.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 28bf4cf22dcd936f93dd6063696b1accdc1d5207)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 62 +++++++++++++++++++---------------------
- 1 file changed, 29 insertions(+), 33 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index ce7717c..36ce1e2 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -297,25 +297,6 @@ static void default_dl_write(struct uart_8250_port *up, int value)
- serial_out(up, UART_DLM, value >> 8 & 0xff);
- }
-
--#if defined(CONFIG_SERIAL_8250_RM9K)
--static int _serial_dl_read(struct uart_8250_port *up)
--{
-- return (up->port.iotype == UPIO_RM9000) ?
-- (((__raw_readl(up->port.membase + 0x10) << 8) |
-- (__raw_readl(up->port.membase + 0x08) & 0xff)) & 0xffff) :
-- default_dl_read(up);
--}
--
--static void _serial_dl_write(struct uart_8250_port *up, int value)
--{
-- if (up->port.iotype == UPIO_RM9000) {
-- __raw_writel(value, up->port.membase + 0x08);
-- __raw_writel(value >> 8, up->port.membase + 0x10);
-- } else {
-- default_dl_write(up, value);
-- }
--}
--#else
- static int _serial_dl_read(struct uart_8250_port *up)
- {
- return default_dl_read(up);
-@@ -325,7 +306,6 @@ static void _serial_dl_write(struct uart_8250_port *up, int value)
- {
- default_dl_write(up, value);
- }
--#endif
-
- #ifdef CONFIG_MIPS_ALCHEMY
-
-@@ -373,7 +353,7 @@ static void au_serial_dl_write(struct uart_8250_port *up, int value)
-
- #endif
-
--#if defined(CONFIG_SERIAL_8250_RM9K)
-+#ifdef CONFIG_SERIAL_8250_RM9K
-
- static const u8
- regmap_in[8] = {
-@@ -397,28 +377,36 @@ static const u8
- [UART_SCR] = 0x2c
- };
-
--static inline int map_8250_in_reg(struct uart_port *p, int offset)
-+static unsigned int rm9k_serial_in(struct uart_port *p, int offset)
- {
-- if (p->iotype != UPIO_RM9000)
-- return offset;
-- return regmap_in[offset];
-+ offset = regmap_in[offset] << p->regshift;
-+ return readl(p->membase + offset);
- }
-
--static inline int map_8250_out_reg(struct uart_port *p, int offset)
-+static void rm9k_serial_out(struct uart_port *p, int offset, int value)
- {
-- if (p->iotype != UPIO_RM9000)
-- return offset;
-- return regmap_out[offset];
-+ offset = regmap_out[offset] << p->regshift;
-+ writel(value, p->membase + offset);
- }
-
--#else
-+static int rm9k_serial_dl_read(struct uart_8250_port *up)
-+{
-+ return ((__raw_readl(up->port.membase + 0x10) << 8) |
-+ (__raw_readl(up->port.membase + 0x08) & 0xff)) & 0xffff;
-+}
-+
-+static void rm9k_serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ __raw_writel(value, up->port.membase + 0x08);
-+ __raw_writel(value >> 8, up->port.membase + 0x10);
-+}
-+
-+#endif
-
- /* sane hardware needs no mapping */
- #define map_8250_in_reg(up, offset) (offset)
- #define map_8250_out_reg(up, offset) (offset)
-
--#endif
--
- static unsigned int hub6_serial_in(struct uart_port *p, int offset)
- {
- offset = map_8250_in_reg(p, offset) << p->regshift;
-@@ -490,12 +478,20 @@ static void set_io_from_upio(struct uart_port *p)
- p->serial_out = mem_serial_out;
- break;
-
-- case UPIO_RM9000:
- case UPIO_MEM32:
- p->serial_in = mem32_serial_in;
- p->serial_out = mem32_serial_out;
- break;
-
-+#ifdef CONFIG_SERIAL_8250_RM9K
-+ case UPIO_RM9000:
-+ p->serial_in = rm9k_serial_in;
-+ p->serial_out = rm9k_serial_out;
-+ up->dl_read = rm9k_serial_dl_read;
-+ up->dl_write = rm9k_serial_dl_write;
-+ break;
-+#endif
-+
- #ifdef CONFIG_MIPS_ALCHEMY
- case UPIO_AU:
- p->serial_in = au_serial_in;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0032-mmc-sdhi-initialise-mmc_data-flags-before-use.patch b/patches.kzm9g/0032-mmc-sdhi-initialise-mmc_data-flags-before-use.patch
deleted file mode 100644
index c88dadd8462f77..00000000000000
--- a/patches.kzm9g/0032-mmc-sdhi-initialise-mmc_data-flags-before-use.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From bf87a92d768043390903be036df2292b6775bdb5 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 19 Aug 2011 10:07:07 +0900
-Subject: mmc: sdhi: initialise mmc_data->flags before use
-
-This corrects a logic error that I introduced in
-"mmc: sdhi: Add write16_hook"
-
-Reported-by: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit b91df1593e361109f1fe665ce17c5e87ca60582b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 774f643..0c4a672 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -120,11 +120,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- mmc_data->hclk = clk_get_rate(priv->clk);
- mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
- mmc_data->get_cd = sh_mobile_sdhi_get_cd;
-- if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT)
-- mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
- mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
- if (p) {
- mmc_data->flags = p->tmio_flags;
-+ if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT)
-+ mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
- mmc_data->ocr_mask = p->tmio_ocr_mask;
- mmc_data->capabilities |= p->tmio_caps;
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0032-serial8250-Clean-up-default-map-and-dl-code.patch b/patches.kzm9g/0032-serial8250-Clean-up-default-map-and-dl-code.patch
deleted file mode 100644
index 5ebaebd7ba7583..00000000000000
--- a/patches.kzm9g/0032-serial8250-Clean-up-default-map-and-dl-code.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From 2c6855bab06ff3e78cdcafd00a9ab5b6fd4c3ef3 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 2 May 2012 21:47:18 +0900
-Subject: serial8250: Clean up default map and dl code
-
-Get rid of unused functions and macros now when
-Alchemy and RM9K are converted over to callbacks.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit e8155629ff19e05722ba057d1521baec270d780e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 38 ++++++++++++--------------------------
- 1 file changed, 12 insertions(+), 26 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 36ce1e2..3445a27 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -285,28 +285,18 @@ static const struct serial8250_config uart_config[] = {
- };
-
- /* Uart divisor latch read */
--static int default_dl_read(struct uart_8250_port *up)
-+static int default_serial_dl_read(struct uart_8250_port *up)
- {
- return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
- }
-
- /* Uart divisor latch write */
--static void default_dl_write(struct uart_8250_port *up, int value)
-+static void default_serial_dl_write(struct uart_8250_port *up, int value)
- {
- serial_out(up, UART_DLL, value & 0xff);
- serial_out(up, UART_DLM, value >> 8 & 0xff);
- }
-
--static int _serial_dl_read(struct uart_8250_port *up)
--{
-- return default_dl_read(up);
--}
--
--static void _serial_dl_write(struct uart_8250_port *up, int value)
--{
-- default_dl_write(up, value);
--}
--
- #ifdef CONFIG_MIPS_ALCHEMY
-
- /* Au1x00 UART hardware has a weird register layout */
-@@ -403,57 +393,53 @@ static void rm9k_serial_dl_write(struct uart_8250_port *up, int value)
-
- #endif
-
--/* sane hardware needs no mapping */
--#define map_8250_in_reg(up, offset) (offset)
--#define map_8250_out_reg(up, offset) (offset)
--
- static unsigned int hub6_serial_in(struct uart_port *p, int offset)
- {
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- outb(p->hub6 - 1 + offset, p->iobase);
- return inb(p->iobase + 1);
- }
-
- static void hub6_serial_out(struct uart_port *p, int offset, int value)
- {
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- outb(p->hub6 - 1 + offset, p->iobase);
- outb(value, p->iobase + 1);
- }
-
- static unsigned int mem_serial_in(struct uart_port *p, int offset)
- {
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- return readb(p->membase + offset);
- }
-
- static void mem_serial_out(struct uart_port *p, int offset, int value)
- {
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- writeb(value, p->membase + offset);
- }
-
- static void mem32_serial_out(struct uart_port *p, int offset, int value)
- {
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- writel(value, p->membase + offset);
- }
-
- static unsigned int mem32_serial_in(struct uart_port *p, int offset)
- {
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- return readl(p->membase + offset);
- }
-
- static unsigned int io_serial_in(struct uart_port *p, int offset)
- {
-- offset = map_8250_in_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- return inb(p->iobase + offset);
- }
-
- static void io_serial_out(struct uart_port *p, int offset, int value)
- {
-- offset = map_8250_out_reg(p, offset) << p->regshift;
-+ offset = offset << p->regshift;
- outb(value, p->iobase + offset);
- }
-
-@@ -464,8 +450,8 @@ static void set_io_from_upio(struct uart_port *p)
- struct uart_8250_port *up =
- container_of(p, struct uart_8250_port, port);
-
-- up->dl_read = _serial_dl_read;
-- up->dl_write = _serial_dl_write;
-+ up->dl_read = default_serial_dl_read;
-+ up->dl_write = default_serial_dl_write;
-
- switch (p->iotype) {
- case UPIO_HUB6:
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0033-mmc-tmio-Cache-interrupt-masks.patch b/patches.kzm9g/0033-mmc-tmio-Cache-interrupt-masks.patch
deleted file mode 100644
index 7f23958328ab13..00000000000000
--- a/patches.kzm9g/0033-mmc-tmio-Cache-interrupt-masks.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From 841db3ade6dadb8573cbe50fa35238f7d0bbe637 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Thu, 25 Aug 2011 10:27:25 +0900
-Subject: mmc: tmio: Cache interrupt masks
-
-This avoids the need to look up the masks each time an interrupt is handled.
-As suggested by Guennadi.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 54680fe7f6ad0fb0c52e330484e2cf1609587862)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 4 ++++
- drivers/mmc/host/tmio_mmc_pio.c | 34 ++++++++++++++++++----------------
- 2 files changed, 22 insertions(+), 16 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index eeaf643..1cf8db5 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -79,6 +79,10 @@ struct tmio_mmc_host {
- struct delayed_work delayed_reset_work;
- struct work_struct done;
-
-+ /* Cache IRQ mask */
-+ u32 sdcard_irq_mask;
-+ u32 sdio_irq_mask;
-+
- spinlock_t lock; /* protect host private data */
- unsigned long last_req_ts;
- struct mutex ios_lock; /* protect set_ios() context */
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 1f16357..f0c7830 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -48,14 +48,14 @@
-
- void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i)
- {
-- u32 mask = sd_ctrl_read32(host, CTL_IRQ_MASK) & ~(i & TMIO_MASK_IRQ);
-- sd_ctrl_write32(host, CTL_IRQ_MASK, mask);
-+ host->sdcard_irq_mask &= ~(i & TMIO_MASK_IRQ);
-+ sd_ctrl_write32(host, CTL_IRQ_MASK, host->sdcard_irq_mask);
- }
-
- void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i)
- {
-- u32 mask = sd_ctrl_read32(host, CTL_IRQ_MASK) | (i & TMIO_MASK_IRQ);
-- sd_ctrl_write32(host, CTL_IRQ_MASK, mask);
-+ host->sdcard_irq_mask |= (i & TMIO_MASK_IRQ);
-+ sd_ctrl_write32(host, CTL_IRQ_MASK, host->sdcard_irq_mask);
- }
-
- static void tmio_mmc_ack_mmc_irqs(struct tmio_mmc_host *host, u32 i)
-@@ -127,11 +127,13 @@ static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
-
- if (enable) {
- host->sdio_irq_enabled = 1;
-+ host->sdio_irq_mask = TMIO_SDIO_MASK_ALL &
-+ ~TMIO_SDIO_STAT_IOIRQ;
- sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
-- sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK,
-- (TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ));
-+ sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
- } else {
-- sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, TMIO_SDIO_MASK_ALL);
-+ host->sdio_irq_mask = TMIO_SDIO_MASK_ALL;
-+ sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
- sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
- host->sdio_irq_enabled = 0;
- }
-@@ -548,26 +550,25 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- struct tmio_mmc_host *host = devid;
- struct mmc_host *mmc = host->mmc;
- struct tmio_mmc_data *pdata = host->pdata;
-- unsigned int ireg, irq_mask, status;
-- unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
-+ unsigned int ireg, status;
-+ unsigned int sdio_ireg, sdio_status;
-
- pr_debug("MMC IRQ begin\n");
-
- status = sd_ctrl_read32(host, CTL_STATUS);
-- irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
-- ireg = status & TMIO_MASK_IRQ & ~irq_mask;
-+ ireg = status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask;
-
- sdio_ireg = 0;
- if (!ireg && pdata->flags & TMIO_MMC_SDIO_IRQ) {
- sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
-- sdio_irq_mask = sd_ctrl_read16(host, CTL_SDIO_IRQ_MASK);
-- sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL & ~sdio_irq_mask;
-+ sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL &
-+ ~host->sdio_irq_mask;
-
- sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
-
- if (sdio_ireg && !host->sdio_irq_enabled) {
- pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
-- sdio_status, sdio_irq_mask, sdio_ireg);
-+ sdio_status, host->sdio_irq_mask, sdio_ireg);
- tmio_mmc_enable_sdio_irq(mmc, 0);
- goto out;
- }
-@@ -623,9 +624,9 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- }
-
- pr_warning("tmio_mmc: Spurious irq, disabling! "
-- "0x%08x 0x%08x 0x%08x\n", status, irq_mask, ireg);
-+ "0x%08x 0x%08x 0x%08x\n", status, host->sdcard_irq_mask, ireg);
- pr_debug_status(status);
-- tmio_mmc_disable_mmc_irqs(host, status & ~irq_mask);
-+ tmio_mmc_disable_mmc_irqs(host, status & ~host->sdcard_irq_mask);
-
- out:
- return IRQ_HANDLED;
-@@ -882,6 +883,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- tmio_mmc_clk_stop(_host);
- tmio_mmc_reset(_host);
-
-+ _host->sdcard_irq_mask = sd_ctrl_read32(_host, CTL_IRQ_MASK);
- tmio_mmc_disable_mmc_irqs(_host, TMIO_MASK_ALL);
- if (pdata->flags & TMIO_MMC_SDIO_IRQ)
- tmio_mmc_enable_sdio_irq(mmc, 0);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0033-serial8250-Introduce-serial8250_register_8250_port.patch b/patches.kzm9g/0033-serial8250-Introduce-serial8250_register_8250_port.patch
deleted file mode 100644
index f01d7ee280adfa..00000000000000
--- a/patches.kzm9g/0033-serial8250-Introduce-serial8250_register_8250_port.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From 4d5e00ec9374ddf1ec0995e10380e2e044eb8154 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 2 May 2012 21:47:27 +0900
-Subject: serial8250: Introduce serial8250_register_8250_port()
-
-Introduce yet another 8250 registration function.
-This time it is serial8250_register_8250_port() and it
-allows us to register 8250 hardware instances using struct
-uart_8250_port. The new function makes it possible to
-register 8250 hardware that makes use of 8250 specific
-callbacks such as ->dl_read() and ->dl_write().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit f73fa05b90eb8c0dd3230c364cf1107f4f8f3848)
-
-Conflicts:
- drivers/tty/serial/8250/8250.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250.c | 87 ++++++++++++++++++++++++++--------------
- include/linux/serial_8250.h | 1 +
- 2 files changed, 58 insertions(+), 30 deletions(-)
-
-diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
-index 3445a27..8de9a39 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
-@@ -3132,7 +3132,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
- }
-
- /**
-- * serial8250_register_port - register a serial port
-+ * serial8250_register_8250_port - register a serial port
- * @port: serial port template
- *
- * Configure the serial port specified by the request. If the
-@@ -3144,50 +3144,54 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
- *
- * On success the port is ready to use and the line number is returned.
- */
--int serial8250_register_port(struct uart_port *port)
-+int serial8250_register_8250_port(struct uart_8250_port *up)
- {
- struct uart_8250_port *uart;
- int ret = -ENOSPC;
-
-- if (port->uartclk == 0)
-+ if (up->port.uartclk == 0)
- return -EINVAL;
-
- mutex_lock(&serial_mutex);
-
-- uart = serial8250_find_match_or_unused(port);
-+ uart = serial8250_find_match_or_unused(&up->port);
- if (uart) {
- uart_remove_one_port(&serial8250_reg, &uart->port);
-
-- uart->port.iobase = port->iobase;
-- uart->port.membase = port->membase;
-- uart->port.irq = port->irq;
-- uart->port.irqflags = port->irqflags;
-- uart->port.uartclk = port->uartclk;
-- uart->port.fifosize = port->fifosize;
-- uart->port.regshift = port->regshift;
-- uart->port.iotype = port->iotype;
-- uart->port.flags = port->flags | UPF_BOOT_AUTOCONF;
-- uart->port.mapbase = port->mapbase;
-- uart->port.private_data = port->private_data;
-- if (port->dev)
-- uart->port.dev = port->dev;
--
-- if (port->flags & UPF_FIXED_TYPE)
-- serial8250_init_fixed_type_port(uart, port->type);
-+ uart->port.iobase = up->port.iobase;
-+ uart->port.membase = up->port.membase;
-+ uart->port.irq = up->port.irq;
-+ uart->port.irqflags = up->port.irqflags;
-+ uart->port.uartclk = up->port.uartclk;
-+ uart->port.fifosize = up->port.fifosize;
-+ uart->port.regshift = up->port.regshift;
-+ uart->port.iotype = up->port.iotype;
-+ uart->port.flags = up->port.flags | UPF_BOOT_AUTOCONF;
-+ uart->port.mapbase = up->port.mapbase;
-+ uart->port.private_data = up->port.private_data;
-+ if (up->port.dev)
-+ uart->port.dev = up->port.dev;
-+
-+ if (up->port.flags & UPF_FIXED_TYPE)
-+ serial8250_init_fixed_type_port(uart, up->port.type);
-
- set_io_from_upio(&uart->port);
- /* Possibly override default I/O functions. */
-- if (port->serial_in)
-- uart->port.serial_in = port->serial_in;
-- if (port->serial_out)
-- uart->port.serial_out = port->serial_out;
-- if (port->handle_irq)
-- uart->port.handle_irq = port->handle_irq;
-+ if (up->port.serial_in)
-+ uart->port.serial_in = up->port.serial_in;
-+ if (up->port.serial_out)
-+ uart->port.serial_out = up->port.serial_out;
-+ if (up->port.handle_irq)
-+ uart->port.handle_irq = up->port.handle_irq;
- /* Possibly override set_termios call */
-- if (port->set_termios)
-- uart->port.set_termios = port->set_termios;
-- if (port->pm)
-- uart->port.pm = port->pm;
-+ if (up->port.set_termios)
-+ uart->port.set_termios = up->port.set_termios;
-+ if (up->port.pm)
-+ uart->port.pm = up->port.pm;
-+ if (up->dl_read)
-+ uart->dl_read = up->dl_read;
-+ if (up->dl_write)
-+ uart->dl_write = up->dl_write;
-
- if (serial8250_isa_config != NULL)
- serial8250_isa_config(0, &uart->port,
-@@ -3201,6 +3205,29 @@ int serial8250_register_port(struct uart_port *port)
-
- return ret;
- }
-+EXPORT_SYMBOL(serial8250_register_8250_port);
-+
-+/**
-+ * serial8250_register_port - register a serial port
-+ * @port: serial port template
-+ *
-+ * Configure the serial port specified by the request. If the
-+ * port exists and is in use, it is hung up and unregistered
-+ * first.
-+ *
-+ * The port is then probed and if necessary the IRQ is autodetected
-+ * If this fails an error is returned.
-+ *
-+ * On success the port is ready to use and the line number is returned.
-+ */
-+int serial8250_register_port(struct uart_port *port)
-+{
-+ struct uart_8250_port up;
-+
-+ memset(&up, 0, sizeof(up));
-+ memcpy(&up.port, port, sizeof(*port));
-+ return serial8250_register_8250_port(&up);
-+}
- EXPORT_SYMBOL(serial8250_register_port);
-
- /**
-diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
-index b44034e..d7f286e 100644
---- a/include/linux/serial_8250.h
-+++ b/include/linux/serial_8250.h
-@@ -68,6 +68,7 @@ enum {
- struct uart_port;
- struct uart_8250_port;
-
-+int serial8250_register_8250_port(struct uart_8250_port *);
- int serial8250_register_port(struct uart_port *);
- void serial8250_unregister_port(int line);
- void serial8250_suspend_port(int line);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0034-mmc-tmio-Provide-separate-interrupt-handlers.patch b/patches.kzm9g/0034-mmc-tmio-Provide-separate-interrupt-handlers.patch
deleted file mode 100644
index a36ee79a77255d..00000000000000
--- a/patches.kzm9g/0034-mmc-tmio-Provide-separate-interrupt-handlers.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 82db957f7a037e60d56f38437d5d0e8517cfd3f9 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Thu, 25 Aug 2011 10:27:26 +0900
-Subject: mmc: tmio: Provide separate interrupt handlers
-
-Provide separate interrupt handlers which may be used by platforms where
-SDHI has three interrupt sources.
-
-This patch also removes the commented-out handling of CRC and other errors.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 7729c7a232a95360fa17ffe8beb1adb621bc0ba0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 3 +
- drivers/mmc/host/tmio_mmc_pio.c | 131 +++++++++++++++++++++++++---------------
- 2 files changed, 86 insertions(+), 48 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 1cf8db5..3020f98 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -97,6 +97,9 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
- void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
- void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
- irqreturn_t tmio_mmc_irq(int irq, void *devid);
-+irqreturn_t tmio_mmc_sdcard_irq(int irq, void *devid);
-+irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid);
-+irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid);
-
- static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
- unsigned long *flags)
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index f0c7830..6275e3d 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -545,44 +545,20 @@ out:
- spin_unlock(&host->lock);
- }
-
--irqreturn_t tmio_mmc_irq(int irq, void *devid)
-+static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
-+ int *ireg, int *status)
- {
-- struct tmio_mmc_host *host = devid;
-- struct mmc_host *mmc = host->mmc;
-- struct tmio_mmc_data *pdata = host->pdata;
-- unsigned int ireg, status;
-- unsigned int sdio_ireg, sdio_status;
--
-- pr_debug("MMC IRQ begin\n");
--
-- status = sd_ctrl_read32(host, CTL_STATUS);
-- ireg = status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask;
-+ *status = sd_ctrl_read32(host, CTL_STATUS);
-+ *ireg = *status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask;
-
-- sdio_ireg = 0;
-- if (!ireg && pdata->flags & TMIO_MMC_SDIO_IRQ) {
-- sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
-- sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL &
-- ~host->sdio_irq_mask;
--
-- sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
--
-- if (sdio_ireg && !host->sdio_irq_enabled) {
-- pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
-- sdio_status, host->sdio_irq_mask, sdio_ireg);
-- tmio_mmc_enable_sdio_irq(mmc, 0);
-- goto out;
-- }
--
-- if (mmc->caps & MMC_CAP_SDIO_IRQ &&
-- sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
-- mmc_signal_sdio_irq(mmc);
--
-- if (sdio_ireg)
-- goto out;
-- }
-+ pr_debug_status(*status);
-+ pr_debug_status(*ireg);
-+}
-
-- pr_debug_status(status);
-- pr_debug_status(ireg);
-+static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-+ int ireg, int status)
-+{
-+ struct mmc_host *mmc = host->mmc;
-
- /* Card insert / remove attempts */
- if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
-@@ -592,43 +568,102 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
- ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) &&
- !work_pending(&mmc->detect.work))
- mmc_detect_change(host->mmc, msecs_to_jiffies(100));
-- goto out;
-+ return true;
- }
-
-- /* CRC and other errors */
--/* if (ireg & TMIO_STAT_ERR_IRQ)
-- * handled |= tmio_error_irq(host, irq, stat);
-- */
-+ return false;
-+}
-+
-+irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid)
-+{
-+ unsigned int ireg, status;
-+ struct tmio_mmc_host *host = devid;
-
-+ tmio_mmc_card_irq_status(host, &ireg, &status);
-+ __tmio_mmc_card_detect_irq(host, ireg, status);
-+
-+ return IRQ_HANDLED;
-+}
-+EXPORT_SYMBOL(tmio_mmc_card_detect_irq);
-+
-+static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host,
-+ int ireg, int status)
-+{
- /* Command completion */
- if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
- tmio_mmc_ack_mmc_irqs(host,
- TMIO_STAT_CMDRESPEND |
- TMIO_STAT_CMDTIMEOUT);
- tmio_mmc_cmd_irq(host, status);
-- goto out;
-+ return true;
- }
-
- /* Data transfer */
- if (ireg & (TMIO_STAT_RXRDY | TMIO_STAT_TXRQ)) {
- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_RXRDY | TMIO_STAT_TXRQ);
- tmio_mmc_pio_irq(host);
-- goto out;
-+ return true;
- }
-
- /* Data transfer completion */
- if (ireg & TMIO_STAT_DATAEND) {
- tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_DATAEND);
- tmio_mmc_data_irq(host);
-- goto out;
-+ return true;
- }
-
-- pr_warning("tmio_mmc: Spurious irq, disabling! "
-- "0x%08x 0x%08x 0x%08x\n", status, host->sdcard_irq_mask, ireg);
-- pr_debug_status(status);
-- tmio_mmc_disable_mmc_irqs(host, status & ~host->sdcard_irq_mask);
-+ return false;
-+}
-+
-+irqreturn_t tmio_mmc_sdcard_irq(int irq, void *devid)
-+{
-+ unsigned int ireg, status;
-+ struct tmio_mmc_host *host = devid;
-+
-+ tmio_mmc_card_irq_status(host, &ireg, &status);
-+ __tmio_mmc_sdcard_irq(host, ireg, status);
-+
-+ return IRQ_HANDLED;
-+}
-+EXPORT_SYMBOL(tmio_mmc_sdcard_irq);
-+
-+irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
-+{
-+ struct tmio_mmc_host *host = devid;
-+ struct mmc_host *mmc = host->mmc;
-+ struct tmio_mmc_data *pdata = host->pdata;
-+ unsigned int ireg, status;
-+
-+ if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
-+ return IRQ_HANDLED;
-+
-+ status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
-+ ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
-+
-+ sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
-+
-+ if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
-+ mmc_signal_sdio_irq(mmc);
-+
-+ return IRQ_HANDLED;
-+}
-+EXPORT_SYMBOL(tmio_mmc_sdio_irq);
-+
-+irqreturn_t tmio_mmc_irq(int irq, void *devid)
-+{
-+ struct tmio_mmc_host *host = devid;
-+ unsigned int ireg, status;
-+
-+ pr_debug("MMC IRQ begin\n");
-+
-+ tmio_mmc_card_irq_status(host, &ireg, &status);
-+ if (__tmio_mmc_card_detect_irq(host, ireg, status))
-+ return IRQ_HANDLED;
-+ if (__tmio_mmc_sdcard_irq(host, ireg, status))
-+ return IRQ_HANDLED;
-+
-+ tmio_mmc_sdio_irq(irq, devid);
-
--out:
- return IRQ_HANDLED;
- }
- EXPORT_SYMBOL(tmio_mmc_irq);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0034-serial8250-em-Emma-Mobile-UART-driver-V2.patch b/patches.kzm9g/0034-serial8250-em-Emma-Mobile-UART-driver-V2.patch
deleted file mode 100644
index d20eea6d874744..00000000000000
--- a/patches.kzm9g/0034-serial8250-em-Emma-Mobile-UART-driver-V2.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-From 851dd6ac01a254a7c6e14a75c0cd0c8aec2d542b Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 3 May 2012 21:13:09 +0900
-Subject: serial8250-em: Emma Mobile UART driver V2
-
-This is V2 of the Emma Mobile 8250 platform driver.
-
-The hardware itself has according to the data sheet
-up to 64 byte FIFOs but at this point we only make
-use of the 16550 compatible mode.
-
-To support this piece of hardware the common UART
-registers need to be remapped, and the access size
-differences need to be handled.
-
-The DLL and DLM registers can due to offset collision
-not be remapped easily, and because of that this
-driver makes use of ->dl_read() and ->dl_write()
-callbacks. This in turn requires a registration
-function that takes 8250-specific paramenters.
-
-Future potential enhancements include DT support,
-early platform driver console and fine grained PM.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Acked-by: Alan Cox <alan@linux.intel.com>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 22886ee96895b7a9f9d06da4dc9420b61b4ef1f7)
-
-Conflicts:
- drivers/tty/serial/8250/Kconfig
- drivers/tty/serial/8250/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250_em.c | 178 +++++++++++++++++++++++++++++++++++++
- drivers/tty/serial/8250/Kconfig | 8 ++
- drivers/tty/serial/8250/Makefile | 1 +
- 3 files changed, 187 insertions(+)
- create mode 100644 drivers/tty/serial/8250/8250_em.c
-
-diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
-new file mode 100644
-index 0000000..ff42542
---- /dev/null
-+++ b/drivers/tty/serial/8250/8250_em.c
-@@ -0,0 +1,178 @@
-+/*
-+ * Renesas Emma Mobile 8250 driver
-+ *
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+
-+#include <linux/device.h>
-+#include <linux/init.h>
-+#include <linux/io.h>
-+#include <linux/module.h>
-+#include <linux/serial_8250.h>
-+#include <linux/serial_core.h>
-+#include <linux/serial_reg.h>
-+#include <linux/platform_device.h>
-+#include <linux/clk.h>
-+#include <linux/slab.h>
-+
-+#include "8250.h"
-+
-+#define UART_DLL_EM 9
-+#define UART_DLM_EM 10
-+
-+struct serial8250_em_priv {
-+ struct clk *sclk;
-+ int line;
-+};
-+
-+static void serial8250_em_serial_out(struct uart_port *p, int offset, int value)
-+{
-+ switch (offset) {
-+ case UART_TX: /* TX @ 0x00 */
-+ writeb(value, p->membase);
-+ break;
-+ case UART_FCR: /* FCR @ 0x0c (+1) */
-+ case UART_LCR: /* LCR @ 0x10 (+1) */
-+ case UART_MCR: /* MCR @ 0x14 (+1) */
-+ case UART_SCR: /* SCR @ 0x20 (+1) */
-+ writel(value, p->membase + ((offset + 1) << 2));
-+ break;
-+ case UART_IER: /* IER @ 0x04 */
-+ value &= 0x0f; /* only 4 valid bits - not Xscale */
-+ /* fall-through */
-+ case UART_DLL_EM: /* DLL @ 0x24 (+9) */
-+ case UART_DLM_EM: /* DLM @ 0x28 (+9) */
-+ writel(value, p->membase + (offset << 2));
-+ }
-+}
-+
-+static unsigned int serial8250_em_serial_in(struct uart_port *p, int offset)
-+{
-+ switch (offset) {
-+ case UART_RX: /* RX @ 0x00 */
-+ return readb(p->membase);
-+ case UART_MCR: /* MCR @ 0x14 (+1) */
-+ case UART_LSR: /* LSR @ 0x18 (+1) */
-+ case UART_MSR: /* MSR @ 0x1c (+1) */
-+ case UART_SCR: /* SCR @ 0x20 (+1) */
-+ return readl(p->membase + ((offset + 1) << 2));
-+ case UART_IER: /* IER @ 0x04 */
-+ case UART_IIR: /* IIR @ 0x08 */
-+ case UART_DLL_EM: /* DLL @ 0x24 (+9) */
-+ case UART_DLM_EM: /* DLM @ 0x28 (+9) */
-+ return readl(p->membase + (offset << 2));
-+ }
-+ return 0;
-+}
-+
-+static int serial8250_em_serial_dl_read(struct uart_8250_port *up)
-+{
-+ return serial_in(up, UART_DLL_EM) | serial_in(up, UART_DLM_EM) << 8;
-+}
-+
-+static void serial8250_em_serial_dl_write(struct uart_8250_port *up, int value)
-+{
-+ serial_out(up, UART_DLL_EM, value & 0xff);
-+ serial_out(up, UART_DLM_EM, value >> 8 & 0xff);
-+}
-+
-+static int __devinit serial8250_em_probe(struct platform_device *pdev)
-+{
-+ struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-+ struct serial8250_em_priv *priv;
-+ struct uart_8250_port up;
-+ int ret = -EINVAL;
-+
-+ if (!regs || !irq) {
-+ dev_err(&pdev->dev, "missing registers or irq\n");
-+ goto err0;
-+ }
-+
-+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-+ if (!priv) {
-+ dev_err(&pdev->dev, "unable to allocate private data\n");
-+ ret = -ENOMEM;
-+ goto err0;
-+ }
-+
-+ priv->sclk = clk_get(&pdev->dev, "sclk");
-+ if (!priv->sclk) {
-+ dev_err(&pdev->dev, "unable to get clock\n");
-+ goto err1;
-+ }
-+
-+ memset(&up, 0, sizeof(up));
-+ up.port.mapbase = regs->start;
-+ up.port.irq = irq->start;
-+ up.port.type = PORT_UNKNOWN;
-+ up.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP;
-+ up.port.dev = &pdev->dev;
-+ up.port.private_data = priv;
-+
-+ clk_enable(priv->sclk);
-+ up.port.uartclk = clk_get_rate(priv->sclk);
-+
-+ up.port.iotype = UPIO_MEM32;
-+ up.port.serial_in = serial8250_em_serial_in;
-+ up.port.serial_out = serial8250_em_serial_out;
-+ up.dl_read = serial8250_em_serial_dl_read;
-+ up.dl_write = serial8250_em_serial_dl_write;
-+
-+ ret = serial8250_register_8250_port(&up);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "unable to register 8250 port\n");
-+ goto err2;
-+ }
-+
-+ priv->line = ret;
-+ platform_set_drvdata(pdev, priv);
-+ return 0;
-+
-+ err2:
-+ clk_disable(priv->sclk);
-+ clk_put(priv->sclk);
-+ err1:
-+ kfree(priv);
-+ err0:
-+ return ret;
-+}
-+
-+static int __devexit serial8250_em_remove(struct platform_device *pdev)
-+{
-+ struct serial8250_em_priv *priv = platform_get_drvdata(pdev);
-+
-+ serial8250_unregister_port(priv->line);
-+ clk_disable(priv->sclk);
-+ clk_put(priv->sclk);
-+ kfree(priv);
-+ return 0;
-+}
-+
-+static struct platform_driver serial8250_em_platform_driver = {
-+ .driver = {
-+ .name = "serial8250-em",
-+ .owner = THIS_MODULE,
-+ },
-+ .probe = serial8250_em_probe,
-+ .remove = __devexit_p(serial8250_em_remove),
-+};
-+
-+module_platform_driver(serial8250_em_platform_driver);
-+
-+MODULE_AUTHOR("Magnus Damm");
-+MODULE_DESCRIPTION("Renesas Emma Mobile 8250 Driver");
-+MODULE_LICENSE("GPL v2");
-diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
-index b1bb251..7aa3b6c 100644
---- a/drivers/tty/serial/8250/Kconfig
-+++ b/drivers/tty/serial/8250/Kconfig
-@@ -266,3 +266,11 @@ config SERIAL_8250_RM9K
- Selecting this option will add support for the integrated serial
- port hardware found on MIPS RM9122 and similar processors.
- If unsure, say N.
-+
-+config SERIAL_8250_EM
-+ tristate "Support for Emma Mobile intergrated serial port"
-+ depends on SERIAL_8250 && ARM && HAVE_CLK
-+ help
-+ Selecting this option will add support for the integrated serial
-+ port hardware found on the Emma Mobile line of processors.
-+ If unsure, say N.
-diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
-index c0d0c29..6a70704 100644
---- a/drivers/tty/serial/8250/Makefile
-+++ b/drivers/tty/serial/8250/Makefile
-@@ -16,3 +16,4 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
- obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
- obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
- obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
-+obj-$(CONFIG_SERIAL_8250_EM) += 8250_em.o
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0035-mmc-sdhi-Allow-named-IRQs-to-use-specific-handlers.patch b/patches.kzm9g/0035-mmc-sdhi-Allow-named-IRQs-to-use-specific-handlers.patch
deleted file mode 100644
index 44d188ce33d7ea..00000000000000
--- a/patches.kzm9g/0035-mmc-sdhi-Allow-named-IRQs-to-use-specific-handlers.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-From 0f69bae0394ca010c38bb88a66b8a9a480f5f3ea Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 26 Aug 2011 10:42:39 +0200
-Subject: mmc: sdhi: Allow named IRQs to use specific handlers
-
-Allow named IRQs to use corresponding specific handlers. If named IRQs are
-used, at least an "sdcard" IRQ has to be specified by the platform. If
-names are not used, an arbitrary number of IRQs can be provided by the
-platform, in which case the generic ISR will be used for each of them.
-
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Magnus Damm <magnus.damm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-[g.liakhovetski@gmx.de: style and typo corrections, platform data check]
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit d5098cb63b3f13da2a2b230b3566ac7b5dfa4f28)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 98 ++++++++++++++++++++++++++++----------
- include/linux/mmc/sh_mobile_sdhi.h | 4 ++
- 2 files changed, 77 insertions(+), 25 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 0c4a672..75bffc4 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -96,7 +96,8 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
- struct tmio_mmc_host *host;
- char clk_name[8];
-- int i, irq, ret;
-+ int irq, ret, i = 0;
-+ bool multiplexed_isr = true;
-
- priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
- if (priv == NULL) {
-@@ -153,27 +154,60 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- if (ret < 0)
- goto eprobe;
-
-- for (i = 0; i < 3; i++) {
-- irq = platform_get_irq(pdev, i);
-- if (irq < 0) {
-- if (i) {
-- continue;
-- } else {
-- ret = irq;
-- goto eirq;
-- }
-- }
-- ret = request_irq(irq, tmio_mmc_irq, 0,
-+ /*
-+ * Allow one or more specific (named) ISRs or
-+ * one or more multiplexed (un-named) ISRs.
-+ */
-+
-+ irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
-+ if (irq >= 0) {
-+ multiplexed_isr = false;
-+ ret = request_irq(irq, tmio_mmc_card_detect_irq, 0,
-+ dev_name(&pdev->dev), host);
-+ if (ret)
-+ goto eirq_card_detect;
-+ }
-+
-+ irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
-+ if (irq >= 0) {
-+ multiplexed_isr = false;
-+ ret = request_irq(irq, tmio_mmc_sdio_irq, 0,
-+ dev_name(&pdev->dev), host);
-+ if (ret)
-+ goto eirq_sdio;
-+ }
-+
-+ irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
-+ if (irq >= 0) {
-+ multiplexed_isr = false;
-+ ret = request_irq(irq, tmio_mmc_sdcard_irq, 0,
- dev_name(&pdev->dev), host);
-- if (ret) {
-- while (i--) {
-- irq = platform_get_irq(pdev, i);
-- if (irq >= 0)
-- free_irq(irq, host);
-- }
-- goto eirq;
-+ if (ret)
-+ goto eirq_sdcard;
-+ } else if (!multiplexed_isr) {
-+ dev_err(&pdev->dev,
-+ "Principal SD-card IRQ is missing among named interrupts\n");
-+ ret = irq;
-+ goto eirq_sdcard;
-+ }
-+
-+ if (multiplexed_isr) {
-+ while (1) {
-+ irq = platform_get_irq(pdev, i);
-+ if (irq < 0)
-+ break;
-+ i++;
-+ ret = request_irq(irq, tmio_mmc_irq, 0,
-+ dev_name(&pdev->dev), host);
-+ if (ret)
-+ goto eirq_multiplexed;
- }
-+
-+ /* There must be at least one IRQ source */
-+ if (!i)
-+ goto eirq_multiplexed;
- }
-+
- dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n",
- mmc_hostname(host->mmc), (unsigned long)
- (platform_get_resource(pdev,IORESOURCE_MEM, 0)->start),
-@@ -181,7 +215,20 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
-
- return ret;
-
--eirq:
-+eirq_multiplexed:
-+ while (i--) {
-+ irq = platform_get_irq(pdev, i);
-+ free_irq(irq, host);
-+ }
-+eirq_sdcard:
-+ irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
-+ if (irq >= 0)
-+ free_irq(irq, host);
-+eirq_sdio:
-+ irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
-+ if (irq >= 0)
-+ free_irq(irq, host);
-+eirq_card_detect:
- tmio_mmc_host_remove(host);
- eprobe:
- clk_disable(priv->clk);
-@@ -197,16 +244,17 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
- struct tmio_mmc_host *host = mmc_priv(mmc);
- struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
- struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
-- int i, irq;
-+ int i = 0, irq;
-
- p->pdata = NULL;
-
- tmio_mmc_host_remove(host);
-
-- for (i = 0; i < 3; i++) {
-- irq = platform_get_irq(pdev, i);
-- if (irq >= 0)
-- free_irq(irq, host);
-+ while (1) {
-+ irq = platform_get_irq(pdev, i++);
-+ if (irq < 0)
-+ break;
-+ free_irq(irq, host);
- }
-
- clk_disable(priv->clk);
-diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
-index bd50b36..71b8054 100644
---- a/include/linux/mmc/sh_mobile_sdhi.h
-+++ b/include/linux/mmc/sh_mobile_sdhi.h
-@@ -6,6 +6,10 @@
- struct platform_device;
- struct tmio_mmc_data;
-
-+#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
-+#define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard"
-+#define SH_MOBILE_SDHI_IRQ_SDIO "sdio"
-+
- struct sh_mobile_sdhi_info {
- int dma_slave_tx;
- int dma_slave_rx;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0035-serial8250-em-clk_get-IS_ERR-error-handling-fix.patch b/patches.kzm9g/0035-serial8250-em-clk_get-IS_ERR-error-handling-fix.patch
deleted file mode 100644
index f0dbf2bf2bd6ed..00000000000000
--- a/patches.kzm9g/0035-serial8250-em-clk_get-IS_ERR-error-handling-fix.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 7ff1614653a079059c1d017d4d95376a616649ab Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 9 May 2012 15:49:57 +0900
-Subject: serial8250-em: clk_get() IS_ERR() error handling fix
-
-Update the 8250_em driver to correctly handle the case
-where no clock is associated with the device.
-
-The return value of clk_get() needs to be checked with
-IS_ERR() to avoid NULL pointer referencing.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-(cherry picked from commit 94e792ab66d696aad2e52c91bae4cfbeefe4c9f6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/serial/8250/8250_em.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
-index ff42542..be6c289 100644
---- a/drivers/tty/serial/8250/8250_em.c
-+++ b/drivers/tty/serial/8250/8250_em.c
-@@ -110,8 +110,9 @@ static int __devinit serial8250_em_probe(struct platform_device *pdev)
- }
-
- priv->sclk = clk_get(&pdev->dev, "sclk");
-- if (!priv->sclk) {
-+ if (IS_ERR(priv->sclk)) {
- dev_err(&pdev->dev, "unable to get clock\n");
-+ ret = PTR_ERR(priv->sclk);
- goto err1;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0036-cpuidle-create-bootparam-cpuidle.off-1.patch b/patches.kzm9g/0036-cpuidle-create-bootparam-cpuidle.off-1.patch
deleted file mode 100644
index d0cef7b7014acd..00000000000000
--- a/patches.kzm9g/0036-cpuidle-create-bootparam-cpuidle.off-1.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 9c84f8943b8bb242d3eab46ab23bc6daeaa7a02f Mon Sep 17 00:00:00 2001
-From: Len Brown <len.brown@intel.com>
-Date: Fri, 1 Apr 2011 18:13:10 -0400
-Subject: cpuidle: create bootparam "cpuidle.off=1"
-
-useful for disabling cpuidle to fall back
-to architecture-default idle loop
-
-cpuidle drivers and governors will fail to register.
-on x86 they'll say so:
-
-intel_idle: intel_idle yielding to (null)
-ACPI: acpi_idle yielding to (null)
-
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit 62027aea23fcd14478abdddd3b74a4e0f5fb2984)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/kernel-parameters.txt | 3 +++
- drivers/cpuidle/cpuidle.c | 10 ++++++++++
- drivers/cpuidle/cpuidle.h | 1 +
- drivers/cpuidle/driver.c | 3 +++
- drivers/cpuidle/governor.c | 3 +++
- 5 files changed, 20 insertions(+)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 400b7be..79cef3c 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -546,6 +546,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- /proc/<pid>/coredump_filter.
- See also Documentation/filesystems/proc.txt.
-
-+ cpuidle.off=1 [CPU_IDLE]
-+ disable the cpuidle sub-system
-+
- cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
- Format:
- <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index eed4c47..4487396 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -28,6 +28,12 @@ LIST_HEAD(cpuidle_detected_devices);
- static void (*pm_idle_old)(void);
-
- static int enabled_devices;
-+static int off __read_mostly;
-+
-+int cpuidle_disabled(void)
-+{
-+ return off;
-+}
-
- #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT)
- static void cpuidle_kick_cpus(void)
-@@ -427,6 +433,9 @@ static int __init cpuidle_init(void)
- {
- int ret;
-
-+ if (cpuidle_disabled())
-+ return -ENODEV;
-+
- pm_idle_old = pm_idle;
-
- ret = cpuidle_add_class_sysfs(&cpu_sysdev_class);
-@@ -438,4 +447,5 @@ static int __init cpuidle_init(void)
- return 0;
- }
-
-+module_param(off, int, 0444);
- core_initcall(cpuidle_init);
-diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h
-index 33e50d5..38c3fd8 100644
---- a/drivers/cpuidle/cpuidle.h
-+++ b/drivers/cpuidle/cpuidle.h
-@@ -13,6 +13,7 @@ extern struct list_head cpuidle_governors;
- extern struct list_head cpuidle_detected_devices;
- extern struct mutex cpuidle_lock;
- extern spinlock_t cpuidle_driver_lock;
-+extern int cpuidle_disabled(void);
-
- /* idle loop */
- extern void cpuidle_install_idle_handler(void);
-diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
-index fd1601e..3f7e3ce 100644
---- a/drivers/cpuidle/driver.c
-+++ b/drivers/cpuidle/driver.c
-@@ -26,6 +26,9 @@ int cpuidle_register_driver(struct cpuidle_driver *drv)
- if (!drv)
- return -EINVAL;
-
-+ if (cpuidle_disabled())
-+ return -ENODEV;
-+
- spin_lock(&cpuidle_driver_lock);
- if (cpuidle_curr_driver) {
- spin_unlock(&cpuidle_driver_lock);
-diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
-index 724c164..ea2f8e7 100644
---- a/drivers/cpuidle/governor.c
-+++ b/drivers/cpuidle/governor.c
-@@ -81,6 +81,9 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
- if (!gov || !gov->select)
- return -EINVAL;
-
-+ if (cpuidle_disabled())
-+ return -ENODEV;
-+
- mutex_lock(&cpuidle_lock);
- if (__cpuidle_find_governor(gov->name) == NULL) {
- ret = 0;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0036-mmc-irq-Remove-IRQF_DISABLED.patch b/patches.kzm9g/0036-mmc-irq-Remove-IRQF_DISABLED.patch
deleted file mode 100644
index be5d23aac991d4..00000000000000
--- a/patches.kzm9g/0036-mmc-irq-Remove-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 659def1c9d9094e00aef310907f2859663a850c8 Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Thu, 22 Sep 2011 16:59:04 +0800
-Subject: mmc: irq: Remove IRQF_DISABLED
-
-Since commit [e58aa3d2: genirq: Run irq handlers with interrupts
-disabled], we run all interrupt handlers with interrupts disabled
-and we even check and yell when an interrupt handler returns with
-interrupts enabled (see commit [b738a50a: genirq: Warn when handler
-enables interrupts]).
-
-So now this flag is a NOOP and can be removed.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit d9618e9f1a057efdfc52514d6cd7af56e9bddc17)
-
-Conflicts:
-
- drivers/mmc/host/omap_hsmmc.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
-index 44a9668..a4ea102 100644
---- a/drivers/mmc/host/tmio_mmc.c
-+++ b/drivers/mmc/host/tmio_mmc.c
-@@ -88,8 +88,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *pdev)
- if (ret)
- goto cell_disable;
-
-- ret = request_irq(irq, tmio_mmc_irq, IRQF_DISABLED |
-- IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), host);
-+ ret = request_irq(irq, tmio_mmc_irq, IRQF_TRIGGER_FALLING,
-+ dev_name(&pdev->dev), host);
- if (ret)
- goto host_remove;
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0037-cpuidle-replace-xen-access-to-x86-pm_idle-and-defaul.patch b/patches.kzm9g/0037-cpuidle-replace-xen-access-to-x86-pm_idle-and-defaul.patch
deleted file mode 100644
index 3ae71b0e25c0c6..00000000000000
--- a/patches.kzm9g/0037-cpuidle-replace-xen-access-to-x86-pm_idle-and-defaul.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 761a5d96c87fccab8a53f8c8c3240d8dcdb1bb19 Mon Sep 17 00:00:00 2001
-From: Len Brown <len.brown@intel.com>
-Date: Fri, 1 Apr 2011 18:28:35 -0400
-Subject: cpuidle: replace xen access to x86 pm_idle and default_idle
-
-When a Xen Dom0 kernel boots on a hypervisor, it gets access
-to the raw-hardware ACPI tables. While it parses the idle tables
-for the hypervisor's beneift, it uses HLT for its own idle.
-
-Rather than have xen scribble on pm_idle and access default_idle,
-have it simply disable_cpuidle() so acpi_idle will not load and
-architecture default HLT will be used.
-
-cc: xen-devel@lists.xensource.com
-Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-Acked-by: H. Peter Anvin <hpa@linux.intel.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit d91ee5863b71e8c90eaf6035bff3078a85e2e7b5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/x86/xen/setup.c | 3 ++-
- drivers/cpuidle/cpuidle.c | 4 ++++
- include/linux/cpuidle.h | 2 ++
- 3 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
-index f8dcda4..e16a4ca 100644
---- a/arch/x86/xen/setup.c
-+++ b/arch/x86/xen/setup.c
-@@ -9,6 +9,7 @@
- #include <linux/mm.h>
- #include <linux/pm.h>
- #include <linux/memblock.h>
-+#include <linux/cpuidle.h>
-
- #include <asm/elf.h>
- #include <asm/vdso.h>
-@@ -459,7 +460,7 @@ void __init xen_arch_setup(void)
- #ifdef CONFIG_X86_32
- boot_cpu_data.hlt_works_ok = 1;
- #endif
-- pm_idle = default_idle;
-+ disable_cpuidle();
- boot_option_idle_override = IDLE_HALT;
-
- fiddle_vdso();
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index 4487396..cd1c19c 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -34,6 +34,10 @@ int cpuidle_disabled(void)
- {
- return off;
- }
-+void disable_cpuidle(void)
-+{
-+ off = 1;
-+}
-
- #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT)
- static void cpuidle_kick_cpus(void)
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index 36719ea..b89f67d 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -122,6 +122,7 @@ struct cpuidle_driver {
- };
-
- #ifdef CONFIG_CPU_IDLE
-+extern void disable_cpuidle(void);
-
- extern int cpuidle_register_driver(struct cpuidle_driver *drv);
- struct cpuidle_driver *cpuidle_get_driver(void);
-@@ -135,6 +136,7 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev);
- extern void cpuidle_disable_device(struct cpuidle_device *dev);
-
- #else
-+static inline void disable_cpuidle(void) { }
-
- static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
- {return -ENODEV; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0037-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch b/patches.kzm9g/0037-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
deleted file mode 100644
index b3cae7b2e76dd6..00000000000000
--- a/patches.kzm9g/0037-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b19f896d27c56c6fdf613e245c7cd8963cac5c05 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 3 Jul 2011 15:15:51 -0400
-Subject: mmc: Add module.h to drivers/mmc users assuming implicit presence.
-
-We are cleaning up the implicit presence of module.h; these guys are
-some of the people who just assume it will be there. Call it out
-explitly for those that really need it.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 88b47679746b81534002bcba42da97ab82b5d12a)
-
-Cherry picked changes for:
- drivers/mmc/host/sh_mobile_sdhi.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 75bffc4..41ae646 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -21,6 +21,7 @@
- #include <linux/kernel.h>
- #include <linux/clk.h>
- #include <linux/slab.h>
-+#include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/mmc/host.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0038-cpuidle-stop-depending-on-pm_idle.patch b/patches.kzm9g/0038-cpuidle-stop-depending-on-pm_idle.patch
deleted file mode 100644
index 276df0975f753b..00000000000000
--- a/patches.kzm9g/0038-cpuidle-stop-depending-on-pm_idle.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-From be5500b643f8d3d104e64d9096a5c8d86afadd92 Mon Sep 17 00:00:00 2001
-From: Len Brown <len.brown@intel.com>
-Date: Fri, 1 Apr 2011 19:34:59 -0400
-Subject: cpuidle: stop depending on pm_idle
-
-cpuidle users should call cpuidle_call_idle() directly
-rather than via (pm_idle)() function pointer.
-
-Architecture may choose to continue using (pm_idle)(),
-but cpuidle need not depend on it:
-
- my_arch_cpu_idle()
- ...
- if(cpuidle_call_idle())
- pm_idle();
-
-cc: Kevin Hilman <khilman@deeprootsystems.com>
-cc: Paul Mundt <lethal@linux-sh.org>
-cc: x86@kernel.org
-Acked-by: H. Peter Anvin <hpa@linux.intel.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit a0bfa1373859e9d11dc92561a8667588803e42d8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/kernel/process.c | 4 +++-
- arch/sh/kernel/idle.c | 6 ++++--
- arch/x86/kernel/process_32.c | 4 +++-
- arch/x86/kernel/process_64.c | 4 +++-
- drivers/cpuidle/cpuidle.c | 38 ++++++++++++++++++--------------------
- include/linux/cpuidle.h | 2 ++
- 6 files changed, 33 insertions(+), 25 deletions(-)
-
-diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 74ae833..5affc61 100644
---- a/arch/arm/kernel/process.c
-+++ b/arch/arm/kernel/process.c
-@@ -30,6 +30,7 @@
- #include <linux/uaccess.h>
- #include <linux/random.h>
- #include <linux/hw_breakpoint.h>
-+#include <linux/cpuidle.h>
-
- #include <asm/cacheflush.h>
- #include <asm/leds.h>
-@@ -199,7 +200,8 @@ void cpu_idle(void)
- cpu_relax();
- } else {
- stop_critical_timings();
-- pm_idle();
-+ if (cpuidle_call_idle())
-+ pm_idle();
- start_critical_timings();
- /*
- * This will eventually be removed - pm_idle
-diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
-index 425d604..9c7099e 100644
---- a/arch/sh/kernel/idle.c
-+++ b/arch/sh/kernel/idle.c
-@@ -16,12 +16,13 @@
- #include <linux/thread_info.h>
- #include <linux/irqflags.h>
- #include <linux/smp.h>
-+#include <linux/cpuidle.h>
- #include <asm/pgalloc.h>
- #include <asm/system.h>
- #include <asm/atomic.h>
- #include <asm/smp.h>
-
--void (*pm_idle)(void) = NULL;
-+static void (*pm_idle)(void);
-
- static int hlt_counter;
-
-@@ -100,7 +101,8 @@ void cpu_idle(void)
- local_irq_disable();
- /* Don't trace irqs off for idle */
- stop_critical_timings();
-- pm_idle();
-+ if (cpuidle_call_idle())
-+ pm_idle();
- /*
- * Sanity check to ensure that pm_idle() returns
- * with IRQs enabled
-diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
-index fcdb1b3..ca71e9a 100644
---- a/arch/x86/kernel/process_32.c
-+++ b/arch/x86/kernel/process_32.c
-@@ -38,6 +38,7 @@
- #include <linux/uaccess.h>
- #include <linux/io.h>
- #include <linux/kdebug.h>
-+#include <linux/cpuidle.h>
-
- #include <asm/pgtable.h>
- #include <asm/system.h>
-@@ -109,7 +110,8 @@ void cpu_idle(void)
- local_irq_disable();
- /* Don't trace irqs off for idle */
- stop_critical_timings();
-- pm_idle();
-+ if (cpuidle_idle_call())
-+ pm_idle();
- start_critical_timings();
- }
- tick_nohz_restart_sched_tick();
-diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
-index b01898d..ca8df6a 100644
---- a/arch/x86/kernel/process_64.c
-+++ b/arch/x86/kernel/process_64.c
-@@ -37,6 +37,7 @@
- #include <linux/uaccess.h>
- #include <linux/io.h>
- #include <linux/ftrace.h>
-+#include <linux/cpuidle.h>
-
- #include <asm/pgtable.h>
- #include <asm/system.h>
-@@ -136,7 +137,8 @@ void cpu_idle(void)
- enter_idle();
- /* Don't trace irqs off for idle */
- stop_critical_timings();
-- pm_idle();
-+ if (cpuidle_idle_call())
-+ pm_idle();
- start_critical_timings();
-
- /* In many cases the interrupt that ended idle
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index cd1c19c..0df0141 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -25,10 +25,10 @@ DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
-
- DEFINE_MUTEX(cpuidle_lock);
- LIST_HEAD(cpuidle_detected_devices);
--static void (*pm_idle_old)(void);
-
- static int enabled_devices;
- static int off __read_mostly;
-+static int initialized __read_mostly;
-
- int cpuidle_disabled(void)
- {
-@@ -56,25 +56,23 @@ static int __cpuidle_register_device(struct cpuidle_device *dev);
- * cpuidle_idle_call - the main idle loop
- *
- * NOTE: no locks or semaphores should be used here
-+ * return non-zero on failure
- */
--static void cpuidle_idle_call(void)
-+int cpuidle_idle_call(void)
- {
- struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
- struct cpuidle_state *target_state;
- int next_state;
-
-+ if (off)
-+ return -ENODEV;
-+
-+ if (!initialized)
-+ return -ENODEV;
-+
- /* check if the device is ready */
-- if (!dev || !dev->enabled) {
-- if (pm_idle_old)
-- pm_idle_old();
-- else
--#if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE)
-- default_idle();
--#else
-- local_irq_enable();
--#endif
-- return;
-- }
-+ if (!dev || !dev->enabled)
-+ return -EBUSY;
-
- #if 0
- /* shows regressions, re-enable for 2.6.29 */
-@@ -99,7 +97,7 @@ static void cpuidle_idle_call(void)
- next_state = cpuidle_curr_governor->select(dev);
- if (need_resched()) {
- local_irq_enable();
-- return;
-+ return 0;
- }
-
- target_state = &dev->states[next_state];
-@@ -124,6 +122,8 @@ static void cpuidle_idle_call(void)
- /* give the governor an opportunity to reflect on the outcome */
- if (cpuidle_curr_governor->reflect)
- cpuidle_curr_governor->reflect(dev);
-+
-+ return 0;
- }
-
- /**
-@@ -131,10 +131,10 @@ static void cpuidle_idle_call(void)
- */
- void cpuidle_install_idle_handler(void)
- {
-- if (enabled_devices && (pm_idle != cpuidle_idle_call)) {
-+ if (enabled_devices) {
- /* Make sure all changes finished before we switch to new idle */
- smp_wmb();
-- pm_idle = cpuidle_idle_call;
-+ initialized = 1;
- }
- }
-
-@@ -143,8 +143,8 @@ void cpuidle_install_idle_handler(void)
- */
- void cpuidle_uninstall_idle_handler(void)
- {
-- if (enabled_devices && pm_idle_old && (pm_idle != pm_idle_old)) {
-- pm_idle = pm_idle_old;
-+ if (enabled_devices) {
-+ initialized = 0;
- cpuidle_kick_cpus();
- }
- }
-@@ -440,8 +440,6 @@ static int __init cpuidle_init(void)
- if (cpuidle_disabled())
- return -ENODEV;
-
-- pm_idle_old = pm_idle;
--
- ret = cpuidle_add_class_sysfs(&cpu_sysdev_class);
- if (ret)
- return ret;
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index b89f67d..b51629e 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -123,6 +123,7 @@ struct cpuidle_driver {
-
- #ifdef CONFIG_CPU_IDLE
- extern void disable_cpuidle(void);
-+extern int cpuidle_idle_call(void);
-
- extern int cpuidle_register_driver(struct cpuidle_driver *drv);
- struct cpuidle_driver *cpuidle_get_driver(void);
-@@ -137,6 +138,7 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev);
-
- #else
- static inline void disable_cpuidle(void) { }
-+static inline int cpuidle_idle_call(void) { return -ENODEV; }
-
- static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
- {return -ENODEV; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0038-mmc-replace-printk-with-appropriate-display-macro.patch b/patches.kzm9g/0038-mmc-replace-printk-with-appropriate-display-macro.patch
deleted file mode 100644
index d31b0098cfaeeb..00000000000000
--- a/patches.kzm9g/0038-mmc-replace-printk-with-appropriate-display-macro.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From f1b038d466d3385553728a07eb252ea400847af6 Mon Sep 17 00:00:00 2001
-From: Girish K S <girish.shivananjappa@linaro.org>
-Date: Tue, 11 Oct 2011 11:44:09 +0530
-Subject: mmc: replace printk with appropriate display macro
-
-All the files using printk function for displaying kernel messages
-in the mmc driver have been replaced with corresponding macro.
-
-Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit a3c76eb9d4a1e68a69dd880cf0bcb8a52418b993)
-
-Cherry-picked changes for:
- drivers/mmc/host/tmio_mmc_pio.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 6275e3d..d85a60c 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -92,7 +92,7 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
- static void pr_debug_status(u32 status)
- {
- int i = 0;
-- printk(KERN_DEBUG "status: %08x = ", status);
-+ pr_debug("status: %08x = ", status);
- STATUS_TO_TEXT(CARD_REMOVE, status, i);
- STATUS_TO_TEXT(CARD_INSERT, status, i);
- STATUS_TO_TEXT(SIGSTATE, status, i);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0039-cpuidle-Consistent-spelling-of-cpuidle_idle_call.patch b/patches.kzm9g/0039-cpuidle-Consistent-spelling-of-cpuidle_idle_call.patch
deleted file mode 100644
index 495c66f5cd66dc..00000000000000
--- a/patches.kzm9g/0039-cpuidle-Consistent-spelling-of-cpuidle_idle_call.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 8fb27384a7f934ae0f01e86b41a8cdc22bf57ca7 Mon Sep 17 00:00:00 2001
-From: David Brown <davidb@codeaurora.org>
-Date: Thu, 4 Aug 2011 09:24:31 -0700
-Subject: cpuidle: Consistent spelling of cpuidle_idle_call()
-
-Commit a0bfa1373859e9d11dc92561a8667588803e42d8 mispells
-cpuidle_idle_call() on ARM and SH code. Fix this to be consistent.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Paul Mundt <lethal@linux-sh.org>
-Cc: x86@kernel.org
-Cc: Len Brown <len.brown@intel.com>
-Signed-off-by: David Brown <davidb@codeaurora.org>
-[ Also done by Mark Brown - th ebug has been around forever, and was
- noticed in -next, but the idle tree never picked it up. Bad bad bad ]
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit cbc158d6bfa1990f7869717bb5270867c66068d1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/kernel/process.c | 2 +-
- arch/sh/kernel/idle.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 5affc61..c9d11ea 100644
---- a/arch/arm/kernel/process.c
-+++ b/arch/arm/kernel/process.c
-@@ -200,7 +200,7 @@ void cpu_idle(void)
- cpu_relax();
- } else {
- stop_critical_timings();
-- if (cpuidle_call_idle())
-+ if (cpuidle_idle_call())
- pm_idle();
- start_critical_timings();
- /*
-diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
-index 9c7099e..1db1968 100644
---- a/arch/sh/kernel/idle.c
-+++ b/arch/sh/kernel/idle.c
-@@ -101,7 +101,7 @@ void cpu_idle(void)
- local_irq_disable();
- /* Don't trace irqs off for idle */
- stop_critical_timings();
-- if (cpuidle_call_idle())
-+ if (cpuidle_idle_call())
- pm_idle();
- /*
- * Sanity check to ensure that pm_idle() returns
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0039-mmc-tmio-fix-clock-gating-on-platforms-with-a-.set_p.patch b/patches.kzm9g/0039-mmc-tmio-fix-clock-gating-on-platforms-with-a-.set_p.patch
deleted file mode 100644
index e0f1bf06d3a7e8..00000000000000
--- a/patches.kzm9g/0039-mmc-tmio-fix-clock-gating-on-platforms-with-a-.set_p.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 998c2d6fab4e0ed0eb6f8bc58f9fdeb2f9ee9620 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 16 Nov 2011 10:11:45 +0100
-Subject: mmc: tmio: fix clock gating on platforms with a .set_pwr() method
-
-Do not power down the card in .set_ios(), unless MMC_POWER_OFF is
-requested. This fixes the SDHI functionality on ecovec.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit f6b8b52c68f6109db4be02b55660258ff503fc3b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index d85a60c..4208b39 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -798,7 +798,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- /* start bus clock */
- tmio_mmc_clk_start(host);
- } else if (ios->power_mode != MMC_POWER_UP) {
-- if (host->set_pwr)
-+ if (host->set_pwr && ios->power_mode == MMC_POWER_OFF)
- host->set_pwr(host->pdev, 0);
- if ((pdata->flags & TMIO_MMC_HAS_COLD_CD) &&
- pdata->power) {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/004-ltsi-arm-mach_shmobile-kzm9g-update-defconfig.patch b/patches.kzm9g/004-ltsi-arm-mach_shmobile-kzm9g-update-defconfig.patch
deleted file mode 100644
index 5e0b7267478066..00000000000000
--- a/patches.kzm9g/004-ltsi-arm-mach_shmobile-kzm9g-update-defconfig.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jun 26 04:12:14 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Tue, 26 Jun 2012 20:12:11 +0900
-Subject: [LTSI-dev] [PATCH 4/4] LTSI: ARM: mach_shmobile: kzm9g: update defconfig
-To: ltsi-dev@lists.linuxfoundation.org, kuninori.morimoto.gx@gmail.com
-Message-ID: <4FE9990B.7040207@kmckk.co.jp>
-
-
-Add NET_ETHERNET and HID.
-
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/configs/kzm9g_defconfig | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
-index 6fb27eb..b9b3722 100644
---- a/arch/arm/configs/kzm9g_defconfig
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -64,6 +64,9 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
- CONFIG_SCSI=y
- CONFIG_BLK_DEV_SD=y
- CONFIG_NETDEVICES=y
-+CONFIG_MII=y
-+CONFIG_PHYLIB=y
-+CONFIG_NET_ETHERNET=y
- CONFIG_SMSC911X=y
- # CONFIG_WLAN is not set
- CONFIG_INPUT_SPARSEKMAP=y
-@@ -97,7 +100,9 @@ CONFIG_SND=y
- # CONFIG_SND_USB is not set
- CONFIG_SND_SOC=y
- CONFIG_SND_SOC_SH4_FSI=y
--# CONFIG_HID_SUPPORT is not set
-+CONFIG_HID_SUPPORT=y
-+CONFIG_HID=y
-+CONFIG_USB_HID=y
- CONFIG_USB=y
- CONFIG_USB_DEVICEFS=y
- CONFIG_USB_R8A66597_HCD=y
---
-1.7.9.5
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.kzm9g/0040-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch b/patches.kzm9g/0040-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
deleted file mode 100644
index 51127b5b8c05e1..00000000000000
--- a/patches.kzm9g/0040-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 9fd478fb4b61077bb435702bcb65e79de681e1c6 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Sat, 26 Nov 2011 12:55:43 +0800
-Subject: mmc: convert drivers/mmc/host/* to use module_platform_driver()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch converts the drivers in drivers/mmc/host/* to use the
-module_platform_driver() macro which makes the code smaller and a bit
-simpler.
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Acked-by: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
-Acked-by: David Brown <davidb@codeaurora.org>
-Acked-by: Viresh Kumar <viresh.kumar@st.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
-Acked-by: Wolfram Sang <w.sang@pengutronix.de>
-Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry-picked from commit d1f81a64a4250bdd776978be06ae2b8e13ec7471)
-
-Conflicts:
-
- drivers/mmc/host/bfin_sdh.c
- drivers/mmc/host/cb710-mmc.c
- drivers/mmc/host/jz4740_mmc.c
- drivers/mmc/host/msm_sdcc.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/pxamci.c
- drivers/mmc/host/s3cmci.c
- drivers/mmc/host/sdhci-cns3xxx.c
- drivers/mmc/host/sdhci-dove.c
- drivers/mmc/host/sdhci-esdhc-imx.c
- drivers/mmc/host/sdhci-of-esdhc.c
- drivers/mmc/host/sdhci-of-hlwd.c
- drivers/mmc/host/sdhci-pxav2.c
- drivers/mmc/host/sdhci-pxav3.c
- drivers/mmc/host/sdhci-s3c.c
- drivers/mmc/host/sdhci-spear.c
- drivers/mmc/host/sdhci-tegra.c
- drivers/mmc/host/sh_mmcif.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 13 +------------
- drivers/mmc/host/tmio_mmc.c | 14 +-------------
- 2 files changed, 2 insertions(+), 25 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 41ae646..58da3c4 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -282,18 +282,7 @@ static struct platform_driver sh_mobile_sdhi_driver = {
- .remove = __devexit_p(sh_mobile_sdhi_remove),
- };
-
--static int __init sh_mobile_sdhi_init(void)
--{
-- return platform_driver_register(&sh_mobile_sdhi_driver);
--}
--
--static void __exit sh_mobile_sdhi_exit(void)
--{
-- platform_driver_unregister(&sh_mobile_sdhi_driver);
--}
--
--module_init(sh_mobile_sdhi_init);
--module_exit(sh_mobile_sdhi_exit);
-+module_platform_driver(sh_mobile_sdhi_driver);
-
- MODULE_DESCRIPTION("SuperH Mobile SDHI driver");
- MODULE_AUTHOR("Magnus Damm");
-diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
-index a4ea102..113ce6c 100644
---- a/drivers/mmc/host/tmio_mmc.c
-+++ b/drivers/mmc/host/tmio_mmc.c
-@@ -138,19 +138,7 @@ static struct platform_driver tmio_mmc_driver = {
- .resume = tmio_mmc_resume,
- };
-
--
--static int __init tmio_mmc_init(void)
--{
-- return platform_driver_register(&tmio_mmc_driver);
--}
--
--static void __exit tmio_mmc_exit(void)
--{
-- platform_driver_unregister(&tmio_mmc_driver);
--}
--
--module_init(tmio_mmc_init);
--module_exit(tmio_mmc_exit);
-+module_platform_driver(tmio_mmc_driver);
-
- MODULE_DESCRIPTION("Toshiba TMIO SD/MMC driver");
- MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0040-sh-Fix-up-fallout-from-cpuidle-changes.patch b/patches.kzm9g/0040-sh-Fix-up-fallout-from-cpuidle-changes.patch
deleted file mode 100644
index e39f543f6d5345..00000000000000
--- a/patches.kzm9g/0040-sh-Fix-up-fallout-from-cpuidle-changes.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From ff5ca09e2aa7d364357133e228c8f47ceccaa8a0 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Mon, 8 Aug 2011 16:30:11 +0900
-Subject: sh: Fix up fallout from cpuidle changes.
-
-Fixes up the pm_idle redefinition that was introduced with the earlier
-cpuidle changes.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit c66d3fcbf306af3c0c4b6f4e0d81467f89c67702)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/kernel/idle.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
-index 1db1968..169767f 100644
---- a/arch/sh/kernel/idle.c
-+++ b/arch/sh/kernel/idle.c
-@@ -22,7 +22,7 @@
- #include <asm/atomic.h>
- #include <asm/smp.h>
-
--static void (*pm_idle)(void);
-+void (*pm_idle)(void);
-
- static int hlt_counter;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0041-cpuidle-Add-module.h-to-drivers-cpuidle-files-as-req.patch b/patches.kzm9g/0041-cpuidle-Add-module.h-to-drivers-cpuidle-files-as-req.patch
deleted file mode 100644
index 4a4ecdd8a534a1..00000000000000
--- a/patches.kzm9g/0041-cpuidle-Add-module.h-to-drivers-cpuidle-files-as-req.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From e642a0935f0ebf4599766c1005b6995f79a0cfcd Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Mon, 29 Aug 2011 17:52:39 -0400
-Subject: cpuidle: Add module.h to drivers/cpuidle files as required.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 884b17e109d61e95ee4c652cf6873341bf1dca63)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/cpuidle/cpuidle.c | 1 +
- drivers/cpuidle/governors/menu.c | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index 0df0141..becd6d9 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -17,6 +17,7 @@
- #include <linux/cpuidle.h>
- #include <linux/ktime.h>
- #include <linux/hrtimer.h>
-+#include <linux/module.h>
- #include <trace/events/power.h>
-
- #include "cpuidle.h"
-diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
-index 3600f19..0027524 100644
---- a/drivers/cpuidle/governors/menu.c
-+++ b/drivers/cpuidle/governors/menu.c
-@@ -19,6 +19,7 @@
- #include <linux/tick.h>
- #include <linux/sched.h>
- #include <linux/math64.h>
-+#include <linux/module.h>
-
- #define BUCKETS 12
- #define INTERVALS 8
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0041-mmc-remove-the-second-argument-of-k-un-map_atomic.patch b/patches.kzm9g/0041-mmc-remove-the-second-argument-of-k-un-map_atomic.patch
deleted file mode 100644
index 9ac5f48f863ccc..00000000000000
--- a/patches.kzm9g/0041-mmc-remove-the-second-argument-of-k-un-map_atomic.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 5a1454200daaf7e2ed0ec2ad17e960240af1f9ee Mon Sep 17 00:00:00 2001
-From: Cong Wang <amwang@redhat.com>
-Date: Sun, 27 Nov 2011 13:27:00 +0800
-Subject: mmc: remove the second argument of k[un]map_atomic()
-
-Signed-off-by: Cong Wang <amwang@redhat.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 482fce997e143a8d5429406fe066d31aa76ef70a)
-
-Conflicts:
-
- drivers/mmc/host/at91_mci.c
- drivers/mmc/host/msm_sdcc.c
- drivers/mmc/host/sdhci.c
- drivers/mmc/host/tifm_sd.c
- drivers/mmc/host/tmio_mmc.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 3020f98..a95e6d9 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -105,13 +105,13 @@ static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
- unsigned long *flags)
- {
- local_irq_save(*flags);
-- return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
-+ return kmap_atomic(sg_page(sg)) + sg->offset;
- }
-
- static inline void tmio_mmc_kunmap_atomic(struct scatterlist *sg,
- unsigned long *flags, void *virt)
- {
-- kunmap_atomic(virt - sg->offset, KM_BIO_SRC_IRQ);
-+ kunmap_atomic(virt - sg->offset);
- local_irq_restore(*flags);
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0042-cpuidle-Move-dev-last_residency-update-to-driver-ent.patch b/patches.kzm9g/0042-cpuidle-Move-dev-last_residency-update-to-driver-ent.patch
deleted file mode 100644
index fb997a6fcea315..00000000000000
--- a/patches.kzm9g/0042-cpuidle-Move-dev-last_residency-update-to-driver-ent.patch
+++ /dev/null
@@ -1,868 +0,0 @@
-From a2bea6713199f518d94d1bcc5acbe8b7523d4b7e Mon Sep 17 00:00:00 2001
-From: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Date: Fri, 28 Oct 2011 16:20:09 +0530
-Subject: cpuidle: Move dev->last_residency update to driver enter routine;
- remove dev->last_state
-
-Cpuidle governor only suggests the state to enter using the
-governor->select() interface, but allows the low level driver to
-override the recommended state. The actual entered state
-may be different because of software or hardware demotion. Software
-demotion is done by the back-end cpuidle driver and can be accounted
-correctly. Current cpuidle code uses last_state field to capture the
-actual state entered and based on that updates the statistics for the
-state entered.
-
-Ideally the driver enter routine should update the counters,
-and it should return the state actually entered rather than the time
-spent there. The generic cpuidle code should simply handle where
-the counters live in the sysfs namespace, not updating the counters.
-
-Reference:
-https://lkml.org/lkml/2011/3/25/52
-
-Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
-Tested-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Acked-by: Arjan van de Ven <arjan@linux.intel.com>
-Acked-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit e978aa7d7d57d04eb5f88a7507c4fb98577def77)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-at91/cpuidle.c | 10 +++--
- arch/arm/mach-davinci/cpuidle.c | 9 ++--
- arch/arm/mach-exynos4/cpuidle.c | 7 +--
- arch/arm/mach-kirkwood/cpuidle.c | 12 ++++--
- arch/arm/mach-omap2/cpuidle34xx.c | 67 +++++++++++++++++------------
- arch/sh/kernel/cpu/shmobile/cpuidle.c | 12 +++---
- drivers/acpi/processor_idle.c | 75 +++++++++++++++++++++------------
- drivers/cpuidle/cpuidle.c | 32 +++++++-------
- drivers/cpuidle/governors/ladder.c | 13 ++++++
- drivers/cpuidle/governors/menu.c | 7 ++-
- drivers/idle/intel_idle.c | 12 ++++--
- include/linux/cpuidle.h | 7 ++-
- 12 files changed, 164 insertions(+), 99 deletions(-)
-
-diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
-index f474272..d76a600 100644
---- a/arch/arm/mach-at91/cpuidle.c
-+++ b/arch/arm/mach-at91/cpuidle.c
-@@ -34,7 +34,7 @@ static struct cpuidle_driver at91_idle_driver = {
-
- /* Actual code that puts the SoC in different idle states */
- static int at91_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- struct timeval before, after;
- int idle_time;
-@@ -42,10 +42,10 @@ static int at91_enter_idle(struct cpuidle_device *dev,
-
- local_irq_disable();
- do_gettimeofday(&before);
-- if (state == &dev->states[0])
-+ if (index == 0)
- /* Wait for interrupt state */
- cpu_do_idle();
-- else if (state == &dev->states[1]) {
-+ else if (index == 1) {
- asm("b 1f; .align 5; 1:");
- asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
- saved_lpr = sdram_selfrefresh_enable();
-@@ -56,7 +56,9 @@ static int at91_enter_idle(struct cpuidle_device *dev,
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-- return idle_time;
-+
-+ dev->last_residency = idle_time;
-+ return index;
- }
-
- /* Initialize CPU idle by registering the idle states */
-diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
-index 85cc399..ab9a9e4 100644
---- a/arch/arm/mach-davinci/cpuidle.c
-+++ b/arch/arm/mach-davinci/cpuidle.c
-@@ -79,9 +79,9 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
-
- /* Actual code that puts the SoC in different idle states */
- static int davinci_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
-- struct davinci_ops *ops = cpuidle_get_statedata(state);
-+ struct davinci_ops *ops = cpuidle_get_statedata(&dev->states[index]);
- struct timeval before, after;
- int idle_time;
-
-@@ -99,7 +99,10 @@ static int davinci_enter_idle(struct cpuidle_device *dev,
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-- return idle_time;
-+
-+ dev->last_residency = idle_time;
-+
-+ return index;
- }
-
- static int __init davinci_cpuidle_probe(struct platform_device *pdev)
-diff --git a/arch/arm/mach-exynos4/cpuidle.c b/arch/arm/mach-exynos4/cpuidle.c
-index bf7e96f..ea026e7 100644
---- a/arch/arm/mach-exynos4/cpuidle.c
-+++ b/arch/arm/mach-exynos4/cpuidle.c
-@@ -16,7 +16,7 @@
- #include <asm/proc-fns.h>
-
- static int exynos4_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state);
-+ int index);
-
- static struct cpuidle_state exynos4_cpuidle_set[] = {
- [0] = {
-@@ -37,7 +37,7 @@ static struct cpuidle_driver exynos4_idle_driver = {
- };
-
- static int exynos4_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- struct timeval before, after;
- int idle_time;
-@@ -52,7 +52,8 @@ static int exynos4_enter_idle(struct cpuidle_device *dev,
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-
-- return idle_time;
-+ dev->last_residency = idle_time;
-+ return index;
- }
-
- static int __init exynos4_init_cpuidle(void)
-diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
-index 864e569..53d6049 100644
---- a/arch/arm/mach-kirkwood/cpuidle.c
-+++ b/arch/arm/mach-kirkwood/cpuidle.c
-@@ -33,17 +33,17 @@ static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
-
- /* Actual code that puts the SoC in different idle states */
- static int kirkwood_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- struct timeval before, after;
- int idle_time;
-
- local_irq_disable();
- do_gettimeofday(&before);
-- if (state == &dev->states[0])
-+ if (index == 0)
- /* Wait for interrupt state */
- cpu_do_idle();
-- else if (state == &dev->states[1]) {
-+ else if (index == 1) {
- /*
- * Following write will put DDR in self refresh.
- * Note that we have 256 cycles before DDR puts it
-@@ -58,7 +58,11 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-- return idle_time;
-+
-+ /* Update last residency */
-+ dev->last_residency = idle_time;
-+
-+ return index;
- }
-
- /* Initialize CPU idle by registering the idle states */
-diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
-index 4bf6e6e..58425c7 100644
---- a/arch/arm/mach-omap2/cpuidle34xx.c
-+++ b/arch/arm/mach-omap2/cpuidle34xx.c
-@@ -88,17 +88,19 @@ static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
- /**
- * omap3_enter_idle - Programs OMAP3 to enter the specified state
- * @dev: cpuidle device
-- * @state: The target state to be programmed
-+ * @index: the index of state to be entered
- *
- * Called from the CPUidle framework to program the device to the
- * specified target state selected by the governor.
- */
- static int omap3_enter_idle(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
-- struct omap3_idle_statedata *cx = cpuidle_get_statedata(state);
-+ struct omap3_idle_statedata *cx =
-+ cpuidle_get_statedata(&dev->states[index]);
- struct timespec ts_preidle, ts_postidle, ts_idle;
- u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
-+ int idle_time;
-
- /* Used to keep track of the total time in idle */
- getnstimeofday(&ts_preidle);
-@@ -113,7 +115,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
- goto return_sleep_time;
-
- /* Deny idle for C1 */
-- if (state == &dev->states[0]) {
-+ if (index == 0) {
- pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
- pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
- }
-@@ -122,7 +124,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
- omap_sram_idle();
-
- /* Re-allow idle for C1 */
-- if (state == &dev->states[0]) {
-+ if (index == 0) {
- pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
- pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
- }
-@@ -134,28 +136,35 @@ return_sleep_time:
- local_irq_enable();
- local_fiq_enable();
-
-- return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;
-+ idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
-+ USEC_PER_SEC;
-+
-+ /* Update cpuidle counters */
-+ dev->last_residency = idle_time;
-+
-+ return index;
- }
-
- /**
- * next_valid_state - Find next valid C-state
- * @dev: cpuidle device
-- * @state: Currently selected C-state
-+ * @index: Index of currently selected c-state
- *
-- * If the current state is valid, it is returned back to the caller.
-- * Else, this function searches for a lower c-state which is still
-- * valid.
-+ * If the state corresponding to index is valid, index is returned back
-+ * to the caller. Else, this function searches for a lower c-state which is
-+ * still valid (as defined in omap3_power_states[]) and returns its index.
- *
- * A state is valid if the 'valid' field is enabled and
- * if it satisfies the enable_off_mode condition.
- */
--static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
-- struct cpuidle_state *curr)
-+static int next_valid_state(struct cpuidle_device *dev,
-+ int index)
- {
-- struct cpuidle_state *next = NULL;
-+ struct cpuidle_state *curr = &dev->states[index];
- struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr);
- u32 mpu_deepest_state = PWRDM_POWER_RET;
- u32 core_deepest_state = PWRDM_POWER_RET;
-+ int next_index = -1;
-
- if (enable_off_mode) {
- mpu_deepest_state = PWRDM_POWER_OFF;
-@@ -172,20 +181,20 @@ static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
- if ((cx->valid) &&
- (cx->mpu_state >= mpu_deepest_state) &&
- (cx->core_state >= core_deepest_state)) {
-- return curr;
-+ return index;
- } else {
- int idx = OMAP3_NUM_STATES - 1;
-
- /* Reach the current state starting at highest C-state */
- for (; idx >= 0; idx--) {
- if (&dev->states[idx] == curr) {
-- next = &dev->states[idx];
-+ next_index = idx;
- break;
- }
- }
-
- /* Should never hit this condition */
-- WARN_ON(next == NULL);
-+ WARN_ON(next_index == -1);
-
- /*
- * Drop to next valid state.
-@@ -197,37 +206,39 @@ static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
- if ((cx->valid) &&
- (cx->mpu_state >= mpu_deepest_state) &&
- (cx->core_state >= core_deepest_state)) {
-- next = &dev->states[idx];
-+ next_index = idx;
- break;
- }
- }
- /*
- * C1 is always valid.
-- * So, no need to check for 'next==NULL' outside this loop.
-+ * So, no need to check for 'next_index == -1' outside
-+ * this loop.
- */
- }
-
-- return next;
-+ return next_index;
- }
-
- /**
- * omap3_enter_idle_bm - Checks for any bus activity
- * @dev: cpuidle device
-- * @state: The target state to be programmed
-+ * @index: array index of target state to be programmed
- *
- * This function checks for any pending activity and then programs
- * the device to the specified or a safer state.
- */
- static int omap3_enter_idle_bm(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
-- struct cpuidle_state *new_state;
-+ struct cpuidle_state *state = &dev->states[index];
-+ int new_state_idx;
- u32 core_next_state, per_next_state = 0, per_saved_state = 0, cam_state;
- struct omap3_idle_statedata *cx;
- int ret;
-
- if (!omap3_can_sleep()) {
-- new_state = dev->safe_state;
-+ new_state_idx = dev->safe_state_index;
- goto select_state;
- }
-
-@@ -237,7 +248,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- */
- cam_state = pwrdm_read_pwrst(cam_pd);
- if (cam_state == PWRDM_POWER_ON) {
-- new_state = dev->safe_state;
-+ new_state_idx = dev->safe_state_index;
- goto select_state;
- }
-
-@@ -264,11 +275,10 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- if (per_next_state != per_saved_state)
- pwrdm_set_next_pwrst(per_pd, per_next_state);
-
-- new_state = next_valid_state(dev, state);
-+ new_state_idx = next_valid_state(dev, index);
-
- select_state:
-- dev->last_state = new_state;
-- ret = omap3_enter_idle(dev, new_state);
-+ ret = omap3_enter_idle(dev, new_state_idx);
-
- /* Restore original PER state if it was modified */
- if (per_next_state != per_saved_state)
-@@ -339,11 +349,12 @@ int __init omap3_idle_init(void)
-
- cpuidle_register_driver(&omap3_idle_driver);
- dev = &per_cpu(omap3_idle_dev, smp_processor_id());
-+ dev->safe_state_index = -1;
-
- /* C1 . MPU WFI + Core active */
- cx = _fill_cstate(dev, 0, "MPU ON + CORE ON");
- (&dev->states[0])->enter = omap3_enter_idle;
-- dev->safe_state = &dev->states[0];
-+ dev->safe_state_index = 0;
- cx->valid = 1; /* C1 is always valid */
- cx->mpu_state = PWRDM_POWER_ON;
- cx->core_state = PWRDM_POWER_ON;
-diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
-index e4469e72..7be50d4c 100644
---- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
-+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
-@@ -25,11 +25,11 @@ static unsigned long cpuidle_mode[] = {
- };
-
- static int cpuidle_sleep_enter(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- unsigned long allowed_mode = arch_hwblk_sleep_mode();
- ktime_t before, after;
-- int requested_state = state - &dev->states[0];
-+ int requested_state = index;
- int allowed_state;
- int k;
-
-@@ -46,11 +46,13 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev,
- */
- k = min_t(int, allowed_state, requested_state);
-
-- dev->last_state = &dev->states[k];
- before = ktime_get();
- sh_mobile_call_standby(cpuidle_mode[k]);
- after = ktime_get();
-- return ktime_to_ns(ktime_sub(after, before)) >> 10;
-+
-+ dev->last_residency = (int)ktime_to_ns(ktime_sub(after, before)) >> 10;
-+
-+ return k;
- }
-
- static struct cpuidle_device cpuidle_dev;
-@@ -84,7 +86,7 @@ void sh_mobile_setup_cpuidle(void)
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
- state->enter = cpuidle_sleep_enter;
-
-- dev->safe_state = state;
-+ dev->safe_state_index = i-1;
-
- if (sh_mobile_sleep_supported & SUSP_SH_SF) {
- state = &dev->states[i++];
-diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 2e69e09..6be70bf 100644
---- a/drivers/acpi/processor_idle.c
-+++ b/drivers/acpi/processor_idle.c
-@@ -741,22 +741,24 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
- /**
- * acpi_idle_enter_c1 - enters an ACPI C1 state-type
- * @dev: the target CPU
-- * @state: the state data
-+ * @index: index of target state
- *
- * This is equivalent to the HALT instruction.
- */
- static int acpi_idle_enter_c1(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- ktime_t kt1, kt2;
- s64 idle_time;
- struct acpi_processor *pr;
-+ struct cpuidle_state *state = &dev->states[index];
- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
-
- pr = __this_cpu_read(processors);
-+ dev->last_residency = 0;
-
- if (unlikely(!pr))
-- return 0;
-+ return -EINVAL;
-
- local_irq_disable();
-
-@@ -764,7 +766,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
- if (acpi_idle_suspend) {
- local_irq_enable();
- cpu_relax();
-- return 0;
-+ return -EINVAL;
- }
-
- lapic_timer_state_broadcast(pr, cx, 1);
-@@ -773,37 +775,46 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
- kt2 = ktime_get_real();
- idle_time = ktime_to_us(ktime_sub(kt2, kt1));
-
-+ /* Update device last_residency*/
-+ dev->last_residency = (int)idle_time;
-+
- local_irq_enable();
- cx->usage++;
- lapic_timer_state_broadcast(pr, cx, 0);
-
-- return idle_time;
-+ return index;
- }
-
- /**
- * acpi_idle_enter_simple - enters an ACPI state without BM handling
- * @dev: the target CPU
-- * @state: the state data
-+ * @index: the index of suggested state
- */
- static int acpi_idle_enter_simple(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- struct acpi_processor *pr;
-+ struct cpuidle_state *state = &dev->states[index];
- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
- ktime_t kt1, kt2;
- s64 idle_time_ns;
- s64 idle_time;
-
- pr = __this_cpu_read(processors);
-+ dev->last_residency = 0;
-
- if (unlikely(!pr))
-- return 0;
--
-- if (acpi_idle_suspend)
-- return(acpi_idle_enter_c1(dev, state));
-+ return -EINVAL;
-
- local_irq_disable();
-
-+ if (acpi_idle_suspend) {
-+ local_irq_enable();
-+ cpu_relax();
-+ return -EINVAL;
-+ }
-+
-+
- if (cx->entry_method != ACPI_CSTATE_FFH) {
- current_thread_info()->status &= ~TS_POLLING;
- /*
-@@ -815,7 +826,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
- if (unlikely(need_resched())) {
- current_thread_info()->status |= TS_POLLING;
- local_irq_enable();
-- return 0;
-+ return -EINVAL;
- }
- }
-
-@@ -837,6 +848,9 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
- idle_time = idle_time_ns;
- do_div(idle_time, NSEC_PER_USEC);
-
-+ /* Update device last_residency*/
-+ dev->last_residency = (int)idle_time;
-+
- /* Tell the scheduler how much we idled: */
- sched_clock_idle_wakeup_event(idle_time_ns);
-
-@@ -848,7 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
-
- lapic_timer_state_broadcast(pr, cx, 0);
- cx->time += idle_time;
-- return idle_time;
-+ return index;
- }
-
- static int c3_cpu_count;
-@@ -857,14 +871,15 @@ static DEFINE_SPINLOCK(c3_lock);
- /**
- * acpi_idle_enter_bm - enters C3 with proper BM handling
- * @dev: the target CPU
-- * @state: the state data
-+ * @index: the index of suggested state
- *
- * If BM is detected, the deepest non-C3 idle state is entered instead.
- */
- static int acpi_idle_enter_bm(struct cpuidle_device *dev,
-- struct cpuidle_state *state)
-+ int index)
- {
- struct acpi_processor *pr;
-+ struct cpuidle_state *state = &dev->states[index];
- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
- ktime_t kt1, kt2;
- s64 idle_time_ns;
-@@ -872,22 +887,26 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
-
-
- pr = __this_cpu_read(processors);
-+ dev->last_residency = 0;
-
- if (unlikely(!pr))
-- return 0;
-+ return -EINVAL;
-
-- if (acpi_idle_suspend)
-- return(acpi_idle_enter_c1(dev, state));
-+
-+ if (acpi_idle_suspend) {
-+ cpu_relax();
-+ return -EINVAL;
-+ }
-
- if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
-- if (dev->safe_state) {
-- dev->last_state = dev->safe_state;
-- return dev->safe_state->enter(dev, dev->safe_state);
-+ if (dev->safe_state_index >= 0) {
-+ return dev->states[dev->safe_state_index].enter(dev,
-+ dev->safe_state_index);
- } else {
- local_irq_disable();
- acpi_safe_halt();
- local_irq_enable();
-- return 0;
-+ return -EINVAL;
- }
- }
-
-@@ -904,7 +923,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
- if (unlikely(need_resched())) {
- current_thread_info()->status |= TS_POLLING;
- local_irq_enable();
-- return 0;
-+ return -EINVAL;
- }
- }
-
-@@ -954,6 +973,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
- idle_time = idle_time_ns;
- do_div(idle_time, NSEC_PER_USEC);
-
-+ /* Update device last_residency*/
-+ dev->last_residency = (int)idle_time;
-+
- /* Tell the scheduler how much we idled: */
- sched_clock_idle_wakeup_event(idle_time_ns);
-
-@@ -965,7 +987,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
-
- lapic_timer_state_broadcast(pr, cx, 0);
- cx->time += idle_time;
-- return idle_time;
-+ return index;
- }
-
- struct cpuidle_driver acpi_idle_driver = {
-@@ -992,6 +1014,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- }
-
- dev->cpu = pr->id;
-+ dev->safe_state_index = -1;
- for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
- dev->states[i].name[0] = '\0';
- dev->states[i].desc[0] = '\0';
-@@ -1027,13 +1050,13 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
-
- state->enter = acpi_idle_enter_c1;
-- dev->safe_state = state;
-+ dev->safe_state_index = count;
- break;
-
- case ACPI_STATE_C2:
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
- state->enter = acpi_idle_enter_simple;
-- dev->safe_state = state;
-+ dev->safe_state_index = count;
- break;
-
- case ACPI_STATE_C3:
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index becd6d9..c0f1a3a 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -63,7 +63,7 @@ int cpuidle_idle_call(void)
- {
- struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
- struct cpuidle_state *target_state;
-- int next_state;
-+ int next_state, entered_state;
-
- if (off)
- return -ENODEV;
-@@ -103,26 +103,27 @@ int cpuidle_idle_call(void)
-
- target_state = &dev->states[next_state];
-
-- /* enter the state and update stats */
-- dev->last_state = target_state;
--
- trace_power_start(POWER_CSTATE, next_state, dev->cpu);
- trace_cpu_idle(next_state, dev->cpu);
-
-- dev->last_residency = target_state->enter(dev, target_state);
-+ entered_state = target_state->enter(dev, next_state);
-
- trace_power_end(dev->cpu);
- trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
-
-- if (dev->last_state)
-- target_state = dev->last_state;
--
-- target_state->time += (unsigned long long)dev->last_residency;
-- target_state->usage++;
-+ if (entered_state >= 0) {
-+ /* Update cpuidle counters */
-+ /* This can be moved to within driver enter routine
-+ * but that results in multiple copies of same code.
-+ */
-+ dev->states[entered_state].time +=
-+ (unsigned long long)dev->last_residency;
-+ dev->states[entered_state].usage++;
-+ }
-
- /* give the governor an opportunity to reflect on the outcome */
- if (cpuidle_curr_governor->reflect)
-- cpuidle_curr_governor->reflect(dev);
-+ cpuidle_curr_governor->reflect(dev, entered_state);
-
- return 0;
- }
-@@ -173,11 +174,10 @@ void cpuidle_resume_and_unlock(void)
- EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
-
- #ifdef CONFIG_ARCH_HAS_CPU_RELAX
--static int poll_idle(struct cpuidle_device *dev, struct cpuidle_state *st)
-+static int poll_idle(struct cpuidle_device *dev, int index)
- {
- ktime_t t1, t2;
- s64 diff;
-- int ret;
-
- t1 = ktime_get();
- local_irq_enable();
-@@ -189,8 +189,9 @@ static int poll_idle(struct cpuidle_device *dev, struct cpuidle_state *st)
- if (diff > INT_MAX)
- diff = INT_MAX;
-
-- ret = (int) diff;
-- return ret;
-+ dev->last_residency = (int) diff;
-+
-+ return index;
- }
-
- static void poll_idle_init(struct cpuidle_device *dev)
-@@ -249,7 +250,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
- dev->states[i].time = 0;
- }
- dev->last_residency = 0;
-- dev->last_state = NULL;
-
- smp_wmb();
-
-diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
-index f62fde2..78b06d2 100644
---- a/drivers/cpuidle/governors/ladder.c
-+++ b/drivers/cpuidle/governors/ladder.c
-@@ -153,11 +153,24 @@ static int ladder_enable_device(struct cpuidle_device *dev)
- return 0;
- }
-
-+/**
-+ * ladder_reflect - update the correct last_state_idx
-+ * @dev: the CPU
-+ * @index: the index of actual state entered
-+ */
-+static void ladder_reflect(struct cpuidle_device *dev, int index)
-+{
-+ struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
-+ if (index > 0)
-+ ldev->last_state_idx = index;
-+}
-+
- static struct cpuidle_governor ladder_governor = {
- .name = "ladder",
- .rating = 10,
- .enable = ladder_enable_device,
- .select = ladder_select_state,
-+ .reflect = ladder_reflect,
- .owner = THIS_MODULE,
- };
-
-diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
-index 0027524..e27a2af 100644
---- a/drivers/cpuidle/governors/menu.c
-+++ b/drivers/cpuidle/governors/menu.c
-@@ -311,14 +311,17 @@ static int menu_select(struct cpuidle_device *dev)
- /**
- * menu_reflect - records that data structures need update
- * @dev: the CPU
-+ * @index: the index of actual entered state
- *
- * NOTE: it's important to be fast here because this operation will add to
- * the overall exit latency.
- */
--static void menu_reflect(struct cpuidle_device *dev)
-+static void menu_reflect(struct cpuidle_device *dev, int index)
- {
- struct menu_device *data = &__get_cpu_var(menu_devices);
-- data->needs_update = 1;
-+ data->last_state_idx = index;
-+ if (index >= 0)
-+ data->needs_update = 1;
- }
-
- /**
-diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
-index 026f9aa..8f056e1 100644
---- a/drivers/idle/intel_idle.c
-+++ b/drivers/idle/intel_idle.c
-@@ -81,7 +81,7 @@ static unsigned int mwait_substates;
- static unsigned int lapic_timer_reliable_states = (1 << 1); /* Default to only C1 */
-
- static struct cpuidle_device __percpu *intel_idle_cpuidle_devices;
--static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state);
-+static int intel_idle(struct cpuidle_device *dev, int index);
-
- static struct cpuidle_state *cpuidle_state_table;
-
-@@ -209,12 +209,13 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
- /**
- * intel_idle
- * @dev: cpuidle_device
-- * @state: cpuidle state
-+ * @index: index of cpuidle state
- *
- */
--static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
-+static int intel_idle(struct cpuidle_device *dev, int index)
- {
- unsigned long ecx = 1; /* break on interrupt flag */
-+ struct cpuidle_state *state = &dev->states[index];
- unsigned long eax = (unsigned long)cpuidle_get_statedata(state);
- unsigned int cstate;
- ktime_t kt_before, kt_after;
-@@ -256,7 +257,10 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
- if (!(lapic_timer_reliable_states & (1 << (cstate))))
- clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
-
-- return usec_delta;
-+ /* Update cpuidle counters */
-+ dev->last_residency = (int)usec_delta;
-+
-+ return index;
- }
-
- static void __setup_broadcast_timer(void *arg)
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index b51629e..8da811b 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -42,7 +42,7 @@ struct cpuidle_state {
- unsigned long long time; /* in US */
-
- int (*enter) (struct cpuidle_device *dev,
-- struct cpuidle_state *state);
-+ int index);
- };
-
- /* Idle State Flags */
-@@ -87,13 +87,12 @@ struct cpuidle_device {
- int state_count;
- struct cpuidle_state states[CPUIDLE_STATE_MAX];
- struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
-- struct cpuidle_state *last_state;
-
- struct list_head device_list;
- struct kobject kobj;
- struct completion kobj_unregister;
- void *governor_data;
-- struct cpuidle_state *safe_state;
-+ int safe_state_index;
-
- int (*prepare) (struct cpuidle_device *dev);
- };
-@@ -169,7 +168,7 @@ struct cpuidle_governor {
- void (*disable) (struct cpuidle_device *dev);
-
- int (*select) (struct cpuidle_device *dev);
-- void (*reflect) (struct cpuidle_device *dev);
-+ void (*reflect) (struct cpuidle_device *dev, int index);
-
- struct module *owner;
- };
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0042-mmc-tmio_mmc-Hotplug-code-regrouping.patch b/patches.kzm9g/0042-mmc-tmio_mmc-Hotplug-code-regrouping.patch
deleted file mode 100644
index 9c567795f38f3a..00000000000000
--- a/patches.kzm9g/0042-mmc-tmio_mmc-Hotplug-code-regrouping.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 4ca7e51f2818d592650cabed935acd9f094ca26a Mon Sep 17 00:00:00 2001
-From: Bastian Hecht <hechtb@googlemail.com>
-Date: Fri, 23 Dec 2011 23:03:13 +0100
-Subject: mmc: tmio_mmc: Hotplug code regrouping
-
-This patch regroups the code slightly, adds documentation and allows
-the rtpm counter of MMC_CAP_NEEDS_POLL devices to reach 0 again.
-
-Signed-off-by: Bastian Hecht <hechtb@gmail.com>
-[g.liakhovetski@gmx.de: restore pm_runtime_get_noresume()]
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit cbb18b309d3d6b6661f931279697eac77b6591c9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 30 +++++++++++++++++++++---------
- 1 file changed, 21 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 4208b39..abad01b 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -800,8 +800,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- } else if (ios->power_mode != MMC_POWER_UP) {
- if (host->set_pwr && ios->power_mode == MMC_POWER_OFF)
- host->set_pwr(host->pdev, 0);
-- if ((pdata->flags & TMIO_MMC_HAS_COLD_CD) &&
-- pdata->power) {
-+ if (pdata->power) {
- pdata->power = false;
- pm_runtime_put(&host->pdev->dev);
- }
-@@ -915,6 +914,23 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- if (ret < 0)
- goto pm_disable;
-
-+ /*
-+ * There are 4 different scenarios for the card detection:
-+ * 1) an external gpio irq handles the cd (best for power savings)
-+ * 2) internal sdhi irq handles the cd
-+ * 3) a worker thread polls the sdhi - indicated by MMC_CAP_NEEDS_POLL
-+ * 4) the medium is non-removable - indicated by MMC_CAP_NONREMOVABLE
-+ *
-+ * While we increment the rtpm counter for all scenarios when the mmc
-+ * core activates us by calling an appropriate set_ios(), we must
-+ * additionally ensure that in case 2) the tmio mmc hardware stays
-+ * powered on during runtime for the card detection to work.
-+ */
-+ if (!(pdata->flags & TMIO_MMC_HAS_COLD_CD
-+ || mmc->caps & MMC_CAP_NEEDS_POLL
-+ || mmc->caps & MMC_CAP_NONREMOVABLE))
-+ pm_runtime_get_noresume(&pdev->dev);
-+
- tmio_mmc_clk_stop(_host);
- tmio_mmc_reset(_host);
-
-@@ -933,12 +949,6 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- /* See if we also get DMA */
- tmio_mmc_request_dma(_host, pdata);
-
-- /* We have to keep the device powered for its card detection to work */
-- if (!(pdata->flags & TMIO_MMC_HAS_COLD_CD)) {
-- pdata->power = true;
-- pm_runtime_get_noresume(&pdev->dev);
-- }
--
- mmc_add_host(mmc);
-
- /* Unmask the IRQs we want to know about */
-@@ -974,7 +984,9 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
- * the controller, the runtime PM is suspended and pdata->power == false,
- * so, our .runtime_resume() will not try to detect a card in the slot.
- */
-- if (host->pdata->flags & TMIO_MMC_HAS_COLD_CD)
-+ if (host->pdata->flags & TMIO_MMC_HAS_COLD_CD
-+ || host->mmc->caps & MMC_CAP_NEEDS_POLL
-+ || host->mmc->caps & MMC_CAP_NONREMOVABLE)
- pm_runtime_get_sync(&pdev->dev);
-
- mmc_remove_host(host->mmc);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch b/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
deleted file mode 100644
index 549d142a86ca94..00000000000000
--- a/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From bdf8107f9e58c5563946d7cb46e1bed307ce2653 Mon Sep 17 00:00:00 2001
-From: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Date: Fri, 28 Oct 2011 16:20:24 +0530
-Subject: cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()
-
-The cpuidle_device->prepare() mechanism causes updates to the
-cpuidle_state[].flags, setting and clearing CPUIDLE_FLAG_IGNORE
-to tell the governor not to chose a state on a per-cpu basis at
-run-time. State demotion is now handled by the driver and it returns
-the actual state entered. Hence, this mechanism is not required.
-Also this removes per-cpu flags from cpuidle_state enabling
-it to be made global.
-
-Reference:
-https://lkml.org/lkml/2011/3/25/52
-
-Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm>
-Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
-Tested-by: Jean Pihet <j-pihet@ti.com>
-Acked-by: Arjan van de Ven <arjan@linux.intel.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit b25edc42bfb9602f0503474b2c94701d5536ce60)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/cpuidle/cpuidle.c | 10 ----------
- drivers/cpuidle/governors/menu.c | 2 --
- include/linux/cpuidle.h | 3 ---
- 3 files changed, 15 deletions(-)
-
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index c0f1a3a..70350d2 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -84,16 +84,6 @@ int cpuidle_idle_call(void)
- hrtimer_peek_ahead_timers();
- #endif
-
-- /*
-- * Call the device's prepare function before calling the
-- * governor's select function. ->prepare gives the device's
-- * cpuidle driver a chance to update any dynamic information
-- * of its cpuidle states for the current idle period, e.g.
-- * state availability, latencies, residencies, etc.
-- */
-- if (dev->prepare)
-- dev->prepare(dev);
--
- /* ask the governor for the next state */
- next_state = cpuidle_curr_governor->select(dev);
- if (need_resched()) {
-diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
-index e27a2af..2072aeb 100644
---- a/drivers/cpuidle/governors/menu.c
-+++ b/drivers/cpuidle/governors/menu.c
-@@ -289,8 +289,6 @@ static int menu_select(struct cpuidle_device *dev)
- for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) {
- struct cpuidle_state *s = &dev->states[i];
-
-- if (s->flags & CPUIDLE_FLAG_IGNORE)
-- continue;
- if (s->target_residency > data->predicted_us)
- continue;
- if (s->exit_latency > latency_req)
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index 8da811b..c6d85cf 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -47,7 +47,6 @@ struct cpuidle_state {
-
- /* Idle State Flags */
- #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
--#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
-
- #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
-
-@@ -93,8 +92,6 @@ struct cpuidle_device {
- struct completion kobj_unregister;
- void *governor_data;
- int safe_state_index;
--
-- int (*prepare) (struct cpuidle_device *dev);
- };
-
- DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0043-mmc-host-move-to-dma_transfer_direction.patch b/patches.kzm9g/0043-mmc-host-move-to-dma_transfer_direction.patch
deleted file mode 100644
index e0e100e94f4d61..00000000000000
--- a/patches.kzm9g/0043-mmc-host-move-to-dma_transfer_direction.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From aa9a805a43f06d6cf99be9a4ef28701aa8ec1314 Mon Sep 17 00:00:00 2001
-From: Vinod Koul <vinod.koul@linux.intel.com>
-Date: Fri, 14 Oct 2011 10:45:11 +0530
-Subject: mmc-host: move to dma_transfer_direction
-
-fixup usage of dma direction by introducing dma_transfer_direction,
-this patch moves mmc drivers to use new enum
-
-Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
-Cc: Chris Ball <cjb@laptop.org>
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry picked from commit 05f5799cbe5c9e2c03f604b3de5783cf4d726227)
-
-Conflicts:
-
- drivers/mmc/host/atmel-mci.c
- drivers/mmc/host/mmci.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/sh_mmcif.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_dma.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 86f259c..7a6e6cc 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -77,7 +77,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
- ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
- if (ret > 0)
- desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-- DMA_FROM_DEVICE, DMA_CTRL_ACK);
-+ DMA_DEV_TO_MEM, DMA_CTRL_ACK);
-
- if (desc) {
- cookie = dmaengine_submit(desc);
-@@ -158,7 +158,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
- ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
- if (ret > 0)
- desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-- DMA_TO_DEVICE, DMA_CTRL_ACK);
-+ DMA_MEM_TO_DEV, DMA_CTRL_ACK);
-
- if (desc) {
- cookie = dmaengine_submit(desc);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0044-cpuidle-Split-cpuidle_state-structure-and-move-per-c.patch b/patches.kzm9g/0044-cpuidle-Split-cpuidle_state-structure-and-move-per-c.patch
deleted file mode 100644
index d41a55c17819b7..00000000000000
--- a/patches.kzm9g/0044-cpuidle-Split-cpuidle_state-structure-and-move-per-c.patch
+++ /dev/null
@@ -1,531 +0,0 @@
-From f3127a05382f54ff79a80cddcabc22ffdfb510e0 Mon Sep 17 00:00:00 2001
-From: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Date: Fri, 28 Oct 2011 16:20:33 +0530
-Subject: cpuidle: Split cpuidle_state structure and move per-cpu statistics
- fields
-
-This is the first step towards global registration of cpuidle
-states. The statistics used primarily by the governor are per-cpu
-and have to be split from rest of the fields inside cpuidle_state,
-which would be made global i.e. single copy. The driver_data field
-is also per-cpu and moved.
-
-Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
-Tested-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Acked-by: Arjan van de Ven <arjan@linux.intel.com>
-Acked-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit 4202735e8ab6ecfb0381631a0d0b58fefe0bd4e2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-davinci/cpuidle.c | 5 ++--
- arch/arm/mach-omap2/cpuidle34xx.c | 13 ++++++-----
- drivers/acpi/processor_idle.c | 25 ++++++++++----------
- drivers/cpuidle/cpuidle.c | 11 +++++----
- drivers/cpuidle/sysfs.c | 19 ++++++++++-----
- drivers/idle/intel_idle.c | 46 +++++++++++++++++++++++++++----------
- include/linux/cpuidle.h | 25 ++++++++++++--------
- 7 files changed, 90 insertions(+), 54 deletions(-)
-
-diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
-index ab9a9e4..dda6d2f 100644
---- a/arch/arm/mach-davinci/cpuidle.c
-+++ b/arch/arm/mach-davinci/cpuidle.c
-@@ -81,7 +81,8 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
- static int davinci_enter_idle(struct cpuidle_device *dev,
- int index)
- {
-- struct davinci_ops *ops = cpuidle_get_statedata(&dev->states[index]);
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-+ struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
- struct timeval before, after;
- int idle_time;
-
-@@ -143,7 +144,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
- strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
- if (pdata->ddr2_pdown)
- davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
-- cpuidle_set_statedata(&device->states[1], &davinci_states[1]);
-+ cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
-
- device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
-
-diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
-index 58425c7..d3fce7b 100644
---- a/arch/arm/mach-omap2/cpuidle34xx.c
-+++ b/arch/arm/mach-omap2/cpuidle34xx.c
-@@ -97,7 +97,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
- int index)
- {
- struct omap3_idle_statedata *cx =
-- cpuidle_get_statedata(&dev->states[index]);
-+ cpuidle_get_statedata(&dev->states_usage[index]);
- struct timespec ts_preidle, ts_postidle, ts_idle;
- u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
- int idle_time;
-@@ -160,8 +160,9 @@ return_sleep_time:
- static int next_valid_state(struct cpuidle_device *dev,
- int index)
- {
-+ struct cpuidle_state_usage *curr_usage = &dev->states_usage[index];
- struct cpuidle_state *curr = &dev->states[index];
-- struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr);
-+ struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr_usage);
- u32 mpu_deepest_state = PWRDM_POWER_RET;
- u32 core_deepest_state = PWRDM_POWER_RET;
- int next_index = -1;
-@@ -202,7 +203,7 @@ static int next_valid_state(struct cpuidle_device *dev,
- */
- idx--;
- for (; idx >= 0; idx--) {
-- cx = cpuidle_get_statedata(&dev->states[idx]);
-+ cx = cpuidle_get_statedata(&dev->states_usage[idx]);
- if ((cx->valid) &&
- (cx->mpu_state >= mpu_deepest_state) &&
- (cx->core_state >= core_deepest_state)) {
-@@ -231,7 +232,6 @@ static int next_valid_state(struct cpuidle_device *dev,
- static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- int index)
- {
-- struct cpuidle_state *state = &dev->states[index];
- int new_state_idx;
- u32 core_next_state, per_next_state = 0, per_saved_state = 0, cam_state;
- struct omap3_idle_statedata *cx;
-@@ -264,7 +264,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- * Prevent PER off if CORE is not in retention or off as this
- * would disable PER wakeups completely.
- */
-- cx = cpuidle_get_statedata(state);
-+ cx = cpuidle_get_statedata(&dev->states_usage[index]);
- core_next_state = cx->core_state;
- per_next_state = per_saved_state = pwrdm_read_next_pwrst(per_pd);
- if ((per_next_state == PWRDM_POWER_OFF) &&
-@@ -318,6 +318,7 @@ static inline struct omap3_idle_statedata *_fill_cstate(
- {
- struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
- struct cpuidle_state *state = &dev->states[idx];
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
-
- state->exit_latency = cpuidle_params_table[idx].exit_latency;
- state->target_residency = cpuidle_params_table[idx].target_residency;
-@@ -326,7 +327,7 @@ static inline struct omap3_idle_statedata *_fill_cstate(
- cx->valid = cpuidle_params_table[idx].valid;
- sprintf(state->name, "C%d", idx + 1);
- strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
-- cpuidle_set_statedata(state, cx);
-+ cpuidle_set_statedata(state_usage, cx);
-
- return cx;
- }
-diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 6be70bf..c7b89f0 100644
---- a/drivers/acpi/processor_idle.c
-+++ b/drivers/acpi/processor_idle.c
-@@ -745,14 +745,13 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
- *
- * This is equivalent to the HALT instruction.
- */
--static int acpi_idle_enter_c1(struct cpuidle_device *dev,
-- int index)
-+static int acpi_idle_enter_c1(struct cpuidle_device *dev, int index)
- {
- ktime_t kt1, kt2;
- s64 idle_time;
- struct acpi_processor *pr;
-- struct cpuidle_state *state = &dev->states[index];
-- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-+ struct acpi_processor_cx *cx = cpuidle_get_statedata(state_usage);
-
- pr = __this_cpu_read(processors);
- dev->last_residency = 0;
-@@ -790,12 +789,11 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
- * @dev: the target CPU
- * @index: the index of suggested state
- */
--static int acpi_idle_enter_simple(struct cpuidle_device *dev,
-- int index)
-+static int acpi_idle_enter_simple(struct cpuidle_device *dev, int index)
- {
- struct acpi_processor *pr;
-- struct cpuidle_state *state = &dev->states[index];
-- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-+ struct acpi_processor_cx *cx = cpuidle_get_statedata(state_usage);
- ktime_t kt1, kt2;
- s64 idle_time_ns;
- s64 idle_time;
-@@ -875,12 +873,11 @@ static DEFINE_SPINLOCK(c3_lock);
- *
- * If BM is detected, the deepest non-C3 idle state is entered instead.
- */
--static int acpi_idle_enter_bm(struct cpuidle_device *dev,
-- int index)
-+static int acpi_idle_enter_bm(struct cpuidle_device *dev, int index)
- {
- struct acpi_processor *pr;
-- struct cpuidle_state *state = &dev->states[index];
-- struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-+ struct acpi_processor_cx *cx = cpuidle_get_statedata(state_usage);
- ktime_t kt1, kt2;
- s64 idle_time_ns;
- s64 idle_time;
-@@ -1004,6 +1001,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- int i, count = CPUIDLE_DRIVER_STATE_START;
- struct acpi_processor_cx *cx;
- struct cpuidle_state *state;
-+ struct cpuidle_state_usage *state_usage;
- struct cpuidle_device *dev = &pr->power.dev;
-
- if (!pr->flags.power_setup_done)
-@@ -1026,6 +1024,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
- cx = &pr->power.states[i];
- state = &dev->states[count];
-+ state_usage = &dev->states_usage[count];
-
- if (!cx->valid)
- continue;
-@@ -1036,7 +1035,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
- continue;
- #endif
-- cpuidle_set_statedata(state, cx);
-+ cpuidle_set_statedata(state_usage, cx);
-
- snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
- strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index 70350d2..219a757 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -106,9 +106,9 @@ int cpuidle_idle_call(void)
- /* This can be moved to within driver enter routine
- * but that results in multiple copies of same code.
- */
-- dev->states[entered_state].time +=
-+ dev->states_usage[entered_state].time +=
- (unsigned long long)dev->last_residency;
-- dev->states[entered_state].usage++;
-+ dev->states_usage[entered_state].usage++;
- }
-
- /* give the governor an opportunity to reflect on the outcome */
-@@ -187,8 +187,9 @@ static int poll_idle(struct cpuidle_device *dev, int index)
- static void poll_idle_init(struct cpuidle_device *dev)
- {
- struct cpuidle_state *state = &dev->states[0];
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[0];
-
-- cpuidle_set_statedata(state, NULL);
-+ cpuidle_set_statedata(state_usage, NULL);
-
- snprintf(state->name, CPUIDLE_NAME_LEN, "POLL");
- snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE");
-@@ -236,8 +237,8 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
- goto fail_sysfs;
-
- for (i = 0; i < dev->state_count; i++) {
-- dev->states[i].usage = 0;
-- dev->states[i].time = 0;
-+ dev->states_usage[i].usage = 0;
-+ dev->states_usage[i].time = 0;
- }
- dev->last_residency = 0;
-
-diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
-index be7917ec..8a1ace1 100644
---- a/drivers/cpuidle/sysfs.c
-+++ b/drivers/cpuidle/sysfs.c
-@@ -216,7 +216,8 @@ static struct kobj_type ktype_cpuidle = {
-
- struct cpuidle_state_attr {
- struct attribute attr;
-- ssize_t (*show)(struct cpuidle_state *, char *);
-+ ssize_t (*show)(struct cpuidle_state *, \
-+ struct cpuidle_state_usage *, char *);
- ssize_t (*store)(struct cpuidle_state *, const char *, size_t);
- };
-
-@@ -224,19 +225,22 @@ struct cpuidle_state_attr {
- static struct cpuidle_state_attr attr_##_name = __ATTR(_name, 0444, show, NULL)
-
- #define define_show_state_function(_name) \
--static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
-+static ssize_t show_state_##_name(struct cpuidle_state *state, \
-+ struct cpuidle_state_usage *state_usage, char *buf) \
- { \
- return sprintf(buf, "%u\n", state->_name);\
- }
-
- #define define_show_state_ull_function(_name) \
--static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
-+static ssize_t show_state_##_name(struct cpuidle_state *state, \
-+ struct cpuidle_state_usage *state_usage, char *buf) \
- { \
-- return sprintf(buf, "%llu\n", state->_name);\
-+ return sprintf(buf, "%llu\n", state_usage->_name);\
- }
-
- #define define_show_state_str_function(_name) \
--static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
-+static ssize_t show_state_##_name(struct cpuidle_state *state, \
-+ struct cpuidle_state_usage *state_usage, char *buf) \
- { \
- if (state->_name[0] == '\0')\
- return sprintf(buf, "<null>\n");\
-@@ -269,16 +273,18 @@ static struct attribute *cpuidle_state_default_attrs[] = {
-
- #define kobj_to_state_obj(k) container_of(k, struct cpuidle_state_kobj, kobj)
- #define kobj_to_state(k) (kobj_to_state_obj(k)->state)
-+#define kobj_to_state_usage(k) (kobj_to_state_obj(k)->state_usage)
- #define attr_to_stateattr(a) container_of(a, struct cpuidle_state_attr, attr)
- static ssize_t cpuidle_state_show(struct kobject * kobj,
- struct attribute * attr ,char * buf)
- {
- int ret = -EIO;
- struct cpuidle_state *state = kobj_to_state(kobj);
-+ struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj);
- struct cpuidle_state_attr * cattr = attr_to_stateattr(attr);
-
- if (cattr->show)
-- ret = cattr->show(state, buf);
-+ ret = cattr->show(state, state_usage, buf);
-
- return ret;
- }
-@@ -323,6 +329,7 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device)
- if (!kobj)
- goto error_state;
- kobj->state = &device->states[i];
-+ kobj->state_usage = &device->states_usage[i];
- init_completion(&kobj->kobj_unregister);
-
- ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle, &device->kobj,
-diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
-index 8f056e1..b0c63e9 100644
---- a/drivers/idle/intel_idle.c
-+++ b/drivers/idle/intel_idle.c
-@@ -109,7 +109,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C1 */
- .name = "C1-NHM",
- .desc = "MWAIT 0x00",
-- .driver_data = (void *) 0x00,
- .flags = CPUIDLE_FLAG_TIME_VALID,
- .exit_latency = 3,
- .target_residency = 6,
-@@ -117,7 +116,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C2 */
- .name = "C3-NHM",
- .desc = "MWAIT 0x10",
-- .driver_data = (void *) 0x10,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 20,
- .target_residency = 80,
-@@ -125,7 +123,6 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C3 */
- .name = "C6-NHM",
- .desc = "MWAIT 0x20",
-- .driver_data = (void *) 0x20,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 200,
- .target_residency = 800,
-@@ -137,7 +134,6 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C1 */
- .name = "C1-SNB",
- .desc = "MWAIT 0x00",
-- .driver_data = (void *) 0x00,
- .flags = CPUIDLE_FLAG_TIME_VALID,
- .exit_latency = 1,
- .target_residency = 1,
-@@ -145,7 +141,6 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C2 */
- .name = "C3-SNB",
- .desc = "MWAIT 0x10",
-- .driver_data = (void *) 0x10,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 80,
- .target_residency = 211,
-@@ -153,7 +148,6 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C3 */
- .name = "C6-SNB",
- .desc = "MWAIT 0x20",
-- .driver_data = (void *) 0x20,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 104,
- .target_residency = 345,
-@@ -161,7 +155,6 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C4 */
- .name = "C7-SNB",
- .desc = "MWAIT 0x30",
-- .driver_data = (void *) 0x30,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 109,
- .target_residency = 345,
-@@ -173,7 +166,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C1 */
- .name = "C1-ATM",
- .desc = "MWAIT 0x00",
-- .driver_data = (void *) 0x00,
- .flags = CPUIDLE_FLAG_TIME_VALID,
- .exit_latency = 1,
- .target_residency = 4,
-@@ -181,7 +173,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C2 */
- .name = "C2-ATM",
- .desc = "MWAIT 0x10",
-- .driver_data = (void *) 0x10,
- .flags = CPUIDLE_FLAG_TIME_VALID,
- .exit_latency = 20,
- .target_residency = 80,
-@@ -190,7 +181,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C4 */
- .name = "C4-ATM",
- .desc = "MWAIT 0x30",
-- .driver_data = (void *) 0x30,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 100,
- .target_residency = 400,
-@@ -199,13 +189,41 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
- { /* MWAIT C6 */
- .name = "C6-ATM",
- .desc = "MWAIT 0x52",
-- .driver_data = (void *) 0x52,
- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
- .exit_latency = 140,
- .target_residency = 560,
- .enter = &intel_idle },
- };
-
-+static int get_driver_data(int cstate)
-+{
-+ int driver_data;
-+ switch (cstate) {
-+
-+ case 1: /* MWAIT C1 */
-+ driver_data = 0x00;
-+ break;
-+ case 2: /* MWAIT C2 */
-+ driver_data = 0x10;
-+ break;
-+ case 3: /* MWAIT C3 */
-+ driver_data = 0x20;
-+ break;
-+ case 4: /* MWAIT C4 */
-+ driver_data = 0x30;
-+ break;
-+ case 5: /* MWAIT C5 */
-+ driver_data = 0x40;
-+ break;
-+ case 6: /* MWAIT C6 */
-+ driver_data = 0x52;
-+ break;
-+ default:
-+ driver_data = 0x00;
-+ }
-+ return driver_data;
-+}
-+
- /**
- * intel_idle
- * @dev: cpuidle_device
-@@ -216,7 +234,8 @@ static int intel_idle(struct cpuidle_device *dev, int index)
- {
- unsigned long ecx = 1; /* break on interrupt flag */
- struct cpuidle_state *state = &dev->states[index];
-- unsigned long eax = (unsigned long)cpuidle_get_statedata(state);
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-+ unsigned long eax = (unsigned long)cpuidle_get_statedata(state_usage);
- unsigned int cstate;
- ktime_t kt_before, kt_after;
- s64 usec_delta;
-@@ -452,6 +471,9 @@ static int intel_idle_cpuidle_devices_init(void)
- dev->states[dev->state_count] = /* structure copy */
- cpuidle_state_table[cstate];
-
-+ dev->states_usage[dev->state_count].driver_data =
-+ (void *)get_driver_data(cstate);
-+
- dev->state_count += 1;
- }
-
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index c6d85cf..0156540 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -28,19 +28,22 @@ struct cpuidle_device;
- * CPUIDLE DEVICE INTERFACE *
- ****************************/
-
-+struct cpuidle_state_usage {
-+ void *driver_data;
-+
-+ unsigned long long usage;
-+ unsigned long long time; /* in US */
-+};
-+
- struct cpuidle_state {
- char name[CPUIDLE_NAME_LEN];
- char desc[CPUIDLE_DESC_LEN];
-- void *driver_data;
-
- unsigned int flags;
- unsigned int exit_latency; /* in US */
- unsigned int power_usage; /* in mW */
- unsigned int target_residency; /* in US */
-
-- unsigned long long usage;
-- unsigned long long time; /* in US */
--
- int (*enter) (struct cpuidle_device *dev,
- int index);
- };
-@@ -52,26 +55,27 @@ struct cpuidle_state {
-
- /**
- * cpuidle_get_statedata - retrieves private driver state data
-- * @state: the state
-+ * @st_usage: the state usage statistics
- */
--static inline void * cpuidle_get_statedata(struct cpuidle_state *state)
-+static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage)
- {
-- return state->driver_data;
-+ return st_usage->driver_data;
- }
-
- /**
- * cpuidle_set_statedata - stores private driver state data
-- * @state: the state
-+ * @st_usage: the state usage statistics
- * @data: the private data
- */
- static inline void
--cpuidle_set_statedata(struct cpuidle_state *state, void *data)
-+cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data)
- {
-- state->driver_data = data;
-+ st_usage->driver_data = data;
- }
-
- struct cpuidle_state_kobj {
- struct cpuidle_state *state;
-+ struct cpuidle_state_usage *state_usage;
- struct completion kobj_unregister;
- struct kobject kobj;
- };
-@@ -85,6 +89,7 @@ struct cpuidle_device {
- int last_residency;
- int state_count;
- struct cpuidle_state states[CPUIDLE_STATE_MAX];
-+ struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
- struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
-
- struct list_head device_list;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0044-mmc-tmio_mmc-fix-card-eject-during-IO-with-DMA.patch b/patches.kzm9g/0044-mmc-tmio_mmc-fix-card-eject-during-IO-with-DMA.patch
deleted file mode 100644
index 5f23faae47bc97..00000000000000
--- a/patches.kzm9g/0044-mmc-tmio_mmc-fix-card-eject-during-IO-with-DMA.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 471b39df4319e8f35fe4ab3d91c859c391385bdd Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Fri, 6 Jan 2012 13:06:51 +0100
-Subject: mmc: tmio_mmc: fix card eject during IO with DMA
-
-When DMA is in use and the card is ejected during IO, DMA transfers have to
-be terminated, otherwise the dmaengine driver fails to operate properly,
-when the card is re-inserted.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit e3de2be7368d2983bd7f7ddb6e9cf5ea32363128)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 7 ++++++-
- drivers/mmc/host/tmio_mmc_dma.c | 12 ++++++++++++
- drivers/mmc/host/tmio_mmc_pio.c | 6 +++++-
- 3 files changed, 23 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index a95e6d9..f96c536 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -20,8 +20,8 @@
- #include <linux/mmc/tmio.h>
- #include <linux/mutex.h>
- #include <linux/pagemap.h>
--#include <linux/spinlock.h>
- #include <linux/scatterlist.h>
-+#include <linux/spinlock.h>
-
- /* Definitions for values the CTRL_SDIO_STATUS register can take. */
- #define TMIO_SDIO_STAT_IOIRQ 0x0001
-@@ -120,6 +120,7 @@ void tmio_mmc_start_dma(struct tmio_mmc_host *host, struct mmc_data *data);
- void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable);
- void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata);
- void tmio_mmc_release_dma(struct tmio_mmc_host *host);
-+void tmio_mmc_abort_dma(struct tmio_mmc_host *host);
- #else
- static inline void tmio_mmc_start_dma(struct tmio_mmc_host *host,
- struct mmc_data *data)
-@@ -140,6 +141,10 @@ static inline void tmio_mmc_request_dma(struct tmio_mmc_host *host,
- static inline void tmio_mmc_release_dma(struct tmio_mmc_host *host)
- {
- }
-+
-+static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
-+{
-+}
- #endif
-
- #ifdef CONFIG_PM
-diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
-index 7a6e6cc..8253ec1 100644
---- a/drivers/mmc/host/tmio_mmc_dma.c
-+++ b/drivers/mmc/host/tmio_mmc_dma.c
-@@ -34,6 +34,18 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
- #endif
- }
-
-+void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
-+{
-+ tmio_mmc_enable_dma(host, false);
-+
-+ if (host->chan_rx)
-+ dmaengine_terminate_all(host->chan_rx);
-+ if (host->chan_tx)
-+ dmaengine_terminate_all(host->chan_tx);
-+
-+ tmio_mmc_enable_dma(host, true);
-+}
-+
- static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
- {
- struct scatterlist *sg = host->sg_ptr, *sg_tmp;
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index abad01b..5f9ad74 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -41,8 +41,8 @@
- #include <linux/platform_device.h>
- #include <linux/pm_runtime.h>
- #include <linux/scatterlist.h>
--#include <linux/workqueue.h>
- #include <linux/spinlock.h>
-+#include <linux/workqueue.h>
-
- #include "tmio_mmc.h"
-
-@@ -246,6 +246,7 @@ static void tmio_mmc_reset_work(struct work_struct *work)
- /* Ready for new calls */
- host->mrq = NULL;
-
-+ tmio_mmc_abort_dma(host);
- mmc_request_done(host->mmc, mrq);
- }
-
-@@ -272,6 +273,9 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
- host->mrq = NULL;
- spin_unlock_irqrestore(&host->lock, flags);
-
-+ if (mrq->cmd->error || (mrq->data && mrq->data->error))
-+ tmio_mmc_abort_dma(host);
-+
- mmc_request_done(host->mmc, mrq);
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0045-cpuidle-Single-Global-registration-of-idle-states.patch b/patches.kzm9g/0045-cpuidle-Single-Global-registration-of-idle-states.patch
deleted file mode 100644
index b6aa221bd0d115..00000000000000
--- a/patches.kzm9g/0045-cpuidle-Single-Global-registration-of-idle-states.patch
+++ /dev/null
@@ -1,1520 +0,0 @@
-From a50a3085d47712f6a11024570ffc8bf6b90fb126 Mon Sep 17 00:00:00 2001
-From: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Date: Fri, 28 Oct 2011 16:20:42 +0530
-Subject: cpuidle: Single/Global registration of idle states
-
-This patch makes the cpuidle_states structure global (single copy)
-instead of per-cpu. The statistics needed on per-cpu basis
-by the governor are kept per-cpu. This simplifies the cpuidle
-subsystem as state registration is done by single cpu only.
-Having single copy of cpuidle_states saves memory. Rare case
-of asymmetric C-states can be handled within the cpuidle driver
-and architectures such as POWER do not have asymmetric C-states.
-
-Having single/global registration of all the idle states,
-dynamic C-state transitions on x86 are handled by
-the boot cpu. Here, the boot cpu would disable all the devices,
-re-populate the states and later enable all the devices,
-irrespective of the cpu that would receive the notification first.
-
-Reference:
-https://lkml.org/lkml/2011/4/25/83
-
-Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
-Tested-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Acked-by: Arjan van de Ven <arjan@linux.intel.com>
-Acked-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit 46bcfad7a819bd17ac4e831b04405152d59784ab)
-
-Conflicts:
-
- drivers/idle/intel_idle.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-at91/cpuidle.c | 31 +++---
- arch/arm/mach-davinci/cpuidle.c | 39 +++----
- arch/arm/mach-exynos4/cpuidle.c | 23 ++--
- arch/arm/mach-kirkwood/cpuidle.c | 30 +++---
- arch/arm/mach-omap2/cpuidle34xx.c | 73 ++++++++-----
- arch/sh/kernel/cpu/shmobile/cpuidle.c | 18 ++--
- drivers/acpi/processor_driver.c | 20 +---
- drivers/acpi/processor_idle.c | 191 ++++++++++++++++++++++++++++-----
- drivers/cpuidle/cpuidle.c | 45 +++-----
- drivers/cpuidle/driver.c | 25 +++++
- drivers/cpuidle/governors/ladder.c | 28 +++--
- drivers/cpuidle/governors/menu.c | 20 ++--
- drivers/cpuidle/sysfs.c | 3 +-
- drivers/idle/intel_idle.c | 80 ++++++++++----
- include/acpi/processor.h | 1 +
- include/linux/cpuidle.h | 19 ++--
- 16 files changed, 439 insertions(+), 207 deletions(-)
-
-diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
-index d76a600..a851e6c 100644
---- a/arch/arm/mach-at91/cpuidle.c
-+++ b/arch/arm/mach-at91/cpuidle.c
-@@ -34,6 +34,7 @@ static struct cpuidle_driver at91_idle_driver = {
-
- /* Actual code that puts the SoC in different idle states */
- static int at91_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct timeval before, after;
-@@ -65,27 +66,29 @@ static int at91_enter_idle(struct cpuidle_device *dev,
- static int at91_init_cpuidle(void)
- {
- struct cpuidle_device *device;
--
-- cpuidle_register_driver(&at91_idle_driver);
-+ struct cpuidle_driver *driver = &at91_idle_driver;
-
- device = &per_cpu(at91_cpuidle_device, smp_processor_id());
- device->state_count = AT91_MAX_STATES;
-+ driver->state_count = AT91_MAX_STATES;
-
- /* Wait for interrupt state */
-- device->states[0].enter = at91_enter_idle;
-- device->states[0].exit_latency = 1;
-- device->states[0].target_residency = 10000;
-- device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[0].name, "WFI");
-- strcpy(device->states[0].desc, "Wait for interrupt");
-+ driver->states[0].enter = at91_enter_idle;
-+ driver->states[0].exit_latency = 1;
-+ driver->states[0].target_residency = 10000;
-+ driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[0].name, "WFI");
-+ strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and RAM self refresh state */
-- device->states[1].enter = at91_enter_idle;
-- device->states[1].exit_latency = 10;
-- device->states[1].target_residency = 10000;
-- device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[1].name, "RAM_SR");
-- strcpy(device->states[1].desc, "WFI and RAM Self Refresh");
-+ driver->states[1].enter = at91_enter_idle;
-+ driver->states[1].exit_latency = 10;
-+ driver->states[1].target_residency = 10000;
-+ driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[1].name, "RAM_SR");
-+ strcpy(driver->states[1].desc, "WFI and RAM Self Refresh");
-+
-+ cpuidle_register_driver(&at91_idle_driver);
-
- if (cpuidle_register_device(device)) {
- printk(KERN_ERR "at91_init_cpuidle: Failed registering\n");
-diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
-index dda6d2f..ed7fb95 100644
---- a/arch/arm/mach-davinci/cpuidle.c
-+++ b/arch/arm/mach-davinci/cpuidle.c
-@@ -79,6 +79,7 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
-
- /* Actual code that puts the SoC in different idle states */
- static int davinci_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-@@ -110,6 +111,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
- {
- int ret;
- struct cpuidle_device *device;
-+ struct cpuidle_driver *driver = &davinci_idle_driver;
- struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
-
- device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
-@@ -121,32 +123,33 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
-
- ddr2_reg_base = pdata->ddr2_ctlr_base;
-
-- ret = cpuidle_register_driver(&davinci_idle_driver);
-- if (ret) {
-- dev_err(&pdev->dev, "failed to register driver\n");
-- return ret;
-- }
--
- /* Wait for interrupt state */
-- device->states[0].enter = davinci_enter_idle;
-- device->states[0].exit_latency = 1;
-- device->states[0].target_residency = 10000;
-- device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[0].name, "WFI");
-- strcpy(device->states[0].desc, "Wait for interrupt");
-+ driver->states[0].enter = davinci_enter_idle;
-+ driver->states[0].exit_latency = 1;
-+ driver->states[0].target_residency = 10000;
-+ driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[0].name, "WFI");
-+ strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and DDR self refresh state */
-- device->states[1].enter = davinci_enter_idle;
-- device->states[1].exit_latency = 10;
-- device->states[1].target_residency = 10000;
-- device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[1].name, "DDR SR");
-- strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
-+ driver->states[1].enter = davinci_enter_idle;
-+ driver->states[1].exit_latency = 10;
-+ driver->states[1].target_residency = 10000;
-+ driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[1].name, "DDR SR");
-+ strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
- if (pdata->ddr2_pdown)
- davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
- cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
-
- device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
-+ driver->state_count = DAVINCI_CPUIDLE_MAX_STATES;
-+
-+ ret = cpuidle_register_driver(&davinci_idle_driver);
-+ if (ret) {
-+ dev_err(&pdev->dev, "failed to register driver\n");
-+ return ret;
-+ }
-
- ret = cpuidle_register_device(device);
- if (ret) {
-diff --git a/arch/arm/mach-exynos4/cpuidle.c b/arch/arm/mach-exynos4/cpuidle.c
-index ea026e7..35f6502 100644
---- a/arch/arm/mach-exynos4/cpuidle.c
-+++ b/arch/arm/mach-exynos4/cpuidle.c
-@@ -16,6 +16,7 @@
- #include <asm/proc-fns.h>
-
- static int exynos4_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index);
-
- static struct cpuidle_state exynos4_cpuidle_set[] = {
-@@ -37,6 +38,7 @@ static struct cpuidle_driver exynos4_idle_driver = {
- };
-
- static int exynos4_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct timeval before, after;
-@@ -60,22 +62,23 @@ static int __init exynos4_init_cpuidle(void)
- {
- int i, max_cpuidle_state, cpu_id;
- struct cpuidle_device *device;
--
-+ struct cpuidle_driver *drv = &exynos4_idle_driver;
-+
-+ /* Setup cpuidle driver */
-+ drv->state_count = (sizeof(exynos4_cpuidle_set) /
-+ sizeof(struct cpuidle_state));
-+ max_cpuidle_state = drv->state_count;
-+ for (i = 0; i < max_cpuidle_state; i++) {
-+ memcpy(&drv->states[i], &exynos4_cpuidle_set[i],
-+ sizeof(struct cpuidle_state));
-+ }
- cpuidle_register_driver(&exynos4_idle_driver);
-
- for_each_cpu(cpu_id, cpu_online_mask) {
- device = &per_cpu(exynos4_cpuidle_device, cpu_id);
- device->cpu = cpu_id;
-
-- device->state_count = (sizeof(exynos4_cpuidle_set) /
-- sizeof(struct cpuidle_state));
--
-- max_cpuidle_state = device->state_count;
--
-- for (i = 0; i < max_cpuidle_state; i++) {
-- memcpy(&device->states[i], &exynos4_cpuidle_set[i],
-- sizeof(struct cpuidle_state));
-- }
-+ device->state_count = drv->state_count;
-
- if (cpuidle_register_device(device)) {
- printk(KERN_ERR "CPUidle register device failed\n,");
-diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
-index 53d6049..7088180 100644
---- a/arch/arm/mach-kirkwood/cpuidle.c
-+++ b/arch/arm/mach-kirkwood/cpuidle.c
-@@ -33,6 +33,7 @@ static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
-
- /* Actual code that puts the SoC in different idle states */
- static int kirkwood_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct timeval before, after;
-@@ -69,28 +70,29 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
- static int kirkwood_init_cpuidle(void)
- {
- struct cpuidle_device *device;
--
-- cpuidle_register_driver(&kirkwood_idle_driver);
-+ struct cpuidle_driver *driver = &kirkwood_idle_driver;
-
- device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
- device->state_count = KIRKWOOD_MAX_STATES;
-+ driver->state_count = KIRKWOOD_MAX_STATES;
-
- /* Wait for interrupt state */
-- device->states[0].enter = kirkwood_enter_idle;
-- device->states[0].exit_latency = 1;
-- device->states[0].target_residency = 10000;
-- device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[0].name, "WFI");
-- strcpy(device->states[0].desc, "Wait for interrupt");
-+ driver->states[0].enter = kirkwood_enter_idle;
-+ driver->states[0].exit_latency = 1;
-+ driver->states[0].target_residency = 10000;
-+ driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[0].name, "WFI");
-+ strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and DDR self refresh state */
-- device->states[1].enter = kirkwood_enter_idle;
-- device->states[1].exit_latency = 10;
-- device->states[1].target_residency = 10000;
-- device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-- strcpy(device->states[1].name, "DDR SR");
-- strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
-+ driver->states[1].enter = kirkwood_enter_idle;
-+ driver->states[1].exit_latency = 10;
-+ driver->states[1].target_residency = 10000;
-+ driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
-+ strcpy(driver->states[1].name, "DDR SR");
-+ strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
-
-+ cpuidle_register_driver(&kirkwood_idle_driver);
- if (cpuidle_register_device(device)) {
- printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n");
- return -EIO;
-diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
-index d3fce7b..1fe35c2 100644
---- a/arch/arm/mach-omap2/cpuidle34xx.c
-+++ b/arch/arm/mach-omap2/cpuidle34xx.c
-@@ -88,12 +88,14 @@ static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
- /**
- * omap3_enter_idle - Programs OMAP3 to enter the specified state
- * @dev: cpuidle device
-+ * @drv: cpuidle driver
- * @index: the index of state to be entered
- *
- * Called from the CPUidle framework to program the device to the
- * specified target state selected by the governor.
- */
- static int omap3_enter_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct omap3_idle_statedata *cx =
-@@ -148,6 +150,7 @@ return_sleep_time:
- /**
- * next_valid_state - Find next valid C-state
- * @dev: cpuidle device
-+ * @drv: cpuidle driver
- * @index: Index of currently selected c-state
- *
- * If the state corresponding to index is valid, index is returned back
-@@ -158,10 +161,11 @@ return_sleep_time:
- * if it satisfies the enable_off_mode condition.
- */
- static int next_valid_state(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- struct cpuidle_state_usage *curr_usage = &dev->states_usage[index];
-- struct cpuidle_state *curr = &dev->states[index];
-+ struct cpuidle_state *curr = &drv->states[index];
- struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr_usage);
- u32 mpu_deepest_state = PWRDM_POWER_RET;
- u32 core_deepest_state = PWRDM_POWER_RET;
-@@ -188,7 +192,7 @@ static int next_valid_state(struct cpuidle_device *dev,
-
- /* Reach the current state starting at highest C-state */
- for (; idx >= 0; idx--) {
-- if (&dev->states[idx] == curr) {
-+ if (&drv->states[idx] == curr) {
- next_index = idx;
- break;
- }
-@@ -224,12 +228,14 @@ static int next_valid_state(struct cpuidle_device *dev,
- /**
- * omap3_enter_idle_bm - Checks for any bus activity
- * @dev: cpuidle device
-+ * @drv: cpuidle driver
- * @index: array index of target state to be programmed
- *
- * This function checks for any pending activity and then programs
- * the device to the specified or a safer state.
- */
- static int omap3_enter_idle_bm(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- int new_state_idx;
-@@ -238,7 +244,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- int ret;
-
- if (!omap3_can_sleep()) {
-- new_state_idx = dev->safe_state_index;
-+ new_state_idx = drv->safe_state_index;
- goto select_state;
- }
-
-@@ -248,7 +254,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- */
- cam_state = pwrdm_read_pwrst(cam_pd);
- if (cam_state == PWRDM_POWER_ON) {
-- new_state_idx = dev->safe_state_index;
-+ new_state_idx = drv->safe_state_index;
- goto select_state;
- }
-
-@@ -275,10 +281,10 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
- if (per_next_state != per_saved_state)
- pwrdm_set_next_pwrst(per_pd, per_next_state);
-
-- new_state_idx = next_valid_state(dev, index);
-+ new_state_idx = next_valid_state(dev, drv, index);
-
- select_state:
-- ret = omap3_enter_idle(dev, new_state_idx);
-+ ret = omap3_enter_idle(dev, drv, new_state_idx);
-
- /* Restore original PER state if it was modified */
- if (per_next_state != per_saved_state)
-@@ -311,22 +317,30 @@ struct cpuidle_driver omap3_idle_driver = {
- .owner = THIS_MODULE,
- };
-
--/* Helper to fill the C-state common data and register the driver_data */
--static inline struct omap3_idle_statedata *_fill_cstate(
-- struct cpuidle_device *dev,
-+/* Helper to fill the C-state common data*/
-+static inline void _fill_cstate(struct cpuidle_driver *drv,
- int idx, const char *descr)
- {
-- struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
-- struct cpuidle_state *state = &dev->states[idx];
-- struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
-+ struct cpuidle_state *state = &drv->states[idx];
-
- state->exit_latency = cpuidle_params_table[idx].exit_latency;
- state->target_residency = cpuidle_params_table[idx].target_residency;
- state->flags = CPUIDLE_FLAG_TIME_VALID;
- state->enter = omap3_enter_idle_bm;
-- cx->valid = cpuidle_params_table[idx].valid;
- sprintf(state->name, "C%d", idx + 1);
- strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
-+
-+}
-+
-+/* Helper to register the driver_data */
-+static inline struct omap3_idle_statedata *_fill_cstate_usage(
-+ struct cpuidle_device *dev,
-+ int idx)
-+{
-+ struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
-+ struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
-+
-+ cx->valid = cpuidle_params_table[idx].valid;
- cpuidle_set_statedata(state_usage, cx);
-
- return cx;
-@@ -341,6 +355,7 @@ static inline struct omap3_idle_statedata *_fill_cstate(
- int __init omap3_idle_init(void)
- {
- struct cpuidle_device *dev;
-+ struct cpuidle_driver *drv = &omap3_idle_driver;
- struct omap3_idle_statedata *cx;
-
- mpu_pd = pwrdm_lookup("mpu_pwrdm");
-@@ -348,45 +363,52 @@ int __init omap3_idle_init(void)
- per_pd = pwrdm_lookup("per_pwrdm");
- cam_pd = pwrdm_lookup("cam_pwrdm");
-
-- cpuidle_register_driver(&omap3_idle_driver);
-+
-+ drv->safe_state_index = -1;
- dev = &per_cpu(omap3_idle_dev, smp_processor_id());
-- dev->safe_state_index = -1;
-
- /* C1 . MPU WFI + Core active */
-- cx = _fill_cstate(dev, 0, "MPU ON + CORE ON");
-- (&dev->states[0])->enter = omap3_enter_idle;
-- dev->safe_state_index = 0;
-+ _fill_cstate(drv, 0, "MPU ON + CORE ON");
-+ (&drv->states[0])->enter = omap3_enter_idle;
-+ drv->safe_state_index = 0;
-+ cx = _fill_cstate_usage(dev, 0);
- cx->valid = 1; /* C1 is always valid */
- cx->mpu_state = PWRDM_POWER_ON;
- cx->core_state = PWRDM_POWER_ON;
-
- /* C2 . MPU WFI + Core inactive */
-- cx = _fill_cstate(dev, 1, "MPU ON + CORE ON");
-+ _fill_cstate(drv, 1, "MPU ON + CORE ON");
-+ cx = _fill_cstate_usage(dev, 1);
- cx->mpu_state = PWRDM_POWER_ON;
- cx->core_state = PWRDM_POWER_ON;
-
- /* C3 . MPU CSWR + Core inactive */
-- cx = _fill_cstate(dev, 2, "MPU RET + CORE ON");
-+ _fill_cstate(drv, 2, "MPU RET + CORE ON");
-+ cx = _fill_cstate_usage(dev, 2);
- cx->mpu_state = PWRDM_POWER_RET;
- cx->core_state = PWRDM_POWER_ON;
-
- /* C4 . MPU OFF + Core inactive */
-- cx = _fill_cstate(dev, 3, "MPU OFF + CORE ON");
-+ _fill_cstate(drv, 3, "MPU OFF + CORE ON");
-+ cx = _fill_cstate_usage(dev, 3);
- cx->mpu_state = PWRDM_POWER_OFF;
- cx->core_state = PWRDM_POWER_ON;
-
- /* C5 . MPU RET + Core RET */
-- cx = _fill_cstate(dev, 4, "MPU RET + CORE RET");
-+ _fill_cstate(drv, 4, "MPU RET + CORE RET");
-+ cx = _fill_cstate_usage(dev, 4);
- cx->mpu_state = PWRDM_POWER_RET;
- cx->core_state = PWRDM_POWER_RET;
-
- /* C6 . MPU OFF + Core RET */
-- cx = _fill_cstate(dev, 5, "MPU OFF + CORE RET");
-+ _fill_cstate(drv, 5, "MPU OFF + CORE RET");
-+ cx = _fill_cstate_usage(dev, 5);
- cx->mpu_state = PWRDM_POWER_OFF;
- cx->core_state = PWRDM_POWER_RET;
-
- /* C7 . MPU OFF + Core OFF */
-- cx = _fill_cstate(dev, 6, "MPU OFF + CORE OFF");
-+ _fill_cstate(drv, 6, "MPU OFF + CORE OFF");
-+ cx = _fill_cstate_usage(dev, 6);
- /*
- * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot
- * enable OFF mode in a stable form for previous revisions.
-@@ -400,6 +422,9 @@ int __init omap3_idle_init(void)
- cx->mpu_state = PWRDM_POWER_OFF;
- cx->core_state = PWRDM_POWER_OFF;
-
-+ drv->state_count = OMAP3_NUM_STATES;
-+ cpuidle_register_driver(&omap3_idle_driver);
-+
- dev->state_count = OMAP3_NUM_STATES;
- if (cpuidle_register_device(dev)) {
- printk(KERN_ERR "%s: CPUidle register device failed\n",
-diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
-index 7be50d4c..ad1012a 100644
---- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
-+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
-@@ -25,6 +25,7 @@ static unsigned long cpuidle_mode[] = {
- };
-
- static int cpuidle_sleep_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index)
- {
- unsigned long allowed_mode = arch_hwblk_sleep_mode();
-@@ -64,19 +65,19 @@ static struct cpuidle_driver cpuidle_driver = {
- void sh_mobile_setup_cpuidle(void)
- {
- struct cpuidle_device *dev = &cpuidle_dev;
-+ struct cpuidle_driver *drv = &cpuidle_driver;
- struct cpuidle_state *state;
- int i;
-
-- cpuidle_register_driver(&cpuidle_driver);
-
- for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
-- dev->states[i].name[0] = '\0';
-- dev->states[i].desc[0] = '\0';
-+ drv->states[i].name[0] = '\0';
-+ drv->states[i].desc[0] = '\0';
- }
-
- i = CPUIDLE_DRIVER_STATE_START;
-
-- state = &dev->states[i++];
-+ state = &drv->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
- strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN);
- state->exit_latency = 1;
-@@ -86,10 +87,10 @@ void sh_mobile_setup_cpuidle(void)
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
- state->enter = cpuidle_sleep_enter;
-
-- dev->safe_state_index = i-1;
-+ drv->safe_state_index = i-1;
-
- if (sh_mobile_sleep_supported & SUSP_SH_SF) {
-- state = &dev->states[i++];
-+ state = &drv->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
- strncpy(state->desc, "SuperH Sleep Mode [SF]",
- CPUIDLE_DESC_LEN);
-@@ -102,7 +103,7 @@ void sh_mobile_setup_cpuidle(void)
- }
-
- if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) {
-- state = &dev->states[i++];
-+ state = &drv->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C3");
- strncpy(state->desc, "SuperH Mobile Standby Mode [SF]",
- CPUIDLE_DESC_LEN);
-@@ -114,7 +115,10 @@ void sh_mobile_setup_cpuidle(void)
- state->enter = cpuidle_sleep_enter;
- }
-
-+ drv->state_count = i;
- dev->state_count = i;
-
-+ cpuidle_register_driver(&cpuidle_driver);
-+
- cpuidle_register_device(dev);
- }
-diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
-index a4e0f1b..9d7bc9f 100644
---- a/drivers/acpi/processor_driver.c
-+++ b/drivers/acpi/processor_driver.c
-@@ -426,7 +426,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
-
- if (action == CPU_ONLINE && pr) {
- acpi_processor_ppc_has_changed(pr, 0);
-- acpi_processor_cst_has_changed(pr);
-+ acpi_processor_hotplug(pr);
- acpi_processor_reevaluate_tstate(pr, action);
- acpi_processor_tstate_has_changed(pr);
- }
-@@ -503,8 +503,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
- acpi_processor_get_throttling_info(pr);
- acpi_processor_get_limit_info(pr);
-
--
-- if (cpuidle_get_driver() == &acpi_idle_driver)
-+ if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
- acpi_processor_power_init(pr, device);
-
- pr->cdev = thermal_cooling_device_register("Processor", device,
-@@ -800,17 +799,9 @@ static int __init acpi_processor_init(void)
-
- memset(&errata, 0, sizeof(errata));
-
-- if (!cpuidle_register_driver(&acpi_idle_driver)) {
-- printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
-- acpi_idle_driver.name);
-- } else {
-- printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",
-- cpuidle_get_driver()->name);
-- }
--
- result = acpi_bus_register_driver(&acpi_processor_driver);
- if (result < 0)
-- goto out_cpuidle;
-+ return result;
-
- acpi_processor_install_hotplug_notify();
-
-@@ -821,11 +812,6 @@ static int __init acpi_processor_init(void)
- acpi_processor_throttling_init();
-
- return 0;
--
--out_cpuidle:
-- cpuidle_unregister_driver(&acpi_idle_driver);
--
-- return result;
- }
-
- static void __exit acpi_processor_exit(void)
-diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index c7b89f0..da70c26 100644
---- a/drivers/acpi/processor_idle.c
-+++ b/drivers/acpi/processor_idle.c
-@@ -741,11 +741,13 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
- /**
- * acpi_idle_enter_c1 - enters an ACPI C1 state-type
- * @dev: the target CPU
-+ * @drv: cpuidle driver containing cpuidle state info
- * @index: index of target state
- *
- * This is equivalent to the HALT instruction.
- */
--static int acpi_idle_enter_c1(struct cpuidle_device *dev, int index)
-+static int acpi_idle_enter_c1(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
- {
- ktime_t kt1, kt2;
- s64 idle_time;
-@@ -787,9 +789,11 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, int index)
- /**
- * acpi_idle_enter_simple - enters an ACPI state without BM handling
- * @dev: the target CPU
-+ * @drv: cpuidle driver with cpuidle state information
- * @index: the index of suggested state
- */
--static int acpi_idle_enter_simple(struct cpuidle_device *dev, int index)
-+static int acpi_idle_enter_simple(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
- {
- struct acpi_processor *pr;
- struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-@@ -869,11 +873,13 @@ static DEFINE_SPINLOCK(c3_lock);
- /**
- * acpi_idle_enter_bm - enters C3 with proper BM handling
- * @dev: the target CPU
-+ * @drv: cpuidle driver containing state data
- * @index: the index of suggested state
- *
- * If BM is detected, the deepest non-C3 idle state is entered instead.
- */
--static int acpi_idle_enter_bm(struct cpuidle_device *dev, int index)
-+static int acpi_idle_enter_bm(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
- {
- struct acpi_processor *pr;
- struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
-@@ -896,9 +902,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, int index)
- }
-
- if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
-- if (dev->safe_state_index >= 0) {
-- return dev->states[dev->safe_state_index].enter(dev,
-- dev->safe_state_index);
-+ if (drv->safe_state_index >= 0) {
-+ return drv->states[drv->safe_state_index].enter(dev,
-+ drv, drv->safe_state_index);
- } else {
- local_irq_disable();
- acpi_safe_halt();
-@@ -993,14 +999,15 @@ struct cpuidle_driver acpi_idle_driver = {
- };
-
- /**
-- * acpi_processor_setup_cpuidle - prepares and configures CPUIDLE
-+ * acpi_processor_setup_cpuidle_cx - prepares and configures CPUIDLE
-+ * device i.e. per-cpu data
-+ *
- * @pr: the ACPI processor
- */
--static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
-+static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr)
- {
- int i, count = CPUIDLE_DRIVER_STATE_START;
- struct acpi_processor_cx *cx;
-- struct cpuidle_state *state;
- struct cpuidle_state_usage *state_usage;
- struct cpuidle_device *dev = &pr->power.dev;
-
-@@ -1012,18 +1019,12 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- }
-
- dev->cpu = pr->id;
-- dev->safe_state_index = -1;
-- for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
-- dev->states[i].name[0] = '\0';
-- dev->states[i].desc[0] = '\0';
-- }
-
- if (max_cstate == 0)
- max_cstate = 1;
-
- for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
- cx = &pr->power.states[i];
-- state = &dev->states[count];
- state_usage = &dev->states_usage[count];
-
- if (!cx->valid)
-@@ -1035,8 +1036,64 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
- continue;
- #endif
-+
- cpuidle_set_statedata(state_usage, cx);
-
-+ count++;
-+ if (count == CPUIDLE_STATE_MAX)
-+ break;
-+ }
-+
-+ dev->state_count = count;
-+
-+ if (!count)
-+ return -EINVAL;
-+
-+ return 0;
-+}
-+
-+/**
-+ * acpi_processor_setup_cpuidle states- prepares and configures cpuidle
-+ * global state data i.e. idle routines
-+ *
-+ * @pr: the ACPI processor
-+ */
-+static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
-+{
-+ int i, count = CPUIDLE_DRIVER_STATE_START;
-+ struct acpi_processor_cx *cx;
-+ struct cpuidle_state *state;
-+ struct cpuidle_driver *drv = &acpi_idle_driver;
-+
-+ if (!pr->flags.power_setup_done)
-+ return -EINVAL;
-+
-+ if (pr->flags.power == 0)
-+ return -EINVAL;
-+
-+ drv->safe_state_index = -1;
-+ for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
-+ drv->states[i].name[0] = '\0';
-+ drv->states[i].desc[0] = '\0';
-+ }
-+
-+ if (max_cstate == 0)
-+ max_cstate = 1;
-+
-+ for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
-+ cx = &pr->power.states[i];
-+
-+ if (!cx->valid)
-+ continue;
-+
-+#ifdef CONFIG_HOTPLUG_CPU
-+ if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
-+ !pr->flags.has_cst &&
-+ !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
-+ continue;
-+#endif
-+
-+ state = &drv->states[count];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
- strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
- state->exit_latency = cx->latency;
-@@ -1049,13 +1106,13 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
-
- state->enter = acpi_idle_enter_c1;
-- dev->safe_state_index = count;
-+ drv->safe_state_index = count;
- break;
-
- case ACPI_STATE_C2:
- state->flags |= CPUIDLE_FLAG_TIME_VALID;
- state->enter = acpi_idle_enter_simple;
-- dev->safe_state_index = count;
-+ drv->safe_state_index = count;
- break;
-
- case ACPI_STATE_C3:
-@@ -1071,7 +1128,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- break;
- }
-
-- dev->state_count = count;
-+ drv->state_count = count;
-
- if (!count)
- return -EINVAL;
-@@ -1079,7 +1136,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
- return 0;
- }
-
--int acpi_processor_cst_has_changed(struct acpi_processor *pr)
-+int acpi_processor_hotplug(struct acpi_processor *pr)
- {
- int ret = 0;
-
-@@ -1100,7 +1157,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
- cpuidle_disable_device(&pr->power.dev);
- acpi_processor_get_power_info(pr);
- if (pr->flags.power) {
-- acpi_processor_setup_cpuidle(pr);
-+ acpi_processor_setup_cpuidle_cx(pr);
- ret = cpuidle_enable_device(&pr->power.dev);
- }
- cpuidle_resume_and_unlock();
-@@ -1108,10 +1165,72 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
- return ret;
- }
-
-+int acpi_processor_cst_has_changed(struct acpi_processor *pr)
-+{
-+ int cpu;
-+ struct acpi_processor *_pr;
-+
-+ if (disabled_by_idle_boot_param())
-+ return 0;
-+
-+ if (!pr)
-+ return -EINVAL;
-+
-+ if (nocst)
-+ return -ENODEV;
-+
-+ if (!pr->flags.power_setup_done)
-+ return -ENODEV;
-+
-+ /*
-+ * FIXME: Design the ACPI notification to make it once per
-+ * system instead of once per-cpu. This condition is a hack
-+ * to make the code that updates C-States be called once.
-+ */
-+
-+ if (smp_processor_id() == 0 &&
-+ cpuidle_get_driver() == &acpi_idle_driver) {
-+
-+ cpuidle_pause_and_lock();
-+ /* Protect against cpu-hotplug */
-+ get_online_cpus();
-+
-+ /* Disable all cpuidle devices */
-+ for_each_online_cpu(cpu) {
-+ _pr = per_cpu(processors, cpu);
-+ if (!_pr || !_pr->flags.power_setup_done)
-+ continue;
-+ cpuidle_disable_device(&_pr->power.dev);
-+ }
-+
-+ /* Populate Updated C-state information */
-+ acpi_processor_setup_cpuidle_states(pr);
-+
-+ /* Enable all cpuidle devices */
-+ for_each_online_cpu(cpu) {
-+ _pr = per_cpu(processors, cpu);
-+ if (!_pr || !_pr->flags.power_setup_done)
-+ continue;
-+ acpi_processor_get_power_info(_pr);
-+ if (_pr->flags.power) {
-+ acpi_processor_setup_cpuidle_cx(_pr);
-+ cpuidle_enable_device(&_pr->power.dev);
-+ }
-+ }
-+ put_online_cpus();
-+ cpuidle_resume_and_unlock();
-+ }
-+
-+ return 0;
-+}
-+
-+static int acpi_processor_registered;
-+
- int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
- struct acpi_device *device)
- {
- acpi_status status = 0;
-+ int retval;
- static int first_run;
-
- if (disabled_by_idle_boot_param())
-@@ -1148,9 +1267,26 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
- * platforms that only support C1.
- */
- if (pr->flags.power) {
-- acpi_processor_setup_cpuidle(pr);
-- if (cpuidle_register_device(&pr->power.dev))
-- return -EIO;
-+ /* Register acpi_idle_driver if not already registered */
-+ if (!acpi_processor_registered) {
-+ acpi_processor_setup_cpuidle_states(pr);
-+ retval = cpuidle_register_driver(&acpi_idle_driver);
-+ if (retval)
-+ return retval;
-+ printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
-+ acpi_idle_driver.name);
-+ }
-+ /* Register per-cpu cpuidle_device. Cpuidle driver
-+ * must already be registered before registering device
-+ */
-+ acpi_processor_setup_cpuidle_cx(pr);
-+ retval = cpuidle_register_device(&pr->power.dev);
-+ if (retval) {
-+ if (acpi_processor_registered == 0)
-+ cpuidle_unregister_driver(&acpi_idle_driver);
-+ return retval;
-+ }
-+ acpi_processor_registered++;
- }
- return 0;
- }
-@@ -1161,8 +1297,13 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
- if (disabled_by_idle_boot_param())
- return 0;
-
-- cpuidle_unregister_device(&pr->power.dev);
-- pr->flags.power_setup_done = 0;
-+ if (pr->flags.power) {
-+ cpuidle_unregister_device(&pr->power.dev);
-+ acpi_processor_registered--;
-+ if (acpi_processor_registered == 0)
-+ cpuidle_unregister_driver(&acpi_idle_driver);
-+ }
-
-+ pr->flags.power_setup_done = 0;
- return 0;
- }
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index 219a757..06ce268 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -62,6 +62,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev);
- int cpuidle_idle_call(void)
- {
- struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
-+ struct cpuidle_driver *drv = cpuidle_get_driver();
- struct cpuidle_state *target_state;
- int next_state, entered_state;
-
-@@ -85,18 +86,18 @@ int cpuidle_idle_call(void)
- #endif
-
- /* ask the governor for the next state */
-- next_state = cpuidle_curr_governor->select(dev);
-+ next_state = cpuidle_curr_governor->select(drv, dev);
- if (need_resched()) {
- local_irq_enable();
- return 0;
- }
-
-- target_state = &dev->states[next_state];
-+ target_state = &drv->states[next_state];
-
- trace_power_start(POWER_CSTATE, next_state, dev->cpu);
- trace_cpu_idle(next_state, dev->cpu);
-
-- entered_state = target_state->enter(dev, next_state);
-+ entered_state = target_state->enter(dev, drv, next_state);
-
- trace_power_end(dev->cpu);
- trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
-@@ -164,7 +165,8 @@ void cpuidle_resume_and_unlock(void)
- EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
-
- #ifdef CONFIG_ARCH_HAS_CPU_RELAX
--static int poll_idle(struct cpuidle_device *dev, int index)
-+static int poll_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
- {
- ktime_t t1, t2;
- s64 diff;
-@@ -184,12 +186,9 @@ static int poll_idle(struct cpuidle_device *dev, int index)
- return index;
- }
-
--static void poll_idle_init(struct cpuidle_device *dev)
-+static void poll_idle_init(struct cpuidle_driver *drv)
- {
-- struct cpuidle_state *state = &dev->states[0];
-- struct cpuidle_state_usage *state_usage = &dev->states_usage[0];
--
-- cpuidle_set_statedata(state_usage, NULL);
-+ struct cpuidle_state *state = &drv->states[0];
-
- snprintf(state->name, CPUIDLE_NAME_LEN, "POLL");
- snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE");
-@@ -200,7 +199,7 @@ static void poll_idle_init(struct cpuidle_device *dev)
- state->enter = poll_idle;
- }
- #else
--static void poll_idle_init(struct cpuidle_device *dev) {}
-+static void poll_idle_init(struct cpuidle_driver *drv) {}
- #endif /* CONFIG_ARCH_HAS_CPU_RELAX */
-
- /**
-@@ -227,13 +226,13 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
- return ret;
- }
-
-- poll_idle_init(dev);
-+ poll_idle_init(cpuidle_get_driver());
-
- if ((ret = cpuidle_add_state_sysfs(dev)))
- return ret;
-
- if (cpuidle_curr_governor->enable &&
-- (ret = cpuidle_curr_governor->enable(dev)))
-+ (ret = cpuidle_curr_governor->enable(cpuidle_get_driver(), dev)))
- goto fail_sysfs;
-
- for (i = 0; i < dev->state_count; i++) {
-@@ -274,7 +273,7 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
- dev->enabled = 0;
-
- if (cpuidle_curr_governor->disable)
-- cpuidle_curr_governor->disable(dev);
-+ cpuidle_curr_governor->disable(cpuidle_get_driver(), dev);
-
- cpuidle_remove_state_sysfs(dev);
- enabled_devices--;
-@@ -302,26 +301,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
-
- init_completion(&dev->kobj_unregister);
-
-- /*
-- * cpuidle driver should set the dev->power_specified bit
-- * before registering the device if the driver provides
-- * power_usage numbers.
-- *
-- * For those devices whose ->power_specified is not set,
-- * we fill in power_usage with decreasing values as the
-- * cpuidle code has an implicit assumption that state Cn
-- * uses less power than C(n-1).
-- *
-- * With CONFIG_ARCH_HAS_CPU_RELAX, C0 is already assigned
-- * an power value of -1. So we use -2, -3, etc, for other
-- * c-states.
-- */
-- if (!dev->power_specified) {
-- int i;
-- for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++)
-- dev->states[i].power_usage = -1 - i;
-- }
--
- per_cpu(cpuidle_devices, dev->cpu) = dev;
- list_add(&dev->device_list, &cpuidle_detected_devices);
- if ((ret = cpuidle_add_sysfs(sys_dev))) {
-diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
-index 3f7e3ce..284d7af 100644
---- a/drivers/cpuidle/driver.c
-+++ b/drivers/cpuidle/driver.c
-@@ -17,6 +17,30 @@
- static struct cpuidle_driver *cpuidle_curr_driver;
- DEFINE_SPINLOCK(cpuidle_driver_lock);
-
-+static void __cpuidle_register_driver(struct cpuidle_driver *drv)
-+{
-+ int i;
-+ /*
-+ * cpuidle driver should set the drv->power_specified bit
-+ * before registering if the driver provides
-+ * power_usage numbers.
-+ *
-+ * If power_specified is not set,
-+ * we fill in power_usage with decreasing values as the
-+ * cpuidle code has an implicit assumption that state Cn
-+ * uses less power than C(n-1).
-+ *
-+ * With CONFIG_ARCH_HAS_CPU_RELAX, C0 is already assigned
-+ * an power value of -1. So we use -2, -3, etc, for other
-+ * c-states.
-+ */
-+ if (!drv->power_specified) {
-+ for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
-+ drv->states[i].power_usage = -1 - i;
-+ }
-+}
-+
-+
- /**
- * cpuidle_register_driver - registers a driver
- * @drv: the driver
-@@ -34,6 +58,7 @@ int cpuidle_register_driver(struct cpuidle_driver *drv)
- spin_unlock(&cpuidle_driver_lock);
- return -EBUSY;
- }
-+ __cpuidle_register_driver(drv);
- cpuidle_curr_driver = drv;
- spin_unlock(&cpuidle_driver_lock);
-
-diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
-index 78b06d2..261e57a 100644
---- a/drivers/cpuidle/governors/ladder.c
-+++ b/drivers/cpuidle/governors/ladder.c
-@@ -60,9 +60,11 @@ static inline void ladder_do_selection(struct ladder_device *ldev,
-
- /**
- * ladder_select_state - selects the next state to enter
-+ * @drv: cpuidle driver
- * @dev: the CPU
- */
--static int ladder_select_state(struct cpuidle_device *dev)
-+static int ladder_select_state(struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev)
- {
- struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
- struct ladder_device_state *last_state;
-@@ -77,15 +79,17 @@ static int ladder_select_state(struct cpuidle_device *dev)
-
- last_state = &ldev->states[last_idx];
-
-- if (dev->states[last_idx].flags & CPUIDLE_FLAG_TIME_VALID)
-- last_residency = cpuidle_get_last_residency(dev) - dev->states[last_idx].exit_latency;
-+ if (drv->states[last_idx].flags & CPUIDLE_FLAG_TIME_VALID) {
-+ last_residency = cpuidle_get_last_residency(dev) - \
-+ drv->states[last_idx].exit_latency;
-+ }
- else
- last_residency = last_state->threshold.promotion_time + 1;
-
- /* consider promotion */
-- if (last_idx < dev->state_count - 1 &&
-+ if (last_idx < drv->state_count - 1 &&
- last_residency > last_state->threshold.promotion_time &&
-- dev->states[last_idx + 1].exit_latency <= latency_req) {
-+ drv->states[last_idx + 1].exit_latency <= latency_req) {
- last_state->stats.promotion_count++;
- last_state->stats.demotion_count = 0;
- if (last_state->stats.promotion_count >= last_state->threshold.promotion_count) {
-@@ -96,11 +100,11 @@ static int ladder_select_state(struct cpuidle_device *dev)
-
- /* consider demotion */
- if (last_idx > CPUIDLE_DRIVER_STATE_START &&
-- dev->states[last_idx].exit_latency > latency_req) {
-+ drv->states[last_idx].exit_latency > latency_req) {
- int i;
-
- for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
-- if (dev->states[i].exit_latency <= latency_req)
-+ if (drv->states[i].exit_latency <= latency_req)
- break;
- }
- ladder_do_selection(ldev, last_idx, i);
-@@ -123,9 +127,11 @@ static int ladder_select_state(struct cpuidle_device *dev)
-
- /**
- * ladder_enable_device - setup for the governor
-+ * @drv: cpuidle driver
- * @dev: the CPU
- */
--static int ladder_enable_device(struct cpuidle_device *dev)
-+static int ladder_enable_device(struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev)
- {
- int i;
- struct ladder_device *ldev = &per_cpu(ladder_devices, dev->cpu);
-@@ -134,8 +140,8 @@ static int ladder_enable_device(struct cpuidle_device *dev)
-
- ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;
-
-- for (i = 0; i < dev->state_count; i++) {
-- state = &dev->states[i];
-+ for (i = 0; i < drv->state_count; i++) {
-+ state = &drv->states[i];
- lstate = &ldev->states[i];
-
- lstate->stats.promotion_count = 0;
-@@ -144,7 +150,7 @@ static int ladder_enable_device(struct cpuidle_device *dev)
- lstate->threshold.promotion_count = PROMOTION_COUNT;
- lstate->threshold.demotion_count = DEMOTION_COUNT;
-
-- if (i < dev->state_count - 1)
-+ if (i < drv->state_count - 1)
- lstate->threshold.promotion_time = state->exit_latency;
- if (i > 0)
- lstate->threshold.demotion_time = state->exit_latency;
-diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
-index 2072aeb..ad09526 100644
---- a/drivers/cpuidle/governors/menu.c
-+++ b/drivers/cpuidle/governors/menu.c
-@@ -183,7 +183,7 @@ static inline int performance_multiplier(void)
-
- static DEFINE_PER_CPU(struct menu_device, menu_devices);
-
--static void menu_update(struct cpuidle_device *dev);
-+static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev);
-
- /* This implements DIV_ROUND_CLOSEST but avoids 64 bit division */
- static u64 div_round64(u64 dividend, u32 divisor)
-@@ -229,9 +229,10 @@ static void detect_repeating_patterns(struct menu_device *data)
-
- /**
- * menu_select - selects the next idle state to enter
-+ * @drv: cpuidle driver containing state data
- * @dev: the CPU
- */
--static int menu_select(struct cpuidle_device *dev)
-+static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
- {
- struct menu_device *data = &__get_cpu_var(menu_devices);
- int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
-@@ -241,7 +242,7 @@ static int menu_select(struct cpuidle_device *dev)
- struct timespec t;
-
- if (data->needs_update) {
-- menu_update(dev);
-+ menu_update(drv, dev);
- data->needs_update = 0;
- }
-
-@@ -286,8 +287,8 @@ static int menu_select(struct cpuidle_device *dev)
- * Find the idle state with the lowest power while satisfying
- * our constraints.
- */
-- for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) {
-- struct cpuidle_state *s = &dev->states[i];
-+ for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
-+ struct cpuidle_state *s = &drv->states[i];
-
- if (s->target_residency > data->predicted_us)
- continue;
-@@ -324,14 +325,15 @@ static void menu_reflect(struct cpuidle_device *dev, int index)
-
- /**
- * menu_update - attempts to guess what happened after entry
-+ * @drv: cpuidle driver containing state data
- * @dev: the CPU
- */
--static void menu_update(struct cpuidle_device *dev)
-+static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
- {
- struct menu_device *data = &__get_cpu_var(menu_devices);
- int last_idx = data->last_state_idx;
- unsigned int last_idle_us = cpuidle_get_last_residency(dev);
-- struct cpuidle_state *target = &dev->states[last_idx];
-+ struct cpuidle_state *target = &drv->states[last_idx];
- unsigned int measured_us;
- u64 new_factor;
-
-@@ -385,9 +387,11 @@ static void menu_update(struct cpuidle_device *dev)
-
- /**
- * menu_enable_device - scans a CPU's states and does setup
-+ * @drv: cpuidle driver
- * @dev: the CPU
- */
--static int menu_enable_device(struct cpuidle_device *dev)
-+static int menu_enable_device(struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev)
- {
- struct menu_device *data = &per_cpu(menu_devices, dev->cpu);
-
-diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
-index 8a1ace1..1e756e1 100644
---- a/drivers/cpuidle/sysfs.c
-+++ b/drivers/cpuidle/sysfs.c
-@@ -322,13 +322,14 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device)
- {
- int i, ret = -ENOMEM;
- struct cpuidle_state_kobj *kobj;
-+ struct cpuidle_driver *drv = cpuidle_get_driver();
-
- /* state statistics */
- for (i = 0; i < device->state_count; i++) {
- kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
- if (!kobj)
- goto error_state;
-- kobj->state = &device->states[i];
-+ kobj->state = &drv->states[i];
- kobj->state_usage = &device->states_usage[i];
- init_completion(&kobj->kobj_unregister);
-
-diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
-index b0c63e9..1f122c6 100644
---- a/drivers/idle/intel_idle.c
-+++ b/drivers/idle/intel_idle.c
-@@ -81,7 +81,8 @@ static unsigned int mwait_substates;
- static unsigned int lapic_timer_reliable_states = (1 << 1); /* Default to only C1 */
-
- static struct cpuidle_device __percpu *intel_idle_cpuidle_devices;
--static int intel_idle(struct cpuidle_device *dev, int index);
-+static int intel_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index);
-
- static struct cpuidle_state *cpuidle_state_table;
-
-@@ -227,13 +228,15 @@ static int get_driver_data(int cstate)
- /**
- * intel_idle
- * @dev: cpuidle_device
-+ * @drv: cpuidle driver
- * @index: index of cpuidle state
- *
- */
--static int intel_idle(struct cpuidle_device *dev, int index)
-+static int intel_idle(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
- {
- unsigned long ecx = 1; /* break on interrupt flag */
-- struct cpuidle_state *state = &dev->states[index];
-+ struct cpuidle_state *state = &drv->states[index];
- struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
- unsigned long eax = (unsigned long)cpuidle_get_statedata(state_usage);
- unsigned int cstate;
-@@ -421,6 +424,60 @@ static void intel_idle_cpuidle_devices_uninit(void)
- return;
- }
- /*
-+ * intel_idle_cpuidle_driver_init()
-+ * allocate, initialize cpuidle_states
-+ */
-+static int intel_idle_cpuidle_driver_init(void)
-+{
-+ int cstate;
-+ struct cpuidle_driver *drv = &intel_idle_driver;
-+
-+ drv->state_count = 1;
-+
-+ for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) {
-+ int num_substates;
-+
-+ if (cstate > max_cstate) {
-+ printk(PREFIX "max_cstate %d reached\n",
-+ max_cstate);
-+ break;
-+ }
-+
-+ /* does the state exist in CPUID.MWAIT? */
-+ num_substates = (mwait_substates >> ((cstate) * 4))
-+ & MWAIT_SUBSTATE_MASK;
-+ if (num_substates == 0)
-+ continue;
-+ /* is the state not enabled? */
-+ if (cpuidle_state_table[cstate].enter == NULL) {
-+ /* does the driver not know about the state? */
-+ if (*cpuidle_state_table[cstate].name == '\0')
-+ pr_debug(PREFIX "unaware of model 0x%x"
-+ " MWAIT %d please"
-+ " contact lenb@kernel.org",
-+ boot_cpu_data.x86_model, cstate);
-+ continue;
-+ }
-+
-+ if ((cstate > 2) &&
-+ !boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
-+ mark_tsc_unstable("TSC halts in idle"
-+ " states deeper than C2");
-+
-+ drv->states[drv->state_count] = /* structure copy */
-+ cpuidle_state_table[cstate];
-+
-+ drv->state_count += 1;
-+ }
-+
-+ if (auto_demotion_disable_flags)
-+ smp_call_function(auto_demotion_disable, NULL, 1);
-+
-+ return 0;
-+}
-+
-+
-+/*
- * intel_idle_cpuidle_devices_init()
- * allocate, initialize, register cpuidle_devices
- */
-@@ -454,23 +511,9 @@ static int intel_idle_cpuidle_devices_init(void)
- continue;
- /* is the state not enabled? */
- if (cpuidle_state_table[cstate].enter == NULL) {
-- /* does the driver not know about the state? */
-- if (*cpuidle_state_table[cstate].name == '\0')
-- pr_debug(PREFIX "unaware of model 0x%x"
-- " MWAIT %d please"
-- " contact lenb@kernel.org",
-- boot_cpu_data.x86_model, cstate);
- continue;
- }
-
-- if ((cstate > 2) &&
-- !boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
-- mark_tsc_unstable("TSC halts in idle"
-- " states deeper than C2");
--
-- dev->states[dev->state_count] = /* structure copy */
-- cpuidle_state_table[cstate];
--
- dev->states_usage[dev->state_count].driver_data =
- (void *)get_driver_data(cstate);
-
-@@ -485,8 +528,6 @@ static int intel_idle_cpuidle_devices_init(void)
- return -EIO;
- }
- }
-- if (auto_demotion_disable_flags)
-- on_each_cpu(auto_demotion_disable, NULL, 1);
-
- return 0;
- }
-@@ -504,6 +545,7 @@ static int __init intel_idle_init(void)
- if (retval)
- return retval;
-
-+ intel_idle_cpuidle_driver_init();
- retval = cpuidle_register_driver(&intel_idle_driver);
- if (retval) {
- printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
-diff --git a/include/acpi/processor.h b/include/acpi/processor.h
-index ba4928c..716e97b 100644
---- a/include/acpi/processor.h
-+++ b/include/acpi/processor.h
-@@ -329,6 +329,7 @@ extern void acpi_processor_throttling_init(void);
- int acpi_processor_power_init(struct acpi_processor *pr,
- struct acpi_device *device);
- int acpi_processor_cst_has_changed(struct acpi_processor *pr);
-+int acpi_processor_hotplug(struct acpi_processor *pr);
- int acpi_processor_power_exit(struct acpi_processor *pr,
- struct acpi_device *device);
- int acpi_processor_suspend(struct acpi_device * device, pm_message_t state);
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index 0156540..c904188 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -22,6 +22,7 @@
- #define CPUIDLE_DESC_LEN 32
-
- struct cpuidle_device;
-+struct cpuidle_driver;
-
-
- /****************************
-@@ -45,6 +46,7 @@ struct cpuidle_state {
- unsigned int target_residency; /* in US */
-
- int (*enter) (struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv,
- int index);
- };
-
-@@ -83,12 +85,10 @@ struct cpuidle_state_kobj {
- struct cpuidle_device {
- unsigned int registered:1;
- unsigned int enabled:1;
-- unsigned int power_specified:1;
- unsigned int cpu;
-
- int last_residency;
- int state_count;
-- struct cpuidle_state states[CPUIDLE_STATE_MAX];
- struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
- struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
-
-@@ -96,7 +96,6 @@ struct cpuidle_device {
- struct kobject kobj;
- struct completion kobj_unregister;
- void *governor_data;
-- int safe_state_index;
- };
-
- DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
-@@ -120,6 +119,11 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
- struct cpuidle_driver {
- char name[CPUIDLE_NAME_LEN];
- struct module *owner;
-+
-+ unsigned int power_specified:1;
-+ struct cpuidle_state states[CPUIDLE_STATE_MAX];
-+ int state_count;
-+ int safe_state_index;
- };
-
- #ifdef CONFIG_CPU_IDLE
-@@ -166,10 +170,13 @@ struct cpuidle_governor {
- struct list_head governor_list;
- unsigned int rating;
-
-- int (*enable) (struct cpuidle_device *dev);
-- void (*disable) (struct cpuidle_device *dev);
-+ int (*enable) (struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev);
-+ void (*disable) (struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev);
-
-- int (*select) (struct cpuidle_device *dev);
-+ int (*select) (struct cpuidle_driver *drv,
-+ struct cpuidle_device *dev);
- void (*reflect) (struct cpuidle_device *dev, int index);
-
- struct module *owner;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0045-mmc-tmio_mmc-do-not-enable-card-hotplug-interrupts-i.patch b/patches.kzm9g/0045-mmc-tmio_mmc-do-not-enable-card-hotplug-interrupts-i.patch
deleted file mode 100644
index fbf34ec4499e10..00000000000000
--- a/patches.kzm9g/0045-mmc-tmio_mmc-do-not-enable-card-hotplug-interrupts-i.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From aa83922dbd8c0d4e16cbc28fae2d59a6d709ed07 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 22 Feb 2012 13:16:09 +0100
-Subject: mmc: tmio_mmc: do not enable card hotplug interrupts, if unused
-
-If TMIO MMC is used in polling mode, or the card is non-removable, or
-card-detection is performed, using an external interrupt, there is no
-need to enable controller native card hotplug interrupts.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit e23cd53c799694d0dc1d6a66370201ad9c181bae)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 5f9ad74..f013347 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -303,6 +303,7 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
- {
- struct mmc_data *data = host->data;
- int c = cmd->opcode;
-+ u32 irq_mask = TMIO_MASK_CMD;
-
- /* Command 12 is handled by hardware */
- if (cmd->opcode == 12 && !cmd->arg) {
-@@ -338,7 +339,9 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
- c |= TRANSFER_READ;
- }
-
-- tmio_mmc_enable_mmc_irqs(host, TMIO_MASK_CMD);
-+ if (!host->native_hotplug)
-+ irq_mask &= ~(TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT);
-+ tmio_mmc_enable_mmc_irqs(host, irq_mask);
-
- /* Fire off the command */
- sd_ctrl_write32(host, CTL_ARG_REG, cmd->arg);
-@@ -960,6 +963,8 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- irq_mask |= TMIO_MASK_READOP;
- if (!_host->chan_tx)
- irq_mask |= TMIO_MASK_WRITEOP;
-+ if (!_host->native_hotplug)
-+ irq_mask &= ~(TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT);
-
- tmio_mmc_enable_mmc_irqs(_host, irq_mask);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0046-cpuidle-Add-common-time-keeping-and-irq-enabling.patch b/patches.kzm9g/0046-cpuidle-Add-common-time-keeping-and-irq-enabling.patch
deleted file mode 100644
index 6e6e73f5646766..00000000000000
--- a/patches.kzm9g/0046-cpuidle-Add-common-time-keeping-and-irq-enabling.patch
+++ /dev/null
@@ -1,285 +0,0 @@
-From 578cf9ddd7dd3eee538113c2824ddfe3ca0b9857 Mon Sep 17 00:00:00 2001
-From: Robert Lee <rob.lee@linaro.org>
-Date: Tue, 20 Mar 2012 15:22:42 -0500
-Subject: cpuidle: Add common time keeping and irq enabling
-
-Make necessary changes to implement time keeping and irq enabling
-in the core cpuidle code. This will allow the removal of these
-functionalities from various platform cpuidle implementations whose
-timekeeping and irq enabling follows the form in this common code.
-
-Signed-off-by: Robert Lee <rob.lee@linaro.org>
-Tested-by: Jean Pihet <j-pihet@ti.com>
-Tested-by: Amit Daniel <amit.kachhap@linaro.org>
-Tested-by: Robert Lee <rob.lee@linaro.org>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-Reviewed-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
-Acked-by: Jean Pihet <j-pihet@ti.com>
-Signed-off-by: Len Brown <len.brown@intel.com>
-(cherry picked from commit e1689795a784a7c41ac4cf9032794986b095a133)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/cpuidle.h | 29 ++++++++++++++++++
- arch/arm/kernel/Makefile | 2 +-
- arch/arm/kernel/cpuidle.c | 21 +++++++++++++
- drivers/cpuidle/cpuidle.c | 66 +++++++++++++++++++++++++++++++++++-----
- include/linux/cpuidle.h | 13 +++++++-
- 5 files changed, 122 insertions(+), 9 deletions(-)
- create mode 100644 arch/arm/include/asm/cpuidle.h
- create mode 100644 arch/arm/kernel/cpuidle.c
-
-diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h
-new file mode 100644
-index 0000000..2fca60a
---- /dev/null
-+++ b/arch/arm/include/asm/cpuidle.h
-@@ -0,0 +1,29 @@
-+#ifndef __ASM_ARM_CPUIDLE_H
-+#define __ASM_ARM_CPUIDLE_H
-+
-+#ifdef CONFIG_CPU_IDLE
-+extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index);
-+#else
-+static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index) { return -ENODEV; }
-+#endif
-+
-+/* Common ARM WFI state */
-+#define ARM_CPUIDLE_WFI_STATE_PWR(p) {\
-+ .enter = arm_cpuidle_simple_enter,\
-+ .exit_latency = 1,\
-+ .target_residency = 1,\
-+ .power_usage = p,\
-+ .flags = CPUIDLE_FLAG_TIME_VALID,\
-+ .name = "WFI",\
-+ .desc = "ARM WFI",\
-+}
-+
-+/*
-+ * in case power_specified == 1, give a default WFI power value needed
-+ * by some governors
-+ */
-+#define ARM_CPUIDLE_WFI_STATE ARM_CPUIDLE_WFI_STATE_PWR(UINT_MAX)
-+
-+#endif
-diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
-index 816a481..086fe97 100644
---- a/arch/arm/kernel/Makefile
-+++ b/arch/arm/kernel/Makefile
-@@ -21,7 +21,7 @@ obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o
-
- obj-$(CONFIG_LEDS) += leds.o
- obj-$(CONFIG_OC_ETM) += etm.o
--
-+obj-$(CONFIG_CPU_IDLE) += cpuidle.o
- obj-$(CONFIG_ISA_DMA_API) += dma.o
- obj-$(CONFIG_ARCH_ACORN) += ecard.o
- obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
-diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
-new file mode 100644
-index 0000000..89545f6
---- /dev/null
-+++ b/arch/arm/kernel/cpuidle.c
-@@ -0,0 +1,21 @@
-+/*
-+ * Copyright 2012 Linaro Ltd.
-+ *
-+ * The code contained herein is licensed under the GNU General Public
-+ * License. You may obtain a copy of the GNU General Public License
-+ * Version 2 or later at the following locations:
-+ *
-+ * http://www.opensource.org/licenses/gpl-license.html
-+ * http://www.gnu.org/copyleft/gpl.html
-+ */
-+
-+#include <linux/cpuidle.h>
-+#include <asm/proc-fns.h>
-+
-+int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
-+{
-+ cpu_do_idle();
-+
-+ return index;
-+}
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index 06ce268..3d3bd98 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -53,6 +53,24 @@ static void cpuidle_kick_cpus(void) {}
-
- static int __cpuidle_register_device(struct cpuidle_device *dev);
-
-+static inline int cpuidle_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
-+{
-+ struct cpuidle_state *target_state = &drv->states[index];
-+ return target_state->enter(dev, drv, index);
-+}
-+
-+static inline int cpuidle_enter_tk(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index)
-+{
-+ return cpuidle_wrap_enter(dev, drv, index, cpuidle_enter);
-+}
-+
-+typedef int (*cpuidle_enter_t)(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index);
-+
-+static cpuidle_enter_t cpuidle_enter_ops;
-+
- /**
- * cpuidle_idle_call - the main idle loop
- *
-@@ -63,7 +81,6 @@ int cpuidle_idle_call(void)
- {
- struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
- struct cpuidle_driver *drv = cpuidle_get_driver();
-- struct cpuidle_state *target_state;
- int next_state, entered_state;
-
- if (off)
-@@ -92,12 +109,10 @@ int cpuidle_idle_call(void)
- return 0;
- }
-
-- target_state = &drv->states[next_state];
--
- trace_power_start(POWER_CSTATE, next_state, dev->cpu);
- trace_cpu_idle(next_state, dev->cpu);
-
-- entered_state = target_state->enter(dev, drv, next_state);
-+ entered_state = cpuidle_enter_ops(dev, drv, next_state);
-
- trace_power_end(dev->cpu);
- trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
-@@ -110,6 +125,8 @@ int cpuidle_idle_call(void)
- dev->states_usage[entered_state].time +=
- (unsigned long long)dev->last_residency;
- dev->states_usage[entered_state].usage++;
-+ } else {
-+ dev->last_residency = 0;
- }
-
- /* give the governor an opportunity to reflect on the outcome */
-@@ -164,6 +181,37 @@ void cpuidle_resume_and_unlock(void)
-
- EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
-
-+/**
-+ * cpuidle_wrap_enter - performs timekeeping and irqen around enter function
-+ * @dev: pointer to a valid cpuidle_device object
-+ * @drv: pointer to a valid cpuidle_driver object
-+ * @index: index of the target cpuidle state.
-+ */
-+int cpuidle_wrap_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index,
-+ int (*enter)(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index))
-+{
-+ ktime_t time_start, time_end;
-+ s64 diff;
-+
-+ time_start = ktime_get();
-+
-+ index = enter(dev, drv, index);
-+
-+ time_end = ktime_get();
-+
-+ local_irq_enable();
-+
-+ diff = ktime_to_us(ktime_sub(time_end, time_start));
-+ if (diff > INT_MAX)
-+ diff = INT_MAX;
-+
-+ dev->last_residency = (int) diff;
-+
-+ return index;
-+}
-+
- #ifdef CONFIG_ARCH_HAS_CPU_RELAX
- static int poll_idle(struct cpuidle_device *dev,
- struct cpuidle_driver *drv, int index)
-@@ -212,10 +260,11 @@ static void poll_idle_init(struct cpuidle_driver *drv) {}
- int cpuidle_enable_device(struct cpuidle_device *dev)
- {
- int ret, i;
-+ struct cpuidle_driver *drv = cpuidle_get_driver();
-
- if (dev->enabled)
- return 0;
-- if (!cpuidle_get_driver() || !cpuidle_curr_governor)
-+ if (!drv || !cpuidle_curr_governor)
- return -EIO;
- if (!dev->state_count)
- return -EINVAL;
-@@ -226,13 +275,16 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
- return ret;
- }
-
-- poll_idle_init(cpuidle_get_driver());
-+ cpuidle_enter_ops = drv->en_core_tk_irqen ?
-+ cpuidle_enter_tk : cpuidle_enter;
-+
-+ poll_idle_init(drv);
-
- if ((ret = cpuidle_add_state_sysfs(dev)))
- return ret;
-
- if (cpuidle_curr_governor->enable &&
-- (ret = cpuidle_curr_governor->enable(cpuidle_get_driver(), dev)))
-+ (ret = cpuidle_curr_governor->enable(drv, dev)))
- goto fail_sysfs;
-
- for (i = 0; i < dev->state_count; i++) {
-diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index c904188..fd11aa0 100644
---- a/include/linux/cpuidle.h
-+++ b/include/linux/cpuidle.h
-@@ -16,6 +16,7 @@
- #include <linux/module.h>
- #include <linux/kobject.h>
- #include <linux/completion.h>
-+#include <linux/hrtimer.h>
-
- #define CPUIDLE_STATE_MAX 8
- #define CPUIDLE_NAME_LEN 16
-@@ -121,6 +122,8 @@ struct cpuidle_driver {
- struct module *owner;
-
- unsigned int power_specified:1;
-+ /* set to 1 to use the core cpuidle time keeping (for all states). */
-+ unsigned int en_core_tk_irqen:1;
- struct cpuidle_state states[CPUIDLE_STATE_MAX];
- int state_count;
- int safe_state_index;
-@@ -140,7 +143,10 @@ extern void cpuidle_pause_and_lock(void);
- extern void cpuidle_resume_and_unlock(void);
- extern int cpuidle_enable_device(struct cpuidle_device *dev);
- extern void cpuidle_disable_device(struct cpuidle_device *dev);
--
-+extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index,
-+ int (*enter)(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index));
- #else
- static inline void disable_cpuidle(void) { }
- static inline int cpuidle_idle_call(void) { return -ENODEV; }
-@@ -158,6 +164,11 @@ static inline void cpuidle_resume_and_unlock(void) { }
- static inline int cpuidle_enable_device(struct cpuidle_device *dev)
- {return -ENODEV; }
- static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
-+static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index,
-+ int (*enter)(struct cpuidle_device *dev,
-+ struct cpuidle_driver *drv, int index))
-+{ return -ENODEV; }
-
- #endif
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0046-mmc-tmio-calculate-the-native-hotplug-condition-only.patch b/patches.kzm9g/0046-mmc-tmio-calculate-the-native-hotplug-condition-only.patch
deleted file mode 100644
index f2e1b51a51d4d0..00000000000000
--- a/patches.kzm9g/0046-mmc-tmio-calculate-the-native-hotplug-condition-only.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From ca17c6399644d13094702101c3a3960445a465dd Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:08 +0100
-Subject: mmc: tmio: calculate the native hotplug condition only once
-
-The condition, whether we have to use the native TMIO card hotplug
-detection interrupt, is rather complex, it is better to only calculate it
-once and store in the private data.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 2b1ac5c2caccbfd43bd616321cbbe21eb33c7879)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 1 +
- drivers/mmc/host/tmio_mmc_pio.c | 12 ++++++------
- 2 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index f96c536..8531d8d 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -86,6 +86,7 @@ struct tmio_mmc_host {
- spinlock_t lock; /* protect host private data */
- unsigned long last_req_ts;
- struct mutex ios_lock; /* protect set_ios() context */
-+ bool native_hotplug;
- };
-
- int tmio_mmc_host_probe(struct tmio_mmc_host **host,
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index f013347..0a111f4 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -915,6 +915,10 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- else
- mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-
-+ _host->native_hotplug = !(pdata->flags & TMIO_MMC_HAS_COLD_CD ||
-+ mmc->caps & MMC_CAP_NEEDS_POLL ||
-+ mmc->caps & MMC_CAP_NONREMOVABLE);
-+
- pdata->power = false;
- pm_runtime_enable(&pdev->dev);
- ret = pm_runtime_resume(&pdev->dev);
-@@ -933,9 +937,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- * additionally ensure that in case 2) the tmio mmc hardware stays
- * powered on during runtime for the card detection to work.
- */
-- if (!(pdata->flags & TMIO_MMC_HAS_COLD_CD
-- || mmc->caps & MMC_CAP_NEEDS_POLL
-- || mmc->caps & MMC_CAP_NONREMOVABLE))
-+ if (_host->native_hotplug)
- pm_runtime_get_noresume(&pdev->dev);
-
- tmio_mmc_clk_stop(_host);
-@@ -993,9 +995,7 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
- * the controller, the runtime PM is suspended and pdata->power == false,
- * so, our .runtime_resume() will not try to detect a card in the slot.
- */
-- if (host->pdata->flags & TMIO_MMC_HAS_COLD_CD
-- || host->mmc->caps & MMC_CAP_NEEDS_POLL
-- || host->mmc->caps & MMC_CAP_NONREMOVABLE)
-+ if (!host->native_hotplug)
- pm_runtime_get_sync(&pdev->dev);
-
- mmc_remove_host(host->mmc);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0047-mm-add-vm_area_add_early.patch b/patches.kzm9g/0047-mm-add-vm_area_add_early.patch
deleted file mode 100644
index 6e00e80e95e5ae..00000000000000
--- a/patches.kzm9g/0047-mm-add-vm_area_add_early.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From faf323f0f552c0523cce81cf62b87a87b3eb0020 Mon Sep 17 00:00:00 2001
-From: Nicolas Pitre <nicolas.pitre@linaro.org>
-Date: Thu, 25 Aug 2011 00:24:21 -0400
-Subject: mm: add vm_area_add_early()
-
-The existing vm_area_register_early() allows for early vmalloc space
-allocation. However upcoming cleanups in the ARM architecture require
-that some fixed locations in the vmalloc area be reserved also very early.
-
-The name "vm_area_register_early" would have been a good name for the
-reservation part without the allocation. Since it is already in use with
-different semantics, let's create vm_area_add_early() instead.
-
-Both vm_area_register_early() and vm_area_add_early() can be used together
-meaning that the former is now implemented using the later where it is
-ensured that no conflicting areas are added, but no attempt is made to
-make the allocation scheme in vm_area_register_early() more sophisticated.
-After all, you must know what you're doing when using those functions.
-
-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-Acked-by: Andrew Morton <akpm@linux-foundation.org>
-Cc: linux-mm@kvack.org
-(cherry picked from commit be9b7335e70696bee731c152429b1737e42fe163)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/vmalloc.h | 1 +
- mm/vmalloc.c | 29 +++++++++++++++++++++++++++--
- 2 files changed, 28 insertions(+), 2 deletions(-)
-
-diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
-index 687fb11..4115d6a 100644
---- a/include/linux/vmalloc.h
-+++ b/include/linux/vmalloc.h
-@@ -131,6 +131,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
- */
- extern rwlock_t vmlist_lock;
- extern struct vm_struct *vmlist;
-+extern __init void vm_area_add_early(struct vm_struct *vm);
- extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
-
- #ifdef CONFIG_SMP
-diff --git a/mm/vmalloc.c b/mm/vmalloc.c
-index 43b44db..fb0d354 100644
---- a/mm/vmalloc.c
-+++ b/mm/vmalloc.c
-@@ -1132,6 +1132,32 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
- EXPORT_SYMBOL(vm_map_ram);
-
- /**
-+ * vm_area_add_early - add vmap area early during boot
-+ * @vm: vm_struct to add
-+ *
-+ * This function is used to add fixed kernel vm area to vmlist before
-+ * vmalloc_init() is called. @vm->addr, @vm->size, and @vm->flags
-+ * should contain proper values and the other fields should be zero.
-+ *
-+ * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
-+ */
-+void __init vm_area_add_early(struct vm_struct *vm)
-+{
-+ struct vm_struct *tmp, **p;
-+
-+ BUG_ON(vmap_initialized);
-+ for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) {
-+ if (tmp->addr >= vm->addr) {
-+ BUG_ON(tmp->addr < vm->addr + vm->size);
-+ break;
-+ } else
-+ BUG_ON(tmp->addr + tmp->size > vm->addr);
-+ }
-+ vm->next = *p;
-+ *p = vm;
-+}
-+
-+/**
- * vm_area_register_early - register vmap area early during boot
- * @vm: vm_struct to register
- * @align: requested alignment
-@@ -1153,8 +1179,7 @@ void __init vm_area_register_early(struct vm_struct *vm, size_t align)
-
- vm->addr = (void *)addr;
-
-- vm->next = vmlist;
-- vmlist = vm;
-+ vm_area_add_early(vm);
- }
-
- void __init vmalloc_init(void)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0047-mmc-tmio_mmc-support-the-generic-MMC-GPIO-card-hotpl.patch b/patches.kzm9g/0047-mmc-tmio_mmc-support-the-generic-MMC-GPIO-card-hotpl.patch
deleted file mode 100644
index 5d839b0bb05098..00000000000000
--- a/patches.kzm9g/0047-mmc-tmio_mmc-support-the-generic-MMC-GPIO-card-hotpl.patch
+++ /dev/null
@@ -1,255 +0,0 @@
-From 8605d396d99e7c52ec9a8b5f67835735ce9fa7c2 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:09 +0100
-Subject: mmc: tmio_mmc: support the generic MMC GPIO card hotplug helper
-
-If the platform specifies the TMIO_MMC_HAS_COLD_CD flag, use the generic
-MMC GPIO card hotplug helper.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit c8be24c2afd3ed2445bbf8f542af35a9787fc0e8)
-
-Conflicts:
-
- drivers/mmc/host/tmio_mmc_pio.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 4 ---
- drivers/mmc/host/tmio_mmc_pio.c | 67 ++++++++++++++++++-----------------------
- include/linux/mfd/tmio.h | 25 +++++++++++----
- 3 files changed, 49 insertions(+), 47 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index 8531d8d..ede2f4e5 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -53,10 +53,6 @@ struct tmio_mmc_host {
- void (*set_pwr)(struct platform_device *host, int state);
- void (*set_clk_div)(struct platform_device *host, int state);
-
-- int pm_error;
-- /* recognise system-wide suspend in runtime PM methods */
-- bool pm_global;
--
- /* pio related stuff */
- struct scatterlist *sg_ptr;
- struct scatterlist *sg_orig;
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 0a111f4..ce5f126 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -34,6 +34,7 @@
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/mfd/tmio.h>
-+#include <linux/mmc/cd-gpio.h>
- #include <linux/mmc/host.h>
- #include <linux/mmc/tmio.h>
- #include <linux/module.h>
-@@ -790,8 +791,10 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- spin_unlock_irqrestore(&host->lock, flags);
-
- /*
-- * pdata->power == false only if COLD_CD is available, otherwise only
-- * in short time intervals during probing or resuming
-+ * pdata->power toggles between false and true in both cases - either
-+ * or not the controller can be runtime-suspended during inactivity.
-+ * But if the controller has to be kept on, the runtime-pm usage_count
-+ * is kept positive, so no suspending actually takes place.
- */
- if (ios->power_mode == MMC_POWER_ON && ios->clock) {
- if (!pdata->power) {
-@@ -915,7 +918,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- else
- mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-
-- _host->native_hotplug = !(pdata->flags & TMIO_MMC_HAS_COLD_CD ||
-+ _host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
- mmc->caps & MMC_CAP_NEEDS_POLL ||
- mmc->caps & MMC_CAP_NONREMOVABLE);
-
-@@ -932,8 +935,9 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- * 3) a worker thread polls the sdhi - indicated by MMC_CAP_NEEDS_POLL
- * 4) the medium is non-removable - indicated by MMC_CAP_NONREMOVABLE
- *
-- * While we increment the rtpm counter for all scenarios when the mmc
-- * core activates us by calling an appropriate set_ios(), we must
-+ * While we increment the runtime PM counter for all scenarios when
-+ * the mmc core activates us by calling an appropriate set_ios(), we
-+ * must additionally ensure that in case 2) the tmio mmc hardware stays
- * additionally ensure that in case 2) the tmio mmc hardware stays
- * powered on during runtime for the card detection to work.
- */
-@@ -970,6 +974,14 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
-
- tmio_mmc_enable_mmc_irqs(_host, irq_mask);
-
-+ if (pdata->flags & TMIO_MMC_USE_GPIO_CD) {
-+ ret = mmc_cd_gpio_request(mmc, pdata->cd_gpio);
-+ if (ret < 0) {
-+ tmio_mmc_host_remove(_host);
-+ return ret;
-+ }
-+ }
-+
- *host = _host;
-
- return 0;
-@@ -987,14 +999,16 @@ EXPORT_SYMBOL(tmio_mmc_host_probe);
- void tmio_mmc_host_remove(struct tmio_mmc_host *host)
- {
- struct platform_device *pdev = host->pdev;
-+ struct tmio_mmc_data *pdata = host->pdata;
-+ struct mmc_host *mmc = host->mmc;
-+
-+ if (pdata->flags & TMIO_MMC_USE_GPIO_CD)
-+ /*
-+ * This means we can miss a card-eject, but this is anyway
-+ * possible, because of delayed processing of hotplug events.
-+ */
-+ mmc_cd_gpio_free(mmc);
-
-- /*
-- * We don't have to manipulate pdata->power here: if there is a card in
-- * the slot, the runtime PM is active and our .runtime_resume() will not
-- * be run. If there is no card in the slot and the platform can suspend
-- * the controller, the runtime PM is suspended and pdata->power == false,
-- * so, our .runtime_resume() will not try to detect a card in the slot.
-- */
- if (!host->native_hotplug)
- pm_runtime_get_sync(&pdev->dev);
-
-@@ -1007,7 +1021,7 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
- pm_runtime_disable(&pdev->dev);
-
- iounmap(host->ctl);
-- mmc_free_host(host->mmc);
-+ mmc_free_host(mmc);
- }
- EXPORT_SYMBOL(tmio_mmc_host_remove);
-
-@@ -1021,8 +1035,6 @@ int tmio_mmc_host_suspend(struct device *dev)
- if (!ret)
- tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
-
-- host->pm_error = pm_runtime_put_sync(dev);
--
- return ret;
- }
- EXPORT_SYMBOL(tmio_mmc_host_suspend);
-@@ -1032,20 +1044,10 @@ int tmio_mmc_host_resume(struct device *dev)
- struct mmc_host *mmc = dev_get_drvdata(dev);
- struct tmio_mmc_host *host = mmc_priv(mmc);
-
-- /* The MMC core will perform the complete set up */
-- host->pdata->power = false;
--
-- host->pm_global = true;
-- if (!host->pm_error)
-- pm_runtime_get_sync(dev);
--
-- if (host->pm_global) {
-- /* Runtime PM resume callback didn't run */
-- tmio_mmc_reset(host);
-- tmio_mmc_enable_dma(host, true);
-- host->pm_global = false;
-- }
-+ tmio_mmc_reset(host);
-+ tmio_mmc_enable_dma(host, true);
-
-+ /* The MMC core will perform the complete set up */
- return mmc_resume_host(mmc);
- }
- EXPORT_SYMBOL(tmio_mmc_host_resume);
-@@ -1062,19 +1064,10 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
- {
- struct mmc_host *mmc = dev_get_drvdata(dev);
- struct tmio_mmc_host *host = mmc_priv(mmc);
-- struct tmio_mmc_data *pdata = host->pdata;
-
- tmio_mmc_reset(host);
- tmio_mmc_enable_dma(host, true);
-
-- if (pdata->power) {
-- /* Only entered after a card-insert interrupt */
-- if (!mmc->card)
-- tmio_mmc_set_ios(mmc, &mmc->ios);
-- mmc_detect_change(mmc, msecs_to_jiffies(100));
-- }
-- host->pm_global = false;
--
- return 0;
- }
- EXPORT_SYMBOL(tmio_mmc_host_runtime_resume);
-diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
-index 0dc9804..5a197de 100644
---- a/include/linux/mfd/tmio.h
-+++ b/include/linux/mfd/tmio.h
-@@ -1,8 +1,10 @@
- #ifndef MFD_TMIO_H
- #define MFD_TMIO_H
-
-+#include <linux/device.h>
- #include <linux/fb.h>
- #include <linux/io.h>
-+#include <linux/jiffies.h>
- #include <linux/platform_device.h>
- #include <linux/pm_runtime.h>
-
-@@ -64,8 +66,8 @@
- #define TMIO_MMC_SDIO_IRQ (1 << 2)
- /*
- * Some platforms can detect card insertion events with controller powered
-- * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the
-- * controller and report the event to the driver.
-+ * down, using a GPIO IRQ, in which case they have to fill in cd_irq, cd_gpio,
-+ * and cd_flags fields of struct tmio_mmc_data.
- */
- #define TMIO_MMC_HAS_COLD_CD (1 << 3)
- /*
-@@ -73,6 +75,12 @@
- * idle before writing to some registers.
- */
- #define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
-+/*
-+ * A GPIO is used for card hotplug detection. We need an extra flag for this,
-+ * because 0 is a valid GPIO number too, and requiring users to specify
-+ * cd_gpio < 0 to disable GPIO hotplug would break backwards compatibility.
-+ */
-+#define TMIO_MMC_USE_GPIO_CD (1 << 5)
-
- int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
- int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
-@@ -98,18 +106,23 @@ struct tmio_mmc_data {
- struct tmio_mmc_dma *dma;
- struct device *dev;
- bool power;
-+ unsigned int cd_gpio;
- void (*set_pwr)(struct platform_device *host, int state);
- void (*set_clk_div)(struct platform_device *host, int state);
- int (*get_cd)(struct platform_device *host);
- int (*write16_hook)(struct tmio_mmc_host *host, int addr);
- };
-
-+/*
-+ * This function is deprecated and will be removed soon. Please, convert your
-+ * platform to use drivers/mmc/core/cd-gpio.c
-+ */
-+#include <linux/mmc/host.h>
- static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
- {
-- if (pdata && !pdata->power) {
-- pdata->power = true;
-- pm_runtime_get(pdata->dev);
-- }
-+ if (pdata)
-+ mmc_detect_change(dev_get_drvdata(pdata->dev),
-+ msecs_to_jiffies(100));
- }
-
- /*
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0048-clockevents-Make-clockevents_config-a-global-symbol.patch b/patches.kzm9g/0048-clockevents-Make-clockevents_config-a-global-symbol.patch
deleted file mode 100644
index c276f9f29d3b24..00000000000000
--- a/patches.kzm9g/0048-clockevents-Make-clockevents_config-a-global-symbol.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From fff14be80697fd2ad8584769e60a24f97ba0a704 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 9 May 2012 23:39:34 +0900
-Subject: clockevents: Make clockevents_config() a global symbol
-
-Make clockevents_config() into a global symbol to allow it
-to be used by compiled-in clockevent drivers. This is needed
-by drivers that want to update the timer frequency after
-registration time.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/clockchips.h | 1 +
- kernel/time/clockevents.c | 3 +--
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
-index d6733e2..91d1b67 100644
---- a/include/linux/clockchips.h
-+++ b/include/linux/clockchips.h
-@@ -128,6 +128,7 @@ extern u64 clockevent_delta2ns(unsigned long latch,
- struct clock_event_device *evt);
- extern void clockevents_register_device(struct clock_event_device *dev);
-
-+extern void clockevents_config(struct clock_event_device *dev, u32 freq);
- extern void clockevents_config_and_register(struct clock_event_device *dev,
- u32 freq, unsigned long min_delta,
- unsigned long max_delta);
-diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
-index e4c699d..1029cbc 100644
---- a/kernel/time/clockevents.c
-+++ b/kernel/time/clockevents.c
-@@ -197,8 +197,7 @@ void clockevents_register_device(struct clock_event_device *dev)
- }
- EXPORT_SYMBOL_GPL(clockevents_register_device);
-
--static void clockevents_config(struct clock_event_device *dev,
-- u32 freq)
-+void clockevents_config(struct clock_event_device *dev, u32 freq)
- {
- u64 sec;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0048-mmc-sh_mobile_sdhi-pass-card-hotplug-GPIO-number-to-.patch b/patches.kzm9g/0048-mmc-sh_mobile_sdhi-pass-card-hotplug-GPIO-number-to-.patch
deleted file mode 100644
index 48b733b7c362b7..00000000000000
--- a/patches.kzm9g/0048-mmc-sh_mobile_sdhi-pass-card-hotplug-GPIO-number-to-.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 4c75a4614497dab36aeb8a5a033ae5da1cb18a98 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:10 +0100
-Subject: mmc: sh_mobile_sdhi: pass card hotplug GPIO number to TMIO MMC
-
-To use TMIO MMC driver ability to interface to the generic MMC GPIO card
-hotplug detection helper, the SDHI driver has to pass the GPIO number
-from its own platform data.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 58126c878b4a4f658015e383614bafb6331e46d3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 3 ++-
- include/linux/mmc/sh_mobile_sdhi.h | 1 +
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 58da3c4..cb279b4 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -129,6 +129,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
- mmc_data->ocr_mask = p->tmio_ocr_mask;
- mmc_data->capabilities |= p->tmio_caps;
-+ mmc_data->cd_gpio = p->cd_gpio;
-
- if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
- priv->param_tx.slave_id = p->dma_slave_tx;
-@@ -211,7 +212,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
-
- dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n",
- mmc_hostname(host->mmc), (unsigned long)
-- (platform_get_resource(pdev,IORESOURCE_MEM, 0)->start),
-+ (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
- mmc_data->hclk / 1000000);
-
- return ret;
-diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
-index 71b8054..082a736 100644
---- a/include/linux/mmc/sh_mobile_sdhi.h
-+++ b/include/linux/mmc/sh_mobile_sdhi.h
-@@ -16,6 +16,7 @@ struct sh_mobile_sdhi_info {
- unsigned long tmio_flags;
- unsigned long tmio_caps;
- u32 tmio_ocr_mask; /* available MMC voltages */
-+ unsigned int cd_gpio;
- struct tmio_mmc_data *pdata;
- void (*set_pwr)(struct platform_device *pdev, int state);
- int (*get_cd)(struct platform_device *pdev);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0049-clocksource-em_sti-Emma-Mobile-STI-driver-V2.patch b/patches.kzm9g/0049-clocksource-em_sti-Emma-Mobile-STI-driver-V2.patch
deleted file mode 100644
index 826ec8002d1011..00000000000000
--- a/patches.kzm9g/0049-clocksource-em_sti-Emma-Mobile-STI-driver-V2.patch
+++ /dev/null
@@ -1,484 +0,0 @@
-From c97faaf620983062ebff15fd4db3f341a8e224b2 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 9 May 2012 23:39:42 +0900
-Subject: clocksource: em_sti: Emma Mobile STI driver V2
-
-This is V2 of the Emma Mobile STI timer driver.
-
-The STI hardware is based on a single 48-bit 32kHz
-counter that together with two individual compare
-registers can generate interrupts. There are no
-timer operating modes selectable which means that
-the timer can not clear on match.
-
-This driver is providing clocksource support for the
-48-bit counter. Clockevents are also supported using
-the same timer in periodic or oneshot modes.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
-Conflicts:
- drivers/clocksource/Makefile
----
- arch/arm/mach-shmobile/Kconfig | 6 +
- drivers/clocksource/Makefile | 1 +
- drivers/clocksource/em_sti.c | 418 ++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 425 insertions(+)
- create mode 100644 drivers/clocksource/em_sti.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 9020c1b..1e7656a 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -147,6 +147,12 @@ config SH_TIMER_TMU
- help
- This enables build of the TMU timer driver.
-
-+config EM_TIMER_STI
-+ bool "STI timer driver"
-+ default y
-+ help
-+ This enables build of the STI timer driver.
-+
- endmenu
-
- config SH_CLK_CPG
-diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
-index b995942..59eb37d 100644
---- a/drivers/clocksource/Makefile
-+++ b/drivers/clocksource/Makefile
-@@ -6,5 +6,6 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC) += cs5535-clockevt.o
- obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o
- obj-$(CONFIG_SH_TIMER_MTU2) += sh_mtu2.o
- obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o
-+obj-$(CONFIG_EM_TIMER_STI) += em_sti.o
- obj-$(CONFIG_CLKSRC_I8253) += i8253.o
- obj-$(CONFIG_CLKSRC_MMIO) += mmio.o
-diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
-new file mode 100644
-index 0000000..e8fc46d
---- /dev/null
-+++ b/drivers/clocksource/em_sti.c
-@@ -0,0 +1,418 @@
-+/*
-+ * Emma Mobile Timer Support - STI
-+ *
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/spinlock.h>
-+#include <linux/interrupt.h>
-+#include <linux/ioport.h>
-+#include <linux/io.h>
-+#include <linux/clk.h>
-+#include <linux/irq.h>
-+#include <linux/err.h>
-+#include <linux/delay.h>
-+#include <linux/clocksource.h>
-+#include <linux/clockchips.h>
-+#include <linux/slab.h>
-+#include <linux/module.h>
-+
-+enum { USER_CLOCKSOURCE, USER_CLOCKEVENT, USER_NR };
-+
-+struct em_sti_priv {
-+ void __iomem *base;
-+ struct clk *clk;
-+ struct platform_device *pdev;
-+ unsigned int active[USER_NR];
-+ unsigned long rate;
-+ unsigned long delta;
-+ cycle_t next;
-+ spinlock_t lock;
-+ struct clock_event_device ced;
-+ struct clocksource cs;
-+};
-+
-+#define STI_CONTROL 0x00
-+#define STI_COMPA_H 0x10
-+#define STI_COMPA_L 0x14
-+#define STI_COMPB_H 0x18
-+#define STI_COMPB_L 0x1c
-+#define STI_COUNT_H 0x20
-+#define STI_COUNT_L 0x24
-+#define STI_COUNT_RAW_H 0x28
-+#define STI_COUNT_RAW_L 0x2c
-+#define STI_SET_H 0x30
-+#define STI_SET_L 0x34
-+#define STI_INTSTATUS 0x40
-+#define STI_INTRAWSTATUS 0x44
-+#define STI_INTENSET 0x48
-+#define STI_INTENCLR 0x4c
-+#define STI_INTFFCLR 0x50
-+
-+static inline unsigned long em_sti_read(struct em_sti_priv *p, int offs)
-+{
-+ return ioread32(p->base + offs);
-+}
-+
-+static inline void em_sti_write(struct em_sti_priv *p, int offs,
-+ unsigned long value)
-+{
-+ iowrite32(value, p->base + offs);
-+}
-+
-+static int em_sti_enable(struct em_sti_priv *p)
-+{
-+ int ret;
-+
-+ /* enable clock */
-+ ret = clk_enable(p->clk);
-+ if (ret) {
-+ dev_err(&p->pdev->dev, "cannot enable clock\n");
-+ return ret;
-+ }
-+
-+ /* configure channel, periodic mode and maximum timeout */
-+ p->rate = clk_get_rate(p->clk);
-+
-+ /* reset the counter */
-+ em_sti_write(p, STI_SET_H, 0x40000000);
-+ em_sti_write(p, STI_SET_L, 0x00000000);
-+
-+ /* mask and clear pending interrupts */
-+ em_sti_write(p, STI_INTENCLR, 3);
-+ em_sti_write(p, STI_INTFFCLR, 3);
-+
-+ /* enable updates of counter registers */
-+ em_sti_write(p, STI_CONTROL, 1);
-+
-+ return 0;
-+}
-+
-+static void em_sti_disable(struct em_sti_priv *p)
-+{
-+ /* mask interrupts */
-+ em_sti_write(p, STI_INTENCLR, 3);
-+
-+ /* stop clock */
-+ clk_disable(p->clk);
-+}
-+
-+static cycle_t em_sti_count(struct em_sti_priv *p)
-+{
-+ cycle_t ticks;
-+ unsigned long flags;
-+
-+ /* the STI hardware buffers the 48-bit count, but to
-+ * break it out into two 32-bit access the registers
-+ * must be accessed in a certain order.
-+ * Always read STI_COUNT_H before STI_COUNT_L.
-+ */
-+ spin_lock_irqsave(&p->lock, flags);
-+ ticks = (cycle_t)(em_sti_read(p, STI_COUNT_H) & 0xffff) << 32;
-+ ticks |= em_sti_read(p, STI_COUNT_L);
-+ spin_unlock_irqrestore(&p->lock, flags);
-+
-+ return ticks;
-+}
-+
-+static void em_sti_update(struct em_sti_priv *p)
-+{
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&p->lock, flags);
-+
-+ /* update our cached counter */
-+ p->next += p->delta;
-+
-+ /* mask compare A interrupt */
-+ em_sti_write(p, STI_INTENCLR, 1);
-+
-+ /* update compare A value */
-+ em_sti_write(p, STI_COMPA_H, p->next >> 32);
-+ em_sti_write(p, STI_COMPA_L, p->next & 0xffffffff);
-+
-+ /* clear compare A interrupt source */
-+ em_sti_write(p, STI_INTFFCLR, 1);
-+
-+ /* unmask compare A interrupt */
-+ em_sti_write(p, STI_INTENSET, 1);
-+
-+ spin_unlock_irqrestore(&p->lock, flags);
-+}
-+
-+static irqreturn_t em_sti_interrupt(int irq, void *dev_id)
-+{
-+ struct em_sti_priv *p = dev_id;
-+
-+ /* Always regprogram timer compare A */
-+ if (p->ced.mode == CLOCK_EVT_MODE_PERIODIC)
-+ em_sti_update(p);
-+
-+ p->ced.event_handler(&p->ced);
-+ return IRQ_HANDLED;
-+}
-+
-+static int em_sti_start(struct em_sti_priv *p, unsigned int user)
-+{
-+ unsigned long flags;
-+ int used_before;
-+ int ret = 0;
-+
-+ spin_lock_irqsave(&p->lock, flags);
-+ used_before = p->active[USER_CLOCKSOURCE] | p->active[USER_CLOCKEVENT];
-+ if (!used_before)
-+ ret = em_sti_enable(p);
-+
-+ if (!ret)
-+ p->active[user] = 1;
-+ spin_unlock_irqrestore(&p->lock, flags);
-+
-+ return ret;
-+}
-+
-+static void em_sti_stop(struct em_sti_priv *p, unsigned int user)
-+{
-+ unsigned long flags;
-+ int used_before, used_after;
-+
-+ spin_lock_irqsave(&p->lock, flags);
-+ used_before = p->active[USER_CLOCKSOURCE] | p->active[USER_CLOCKEVENT];
-+ p->active[user] = 0;
-+ used_after = p->active[USER_CLOCKSOURCE] | p->active[USER_CLOCKEVENT];
-+
-+ if (used_before && !used_after)
-+ em_sti_disable(p);
-+ spin_unlock_irqrestore(&p->lock, flags);
-+}
-+
-+static struct em_sti_priv *cs_to_em_sti(struct clocksource *cs)
-+{
-+ return container_of(cs, struct em_sti_priv, cs);
-+}
-+
-+static cycle_t em_sti_clocksource_read(struct clocksource *cs)
-+{
-+ return em_sti_count(cs_to_em_sti(cs));
-+}
-+
-+static int em_sti_clocksource_enable(struct clocksource *cs)
-+{
-+ int ret;
-+ struct em_sti_priv *p = cs_to_em_sti(cs);
-+
-+ ret = em_sti_start(p, USER_CLOCKSOURCE);
-+ if (!ret)
-+ __clocksource_updatefreq_hz(cs, p->rate);
-+ return ret;
-+}
-+
-+static void em_sti_clocksource_disable(struct clocksource *cs)
-+{
-+ em_sti_stop(cs_to_em_sti(cs), USER_CLOCKSOURCE);
-+}
-+
-+static void em_sti_clocksource_resume(struct clocksource *cs)
-+{
-+ em_sti_clocksource_enable(cs);
-+}
-+
-+static int em_sti_register_clocksource(struct em_sti_priv *p)
-+{
-+ struct clocksource *cs = &p->cs;
-+
-+ memset(cs, 0, sizeof(*cs));
-+ cs->name = dev_name(&p->pdev->dev);
-+ cs->rating = 200;
-+ cs->read = em_sti_clocksource_read;
-+ cs->enable = em_sti_clocksource_enable;
-+ cs->disable = em_sti_clocksource_disable;
-+ cs->suspend = em_sti_clocksource_disable;
-+ cs->resume = em_sti_clocksource_resume;
-+ cs->mask = CLOCKSOURCE_MASK(48);
-+ cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
-+
-+ dev_info(&p->pdev->dev, "used as clock source\n");
-+
-+ /* Register with dummy 1 Hz value, gets updated in ->enable() */
-+ clocksource_register_hz(cs, 1);
-+ return 0;
-+}
-+
-+static struct em_sti_priv *ced_to_em_sti(struct clock_event_device *ced)
-+{
-+ return container_of(ced, struct em_sti_priv, ced);
-+}
-+
-+static void em_sti_clock_event_mode(enum clock_event_mode mode,
-+ struct clock_event_device *ced)
-+{
-+ struct em_sti_priv *p = ced_to_em_sti(ced);
-+
-+ /* deal with old setting first */
-+ switch (ced->mode) {
-+ case CLOCK_EVT_MODE_PERIODIC:
-+ case CLOCK_EVT_MODE_ONESHOT:
-+ em_sti_stop(p, USER_CLOCKEVENT);
-+ break;
-+ default:
-+ break;
-+ }
-+
-+ switch (mode) {
-+ case CLOCK_EVT_MODE_PERIODIC:
-+ dev_info(&p->pdev->dev, "used for periodic clock events\n");
-+ em_sti_start(p, USER_CLOCKEVENT);
-+ clockevents_config(&p->ced, p->rate);
-+ p->delta = (p->rate + HZ/2) / HZ;
-+ p->next = em_sti_count(p);
-+ em_sti_update(p);
-+ break;
-+ case CLOCK_EVT_MODE_ONESHOT:
-+ dev_info(&p->pdev->dev, "used for oneshot clock events\n");
-+ em_sti_start(p, USER_CLOCKEVENT);
-+ clockevents_config(&p->ced, p->rate);
-+ break;
-+ case CLOCK_EVT_MODE_SHUTDOWN:
-+ case CLOCK_EVT_MODE_UNUSED:
-+ em_sti_stop(p, USER_CLOCKEVENT);
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+static int em_sti_clock_event_next(unsigned long delta,
-+ struct clock_event_device *ced)
-+{
-+ struct em_sti_priv *p = ced_to_em_sti(ced);
-+ int safe;
-+
-+ p->delta = delta;
-+ p->next = em_sti_count(p);
-+ em_sti_update(p);
-+
-+ safe = em_sti_count(p) < (p->next - 1);
-+
-+ return !safe;
-+}
-+
-+static void em_sti_register_clockevent(struct em_sti_priv *p)
-+{
-+ struct clock_event_device *ced = &p->ced;
-+
-+ memset(ced, 0, sizeof(*ced));
-+ ced->name = dev_name(&p->pdev->dev);
-+ ced->features = CLOCK_EVT_FEAT_PERIODIC;
-+ ced->features |= CLOCK_EVT_FEAT_ONESHOT;
-+ ced->rating = 200;
-+ ced->cpumask = cpumask_of(0);
-+ ced->set_next_event = em_sti_clock_event_next;
-+ ced->set_mode = em_sti_clock_event_mode;
-+
-+ dev_info(&p->pdev->dev, "used for clock events\n");
-+
-+ /* Register with dummy 1 Hz value, gets updated in ->set_mode() */
-+ clockevents_config_and_register(ced, 1, 2, 0xffffffff);
-+}
-+
-+static int __devinit em_sti_probe(struct platform_device *pdev)
-+{
-+ struct em_sti_priv *p;
-+ struct resource *res;
-+ int irq, ret;
-+
-+ p = kzalloc(sizeof(*p), GFP_KERNEL);
-+ if (p == NULL) {
-+ dev_err(&pdev->dev, "failed to allocate driver data\n");
-+ ret = -ENOMEM;
-+ goto err0;
-+ }
-+
-+ p->pdev = pdev;
-+ platform_set_drvdata(pdev, p);
-+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ if (!res) {
-+ dev_err(&pdev->dev, "failed to get I/O memory\n");
-+ ret = -EINVAL;
-+ goto err0;
-+ }
-+
-+ irq = platform_get_irq(pdev, 0);
-+ if (irq < 0) {
-+ dev_err(&pdev->dev, "failed to get irq\n");
-+ ret = -EINVAL;
-+ goto err0;
-+ }
-+
-+ /* map memory, let base point to the STI instance */
-+ p->base = ioremap_nocache(res->start, resource_size(res));
-+ if (p->base == NULL) {
-+ dev_err(&pdev->dev, "failed to remap I/O memory\n");
-+ ret = -ENXIO;
-+ goto err0;
-+ }
-+
-+ /* get hold of clock */
-+ p->clk = clk_get(&pdev->dev, "sclk");
-+ if (IS_ERR(p->clk)) {
-+ dev_err(&pdev->dev, "cannot get clock\n");
-+ ret = PTR_ERR(p->clk);
-+ goto err1;
-+ }
-+
-+ if (request_irq(irq, em_sti_interrupt,
-+ IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
-+ dev_name(&pdev->dev), p)) {
-+ dev_err(&pdev->dev, "failed to request low IRQ\n");
-+ ret = -ENOENT;
-+ goto err2;
-+ }
-+
-+ spin_lock_init(&p->lock);
-+ em_sti_register_clockevent(p);
-+ em_sti_register_clocksource(p);
-+ return 0;
-+
-+err2:
-+ clk_put(p->clk);
-+err1:
-+ iounmap(p->base);
-+err0:
-+ kfree(p);
-+ return ret;
-+}
-+
-+static int __devexit em_sti_remove(struct platform_device *pdev)
-+{
-+ return -EBUSY; /* cannot unregister clockevent and clocksource */
-+}
-+
-+static struct platform_driver em_sti_device_driver = {
-+ .probe = em_sti_probe,
-+ .remove = __devexit_p(em_sti_remove),
-+ .driver = {
-+ .name = "em_sti",
-+ }
-+};
-+
-+module_platform_driver(em_sti_device_driver);
-+
-+MODULE_AUTHOR("Magnus Damm");
-+MODULE_DESCRIPTION("Renesas Emma Mobile STI Timer Driver");
-+MODULE_LICENSE("GPL v2");
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0049-mmc-tmio_mmc-power-status-flag-doesn-t-have-to-be-ex.patch b/patches.kzm9g/0049-mmc-tmio_mmc-power-status-flag-doesn-t-have-to-be-ex.patch
deleted file mode 100644
index c11b9bb76837a2..00000000000000
--- a/patches.kzm9g/0049-mmc-tmio_mmc-power-status-flag-doesn-t-have-to-be-ex.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 9c90215e8425dad06659dcb19f69b7c62d5de92a Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:13 +0100
-Subject: mmc: tmio_mmc: power status flag doesn't have to be exposed in
- platform data
-
-The controller power status flag does not have to be accessed from the
-hot-plug detection code any more, it can now be removed from the platform
-data and put in the controller private struct.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit c391e1b9ebfe31514fa95a0cdd30c2cbc9652c89)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 3 +++
- drivers/mmc/host/tmio_mmc_pio.c | 13 ++++++-------
- include/linux/mfd/tmio.h | 1 -
- 3 files changed, 9 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index ede2f4e5..edfcfd7 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -49,6 +49,9 @@ struct tmio_mmc_host {
- struct mmc_host *mmc;
- unsigned int sdio_irq_enabled;
-
-+ /* Controller power state */
-+ bool power;
-+
- /* Callbacks for clock / power control */
- void (*set_pwr)(struct platform_device *host, int state);
- void (*set_clk_div)(struct platform_device *host, int state);
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index ce5f126..4a2829c 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -761,7 +761,6 @@ fail:
- static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- {
- struct tmio_mmc_host *host = mmc_priv(mmc);
-- struct tmio_mmc_data *pdata = host->pdata;
- unsigned long flags;
-
- mutex_lock(&host->ios_lock);
-@@ -791,15 +790,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- spin_unlock_irqrestore(&host->lock, flags);
-
- /*
-- * pdata->power toggles between false and true in both cases - either
-+ * host->power toggles between false and true in both cases - either
- * or not the controller can be runtime-suspended during inactivity.
- * But if the controller has to be kept on, the runtime-pm usage_count
- * is kept positive, so no suspending actually takes place.
- */
- if (ios->power_mode == MMC_POWER_ON && ios->clock) {
-- if (!pdata->power) {
-+ if (!host->power) {
- pm_runtime_get_sync(&host->pdev->dev);
-- pdata->power = true;
-+ host->power = true;
- }
- tmio_mmc_set_clock(host, ios->clock);
- /* power up SD bus */
-@@ -810,8 +809,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- } else if (ios->power_mode != MMC_POWER_UP) {
- if (host->set_pwr && ios->power_mode == MMC_POWER_OFF)
- host->set_pwr(host->pdev, 0);
-- if (pdata->power) {
-- pdata->power = false;
-+ if (host->power) {
-+ host->power = false;
- pm_runtime_put(&host->pdev->dev);
- }
- tmio_mmc_clk_stop(host);
-@@ -922,7 +921,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
- mmc->caps & MMC_CAP_NEEDS_POLL ||
- mmc->caps & MMC_CAP_NONREMOVABLE);
-
-- pdata->power = false;
-+ _host->power = false;
- pm_runtime_enable(&pdev->dev);
- ret = pm_runtime_resume(&pdev->dev);
- if (ret < 0)
-diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
-index 5a197de..f5171db 100644
---- a/include/linux/mfd/tmio.h
-+++ b/include/linux/mfd/tmio.h
-@@ -105,7 +105,6 @@ struct tmio_mmc_data {
- u32 ocr_mask; /* available voltages */
- struct tmio_mmc_dma *dma;
- struct device *dev;
-- bool power;
- unsigned int cd_gpio;
- void (*set_pwr)(struct platform_device *host, int state);
- void (*set_clk_div)(struct platform_device *host, int state);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0050-ARM-move-initialization-of-the-high_memory-variable-.patch b/patches.kzm9g/0050-ARM-move-initialization-of-the-high_memory-variable-.patch
deleted file mode 100644
index 995ac0d9c826bd..00000000000000
--- a/patches.kzm9g/0050-ARM-move-initialization-of-the-high_memory-variable-.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 778219539dbd4ac7a63ab82fdba8b529e61f1aeb Mon Sep 17 00:00:00 2001
-From: Nicolas Pitre <nicolas.pitre@linaro.org>
-Date: Sun, 18 Sep 2011 22:40:00 -0400
-Subject: ARM: move initialization of the high_memory variable earlier
-
-Some upcoming changes must know the VMALLOC_START value, which is based
-on high_memory, before bootmem_init() is called.
-
-The best location to set it is in sanity_check_meminfo() where the needed
-computation is already done, and in the non MMU case it is trivial to do
-now that the meminfo array is already sorted at that point.
-
-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-(cherry picked from commit 55a8173cfe1c6b489f8f5705282c762aed2e265e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mm/init.c | 2 --
- arch/arm/mm/mmu.c | 1 +
- arch/arm/mm/nommu.c | 2 ++
- 3 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index db04a3e5..0530019 100644
---- a/arch/arm/mm/init.c
-+++ b/arch/arm/mm/init.c
-@@ -391,8 +391,6 @@ void __init bootmem_init(void)
- */
- arm_bootmem_free(min, max_low, max_high);
-
-- high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
--
- /*
- * This doesn't seem to be used by the Linux memory manager any
- * more, but is used by ll_rw_block. If we can get rid of it, we
-diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index 594d677..eefb8ed 100644
---- a/arch/arm/mm/mmu.c
-+++ b/arch/arm/mm/mmu.c
-@@ -852,6 +852,7 @@ void __init sanity_check_meminfo(void)
- }
- #endif
- meminfo.nr_banks = j;
-+ high_memory = __va(lowmem_limit - 1) + 1;
- memblock_set_current_limit(lowmem_limit);
- }
-
-diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
-index 941a98c..9348730 100644
---- a/arch/arm/mm/nommu.c
-+++ b/arch/arm/mm/nommu.c
-@@ -29,6 +29,8 @@ void __init arm_mm_memblock_reserve(void)
-
- void __init sanity_check_meminfo(void)
- {
-+ phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
-+ high_memory = __va(end - 1) + 1;
- }
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0050-mmc-tmio_mmc-remove-unused-sdio_irq_enabled-flag.patch b/patches.kzm9g/0050-mmc-tmio_mmc-remove-unused-sdio_irq_enabled-flag.patch
deleted file mode 100644
index 0e15dcedde89cd..00000000000000
--- a/patches.kzm9g/0050-mmc-tmio_mmc-remove-unused-sdio_irq_enabled-flag.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From a863686f8649014af31553e5d294fb6fc34a0406 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:14 +0100
-Subject: mmc: tmio_mmc: remove unused sdio_irq_enabled flag
-
-The sdio_irq_enabled member of struct tmio_mmc_host is a left-over from the
-previously removed SDIO IRQ workaround. It is no longer needed and can now
-be removed too.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 5bd99c375e141b8dd12e18c45617158f98920e57)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc.h | 1 -
- drivers/mmc/host/tmio_mmc_pio.c | 2 --
- 2 files changed, 3 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index edfcfd7..d857f5c 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -47,7 +47,6 @@ struct tmio_mmc_host {
- struct mmc_request *mrq;
- struct mmc_data *data;
- struct mmc_host *mmc;
-- unsigned int sdio_irq_enabled;
-
- /* Controller power state */
- bool power;
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 4a2829c..97110ba 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -127,7 +127,6 @@ static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
- struct tmio_mmc_host *host = mmc_priv(mmc);
-
- if (enable) {
-- host->sdio_irq_enabled = 1;
- host->sdio_irq_mask = TMIO_SDIO_MASK_ALL &
- ~TMIO_SDIO_STAT_IOIRQ;
- sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
-@@ -136,7 +135,6 @@ static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
- host->sdio_irq_mask = TMIO_SDIO_MASK_ALL;
- sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
- sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
-- host->sdio_irq_enabled = 0;
- }
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0051-ARM-move-iotable-mappings-within-the-vmalloc-region.patch b/patches.kzm9g/0051-ARM-move-iotable-mappings-within-the-vmalloc-region.patch
deleted file mode 100644
index 720421b0e5fa32..00000000000000
--- a/patches.kzm9g/0051-ARM-move-iotable-mappings-within-the-vmalloc-region.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From dbc2d5048de20169fff5e5c5032e89a4129cfc3b Mon Sep 17 00:00:00 2001
-From: Nicolas Pitre <nicolas.pitre@linaro.org>
-Date: Thu, 25 Aug 2011 00:35:59 -0400
-Subject: ARM: move iotable mappings within the vmalloc region
-
-In order to remove the build time variation between different SOCs with
-regards to VMALLOC_END, the iotable mappings are now allocated inside
-the vmalloc region. This allows for VMALLOC_END to be identical across
-all machines.
-
-The value for VMALLOC_END is now set to 0xff000000 which is right where
-the consistent DMA area starts.
-
-To accommodate all static mappings on machines with possible highmem usage,
-the default vmalloc area size is changed to 240 MB so that VMALLOC_START
-is no higher than 0xf0000000 by default.
-
-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-Tested-by: Stephen Warren <swarren@nvidia.com>
-Tested-by: Kevin Hilman <khilman@ti.com>
-Tested-by: Jamie Iles <jamie@jamieiles.com>
-(cherry picked from commit 0536bdf33faff4d940ac094c77998cfac368cfff)
-
-Conflicts:
- arch/arm/mm/mmu.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/arm/memory.txt | 11 ++++-----
- arch/arm/include/asm/pgtable.h | 8 +------
- arch/arm/mm/mmu.c | 49 ++++++++++++++++++++++++++++------------
- 3 files changed, 41 insertions(+), 27 deletions(-)
-
-diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
-index 771d48d..208a2d4 100644
---- a/Documentation/arm/memory.txt
-+++ b/Documentation/arm/memory.txt
-@@ -51,15 +51,14 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned
- ff000000 ffbfffff Reserved for future expansion of DMA
- mapping region.
-
--VMALLOC_END feffffff Free for platform use, recommended.
-- VMALLOC_END must be aligned to a 2MB
-- boundary.
--
- VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space.
- Memory returned by vmalloc/ioremap will
- be dynamically placed in this region.
-- VMALLOC_START may be based upon the value
-- of the high_memory variable.
-+ Machine specific static mappings are also
-+ located here through iotable_init().
-+ VMALLOC_START is based upon the value
-+ of the high_memory variable, and VMALLOC_END
-+ is equal to 0xff000000.
-
- PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region.
- This maps the platforms RAM, and typically
-diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
-index 5750704..950dee3 100644
---- a/arch/arm/include/asm/pgtable.h
-+++ b/arch/arm/include/asm/pgtable.h
-@@ -21,7 +21,6 @@
- #else
-
- #include <asm/memory.h>
--#include <mach/vmalloc.h>
- #include <asm/pgtable-hwdef.h>
-
- /*
-@@ -31,15 +30,10 @@
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
-- *
-- * Note that platforms may override VMALLOC_START, but they must provide
-- * VMALLOC_END. VMALLOC_END defines the (exclusive) limit of this space,
-- * which may not overlap IO space.
- */
--#ifndef VMALLOC_START
- #define VMALLOC_OFFSET (8*1024*1024)
- #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
--#endif
-+#define VMALLOC_END 0xff000000UL
-
- /*
- * Hardware-wise, we have a two level page table structure, where the first
-diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index eefb8ed..6a98c4a 100644
---- a/arch/arm/mm/mmu.c
-+++ b/arch/arm/mm/mmu.c
-@@ -15,6 +15,7 @@
- #include <linux/nodemask.h>
- #include <linux/memblock.h>
- #include <linux/fs.h>
-+#include <linux/vmalloc.h>
-
- #include <asm/cputype.h>
- #include <asm/sections.h>
-@@ -521,13 +522,18 @@ EXPORT_SYMBOL(phys_mem_access_prot);
-
- #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
-
--static void __init *early_alloc(unsigned long sz)
-+static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
- {
-- void *ptr = __va(memblock_alloc(sz, sz));
-+ void *ptr = __va(memblock_alloc(sz, align));
- memset(ptr, 0, sz);
- return ptr;
- }
-
-+static void __init *early_alloc(unsigned long sz)
-+{
-+ return early_alloc_aligned(sz, sz);
-+}
-+
- static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
- {
- if (pmd_none(*pmd)) {
-@@ -677,9 +683,10 @@ static void __init create_mapping(struct map_desc *md)
- }
-
- if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
-- md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
-+ md->virtual >= PAGE_OFFSET &&
-+ (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
- printk(KERN_WARNING "BUG: mapping for 0x%08llx"
-- " at 0x%08lx overlaps vmalloc space\n",
-+ " at 0x%08lx out of vmalloc space\n",
- (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
- }
-
-@@ -721,18 +728,32 @@ static void __init create_mapping(struct map_desc *md)
- */
- void __init iotable_init(struct map_desc *io_desc, int nr)
- {
-- int i;
-+ struct map_desc *md;
-+ struct vm_struct *vm;
-+
-+ if (!nr)
-+ return;
-
-- for (i = 0; i < nr; i++)
-- create_mapping(io_desc + i);
-+ vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
-+
-+ for (md = io_desc; nr; md++, nr--) {
-+ create_mapping(md);
-+ vm->addr = (void *)(md->virtual & PAGE_MASK);
-+ vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
-+ vm->phys_addr = __pfn_to_phys(md->pfn);
-+ vm->flags = VM_IOREMAP;
-+ vm->caller = iotable_init;
-+ vm_area_add_early(vm++);
-+ }
- }
-
--static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M);
-+static void * __initdata vmalloc_min =
-+ (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
-
- /*
- * vmalloc=size forces the vmalloc area to be exactly 'size'
- * bytes. This can be used to increase (or decrease) the vmalloc
-- * area - the default is 128m.
-+ * area - the default is 240m.
- */
- static int __init early_vmalloc(char *arg)
- {
-@@ -883,10 +904,10 @@ static inline void prepare_page_table(void)
-
- /*
- * Clear out all the kernel space mappings, except for the first
-- * memory bank, up to the end of the vmalloc region.
-+ * memory bank, up to the vmalloc region.
- */
- for (addr = __phys_to_virt(end);
-- addr < VMALLOC_END; addr += PGDIR_SIZE)
-+ addr < VMALLOC_START; addr += PGDIR_SIZE)
- pmd_clear(pmd_off_k(addr));
- }
-
-@@ -911,8 +932,8 @@ void __init arm_mm_memblock_reserve(void)
- }
-
- /*
-- * Set up device the mappings. Since we clear out the page tables for all
-- * mappings above VMALLOC_END, we will remove any debug device mappings.
-+ * Set up the device mappings. Since we clear out the page tables for all
-+ * mappings above VMALLOC_START, we will remove any debug device mappings.
- * This means you have to be careful how you debug this function, or any
- * called function. This means you can't use any function or debugging
- * method which may touch any device, otherwise the kernel _will_ crash.
-@@ -927,7 +948,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
- */
- vectors_page = early_alloc(PAGE_SIZE);
-
-- for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
-+ for (addr = VMALLOC_START; addr; addr += PGDIR_SIZE)
- pmd_clear(pmd_off_k(addr));
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0051-mmc-sh_mobile_sdhi-do-not-manage-PM-clocks-manually.patch b/patches.kzm9g/0051-mmc-sh_mobile_sdhi-do-not-manage-PM-clocks-manually.patch
deleted file mode 100644
index 3d6c1a941d4438..00000000000000
--- a/patches.kzm9g/0051-mmc-sh_mobile_sdhi-do-not-manage-PM-clocks-manually.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 3305f89b5921cc5a8174d1fa302be7ff8fd7085b Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:15 +0100
-Subject: mmc: sh_mobile_sdhi: do not manage PM clocks manually
-
-On sh-mobile platforms the MMC clock frequency for the TMIO MMC unit is
-obtained from the same clock, as the one, that runtime power-manages the
-controller. The SDHI glue code has to access that clock directly,
-bypassing the runtime PM framework, to get its frequency, but it
-shouldn't enable or disable it.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 996bc8aebd2cd5b6d4c5d85085f171fa2447f364)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index cb279b4..f91c3aa 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -117,8 +117,6 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- goto eclkget;
- }
-
-- clk_enable(priv->clk);
--
- mmc_data->hclk = clk_get_rate(priv->clk);
- mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
- mmc_data->get_cd = sh_mobile_sdhi_get_cd;
-@@ -233,7 +231,6 @@ eirq_sdio:
- eirq_card_detect:
- tmio_mmc_host_remove(host);
- eprobe:
-- clk_disable(priv->clk);
- clk_put(priv->clk);
- eclkget:
- kfree(priv);
-@@ -259,7 +256,6 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
- free_irq(irq, host);
- }
-
-- clk_disable(priv->clk);
- clk_put(priv->clk);
- kfree(priv);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0052-ARM-simplify-__iounmap-when-dealing-with-section-bas.patch b/patches.kzm9g/0052-ARM-simplify-__iounmap-when-dealing-with-section-bas.patch
deleted file mode 100644
index 85b4c27b1b4d48..00000000000000
--- a/patches.kzm9g/0052-ARM-simplify-__iounmap-when-dealing-with-section-bas.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 9c711a650671536e915cea3661fc7caa2a4ab487 Mon Sep 17 00:00:00 2001
-From: Nicolas Pitre <nicolas.pitre@linaro.org>
-Date: Thu, 15 Sep 2011 22:12:19 -0400
-Subject: ARM: simplify __iounmap() when dealing with section based mapping
-
-Firstly, there is no need to have a double pointer here as we're only
-walking the vmlist and not modifying it.
-
-Secondly, for the same reason, we don't need a write lock but only a
-read lock here, since the lock only protects the coherency of the list
-nothing else.
-
-Lastly, the reason for holding a lock is not what the comment says, so
-let's remove that misleading piece of information.
-
-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-(cherry picked from commit 6ee723a6570a897208b76ab3e9a495e9106b2f8c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mm/ioremap.c | 20 +++++++++-----------
- 1 file changed, 9 insertions(+), 11 deletions(-)
-
-diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
-index ab50627..1ddcd8a 100644
---- a/arch/arm/mm/ioremap.c
-+++ b/arch/arm/mm/ioremap.c
-@@ -293,26 +293,24 @@ void __iounmap(volatile void __iomem *io_addr)
- {
- void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
- #ifndef CONFIG_SMP
-- struct vm_struct **p, *tmp;
-+ struct vm_struct *vm;
-
- /*
- * If this is a section based mapping we need to handle it
- * specially as the VM subsystem does not know how to handle
-- * such a beast. We need the lock here b/c we need to clear
-- * all the mappings before the area can be reclaimed
-- * by someone else.
-+ * such a beast.
- */
-- write_lock(&vmlist_lock);
-- for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
-- if ((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {
-- if (tmp->flags & VM_ARM_SECTION_MAPPING) {
-- unmap_area_sections((unsigned long)tmp->addr,
-- tmp->size);
-+ read_lock(&vmlist_lock);
-+ for (vm = vmlist; vm; vm = vm->next) {
-+ if ((vm->flags & VM_IOREMAP) && (vm->addr == addr)) {
-+ if (vm->flags & VM_ARM_SECTION_MAPPING) {
-+ unmap_area_sections((unsigned long)vm->addr,
-+ vm->size);
- }
- break;
- }
- }
-- write_unlock(&vmlist_lock);
-+ read_unlock(&vmlist_lock);
- #endif
-
- vunmap(addr);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0052-mmc-tmio-cosmetic-prettify-the-tmio_mmc_set_ios-func.patch b/patches.kzm9g/0052-mmc-tmio-cosmetic-prettify-the-tmio_mmc_set_ios-func.patch
deleted file mode 100644
index f4c6d66f0d0095..00000000000000
--- a/patches.kzm9g/0052-mmc-tmio-cosmetic-prettify-the-tmio_mmc_set_ios-func.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 62da637655deae3561b0ba9fd230afa6e15cc221 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 9 Feb 2012 22:57:16 +0100
-Subject: mmc: tmio: cosmetic: prettify the tmio_mmc_set_ios() function
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 4932bd64a2bb4e80b79efb20c4736ac3b30ba7fe)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/tmio_mmc_pio.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 97110ba..2500163 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -759,6 +759,7 @@ fail:
- static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- {
- struct tmio_mmc_host *host = mmc_priv(mmc);
-+ struct device *dev = &host->pdev->dev;
- unsigned long flags;
-
- mutex_lock(&host->ios_lock);
-@@ -766,13 +767,13 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- spin_lock_irqsave(&host->lock, flags);
- if (host->mrq) {
- if (IS_ERR(host->mrq)) {
-- dev_dbg(&host->pdev->dev,
-+ dev_dbg(dev,
- "%s.%d: concurrent .set_ios(), clk %u, mode %u\n",
- current->comm, task_pid_nr(current),
- ios->clock, ios->power_mode);
- host->mrq = ERR_PTR(-EINTR);
- } else {
-- dev_dbg(&host->pdev->dev,
-+ dev_dbg(dev,
- "%s.%d: CMD%u active since %lu, now %lu!\n",
- current->comm, task_pid_nr(current),
- host->mrq->cmd->opcode, host->last_req_ts, jiffies);
-@@ -795,7 +796,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- */
- if (ios->power_mode == MMC_POWER_ON && ios->clock) {
- if (!host->power) {
-- pm_runtime_get_sync(&host->pdev->dev);
-+ pm_runtime_get_sync(dev);
- host->power = true;
- }
- tmio_mmc_set_clock(host, ios->clock);
-@@ -809,7 +810,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- host->set_pwr(host->pdev, 0);
- if (host->power) {
- host->power = false;
-- pm_runtime_put(&host->pdev->dev);
-+ pm_runtime_put(dev);
- }
- tmio_mmc_clk_stop(host);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0053-ARM-add-generic-ioremap-optimization-by-reusing-stat.patch b/patches.kzm9g/0053-ARM-add-generic-ioremap-optimization-by-reusing-stat.patch
deleted file mode 100644
index 1ecd497ee2d9bd..00000000000000
--- a/patches.kzm9g/0053-ARM-add-generic-ioremap-optimization-by-reusing-stat.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 5be0e66269ddfd8ca3dee6512e573b1f461a6faf Mon Sep 17 00:00:00 2001
-From: Nicolas Pitre <nicolas.pitre@linaro.org>
-Date: Fri, 16 Sep 2011 01:14:23 -0400
-Subject: ARM: add generic ioremap optimization by reusing static mappings
-
-Now that we have all the static mappings from iotable_init() located
-in the vmalloc area, it is trivial to optimize ioremap by reusing those
-static mappings when the requested physical area fits in one of them,
-and so in a generic way for all platforms.
-
-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-Tested-by: Stephen Warren <swarren@nvidia.com>
-Tested-by: Kevin Hilman <khilman@ti.com>
-Tested-by: Jamie Iles <jamie@jamieiles.com>
-(cherry picked from commit 576d2f2525612ecb5af029a76f21f22a3b82563d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mm/ioremap.c | 72 ++++++++++++++++++++++++++++++++-----------------
- arch/arm/mm/mm.h | 14 ++++++++++
- arch/arm/mm/mmu.c | 3 ++-
- 3 files changed, 64 insertions(+), 25 deletions(-)
-
-diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
-index 1ddcd8a..b5900f2 100644
---- a/arch/arm/mm/ioremap.c
-+++ b/arch/arm/mm/ioremap.c
-@@ -36,12 +36,6 @@
- #include <asm/mach/map.h>
- #include "mm.h"
-
--/*
-- * Used by ioremap() and iounmap() code to mark (super)section-mapped
-- * I/O regions in vm_struct->flags field.
-- */
--#define VM_ARM_SECTION_MAPPING 0x80000000
--
- int ioremap_page(unsigned long virt, unsigned long phys,
- const struct mem_type *mtype)
- {
-@@ -201,12 +195,6 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
- if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
- return NULL;
-
-- /*
-- * Don't allow RAM to be mapped - this causes problems with ARMv6+
-- */
-- if (WARN_ON(pfn_valid(pfn)))
-- return NULL;
--
- type = get_mem_type(mtype);
- if (!type)
- return NULL;
-@@ -216,6 +204,34 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
- */
- size = PAGE_ALIGN(offset + size);
-
-+ /*
-+ * Try to reuse one of the static mapping whenever possible.
-+ */
-+ read_lock(&vmlist_lock);
-+ for (area = vmlist; area; area = area->next) {
-+ if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000))
-+ break;
-+ if (!(area->flags & VM_ARM_STATIC_MAPPING))
-+ continue;
-+ if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
-+ continue;
-+ if (__phys_to_pfn(area->phys_addr) > pfn ||
-+ __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
-+ continue;
-+ /* we can drop the lock here as we know *area is static */
-+ read_unlock(&vmlist_lock);
-+ addr = (unsigned long)area->addr;
-+ addr += __pfn_to_phys(pfn) - area->phys_addr;
-+ return (void __iomem *) (offset + addr);
-+ }
-+ read_unlock(&vmlist_lock);
-+
-+ /*
-+ * Don't allow RAM to be mapped - this causes problems with ARMv6+
-+ */
-+ if (WARN_ON(pfn_valid(pfn)))
-+ return NULL;
-+
- area = get_vm_area_caller(size, VM_IOREMAP, caller);
- if (!area)
- return NULL;
-@@ -292,26 +308,34 @@ EXPORT_SYMBOL(__arm_ioremap);
- void __iounmap(volatile void __iomem *io_addr)
- {
- void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
--#ifndef CONFIG_SMP
- struct vm_struct *vm;
-
-- /*
-- * If this is a section based mapping we need to handle it
-- * specially as the VM subsystem does not know how to handle
-- * such a beast.
-- */
- read_lock(&vmlist_lock);
- for (vm = vmlist; vm; vm = vm->next) {
-- if ((vm->flags & VM_IOREMAP) && (vm->addr == addr)) {
-- if (vm->flags & VM_ARM_SECTION_MAPPING) {
-- unmap_area_sections((unsigned long)vm->addr,
-- vm->size);
-- }
-+ if (vm->addr > addr)
- break;
-+ if (!(vm->flags & VM_IOREMAP))
-+ continue;
-+ /* If this is a static mapping we must leave it alone */
-+ if ((vm->flags & VM_ARM_STATIC_MAPPING) &&
-+ (vm->addr <= addr) && (vm->addr + vm->size > addr)) {
-+ read_unlock(&vmlist_lock);
-+ return;
- }
-+#ifndef CONFIG_SMP
-+ /*
-+ * If this is a section based mapping we need to handle it
-+ * specially as the VM subsystem does not know how to handle
-+ * such a beast.
-+ */
-+ if ((vm->addr == addr) &&
-+ (vm->flags & VM_ARM_SECTION_MAPPING)) {
-+ unmap_area_sections((unsigned long)vm->addr, vm->size);
-+ break;
-+ }
-+#endif
- }
- read_unlock(&vmlist_lock);
--#endif
-
- vunmap(addr);
- }
-diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
-index 5b3d7d5..26f3a2c 100644
---- a/arch/arm/mm/mm.h
-+++ b/arch/arm/mm/mm.h
-@@ -21,6 +21,20 @@ const struct mem_type *get_mem_type(unsigned int type);
-
- extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
-
-+/*
-+ * ARM specific vm_struct->flags bits.
-+ */
-+
-+/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
-+#define VM_ARM_SECTION_MAPPING 0x80000000
-+
-+/* permanent static mappings from iotable_init() */
-+#define VM_ARM_STATIC_MAPPING 0x40000000
-+
-+/* mapping type (attributes) for permanent static mappings */
-+#define VM_ARM_MTYPE(mt) ((mt) << 20)
-+#define VM_ARM_MTYPE_MASK (0x1f << 20)
-+
- #endif
-
- void __init bootmem_init(void);
-diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index 6a98c4a..ce0e427 100644
---- a/arch/arm/mm/mmu.c
-+++ b/arch/arm/mm/mmu.c
-@@ -741,7 +741,8 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
- vm->addr = (void *)(md->virtual & PAGE_MASK);
- vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
- vm->phys_addr = __pfn_to_phys(md->pfn);
-- vm->flags = VM_IOREMAP;
-+ vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
-+ vm->flags |= VM_ARM_MTYPE(md->type);
- vm->caller = iotable_init;
- vm_area_add_early(vm++);
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0053-mmc-sh_mobile_sdhi-add-a-callback-for-board-specific.patch b/patches.kzm9g/0053-mmc-sh_mobile_sdhi-add-a-callback-for-board-specific.patch
deleted file mode 100644
index 58860876e860ab..00000000000000
--- a/patches.kzm9g/0053-mmc-sh_mobile_sdhi-add-a-callback-for-board-specific.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 0a98733a6514780187f2f435f3057949932d531b Mon Sep 17 00:00:00 2001
-From: Bastian Hecht <hechtb@googlemail.com>
-Date: Fri, 16 Mar 2012 12:19:29 -0400
-Subject: mmc: sh_mobile_sdhi: add a callback for board specific init code
-
-Some boards need a preliminary setup stage to prepare the sdhi
-controller.
-
-Signed-off-by: Bastian Hecht <hechtb@gmail.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit e82b4ac94e5c43fad51b975aed058858ceda1f0f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 13 +++++++++++++
- include/linux/mmc/sh_mobile_sdhi.h | 4 ++++
- 2 files changed, 17 insertions(+)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index f91c3aa..07ff3fe 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -109,6 +109,12 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- mmc_data = &priv->mmc_data;
- p->pdata = mmc_data;
-
-+ if (p->init) {
-+ ret = p->init(pdev);
-+ if (ret)
-+ goto einit;
-+ }
-+
- snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
- priv->clk = clk_get(&pdev->dev, clk_name);
- if (IS_ERR(priv->clk)) {
-@@ -233,6 +239,9 @@ eirq_card_detect:
- eprobe:
- clk_put(priv->clk);
- eclkget:
-+ if (p->cleanup)
-+ p->cleanup(pdev);
-+einit:
- kfree(priv);
- return ret;
- }
-@@ -257,6 +266,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
- }
-
- clk_put(priv->clk);
-+
-+ if (p->cleanup)
-+ p->cleanup(pdev);
-+
- kfree(priv);
-
- return 0;
-diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
-index 082a736..686b85b 100644
---- a/include/linux/mmc/sh_mobile_sdhi.h
-+++ b/include/linux/mmc/sh_mobile_sdhi.h
-@@ -20,6 +20,10 @@ struct sh_mobile_sdhi_info {
- struct tmio_mmc_data *pdata;
- void (*set_pwr)(struct platform_device *pdev, int state);
- int (*get_cd)(struct platform_device *pdev);
-+
-+ /* callbacks for board specific setup code */
-+ int (*init)(struct platform_device *pdev);
-+ void (*cleanup)(struct platform_device *pdev);
- };
-
- #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0054-ARM-mach-shmobile-Introduce-shmobile_setup_delay.patch b/patches.kzm9g/0054-ARM-mach-shmobile-Introduce-shmobile_setup_delay.patch
deleted file mode 100644
index df4fe7b07a5135..00000000000000
--- a/patches.kzm9g/0054-ARM-mach-shmobile-Introduce-shmobile_setup_delay.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 4db83a8c2af822cc5ae76ea212c7a77b20a637b5 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 28 Mar 2012 19:22:30 +0900
-Subject: ARM: mach-shmobile: Introduce shmobile_setup_delay()
-
-Add the function shmobile_setup_delay() to let platforms
-configure their maximum loops per jiffy delay. With this
-jiffies calculation done the dependency on early timer
-is removed.
-
-In the future this allows us to assign timers
-using the regular driver model via the device tree.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0f2c9f20e4e339de30cfd5613dfa9505e7b9c58b)
-
-Conflicts:
- arch/arm/mach-shmobile/include/mach/common.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/common.h | 2 ++
- arch/arm/mach-shmobile/timer.c | 17 +++++++++++++++++
- 2 files changed, 19 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index c77b3a1..bc3aa3e 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -3,6 +3,8 @@
-
- extern void shmobile_earlytimer_init(void);
- extern struct sys_timer shmobile_timer;
-+extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
-+ unsigned int mult, unsigned int div);
- extern void shmobile_setup_console(void);
- extern void shmobile_secondary_vector(void);
- struct clk;
-diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
-index be1ad70..b323e3c 100644
---- a/arch/arm/mach-shmobile/timer.c
-+++ b/arch/arm/mach-shmobile/timer.c
-@@ -19,8 +19,25 @@
- *
- */
- #include <linux/platform_device.h>
-+#include <linux/delay.h>
- #include <asm/mach/time.h>
-
-+void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
-+ unsigned int mult, unsigned int div)
-+{
-+ /* calculate a worst-case loops-per-jiffy value
-+ * based on maximum cpu core mhz setting and the
-+ * __delay() implementation in arch/arm/lib/delay.S
-+ *
-+ * this will result in a longer delay than expected
-+ * when the cpu core runs on lower frequencies.
-+ */
-+
-+ unsigned int value = (1000000 * mult) / (HZ * div);
-+
-+ lpj_fine = max_cpu_core_mhz * value;
-+}
-+
- static void __init shmobile_late_time_init(void)
- {
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0054-mmc-sh_mobile_sdhi-support-modular-mmc-core-with-non.patch b/patches.kzm9g/0054-mmc-sh_mobile_sdhi-support-modular-mmc-core-with-non.patch
deleted file mode 100644
index bbffae5a0f631f..00000000000000
--- a/patches.kzm9g/0054-mmc-sh_mobile_sdhi-support-modular-mmc-core-with-non.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 0107e6bd1c3993bcd3cefb7406bff5976921bced Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Fri, 9 Mar 2012 10:16:00 +0100
-Subject: mmc: sh_mobile_sdhi: support modular mmc-core with non-standard
- hotplug
-
-Currently if a platform wants to implement a non-standard card-detection
-method, it would need to call tmio_mmc_cd_wakeup(), which is an inline
-function, calling mmc_detect_change(). For this the platform would have
-to link mmc_core statically into the kernel, losing the ability to build
-it as a module. This patch adds a callback to the sh_mobile_sdhi driver,
-which eliminates this dependency.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 7f524217439cc17da74523582c303cced432713e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mobile_sdhi.c | 11 ++++++++++-
- include/linux/mmc/sh_mobile_sdhi.h | 11 ++++++++++-
- 2 files changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 07ff3fe..934b68e 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -90,6 +90,15 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
- return 0;
- }
-
-+static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
-+{
-+ mmc_detect_change(dev_get_drvdata(&pdev->dev), msecs_to_jiffies(100));
-+}
-+
-+static const struct sh_mobile_sdhi_ops sdhi_ops = {
-+ .cd_wakeup = sh_mobile_sdhi_cd_wakeup,
-+};
-+
- static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- {
- struct sh_mobile_sdhi *priv;
-@@ -110,7 +119,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
- p->pdata = mmc_data;
-
- if (p->init) {
-- ret = p->init(pdev);
-+ ret = p->init(pdev, &sdhi_ops);
- if (ret)
- goto einit;
- }
-diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
-index 686b85b..e94e620 100644
---- a/include/linux/mmc/sh_mobile_sdhi.h
-+++ b/include/linux/mmc/sh_mobile_sdhi.h
-@@ -10,6 +10,14 @@ struct tmio_mmc_data;
- #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard"
- #define SH_MOBILE_SDHI_IRQ_SDIO "sdio"
-
-+/**
-+ * struct sh_mobile_sdhi_ops - SDHI driver callbacks
-+ * @cd_wakeup: trigger a card-detection run
-+ */
-+struct sh_mobile_sdhi_ops {
-+ void (*cd_wakeup)(const struct platform_device *pdev);
-+};
-+
- struct sh_mobile_sdhi_info {
- int dma_slave_tx;
- int dma_slave_rx;
-@@ -22,7 +30,8 @@ struct sh_mobile_sdhi_info {
- int (*get_cd)(struct platform_device *pdev);
-
- /* callbacks for board specific setup code */
-- int (*init)(struct platform_device *pdev);
-+ int (*init)(struct platform_device *pdev,
-+ const struct sh_mobile_sdhi_ops *ops);
- void (*cleanup)(struct platform_device *pdev);
- };
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0055-ARM-mach-shmobile-Allow-SoC-specific-CPU-kill-code.patch b/patches.kzm9g/0055-ARM-mach-shmobile-Allow-SoC-specific-CPU-kill-code.patch
deleted file mode 100644
index 4c08f8fffb2b53..00000000000000
--- a/patches.kzm9g/0055-ARM-mach-shmobile-Allow-SoC-specific-CPU-kill-code.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 05f453548b4b9fdf0ab8e36a15c9ef74b21f27e2 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 28 Dec 2011 16:47:16 +0900
-Subject: ARM: mach-shmobile: Allow SoC specific CPU kill code
-
-Add the function shmobile_platform_kill_cpu() to allow
-SoC specific code to tie in their CPU shutdown code.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 8b306796995609c281f6d32b3cbaa814551ad5ac)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/hotplug.c | 3 ++-
- arch/arm/mach-shmobile/include/mach/common.h | 1 +
- arch/arm/mach-shmobile/platsmp.c | 5 +++++
- 3 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
-index 238a0d9..aee3a10 100644
---- a/arch/arm/mach-shmobile/hotplug.c
-+++ b/arch/arm/mach-shmobile/hotplug.c
-@@ -12,10 +12,11 @@
- #include <linux/kernel.h>
- #include <linux/errno.h>
- #include <linux/smp.h>
-+#include <mach/common.h>
-
- int platform_cpu_kill(unsigned int cpu)
- {
-- return 1;
-+ return shmobile_platform_cpu_kill(cpu);
- }
-
- void platform_cpu_die(unsigned int cpu)
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index bc3aa3e..8b88b80 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -7,6 +7,7 @@ extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
- unsigned int mult, unsigned int div);
- extern void shmobile_setup_console(void);
- extern void shmobile_secondary_vector(void);
-+extern int shmobile_platform_cpu_kill(unsigned int cpu);
- struct clk;
- extern int shmobile_clk_init(void);
- extern void shmobile_handle_irq_intc(struct pt_regs *);
-diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
-index 2cc8930..1103ce5 100644
---- a/arch/arm/mach-shmobile/platsmp.c
-+++ b/arch/arm/mach-shmobile/platsmp.c
-@@ -37,6 +37,11 @@ static void __init shmobile_smp_prepare_cpus(void)
- sh73a0_smp_prepare_cpus();
- }
-
-+int shmobile_platform_cpu_kill(unsigned int cpu)
-+{
-+ return 1;
-+}
-+
- void __cpuinit platform_secondary_init(unsigned int cpu)
- {
- trace_hardirqs_off();
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0055-mmc-Standardize-header-file-inclusion-checks.patch b/patches.kzm9g/0055-mmc-Standardize-header-file-inclusion-checks.patch
deleted file mode 100644
index 2ba0ecbdc76767..00000000000000
--- a/patches.kzm9g/0055-mmc-Standardize-header-file-inclusion-checks.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 905868b59a760b3df8ce9ae406534a8299e0a0e2 Mon Sep 17 00:00:00 2001
-From: "Robert P. J. Day" <rpjday@crashcourse.ca>
-Date: Fri, 27 May 2011 16:04:03 -0400
-Subject: mmc: Standardize header file inclusion checks.
-
-Standardize the checks for multiple MMC header file inclusion,
-including adding comments to terminating #endif's, and fixing
-one incorrect comment.
-
-Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 100e918610b7487fa18db97b3879cd8d1fdd5974)
-
-Conflicts:
-
- include/linux/mmc/boot.h
- include/linux/mmc/card.h
- include/linux/mmc/core.h
- include/linux/mmc/dw_mmc.h
- include/linux/mmc/host.h
- include/linux/mmc/ioctl.h
- include/linux/mmc/mmc.h
- include/linux/mmc/pm.h
- include/linux/mmc/sd.h
- include/linux/mmc/sdhci-spear.h
- include/linux/mmc/sdhci.h
- include/linux/mmc/sdio.h
- include/linux/mmc/sdio_func.h
- include/linux/mmc/sdio_ids.h
- include/linux/mmc/sh_mobile_sdhi.h
- include/linux/mmc/tmio.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/mmc/sh_mmcif.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
-index 9eb9b4b..0222cd8 100644
---- a/include/linux/mmc/sh_mmcif.h
-+++ b/include/linux/mmc/sh_mmcif.h
-@@ -11,8 +11,8 @@
- *
- */
-
--#ifndef __SH_MMCIF_H__
--#define __SH_MMCIF_H__
-+#ifndef LINUX_MMC_SH_MMCIF_H
-+#define LINUX_MMC_SH_MMCIF_H
-
- #include <linux/io.h>
- #include <linux/platform_device.h>
-@@ -220,4 +220,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
- sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
- }
-
--#endif /* __SH_MMCIF_H__ */
-+#endif /* LINUX_MMC_SH_MMCIF_H */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0056-ARM-mach-shmobile-Use-preset_lpj-with-calibrate_dela.patch b/patches.kzm9g/0056-ARM-mach-shmobile-Use-preset_lpj-with-calibrate_dela.patch
deleted file mode 100644
index 3b83af24fe5af5..00000000000000
--- a/patches.kzm9g/0056-ARM-mach-shmobile-Use-preset_lpj-with-calibrate_dela.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 0d710173dcca9b9e7c5ec0ddf109e9bbaa6d4a79 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 10 May 2012 00:37:48 +0200
-Subject: ARM / mach-shmobile: Use preset_lpj with calibrate_delay()
-
-Update the mach-shmobile shared delay calibration code for late
-timers. All existing in-tree non-DT socs are however using early
-timers today and they are unaffected by this change.
-
-The patch modifies shmobile_setup_delay() from using lpj_fine
-to preset_lpj. This change allows us to preset the worst case
-loops-per-jiffy value to all CPU cores on the system.
-
-The old code which made use of lpj_fine did not affect the
-secondary CPU cores which made it impossible to boot on SMP
-without early timers.
-
-Needed for SMP SoCs using late timers like EMEV2 or any other
-mach-shmobile SMP SoC that makes use of late timers via DT.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 173bf69a7af142e0325fa514954f6eeb2d20cc1d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/timer.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
-index b323e3c..a169cea 100644
---- a/arch/arm/mach-shmobile/timer.c
-+++ b/arch/arm/mach-shmobile/timer.c
-@@ -35,7 +35,8 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
-
- unsigned int value = (1000000 * mult) / (HZ * div);
-
-- lpj_fine = max_cpu_core_mhz * value;
-+ if (!preset_lpj)
-+ preset_lpj = max_cpu_core_mhz * value;
- }
-
- static void __init shmobile_late_time_init(void)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0056-mmc-sh_mmcif-maximize-power-saving.patch b/patches.kzm9g/0056-mmc-sh_mmcif-maximize-power-saving.patch
deleted file mode 100644
index 28e6383a2bf9f9..00000000000000
--- a/patches.kzm9g/0056-mmc-sh_mmcif-maximize-power-saving.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 896e44c328f1ab6c44097333ba1db7ae3a08ff5d Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 26 May 2011 15:33:30 +0200
-Subject: mmc: sh_mmcif: maximize power saving
-
-This patch uses runtime PM to allow the system to power down the MMC
-controller, when the MMC closk is switched off.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit c9b0cef23f8d2a16c97623d25d6e8f8e93a56e4b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 27 ++++++++++++++++++---------
- 1 file changed, 18 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 14f8edb..557886b 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -175,6 +175,7 @@ struct sh_mmcif_host {
- enum mmcif_state state;
- spinlock_t lock;
- bool power;
-+ bool card_present;
-
- /* DMA support */
- struct dma_chan *chan_rx;
-@@ -877,23 +878,23 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- spin_unlock_irqrestore(&host->lock, flags);
-
- if (ios->power_mode == MMC_POWER_UP) {
-- if (p->set_pwr)
-- p->set_pwr(host->pd, ios->power_mode);
-- if (!host->power) {
-+ if (!host->card_present) {
- /* See if we also get DMA */
- sh_mmcif_request_dma(host, host->pd->dev.platform_data);
-- pm_runtime_get_sync(&host->pd->dev);
-- host->power = true;
-+ host->card_present = true;
- }
- } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
- /* clock stop */
- sh_mmcif_clock_control(host, 0);
- if (ios->power_mode == MMC_POWER_OFF) {
-- if (host->power) {
-- pm_runtime_put(&host->pd->dev);
-+ if (host->card_present) {
- sh_mmcif_release_dma(host);
-- host->power = false;
-+ host->card_present = false;
- }
-+ }
-+ if (host->power) {
-+ pm_runtime_put(&host->pd->dev);
-+ host->power = false;
- if (p->down_pwr)
- p->down_pwr(host->pd);
- }
-@@ -901,8 +902,16 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- return;
- }
-
-- if (ios->clock)
-+ if (ios->clock) {
-+ if (!host->power) {
-+ if (p->set_pwr)
-+ p->set_pwr(host->pd, ios->power_mode);
-+ pm_runtime_get_sync(&host->pd->dev);
-+ host->power = true;
-+ sh_mmcif_sync_reset(host);
-+ }
- sh_mmcif_clock_control(host, ios->clock);
-+ }
-
- host->bus_width = ios->bus_width;
- host->state = STATE_IDLE;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0057-ARM-Undelete-KZM9D-mach-type.patch b/patches.kzm9g/0057-ARM-Undelete-KZM9D-mach-type.patch
deleted file mode 100644
index 5e93acec0931ad..00000000000000
--- a/patches.kzm9g/0057-ARM-Undelete-KZM9D-mach-type.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From cc8618aa381c26c3aaeb40ac9617adeaac14dbfc Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 14 May 2012 19:54:51 +0900
-Subject: ARM: Undelete KZM9D mach-type
-
-Undelete the KZM9D mach-type to allow build of board
-for EMEV2 SoC support.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-
-N.B: Not present upstream
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index 2997e56..e2e0d3f 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -462,6 +462,7 @@ msm7x27_surf MACH_MSM7X27_SURF MSM7X27_SURF 2705
- msm7x27_ffa MACH_MSM7X27_FFA MSM7X27_FFA 2706
- msm7x30_ffa MACH_MSM7X30_FFA MSM7X30_FFA 2707
- qsd8x50_surf MACH_QSD8X50_SURF QSD8X50_SURF 2708
-+kzm9d MACH_KZM9D KZM9D 3246
- mx53_evk MACH_MX53_EVK MX53_EVK 2716
- igep0030 MACH_IGEP0030 IGEP0030 2717
- sbc3530 MACH_SBC3530 SBC3530 2722
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0057-mmc-sh_mmcif-simplify-platform-data.patch b/patches.kzm9g/0057-mmc-sh_mmcif-simplify-platform-data.patch
deleted file mode 100644
index 3197c322c9b371..00000000000000
--- a/patches.kzm9g/0057-mmc-sh_mmcif-simplify-platform-data.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From e269a3b04e790e2b0c18d19a64358706363f9ace Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Tue, 30 Aug 2011 18:26:39 +0200
-Subject: mmc: sh_mmcif: simplify platform data
-
-Provide platforms with a simplified way to specify MMCIF DMA slave IDs in
-a way, similar to SDHI and other sh_dma clients.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 714c4a6e3a0f730834ec8a8bc83b2a6da33f54dc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 20 ++++++++++++++++----
- include/linux/mmc/sh_mmcif.h | 4 +++-
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 557886b..bd91c94 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -165,6 +165,8 @@ struct sh_mmcif_host {
- struct mmc_host *mmc;
- struct mmc_data *data;
- struct platform_device *pd;
-+ struct sh_dmae_slave dma_slave_tx;
-+ struct sh_dmae_slave dma_slave_rx;
- struct clk *hclk;
- unsigned int clk;
- int bus_width;
-@@ -323,25 +325,35 @@ static bool sh_mmcif_filter(struct dma_chan *chan, void *arg)
- static void sh_mmcif_request_dma(struct sh_mmcif_host *host,
- struct sh_mmcif_plat_data *pdata)
- {
-+ struct sh_dmae_slave *tx, *rx;
- host->dma_active = false;
-
- /* We can only either use DMA for both Tx and Rx or not use it at all */
- if (pdata->dma) {
-+ dev_warn(&host->pd->dev,
-+ "Update your platform to use embedded DMA slave IDs\n");
-+ tx = &pdata->dma->chan_priv_tx;
-+ rx = &pdata->dma->chan_priv_rx;
-+ } else {
-+ tx = &host->dma_slave_tx;
-+ tx->slave_id = pdata->slave_id_tx;
-+ rx = &host->dma_slave_rx;
-+ rx->slave_id = pdata->slave_id_rx;
-+ }
-+ if (tx->slave_id > 0 && rx->slave_id > 0) {
- dma_cap_mask_t mask;
-
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
-- host->chan_tx = dma_request_channel(mask, sh_mmcif_filter,
-- &pdata->dma->chan_priv_tx);
-+ host->chan_tx = dma_request_channel(mask, sh_mmcif_filter, tx);
- dev_dbg(&host->pd->dev, "%s: TX: got channel %p\n", __func__,
- host->chan_tx);
-
- if (!host->chan_tx)
- return;
-
-- host->chan_rx = dma_request_channel(mask, sh_mmcif_filter,
-- &pdata->dma->chan_priv_rx);
-+ host->chan_rx = dma_request_channel(mask, sh_mmcif_filter, rx);
- dev_dbg(&host->pd->dev, "%s: RX: got channel %p\n", __func__,
- host->chan_rx);
-
-diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
-index 0222cd8..04ff452 100644
---- a/include/linux/mmc/sh_mmcif.h
-+++ b/include/linux/mmc/sh_mmcif.h
-@@ -41,7 +41,9 @@ struct sh_mmcif_plat_data {
- void (*set_pwr)(struct platform_device *pdev, int state);
- void (*down_pwr)(struct platform_device *pdev);
- int (*get_cd)(struct platform_device *pdef);
-- struct sh_mmcif_dma *dma;
-+ struct sh_mmcif_dma *dma; /* Deprecated. Instead */
-+ unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */
-+ unsigned int slave_id_rx;
- u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
- unsigned long caps;
- u32 ocr;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0058-gpio-Emma-Mobile-GPIO-driver.patch b/patches.kzm9g/0058-gpio-Emma-Mobile-GPIO-driver.patch
deleted file mode 100644
index fd825b1f193902..00000000000000
--- a/patches.kzm9g/0058-gpio-Emma-Mobile-GPIO-driver.patch
+++ /dev/null
@@ -1,481 +0,0 @@
-From 1ed76280e95d4cba220d465a58caec2ba5c20632 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Fri, 11 May 2012 18:41:03 +0900
-Subject: gpio: Emma Mobile GPIO driver
-
-This patch adds a GPIO driver for the Emma Mobile line
-of SoCs. The driver is designed to be reusable between
-multiple SoCs that share the same basic building block,
-but so far it has only been used on Emma Mobile EV2.
-
-Each driver instance handles 32 GPIOs with individually
-maskable IRQs. The driver operates on two I/O memory
-ranges and the 32 GPIOs are hooked up to two interrupts.
-
-In the case of Emma Mobile EV2 this GPIO building block
-is used as main external interrupt controller hooking up
-159 GPIOS as 159 interrupts via 5 driver instances and
-10 interrupts to the GIC and the Cortex-A9 Dual.
-
-This version of the driver gets all configuration via
-struct resource and platform data, but DT bindings are
-currently in development and such support will be sent
-as a individual feature patch in the near future.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-
-N.B: This driver has been merged upsteram
-as commit a07e103ef08c6907d695a06467d7ee950796fccf.
-However, this code is an earlier version of
-the driver that doesn't make use of infrastructure
-that isn't present in Linux 3.0.
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/gpio/Kconfig | 6 +
- drivers/gpio/Makefile | 1 +
- drivers/gpio/gpio-em.c | 385 +++++++++++++++++++++++++++++++++
- include/linux/platform_data/gpio-em.h | 10 +
- 4 files changed, 402 insertions(+)
- create mode 100644 drivers/gpio/gpio-em.c
- create mode 100644 include/linux/platform_data/gpio-em.h
-
-diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
-index 2967002..6450431 100644
---- a/drivers/gpio/Kconfig
-+++ b/drivers/gpio/Kconfig
-@@ -86,6 +86,12 @@ config GPIO_IT8761E
- help
- Say yes here to support GPIO functionality of IT8761E super I/O chip.
-
-+config GPIO_EM
-+ tristate "Emma Mobile GPIO"
-+ depends on ARM
-+ help
-+ Say yes here to support GPIO on Renesas Emma Mobile SoCs.
-+
- config GPIO_EXYNOS4
- def_bool y
- depends on CPU_EXYNOS4210
-diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
-index b605f8e..d5ae36e 100644
---- a/drivers/gpio/Makefile
-+++ b/drivers/gpio/Makefile
-@@ -32,6 +32,7 @@ obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o
- obj-$(CONFIG_GPIO_UCB1400) += ucb1400_gpio.o
- obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o
- obj-$(CONFIG_GPIO_CS5535) += cs5535-gpio.o
-+obj-$(CONFIG_GPIO_EM) += gpio-em.o
- obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o
- obj-$(CONFIG_GPIO_IT8761E) += it8761e_gpio.o
- obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o
-diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
-new file mode 100644
-index 0000000..8873429
---- /dev/null
-+++ b/drivers/gpio/gpio-em.c
-@@ -0,0 +1,385 @@
-+/*
-+ * Emma Mobile GPIO Support - GIO
-+ *
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/spinlock.h>
-+#include <linux/interrupt.h>
-+#include <linux/ioport.h>
-+#include <linux/io.h>
-+#include <linux/irq.h>
-+#include <linux/err.h>
-+#include <linux/gpio.h>
-+#include <linux/slab.h>
-+#include <linux/module.h>
-+#include <linux/platform_data/gpio-em.h>
-+
-+struct em_gio_priv {
-+ void __iomem *base0;
-+ void __iomem *base1;
-+ unsigned int irq_base;
-+ spinlock_t sense_lock;
-+ struct gpio_chip gpio_chip;
-+ struct irq_chip irq_chip;
-+};
-+
-+#define GIO_E1 0x00
-+#define GIO_E0 0x04
-+#define GIO_EM 0x04
-+#define GIO_OL 0x08
-+#define GIO_OH 0x0c
-+#define GIO_I 0x10
-+#define GIO_IIA 0x14
-+#define GIO_IEN 0x18
-+#define GIO_IDS 0x1c
-+#define GIO_IIM 0x1c
-+#define GIO_RAW 0x20
-+#define GIO_MST 0x24
-+#define GIO_IIR 0x28
-+
-+#define GIO_IDT0 0x40
-+#define GIO_IDT1 0x44
-+#define GIO_IDT2 0x48
-+#define GIO_IDT3 0x4c
-+#define GIO_RAWBL 0x50
-+#define GIO_RAWBH 0x54
-+#define GIO_IRBL 0x58
-+#define GIO_IRBH 0x5c
-+
-+#define GIO_IDT(n) GIO_IDT0 + ((n) * 4)
-+
-+static inline unsigned long em_gio_read(struct em_gio_priv *p, int offs)
-+{
-+ if (offs < GIO_IDT0)
-+ return ioread32(p->base0 + offs);
-+ else
-+ return ioread32(p->base1 + (offs - GIO_IDT0));
-+}
-+
-+static inline void em_gio_write(struct em_gio_priv *p, int offs,
-+ unsigned long value)
-+{
-+ if (offs < GIO_IDT0)
-+ iowrite32(value, p->base0 + offs);
-+ else
-+ iowrite32(value, p->base1 + (offs - GIO_IDT0));
-+}
-+
-+static struct em_gio_priv *irq_to_priv(unsigned int irq)
-+{
-+ struct irq_chip *chip = irq_get_chip(irq);
-+ return container_of(chip, struct em_gio_priv, irq_chip);
-+}
-+
-+static void em_gio_irq_disable(struct irq_data *data)
-+{
-+ struct em_gio_priv *p = irq_to_priv(data->irq);
-+ int offset = data->irq - p->irq_base;
-+
-+ em_gio_write(p, GIO_IDS, 1 << offset);
-+}
-+
-+static void em_gio_irq_enable(struct irq_data *data)
-+{
-+ struct em_gio_priv *p = irq_to_priv(data->irq);
-+ int offset = data->irq - p->irq_base;
-+
-+ em_gio_write(p, GIO_IEN, 1 << offset);
-+}
-+
-+#define GIO_ASYNC(x) (x + 8)
-+
-+static unsigned char em_gio_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
-+ [IRQ_TYPE_EDGE_RISING] = GIO_ASYNC(0x00),
-+ [IRQ_TYPE_EDGE_FALLING] = GIO_ASYNC(0x01),
-+ [IRQ_TYPE_LEVEL_HIGH] = GIO_ASYNC(0x02),
-+ [IRQ_TYPE_LEVEL_LOW] = GIO_ASYNC(0x03),
-+ [IRQ_TYPE_EDGE_BOTH] = GIO_ASYNC(0x04),
-+};
-+
-+static int em_gio_irq_set_type(struct irq_data *data, unsigned int type)
-+{
-+ unsigned char value = em_gio_sense_table[type & IRQ_TYPE_SENSE_MASK];
-+ struct em_gio_priv *p = irq_to_priv(data->irq);
-+ unsigned int reg, offset, shift;
-+ unsigned long flags;
-+ unsigned long tmp;
-+
-+ if (!value)
-+ return -EINVAL;
-+
-+ offset = data->irq - p->irq_base;
-+
-+ pr_debug("gio: sense irq = %d, irq = %d, mode = %d, sw base = %d\n",
-+ offset, data->irq, value, p->irq_base);
-+
-+ /* 8 x 4 bit fields in 4 IDT registers */
-+ reg = GIO_IDT(offset >> 3);
-+ shift = (offset & 0x07) << 4;
-+
-+ spin_lock_irqsave(&p->sense_lock, flags);
-+
-+ /* disable the interrupt in IIA */
-+ tmp = em_gio_read(p, GIO_IIA);
-+ tmp &= ~(1 << offset);
-+ em_gio_write(p, GIO_IIA, tmp);
-+
-+ /* change the sense setting in IDT */
-+ tmp = em_gio_read(p, reg);
-+ tmp &= ~(0xf << shift);
-+ tmp |= value << shift;
-+ em_gio_write(p, reg, tmp);
-+
-+ /* clear pending interrupts */
-+ em_gio_write(p, GIO_IIR, 1 << offset);
-+
-+ /* enable the interrupt in IIA */
-+ tmp = em_gio_read(p, GIO_IIA);
-+ tmp |= 1 << offset;
-+ em_gio_write(p, GIO_IIA, tmp);
-+
-+ spin_unlock_irqrestore(&p->sense_lock, flags);
-+
-+ return 0;
-+}
-+
-+static irqreturn_t em_gio_irq_handler(int irq, void *dev_id)
-+{
-+ struct em_gio_priv *p = dev_id;
-+ unsigned long tmp, status;
-+ unsigned int offset;
-+
-+ status = tmp = em_gio_read(p, GIO_MST);
-+ if (!status)
-+ return IRQ_NONE;
-+
-+ while (status) {
-+ offset = __ffs(status);
-+ generic_handle_irq(p->irq_base + offset);
-+ status &= ~(1 << offset);
-+ }
-+
-+ em_gio_write(p, GIO_IIR, tmp);
-+
-+ return IRQ_HANDLED;
-+}
-+
-+static struct em_gio_priv *gpio_to_priv(struct gpio_chip *chip)
-+{
-+ return container_of(chip, struct em_gio_priv, gpio_chip);
-+}
-+
-+static int em_gio_direction_input(struct gpio_chip *chip, unsigned offset)
-+{
-+ em_gio_write(gpio_to_priv(chip), GIO_E0, 1 << offset);
-+ return 0;
-+}
-+
-+static int em_gio_get(struct gpio_chip *chip, unsigned offset)
-+{
-+ return (int)(em_gio_read(gpio_to_priv(chip), GIO_I) & (1 << offset));
-+}
-+
-+static void __em_gio_set(struct gpio_chip *chip, unsigned int reg,
-+ unsigned shift, int value)
-+{
-+ /* upper 16 bits contains mask and lower 16 actual value */
-+ em_gio_write(gpio_to_priv(chip), reg,
-+ (1 << (shift + 16)) | (value << shift));
-+}
-+
-+static void em_gio_set(struct gpio_chip *chip, unsigned offset, int value)
-+{
-+ /* output is split into two registers */
-+ if (offset < 16)
-+ __em_gio_set(chip, GIO_OL, offset, value);
-+ else
-+ __em_gio_set(chip, GIO_OH, offset - 16, value);
-+}
-+
-+static int em_gio_direction_output(struct gpio_chip *chip, unsigned offset,
-+ int value)
-+{
-+ /* write GPIO value to output before selecting output mode of pin */
-+ em_gio_set(chip, offset, value);
-+ em_gio_write(gpio_to_priv(chip), GIO_E1, 1 << offset);
-+ return 0;
-+}
-+
-+static int em_gio_to_irq(struct gpio_chip *chip, unsigned offset)
-+{
-+ return gpio_to_priv(chip)->irq_base + offset;
-+}
-+
-+static int __devinit em_gio_probe(struct platform_device *pdev)
-+{
-+ struct gpio_em_config *pdata = pdev->dev.platform_data;
-+ struct em_gio_priv *p;
-+ struct resource *io[2], *irq[2];
-+ struct gpio_chip *gpio_chip;
-+ struct irq_chip *irq_chip;
-+ const char *name = dev_name(&pdev->dev);
-+ int k, ret;
-+
-+ p = kzalloc(sizeof(*p), GFP_KERNEL);
-+ if (!p) {
-+ dev_err(&pdev->dev, "failed to allocate driver data\n");
-+ ret = -ENOMEM;
-+ goto err0;
-+ }
-+
-+ gpio_chip = &p->gpio_chip;
-+ irq_chip = &p->irq_chip;
-+ platform_set_drvdata(pdev, p);
-+ spin_lock_init(&p->sense_lock);
-+
-+ io[0] = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ io[1] = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+ irq[0] = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-+ irq[1] = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
-+
-+ if (!io[0] || !io[1] || !irq[0] || !irq[1] || !pdata) {
-+ dev_err(&pdev->dev, "missing IRQ, IOMEM or configuration\n");
-+ ret = -EINVAL;
-+ goto err1;
-+ }
-+
-+ p->base0 = ioremap_nocache(io[0]->start, resource_size(io[0]));
-+ if (!p->base0) {
-+ dev_err(&pdev->dev, "failed to remap low I/O memory\n");
-+ ret = -ENXIO;
-+ goto err1;
-+ }
-+
-+ p->base1 = ioremap_nocache(io[1]->start, resource_size(io[1]));
-+ if (!p->base1) {
-+ dev_err(&pdev->dev, "failed to remap high I/O memory\n");
-+ ret = -ENXIO;
-+ goto err2;
-+ }
-+
-+ p->irq_base = irq_alloc_descs(pdata->irq_base, 0,
-+ pdata->number_of_pins, numa_node_id());
-+ if (IS_ERR_VALUE(p->irq_base)) {
-+ dev_err(&pdev->dev, "cannot get irq_desc\n");
-+ ret = -ENXIO;
-+ goto err3;
-+ }
-+
-+ pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n",
-+ pdata->gpio_base, pdata->number_of_pins, p->irq_base);
-+
-+ irq_chip->name = name;
-+ irq_chip->irq_mask = em_gio_irq_disable;
-+ irq_chip->irq_unmask = em_gio_irq_enable;
-+ irq_chip->irq_enable = em_gio_irq_enable;
-+ irq_chip->irq_disable = em_gio_irq_disable;
-+ irq_chip->irq_set_type = em_gio_irq_set_type;
-+ irq_chip->flags = IRQCHIP_SKIP_SET_WAKE;
-+
-+ for (k = p->irq_base; k < (p->irq_base + pdata->number_of_pins); k++) {
-+ irq_set_chip_and_handler_name(k, irq_chip, handle_level_irq,
-+ "level");
-+ set_irq_flags(k, IRQF_VALID); /* kill me now */
-+ }
-+
-+ if (request_irq(irq[0]->start, em_gio_irq_handler, 0, name, p)) {
-+ dev_err(&pdev->dev, "failed to request low IRQ\n");
-+ ret = -ENOENT;
-+ goto err4;
-+ }
-+
-+ if (request_irq(irq[1]->start, em_gio_irq_handler, 0, name, p)) {
-+ dev_err(&pdev->dev, "failed to request high IRQ\n");
-+ ret = -ENOENT;
-+ goto err5;
-+ }
-+
-+ gpio_chip->direction_input = em_gio_direction_input;
-+ gpio_chip->get = em_gio_get;
-+ gpio_chip->direction_output = em_gio_direction_output;
-+ gpio_chip->set = em_gio_set;
-+
-+ gpio_chip->to_irq = em_gio_to_irq;
-+
-+ gpio_chip->label = name;
-+ gpio_chip->owner = THIS_MODULE;
-+
-+ gpio_chip->base = pdata->gpio_base;
-+ gpio_chip->ngpio = pdata->number_of_pins;
-+
-+ ret = gpiochip_add(gpio_chip);
-+ if (ret) {
-+ dev_err(&pdev->dev, "failed to add GPIO cntroller\n");
-+ goto err6;
-+ }
-+ return 0;
-+
-+err6:
-+ free_irq(irq[1]->start, pdev);
-+err5:
-+ free_irq(irq[0]->start, pdev);
-+err4:
-+ irq_free_descs(p->irq_base, pdata->number_of_pins);
-+err3:
-+ iounmap(p->base1);
-+err2:
-+ iounmap(p->base0);
-+err1:
-+ kfree(p);
-+err0:
-+ return ret;
-+}
-+
-+static int __devexit em_gio_remove(struct platform_device *pdev)
-+{
-+ struct gpio_em_config *pdata = pdev->dev.platform_data;
-+ struct em_gio_priv *p = platform_get_drvdata(pdev);
-+ struct resource *irq[2];
-+ int ret;
-+
-+ ret = gpiochip_remove(&p->gpio_chip);
-+ if (ret)
-+ return ret;
-+
-+ irq[0] = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-+ irq[1] = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
-+
-+ free_irq(irq[1]->start, pdev);
-+ free_irq(irq[0]->start, pdev);
-+ irq_free_descs(p->irq_base, pdata->number_of_pins);
-+ iounmap(p->base1);
-+ iounmap(p->base0);
-+ kfree(p);
-+ return 0;
-+}
-+
-+static struct platform_driver em_gio_device_driver = {
-+ .probe = em_gio_probe,
-+ .remove = __devexit_p(em_gio_remove),
-+ .driver = {
-+ .name = "em_gio",
-+ }
-+};
-+
-+module_platform_driver(em_gio_device_driver);
-+
-+MODULE_AUTHOR("Magnus Damm");
-+MODULE_DESCRIPTION("Renesas Emma Mobile GIO Driver");
-+MODULE_LICENSE("GPL v2");
-diff --git a/include/linux/platform_data/gpio-em.h b/include/linux/platform_data/gpio-em.h
-new file mode 100644
-index 0000000..573edfb
---- /dev/null
-+++ b/include/linux/platform_data/gpio-em.h
-@@ -0,0 +1,10 @@
-+#ifndef __GPIO_EM_H__
-+#define __GPIO_EM_H__
-+
-+struct gpio_em_config {
-+ unsigned int gpio_base;
-+ unsigned int irq_base;
-+ unsigned int number_of_pins;
-+};
-+
-+#endif /* __GPIO_EM_H__ */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0058-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch b/patches.kzm9g/0058-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
deleted file mode 100644
index 6555f45617df5d..00000000000000
--- a/patches.kzm9g/0058-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From c53d4419269e916098238ef2bbd15ee2e9381cf0 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Sun, 3 Jul 2011 15:15:51 -0400
-Subject: mmc: Add module.h to drivers/mmc users assuming implicit presence.
-
-We are cleaning up the implicit presence of module.h; these guys are
-some of the people who just assume it will be there. Call it out
-explitly for those that really need it.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 88b47679746b81534002bcba42da97ab82b5d12a)
-
-Conflicts:
-
- drivers/mmc/card/mmc_test.c
- drivers/mmc/host/mmc_spi.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/sdhci-of-esdhc.c
- drivers/mmc/host/sdhci-of-hlwd.c
- drivers/mmc/host/sdhci-pci.c
- drivers/mmc/host/sdhci-pltfm.c
- drivers/mmc/host/sdhci-pxav2.c
- drivers/mmc/host/sdhci-pxav3.c
- drivers/mmc/host/sdhci-spear.c
- drivers/mmc/host/sdhci-tegra.c
- drivers/mmc/host/sdhci.c
- drivers/mmc/host/sdricoh_cs.c
- drivers/mmc/host/sh_mobile_sdhi.c
- drivers/mmc/host/tifm_sd.c
- drivers/mmc/host/via-sdmmc.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index bd91c94..369366c 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -31,6 +31,7 @@
- #include <linux/platform_device.h>
- #include <linux/pm_runtime.h>
- #include <linux/spinlock.h>
-+#include <linux/module.h>
-
- #define DRIVER_NAME "sh_mmcif"
- #define DRIVER_VERSION "2010-04-28"
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0059-mach-shmobile-Emma-Mobile-EV2-SoC-base-support-V3.patch b/patches.kzm9g/0059-mach-shmobile-Emma-Mobile-EV2-SoC-base-support-V3.patch
deleted file mode 100644
index 0706510e984c1a..00000000000000
--- a/patches.kzm9g/0059-mach-shmobile-Emma-Mobile-EV2-SoC-base-support-V3.patch
+++ /dev/null
@@ -1,493 +0,0 @@
-From a60f89d7c6f7b301845e6943c6e2ec4c6d6197be Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 16 May 2012 15:44:58 +0900
-Subject: mach-shmobile: Emma Mobile EV2 SoC base support V3
-
-This is V3 of the Emma Mobile EV2 SoC support.
-Included here is support for serial and timer
-devices which is just about enough to boot a kernel.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 7f627f0380cb5ba3e05bcaac31ecf40c1f508ec1)
-
-Conflicts:
- arch/arm/mach-shmobile/Kconfig
- arch/arm/mach-shmobile/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 5 +
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/clock-emev2.c | 226 +++++++++++++++++++++++++++
- arch/arm/mach-shmobile/include/mach/emev2.h | 9 ++
- arch/arm/mach-shmobile/setup-emev2.c | 180 +++++++++++++++++++++
- 5 files changed, 421 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/clock-emev2.c
- create mode 100644 arch/arm/mach-shmobile/include/mach/emev2.h
- create mode 100644 arch/arm/mach-shmobile/setup-emev2.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 1e7656a..cabb9af 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -33,6 +33,11 @@ config ARCH_R8A7740
- select SH_CLK_CPG
- select ARCH_WANT_OPTIONAL_GPIOLIB
-
-+config ARCH_EMEV2
-+ bool "Emma Mobile EV2"
-+ select CPU_V7
-+ select ARM_GIC
-+
- comment "SH-Mobile Board Type"
-
- config MACH_G3EVM
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index 36bd37d..624f721 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -11,6 +11,7 @@ obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o
- obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
- obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
- obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
-+obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o
-
- # SMP objects
- smp-y := platsmp.o headsmp.o
-diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
-new file mode 100644
-index 0000000..73a1216
---- /dev/null
-+++ b/arch/arm/mach-shmobile/clock-emev2.c
-@@ -0,0 +1,226 @@
-+/*
-+ * Emma Mobile EV2 clock framework support
-+ *
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+#include <linux/sh_clk.h>
-+#include <linux/clkdev.h>
-+#include <mach/common.h>
-+
-+#define EMEV2_SMU_BASE 0xe0110000
-+
-+/* EMEV2 SMU registers */
-+#define USIAU0_RSTCTRL 0x094
-+#define USIBU1_RSTCTRL 0x0ac
-+#define USIBU2_RSTCTRL 0x0b0
-+#define USIBU3_RSTCTRL 0x0b4
-+#define STI_RSTCTRL 0x124
-+#define USIAU0GCLKCTRL 0x4a0
-+#define USIBU1GCLKCTRL 0x4b8
-+#define USIBU2GCLKCTRL 0x4bc
-+#define USIBU3GCLKCTRL 0x04c0
-+#define STIGCLKCTRL 0x528
-+#define USIAU0SCLKDIV 0x61c
-+#define USIB2SCLKDIV 0x65c
-+#define USIB3SCLKDIV 0x660
-+#define STI_CLKSEL 0x688
-+
-+/* not pretty, but hey */
-+static void __iomem *smu_base;
-+
-+static void emev2_smu_write(unsigned long value, int offs)
-+{
-+ BUG_ON(!smu_base || (offs >= PAGE_SIZE));
-+ iowrite32(value, smu_base + offs);
-+}
-+
-+static struct clk_mapping smu_mapping = {
-+ .phys = EMEV2_SMU_BASE,
-+ .len = PAGE_SIZE,
-+};
-+
-+/* Fixed 32 KHz root clock from C32K pin */
-+static struct clk c32k_clk = {
-+ .rate = 32768,
-+ .mapping = &smu_mapping,
-+};
-+
-+/* PLL3 multiplies C32K with 7000 */
-+static unsigned long pll3_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate * 7000;
-+}
-+
-+static struct sh_clk_ops pll3_clk_ops = {
-+ .recalc = pll3_recalc,
-+};
-+
-+static struct clk pll3_clk = {
-+ .ops = &pll3_clk_ops,
-+ .parent = &c32k_clk,
-+};
-+
-+static struct clk *main_clks[] = {
-+ &c32k_clk,
-+ &pll3_clk,
-+};
-+
-+enum { SCLKDIV_USIAU0, SCLKDIV_USIBU2, SCLKDIV_USIBU1, SCLKDIV_USIBU3,
-+ SCLKDIV_NR };
-+
-+#define SCLKDIV(_reg, _shift) \
-+{ \
-+ .parent = &pll3_clk, \
-+ .enable_reg = IOMEM(EMEV2_SMU_BASE + (_reg)), \
-+ .enable_bit = _shift, \
-+}
-+
-+static struct clk sclkdiv_clks[SCLKDIV_NR] = {
-+ [SCLKDIV_USIAU0] = SCLKDIV(USIAU0SCLKDIV, 0),
-+ [SCLKDIV_USIBU2] = SCLKDIV(USIB2SCLKDIV, 16),
-+ [SCLKDIV_USIBU1] = SCLKDIV(USIB2SCLKDIV, 0),
-+ [SCLKDIV_USIBU3] = SCLKDIV(USIB3SCLKDIV, 0),
-+};
-+
-+enum { GCLK_USIAU0_SCLK, GCLK_USIBU1_SCLK, GCLK_USIBU2_SCLK, GCLK_USIBU3_SCLK,
-+ GCLK_STI_SCLK,
-+ GCLK_NR };
-+
-+#define GCLK_SCLK(_parent, _reg) \
-+{ \
-+ .parent = _parent, \
-+ .enable_reg = IOMEM(EMEV2_SMU_BASE + (_reg)), \
-+ .enable_bit = 1, /* SCLK_GCC */ \
-+}
-+
-+static struct clk gclk_clks[GCLK_NR] = {
-+ [GCLK_USIAU0_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIAU0],
-+ USIAU0GCLKCTRL),
-+ [GCLK_USIBU1_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU1],
-+ USIBU1GCLKCTRL),
-+ [GCLK_USIBU2_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU2],
-+ USIBU2GCLKCTRL),
-+ [GCLK_USIBU3_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU3],
-+ USIBU3GCLKCTRL),
-+ [GCLK_STI_SCLK] = GCLK_SCLK(&c32k_clk, STIGCLKCTRL),
-+};
-+
-+static int emev2_gclk_enable(struct clk *clk)
-+{
-+ iowrite32(ioread32(clk->mapped_reg) | (1 << clk->enable_bit),
-+ clk->mapped_reg);
-+ return 0;
-+}
-+
-+static void emev2_gclk_disable(struct clk *clk)
-+{
-+ iowrite32(ioread32(clk->mapped_reg) & ~(1 << clk->enable_bit),
-+ clk->mapped_reg);
-+}
-+
-+static struct sh_clk_ops emev2_gclk_clk_ops = {
-+ .enable = emev2_gclk_enable,
-+ .disable = emev2_gclk_disable,
-+ .recalc = followparent_recalc,
-+};
-+
-+static int __init emev2_gclk_register(struct clk *clks, int nr)
-+{
-+ struct clk *clkp;
-+ int ret = 0;
-+ int k;
-+
-+ for (k = 0; !ret && (k < nr); k++) {
-+ clkp = clks + k;
-+ clkp->ops = &emev2_gclk_clk_ops;
-+ ret |= clk_register(clkp);
-+ }
-+
-+ return ret;
-+}
-+
-+static unsigned long emev2_sclkdiv_recalc(struct clk *clk)
-+{
-+ unsigned int sclk_div;
-+
-+ sclk_div = (ioread32(clk->mapped_reg) >> clk->enable_bit) & 0xff;
-+
-+ return clk->parent->rate / (sclk_div + 1);
-+}
-+
-+static struct sh_clk_ops emev2_sclkdiv_clk_ops = {
-+ .recalc = emev2_sclkdiv_recalc,
-+};
-+
-+static int __init emev2_sclkdiv_register(struct clk *clks, int nr)
-+{
-+ struct clk *clkp;
-+ int ret = 0;
-+ int k;
-+
-+ for (k = 0; !ret && (k < nr); k++) {
-+ clkp = clks + k;
-+ clkp->ops = &emev2_sclkdiv_clk_ops;
-+ ret |= clk_register(clkp);
-+ }
-+
-+ return ret;
-+}
-+
-+static struct clk_lookup lookups[] = {
-+ CLKDEV_DEV_ID("serial8250-em.0", &gclk_clks[GCLK_USIAU0_SCLK]),
-+ CLKDEV_DEV_ID("serial8250-em.1", &gclk_clks[GCLK_USIBU1_SCLK]),
-+ CLKDEV_DEV_ID("serial8250-em.2", &gclk_clks[GCLK_USIBU2_SCLK]),
-+ CLKDEV_DEV_ID("serial8250-em.3", &gclk_clks[GCLK_USIBU3_SCLK]),
-+ CLKDEV_DEV_ID("em_sti.0", &gclk_clks[GCLK_STI_SCLK]),
-+};
-+
-+void __init emev2_clock_init(void)
-+{
-+ int k, ret = 0;
-+
-+ smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
-+ BUG_ON(!smu_base);
-+
-+ /* setup STI timer to run on 37.768 kHz and deassert reset */
-+ emev2_smu_write(0, STI_CLKSEL);
-+ emev2_smu_write(1, STI_RSTCTRL);
-+
-+ /* deassert reset for UART0->UART3 */
-+ emev2_smu_write(2, USIAU0_RSTCTRL);
-+ emev2_smu_write(2, USIBU1_RSTCTRL);
-+ emev2_smu_write(2, USIBU2_RSTCTRL);
-+ emev2_smu_write(2, USIBU3_RSTCTRL);
-+
-+ for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
-+ ret = clk_register(main_clks[k]);
-+
-+ if (!ret)
-+ ret = emev2_sclkdiv_register(sclkdiv_clks, SCLKDIV_NR);
-+
-+ if (!ret)
-+ ret = emev2_gclk_register(gclk_clks, GCLK_NR);
-+
-+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-+
-+ if (!ret)
-+ shmobile_clk_init();
-+ else
-+ panic("failed to setup emev2 clocks\n");
-+}
-diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
-new file mode 100644
-index 0000000..92646c1
---- /dev/null
-+++ b/arch/arm/mach-shmobile/include/mach/emev2.h
-@@ -0,0 +1,9 @@
-+#ifndef __ASM_EMEV2_H__
-+#define __ASM_EMEV2_H__
-+
-+extern void emev2_init_irq(void);
-+extern void emev2_add_early_devices(void);
-+extern void emev2_add_standard_devices(void);
-+extern void emev2_clock_init(void);
-+
-+#endif /* __ASM_EMEV2_H__ */
-diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
-new file mode 100644
-index 0000000..9fff623
---- /dev/null
-+++ b/arch/arm/mach-shmobile/setup-emev2.c
-@@ -0,0 +1,180 @@
-+/*
-+ * Emma Mobile EV2 processor support
-+ *
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/irq.h>
-+#include <linux/platform_device.h>
-+#include <linux/delay.h>
-+#include <linux/input.h>
-+#include <linux/io.h>
-+#include <mach/hardware.h>
-+#include <mach/common.h>
-+#include <mach/emev2.h>
-+#include <mach/irqs.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/time.h>
-+#include <asm/hardware/gic.h>
-+
-+/* UART */
-+static struct resource uart0_resources[] = {
-+ [0] = {
-+ .start = 0xe1020000,
-+ .end = 0xe1020037,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 40,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
-+
-+static struct platform_device uart0_device = {
-+ .name = "serial8250-em",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(uart0_resources),
-+ .resource = uart0_resources,
-+};
-+
-+static struct resource uart1_resources[] = {
-+ [0] = {
-+ .start = 0xe1030000,
-+ .end = 0xe1030037,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 41,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
-+
-+static struct platform_device uart1_device = {
-+ .name = "serial8250-em",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(uart1_resources),
-+ .resource = uart1_resources,
-+};
-+
-+static struct resource uart2_resources[] = {
-+ [0] = {
-+ .start = 0xe1040000,
-+ .end = 0xe1040037,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 42,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
-+
-+static struct platform_device uart2_device = {
-+ .name = "serial8250-em",
-+ .id = 2,
-+ .num_resources = ARRAY_SIZE(uart2_resources),
-+ .resource = uart2_resources,
-+};
-+
-+static struct resource uart3_resources[] = {
-+ [0] = {
-+ .start = 0xe1050000,
-+ .end = 0xe1050037,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 43,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
-+
-+static struct platform_device uart3_device = {
-+ .name = "serial8250-em",
-+ .id = 3,
-+ .num_resources = ARRAY_SIZE(uart3_resources),
-+ .resource = uart3_resources,
-+};
-+
-+/* STI */
-+static struct resource sti_resources[] = {
-+ [0] = {
-+ .name = "STI",
-+ .start = 0xe0180000,
-+ .end = 0xe0180053,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 157,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sti_device = {
-+ .name = "em_sti",
-+ .id = 0,
-+ .resource = sti_resources,
-+ .num_resources = ARRAY_SIZE(sti_resources),
-+};
-+
-+static struct platform_device *emev2_early_devices[] __initdata = {
-+ &uart0_device,
-+ &uart1_device,
-+ &uart2_device,
-+ &uart3_device,
-+};
-+
-+static struct platform_device *emev2_late_devices[] __initdata = {
-+ &sti_device,
-+};
-+
-+void __init emev2_add_standard_devices(void)
-+{
-+ emev2_clock_init();
-+
-+ platform_add_devices(emev2_early_devices,
-+ ARRAY_SIZE(emev2_early_devices));
-+
-+ platform_add_devices(emev2_late_devices,
-+ ARRAY_SIZE(emev2_late_devices));
-+}
-+
-+void __init emev2_add_early_devices(void)
-+{
-+ shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
-+
-+ early_platform_add_devices(emev2_early_devices,
-+ ARRAY_SIZE(emev2_early_devices));
-+
-+ /* setup early console here as well */
-+ shmobile_setup_console();
-+}
-+
-+void __init emev2_init_irq(void)
-+{
-+ void __iomem *gic_dist_base;
-+ void __iomem *gic_cpu_base;
-+
-+ /* Static mappings, never released */
-+ gic_dist_base = ioremap(0xe0028000, PAGE_SIZE);
-+ gic_cpu_base = ioremap(0xe0020000, PAGE_SIZE);
-+ BUG_ON(!gic_dist_base || !gic_cpu_base);
-+
-+ /* Use GIC to handle interrupts */
-+ gic_init(0, 29, gic_dist_base, gic_cpu_base);
-+}
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0059-mmc-host-move-to-dma_transfer_direction.patch b/patches.kzm9g/0059-mmc-host-move-to-dma_transfer_direction.patch
deleted file mode 100644
index a9168363038e0e..00000000000000
--- a/patches.kzm9g/0059-mmc-host-move-to-dma_transfer_direction.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 36af543e2ebf0c4fd2201cf4aa7bd652c2a78809 Mon Sep 17 00:00:00 2001
-From: Vinod Koul <vinod.koul@linux.intel.com>
-Date: Fri, 14 Oct 2011 10:45:11 +0530
-Subject: mmc-host: move to dma_transfer_direction
-
-fixup usage of dma direction by introducing dma_transfer_direction,
-this patch moves mmc drivers to use new enum
-
-Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
-Cc: Chris Ball <cjb@laptop.org>
-Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-(cherry-picked from commit 05f5799cbe5c9e2c03f604b3de5783cf4d726227)
-
-Conflicts:
-
- drivers/mmc/host/atmel-mci.c
- drivers/mmc/host/mmci.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/tmio_mmc_dma.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 369366c..1c0c10b 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -233,7 +233,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
- if (ret > 0) {
- host->dma_active = true;
- desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-- DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
-+ DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- }
-
- if (desc) {
-@@ -281,7 +281,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
- if (ret > 0) {
- host->dma_active = true;
- desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-- DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
-+ DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- }
-
- if (desc) {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0060-mach-shmobile-KZM9D-board-support-V3.patch b/patches.kzm9g/0060-mach-shmobile-KZM9D-board-support-V3.patch
deleted file mode 100644
index ca4b244a9b6109..00000000000000
--- a/patches.kzm9g/0060-mach-shmobile-KZM9D-board-support-V3.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From e11d7a5d8be762494c2bf51a6585f61bdf8b290c Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 16 May 2012 15:45:16 +0900
-Subject: mach-shmobile: KZM9D board support V3
-
-V3 of basic KZM9D board support. At this point a quite
-thin layer that makes use of the Emma Mobile EV2 SoC code.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c050fb10c425cf189da5ca9b84e948ec2fc99049)
-
-Conflicts:
- arch/arm/mach-shmobile/Makefile
- arch/arm/mach-shmobile/clock-emev2.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 4 ++++
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/board-kzm9d.c | 36 ++++++++++++++++++++++++++++++++++
- arch/arm/mach-shmobile/clock-emev2.c | 2 ++
- 4 files changed, 43 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/board-kzm9d.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index cabb9af..d4dc4ee 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -92,6 +92,10 @@ config MACH_KZM9G
- select ARCH_REQUIRE_GPIOLIB
- select SND_SOC_AK4642 if SND_SIMPLE_CARD
-
-+config MACH_KZM9D
-+ bool "KZM9D board"
-+ depends on ARCH_EMEV2
-+
- comment "SH-Mobile System Configuration"
-
- config CPU_HAS_INTEVT
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index 624f721..bdd4383 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -47,6 +47,7 @@ obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
- obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
- obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
- obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
-+obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
-
- # Framework support
- obj-$(CONFIG_SMP) += $(smp-y)
-diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
-new file mode 100644
-index 0000000..e743f90
---- /dev/null
-+++ b/arch/arm/mach-shmobile/board-kzm9d.c
-@@ -0,0 +1,36 @@
-+/*
-+ * kzm9d board support
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/interrupt.h>
-+#include <mach/common.h>
-+#include <mach/emev2.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-+#include <asm/hardware/gic.h>
-+
-+MACHINE_START(KZM9D, "kzm9d")
-+ .init_early = emev2_add_early_devices,
-+ .nr_irqs = NR_IRQS_LEGACY,
-+ .init_irq = emev2_init_irq,
-+ .handle_irq = gic_handle_irq,
-+ .init_machine = emev2_add_standard_devices,
-+ .timer = &shmobile_timer,
-+MACHINE_END
-diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
-index 73a1216..64d4a56 100644
---- a/arch/arm/mach-shmobile/clock-emev2.c
-+++ b/arch/arm/mach-shmobile/clock-emev2.c
-@@ -84,6 +84,8 @@ static struct clk *main_clks[] = {
- enum { SCLKDIV_USIAU0, SCLKDIV_USIBU2, SCLKDIV_USIBU1, SCLKDIV_USIBU3,
- SCLKDIV_NR };
-
-+#define IOMEM(x) ((void __force __iomem *)(x))
-+
- #define SCLKDIV(_reg, _shift) \
- { \
- .parent = &pll3_clk, \
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0060-mmc-sh_mmcif-fix-clock-gating-on-platforms-with-a-.d.patch b/patches.kzm9g/0060-mmc-sh_mmcif-fix-clock-gating-on-platforms-with-a-.d.patch
deleted file mode 100644
index aaa15101e62b63..00000000000000
--- a/patches.kzm9g/0060-mmc-sh_mmcif-fix-clock-gating-on-platforms-with-a-.d.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 9349a2c3b6de8530004a628228b5b72e646decbd Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 16 Nov 2011 10:10:41 +0100
-Subject: mmc: sh_mmcif: fix clock gating on platforms with a .down_pwr()
- method
-
-Do not power down the card in .set_ios(), unless MMC_POWER_OFF is
-requested. This fixes the MMCIF interface functionality on ecovec boards.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit f6bc41fb08cbd6943df358437e0af90c91a3caa3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 1c0c10b..b758b21 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -908,7 +908,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- if (host->power) {
- pm_runtime_put(&host->pd->dev);
- host->power = false;
-- if (p->down_pwr)
-+ if (p->down_pwr && ios->power_mode == MMC_POWER_OFF)
- p->down_pwr(host->pd);
- }
- host->state = STATE_IDLE;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0061-mach-shmobile-Emma-Mobile-EV2-SMP-support-V3.patch b/patches.kzm9g/0061-mach-shmobile-Emma-Mobile-EV2-SMP-support-V3.patch
deleted file mode 100644
index 12ddf536a6297b..00000000000000
--- a/patches.kzm9g/0061-mach-shmobile-Emma-Mobile-EV2-SMP-support-V3.patch
+++ /dev/null
@@ -1,329 +0,0 @@
-From 0af702823eae60eceedd80cbd4bd0670285a2cca Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 16 May 2012 15:45:25 +0900
-Subject: mach-shmobile: Emma Mobile EV2 SMP support V3
-
-This is V3 of Emma Mobile EV2 SMP support.
-
-At this point only the most basic form of SMP operation
-is supported. TWD and CPU Hotplug support is excluded.
-
-Tied to both the Emma Mobile EV2 and the KZM9D board
-due to the need to switch on board in platsmp.c and
-the newly introduced need for static mappings.
-
-The static mappings are needed to allow hardware
-acces early during boot when SMP is initialized.
-This early requirement forces us to also map in
-the SMU registers.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit bd5a875d90c878be4d23f54ea565253734ae2377)
-
-Conflicts:
- arch/arm/mach-shmobile/Makefile
- arch/arm/mach-shmobile/platsmp.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/board-kzm9d.c | 1 +
- arch/arm/mach-shmobile/clock-emev2.c | 18 +++++
- arch/arm/mach-shmobile/include/mach/emev2.h | 7 ++
- arch/arm/mach-shmobile/platsmp.c | 17 +++++
- arch/arm/mach-shmobile/setup-emev2.c | 24 +++++++
- arch/arm/mach-shmobile/smp-emev2.c | 97 +++++++++++++++++++++++++++
- 7 files changed, 165 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/smp-emev2.c
-
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index bdd4383..a2c56d5 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -18,6 +18,7 @@ smp-y := platsmp.o headsmp.o
- smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o
- smp-$(CONFIG_LOCAL_TIMERS) += localtimer.o
- smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o
-+smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o
-
- # Pinmux setup
- pfc-y :=
-diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
-index e743f90..42fc479 100644
---- a/arch/arm/mach-shmobile/board-kzm9d.c
-+++ b/arch/arm/mach-shmobile/board-kzm9d.c
-@@ -27,6 +27,7 @@
- #include <asm/hardware/gic.h>
-
- MACHINE_START(KZM9D, "kzm9d")
-+ .map_io = emev2_map_io,
- .init_early = emev2_add_early_devices,
- .nr_irqs = NR_IRQS_LEGACY,
- .init_irq = emev2_init_irq,
-diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
-index 64d4a56..9414383 100644
---- a/arch/arm/mach-shmobile/clock-emev2.c
-+++ b/arch/arm/mach-shmobile/clock-emev2.c
-@@ -40,6 +40,7 @@
- #define USIB2SCLKDIV 0x65c
- #define USIB3SCLKDIV 0x660
- #define STI_CLKSEL 0x688
-+#define SMU_GENERAL_REG0 0x7c0
-
- /* not pretty, but hey */
- static void __iomem *smu_base;
-@@ -50,6 +51,11 @@ static void emev2_smu_write(unsigned long value, int offs)
- iowrite32(value, smu_base + offs);
- }
-
-+void emev2_set_boot_vector(unsigned long value)
-+{
-+ emev2_smu_write(value, SMU_GENERAL_REG0);
-+}
-+
- static struct clk_mapping smu_mapping = {
- .phys = EMEV2_SMU_BASE,
- .len = PAGE_SIZE,
-@@ -196,6 +202,18 @@ static struct clk_lookup lookups[] = {
- void __init emev2_clock_init(void)
- {
- int k, ret = 0;
-+ static int is_setup;
-+
-+ /* yuck, this is ugly as hell, but the non-smp case of clocks
-+ * code is now designed to rely on ioremap() instead of static
-+ * entity maps. in the case of smp we need access to the SMU
-+ * register earlier than ioremap() is actually working without
-+ * any static maps. to enable SMP in ugly but with dynamic
-+ * mappings we have to call emev2_clock_init() from different
-+ * places depending on UP and SMP...
-+ */
-+ if (is_setup++)
-+ return;
-
- smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
- BUG_ON(!smu_base);
-diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
-index 92646c1..3fc7184 100644
---- a/arch/arm/mach-shmobile/include/mach/emev2.h
-+++ b/arch/arm/mach-shmobile/include/mach/emev2.h
-@@ -1,9 +1,16 @@
- #ifndef __ASM_EMEV2_H__
- #define __ASM_EMEV2_H__
-
-+extern void emev2_map_io(void);
- extern void emev2_init_irq(void);
- extern void emev2_add_early_devices(void);
- extern void emev2_add_standard_devices(void);
- extern void emev2_clock_init(void);
-+extern void emev2_set_boot_vector(unsigned long value);
-+extern unsigned int emev2_get_core_count(void);
-+extern int emev2_platform_cpu_kill(unsigned int cpu);
-+extern void emev2_secondary_init(unsigned int cpu);
-+extern int emev2_boot_secondary(unsigned int cpu);
-+extern void emev2_smp_prepare_cpus(void);
-
- #endif /* __ASM_EMEV2_H__ */
-diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
-index 1103ce5..9e98f9e 100644
---- a/arch/arm/mach-shmobile/platsmp.c
-+++ b/arch/arm/mach-shmobile/platsmp.c
-@@ -20,14 +20,19 @@
- #include <asm/localtimer.h>
- #include <asm/mach-types.h>
- #include <mach/common.h>
-+#include <mach/emev2.h>
-
- #define is_sh73a0() (machine_is_ag5evm() || machine_is_kzm9g())
-+#define is_emev2() machine_is_kzm9d()
-
- static unsigned int __init shmobile_smp_get_core_count(void)
- {
- if (is_sh73a0())
- return sh73a0_get_core_count();
-
-+ if (is_emev2())
-+ return emev2_get_core_count();
-+
- return 1;
- }
-
-@@ -35,10 +40,16 @@ static void __init shmobile_smp_prepare_cpus(void)
- {
- if (is_sh73a0())
- sh73a0_smp_prepare_cpus();
-+
-+ if (is_emev2())
-+ emev2_smp_prepare_cpus();
- }
-
- int shmobile_platform_cpu_kill(unsigned int cpu)
- {
-+ if (is_emev2())
-+ return emev2_platform_cpu_kill(cpu);
-+
- return 1;
- }
-
-@@ -48,6 +59,9 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
-
- if (is_sh73a0())
- sh73a0_secondary_init(cpu);
-+
-+ if (is_emev2())
-+ emev2_secondary_init(cpu);
- }
-
- int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
-@@ -55,6 +69,9 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
- if (is_sh73a0())
- return sh73a0_boot_secondary(cpu);
-
-+ if (is_emev2())
-+ return emev2_boot_secondary(cpu);
-+
- return -ENOSYS;
- }
-
-diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
-index 9fff623..2a03a78 100644
---- a/arch/arm/mach-shmobile/setup-emev2.c
-+++ b/arch/arm/mach-shmobile/setup-emev2.c
-@@ -34,6 +34,30 @@
- #include <asm/mach/time.h>
- #include <asm/hardware/gic.h>
-
-+static struct map_desc emev2_io_desc[] __initdata = {
-+#ifdef CONFIG_SMP
-+ /* 128K entity map for 0xe0100000 (SMU) */
-+ {
-+ .virtual = 0xe0100000,
-+ .pfn = __phys_to_pfn(0xe0100000),
-+ .length = SZ_128K,
-+ .type = MT_DEVICE
-+ },
-+ /* 2M mapping for SCU + L2 controller */
-+ {
-+ .virtual = 0xf0000000,
-+ .pfn = __phys_to_pfn(0x1e000000),
-+ .length = SZ_2M,
-+ .type = MT_DEVICE
-+ },
-+#endif
-+};
-+
-+void __init emev2_map_io(void)
-+{
-+ iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
-+}
-+
- /* UART */
- static struct resource uart0_resources[] = {
- [0] = {
-diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
-new file mode 100644
-index 0000000..6a35c4a
---- /dev/null
-+++ b/arch/arm/mach-shmobile/smp-emev2.c
-@@ -0,0 +1,97 @@
-+/*
-+ * SMP support for Emma Mobile EV2
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ * Copyright (C) 2012 Magnus Damm
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/smp.h>
-+#include <linux/spinlock.h>
-+#include <linux/io.h>
-+#include <linux/delay.h>
-+#include <mach/common.h>
-+#include <mach/emev2.h>
-+#include <asm/smp_plat.h>
-+#include <asm/smp_scu.h>
-+#include <asm/hardware/gic.h>
-+#include <asm/cacheflush.h>
-+
-+#define EMEV2_SCU_BASE 0x1e000000
-+
-+static DEFINE_SPINLOCK(scu_lock);
-+static void __iomem *scu_base;
-+
-+static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
-+{
-+ unsigned long tmp;
-+
-+ /* we assume this code is running on a different cpu
-+ * than the one that is changing coherency setting */
-+ spin_lock(&scu_lock);
-+ tmp = readl(scu_base + 8);
-+ tmp &= ~clr;
-+ tmp |= set;
-+ writel(tmp, scu_base + 8);
-+ spin_unlock(&scu_lock);
-+
-+}
-+
-+unsigned int __init emev2_get_core_count(void)
-+{
-+ if (!scu_base) {
-+ scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
-+ emev2_clock_init(); /* need ioremapped SMU */
-+ }
-+
-+ WARN_ON_ONCE(!scu_base);
-+
-+ return scu_base ? scu_get_core_count(scu_base) : 1;
-+}
-+
-+int emev2_platform_cpu_kill(unsigned int cpu)
-+{
-+ return 0; /* not supported yet */
-+}
-+
-+void __cpuinit emev2_secondary_init(unsigned int cpu)
-+{
-+ gic_secondary_init(0);
-+}
-+
-+int __cpuinit emev2_boot_secondary(unsigned int cpu)
-+{
-+ cpu = cpu_logical_map(cpu);
-+
-+ /* enable cache coherency */
-+ modify_scu_cpu_psr(0, 3 << (cpu * 8));
-+
-+ /* Tell ROM loader about our vector (in headsmp.S) */
-+ emev2_set_boot_vector(__pa(shmobile_secondary_vector));
-+
-+ gic_raise_softirq(cpumask_of(cpu), 1);
-+ return 0;
-+}
-+
-+void __init emev2_smp_prepare_cpus(void)
-+{
-+ int cpu = cpu_logical_map(0);
-+
-+ scu_enable(scu_base);
-+
-+ /* enable cache coherency on CPU0 */
-+ modify_scu_cpu_psr(0, 3 << (cpu * 8));
-+}
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0061-mmc-sh_mmcif-simplify-clock-divisor-calculation.patch b/patches.kzm9g/0061-mmc-sh_mmcif-simplify-clock-divisor-calculation.patch
deleted file mode 100644
index 07c17d299f77db..00000000000000
--- a/patches.kzm9g/0061-mmc-sh_mmcif-simplify-clock-divisor-calculation.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From ac5156aad3d50ae4acfe30f57e74c0677b5cc3a7 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 23 Nov 2011 15:52:30 +0100
-Subject: mmc: sh_mmcif: simplify clock divisor calculation
-
-Replace ilog2(__rounddown_pow_of_two(x)) with the equivalent but much
-simpler fls(x) - 1.
-
-Reported-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 86df174585de79a460e3515ec413ea1f5a0bcf68)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index b758b21..86edbad 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -16,6 +16,7 @@
- *
- */
-
-+#include <linux/bitops.h>
- #include <linux/clk.h>
- #include <linux/completion.h>
- #include <linux/delay.h>
-@@ -399,7 +400,7 @@ static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk)
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK);
- else
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR &
-- (ilog2(__rounddown_pow_of_two(host->clk / clk)) << 16));
-+ ((fls(host->clk / clk) - 1) << 16));
-
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch b/patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch
deleted file mode 100644
index 7604f5b5fbef4e..00000000000000
--- a/patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch
+++ /dev/null
@@ -1,280 +0,0 @@
-From dbf1eecc80eac3500e8456e46d12601641756cd1 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 16 May 2012 15:45:34 +0900
-Subject: mach-shmobile: Emma Mobile EV2 GPIO support V3
-
-Tie in the Emma Mobile GPIO driver "em-gio" to
-support the GPIOs on Emma Mobile EV2.
-
-A static IRQ range is used to allow boards to
-hook up their platform devices to the GPIOs.
-
-DT support is still on the TODO for the GPIO driver,
-so only platform device support is included here.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 088efd9273b5076a0aead479aa31f1066d182b3e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 1 +
- arch/arm/mach-shmobile/include/mach/emev2.h | 3 +
- arch/arm/mach-shmobile/setup-emev2.c | 203 +++++++++++++++++++++++++++
- 3 files changed, 207 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index d4dc4ee..4ce90f3 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -37,6 +37,7 @@ config ARCH_EMEV2
- bool "Emma Mobile EV2"
- select CPU_V7
- select ARM_GIC
-+ select ARCH_WANT_OPTIONAL_GPIOLIB
-
- comment "SH-Mobile Board Type"
-
-diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
-index 3fc7184..e6b0c1b 100644
---- a/arch/arm/mach-shmobile/include/mach/emev2.h
-+++ b/arch/arm/mach-shmobile/include/mach/emev2.h
-@@ -13,4 +13,7 @@ extern void emev2_secondary_init(unsigned int cpu);
- extern int emev2_boot_secondary(unsigned int cpu);
- extern void emev2_smp_prepare_cpus(void);
-
-+#define EMEV2_GPIO_BASE 200
-+#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))
-+
- #endif /* __ASM_EMEV2_H__ */
-diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
-index 2a03a78..d40fede 100644
---- a/arch/arm/mach-shmobile/setup-emev2.c
-+++ b/arch/arm/mach-shmobile/setup-emev2.c
-@@ -21,6 +21,7 @@
- #include <linux/interrupt.h>
- #include <linux/irq.h>
- #include <linux/platform_device.h>
-+#include <linux/platform_data/gpio-em.h>
- #include <linux/delay.h>
- #include <linux/input.h>
- #include <linux/io.h>
-@@ -156,6 +157,203 @@ static struct platform_device sti_device = {
- .num_resources = ARRAY_SIZE(sti_resources),
- };
-
-+
-+/* GIO */
-+static struct gpio_em_config gio0_config = {
-+ .gpio_base = 0,
-+ .irq_base = EMEV2_GPIO_IRQ(0),
-+ .number_of_pins = 32,
-+};
-+
-+static struct resource gio0_resources[] = {
-+ [0] = {
-+ .name = "GIO_000",
-+ .start = 0xe0050000,
-+ .end = 0xe005002b,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = "GIO_000",
-+ .start = 0xe0050040,
-+ .end = 0xe005005f,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = 99,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = 100,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device gio0_device = {
-+ .name = "em_gio",
-+ .id = 0,
-+ .resource = gio0_resources,
-+ .num_resources = ARRAY_SIZE(gio0_resources),
-+ .dev = {
-+ .platform_data = &gio0_config,
-+ },
-+};
-+
-+static struct gpio_em_config gio1_config = {
-+ .gpio_base = 32,
-+ .irq_base = EMEV2_GPIO_IRQ(32),
-+ .number_of_pins = 32,
-+};
-+
-+static struct resource gio1_resources[] = {
-+ [0] = {
-+ .name = "GIO_032",
-+ .start = 0xe0050080,
-+ .end = 0xe00500ab,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = "GIO_032",
-+ .start = 0xe00500c0,
-+ .end = 0xe00500df,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = 101,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = 102,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device gio1_device = {
-+ .name = "em_gio",
-+ .id = 1,
-+ .resource = gio1_resources,
-+ .num_resources = ARRAY_SIZE(gio1_resources),
-+ .dev = {
-+ .platform_data = &gio1_config,
-+ },
-+};
-+
-+static struct gpio_em_config gio2_config = {
-+ .gpio_base = 64,
-+ .irq_base = EMEV2_GPIO_IRQ(64),
-+ .number_of_pins = 32,
-+};
-+
-+static struct resource gio2_resources[] = {
-+ [0] = {
-+ .name = "GIO_064",
-+ .start = 0xe0050100,
-+ .end = 0xe005012b,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = "GIO_064",
-+ .start = 0xe0050140,
-+ .end = 0xe005015f,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = 103,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = 104,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device gio2_device = {
-+ .name = "em_gio",
-+ .id = 2,
-+ .resource = gio2_resources,
-+ .num_resources = ARRAY_SIZE(gio2_resources),
-+ .dev = {
-+ .platform_data = &gio2_config,
-+ },
-+};
-+
-+static struct gpio_em_config gio3_config = {
-+ .gpio_base = 96,
-+ .irq_base = EMEV2_GPIO_IRQ(96),
-+ .number_of_pins = 32,
-+};
-+
-+static struct resource gio3_resources[] = {
-+ [0] = {
-+ .name = "GIO_096",
-+ .start = 0xe0050100,
-+ .end = 0xe005012b,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = "GIO_096",
-+ .start = 0xe0050140,
-+ .end = 0xe005015f,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = 105,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = 106,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device gio3_device = {
-+ .name = "em_gio",
-+ .id = 3,
-+ .resource = gio3_resources,
-+ .num_resources = ARRAY_SIZE(gio3_resources),
-+ .dev = {
-+ .platform_data = &gio3_config,
-+ },
-+};
-+
-+static struct gpio_em_config gio4_config = {
-+ .gpio_base = 128,
-+ .irq_base = EMEV2_GPIO_IRQ(128),
-+ .number_of_pins = 31,
-+};
-+
-+static struct resource gio4_resources[] = {
-+ [0] = {
-+ .name = "GIO_128",
-+ .start = 0xe0050200,
-+ .end = 0xe005022b,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = "GIO_128",
-+ .start = 0xe0050240,
-+ .end = 0xe005025f,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = 107,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = 108,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device gio4_device = {
-+ .name = "em_gio",
-+ .id = 4,
-+ .resource = gio4_resources,
-+ .num_resources = ARRAY_SIZE(gio4_resources),
-+ .dev = {
-+ .platform_data = &gio4_config,
-+ },
-+};
-+
- static struct platform_device *emev2_early_devices[] __initdata = {
- &uart0_device,
- &uart1_device,
-@@ -165,6 +363,11 @@ static struct platform_device *emev2_early_devices[] __initdata = {
-
- static struct platform_device *emev2_late_devices[] __initdata = {
- &sti_device,
-+ &gio0_device,
-+ &gio1_device,
-+ &gio2_device,
-+ &gio3_device,
-+ &gio4_device,
- };
-
- void __init emev2_add_standard_devices(void)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.kzm9g/0062-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch b/patches.kzm9g/0062-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
deleted file mode 100644
index 3c15bd131c035b..00000000000000
--- a/patches.kzm9g/0062-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 44f21f022edbdf0032b9f6d2e197d7e042c14d04 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Sat, 26 Nov 2011 12:55:43 +0800
-Subject: mmc: convert drivers/mmc/host/* to use module_platform_driver()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch converts the drivers in drivers/mmc/host/* to use the
-module_platform_driver() macro which makes the code smaller and a bit
-simpler.
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Acked-by: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
-Acked-by: David Brown <davidb@codeaurora.org>
-Acked-by: Viresh Kumar <viresh.kumar@st.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
-Acked-by: Wolfram Sang <w.sang@pengutronix.de>
-Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit d1f81a64a4250bdd776978be06ae2b8e13ec7471)
-
-Conflicts:
-
- drivers/mmc/host/bfin_sdh.c
- drivers/mmc/host/cb710-mmc.c
- drivers/mmc/host/jz4740_mmc.c
- drivers/mmc/host/msm_sdcc.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/pxamci.c
- drivers/mmc/host/s3cmci.c
- drivers/mmc/host/sdhci-cns3xxx.c
- drivers/mmc/host/sdhci-dove.c
- drivers/mmc/host/sdhci-esdhc-imx.c
- drivers/mmc/host/sdhci-of-esdhc.c
- drivers/mmc/host/sdhci-of-hlwd.c
- drivers/mmc/host/sdhci-pxav2.c
- drivers/mmc/host/sdhci-pxav3.c
- drivers/mmc/host/sdhci-s3c.c
- drivers/mmc/host/sdhci-spear.c
- drivers/mmc/host/sdhci-tegra.c
- drivers/mmc/host/sh_mobile_sdhi.c
- drivers/mmc/host/tmio_mmc.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 14 +-------------
- 1 file changed, 1 insertion(+), 13 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 86edbad..fd0fd11 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -1207,19 +1207,7 @@ static struct platform_driver sh_mmcif_driver = {
- },
- };
-
--static int __init sh_mmcif_init(void)
--{
-- return platform_driver_register(&sh_mmcif_driver);
--}
--
--static void __exit sh_mmcif_exit(void)
--{
-- platform_driver_unregister(&sh_mmcif_driver);
--}
--
--module_init(sh_mmcif_init);
--module_exit(sh_mmcif_exit);
--
-+module_platform_driver(sh_mmcif_driver);
-
- MODULE_DESCRIPTION("SuperH on-chip MMC/eMMC interface driver");
- MODULE_LICENSE("GPL");
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch b/patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch
deleted file mode 100644
index 78f4bbc6106e82..00000000000000
--- a/patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From adaf8f8c3a969904f01b38f842fb7416858ea4cc Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 16 May 2012 15:45:42 +0900
-Subject: mach-shmobile: KZM9D board Ethernet support V3
-
-Tie in the on-board Ethernet controller on KZM9D
-and make use of the GPIO controller for external
-IRQ pin support.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0c73f7bc124e1657a583d9dfb0d168a69005e2d3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9d.c | 44 ++++++++++++++++++++++++++++++++++-
- 1 file changed, 43 insertions(+), 1 deletion(-)
-
---- a/arch/arm/mach-shmobile/board-kzm9d.c
-+++ b/arch/arm/mach-shmobile/board-kzm9d.c
-@@ -20,18 +20,60 @@
-
- #include <linux/kernel.h>
- #include <linux/interrupt.h>
-+#include <linux/platform_device.h>
-+#include <linux/smsc911x.h>
- #include <mach/common.h>
- #include <mach/emev2.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
- #include <asm/hardware/gic.h>
-
-+/* Ether */
-+static struct resource smsc911x_resources[] = {
-+ [0] = {
-+ .start = 0x20000000,
-+ .end = 0x2000ffff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = EMEV2_GPIO_IRQ(1),
-+ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
-+ },
-+};
-+
-+static struct smsc911x_platform_config smsc911x_platdata = {
-+ .flags = SMSC911X_USE_32BIT,
-+ .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
-+ .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
-+};
-+
-+static struct platform_device smsc91x_device = {
-+ .name = "smsc911x",
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &smsc911x_platdata,
-+ },
-+ .num_resources = ARRAY_SIZE(smsc911x_resources),
-+ .resource = smsc911x_resources,
-+};
-+
-+static struct platform_device *kzm9d_devices[] __initdata = {
-+ &smsc91x_device,
-+};
-+
-+void __init kzm9d_add_standard_devices(void)
-+{
-+ emev2_add_standard_devices();
-+
-+ platform_add_devices(kzm9d_devices, ARRAY_SIZE(kzm9d_devices));
-+}
-+
- MACHINE_START(KZM9D, "kzm9d")
- .map_io = emev2_map_io,
- .init_early = emev2_add_early_devices,
- .nr_irqs = NR_IRQS_LEGACY,
- .init_irq = emev2_init_irq,
- .handle_irq = gic_handle_irq,
-- .init_machine = emev2_add_standard_devices,
-+ .init_machine = kzm9d_add_standard_devices,
- .timer = &shmobile_timer,
- MACHINE_END
diff --git a/patches.kzm9g/0063-mmc-sh_mmcif-process-error-interrupts-first.patch b/patches.kzm9g/0063-mmc-sh_mmcif-process-error-interrupts-first.patch
deleted file mode 100644
index 67e7f70ae2b098..00000000000000
--- a/patches.kzm9g/0063-mmc-sh_mmcif-process-error-interrupts-first.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 5e6bf4faa8039a5bc1dba4d380a116a7e4d9a7e4 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 14 Dec 2011 19:31:51 +0100
-Subject: mmc: sh_mmcif: process error interrupts first
-
-If an interrupt is coming with both error and data completion status bits
-set, it has to be handled as an error interrupt, for which error interrupts
-have to be processed first. The current version of the driver on the
-contrary doesn't recognise such interrupts as an error event, which leads
-to data corruption and breaks the error recovery.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 8a8284a98c1a58f5aa3eebce7971f81bcdb29d98)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index fd0fd11..e9ba52e 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -961,7 +961,12 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
-
- state = sh_mmcif_readl(host->addr, MMCIF_CE_INT);
-
-- if (state & INT_RBSYE) {
-+ if (state & INT_ERR_STS) {
-+ /* error interrupts - process first */
-+ sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~state);
-+ sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, state);
-+ err = 1;
-+ } else if (state & INT_RBSYE) {
- sh_mmcif_writel(host->addr, MMCIF_CE_INT,
- ~(INT_RBSYE | INT_CRSPE));
- sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MRBSYE);
-@@ -989,11 +994,6 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
- sh_mmcif_writel(host->addr, MMCIF_CE_INT,
- ~(INT_CMD12RBE | INT_CMD12CRE));
- sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MCMD12RBE);
-- } else if (state & INT_ERR_STS) {
-- /* err interrupts */
-- sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~state);
-- sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, state);
-- err = 1;
- } else {
- dev_dbg(&host->pd->dev, "Unsupported interrupt: 0x%x\n", state);
- sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~state);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0064-mmc-sh_mmcif-cosmetic-clean-up.patch b/patches.kzm9g/0064-mmc-sh_mmcif-cosmetic-clean-up.patch
deleted file mode 100644
index 5b4215a8f80813..00000000000000
--- a/patches.kzm9g/0064-mmc-sh_mmcif-cosmetic-clean-up.patch
+++ /dev/null
@@ -1,211 +0,0 @@
-From 364bbb124f5f7023aa0999c8382c3cfb38629615 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Wed, 14 Dec 2011 19:31:52 +0100
-Subject: mmc: sh_mmcif: cosmetic clean up
-
-This patch doesn't introduce any functional changes, it only simplifies
-some code fragments, removes superfluous parameters, fixes typos.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit ee4b88879f23badd54f5557852745fa28a1570f6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 79 +++++++++++++++++++--------------------------
- 1 file changed, 34 insertions(+), 45 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index e9ba52e..1408ded 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -124,6 +124,11 @@
- #define MASK_MRBSYTO (1 << 1)
- #define MASK_MRSPTO (1 << 0)
-
-+#define MASK_START_CMD (MASK_MCMDVIO | MASK_MBUFVIO | MASK_MWDATERR | \
-+ MASK_MRDATERR | MASK_MRIDXERR | MASK_MRSPERR | \
-+ MASK_MCCSTO | MASK_MCRCSTO | MASK_MWDATTO | \
-+ MASK_MRDATTO | MASK_MRBSYTO | MASK_MRSPTO)
-+
- /* CE_HOST_STS1 */
- #define STS1_CMDSEQ (1 << 31)
-
-@@ -176,8 +181,8 @@ struct sh_mmcif_host {
- long timeout;
- void __iomem *addr;
- struct completion intr_wait;
-+ spinlock_t lock; /* protect sh_mmcif_host::state */
- enum mmcif_state state;
-- spinlock_t lock;
- bool power;
- bool card_present;
-
-@@ -422,7 +427,7 @@ static void sh_mmcif_sync_reset(struct sh_mmcif_host *host)
- static int sh_mmcif_error_manage(struct sh_mmcif_host *host)
- {
- u32 state1, state2;
-- int ret, timeout = 10000000;
-+ int ret, timeout;
-
- host->sd_error = false;
-
-@@ -434,31 +439,30 @@ static int sh_mmcif_error_manage(struct sh_mmcif_host *host)
- if (state1 & STS1_CMDSEQ) {
- sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, CMD_CTRL_BREAK);
- sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, ~CMD_CTRL_BREAK);
-- while (1) {
-- timeout--;
-- if (timeout < 0) {
-- dev_err(&host->pd->dev,
-- "Forceed end of command sequence timeout err\n");
-- return -EIO;
-- }
-+ for (timeout = 10000000; timeout; timeout--) {
- if (!(sh_mmcif_readl(host->addr, MMCIF_CE_HOST_STS1)
-- & STS1_CMDSEQ))
-+ & STS1_CMDSEQ))
- break;
- mdelay(1);
- }
-+ if (!timeout) {
-+ dev_err(&host->pd->dev,
-+ "Forced end of command sequence timeout err\n");
-+ return -EIO;
-+ }
- sh_mmcif_sync_reset(host);
- dev_dbg(&host->pd->dev, "Forced end of command sequence\n");
- return -EIO;
- }
-
- if (state2 & STS2_CRC_ERR) {
-- dev_dbg(&host->pd->dev, ": Happened CRC error\n");
-+ dev_dbg(&host->pd->dev, ": CRC error\n");
- ret = -EIO;
- } else if (state2 & STS2_TIMEOUT_ERR) {
-- dev_dbg(&host->pd->dev, ": Happened Timeout error\n");
-+ dev_dbg(&host->pd->dev, ": Timeout\n");
- ret = -ETIMEDOUT;
- } else {
-- dev_dbg(&host->pd->dev, ": Happened End/Index error\n");
-+ dev_dbg(&host->pd->dev, ": End/Index error\n");
- ret = -EIO;
- }
- return ret;
-@@ -681,55 +685,44 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- static int sh_mmcif_data_trans(struct sh_mmcif_host *host,
- struct mmc_request *mrq, u32 opc)
- {
-- int ret;
--
- switch (opc) {
- case MMC_READ_MULTIPLE_BLOCK:
-- ret = sh_mmcif_multi_read(host, mrq);
-- break;
-+ return sh_mmcif_multi_read(host, mrq);
- case MMC_WRITE_MULTIPLE_BLOCK:
-- ret = sh_mmcif_multi_write(host, mrq);
-- break;
-+ return sh_mmcif_multi_write(host, mrq);
- case MMC_WRITE_BLOCK:
-- ret = sh_mmcif_single_write(host, mrq);
-- break;
-+ return sh_mmcif_single_write(host, mrq);
- case MMC_READ_SINGLE_BLOCK:
- case MMC_SEND_EXT_CSD:
-- ret = sh_mmcif_single_read(host, mrq);
-- break;
-+ return sh_mmcif_single_read(host, mrq);
- default:
- dev_err(&host->pd->dev, "UNSUPPORTED CMD = d'%08d\n", opc);
-- ret = -EINVAL;
-- break;
-+ return -EINVAL;
- }
-- return ret;
- }
-
- static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
-- struct mmc_request *mrq, struct mmc_command *cmd)
-+ struct mmc_request *mrq)
- {
-+ struct mmc_command *cmd = mrq->cmd;
- long time;
-- int ret = 0, mask = 0;
-- u32 opc = cmd->opcode;
-+ int ret = 0;
-+ u32 mask, opc = cmd->opcode;
-
- switch (opc) {
-- /* respons busy check */
-+ /* response busy check */
- case MMC_SWITCH:
- case MMC_STOP_TRANSMISSION:
- case MMC_SET_WRITE_PROT:
- case MMC_CLR_WRITE_PROT:
- case MMC_ERASE:
- case MMC_GEN_CMD:
-- mask = MASK_MRBSYE;
-+ mask = MASK_START_CMD | MASK_MRBSYE;
- break;
- default:
-- mask = MASK_MCRSPE;
-+ mask = MASK_START_CMD | MASK_MCRSPE;
- break;
- }
-- mask |= MASK_MCMDVIO | MASK_MBUFVIO | MASK_MWDATERR |
-- MASK_MRDATERR | MASK_MRIDXERR | MASK_MRSPERR |
-- MASK_MCCSTO | MASK_MCRCSTO | MASK_MWDATTO |
-- MASK_MRDATTO | MASK_MRBSYTO | MASK_MRSPTO;
-
- if (host->data) {
- sh_mmcif_writel(host->addr, MMCIF_CE_BLOCK_SET, 0);
-@@ -797,8 +790,9 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- }
-
- static void sh_mmcif_stop_cmd(struct sh_mmcif_host *host,
-- struct mmc_request *mrq, struct mmc_command *cmd)
-+ struct mmc_request *mrq)
- {
-+ struct mmc_command *cmd = mrq->stop;
- long time;
-
- if (mrq->cmd->opcode == MMC_READ_MULTIPLE_BLOCK)
-@@ -867,11 +861,11 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
- sh_mmcif_start_dma_tx(host);
- }
- }
-- sh_mmcif_start_cmd(host, mrq, mrq->cmd);
-+ sh_mmcif_start_cmd(host, mrq);
- host->data = NULL;
-
- if (!mrq->cmd->error && mrq->stop)
-- sh_mmcif_stop_cmd(host, mrq, mrq->stop);
-+ sh_mmcif_stop_cmd(host, mrq);
- host->state = STATE_IDLE;
- mmc_request_done(mmc, mrq);
- }
-@@ -948,11 +942,6 @@ static struct mmc_host_ops sh_mmcif_ops = {
- .get_cd = sh_mmcif_get_cd,
- };
-
--static void sh_mmcif_detect(struct mmc_host *mmc)
--{
-- mmc_detect_change(mmc, 0);
--}
--
- static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
- {
- struct sh_mmcif_host *host = dev_id;
-@@ -1114,7 +1103,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
- goto clean_up3;
- }
-
-- sh_mmcif_detect(host->mmc);
-+ mmc_detect_change(host->mmc, 0);
-
- dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
- dev_dbg(&pdev->dev, "chip ver H'%04x\n",
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0065-mmc-sh_mmcif-process-requests-asynchronously.patch b/patches.kzm9g/0065-mmc-sh_mmcif-process-requests-asynchronously.patch
deleted file mode 100644
index ac2e137efa91b1..00000000000000
--- a/patches.kzm9g/0065-mmc-sh_mmcif-process-requests-asynchronously.patch
+++ /dev/null
@@ -1,788 +0,0 @@
-From 24a541a85df9dd327db05d3ebb3058d256ac90a6 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Sun, 25 Dec 2011 21:07:52 +0100
-Subject: mmc: sh_mmcif: process requests asynchronously
-
-This patch converts the sh_mmcif MMC host driver to process requests
-asynchronously instead of waiting in its .request() method for completion.
-This is achieved by using threaded IRQs.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit f985da17f4d368896fb30d94531e4ffaa18e68d8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 588 +++++++++++++++++++++++++++++++-------------
- 1 file changed, 416 insertions(+), 172 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 1408ded..5d0ade7 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -16,6 +16,32 @@
- *
- */
-
-+/*
-+ * The MMCIF driver is now processing MMC requests asynchronously, according
-+ * to the Linux MMC API requirement.
-+ *
-+ * The MMCIF driver processes MMC requests in up to 3 stages: command, optional
-+ * data, and optional stop. To achieve asynchronous processing each of these
-+ * stages is split into two halves: a top and a bottom half. The top half
-+ * initialises the hardware, installs a timeout handler to handle completion
-+ * timeouts, and returns. In case of the command stage this immediately returns
-+ * control to the caller, leaving all further processing to run asynchronously.
-+ * All further request processing is performed by the bottom halves.
-+ *
-+ * The bottom half further consists of a "hard" IRQ handler, an IRQ handler
-+ * thread, a DMA completion callback, if DMA is used, a timeout work, and
-+ * request- and stage-specific handler methods.
-+ *
-+ * Each bottom half run begins with either a hardware interrupt, a DMA callback
-+ * invocation, or a timeout work run. In case of an error or a successful
-+ * processing completion, the MMC core is informed and the request processing is
-+ * finished. In case processing has to continue, i.e., if data has to be read
-+ * from or written to the card, or if a stop command has to be sent, the next
-+ * top half is called, which performs the necessary hardware handling and
-+ * reschedules the timeout work. This returns the driver state machine into the
-+ * bottom half waiting state.
-+ */
-+
- #include <linux/bitops.h>
- #include <linux/clk.h>
- #include <linux/completion.h>
-@@ -168,9 +194,22 @@ enum mmcif_state {
- STATE_IOS,
- };
-
-+enum mmcif_wait_for {
-+ MMCIF_WAIT_FOR_REQUEST,
-+ MMCIF_WAIT_FOR_CMD,
-+ MMCIF_WAIT_FOR_MREAD,
-+ MMCIF_WAIT_FOR_MWRITE,
-+ MMCIF_WAIT_FOR_READ,
-+ MMCIF_WAIT_FOR_WRITE,
-+ MMCIF_WAIT_FOR_READ_END,
-+ MMCIF_WAIT_FOR_WRITE_END,
-+ MMCIF_WAIT_FOR_STOP,
-+};
-+
- struct sh_mmcif_host {
- struct mmc_host *mmc;
- struct mmc_data *data;
-+ struct mmc_request *mrq;
- struct platform_device *pd;
- struct sh_dmae_slave dma_slave_tx;
- struct sh_dmae_slave dma_slave_rx;
-@@ -178,11 +217,17 @@ struct sh_mmcif_host {
- unsigned int clk;
- int bus_width;
- bool sd_error;
-+ bool dying;
- long timeout;
- void __iomem *addr;
-- struct completion intr_wait;
-+ u32 *pio_ptr;
- spinlock_t lock; /* protect sh_mmcif_host::state */
- enum mmcif_state state;
-+ enum mmcif_wait_for wait_for;
-+ struct delayed_work timeout_work;
-+ size_t blocksize;
-+ int sg_idx;
-+ int sg_blkidx;
- bool power;
- bool card_present;
-
-@@ -468,125 +513,183 @@ static int sh_mmcif_error_manage(struct sh_mmcif_host *host)
- return ret;
- }
-
--static int sh_mmcif_single_read(struct sh_mmcif_host *host,
-- struct mmc_request *mrq)
-+static bool sh_mmcif_next_block(struct sh_mmcif_host *host, u32 *p)
- {
-- struct mmc_data *data = mrq->data;
-- long time;
-- u32 blocksize, i, *p = sg_virt(data->sg);
-+ struct mmc_data *data = host->mrq->data;
-+
-+ host->sg_blkidx += host->blocksize;
-+
-+ /* data->sg->length must be a multiple of host->blocksize? */
-+ BUG_ON(host->sg_blkidx > data->sg->length);
-+
-+ if (host->sg_blkidx == data->sg->length) {
-+ host->sg_blkidx = 0;
-+ if (++host->sg_idx < data->sg_len)
-+ host->pio_ptr = sg_virt(++data->sg);
-+ } else {
-+ host->pio_ptr = p;
-+ }
-+
-+ if (host->sg_idx == data->sg_len)
-+ return false;
-+
-+ return true;
-+}
-+
-+static void sh_mmcif_single_read(struct sh_mmcif_host *host,
-+ struct mmc_request *mrq)
-+{
-+ host->blocksize = (sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET) &
-+ BLOCK_SIZE_MASK) + 3;
-+
-+ host->wait_for = MMCIF_WAIT_FOR_READ;
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-
- /* buf read enable */
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFREN);
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
--
-- blocksize = (BLOCK_SIZE_MASK &
-- sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET)) + 3;
-- for (i = 0; i < blocksize / 4; i++)
-+}
-+
-+static bool sh_mmcif_read_block(struct sh_mmcif_host *host)
-+{
-+ struct mmc_data *data = host->mrq->data;
-+ u32 *p = sg_virt(data->sg);
-+ int i;
-+
-+ if (host->sd_error) {
-+ data->error = sh_mmcif_error_manage(host);
-+ return false;
-+ }
-+
-+ for (i = 0; i < host->blocksize / 4; i++)
- *p++ = sh_mmcif_readl(host->addr, MMCIF_CE_DATA);
-
- /* buffer read end */
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFRE);
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
-+ host->wait_for = MMCIF_WAIT_FOR_READ_END;
-
-- return 0;
-+ return true;
- }
-
--static int sh_mmcif_multi_read(struct sh_mmcif_host *host,
-- struct mmc_request *mrq)
-+static void sh_mmcif_multi_read(struct sh_mmcif_host *host,
-+ struct mmc_request *mrq)
- {
- struct mmc_data *data = mrq->data;
-- long time;
-- u32 blocksize, i, j, sec, *p;
--
-- blocksize = BLOCK_SIZE_MASK & sh_mmcif_readl(host->addr,
-- MMCIF_CE_BLOCK_SET);
-- for (j = 0; j < data->sg_len; j++) {
-- p = sg_virt(data->sg);
-- for (sec = 0; sec < data->sg->length / blocksize; sec++) {
-- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFREN);
-- /* buf read enable */
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
--
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
--
-- for (i = 0; i < blocksize / 4; i++)
-- *p++ = sh_mmcif_readl(host->addr,
-- MMCIF_CE_DATA);
-- }
-- if (j < data->sg_len - 1)
-- data->sg++;
-+
-+ if (!data->sg_len || !data->sg->length)
-+ return;
-+
-+ host->blocksize = sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET) &
-+ BLOCK_SIZE_MASK;
-+
-+ host->wait_for = MMCIF_WAIT_FOR_MREAD;
-+ host->sg_idx = 0;
-+ host->sg_blkidx = 0;
-+ host->pio_ptr = sg_virt(data->sg);
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-+ sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFREN);
-+}
-+
-+static bool sh_mmcif_mread_block(struct sh_mmcif_host *host)
-+{
-+ struct mmc_data *data = host->mrq->data;
-+ u32 *p = host->pio_ptr;
-+ int i;
-+
-+ if (host->sd_error) {
-+ data->error = sh_mmcif_error_manage(host);
-+ return false;
- }
-- return 0;
-+
-+ BUG_ON(!data->sg->length);
-+
-+ for (i = 0; i < host->blocksize / 4; i++)
-+ *p++ = sh_mmcif_readl(host->addr, MMCIF_CE_DATA);
-+
-+ if (!sh_mmcif_next_block(host, p))
-+ return false;
-+
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-+ sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFREN);
-+
-+ return true;
- }
-
--static int sh_mmcif_single_write(struct sh_mmcif_host *host,
-+static void sh_mmcif_single_write(struct sh_mmcif_host *host,
- struct mmc_request *mrq)
- {
-- struct mmc_data *data = mrq->data;
-- long time;
-- u32 blocksize, i, *p = sg_virt(data->sg);
-+ host->blocksize = (sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET) &
-+ BLOCK_SIZE_MASK) + 3;
-
-- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
-+ host->wait_for = MMCIF_WAIT_FOR_WRITE;
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-
- /* buf write enable */
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
--
-- blocksize = (BLOCK_SIZE_MASK &
-- sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET)) + 3;
-- for (i = 0; i < blocksize / 4; i++)
-+ sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
-+}
-+
-+static bool sh_mmcif_write_block(struct sh_mmcif_host *host)
-+{
-+ struct mmc_data *data = host->mrq->data;
-+ u32 *p = sg_virt(data->sg);
-+ int i;
-+
-+ if (host->sd_error) {
-+ data->error = sh_mmcif_error_manage(host);
-+ return false;
-+ }
-+
-+ for (i = 0; i < host->blocksize / 4; i++)
- sh_mmcif_writel(host->addr, MMCIF_CE_DATA, *p++);
-
- /* buffer write end */
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MDTRANE);
-+ host->wait_for = MMCIF_WAIT_FOR_WRITE_END;
-
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
--
-- return 0;
-+ return true;
- }
-
--static int sh_mmcif_multi_write(struct sh_mmcif_host *host,
-- struct mmc_request *mrq)
-+static void sh_mmcif_multi_write(struct sh_mmcif_host *host,
-+ struct mmc_request *mrq)
- {
- struct mmc_data *data = mrq->data;
-- long time;
-- u32 i, sec, j, blocksize, *p;
-
-- blocksize = BLOCK_SIZE_MASK & sh_mmcif_readl(host->addr,
-- MMCIF_CE_BLOCK_SET);
-+ if (!data->sg_len || !data->sg->length)
-+ return;
-
-- for (j = 0; j < data->sg_len; j++) {
-- p = sg_virt(data->sg);
-- for (sec = 0; sec < data->sg->length / blocksize; sec++) {
-- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
-- /* buf write enable*/
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-+ host->blocksize = sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET) &
-+ BLOCK_SIZE_MASK;
-
-- if (time <= 0 || host->sd_error)
-- return sh_mmcif_error_manage(host);
-+ host->wait_for = MMCIF_WAIT_FOR_MWRITE;
-+ host->sg_idx = 0;
-+ host->sg_blkidx = 0;
-+ host->pio_ptr = sg_virt(data->sg);
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-+ sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
-+}
-
-- for (i = 0; i < blocksize / 4; i++)
-- sh_mmcif_writel(host->addr,
-- MMCIF_CE_DATA, *p++);
-- }
-- if (j < data->sg_len - 1)
-- data->sg++;
-+static bool sh_mmcif_mwrite_block(struct sh_mmcif_host *host)
-+{
-+ struct mmc_data *data = host->mrq->data;
-+ u32 *p = host->pio_ptr;
-+ int i;
-+
-+ if (host->sd_error) {
-+ data->error = sh_mmcif_error_manage(host);
-+ return false;
- }
-- return 0;
-+
-+ BUG_ON(!data->sg->length);
-+
-+ for (i = 0; i < host->blocksize / 4; i++)
-+ sh_mmcif_writel(host->addr, MMCIF_CE_DATA, *p++);
-+
-+ if (!sh_mmcif_next_block(host, p))
-+ return false;
-+
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
-+ sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
-+
-+ return true;
- }
-
- static void sh_mmcif_get_response(struct sh_mmcif_host *host,
-@@ -683,18 +786,22 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- }
-
- static int sh_mmcif_data_trans(struct sh_mmcif_host *host,
-- struct mmc_request *mrq, u32 opc)
-+ struct mmc_request *mrq, u32 opc)
- {
- switch (opc) {
- case MMC_READ_MULTIPLE_BLOCK:
-- return sh_mmcif_multi_read(host, mrq);
-+ sh_mmcif_multi_read(host, mrq);
-+ return 0;
- case MMC_WRITE_MULTIPLE_BLOCK:
-- return sh_mmcif_multi_write(host, mrq);
-+ sh_mmcif_multi_write(host, mrq);
-+ return 0;
- case MMC_WRITE_BLOCK:
-- return sh_mmcif_single_write(host, mrq);
-+ sh_mmcif_single_write(host, mrq);
-+ return 0;
- case MMC_READ_SINGLE_BLOCK:
- case MMC_SEND_EXT_CSD:
-- return sh_mmcif_single_read(host, mrq);
-+ sh_mmcif_single_read(host, mrq);
-+ return 0;
- default:
- dev_err(&host->pd->dev, "UNSUPPORTED CMD = d'%08d\n", opc);
- return -EINVAL;
-@@ -705,9 +812,8 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- struct mmc_request *mrq)
- {
- struct mmc_command *cmd = mrq->cmd;
-- long time;
-- int ret = 0;
-- u32 mask, opc = cmd->opcode;
-+ u32 opc = cmd->opcode;
-+ u32 mask;
-
- switch (opc) {
- /* response busy check */
-@@ -738,62 +844,14 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- /* set cmd */
- sh_mmcif_writel(host->addr, MMCIF_CE_CMD_SET, opc);
-
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0) {
-- cmd->error = sh_mmcif_error_manage(host);
-- return;
-- }
-- if (host->sd_error) {
-- switch (cmd->opcode) {
-- case MMC_ALL_SEND_CID:
-- case MMC_SELECT_CARD:
-- case MMC_APP_CMD:
-- cmd->error = -ETIMEDOUT;
-- break;
-- default:
-- dev_dbg(&host->pd->dev, "Cmd(d'%d) err\n",
-- cmd->opcode);
-- cmd->error = sh_mmcif_error_manage(host);
-- break;
-- }
-- host->sd_error = false;
-- return;
-- }
-- if (!(cmd->flags & MMC_RSP_PRESENT)) {
-- cmd->error = 0;
-- return;
-- }
-- sh_mmcif_get_response(host, cmd);
-- if (host->data) {
-- if (!host->dma_active) {
-- ret = sh_mmcif_data_trans(host, mrq, cmd->opcode);
-- } else {
-- long time =
-- wait_for_completion_interruptible_timeout(&host->dma_complete,
-- host->timeout);
-- if (!time)
-- ret = -ETIMEDOUT;
-- else if (time < 0)
-- ret = time;
-- sh_mmcif_bitclr(host, MMCIF_CE_BUF_ACC,
-- BUF_ACC_DMAREN | BUF_ACC_DMAWEN);
-- host->dma_active = false;
-- }
-- if (ret < 0)
-- mrq->data->bytes_xfered = 0;
-- else
-- mrq->data->bytes_xfered =
-- mrq->data->blocks * mrq->data->blksz;
-- }
-- cmd->error = ret;
-+ host->wait_for = MMCIF_WAIT_FOR_CMD;
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
- }
-
- static void sh_mmcif_stop_cmd(struct sh_mmcif_host *host,
- struct mmc_request *mrq)
- {
- struct mmc_command *cmd = mrq->stop;
-- long time;
-
- if (mrq->cmd->opcode == MMC_READ_MULTIPLE_BLOCK)
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MCMD12DRE);
-@@ -805,14 +863,8 @@ static void sh_mmcif_stop_cmd(struct sh_mmcif_host *host,
- return;
- }
-
-- time = wait_for_completion_interruptible_timeout(&host->intr_wait,
-- host->timeout);
-- if (time <= 0 || host->sd_error) {
-- cmd->error = sh_mmcif_error_manage(host);
-- return;
-- }
-- sh_mmcif_get_cmd12response(host, cmd);
-- cmd->error = 0;
-+ host->wait_for = MMCIF_WAIT_FOR_STOP;
-+ schedule_delayed_work(&host->timeout_work, host->timeout);
- }
-
- static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
-@@ -851,23 +903,11 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
- default:
- break;
- }
-+
-+ host->mrq = mrq;
- host->data = mrq->data;
-- if (mrq->data) {
-- if (mrq->data->flags & MMC_DATA_READ) {
-- if (host->chan_rx)
-- sh_mmcif_start_dma_rx(host);
-- } else {
-- if (host->chan_tx)
-- sh_mmcif_start_dma_tx(host);
-- }
-- }
-- sh_mmcif_start_cmd(host, mrq);
-- host->data = NULL;
-
-- if (!mrq->cmd->error && mrq->stop)
-- sh_mmcif_stop_cmd(host, mrq);
-- host->state = STATE_IDLE;
-- mmc_request_done(mmc, mrq);
-+ sh_mmcif_start_cmd(host, mrq);
- }
-
- static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
-@@ -942,6 +982,157 @@ static struct mmc_host_ops sh_mmcif_ops = {
- .get_cd = sh_mmcif_get_cd,
- };
-
-+static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
-+{
-+ struct mmc_command *cmd = host->mrq->cmd;
-+ long time;
-+
-+ if (host->sd_error) {
-+ switch (cmd->opcode) {
-+ case MMC_ALL_SEND_CID:
-+ case MMC_SELECT_CARD:
-+ case MMC_APP_CMD:
-+ cmd->error = -ETIMEDOUT;
-+ host->sd_error = false;
-+ break;
-+ default:
-+ cmd->error = sh_mmcif_error_manage(host);
-+ dev_dbg(&host->pd->dev, "Cmd(d'%d) error %d\n",
-+ cmd->opcode, cmd->error);
-+ break;
-+ }
-+ return false;
-+ }
-+ if (!(cmd->flags & MMC_RSP_PRESENT)) {
-+ cmd->error = 0;
-+ return false;
-+ }
-+
-+ sh_mmcif_get_response(host, cmd);
-+
-+ if (!host->data)
-+ return false;
-+
-+ if (host->mrq->data->flags & MMC_DATA_READ) {
-+ if (host->chan_rx)
-+ sh_mmcif_start_dma_rx(host);
-+ } else {
-+ if (host->chan_tx)
-+ sh_mmcif_start_dma_tx(host);
-+ }
-+
-+ if (!host->dma_active) {
-+ host->data->error = sh_mmcif_data_trans(host, host->mrq, cmd->opcode);
-+ if (!host->data->error)
-+ return true;
-+ return false;
-+ }
-+
-+ /* Running in the IRQ thread, can sleep */
-+ time = wait_for_completion_interruptible_timeout(&host->dma_complete,
-+ host->timeout);
-+ if (host->sd_error) {
-+ dev_err(host->mmc->parent,
-+ "Error IRQ while waiting for DMA completion!\n");
-+ /* Woken up by an error IRQ: abort DMA */
-+ if (host->data->flags & MMC_DATA_READ)
-+ dmaengine_terminate_all(host->chan_rx);
-+ else
-+ dmaengine_terminate_all(host->chan_tx);
-+ host->data->error = sh_mmcif_error_manage(host);
-+ } else if (!time) {
-+ host->data->error = -ETIMEDOUT;
-+ } else if (time < 0) {
-+ host->data->error = time;
-+ }
-+ sh_mmcif_bitclr(host, MMCIF_CE_BUF_ACC,
-+ BUF_ACC_DMAREN | BUF_ACC_DMAWEN);
-+ host->dma_active = false;
-+
-+ if (host->data->error)
-+ host->data->bytes_xfered = 0;
-+
-+ return false;
-+}
-+
-+static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
-+{
-+ struct sh_mmcif_host *host = dev_id;
-+ struct mmc_request *mrq = host->mrq;
-+
-+ cancel_delayed_work_sync(&host->timeout_work);
-+
-+ /*
-+ * All handlers return true, if processing continues, and false, if the
-+ * request has to be completed - successfully or not
-+ */
-+ switch (host->wait_for) {
-+ case MMCIF_WAIT_FOR_REQUEST:
-+ /* We're too late, the timeout has already kicked in */
-+ return IRQ_HANDLED;
-+ case MMCIF_WAIT_FOR_CMD:
-+ if (sh_mmcif_end_cmd(host))
-+ /* Wait for data */
-+ return IRQ_HANDLED;
-+ break;
-+ case MMCIF_WAIT_FOR_MREAD:
-+ if (sh_mmcif_mread_block(host))
-+ /* Wait for more data */
-+ return IRQ_HANDLED;
-+ break;
-+ case MMCIF_WAIT_FOR_READ:
-+ if (sh_mmcif_read_block(host))
-+ /* Wait for data end */
-+ return IRQ_HANDLED;
-+ break;
-+ case MMCIF_WAIT_FOR_MWRITE:
-+ if (sh_mmcif_mwrite_block(host))
-+ /* Wait data to write */
-+ return IRQ_HANDLED;
-+ break;
-+ case MMCIF_WAIT_FOR_WRITE:
-+ if (sh_mmcif_write_block(host))
-+ /* Wait for data end */
-+ return IRQ_HANDLED;
-+ break;
-+ case MMCIF_WAIT_FOR_STOP:
-+ if (host->sd_error) {
-+ mrq->stop->error = sh_mmcif_error_manage(host);
-+ break;
-+ }
-+ sh_mmcif_get_cmd12response(host, mrq->stop);
-+ mrq->stop->error = 0;
-+ break;
-+ case MMCIF_WAIT_FOR_READ_END:
-+ case MMCIF_WAIT_FOR_WRITE_END:
-+ if (host->sd_error)
-+ mrq->data->error = sh_mmcif_error_manage(host);
-+ break;
-+ default:
-+ BUG();
-+ }
-+
-+ if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
-+ host->data = NULL;
-+
-+ if (!mrq->cmd->error && mrq->data && !mrq->data->error)
-+ mrq->data->bytes_xfered =
-+ mrq->data->blocks * mrq->data->blksz;
-+
-+ if (mrq->stop && !mrq->cmd->error && (!mrq->data || !mrq->data->error)) {
-+ sh_mmcif_stop_cmd(host, mrq);
-+ if (!mrq->stop->error)
-+ return IRQ_HANDLED;
-+ }
-+ }
-+
-+ host->wait_for = MMCIF_WAIT_FOR_REQUEST;
-+ host->state = STATE_IDLE;
-+ mmc_request_done(host->mmc, mrq);
-+
-+ return IRQ_HANDLED;
-+}
-+
- static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
- {
- struct sh_mmcif_host *host = dev_id;
-@@ -993,14 +1184,58 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
- host->sd_error = true;
- dev_dbg(&host->pd->dev, "int err state = %08x\n", state);
- }
-- if (state & ~(INT_CMD12RBE | INT_CMD12CRE))
-- complete(&host->intr_wait);
-- else
-+ if (state & ~(INT_CMD12RBE | INT_CMD12CRE)) {
-+ if (!host->dma_active)
-+ return IRQ_WAKE_THREAD;
-+ else if (host->sd_error)
-+ mmcif_dma_complete(host);
-+ } else {
- dev_dbg(&host->pd->dev, "Unexpected IRQ 0x%x\n", state);
-+ }
-
- return IRQ_HANDLED;
- }
-
-+static void mmcif_timeout_work(struct work_struct *work)
-+{
-+ struct delayed_work *d = container_of(work, struct delayed_work, work);
-+ struct sh_mmcif_host *host = container_of(d, struct sh_mmcif_host, timeout_work);
-+ struct mmc_request *mrq = host->mrq;
-+
-+ if (host->dying)
-+ /* Don't run after mmc_remove_host() */
-+ return;
-+
-+ /*
-+ * Handle races with cancel_delayed_work(), unless
-+ * cancel_delayed_work_sync() is used
-+ */
-+ switch (host->wait_for) {
-+ case MMCIF_WAIT_FOR_CMD:
-+ mrq->cmd->error = sh_mmcif_error_manage(host);
-+ break;
-+ case MMCIF_WAIT_FOR_STOP:
-+ mrq->stop->error = sh_mmcif_error_manage(host);
-+ break;
-+ case MMCIF_WAIT_FOR_MREAD:
-+ case MMCIF_WAIT_FOR_MWRITE:
-+ case MMCIF_WAIT_FOR_READ:
-+ case MMCIF_WAIT_FOR_WRITE:
-+ case MMCIF_WAIT_FOR_READ_END:
-+ case MMCIF_WAIT_FOR_WRITE_END:
-+ host->data->error = sh_mmcif_error_manage(host);
-+ break;
-+ default:
-+ BUG();
-+ }
-+
-+ host->state = STATE_IDLE;
-+ host->wait_for = MMCIF_WAIT_FOR_REQUEST;
-+ host->data = NULL;
-+ host->mrq = NULL;
-+ mmc_request_done(host->mmc, mrq);
-+}
-+
- static int __devinit sh_mmcif_probe(struct platform_device *pdev)
- {
- int ret = 0, irq[2];
-@@ -1054,7 +1289,6 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
- host->clk = clk_get_rate(host->hclk);
- host->pd = pdev;
-
-- init_completion(&host->intr_wait);
- spin_lock_init(&host->lock);
-
- mmc->ops = &sh_mmcif_ops;
-@@ -1091,18 +1325,20 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
-
- sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
-
-- ret = request_irq(irq[0], sh_mmcif_intr, 0, "sh_mmc:error", host);
-+ ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:error", host);
- if (ret) {
- dev_err(&pdev->dev, "request_irq error (sh_mmc:error)\n");
- goto clean_up3;
- }
-- ret = request_irq(irq[1], sh_mmcif_intr, 0, "sh_mmc:int", host);
-+ ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host);
- if (ret) {
- free_irq(irq[0], host);
- dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
- goto clean_up3;
- }
-
-+ INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
-+
- mmc_detect_change(host->mmc, 0);
-
- dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
-@@ -1129,11 +1365,19 @@ static int __devexit sh_mmcif_remove(struct platform_device *pdev)
- struct sh_mmcif_host *host = platform_get_drvdata(pdev);
- int irq[2];
-
-+ host->dying = true;
- pm_runtime_get_sync(&pdev->dev);
-
- mmc_remove_host(host->mmc);
- sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
-
-+ /*
-+ * FIXME: cancel_delayed_work(_sync)() and free_irq() race with the
-+ * mmc_remove_host() call above. But swapping order doesn't help either
-+ * (a query on the linux-mmc mailing list didn't bring any replies).
-+ */
-+ cancel_delayed_work_sync(&host->timeout_work);
-+
- if (host->addr)
- iounmap(host->addr);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0066-mmc-sh_mmcif-remove-now-superfluous-sh_mmcif_host-da.patch b/patches.kzm9g/0066-mmc-sh_mmcif-remove-now-superfluous-sh_mmcif_host-da.patch
deleted file mode 100644
index 36257241a0c463..00000000000000
--- a/patches.kzm9g/0066-mmc-sh_mmcif-remove-now-superfluous-sh_mmcif_host-da.patch
+++ /dev/null
@@ -1,319 +0,0 @@
-From 2f2db71dd4017c3fec347a00c6e8b2a9ac8df42d Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Mon, 26 Dec 2011 12:52:13 -0500
-Subject: mmc: sh_mmcif: remove now superfluous sh_mmcif_host::data member
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 699834045f1ec30156dd51c362a6840e737baaba)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 94 ++++++++++++++++++++++++---------------------
- 1 file changed, 50 insertions(+), 44 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 5d0ade7..f5d8b53 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -208,7 +208,6 @@ enum mmcif_wait_for {
-
- struct sh_mmcif_host {
- struct mmc_host *mmc;
-- struct mmc_data *data;
- struct mmc_request *mrq;
- struct platform_device *pd;
- struct sh_dmae_slave dma_slave_tx;
-@@ -253,19 +252,21 @@ static inline void sh_mmcif_bitclr(struct sh_mmcif_host *host,
- static void mmcif_dma_complete(void *arg)
- {
- struct sh_mmcif_host *host = arg;
-+ struct mmc_data *data = host->mrq->data;
-+
- dev_dbg(&host->pd->dev, "Command completed\n");
-
-- if (WARN(!host->data, "%s: NULL data in DMA completion!\n",
-+ if (WARN(!data, "%s: NULL data in DMA completion!\n",
- dev_name(&host->pd->dev)))
- return;
-
-- if (host->data->flags & MMC_DATA_READ)
-+ if (data->flags & MMC_DATA_READ)
- dma_unmap_sg(host->chan_rx->device->dev,
-- host->data->sg, host->data->sg_len,
-+ data->sg, data->sg_len,
- DMA_FROM_DEVICE);
- else
- dma_unmap_sg(host->chan_tx->device->dev,
-- host->data->sg, host->data->sg_len,
-+ data->sg, data->sg_len,
- DMA_TO_DEVICE);
-
- complete(&host->dma_complete);
-@@ -273,13 +274,14 @@ static void mmcif_dma_complete(void *arg)
-
- static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
- {
-- struct scatterlist *sg = host->data->sg;
-+ struct mmc_data *data = host->mrq->data;
-+ struct scatterlist *sg = data->sg;
- struct dma_async_tx_descriptor *desc = NULL;
- struct dma_chan *chan = host->chan_rx;
- dma_cookie_t cookie = -EINVAL;
- int ret;
-
-- ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,
-+ ret = dma_map_sg(chan->device->dev, sg, data->sg_len,
- DMA_FROM_DEVICE);
- if (ret > 0) {
- host->dma_active = true;
-@@ -295,7 +297,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
- dma_async_issue_pending(chan);
- }
- dev_dbg(&host->pd->dev, "%s(): mapped %d -> %d, cookie %d\n",
-- __func__, host->data->sg_len, ret, cookie);
-+ __func__, data->sg_len, ret, cookie);
-
- if (!desc) {
- /* DMA failed, fall back to PIO */
-@@ -316,18 +318,19 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
- }
-
- dev_dbg(&host->pd->dev, "%s(): desc %p, cookie %d, sg[%d]\n", __func__,
-- desc, cookie, host->data->sg_len);
-+ desc, cookie, data->sg_len);
- }
-
- static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
- {
-- struct scatterlist *sg = host->data->sg;
-+ struct mmc_data *data = host->mrq->data;
-+ struct scatterlist *sg = data->sg;
- struct dma_async_tx_descriptor *desc = NULL;
- struct dma_chan *chan = host->chan_tx;
- dma_cookie_t cookie = -EINVAL;
- int ret;
-
-- ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,
-+ ret = dma_map_sg(chan->device->dev, sg, data->sg_len,
- DMA_TO_DEVICE);
- if (ret > 0) {
- host->dma_active = true;
-@@ -343,7 +346,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
- dma_async_issue_pending(chan);
- }
- dev_dbg(&host->pd->dev, "%s(): mapped %d -> %d, cookie %d\n",
-- __func__, host->data->sg_len, ret, cookie);
-+ __func__, data->sg_len, ret, cookie);
-
- if (!desc) {
- /* DMA failed, fall back to PIO */
-@@ -711,8 +714,11 @@ static void sh_mmcif_get_cmd12response(struct sh_mmcif_host *host,
- }
-
- static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
-- struct mmc_request *mrq, struct mmc_command *cmd, u32 opc)
-+ struct mmc_request *mrq)
- {
-+ struct mmc_data *data = mrq->data;
-+ struct mmc_command *cmd = mrq->cmd;
-+ u32 opc = cmd->opcode;
- u32 tmp = 0;
-
- /* Response Type check */
-@@ -744,7 +750,7 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- break;
- }
- /* WDAT / DATW */
-- if (host->data) {
-+ if (data) {
- tmp |= CMD_SET_WDAT;
- switch (host->bus_width) {
- case MMC_BUS_WIDTH_1:
-@@ -768,7 +774,7 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- if (opc == MMC_READ_MULTIPLE_BLOCK || opc == MMC_WRITE_MULTIPLE_BLOCK) {
- tmp |= CMD_SET_CMLTE | CMD_SET_CMD12EN;
- sh_mmcif_bitset(host, MMCIF_CE_BLOCK_SET,
-- mrq->data->blocks << 16);
-+ data->blocks << 16);
- }
- /* RIDXC[1:0] check bits */
- if (opc == MMC_SEND_OP_COND || opc == MMC_ALL_SEND_CID ||
-@@ -782,7 +788,7 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- opc == MMC_SEND_CSD || opc == MMC_SEND_CID)
- tmp |= CMD_SET_CRC7C_INTERNAL;
-
-- return opc = ((opc << 24) | tmp);
-+ return (opc << 24) | tmp;
- }
-
- static int sh_mmcif_data_trans(struct sh_mmcif_host *host,
-@@ -830,12 +836,12 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- break;
- }
-
-- if (host->data) {
-+ if (mrq->data) {
- sh_mmcif_writel(host->addr, MMCIF_CE_BLOCK_SET, 0);
- sh_mmcif_writel(host->addr, MMCIF_CE_BLOCK_SET,
- mrq->data->blksz);
- }
-- opc = sh_mmcif_set_cmd(host, mrq, cmd, opc);
-+ opc = sh_mmcif_set_cmd(host, mrq);
-
- sh_mmcif_writel(host->addr, MMCIF_CE_INT, 0xD80430C0);
- sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, mask);
-@@ -851,15 +857,16 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- static void sh_mmcif_stop_cmd(struct sh_mmcif_host *host,
- struct mmc_request *mrq)
- {
-- struct mmc_command *cmd = mrq->stop;
--
-- if (mrq->cmd->opcode == MMC_READ_MULTIPLE_BLOCK)
-+ switch (mrq->cmd->opcode) {
-+ case MMC_READ_MULTIPLE_BLOCK:
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MCMD12DRE);
-- else if (mrq->cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK)
-+ break;
-+ case MMC_WRITE_MULTIPLE_BLOCK:
- sh_mmcif_bitset(host, MMCIF_CE_INT_MASK, MASK_MCMD12RBE);
-- else {
-+ break;
-+ default:
- dev_err(&host->pd->dev, "unsupported stop cmd\n");
-- cmd->error = sh_mmcif_error_manage(host);
-+ mrq->stop->error = sh_mmcif_error_manage(host);
- return;
- }
-
-@@ -905,7 +912,6 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
- }
-
- host->mrq = mrq;
-- host->data = mrq->data;
-
- sh_mmcif_start_cmd(host, mrq);
- }
-@@ -985,6 +991,7 @@ static struct mmc_host_ops sh_mmcif_ops = {
- static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
- {
- struct mmc_command *cmd = host->mrq->cmd;
-+ struct mmc_data *data = host->mrq->data;
- long time;
-
- if (host->sd_error) {
-@@ -1010,10 +1017,10 @@ static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
-
- sh_mmcif_get_response(host, cmd);
-
-- if (!host->data)
-+ if (!data)
- return false;
-
-- if (host->mrq->data->flags & MMC_DATA_READ) {
-+ if (data->flags & MMC_DATA_READ) {
- if (host->chan_rx)
- sh_mmcif_start_dma_rx(host);
- } else {
-@@ -1022,8 +1029,8 @@ static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
- }
-
- if (!host->dma_active) {
-- host->data->error = sh_mmcif_data_trans(host, host->mrq, cmd->opcode);
-- if (!host->data->error)
-+ data->error = sh_mmcif_data_trans(host, host->mrq, cmd->opcode);
-+ if (!data->error)
- return true;
- return false;
- }
-@@ -1035,22 +1042,22 @@ static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
- dev_err(host->mmc->parent,
- "Error IRQ while waiting for DMA completion!\n");
- /* Woken up by an error IRQ: abort DMA */
-- if (host->data->flags & MMC_DATA_READ)
-+ if (data->flags & MMC_DATA_READ)
- dmaengine_terminate_all(host->chan_rx);
- else
- dmaengine_terminate_all(host->chan_tx);
-- host->data->error = sh_mmcif_error_manage(host);
-+ data->error = sh_mmcif_error_manage(host);
- } else if (!time) {
-- host->data->error = -ETIMEDOUT;
-+ data->error = -ETIMEDOUT;
- } else if (time < 0) {
-- host->data->error = time;
-+ data->error = time;
- }
- sh_mmcif_bitclr(host, MMCIF_CE_BUF_ACC,
- BUF_ACC_DMAREN | BUF_ACC_DMAWEN);
- host->dma_active = false;
-
-- if (host->data->error)
-- host->data->bytes_xfered = 0;
-+ if (data->error)
-+ data->bytes_xfered = 0;
-
- return false;
- }
-@@ -1059,6 +1066,7 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
- {
- struct sh_mmcif_host *host = dev_id;
- struct mmc_request *mrq = host->mrq;
-+ struct mmc_data *data = mrq->data;
-
- cancel_delayed_work_sync(&host->timeout_work);
-
-@@ -1106,20 +1114,18 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
- case MMCIF_WAIT_FOR_READ_END:
- case MMCIF_WAIT_FOR_WRITE_END:
- if (host->sd_error)
-- mrq->data->error = sh_mmcif_error_manage(host);
-+ data->error = sh_mmcif_error_manage(host);
- break;
- default:
- BUG();
- }
-
- if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
-- host->data = NULL;
-+ if (!mrq->cmd->error && data && !data->error)
-+ data->bytes_xfered =
-+ data->blocks * data->blksz;
-
-- if (!mrq->cmd->error && mrq->data && !mrq->data->error)
-- mrq->data->bytes_xfered =
-- mrq->data->blocks * mrq->data->blksz;
--
-- if (mrq->stop && !mrq->cmd->error && (!mrq->data || !mrq->data->error)) {
-+ if (mrq->stop && !mrq->cmd->error && (!data || !data->error)) {
- sh_mmcif_stop_cmd(host, mrq);
- if (!mrq->stop->error)
- return IRQ_HANDLED;
-@@ -1128,6 +1134,7 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
-
- host->wait_for = MMCIF_WAIT_FOR_REQUEST;
- host->state = STATE_IDLE;
-+ host->mrq = NULL;
- mmc_request_done(host->mmc, mrq);
-
- return IRQ_HANDLED;
-@@ -1223,7 +1230,7 @@ static void mmcif_timeout_work(struct work_struct *work)
- case MMCIF_WAIT_FOR_WRITE:
- case MMCIF_WAIT_FOR_READ_END:
- case MMCIF_WAIT_FOR_WRITE_END:
-- host->data->error = sh_mmcif_error_manage(host);
-+ mrq->data->error = sh_mmcif_error_manage(host);
- break;
- default:
- BUG();
-@@ -1231,7 +1238,6 @@ static void mmcif_timeout_work(struct work_struct *work)
-
- host->state = STATE_IDLE;
- host->wait_for = MMCIF_WAIT_FOR_REQUEST;
-- host->data = NULL;
- host->mrq = NULL;
- mmc_request_done(host->mmc, mrq);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0067-mmc-sh_mmcif-fix-MMC_GEN_CMD-setting.patch b/patches.kzm9g/0067-mmc-sh_mmcif-fix-MMC_GEN_CMD-setting.patch
deleted file mode 100644
index c7f20da2927c71..00000000000000
--- a/patches.kzm9g/0067-mmc-sh_mmcif-fix-MMC_GEN_CMD-setting.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 34adc0ba61f82e5f33cb9d17893051afaac12a7a Mon Sep 17 00:00:00 2001
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 7 Mar 2012 17:37:10 +0900
-Subject: mmc: sh_mmcif: fix MMC_GEN_CMD setting
-
-The MMC_GEN_CMD (CMD56) doesn't need to check busy signal.
-So, the patch fixes the setting.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 183f796b5f701f8ab530ab232e4c27aef527bd76)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index f5d8b53..f91ae31 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -745,7 +745,6 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host,
- case MMC_SET_WRITE_PROT:
- case MMC_CLR_WRITE_PROT:
- case MMC_ERASE:
-- case MMC_GEN_CMD:
- tmp |= CMD_SET_RBSY;
- break;
- }
-@@ -828,7 +827,6 @@ static void sh_mmcif_start_cmd(struct sh_mmcif_host *host,
- case MMC_SET_WRITE_PROT:
- case MMC_CLR_WRITE_PROT:
- case MMC_ERASE:
-- case MMC_GEN_CMD:
- mask = MASK_START_CMD | MASK_MRBSYE;
- break;
- default:
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0068-mmc-sh_mmcif-simplify-bitmask-macros.patch b/patches.kzm9g/0068-mmc-sh_mmcif-simplify-bitmask-macros.patch
deleted file mode 100644
index ea61e07929d1e0..00000000000000
--- a/patches.kzm9g/0068-mmc-sh_mmcif-simplify-bitmask-macros.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 75e468534fc26dc5eea595dee43f1a6ae0231ddc Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Fri, 16 Mar 2012 12:49:04 +0100
-Subject: mmc: sh_mmcif: simplify bitmask macros
-
-Purely cosmetic readability improvement, no functional change.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 135111cc5595c6a24dd826d503e2d2bae92da1c4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/mmc/sh_mmcif.h | 21 +++++++++------------
- 1 file changed, 9 insertions(+), 12 deletions(-)
-
-diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
-index 04ff452..05f0e3d 100644
---- a/include/linux/mmc/sh_mmcif.h
-+++ b/include/linux/mmc/sh_mmcif.h
-@@ -77,18 +77,15 @@ struct sh_mmcif_plat_data {
-
- /* CE_CLK_CTRL */
- #define CLK_ENABLE (1 << 24) /* 1: output mmc clock */
--#define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
--#define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
--#define CLKDIV_4 (1<<16) /* mmc clock frequency.
-- * n: bus clock/(2^(n+1)) */
--#define CLKDIV_256 (7<<16) /* mmc clock frequency. (see above) */
--#define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */
--#define SRBSYTO_29 ((1 << 11) | (1 << 10) | \
-- (1 << 9) | (1 << 8)) /* resp busy timeout */
--#define SRWDTO_29 ((1 << 7) | (1 << 6) | \
-- (1 << 5) | (1 << 4)) /* read/write timeout */
--#define SCCSTO_29 ((1 << 3) | (1 << 2) | \
-- (1 << 1) | (1 << 0)) /* ccs timeout */
-+#define CLK_CLEAR (0xf << 16)
-+#define CLK_SUP_PCLK (0xf << 16)
-+#define CLKDIV_4 (1 << 16) /* mmc clock frequency.
-+ * n: bus clock/(2^(n+1)) */
-+#define CLKDIV_256 (7 << 16) /* mmc clock frequency. (see above) */
-+#define SRSPTO_256 (2 << 12) /* resp timeout */
-+#define SRBSYTO_29 (0xf << 8) /* resp busy timeout */
-+#define SRWDTO_29 (0xf << 4) /* read/write timeout */
-+#define SCCSTO_29 (0xf << 0) /* ccs timeout */
-
- /* CE_VERSION */
- #define SOFT_RST_ON (1 << 31)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0069-mmc-sh_mmcif-double-clock-speed.patch b/patches.kzm9g/0069-mmc-sh_mmcif-double-clock-speed.patch
deleted file mode 100644
index 921cf8c2925c74..00000000000000
--- a/patches.kzm9g/0069-mmc-sh_mmcif-double-clock-speed.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 7d7d0268cfe4401bd5a571771542032700670266 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Wed, 28 Mar 2012 18:01:09 +0900
-Subject: mmc: sh_mmcif: double clock speed
-
-Correct an off-by one error when calculating the clock divisor in cases
-where the host clock is a power of two of the target clock. Previously the
-divisor was one greater than the correct value in these cases leading to
-the clock being set at half the desired speed.
-
-Thanks to Guennadi Liakhovetski for working with me on the logic for this
-change.
-
-Tested-by: Cao Minh Hiep <hiepcm@gmail.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit f93882570496aa02ba8a47bfaf81cce43046b978)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index f91ae31..6288046 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -453,7 +453,8 @@ static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk)
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK);
- else
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR &
-- ((fls(host->clk / clk) - 1) << 16));
-+ ((fls(DIV_ROUND_UP(host->clk,
-+ clk) - 1) - 1) << 16));
-
- sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0070-mmc-sh_mmcif-mmc-f_max-should-be-half-of-the-bus-clo.patch b/patches.kzm9g/0070-mmc-sh_mmcif-mmc-f_max-should-be-half-of-the-bus-clo.patch
deleted file mode 100644
index 49db503a2580cb..00000000000000
--- a/patches.kzm9g/0070-mmc-sh_mmcif-mmc-f_max-should-be-half-of-the-bus-clo.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From f75a73e27d80a451ca2d71defb9a19412eda150b Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Wed, 28 Mar 2012 18:01:10 +0900
-Subject: mmc: sh_mmcif: mmc->f_max should be half of the bus clock
-
-mmc->f_max should be half of the bus clock.
-And now that mmc->f_max is not equal to the bus clock the
-latter should be used directly to calculate mmc->f_min.
-
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Tested-by: Cao Minh Hiep <hiepcm@gmail.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit 930f152cc9998388031af577843baae572ac8ab6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 6288046..347b330 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -1297,14 +1297,14 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
- spin_lock_init(&host->lock);
-
- mmc->ops = &sh_mmcif_ops;
-- mmc->f_max = host->clk;
-+ mmc->f_max = host->clk / 2;
- /* close to 400KHz */
-- if (mmc->f_max < 51200000)
-- mmc->f_min = mmc->f_max / 128;
-- else if (mmc->f_max < 102400000)
-- mmc->f_min = mmc->f_max / 256;
-+ if (host->clk < 51200000)
-+ mmc->f_min = host->clk / 128;
-+ else if (host->clk < 102400000)
-+ mmc->f_min = host->clk / 256;
- else
-- mmc->f_min = mmc->f_max / 512;
-+ mmc->f_min = host->clk / 512;
- if (pd->ocr)
- mmc->ocr_avail = pd->ocr;
- mmc->caps = MMC_CAP_MMC_HIGHSPEED;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0071-mmc-sh_mmcif-Simplify-calculation-of-mmc-f_min.patch b/patches.kzm9g/0071-mmc-sh_mmcif-Simplify-calculation-of-mmc-f_min.patch
deleted file mode 100644
index a86157b48157da..00000000000000
--- a/patches.kzm9g/0071-mmc-sh_mmcif-Simplify-calculation-of-mmc-f_min.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From cf3d0f14aa4b001ace80b5535d6b1d6e84a0d0e2 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Wed, 28 Mar 2012 18:01:11 +0900
-Subject: mmc: sh_mmcif: Simplify calculation of mmc->f_min
-
-There is no need to tune mmc->f_min to a value near 400kHz as the MMC core
-begins testing frequencies at 400kHz regardless of the value of mmc->f_min.
-
-As suggested by Guennadi Liakhovetski.
-
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Tested-by: Cao Minh Hiep <hiepcm@gmail.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Chris Ball <cjb@laptop.org>
-(cherry picked from commit eb91b9118db8c05a5a1257b594b021d32b491254)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/mmc/host/sh_mmcif.c | 8 +-------
- 1 file changed, 1 insertion(+), 7 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 347b330..020c9cc 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -1298,13 +1298,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
-
- mmc->ops = &sh_mmcif_ops;
- mmc->f_max = host->clk / 2;
-- /* close to 400KHz */
-- if (host->clk < 51200000)
-- mmc->f_min = host->clk / 128;
-- else if (host->clk < 102400000)
-- mmc->f_min = host->clk / 256;
-- else
-- mmc->f_min = host->clk / 512;
-+ mmc->f_min = host->clk / 512;
- if (pd->ocr)
- mmc->ocr_avail = pd->ocr;
- mmc->caps = MMC_CAP_MMC_HIGHSPEED;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0072-ARM-mach-shmobile-clock-r8a7740-add-USB-clock.patch b/patches.kzm9g/0072-ARM-mach-shmobile-clock-r8a7740-add-USB-clock.patch
deleted file mode 100644
index 27f4312a233f86..00000000000000
--- a/patches.kzm9g/0072-ARM-mach-shmobile-clock-r8a7740-add-USB-clock.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From 30534687e4e814095198494bc946a63c55731d43 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:07:47 -0700
-Subject: ARM: mach-shmobile: clock-r8a7740: add USB clock
-
-R8A7740 USB needs many clocks for workaround,
-and it has confusing name "usb24s" and "usb24".
-This "usb24s" will be used by other clocks.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 118 ++++++++++++++++++++++++++++++++-
- 1 file changed, 116 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 99c4d74..30535f4 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -47,6 +47,7 @@
- #define PLLC01CR 0xe6150028
-
- #define SUBCKCR 0xe6150080
-+#define USBCKCR 0xe615008c
-
- #define MSTPSR0 0xe6150030
- #define MSTPSR1 0xe6150038
-@@ -181,6 +182,100 @@ static struct clk pllc1_div2_clk = {
- .parent = &pllc1_clk,
- };
-
-+/* USB clock */
-+static struct clk *usb24s_parents[] = {
-+ [0] = &system_clk,
-+ [1] = &extal2_clk
-+};
-+
-+static unsigned long usb24s_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate;
-+};
-+
-+static int usb24s_enable(struct clk *clk)
-+{
-+ __raw_writel(__raw_readl(USBCKCR) & ~(1 << 8), USBCKCR);
-+
-+ return 0;
-+}
-+
-+static void usb24s_disable(struct clk *clk)
-+{
-+ __raw_writel(__raw_readl(USBCKCR) | (1 << 8), USBCKCR);
-+}
-+
-+static int usb24s_set_parent(struct clk *clk, struct clk *parent)
-+{
-+ int i, ret;
-+ u32 val;
-+
-+ if (!clk->parent_table || !clk->parent_num)
-+ return -EINVAL;
-+
-+ /* Search the parent */
-+ for (i = 0; i < clk->parent_num; i++)
-+ if (clk->parent_table[i] == parent)
-+ break;
-+
-+ if (i == clk->parent_num)
-+ return -ENODEV;
-+
-+ ret = clk_reparent(clk, parent);
-+ if (ret < 0)
-+ return ret;
-+
-+ val = __raw_readl(USBCKCR);
-+ val &= ~(1 << 7);
-+ val |= i << 7;
-+ __raw_writel(val, USBCKCR);
-+
-+ return 0;
-+}
-+
-+static struct sh_clk_ops usb24s_clk_ops = {
-+ .recalc = usb24s_recalc,
-+ .enable = usb24s_enable,
-+ .disable = usb24s_disable,
-+ .set_parent = usb24s_set_parent,
-+};
-+
-+static struct clk usb24s_clk = {
-+ .ops = &usb24s_clk_ops,
-+ .parent_table = usb24s_parents,
-+ .parent_num = ARRAY_SIZE(usb24s_parents),
-+ .parent = &system_clk,
-+};
-+
-+static unsigned long usb24_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate /
-+ ((__raw_readl(USBCKCR) & (1 << 6)) ? 1 : 2);
-+};
-+
-+static int usb24_set_rate(struct clk *clk, unsigned long rate)
-+{
-+ u32 val;
-+
-+ /* closer to which ? parent->rate or parent->rate/2 */
-+ val = __raw_readl(USBCKCR);
-+ val &= ~(1 << 6);
-+ val |= (rate > (clk->parent->rate / 4) * 3) << 6;
-+ __raw_writel(val, USBCKCR);
-+
-+ return 0;
-+}
-+
-+static struct sh_clk_ops usb24_clk_ops = {
-+ .recalc = usb24_recalc,
-+ .set_rate = usb24_set_rate,
-+};
-+
-+static struct clk usb24_clk = {
-+ .ops = &usb24_clk_ops,
-+ .parent = &usb24s_clk,
-+};
-+
- struct clk *main_clks[] = {
- &extalr_clk,
- &extal1_clk,
-@@ -196,6 +291,8 @@ struct clk *main_clks[] = {
- &pllc0_clk,
- &pllc1_clk,
- &pllc1_div2_clk,
-+ &usb24s_clk,
-+ &usb24_clk,
- };
-
- static void div4_kick(struct clk *clk)
-@@ -223,7 +320,7 @@ static struct clk_div4_table div4_table = {
-
- enum {
- DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP,
-- DIV4_HPP, DIV4_S, DIV4_ZB, DIV4_M3, DIV4_CP,
-+ DIV4_HPP, DIV4_USBP, DIV4_S, DIV4_ZB, DIV4_M3, DIV4_CP,
- DIV4_NR
- };
-
-@@ -234,6 +331,7 @@ struct clk div4_clks[DIV4_NR] = {
- [DIV4_M1] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT),
- [DIV4_HP] = SH_CLK_DIV4(&pllc1_clk, FRQCRB, 4, 0x6fff, 0),
- [DIV4_HPP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 20, 0x6fff, 0),
-+ [DIV4_USBP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 16, 0x6fff, 0),
- [DIV4_S] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 12, 0x6fff, 0),
- [DIV4_ZB] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 8, 0x6fff, 0),
- [DIV4_M3] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 4, 0x6fff, 0),
-@@ -257,7 +355,9 @@ enum {
- MSTP222,
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-
-- MSTP329, MSTP323,
-+ MSTP329, MSTP323, MSTP320,
-+
-+ MSTP416, MSTP407, MSTP406,
-
- MSTP_NR
- };
-@@ -281,6 +381,11 @@ static struct clk mstp_clks[MSTP_NR] = {
-
- [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
- [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
-+ [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */
-+
-+ [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */
-+ [MSTP407] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-Func */
-+ [MSTP406] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 6, 0), /* USB Phy */
- };
-
- static struct clk_lookup lookups[] = {
-@@ -299,6 +404,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("pllc0_clk", &pllc0_clk),
- CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
- CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
-+ CLKDEV_CON_ID("usb24s", &usb24s_clk),
-
- /* DIV4 clocks */
- CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
-@@ -335,6 +441,14 @@ static struct clk_lookup lookups[] = {
-
- CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
- CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
-+ CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]),
-+
-+ /* ICK */
-+ CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]),
-+ CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]),
-+ CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]),
-+ CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]),
-+ CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk),
- };
-
- void __init r8a7740_clock_init(u8 md_ck)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0073-ALSA-workaround-change-the-timing-of-alsa_sound_last.patch b/patches.kzm9g/0073-ALSA-workaround-change-the-timing-of-alsa_sound_last.patch
deleted file mode 100644
index e0d98cea4904de..00000000000000
--- a/patches.kzm9g/0073-ALSA-workaround-change-the-timing-of-alsa_sound_last.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d7462814e127df262ab184179b807f388fe51c1f Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 19 Apr 2012 00:00:27 -0700
-Subject: ALSA: workaround: change the timing of alsa_sound_last_init()
-
-Current alsa_sound_last_init() was called as __initcall().
-So, on current ALSA, only devices that had been properly
-registered at this point were shown.
-So, it will show "No soundcards found" if driver requests
-probe deferment. it's often misleading.
-This patch delays the timing of alsa_sound_last_init()
-as workaround.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-(cherry picked from commit 590b4775d6b628c7ad215fd0335a0a787032e2dd)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/last.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sound/last.c b/sound/last.c
-index bdd0857..7ffc182 100644
---- a/sound/last.c
-+++ b/sound/last.c
-@@ -38,4 +38,4 @@ static int __init alsa_sound_last_init(void)
- return 0;
- }
-
--__initcall(alsa_sound_last_init);
-+late_initcall_sync(alsa_sound_last_init);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0074-ASoC-core-Optimise-and-refactor-pcm_new-to-pass-only.patch b/patches.kzm9g/0074-ASoC-core-Optimise-and-refactor-pcm_new-to-pass-only.patch
deleted file mode 100644
index bd3ba2b7f43230..00000000000000
--- a/patches.kzm9g/0074-ASoC-core-Optimise-and-refactor-pcm_new-to-pass-only.patch
+++ /dev/null
@@ -1,529 +0,0 @@
-From c41e2859faba7ea13c8bf3bf54a5c25d8297a09c Mon Sep 17 00:00:00 2001
-From: Liam Girdwood <lrg@ti.com>
-Date: Tue, 7 Jun 2011 16:08:33 +0100
-Subject: ASoC: core - Optimise and refactor pcm_new() to pass only rtd
-
-Currently pcm_new() passes in 3 arguments :- card, pcm and DAI.
-
-Refactor this to only pass in 1 argument (i.e. the rtd) since struct rtd contains
-card, pcm and DAI along with other members too that are useful too.
-
-Signed-off-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 552d1ef6b5a98d7b95959d5b139071e3c90cebf1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/soc.h | 3 +--
- sound/soc/atmel/atmel-pcm.c | 6 ++++--
- sound/soc/au1x/dbdma2.c | 7 ++++---
- sound/soc/blackfin/bf5xx-ac97-pcm.c | 6 ++++--
- sound/soc/blackfin/bf5xx-i2s-pcm.c | 6 ++++--
- sound/soc/blackfin/bf5xx-tdm-pcm.c | 6 ++++--
- sound/soc/davinci/davinci-pcm.c | 6 ++++--
- sound/soc/ep93xx/ep93xx-pcm.c | 6 ++++--
- sound/soc/fsl/fsl_dma.c | 6 ++++--
- sound/soc/fsl/mpc5200_dma.c | 7 ++++---
- sound/soc/imx/imx-pcm-fiq.c | 8 +++++---
- sound/soc/imx/imx-ssi.c | 7 ++++---
- sound/soc/imx/imx-ssi.h | 3 +--
- sound/soc/jz4740/jz4740-pcm.c | 6 ++++--
- sound/soc/kirkwood/kirkwood-dma.c | 6 ++++--
- sound/soc/mid-x86/sst_platform.c | 5 +++--
- sound/soc/nuc900/nuc900-pcm.c | 7 +++++--
- sound/soc/omap/omap-pcm.c | 6 ++++--
- sound/soc/pxa/pxa2xx-pcm.c | 6 ++++--
- sound/soc/s6000/s6000-pcm.c | 7 ++++---
- sound/soc/samsung/dma.c | 6 ++++--
- sound/soc/sh/dma-sh7760.c | 6 +++---
- sound/soc/sh/fsi.c | 6 +++---
- sound/soc/sh/siu_pcm.c | 5 +++--
- sound/soc/soc-core.c | 3 +--
- sound/soc/tegra/tegra_pcm.c | 6 ++++--
- sound/soc/txx9/txx9aclc.c | 5 +++--
- 27 files changed, 96 insertions(+), 61 deletions(-)
-
-diff --git a/include/sound/soc.h b/include/sound/soc.h
-index 3a4bd3a..e9db08c 100644
---- a/include/sound/soc.h
-+++ b/include/sound/soc.h
-@@ -623,8 +623,7 @@ struct snd_soc_platform_driver {
- int (*resume)(struct snd_soc_dai *dai);
-
- /* pcm creation and destruction */
-- int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
-- struct snd_pcm *);
-+ int (*pcm_new)(struct snd_soc_pcm_runtime *);
- void (*pcm_free)(struct snd_pcm *);
-
- /*
-diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
-index d0e7532..42f699c 100644
---- a/sound/soc/atmel/atmel-pcm.c
-+++ b/sound/soc/atmel/atmel-pcm.c
-@@ -364,9 +364,11 @@ static struct snd_pcm_ops atmel_pcm_ops = {
- \*--------------------------------------------------------------------------*/
- static u64 atmel_pcm_dmamask = 0xffffffff;
-
--static int atmel_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c
-index 10fdd28..20bb53a 100644
---- a/sound/soc/au1x/dbdma2.c
-+++ b/sound/soc/au1x/dbdma2.c
-@@ -319,10 +319,11 @@ static void au1xpsc_pcm_free_dma_buffers(struct snd_pcm *pcm)
- snd_pcm_lib_preallocate_free_for_all(pcm);
- }
-
--static int au1xpsc_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int au1xpsc_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_pcm *pcm = rtd->pcm;
-+
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
- card->dev, AU1XPSC_BUFFER_MIN_BYTES, (4096 * 1024) - 1);
-
-diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
-index 98b44b3..9e59f68 100644
---- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
-+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
-@@ -418,9 +418,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
-
- static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
-
--int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- pr_debug("%s enter\n", __func__);
-diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
-index f1fd95b..c42fb73 100644
---- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
-+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
-@@ -257,9 +257,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
-
- static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
-
--int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- pr_debug("%s enter\n", __func__);
-diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c
-index 07cfc7a..c95cc03 100644
---- a/sound/soc/blackfin/bf5xx-tdm-pcm.c
-+++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c
-@@ -283,9 +283,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
-
- static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
-
--static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
-index 9d35b8c..29759e1 100644
---- a/sound/soc/davinci/davinci-pcm.c
-+++ b/sound/soc/davinci/davinci-pcm.c
-@@ -811,9 +811,11 @@ static void davinci_pcm_free(struct snd_pcm *pcm)
-
- static u64 davinci_pcm_dmamask = 0xffffffff;
-
--static int davinci_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c
-index a456e49..e27c417 100644
---- a/sound/soc/ep93xx/ep93xx-pcm.c
-+++ b/sound/soc/ep93xx/ep93xx-pcm.c
-@@ -266,9 +266,11 @@ static void ep93xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
-
- static u64 ep93xx_pcm_dmamask = 0xffffffff;
-
--static int ep93xx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int ep93xx_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
-index 6680c0b..5312d1b 100644
---- a/sound/soc/fsl/fsl_dma.c
-+++ b/sound/soc/fsl/fsl_dma.c
-@@ -294,9 +294,11 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id)
- * Regardless of where the memory is actually allocated, since the device can
- * technically DMA to any 36-bit address, we do need to set the DMA mask to 36.
- */
--static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- static u64 fsl_dma_dmamask = DMA_BIT_MASK(36);
- int ret;
-
-diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
-index cbaf8b7..61d2ecc 100644
---- a/sound/soc/fsl/mpc5200_dma.c
-+++ b/sound/soc/fsl/mpc5200_dma.c
-@@ -299,10 +299,11 @@ static struct snd_pcm_ops psc_dma_ops = {
- };
-
- static u64 psc_dma_dmamask = 0xffffffff;
--static int psc_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
- {
-- struct snd_soc_pcm_runtime *rtd = pcm->private_data;
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(rtd->cpu_dai);
- size_t size = psc_dma_hardware.buffer_bytes_max;
- int rc = 0;
-diff --git a/sound/soc/imx/imx-pcm-fiq.c b/sound/soc/imx/imx-pcm-fiq.c
-index 413b78d..309c59e 100644
---- a/sound/soc/imx/imx-pcm-fiq.c
-+++ b/sound/soc/imx/imx-pcm-fiq.c
-@@ -238,12 +238,14 @@ static struct snd_pcm_ops imx_pcm_ops = {
-
- static int ssi_irq = 0;
-
--static int imx_pcm_fiq_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret;
-
-- ret = imx_pcm_new(card, dai, pcm);
-+ ret = imx_pcm_new(rtd);
- if (ret)
- return ret;
-
-diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c
-index 3b56254..3a676cd 100644
---- a/sound/soc/imx/imx-ssi.c
-+++ b/sound/soc/imx/imx-ssi.c
-@@ -388,10 +388,11 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
-
- static u64 imx_pcm_dmamask = DMA_BIT_MASK(32);
-
--int imx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
--
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/imx/imx-ssi.h b/sound/soc/imx/imx-ssi.h
-index dc8a875..0a84cec 100644
---- a/sound/soc/imx/imx-ssi.h
-+++ b/sound/soc/imx/imx-ssi.h
-@@ -225,8 +225,7 @@ struct snd_soc_platform *imx_ssi_dma_mx2_init(struct platform_device *pdev,
- struct imx_ssi *ssi);
-
- int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
--int imx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm);
-+int imx_pcm_new(struct snd_soc_pcm_runtime *rtd);
- void imx_pcm_free(struct snd_pcm *pcm);
-
- /*
-diff --git a/sound/soc/jz4740/jz4740-pcm.c b/sound/soc/jz4740/jz4740-pcm.c
-index fb1483f..a7c9578 100644
---- a/sound/soc/jz4740/jz4740-pcm.c
-+++ b/sound/soc/jz4740/jz4740-pcm.c
-@@ -299,9 +299,11 @@ static void jz4740_pcm_free(struct snd_pcm *pcm)
-
- static u64 jz4740_pcm_dmamask = DMA_BIT_MASK(32);
-
--int jz4740_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
-index e13c6ce..cd33de1 100644
---- a/sound/soc/kirkwood/kirkwood-dma.c
-+++ b/sound/soc/kirkwood/kirkwood-dma.c
-@@ -312,9 +312,11 @@ static int kirkwood_dma_preallocate_dma_buffer(struct snd_pcm *pcm,
- return 0;
- }
-
--static int kirkwood_dma_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
-index 5a946b4..3e78260 100644
---- a/sound/soc/mid-x86/sst_platform.c
-+++ b/sound/soc/mid-x86/sst_platform.c
-@@ -402,9 +402,10 @@ static void sst_pcm_free(struct snd_pcm *pcm)
- snd_pcm_lib_preallocate_free_for_all(pcm);
- }
-
--int sst_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+int sst_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int retval = 0;
-
- pr_debug("sst_pcm_new called\n");
-diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c
-index 8263f56..d589ef1 100644
---- a/sound/soc/nuc900/nuc900-pcm.c
-+++ b/sound/soc/nuc900/nuc900-pcm.c
-@@ -315,9 +315,12 @@ static void nuc900_dma_free_dma_buffers(struct snd_pcm *pcm)
- }
-
- static u64 nuc900_pcm_dmamask = DMA_BIT_MASK(32);
--static int nuc900_dma_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
-+
- if (!card->dev->dma_mask)
- card->dev->dma_mask = &nuc900_pcm_dmamask;
- if (!card->dev->coherent_dma_mask)
-diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
-index e6a6b99..b2f5751 100644
---- a/sound/soc/omap/omap-pcm.c
-+++ b/sound/soc/omap/omap-pcm.c
-@@ -366,9 +366,11 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm)
- }
- }
-
--static int omap_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
-index fab20a5..da28394 100644
---- a/sound/soc/pxa/pxa2xx-pcm.c
-+++ b/sound/soc/pxa/pxa2xx-pcm.c
-@@ -85,9 +85,11 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
-
- static u64 pxa2xx_pcm_dmamask = DMA_BIT_MASK(32);
-
--static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c
-index ab3ccae..80c85fd 100644
---- a/sound/soc/s6000/s6000-pcm.c
-+++ b/sound/soc/s6000/s6000-pcm.c
-@@ -443,10 +443,11 @@ static void s6000_pcm_free(struct snd_pcm *pcm)
-
- static u64 s6000_pcm_dmamask = DMA_BIT_MASK(32);
-
--static int s6000_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime)
- {
-- struct snd_soc_pcm_runtime *runtime = pcm->private_data;
-+ struct snd_card *card = runtime->card->snd_card;
-+ struct snd_soc_dai *dai = runtime->cpu_dai;
-+ struct snd_pcm *pcm = runtime->pcm;
- struct s6000_pcm_dma_params *params;
- int res;
-
-diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
-index 5cb3b88..9465588 100644
---- a/sound/soc/samsung/dma.c
-+++ b/sound/soc/samsung/dma.c
-@@ -425,9 +425,11 @@ static void dma_free_dma_buffers(struct snd_pcm *pcm)
-
- static u64 dma_mask = DMA_BIT_MASK(32);
-
--static int dma_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int dma_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- pr_debug("Entered %s\n", __func__);
-diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c
-index c326d29..db74005 100644
---- a/sound/soc/sh/dma-sh7760.c
-+++ b/sound/soc/sh/dma-sh7760.c
-@@ -327,10 +327,10 @@ static void camelot_pcm_free(struct snd_pcm *pcm)
- snd_pcm_lib_preallocate_free_for_all(pcm);
- }
-
--static int camelot_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_pcm *pcm = rtd->pcm;
-+
- /* dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel
- * in MMAP mode (i.e. aplay -M)
- */
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 4a9da6b..339a1df 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1129,10 +1129,10 @@ static void fsi_pcm_free(struct snd_pcm *pcm)
- snd_pcm_lib_preallocate_free_for_all(pcm);
- }
-
--static int fsi_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int fsi_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_pcm *pcm = rtd->pcm;
-+
- /*
- * dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel
- * in MMAP mode (i.e. aplay -M)
-diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
-index a423bab..f8f6816 100644
---- a/sound/soc/sh/siu_pcm.c
-+++ b/sound/soc/sh/siu_pcm.c
-@@ -527,10 +527,11 @@ static snd_pcm_uframes_t siu_pcm_pointer_dma(struct snd_pcm_substream *ss)
- return bytes_to_frames(ss->runtime, ptr);
- }
-
--static int siu_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int siu_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
- /* card->dev == socdev->dev, see snd_soc_new_pcms() */
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_pcm *pcm = rtd->pcm;
- struct siu_info *info = siu_i2s_data;
- struct platform_device *pdev = to_platform_device(card->dev);
- int ret;
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index e2bfe1d..f2a920a 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -2157,8 +2157,7 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &soc_pcm_ops);
-
- if (platform->driver->pcm_new) {
-- ret = platform->driver->pcm_new(rtd->card->snd_card,
-- codec_dai, pcm);
-+ ret = platform->driver->pcm_new(rtd);
- if (ret < 0) {
- pr_err("asoc: platform pcm constructor failed\n");
- return ret;
-diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
-index 6201710..c7cfd96 100644
---- a/sound/soc/tegra/tegra_pcm.c
-+++ b/sound/soc/tegra/tegra_pcm.c
-@@ -327,9 +327,11 @@ static void tegra_pcm_deallocate_dma_buffer(struct snd_pcm *pcm, int stream)
-
- static u64 tegra_dma_mask = DMA_BIT_MASK(32);
-
--static int tegra_pcm_new(struct snd_card *card,
-- struct snd_soc_dai *dai, struct snd_pcm *pcm)
-+static int tegra_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_card *card = rtd->card->snd_card;
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
-
- if (!card->dev->dma_mask)
-diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
-index f4aa4e0..34aa972 100644
---- a/sound/soc/txx9/txx9aclc.c
-+++ b/sound/soc/txx9/txx9aclc.c
-@@ -288,9 +288,10 @@ static void txx9aclc_pcm_free_dma_buffers(struct snd_pcm *pcm)
- snd_pcm_lib_preallocate_free_for_all(pcm);
- }
-
--static int txx9aclc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
-- struct snd_pcm *pcm)
-+static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd)
- {
-+ struct snd_soc_dai *dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm = rtd->pcm;
- struct platform_device *pdev = to_platform_device(dai->platform->dev);
- struct txx9aclc_soc_device *dev;
- struct resource *r;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0075-ASoC-core-Allow-components-to-probe-remove-in-sequen.patch b/patches.kzm9g/0075-ASoC-core-Allow-components-to-probe-remove-in-sequen.patch
deleted file mode 100644
index 7a32b263c33977..00000000000000
--- a/patches.kzm9g/0075-ASoC-core-Allow-components-to-probe-remove-in-sequen.patch
+++ /dev/null
@@ -1,249 +0,0 @@
-From 94df9e9b6182759ffe6a44fb699a5bd97bd5ca53 Mon Sep 17 00:00:00 2001
-From: Liam Girdwood <lrg@ti.com>
-Date: Tue, 7 Jun 2011 16:08:05 +0100
-Subject: ASoC: core - Allow components to probe/remove in sequence.
-
-Some ASoC components depend on other ASoC components to provide clocks and
-power resources in order to probe() and vice versa for remove().
-
-Allow components to be ordered so that components can be probed() and removed()
-in sequences that conform to their dependencies.
-
-Signed-off-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 0168bf0d130de83cd3532b834237c6228a6158dd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/soc-dai.h | 4 ++++
- include/sound/soc.h | 18 +++++++++++++++
- sound/soc/soc-core.c | 60 ++++++++++++++++++++++++++++++++-----------------
- 3 files changed, 61 insertions(+), 21 deletions(-)
-
-diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
-index 1bafe95..5ad5f3a 100644
---- a/include/sound/soc-dai.h
-+++ b/include/sound/soc-dai.h
-@@ -209,6 +209,10 @@ struct snd_soc_dai_driver {
- struct snd_soc_pcm_stream capture;
- struct snd_soc_pcm_stream playback;
- unsigned int symmetric_rates:1;
-+
-+ /* probe ordering - for components with runtime dependencies */
-+ int probe_order;
-+ int remove_order;
- };
-
- /*
-diff --git a/include/sound/soc.h b/include/sound/soc.h
-index e9db08c..447232c 100644
---- a/include/sound/soc.h
-+++ b/include/sound/soc.h
-@@ -203,6 +203,16 @@
- SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
-
- /*
-+ * Component probe and remove ordering levels for components with runtime
-+ * dependencies.
-+ */
-+#define SND_SOC_COMP_ORDER_FIRST -2
-+#define SND_SOC_COMP_ORDER_EARLY -1
-+#define SND_SOC_COMP_ORDER_NORMAL 0
-+#define SND_SOC_COMP_ORDER_LATE 1
-+#define SND_SOC_COMP_ORDER_LAST 2
-+
-+/*
- * Bias levels
- *
- * @ON: Bias is fully on for audio playback and capture operations.
-@@ -612,6 +622,10 @@ struct snd_soc_codec_driver {
-
- void (*seq_notifier)(struct snd_soc_dapm_context *,
- enum snd_soc_dapm_type, int);
-+
-+ /* probe ordering - for components with runtime dependencies */
-+ int probe_order;
-+ int remove_order;
- };
-
- /* SoC platform interface */
-@@ -635,6 +649,10 @@ struct snd_soc_platform_driver {
-
- /* platform stream ops */
- struct snd_pcm_ops *ops;
-+
-+ /* probe ordering - for components with runtime dependencies */
-+ int probe_order;
-+ int remove_order;
- };
-
- struct snd_soc_platform {
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index f2a920a..841b1c9 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -1396,7 +1396,7 @@ static void soc_remove_codec(struct snd_soc_codec *codec)
- module_put(codec->dev->driver->owner);
- }
-
--static void soc_remove_dai_link(struct snd_soc_card *card, int num)
-+static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order)
- {
- struct snd_soc_pcm_runtime *rtd = &card->rtd[num];
- struct snd_soc_codec *codec = rtd->codec;
-@@ -1413,7 +1413,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num)
- }
-
- /* remove the CODEC DAI */
-- if (codec_dai && codec_dai->probed) {
-+ if (codec_dai && codec_dai->probed &&
-+ codec_dai->driver->remove_order == order) {
- if (codec_dai->driver->remove) {
- err = codec_dai->driver->remove(codec_dai);
- if (err < 0)
-@@ -1424,7 +1425,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num)
- }
-
- /* remove the platform */
-- if (platform && platform->probed) {
-+ if (platform && platform->probed &&
-+ platform->driver->remove_order == order) {
- if (platform->driver->remove) {
- err = platform->driver->remove(platform);
- if (err < 0)
-@@ -1436,11 +1438,13 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num)
- }
-
- /* remove the CODEC */
-- if (codec && codec->probed)
-+ if (codec && codec->probed &&
-+ codec->driver->remove_order == order)
- soc_remove_codec(codec);
-
- /* remove the cpu_dai */
-- if (cpu_dai && cpu_dai->probed) {
-+ if (cpu_dai && cpu_dai->probed &&
-+ cpu_dai->driver->remove_order == order) {
- if (cpu_dai->driver->remove) {
- err = cpu_dai->driver->remove(cpu_dai);
- if (err < 0)
-@@ -1454,11 +1458,13 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num)
-
- static void soc_remove_dai_links(struct snd_soc_card *card)
- {
-- int i;
--
-- for (i = 0; i < card->num_rtd; i++)
-- soc_remove_dai_link(card, i);
-+ int dai, order;
-
-+ for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
-+ order++) {
-+ for (dai = 0; dai < card->num_rtd; dai++)
-+ soc_remove_dai_link(card, dai, order);
-+ }
- card->num_rtd = 0;
- }
-
-@@ -1599,7 +1605,7 @@ static int soc_post_component_init(struct snd_soc_card *card,
- return 0;
- }
-
--static int soc_probe_dai_link(struct snd_soc_card *card, int num)
-+static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
- {
- struct snd_soc_dai_link *dai_link = &card->dai_link[num];
- struct snd_soc_pcm_runtime *rtd = &card->rtd[num];
-@@ -1608,7 +1614,8 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
- struct snd_soc_dai *codec_dai = rtd->codec_dai, *cpu_dai = rtd->cpu_dai;
- int ret;
-
-- dev_dbg(card->dev, "probe %s dai link %d\n", card->name, num);
-+ dev_dbg(card->dev, "probe %s dai link %d late %d\n",
-+ card->name, num, order);
-
- /* config components */
- codec_dai->codec = codec;
-@@ -1620,7 +1627,8 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
- rtd->pmdown_time = pmdown_time;
-
- /* probe the cpu_dai */
-- if (!cpu_dai->probed) {
-+ if (!cpu_dai->probed &&
-+ cpu_dai->driver->probe_order == order) {
- if (!try_module_get(cpu_dai->dev->driver->owner))
- return -ENODEV;
-
-@@ -1639,14 +1647,16 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
- }
-
- /* probe the CODEC */
-- if (!codec->probed) {
-+ if (!codec->probed &&
-+ codec->driver->probe_order == order) {
- ret = soc_probe_codec(card, codec);
- if (ret < 0)
- return ret;
- }
-
- /* probe the platform */
-- if (!platform->probed) {
-+ if (!platform->probed &&
-+ platform->driver->probe_order == order) {
- if (!try_module_get(platform->dev->driver->owner))
- return -ENODEV;
-
-@@ -1665,7 +1675,7 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
- }
-
- /* probe the CODEC DAI */
-- if (!codec_dai->probed) {
-+ if (!codec_dai->probed && codec_dai->driver->probe_order == order) {
- if (codec_dai->driver->probe) {
- ret = codec_dai->driver->probe(codec_dai);
- if (ret < 0) {
-@@ -1680,6 +1690,10 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
- list_add(&codec_dai->card_list, &card->dai_dev_list);
- }
-
-+ /* complete DAI probe during last probe */
-+ if (order != SND_SOC_COMP_ORDER_LAST)
-+ return 0;
-+
- /* DAPM dai link stream work */
- INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work);
-
-@@ -1820,7 +1834,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
- struct snd_soc_codec *codec;
- struct snd_soc_codec_conf *codec_conf;
- enum snd_soc_compress_type compress_type;
-- int ret, i;
-+ int ret, i, order;
-
- mutex_lock(&card->mutex);
-
-@@ -1898,12 +1912,16 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
- goto card_probe_error;
- }
-
-- for (i = 0; i < card->num_links; i++) {
-- ret = soc_probe_dai_link(card, i);
-- if (ret < 0) {
-- pr_err("asoc: failed to instantiate card %s: %d\n",
-+ /* early DAI link probe */
-+ for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
-+ order++) {
-+ for (i = 0; i < card->num_links; i++) {
-+ ret = soc_probe_dai_link(card, i, order);
-+ if (ret < 0) {
-+ pr_err("asoc: failed to instantiate card %s: %d\n",
- card->name, ret);
-- goto probe_dai_err;
-+ goto probe_dai_err;
-+ }
- }
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0076-ASoC-core-Separate-out-PCM-operations-into-new-file.patch b/patches.kzm9g/0076-ASoC-core-Separate-out-PCM-operations-into-new-file.patch
deleted file mode 100644
index a4e97ef1757301..00000000000000
--- a/patches.kzm9g/0076-ASoC-core-Separate-out-PCM-operations-into-new-file.patch
+++ /dev/null
@@ -1,1333 +0,0 @@
-From 481aa7d92ac3e22d6bc73a27f56efe7cec947585 Mon Sep 17 00:00:00 2001
-From: Liam Girdwood <lrg@ti.com>
-Date: Thu, 9 Jun 2011 14:45:53 +0100
-Subject: ASoC: core - Separate out PCM operations into new file.
-
-In preparation for Dynamic PCM support (AKA DSP support).
-
-There will be future patches that add support to allow PCMs to be dynamically
-routed to multiple DAIs at startup and also during stream runtime. This patch
-moves the ASoC core PCM operaitions into a new file called soc-pcm.c. This will
-in simplify the ASoC core features into distinct files.
-
-Signed-off-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit ddee627cf6bb601aa980104fc17d4f84201380be)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/Makefile | 2 +-
- sound/soc/soc-core.c | 612 +-----------------------------------------------
- sound/soc/soc-pcm.c | 639 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 641 insertions(+), 612 deletions(-)
- create mode 100644 sound/soc/soc-pcm.c
-
-diff --git a/sound/soc/Makefile b/sound/soc/Makefile
-index 1ed61c5..adb5719 100644
---- a/sound/soc/Makefile
-+++ b/sound/soc/Makefile
-@@ -1,4 +1,4 @@
--snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
-+snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o soc-pcm.o
-
- obj-$(CONFIG_SND_SOC) += snd-soc-core.o
- obj-$(CONFIG_SND_SOC) += codecs/
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index 841b1c9..f5ec7d8 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -45,7 +45,6 @@
-
- #define NAME_SIZE 32
-
--static DEFINE_MUTEX(pcm_mutex);
- static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq);
-
- #ifdef CONFIG_DEBUG_FS
-@@ -59,7 +58,7 @@ static LIST_HEAD(dai_list);
- static LIST_HEAD(platform_list);
- static LIST_HEAD(codec_list);
-
--static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
-+int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
-
- /*
- * This is a timeout to do a DAPM powerdown after a stream is closed().
-@@ -486,552 +485,6 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
- }
- #endif
-
--static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- int ret;
--
-- if (!codec_dai->driver->symmetric_rates &&
-- !cpu_dai->driver->symmetric_rates &&
-- !rtd->dai_link->symmetric_rates)
-- return 0;
--
-- /* This can happen if multiple streams are starting simultaneously -
-- * the second can need to get its constraints before the first has
-- * picked a rate. Complain and allow the application to carry on.
-- */
-- if (!rtd->rate) {
-- dev_warn(&rtd->dev,
-- "Not enforcing symmetric_rates due to race\n");
-- return 0;
-- }
--
-- dev_dbg(&rtd->dev, "Symmetry forces %dHz rate\n", rtd->rate);
--
-- ret = snd_pcm_hw_constraint_minmax(substream->runtime,
-- SNDRV_PCM_HW_PARAM_RATE,
-- rtd->rate, rtd->rate);
-- if (ret < 0) {
-- dev_err(&rtd->dev,
-- "Unable to apply rate symmetry constraint: %d\n", ret);
-- return ret;
-- }
--
-- return 0;
--}
--
--/*
-- * Called by ALSA when a PCM substream is opened, the runtime->hw record is
-- * then initialized and any private data can be allocated. This also calls
-- * startup for the cpu DAI, platform, machine and codec DAI.
-- */
--static int soc_pcm_open(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_pcm_runtime *runtime = substream->runtime;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- struct snd_soc_dai_driver *cpu_dai_drv = cpu_dai->driver;
-- struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver;
-- int ret = 0;
--
-- mutex_lock(&pcm_mutex);
--
-- /* startup the audio subsystem */
-- if (cpu_dai->driver->ops->startup) {
-- ret = cpu_dai->driver->ops->startup(substream, cpu_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: can't open interface %s\n",
-- cpu_dai->name);
-- goto out;
-- }
-- }
--
-- if (platform->driver->ops && platform->driver->ops->open) {
-- ret = platform->driver->ops->open(substream);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: can't open platform %s\n", platform->name);
-- goto platform_err;
-- }
-- }
--
-- if (codec_dai->driver->ops->startup) {
-- ret = codec_dai->driver->ops->startup(substream, codec_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: can't open codec %s\n",
-- codec_dai->name);
-- goto codec_dai_err;
-- }
-- }
--
-- if (rtd->dai_link->ops && rtd->dai_link->ops->startup) {
-- ret = rtd->dai_link->ops->startup(substream);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: %s startup failed\n", rtd->dai_link->name);
-- goto machine_err;
-- }
-- }
--
-- /* Check that the codec and cpu DAIs are compatible */
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-- runtime->hw.rate_min =
-- max(codec_dai_drv->playback.rate_min,
-- cpu_dai_drv->playback.rate_min);
-- runtime->hw.rate_max =
-- min(codec_dai_drv->playback.rate_max,
-- cpu_dai_drv->playback.rate_max);
-- runtime->hw.channels_min =
-- max(codec_dai_drv->playback.channels_min,
-- cpu_dai_drv->playback.channels_min);
-- runtime->hw.channels_max =
-- min(codec_dai_drv->playback.channels_max,
-- cpu_dai_drv->playback.channels_max);
-- runtime->hw.formats =
-- codec_dai_drv->playback.formats & cpu_dai_drv->playback.formats;
-- runtime->hw.rates =
-- codec_dai_drv->playback.rates & cpu_dai_drv->playback.rates;
-- if (codec_dai_drv->playback.rates
-- & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-- runtime->hw.rates |= cpu_dai_drv->playback.rates;
-- if (cpu_dai_drv->playback.rates
-- & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-- runtime->hw.rates |= codec_dai_drv->playback.rates;
-- } else {
-- runtime->hw.rate_min =
-- max(codec_dai_drv->capture.rate_min,
-- cpu_dai_drv->capture.rate_min);
-- runtime->hw.rate_max =
-- min(codec_dai_drv->capture.rate_max,
-- cpu_dai_drv->capture.rate_max);
-- runtime->hw.channels_min =
-- max(codec_dai_drv->capture.channels_min,
-- cpu_dai_drv->capture.channels_min);
-- runtime->hw.channels_max =
-- min(codec_dai_drv->capture.channels_max,
-- cpu_dai_drv->capture.channels_max);
-- runtime->hw.formats =
-- codec_dai_drv->capture.formats & cpu_dai_drv->capture.formats;
-- runtime->hw.rates =
-- codec_dai_drv->capture.rates & cpu_dai_drv->capture.rates;
-- if (codec_dai_drv->capture.rates
-- & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-- runtime->hw.rates |= cpu_dai_drv->capture.rates;
-- if (cpu_dai_drv->capture.rates
-- & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-- runtime->hw.rates |= codec_dai_drv->capture.rates;
-- }
--
-- ret = -EINVAL;
-- snd_pcm_limit_hw_rates(runtime);
-- if (!runtime->hw.rates) {
-- printk(KERN_ERR "asoc: %s <-> %s No matching rates\n",
-- codec_dai->name, cpu_dai->name);
-- goto config_err;
-- }
-- if (!runtime->hw.formats) {
-- printk(KERN_ERR "asoc: %s <-> %s No matching formats\n",
-- codec_dai->name, cpu_dai->name);
-- goto config_err;
-- }
-- if (!runtime->hw.channels_min || !runtime->hw.channels_max ||
-- runtime->hw.channels_min > runtime->hw.channels_max) {
-- printk(KERN_ERR "asoc: %s <-> %s No matching channels\n",
-- codec_dai->name, cpu_dai->name);
-- goto config_err;
-- }
--
-- /* Symmetry only applies if we've already got an active stream. */
-- if (cpu_dai->active || codec_dai->active) {
-- ret = soc_pcm_apply_symmetry(substream);
-- if (ret != 0)
-- goto config_err;
-- }
--
-- pr_debug("asoc: %s <-> %s info:\n",
-- codec_dai->name, cpu_dai->name);
-- pr_debug("asoc: rate mask 0x%x\n", runtime->hw.rates);
-- pr_debug("asoc: min ch %d max ch %d\n", runtime->hw.channels_min,
-- runtime->hw.channels_max);
-- pr_debug("asoc: min rate %d max rate %d\n", runtime->hw.rate_min,
-- runtime->hw.rate_max);
--
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-- cpu_dai->playback_active++;
-- codec_dai->playback_active++;
-- } else {
-- cpu_dai->capture_active++;
-- codec_dai->capture_active++;
-- }
-- cpu_dai->active++;
-- codec_dai->active++;
-- rtd->codec->active++;
-- mutex_unlock(&pcm_mutex);
-- return 0;
--
--config_err:
-- if (rtd->dai_link->ops && rtd->dai_link->ops->shutdown)
-- rtd->dai_link->ops->shutdown(substream);
--
--machine_err:
-- if (codec_dai->driver->ops->shutdown)
-- codec_dai->driver->ops->shutdown(substream, codec_dai);
--
--codec_dai_err:
-- if (platform->driver->ops && platform->driver->ops->close)
-- platform->driver->ops->close(substream);
--
--platform_err:
-- if (cpu_dai->driver->ops->shutdown)
-- cpu_dai->driver->ops->shutdown(substream, cpu_dai);
--out:
-- mutex_unlock(&pcm_mutex);
-- return ret;
--}
--
--/*
-- * Power down the audio subsystem pmdown_time msecs after close is called.
-- * This is to ensure there are no pops or clicks in between any music tracks
-- * due to DAPM power cycling.
-- */
--static void close_delayed_work(struct work_struct *work)
--{
-- struct snd_soc_pcm_runtime *rtd =
-- container_of(work, struct snd_soc_pcm_runtime, delayed_work.work);
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
--
-- mutex_lock(&pcm_mutex);
--
-- pr_debug("pop wq checking: %s status: %s waiting: %s\n",
-- codec_dai->driver->playback.stream_name,
-- codec_dai->playback_active ? "active" : "inactive",
-- codec_dai->pop_wait ? "yes" : "no");
--
-- /* are we waiting on this codec DAI stream */
-- if (codec_dai->pop_wait == 1) {
-- codec_dai->pop_wait = 0;
-- snd_soc_dapm_stream_event(rtd,
-- codec_dai->driver->playback.stream_name,
-- SND_SOC_DAPM_STREAM_STOP);
-- }
--
-- mutex_unlock(&pcm_mutex);
--}
--
--/*
-- * Called by ALSA when a PCM substream is closed. Private data can be
-- * freed here. The cpu DAI, codec DAI, machine and platform are also
-- * shutdown.
-- */
--static int soc_codec_close(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- struct snd_soc_codec *codec = rtd->codec;
--
-- mutex_lock(&pcm_mutex);
--
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-- cpu_dai->playback_active--;
-- codec_dai->playback_active--;
-- } else {
-- cpu_dai->capture_active--;
-- codec_dai->capture_active--;
-- }
--
-- cpu_dai->active--;
-- codec_dai->active--;
-- codec->active--;
--
-- /* Muting the DAC suppresses artifacts caused during digital
-- * shutdown, for example from stopping clocks.
-- */
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-- snd_soc_dai_digital_mute(codec_dai, 1);
--
-- if (cpu_dai->driver->ops->shutdown)
-- cpu_dai->driver->ops->shutdown(substream, cpu_dai);
--
-- if (codec_dai->driver->ops->shutdown)
-- codec_dai->driver->ops->shutdown(substream, codec_dai);
--
-- if (rtd->dai_link->ops && rtd->dai_link->ops->shutdown)
-- rtd->dai_link->ops->shutdown(substream);
--
-- if (platform->driver->ops && platform->driver->ops->close)
-- platform->driver->ops->close(substream);
-- cpu_dai->runtime = NULL;
--
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-- /* start delayed pop wq here for playback streams */
-- codec_dai->pop_wait = 1;
-- schedule_delayed_work(&rtd->delayed_work,
-- msecs_to_jiffies(rtd->pmdown_time));
-- } else {
-- /* capture streams can be powered down now */
-- snd_soc_dapm_stream_event(rtd,
-- codec_dai->driver->capture.stream_name,
-- SND_SOC_DAPM_STREAM_STOP);
-- }
--
-- mutex_unlock(&pcm_mutex);
-- return 0;
--}
--
--/*
-- * Called by ALSA when the PCM substream is prepared, can set format, sample
-- * rate, etc. This function is non atomic and can be called multiple times,
-- * it can refer to the runtime info.
-- */
--static int soc_pcm_prepare(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- int ret = 0;
--
-- mutex_lock(&pcm_mutex);
--
-- if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) {
-- ret = rtd->dai_link->ops->prepare(substream);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: machine prepare error\n");
-- goto out;
-- }
-- }
--
-- if (platform->driver->ops && platform->driver->ops->prepare) {
-- ret = platform->driver->ops->prepare(substream);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: platform prepare error\n");
-- goto out;
-- }
-- }
--
-- if (codec_dai->driver->ops->prepare) {
-- ret = codec_dai->driver->ops->prepare(substream, codec_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: codec DAI prepare error\n");
-- goto out;
-- }
-- }
--
-- if (cpu_dai->driver->ops->prepare) {
-- ret = cpu_dai->driver->ops->prepare(substream, cpu_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: cpu DAI prepare error\n");
-- goto out;
-- }
-- }
--
-- /* cancel any delayed stream shutdown that is pending */
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
-- codec_dai->pop_wait) {
-- codec_dai->pop_wait = 0;
-- cancel_delayed_work(&rtd->delayed_work);
-- }
--
-- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-- snd_soc_dapm_stream_event(rtd,
-- codec_dai->driver->playback.stream_name,
-- SND_SOC_DAPM_STREAM_START);
-- else
-- snd_soc_dapm_stream_event(rtd,
-- codec_dai->driver->capture.stream_name,
-- SND_SOC_DAPM_STREAM_START);
--
-- snd_soc_dai_digital_mute(codec_dai, 0);
--
--out:
-- mutex_unlock(&pcm_mutex);
-- return ret;
--}
--
--/*
-- * Called by ALSA when the hardware params are set by application. This
-- * function can also be called multiple times and can allocate buffers
-- * (using snd_pcm_lib_* ). It's non-atomic.
-- */
--static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
-- struct snd_pcm_hw_params *params)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- int ret = 0;
--
-- mutex_lock(&pcm_mutex);
--
-- if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) {
-- ret = rtd->dai_link->ops->hw_params(substream, params);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: machine hw_params failed\n");
-- goto out;
-- }
-- }
--
-- if (codec_dai->driver->ops->hw_params) {
-- ret = codec_dai->driver->ops->hw_params(substream, params, codec_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: can't set codec %s hw params\n",
-- codec_dai->name);
-- goto codec_err;
-- }
-- }
--
-- if (cpu_dai->driver->ops->hw_params) {
-- ret = cpu_dai->driver->ops->hw_params(substream, params, cpu_dai);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: interface %s hw params failed\n",
-- cpu_dai->name);
-- goto interface_err;
-- }
-- }
--
-- if (platform->driver->ops && platform->driver->ops->hw_params) {
-- ret = platform->driver->ops->hw_params(substream, params);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: platform %s hw params failed\n",
-- platform->name);
-- goto platform_err;
-- }
-- }
--
-- rtd->rate = params_rate(params);
--
--out:
-- mutex_unlock(&pcm_mutex);
-- return ret;
--
--platform_err:
-- if (cpu_dai->driver->ops->hw_free)
-- cpu_dai->driver->ops->hw_free(substream, cpu_dai);
--
--interface_err:
-- if (codec_dai->driver->ops->hw_free)
-- codec_dai->driver->ops->hw_free(substream, codec_dai);
--
--codec_err:
-- if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free)
-- rtd->dai_link->ops->hw_free(substream);
--
-- mutex_unlock(&pcm_mutex);
-- return ret;
--}
--
--/*
-- * Frees resources allocated by hw_params, can be called multiple times
-- */
--static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- struct snd_soc_codec *codec = rtd->codec;
--
-- mutex_lock(&pcm_mutex);
--
-- /* apply codec digital mute */
-- if (!codec->active)
-- snd_soc_dai_digital_mute(codec_dai, 1);
--
-- /* free any machine hw params */
-- if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free)
-- rtd->dai_link->ops->hw_free(substream);
--
-- /* free any DMA resources */
-- if (platform->driver->ops && platform->driver->ops->hw_free)
-- platform->driver->ops->hw_free(substream);
--
-- /* now free hw params for the DAIs */
-- if (codec_dai->driver->ops->hw_free)
-- codec_dai->driver->ops->hw_free(substream, codec_dai);
--
-- if (cpu_dai->driver->ops->hw_free)
-- cpu_dai->driver->ops->hw_free(substream, cpu_dai);
--
-- mutex_unlock(&pcm_mutex);
-- return 0;
--}
--
--static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- int ret;
--
-- if (codec_dai->driver->ops->trigger) {
-- ret = codec_dai->driver->ops->trigger(substream, cmd, codec_dai);
-- if (ret < 0)
-- return ret;
-- }
--
-- if (platform->driver->ops && platform->driver->ops->trigger) {
-- ret = platform->driver->ops->trigger(substream, cmd);
-- if (ret < 0)
-- return ret;
-- }
--
-- if (cpu_dai->driver->ops->trigger) {
-- ret = cpu_dai->driver->ops->trigger(substream, cmd, cpu_dai);
-- if (ret < 0)
-- return ret;
-- }
-- return 0;
--}
--
--/*
-- * soc level wrapper for pointer callback
-- * If cpu_dai, codec_dai, platform driver has the delay callback, than
-- * the runtime->delay will be updated accordingly.
-- */
--static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
--{
-- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- struct snd_pcm_runtime *runtime = substream->runtime;
-- snd_pcm_uframes_t offset = 0;
-- snd_pcm_sframes_t delay = 0;
--
-- if (platform->driver->ops && platform->driver->ops->pointer)
-- offset = platform->driver->ops->pointer(substream);
--
-- if (cpu_dai->driver->ops->delay)
-- delay += cpu_dai->driver->ops->delay(substream, cpu_dai);
--
-- if (codec_dai->driver->ops->delay)
-- delay += codec_dai->driver->ops->delay(substream, codec_dai);
--
-- if (platform->driver->delay)
-- delay += platform->driver->delay(substream, codec_dai);
--
-- runtime->delay = delay;
--
-- return offset;
--}
--
--/* ASoC PCM operations */
--static struct snd_pcm_ops soc_pcm_ops = {
-- .open = soc_pcm_open,
-- .close = soc_codec_close,
-- .hw_params = soc_pcm_hw_params,
-- .hw_free = soc_pcm_hw_free,
-- .prepare = soc_pcm_prepare,
-- .trigger = soc_pcm_trigger,
-- .pointer = soc_pcm_pointer,
--};
--
- #ifdef CONFIG_PM_SLEEP
- /* powers down audio subsystem for suspend */
- int snd_soc_suspend(struct device *dev)
-@@ -1694,9 +1147,6 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
- if (order != SND_SOC_COMP_ORDER_LAST)
- return 0;
-
-- /* DAPM dai link stream work */
-- INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work);
--
- ret = soc_post_component_init(card, codec, num, 0);
- if (ret)
- return ret;
-@@ -2128,66 +1578,6 @@ static struct platform_driver soc_driver = {
- .remove = soc_remove,
- };
-
--/* create a new pcm */
--static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
--{
-- struct snd_soc_codec *codec = rtd->codec;
-- struct snd_soc_platform *platform = rtd->platform;
-- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-- struct snd_pcm *pcm;
-- char new_name[64];
-- int ret = 0, playback = 0, capture = 0;
--
-- /* check client and interface hw capabilities */
-- snprintf(new_name, sizeof(new_name), "%s %s-%d",
-- rtd->dai_link->stream_name, codec_dai->name, num);
--
-- if (codec_dai->driver->playback.channels_min)
-- playback = 1;
-- if (codec_dai->driver->capture.channels_min)
-- capture = 1;
--
-- dev_dbg(rtd->card->dev, "registered pcm #%d %s\n",num,new_name);
-- ret = snd_pcm_new(rtd->card->snd_card, new_name,
-- num, playback, capture, &pcm);
-- if (ret < 0) {
-- printk(KERN_ERR "asoc: can't create pcm for codec %s\n", codec->name);
-- return ret;
-- }
--
-- rtd->pcm = pcm;
-- pcm->private_data = rtd;
-- if (platform->driver->ops) {
-- soc_pcm_ops.mmap = platform->driver->ops->mmap;
-- soc_pcm_ops.pointer = platform->driver->ops->pointer;
-- soc_pcm_ops.ioctl = platform->driver->ops->ioctl;
-- soc_pcm_ops.copy = platform->driver->ops->copy;
-- soc_pcm_ops.silence = platform->driver->ops->silence;
-- soc_pcm_ops.ack = platform->driver->ops->ack;
-- soc_pcm_ops.page = platform->driver->ops->page;
-- }
--
-- if (playback)
-- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &soc_pcm_ops);
--
-- if (capture)
-- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &soc_pcm_ops);
--
-- if (platform->driver->pcm_new) {
-- ret = platform->driver->pcm_new(rtd);
-- if (ret < 0) {
-- pr_err("asoc: platform pcm constructor failed\n");
-- return ret;
-- }
-- }
--
-- pcm->private_free = platform->driver->pcm_free;
-- printk(KERN_INFO "asoc: %s <-> %s mapping ok\n", codec_dai->name,
-- cpu_dai->name);
-- return ret;
--}
--
- /**
- * snd_soc_codec_volatile_register: Report if a register is volatile.
- *
-diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
-new file mode 100644
-index 0000000..9bebee8
---- /dev/null
-+++ b/sound/soc/soc-pcm.c
-@@ -0,0 +1,639 @@
-+/*
-+ * soc-pcm.c -- ALSA SoC PCM
-+ *
-+ * Copyright 2005 Wolfson Microelectronics PLC.
-+ * Copyright 2005 Openedhand Ltd.
-+ * Copyright (C) 2010 Slimlogic Ltd.
-+ * Copyright (C) 2010 Texas Instruments Inc.
-+ *
-+ * Authors: Liam Girdwood <lrg@ti.com>
-+ * Mark Brown <broonie@opensource.wolfsonmicro.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.
-+ *
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/delay.h>
-+#include <linux/slab.h>
-+#include <linux/workqueue.h>
-+#include <sound/core.h>
-+#include <sound/pcm.h>
-+#include <sound/pcm_params.h>
-+#include <sound/soc.h>
-+#include <sound/initval.h>
-+
-+static DEFINE_MUTEX(pcm_mutex);
-+
-+static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ int ret;
-+
-+ if (!codec_dai->driver->symmetric_rates &&
-+ !cpu_dai->driver->symmetric_rates &&
-+ !rtd->dai_link->symmetric_rates)
-+ return 0;
-+
-+ /* This can happen if multiple streams are starting simultaneously -
-+ * the second can need to get its constraints before the first has
-+ * picked a rate. Complain and allow the application to carry on.
-+ */
-+ if (!rtd->rate) {
-+ dev_warn(&rtd->dev,
-+ "Not enforcing symmetric_rates due to race\n");
-+ return 0;
-+ }
-+
-+ dev_dbg(&rtd->dev, "Symmetry forces %dHz rate\n", rtd->rate);
-+
-+ ret = snd_pcm_hw_constraint_minmax(substream->runtime,
-+ SNDRV_PCM_HW_PARAM_RATE,
-+ rtd->rate, rtd->rate);
-+ if (ret < 0) {
-+ dev_err(&rtd->dev,
-+ "Unable to apply rate symmetry constraint: %d\n", ret);
-+ return ret;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * Called by ALSA when a PCM substream is opened, the runtime->hw record is
-+ * then initialized and any private data can be allocated. This also calls
-+ * startup for the cpu DAI, platform, machine and codec DAI.
-+ */
-+static int soc_pcm_open(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_pcm_runtime *runtime = substream->runtime;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ struct snd_soc_dai_driver *cpu_dai_drv = cpu_dai->driver;
-+ struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver;
-+ int ret = 0;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ /* startup the audio subsystem */
-+ if (cpu_dai->driver->ops->startup) {
-+ ret = cpu_dai->driver->ops->startup(substream, cpu_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: can't open interface %s\n",
-+ cpu_dai->name);
-+ goto out;
-+ }
-+ }
-+
-+ if (platform->driver->ops && platform->driver->ops->open) {
-+ ret = platform->driver->ops->open(substream);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: can't open platform %s\n", platform->name);
-+ goto platform_err;
-+ }
-+ }
-+
-+ if (codec_dai->driver->ops->startup) {
-+ ret = codec_dai->driver->ops->startup(substream, codec_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: can't open codec %s\n",
-+ codec_dai->name);
-+ goto codec_dai_err;
-+ }
-+ }
-+
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->startup) {
-+ ret = rtd->dai_link->ops->startup(substream);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: %s startup failed\n", rtd->dai_link->name);
-+ goto machine_err;
-+ }
-+ }
-+
-+ /* Check that the codec and cpu DAIs are compatible */
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-+ runtime->hw.rate_min =
-+ max(codec_dai_drv->playback.rate_min,
-+ cpu_dai_drv->playback.rate_min);
-+ runtime->hw.rate_max =
-+ min(codec_dai_drv->playback.rate_max,
-+ cpu_dai_drv->playback.rate_max);
-+ runtime->hw.channels_min =
-+ max(codec_dai_drv->playback.channels_min,
-+ cpu_dai_drv->playback.channels_min);
-+ runtime->hw.channels_max =
-+ min(codec_dai_drv->playback.channels_max,
-+ cpu_dai_drv->playback.channels_max);
-+ runtime->hw.formats =
-+ codec_dai_drv->playback.formats & cpu_dai_drv->playback.formats;
-+ runtime->hw.rates =
-+ codec_dai_drv->playback.rates & cpu_dai_drv->playback.rates;
-+ if (codec_dai_drv->playback.rates
-+ & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-+ runtime->hw.rates |= cpu_dai_drv->playback.rates;
-+ if (cpu_dai_drv->playback.rates
-+ & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-+ runtime->hw.rates |= codec_dai_drv->playback.rates;
-+ } else {
-+ runtime->hw.rate_min =
-+ max(codec_dai_drv->capture.rate_min,
-+ cpu_dai_drv->capture.rate_min);
-+ runtime->hw.rate_max =
-+ min(codec_dai_drv->capture.rate_max,
-+ cpu_dai_drv->capture.rate_max);
-+ runtime->hw.channels_min =
-+ max(codec_dai_drv->capture.channels_min,
-+ cpu_dai_drv->capture.channels_min);
-+ runtime->hw.channels_max =
-+ min(codec_dai_drv->capture.channels_max,
-+ cpu_dai_drv->capture.channels_max);
-+ runtime->hw.formats =
-+ codec_dai_drv->capture.formats & cpu_dai_drv->capture.formats;
-+ runtime->hw.rates =
-+ codec_dai_drv->capture.rates & cpu_dai_drv->capture.rates;
-+ if (codec_dai_drv->capture.rates
-+ & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-+ runtime->hw.rates |= cpu_dai_drv->capture.rates;
-+ if (cpu_dai_drv->capture.rates
-+ & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
-+ runtime->hw.rates |= codec_dai_drv->capture.rates;
-+ }
-+
-+ ret = -EINVAL;
-+ snd_pcm_limit_hw_rates(runtime);
-+ if (!runtime->hw.rates) {
-+ printk(KERN_ERR "asoc: %s <-> %s No matching rates\n",
-+ codec_dai->name, cpu_dai->name);
-+ goto config_err;
-+ }
-+ if (!runtime->hw.formats) {
-+ printk(KERN_ERR "asoc: %s <-> %s No matching formats\n",
-+ codec_dai->name, cpu_dai->name);
-+ goto config_err;
-+ }
-+ if (!runtime->hw.channels_min || !runtime->hw.channels_max ||
-+ runtime->hw.channels_min > runtime->hw.channels_max) {
-+ printk(KERN_ERR "asoc: %s <-> %s No matching channels\n",
-+ codec_dai->name, cpu_dai->name);
-+ goto config_err;
-+ }
-+
-+ /* Symmetry only applies if we've already got an active stream. */
-+ if (cpu_dai->active || codec_dai->active) {
-+ ret = soc_pcm_apply_symmetry(substream);
-+ if (ret != 0)
-+ goto config_err;
-+ }
-+
-+ pr_debug("asoc: %s <-> %s info:\n",
-+ codec_dai->name, cpu_dai->name);
-+ pr_debug("asoc: rate mask 0x%x\n", runtime->hw.rates);
-+ pr_debug("asoc: min ch %d max ch %d\n", runtime->hw.channels_min,
-+ runtime->hw.channels_max);
-+ pr_debug("asoc: min rate %d max rate %d\n", runtime->hw.rate_min,
-+ runtime->hw.rate_max);
-+
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-+ cpu_dai->playback_active++;
-+ codec_dai->playback_active++;
-+ } else {
-+ cpu_dai->capture_active++;
-+ codec_dai->capture_active++;
-+ }
-+ cpu_dai->active++;
-+ codec_dai->active++;
-+ rtd->codec->active++;
-+ mutex_unlock(&pcm_mutex);
-+ return 0;
-+
-+config_err:
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->shutdown)
-+ rtd->dai_link->ops->shutdown(substream);
-+
-+machine_err:
-+ if (codec_dai->driver->ops->shutdown)
-+ codec_dai->driver->ops->shutdown(substream, codec_dai);
-+
-+codec_dai_err:
-+ if (platform->driver->ops && platform->driver->ops->close)
-+ platform->driver->ops->close(substream);
-+
-+platform_err:
-+ if (cpu_dai->driver->ops->shutdown)
-+ cpu_dai->driver->ops->shutdown(substream, cpu_dai);
-+out:
-+ mutex_unlock(&pcm_mutex);
-+ return ret;
-+}
-+
-+/*
-+ * Power down the audio subsystem pmdown_time msecs after close is called.
-+ * This is to ensure there are no pops or clicks in between any music tracks
-+ * due to DAPM power cycling.
-+ */
-+static void close_delayed_work(struct work_struct *work)
-+{
-+ struct snd_soc_pcm_runtime *rtd =
-+ container_of(work, struct snd_soc_pcm_runtime, delayed_work.work);
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ pr_debug("pop wq checking: %s status: %s waiting: %s\n",
-+ codec_dai->driver->playback.stream_name,
-+ codec_dai->playback_active ? "active" : "inactive",
-+ codec_dai->pop_wait ? "yes" : "no");
-+
-+ /* are we waiting on this codec DAI stream */
-+ if (codec_dai->pop_wait == 1) {
-+ codec_dai->pop_wait = 0;
-+ snd_soc_dapm_stream_event(rtd,
-+ codec_dai->driver->playback.stream_name,
-+ SND_SOC_DAPM_STREAM_STOP);
-+ }
-+
-+ mutex_unlock(&pcm_mutex);
-+}
-+
-+/*
-+ * Called by ALSA when a PCM substream is closed. Private data can be
-+ * freed here. The cpu DAI, codec DAI, machine and platform are also
-+ * shutdown.
-+ */
-+static int soc_codec_close(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ struct snd_soc_codec *codec = rtd->codec;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-+ cpu_dai->playback_active--;
-+ codec_dai->playback_active--;
-+ } else {
-+ cpu_dai->capture_active--;
-+ codec_dai->capture_active--;
-+ }
-+
-+ cpu_dai->active--;
-+ codec_dai->active--;
-+ codec->active--;
-+
-+ /* Muting the DAC suppresses artifacts caused during digital
-+ * shutdown, for example from stopping clocks.
-+ */
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ snd_soc_dai_digital_mute(codec_dai, 1);
-+
-+ if (cpu_dai->driver->ops->shutdown)
-+ cpu_dai->driver->ops->shutdown(substream, cpu_dai);
-+
-+ if (codec_dai->driver->ops->shutdown)
-+ codec_dai->driver->ops->shutdown(substream, codec_dai);
-+
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->shutdown)
-+ rtd->dai_link->ops->shutdown(substream);
-+
-+ if (platform->driver->ops && platform->driver->ops->close)
-+ platform->driver->ops->close(substream);
-+ cpu_dai->runtime = NULL;
-+
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-+ /* start delayed pop wq here for playback streams */
-+ codec_dai->pop_wait = 1;
-+ schedule_delayed_work(&rtd->delayed_work,
-+ msecs_to_jiffies(rtd->pmdown_time));
-+ } else {
-+ /* capture streams can be powered down now */
-+ snd_soc_dapm_stream_event(rtd,
-+ codec_dai->driver->capture.stream_name,
-+ SND_SOC_DAPM_STREAM_STOP);
-+ }
-+
-+ mutex_unlock(&pcm_mutex);
-+ return 0;
-+}
-+
-+/*
-+ * Called by ALSA when the PCM substream is prepared, can set format, sample
-+ * rate, etc. This function is non atomic and can be called multiple times,
-+ * it can refer to the runtime info.
-+ */
-+static int soc_pcm_prepare(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ int ret = 0;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) {
-+ ret = rtd->dai_link->ops->prepare(substream);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: machine prepare error\n");
-+ goto out;
-+ }
-+ }
-+
-+ if (platform->driver->ops && platform->driver->ops->prepare) {
-+ ret = platform->driver->ops->prepare(substream);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: platform prepare error\n");
-+ goto out;
-+ }
-+ }
-+
-+ if (codec_dai->driver->ops->prepare) {
-+ ret = codec_dai->driver->ops->prepare(substream, codec_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: codec DAI prepare error\n");
-+ goto out;
-+ }
-+ }
-+
-+ if (cpu_dai->driver->ops->prepare) {
-+ ret = cpu_dai->driver->ops->prepare(substream, cpu_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: cpu DAI prepare error\n");
-+ goto out;
-+ }
-+ }
-+
-+ /* cancel any delayed stream shutdown that is pending */
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
-+ codec_dai->pop_wait) {
-+ codec_dai->pop_wait = 0;
-+ cancel_delayed_work(&rtd->delayed_work);
-+ }
-+
-+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ snd_soc_dapm_stream_event(rtd,
-+ codec_dai->driver->playback.stream_name,
-+ SND_SOC_DAPM_STREAM_START);
-+ else
-+ snd_soc_dapm_stream_event(rtd,
-+ codec_dai->driver->capture.stream_name,
-+ SND_SOC_DAPM_STREAM_START);
-+
-+ snd_soc_dai_digital_mute(codec_dai, 0);
-+
-+out:
-+ mutex_unlock(&pcm_mutex);
-+ return ret;
-+}
-+
-+/*
-+ * Called by ALSA when the hardware params are set by application. This
-+ * function can also be called multiple times and can allocate buffers
-+ * (using snd_pcm_lib_* ). It's non-atomic.
-+ */
-+static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
-+ struct snd_pcm_hw_params *params)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ int ret = 0;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) {
-+ ret = rtd->dai_link->ops->hw_params(substream, params);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: machine hw_params failed\n");
-+ goto out;
-+ }
-+ }
-+
-+ if (codec_dai->driver->ops->hw_params) {
-+ ret = codec_dai->driver->ops->hw_params(substream, params, codec_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: can't set codec %s hw params\n",
-+ codec_dai->name);
-+ goto codec_err;
-+ }
-+ }
-+
-+ if (cpu_dai->driver->ops->hw_params) {
-+ ret = cpu_dai->driver->ops->hw_params(substream, params, cpu_dai);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: interface %s hw params failed\n",
-+ cpu_dai->name);
-+ goto interface_err;
-+ }
-+ }
-+
-+ if (platform->driver->ops && platform->driver->ops->hw_params) {
-+ ret = platform->driver->ops->hw_params(substream, params);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: platform %s hw params failed\n",
-+ platform->name);
-+ goto platform_err;
-+ }
-+ }
-+
-+ rtd->rate = params_rate(params);
-+
-+out:
-+ mutex_unlock(&pcm_mutex);
-+ return ret;
-+
-+platform_err:
-+ if (cpu_dai->driver->ops->hw_free)
-+ cpu_dai->driver->ops->hw_free(substream, cpu_dai);
-+
-+interface_err:
-+ if (codec_dai->driver->ops->hw_free)
-+ codec_dai->driver->ops->hw_free(substream, codec_dai);
-+
-+codec_err:
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free)
-+ rtd->dai_link->ops->hw_free(substream);
-+
-+ mutex_unlock(&pcm_mutex);
-+ return ret;
-+}
-+
-+/*
-+ * Frees resources allocated by hw_params, can be called multiple times
-+ */
-+static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ struct snd_soc_codec *codec = rtd->codec;
-+
-+ mutex_lock(&pcm_mutex);
-+
-+ /* apply codec digital mute */
-+ if (!codec->active)
-+ snd_soc_dai_digital_mute(codec_dai, 1);
-+
-+ /* free any machine hw params */
-+ if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free)
-+ rtd->dai_link->ops->hw_free(substream);
-+
-+ /* free any DMA resources */
-+ if (platform->driver->ops && platform->driver->ops->hw_free)
-+ platform->driver->ops->hw_free(substream);
-+
-+ /* now free hw params for the DAIs */
-+ if (codec_dai->driver->ops->hw_free)
-+ codec_dai->driver->ops->hw_free(substream, codec_dai);
-+
-+ if (cpu_dai->driver->ops->hw_free)
-+ cpu_dai->driver->ops->hw_free(substream, cpu_dai);
-+
-+ mutex_unlock(&pcm_mutex);
-+ return 0;
-+}
-+
-+static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ int ret;
-+
-+ if (codec_dai->driver->ops->trigger) {
-+ ret = codec_dai->driver->ops->trigger(substream, cmd, codec_dai);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ if (platform->driver->ops && platform->driver->ops->trigger) {
-+ ret = platform->driver->ops->trigger(substream, cmd);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ if (cpu_dai->driver->ops->trigger) {
-+ ret = cpu_dai->driver->ops->trigger(substream, cmd, cpu_dai);
-+ if (ret < 0)
-+ return ret;
-+ }
-+ return 0;
-+}
-+
-+/*
-+ * soc level wrapper for pointer callback
-+ * If cpu_dai, codec_dai, platform driver has the delay callback, than
-+ * the runtime->delay will be updated accordingly.
-+ */
-+static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
-+{
-+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ struct snd_pcm_runtime *runtime = substream->runtime;
-+ snd_pcm_uframes_t offset = 0;
-+ snd_pcm_sframes_t delay = 0;
-+
-+ if (platform->driver->ops && platform->driver->ops->pointer)
-+ offset = platform->driver->ops->pointer(substream);
-+
-+ if (cpu_dai->driver->ops->delay)
-+ delay += cpu_dai->driver->ops->delay(substream, cpu_dai);
-+
-+ if (codec_dai->driver->ops->delay)
-+ delay += codec_dai->driver->ops->delay(substream, codec_dai);
-+
-+ if (platform->driver->delay)
-+ delay += platform->driver->delay(substream, codec_dai);
-+
-+ runtime->delay = delay;
-+
-+ return offset;
-+}
-+
-+/* ASoC PCM operations */
-+static struct snd_pcm_ops soc_pcm_ops = {
-+ .open = soc_pcm_open,
-+ .close = soc_codec_close,
-+ .hw_params = soc_pcm_hw_params,
-+ .hw_free = soc_pcm_hw_free,
-+ .prepare = soc_pcm_prepare,
-+ .trigger = soc_pcm_trigger,
-+ .pointer = soc_pcm_pointer,
-+};
-+
-+/* create a new pcm */
-+int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
-+{
-+ struct snd_soc_codec *codec = rtd->codec;
-+ struct snd_soc_platform *platform = rtd->platform;
-+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
-+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ struct snd_pcm *pcm;
-+ char new_name[64];
-+ int ret = 0, playback = 0, capture = 0;
-+
-+ /* check client and interface hw capabilities */
-+ snprintf(new_name, sizeof(new_name), "%s %s-%d",
-+ rtd->dai_link->stream_name, codec_dai->name, num);
-+
-+ if (codec_dai->driver->playback.channels_min)
-+ playback = 1;
-+ if (codec_dai->driver->capture.channels_min)
-+ capture = 1;
-+
-+ dev_dbg(rtd->card->dev, "registered pcm #%d %s\n",num,new_name);
-+ ret = snd_pcm_new(rtd->card->snd_card, new_name,
-+ num, playback, capture, &pcm);
-+ if (ret < 0) {
-+ printk(KERN_ERR "asoc: can't create pcm for codec %s\n", codec->name);
-+ return ret;
-+ }
-+
-+ /* DAPM dai link stream work */
-+ INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work);
-+
-+ rtd->pcm = pcm;
-+ pcm->private_data = rtd;
-+ if (platform->driver->ops) {
-+ soc_pcm_ops.mmap = platform->driver->ops->mmap;
-+ soc_pcm_ops.pointer = platform->driver->ops->pointer;
-+ soc_pcm_ops.ioctl = platform->driver->ops->ioctl;
-+ soc_pcm_ops.copy = platform->driver->ops->copy;
-+ soc_pcm_ops.silence = platform->driver->ops->silence;
-+ soc_pcm_ops.ack = platform->driver->ops->ack;
-+ soc_pcm_ops.page = platform->driver->ops->page;
-+ }
-+
-+ if (playback)
-+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &soc_pcm_ops);
-+
-+ if (capture)
-+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &soc_pcm_ops);
-+
-+ if (platform->driver->pcm_new) {
-+ ret = platform->driver->pcm_new(rtd);
-+ if (ret < 0) {
-+ pr_err("asoc: platform pcm constructor failed\n");
-+ return ret;
-+ }
-+ }
-+
-+ pcm->private_free = platform->driver->pcm_free;
-+ printk(KERN_INFO "asoc: %s <-> %s mapping ok\n", codec_dai->name,
-+ cpu_dai->name);
-+ return ret;
-+}
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0077-ASoC-core-PCM-mutex-per-rtd.patch b/patches.kzm9g/0077-ASoC-core-PCM-mutex-per-rtd.patch
deleted file mode 100644
index 2f91a0f4b76221..00000000000000
--- a/patches.kzm9g/0077-ASoC-core-PCM-mutex-per-rtd.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From 7c74178e9fd0dbf8b3e823a1fea0a0f4ab907afe Mon Sep 17 00:00:00 2001
-From: Liam Girdwood <lrg@ti.com>
-Date: Thu, 9 Jun 2011 17:04:39 +0100
-Subject: ASoC: core - PCM mutex per rtd
-
-In preparation for the new ASoC Dynamic PCM support (AKA DSP support).
-
-The new ASoC Dynamic PCM core allows DAIs to be dynamically re-routed
-at runtime between the PCM device end (or Frontend - FE) and the physical DAI
-(Backend - BE) using regular kcontrols (just like a hardware CODEC routes
-audio in the analog domain). The Dynamic PCM core therefore must be
-able to call PCM operations for both the Frontend and Backend(s) DAIs at
-the same time.
-
-Currently we have a global pcm_mutex that is used to serialise
-the ASoC PCM operations. This patch removes the global mutex
-and adds a mutex per RTD allowing the PCM operations to be reentrant and
-allow control of more than one DAI at at time. e.g. a frontend PCM hw_params()
-could configure multiple backend DAI hw_params() with similar or different
-hw parameters at the same time.
-
-Signed-off-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit b8c0dab9bf3373010e857a8d3f1b594c60a348dd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/soc.h | 8 ++++++++
- sound/soc/soc-core.c | 1 +
- sound/soc/soc-pcm.c | 28 ++++++++++++++--------------
- 3 files changed, 23 insertions(+), 14 deletions(-)
-
-diff --git a/include/sound/soc.h b/include/sound/soc.h
-index 447232c..9e6d13e 100644
---- a/include/sound/soc.h
-+++ b/include/sound/soc.h
-@@ -268,6 +268,11 @@ enum snd_soc_compress_type {
- SND_SOC_RBTREE_COMPRESSION
- };
-
-+enum snd_soc_pcm_subclass {
-+ SND_SOC_PCM_CLASS_PCM = 0,
-+ SND_SOC_PCM_CLASS_BE = 1,
-+};
-+
- int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
- unsigned int freq, int dir);
- int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
-@@ -806,6 +811,9 @@ struct snd_soc_pcm_runtime {
- struct device dev;
- struct snd_soc_card *card;
- struct snd_soc_dai_link *dai_link;
-+ struct mutex pcm_mutex;
-+ enum snd_soc_pcm_subclass pcm_subclass;
-+ struct snd_pcm_ops ops;
-
- unsigned int complete:1;
- unsigned int dev_registered:1;
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index f5ec7d8..71cf27f 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -1034,6 +1034,7 @@ static int soc_post_component_init(struct snd_soc_card *card,
- rtd->dev.parent = card->dev;
- rtd->dev.release = rtd_release;
- rtd->dev.init_name = name;
-+ mutex_init(&rtd->pcm_mutex);
- ret = device_register(&rtd->dev);
- if (ret < 0) {
- dev_err(card->dev,
-diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
-index 9bebee8..f4864b0 100644
---- a/sound/soc/soc-pcm.c
-+++ b/sound/soc/soc-pcm.c
-@@ -81,7 +81,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
- struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver;
- int ret = 0;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- /* startup the audio subsystem */
- if (cpu_dai->driver->ops->startup) {
-@@ -211,7 +211,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
- cpu_dai->active++;
- codec_dai->active++;
- rtd->codec->active++;
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return 0;
-
- config_err:
-@@ -230,7 +230,7 @@ platform_err:
- if (cpu_dai->driver->ops->shutdown)
- cpu_dai->driver->ops->shutdown(substream, cpu_dai);
- out:
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return ret;
- }
-
-@@ -245,7 +245,7 @@ static void close_delayed_work(struct work_struct *work)
- container_of(work, struct snd_soc_pcm_runtime, delayed_work.work);
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- pr_debug("pop wq checking: %s status: %s waiting: %s\n",
- codec_dai->driver->playback.stream_name,
-@@ -260,7 +260,7 @@ static void close_delayed_work(struct work_struct *work)
- SND_SOC_DAPM_STREAM_STOP);
- }
-
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- }
-
- /*
-@@ -276,7 +276,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- struct snd_soc_codec *codec = rtd->codec;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- cpu_dai->playback_active--;
-@@ -321,7 +321,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
- SND_SOC_DAPM_STREAM_STOP);
- }
-
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return 0;
- }
-
-@@ -338,7 +338,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- int ret = 0;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) {
- ret = rtd->dai_link->ops->prepare(substream);
-@@ -391,7 +391,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
- snd_soc_dai_digital_mute(codec_dai, 0);
-
- out:
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return ret;
- }
-
-@@ -409,7 +409,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- int ret = 0;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) {
- ret = rtd->dai_link->ops->hw_params(substream, params);
-@@ -449,7 +449,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
- rtd->rate = params_rate(params);
-
- out:
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return ret;
-
- platform_err:
-@@ -464,7 +464,7 @@ codec_err:
- if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free)
- rtd->dai_link->ops->hw_free(substream);
-
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return ret;
- }
-
-@@ -479,7 +479,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- struct snd_soc_codec *codec = rtd->codec;
-
-- mutex_lock(&pcm_mutex);
-+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- /* apply codec digital mute */
- if (!codec->active)
-@@ -500,7 +500,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
- if (cpu_dai->driver->ops->hw_free)
- cpu_dai->driver->ops->hw_free(substream, cpu_dai);
-
-- mutex_unlock(&pcm_mutex);
-+ mutex_unlock(&rtd->pcm_mutex);
- return 0;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0078-ASoC-Allow-DAI-formats-to-be-specified-in-the-dai_li.patch b/patches.kzm9g/0078-ASoC-Allow-DAI-formats-to-be-specified-in-the-dai_li.patch
deleted file mode 100644
index 6bf720a1e7e90b..00000000000000
--- a/patches.kzm9g/0078-ASoC-Allow-DAI-formats-to-be-specified-in-the-dai_li.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From 8e48ac5598f4d6425d2b703b87a3d51a7a546ba4 Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Tue, 27 Sep 2011 16:41:01 +0100
-Subject: ASoC: Allow DAI formats to be specified in the dai_link
-
-For almost all machines the DAI format is a constant, always set to the
-same thing. This means that not only should we normally set it on init
-rather than in hw_params() (where it has been for historical reasons) we
-should also allow users to configure this by setting a variable in the
-dai_link structure. The combination of these two will make many machine
-drivers even more data driven.
-
-Implement a new dai_fmt field in the dai_link doing just that. Since 0 is
-a valid value for many format flags and we need to be able to tell if the
-field is actually set also add one to all the values used to configure
-formats.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 75d9ac46b99280f5f381927ae75a9eaf21844d20)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/soc-dai.h | 34 +++++++++++++++++-----------------
- include/sound/soc.h | 2 ++
- sound/soc/soc-core.c | 21 +++++++++++++++++++++
- 3 files changed, 40 insertions(+), 17 deletions(-)
-
-diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
-index 5ad5f3a..5d56a06 100644
---- a/include/sound/soc-dai.h
-+++ b/include/sound/soc-dai.h
-@@ -24,13 +24,13 @@ struct snd_pcm_substream;
- * Describes the physical PCM data formating and clocking. Add new formats
- * to the end.
- */
--#define SND_SOC_DAIFMT_I2S 0 /* I2S mode */
--#define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */
--#define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */
--#define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */
--#define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */
--#define SND_SOC_DAIFMT_AC97 5 /* AC97 */
--#define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */
-+#define SND_SOC_DAIFMT_I2S 1 /* I2S mode */
-+#define SND_SOC_DAIFMT_RIGHT_J 2 /* Right Justified mode */
-+#define SND_SOC_DAIFMT_LEFT_J 3 /* Left Justified mode */
-+#define SND_SOC_DAIFMT_DSP_A 4 /* L data MSB after FRM LRC */
-+#define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */
-+#define SND_SOC_DAIFMT_AC97 6 /* AC97 */
-+#define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */
-
- /* left and right justified also known as MSB and LSB respectively */
- #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
-@@ -42,8 +42,8 @@ struct snd_pcm_substream;
- * DAI bit clocks can be be gated (disabled) when the DAI is not
- * sending or receiving PCM data in a frame. This can be used to save power.
- */
--#define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */
--#define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */
-+#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
-+#define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */
-
- /*
- * DAI hardware signal inversions.
-@@ -51,10 +51,10 @@ struct snd_pcm_substream;
- * Specifies whether the DAI can also support inverted clocks for the specified
- * format.
- */
--#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */
--#define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */
--#define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */
--#define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */
-+#define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */
-+#define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */
-+#define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */
-+#define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
-
- /*
- * DAI hardware clock masters.
-@@ -63,10 +63,10 @@ struct snd_pcm_substream;
- * i.e. if the codec is clk and FRM master then the interface is
- * clk and frame slave.
- */
--#define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */
--#define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */
--#define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */
--#define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */
-+#define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */
-+#define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */
-+#define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */
-+#define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */
-
- #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f
- #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
-diff --git a/include/sound/soc.h b/include/sound/soc.h
-index 9e6d13e..811474e 100644
---- a/include/sound/soc.h
-+++ b/include/sound/soc.h
-@@ -683,6 +683,8 @@ struct snd_soc_dai_link {
- const char *cpu_dai_name;
- const char *codec_dai_name;
-
-+ unsigned int dai_fmt; /* format to set on init */
-+
- /* Keep DAI active over suspend */
- unsigned int ignore_suspend:1;
-
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index 71cf27f..11a889c 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -1285,6 +1285,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
- struct snd_soc_codec *codec;
- struct snd_soc_codec_conf *codec_conf;
- enum snd_soc_compress_type compress_type;
-+ struct snd_soc_dai_link *dai_link;
- int ret, i, order;
-
- mutex_lock(&card->mutex);
-@@ -1397,6 +1398,26 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
- snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
- card->num_dapm_routes);
-
-+ for (i = 0; i < card->num_links; i++) {
-+ dai_link = &card->dai_link[i];
-+
-+ if (dai_link->dai_fmt) {
-+ ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai,
-+ dai_link->dai_fmt);
-+ if (ret != 0)
-+ dev_warn(card->rtd[i].codec_dai->dev,
-+ "Failed to set DAI format: %d\n",
-+ ret);
-+
-+ ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
-+ dai_link->dai_fmt);
-+ if (ret != 0)
-+ dev_warn(card->rtd[i].cpu_dai->dev,
-+ "Failed to set DAI format: %d\n",
-+ ret);
-+ }
-+ }
-+
- snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
- "%s", card->name);
- snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0079-ASoC-Hold-runtime-PM-references-to-components-of-act.patch b/patches.kzm9g/0079-ASoC-Hold-runtime-PM-references-to-components-of-act.patch
deleted file mode 100644
index 5f75399fc1f070..00000000000000
--- a/patches.kzm9g/0079-ASoC-Hold-runtime-PM-references-to-components-of-act.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From a34733d7e91c1defeb73b851cb78e76db67a5e48 Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Sat, 3 Dec 2011 20:14:31 +0000
-Subject: ASoC: Hold runtime PM references to components of active DAIs
-
-Every device that implements runtime power management for DAIs is doing
-it in pretty much the same way: in the startup callback they take a
-runtime PM reference and then in the shutdown callback they release that
-reference, keeping the device active while the DAI is active. Given the
-frequency with which this is done and the obviousness of the need to keep
-the device active in this period factor the code out into the core, taking
-references on the device for each CPU DAI, CODEC DAI and DMA device in the
-core.
-
-As runtime PM is reference counted this shouldn't interfere with any
-other reference holding by the drivers, and since (in common with the
-existing implementations) we don't check for errors on enabling it
-shouldn't matter if the device actually has runtime PM enabled or not.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-(cherry picked from commit d6652ef8229e9953543f41d8e081c23e653f0044)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/soc-pcm.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
-index f4864b0..3047db8 100644
---- a/sound/soc/soc-pcm.c
-+++ b/sound/soc/soc-pcm.c
-@@ -19,6 +19,7 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/delay.h>
-+#include <linux/pm_runtime.h>
- #include <linux/slab.h>
- #include <linux/workqueue.h>
- #include <sound/core.h>
-@@ -81,6 +82,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
- struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver;
- int ret = 0;
-
-+ pm_runtime_get_sync(cpu_dai->dev);
-+ pm_runtime_get_sync(codec_dai->dev);
-+ pm_runtime_get_sync(platform->dev);
-+
- mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
-
- /* startup the audio subsystem */
-@@ -231,6 +236,11 @@ platform_err:
- cpu_dai->driver->ops->shutdown(substream, cpu_dai);
- out:
- mutex_unlock(&rtd->pcm_mutex);
-+
-+ pm_runtime_put(platform->dev);
-+ pm_runtime_put(codec_dai->dev);
-+ pm_runtime_put(cpu_dai->dev);
-+
- return ret;
- }
-
-@@ -322,6 +332,11 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
- }
-
- mutex_unlock(&rtd->pcm_mutex);
-+
-+ pm_runtime_put(platform->dev);
-+ pm_runtime_put(codec_dai->dev);
-+ pm_runtime_put(cpu_dai->dev);
-+
- return 0;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0080-ASoC-sh-fsi-tidyup-parameter-of-fsi_stream_push.patch b/patches.kzm9g/0080-ASoC-sh-fsi-tidyup-parameter-of-fsi_stream_push.patch
deleted file mode 100644
index 6da2adc2603c4c..00000000000000
--- a/patches.kzm9g/0080-ASoC-sh-fsi-tidyup-parameter-of-fsi_stream_push.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 239b4f1f31ed777afdb5bc02f968e831232f856b Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:45:57 +0900
-Subject: ASoC: sh: fsi: tidyup parameter of fsi_stream_push
-
-It is possible to create buff_len and period_len
-from substream->runtime.
-This patch is preparation of tidyup unclear variable naming patch.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 0ffe296addcfb8414ebad3d399859f9bf8f955d2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 14 +++++---------
- 1 file changed, 5 insertions(+), 9 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 339a1df..9666a26 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -344,16 +344,15 @@ static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
-
- static void fsi_stream_push(struct fsi_priv *fsi,
- int is_play,
-- struct snd_pcm_substream *substream,
-- u32 buffer_len,
-- u32 period_len)
-+ struct snd_pcm_substream *substream)
- {
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct snd_pcm_runtime *runtime = substream->runtime;
-
- io->substream = substream;
-- io->buff_len = buffer_len;
-+ io->buff_len = frames_to_bytes(runtime, runtime->buffer_size);
- io->buff_offset = 0;
-- io->period_len = period_len;
-+ io->period_len = frames_to_bytes(runtime, runtime->period_size);
- io->period_num = 0;
- io->oerr_num = -1; /* ignore 1st err */
- io->uerr_num = -1; /* ignore 1st err */
-@@ -844,15 +843,12 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- struct snd_pcm_runtime *runtime = substream->runtime;
- int is_play = fsi_is_play(substream);
- int ret = 0;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
-- fsi_stream_push(fsi, is_play, substream,
-- frames_to_bytes(runtime, runtime->buffer_size),
-- frames_to_bytes(runtime, runtime->period_size));
-+ fsi_stream_push(fsi, is_play, substream);
- ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
- fsi_irq_enable(fsi, is_play);
- fsi_port_start(fsi);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0081-ASoC-sh-fsi-add-fsi_set_master_clk.patch b/patches.kzm9g/0081-ASoC-sh-fsi-add-fsi_set_master_clk.patch
deleted file mode 100644
index 51db7c0ddad5e8..00000000000000
--- a/patches.kzm9g/0081-ASoC-sh-fsi-add-fsi_set_master_clk.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-From 6bddd5bd7705307cc504b2929d66939103b1d401 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:18 +0900
-Subject: ASoC: sh: fsi: add fsi_set_master_clk
-
-Current FSI driver is using set_rate call back function which is for
-master mode.
-By this patch, it is used from fsi_set_master_clk.
-This patch is preparation of cleanup suspend/resume patch.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 4f56cde17e3373219b56d2e9a91dbcd0ad228af7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 164 ++++++++++++++++++++++++++++-------------------------
- 1 file changed, 87 insertions(+), 77 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 9666a26..78a1631 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -558,6 +558,82 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
- /*
- * clock function
- */
-+static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
-+ long rate, int enable)
-+{
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ set_rate_func set_rate = fsi_get_info_set_rate(master);
-+ int fsi_ver = master->core->ver;
-+ int ret;
-+
-+ ret = set_rate(dev, fsi_is_port_a(fsi), rate, enable);
-+ if (ret < 0) /* error */
-+ return ret;
-+
-+ if (!enable)
-+ return 0;
-+
-+ if (ret > 0) {
-+ u32 data = 0;
-+
-+ switch (ret & SH_FSI_ACKMD_MASK) {
-+ default:
-+ /* FALL THROUGH */
-+ case SH_FSI_ACKMD_512:
-+ data |= (0x0 << 12);
-+ break;
-+ case SH_FSI_ACKMD_256:
-+ data |= (0x1 << 12);
-+ break;
-+ case SH_FSI_ACKMD_128:
-+ data |= (0x2 << 12);
-+ break;
-+ case SH_FSI_ACKMD_64:
-+ data |= (0x3 << 12);
-+ break;
-+ case SH_FSI_ACKMD_32:
-+ if (fsi_ver < 2)
-+ dev_err(dev, "unsupported ACKMD\n");
-+ else
-+ data |= (0x4 << 12);
-+ break;
-+ }
-+
-+ switch (ret & SH_FSI_BPFMD_MASK) {
-+ default:
-+ /* FALL THROUGH */
-+ case SH_FSI_BPFMD_32:
-+ data |= (0x0 << 8);
-+ break;
-+ case SH_FSI_BPFMD_64:
-+ data |= (0x1 << 8);
-+ break;
-+ case SH_FSI_BPFMD_128:
-+ data |= (0x2 << 8);
-+ break;
-+ case SH_FSI_BPFMD_256:
-+ data |= (0x3 << 8);
-+ break;
-+ case SH_FSI_BPFMD_512:
-+ data |= (0x4 << 8);
-+ break;
-+ case SH_FSI_BPFMD_16:
-+ if (fsi_ver < 2)
-+ dev_err(dev, "unsupported ACKMD\n");
-+ else
-+ data |= (0x7 << 8);
-+ break;
-+ }
-+
-+ fsi_reg_mask_set(fsi, CKG1, (ACKMD_MASK | BPFMD_MASK) , data);
-+ udelay(10);
-+ ret = 0;
-+ }
-+
-+ return ret;
-+
-+}
-+
- #define fsi_module_init(m, d) __fsi_module_clk_ctrl(m, d, 1)
- #define fsi_module_kill(m, d) __fsi_module_clk_ctrl(m, d, 0)
- static void __fsi_module_clk_ctrl(struct fsi_master *master,
-@@ -826,13 +902,11 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
- int is_play = fsi_is_play(substream);
-- struct fsi_master *master = fsi_get_master(fsi);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-
- fsi_irq_disable(fsi, is_play);
-
- if (fsi_is_clk_master(fsi))
-- set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0);
-+ fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0);
-
- fsi->rate = 0;
-
-@@ -960,79 +1034,19 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- struct fsi_master *master = fsi_get_master(fsi);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-- int fsi_ver = master->core->ver;
- long rate = params_rate(params);
- int ret;
-
- if (!fsi_is_clk_master(fsi))
- return 0;
-
-- ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1);
-- if (ret < 0) /* error */
-+ ret = fsi_set_master_clk(dai->dev, fsi, rate, 1);
-+ if (ret < 0)
- return ret;
-
- fsi->rate = rate;
-- if (ret > 0) {
-- u32 data = 0;
--
-- switch (ret & SH_FSI_ACKMD_MASK) {
-- default:
-- /* FALL THROUGH */
-- case SH_FSI_ACKMD_512:
-- data |= (0x0 << 12);
-- break;
-- case SH_FSI_ACKMD_256:
-- data |= (0x1 << 12);
-- break;
-- case SH_FSI_ACKMD_128:
-- data |= (0x2 << 12);
-- break;
-- case SH_FSI_ACKMD_64:
-- data |= (0x3 << 12);
-- break;
-- case SH_FSI_ACKMD_32:
-- if (fsi_ver < 2)
-- dev_err(dai->dev, "unsupported ACKMD\n");
-- else
-- data |= (0x4 << 12);
-- break;
-- }
--
-- switch (ret & SH_FSI_BPFMD_MASK) {
-- default:
-- /* FALL THROUGH */
-- case SH_FSI_BPFMD_32:
-- data |= (0x0 << 8);
-- break;
-- case SH_FSI_BPFMD_64:
-- data |= (0x1 << 8);
-- break;
-- case SH_FSI_BPFMD_128:
-- data |= (0x2 << 8);
-- break;
-- case SH_FSI_BPFMD_256:
-- data |= (0x3 << 8);
-- break;
-- case SH_FSI_BPFMD_512:
-- data |= (0x4 << 8);
-- break;
-- case SH_FSI_BPFMD_16:
-- if (fsi_ver < 2)
-- dev_err(dai->dev, "unsupported ACKMD\n");
-- else
-- data |= (0x7 << 8);
-- break;
-- }
--
-- fsi_reg_mask_set(fsi, CKG1, (ACKMD_MASK | BPFMD_MASK) , data);
-- udelay(10);
-- ret = 0;
-- }
-
- return ret;
--
- }
-
- static struct snd_soc_dai_ops fsi_dai_ops = {
-@@ -1301,8 +1315,7 @@ static int fsi_remove(struct platform_device *pdev)
- }
-
- static void __fsi_suspend(struct fsi_priv *fsi,
-- struct device *dev,
-- set_rate_func set_rate)
-+ struct device *dev)
- {
- fsi->saved_do_fmt = fsi_reg_read(fsi, DO_FMT);
- fsi->saved_di_fmt = fsi_reg_read(fsi, DI_FMT);
-@@ -1311,12 +1324,11 @@ static void __fsi_suspend(struct fsi_priv *fsi,
- fsi->saved_out_sel = fsi_reg_read(fsi, OUT_SEL);
-
- if (fsi_is_clk_master(fsi))
-- set_rate(dev, fsi_is_port_a(fsi), fsi->rate, 0);
-+ fsi_set_master_clk(dev, fsi, fsi->rate, 0);
- }
-
- static void __fsi_resume(struct fsi_priv *fsi,
-- struct device *dev,
-- set_rate_func set_rate)
-+ struct device *dev)
- {
- fsi_reg_write(fsi, DO_FMT, fsi->saved_do_fmt);
- fsi_reg_write(fsi, DI_FMT, fsi->saved_di_fmt);
-@@ -1325,18 +1337,17 @@ static void __fsi_resume(struct fsi_priv *fsi,
- fsi_reg_write(fsi, OUT_SEL, fsi->saved_out_sel);
-
- if (fsi_is_clk_master(fsi))
-- set_rate(dev, fsi_is_port_a(fsi), fsi->rate, 1);
-+ fsi_set_master_clk(dev, fsi, fsi->rate, 1);
- }
-
- static int fsi_suspend(struct device *dev)
- {
- struct fsi_master *master = dev_get_drvdata(dev);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-
- pm_runtime_get_sync(dev);
-
-- __fsi_suspend(&master->fsia, dev, set_rate);
-- __fsi_suspend(&master->fsib, dev, set_rate);
-+ __fsi_suspend(&master->fsia, dev);
-+ __fsi_suspend(&master->fsib, dev);
-
- master->saved_a_mclk = fsi_core_read(master, a_mclk);
- master->saved_b_mclk = fsi_core_read(master, b_mclk);
-@@ -1355,7 +1366,6 @@ static int fsi_suspend(struct device *dev)
- static int fsi_resume(struct device *dev)
- {
- struct fsi_master *master = dev_get_drvdata(dev);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-
- pm_runtime_get_sync(dev);
-
-@@ -1368,8 +1378,8 @@ static int fsi_resume(struct device *dev)
- fsi_core_mask_set(master, iemsk, 0xffff, master->saved_iemsk);
- fsi_core_mask_set(master, imsk, 0xffff, master->saved_imsk);
-
-- __fsi_resume(&master->fsia, dev, set_rate);
-- __fsi_resume(&master->fsib, dev, set_rate);
-+ __fsi_resume(&master->fsia, dev);
-+ __fsi_resume(&master->fsib, dev);
-
- pm_runtime_put_sync(dev);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0082-ASoC-sh-fsi-irq-control-moves-to-fsi_port_start-stop.patch b/patches.kzm9g/0082-ASoC-sh-fsi-irq-control-moves-to-fsi_port_start-stop.patch
deleted file mode 100644
index 98b7a8a5a53f8e..00000000000000
--- a/patches.kzm9g/0082-ASoC-sh-fsi-irq-control-moves-to-fsi_port_start-stop.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 640c889570e0563c5a0e3bc7caf89bba5244d8b4 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:23 +0900
-Subject: ASoC: sh: fsi: irq control moves to fsi_port_start/stop
-
-Using fsi_irq_enable/disable in fsi_port_start/stop is very natural.
-This patch is preparation of cleanup suspend/resume patch.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 1ddddd36353c40fbf8faad955fcc26e05f656121)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 78a1631..c445e86 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -654,15 +654,20 @@ static void __fsi_module_clk_ctrl(struct fsi_master *master,
- pm_runtime_put_sync(dev);
- }
-
--#define fsi_port_start(f) __fsi_port_clk_ctrl(f, 1)
--#define fsi_port_stop(f) __fsi_port_clk_ctrl(f, 0)
--static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int enable)
-+#define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
-+#define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0)
-+static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- {
- struct fsi_master *master = fsi_get_master(fsi);
- u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR;
- u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
- int is_master = fsi_is_clk_master(fsi);
-
-+ if (enable)
-+ fsi_irq_enable(fsi, is_play);
-+ else
-+ fsi_irq_disable(fsi, is_play);
-+
- fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0);
- if (is_master)
- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
-@@ -901,9 +906,6 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- int is_play = fsi_is_play(substream);
--
-- fsi_irq_disable(fsi, is_play);
-
- if (fsi_is_clk_master(fsi))
- fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0);
-@@ -924,12 +926,10 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- case SNDRV_PCM_TRIGGER_START:
- fsi_stream_push(fsi, is_play, substream);
- ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
-- fsi_irq_enable(fsi, is_play);
-- fsi_port_start(fsi);
-+ fsi_port_start(fsi, is_play);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
-- fsi_port_stop(fsi);
-- fsi_irq_disable(fsi, is_play);
-+ fsi_port_stop(fsi, is_play);
- fsi_stream_pop(fsi, is_play);
- break;
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0083-ASoC-sh-fsi-tidyup-unclear-variable-naming.patch b/patches.kzm9g/0083-ASoC-sh-fsi-tidyup-unclear-variable-naming.patch
deleted file mode 100644
index 98e9e9570ab38d..00000000000000
--- a/patches.kzm9g/0083-ASoC-sh-fsi-tidyup-unclear-variable-naming.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From f958aa05f1e92cc702ef0aabb8230172eb6f6275 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:03 +0900
-Subject: ASoC: sh: fsi: tidyup unclear variable naming
-
-Some variables on this driver were a unclear naming,
-and were different unit (byte, frame, sample).
-And some functions had wrong name
-(ex. it returned "sample width" but name was "fsi_get_frame_width").
-This patch tidy-up this issue, and the minimum unit become "sample".
-Special thanks to Takashi YOSHII.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 2e651bafa959c6e2620601c2c2e9b7c26f6a9c1a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 182 +++++++++++++++++++++++++++++------------------------
- 1 file changed, 100 insertions(+), 82 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index c445e86..98c8296 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -118,10 +118,38 @@ typedef int (*set_rate_func)(struct device *dev, int is_porta, int rate, int ena
- /*
- * FSI driver use below type name for variable
- *
-- * xxx_len : data length
-- * xxx_width : data width
-- * xxx_offset : data offset
- * xxx_num : number of data
-+ * xxx_pos : position of data
-+ * xxx_capa : capacity of data
-+ */
-+
-+/*
-+ * period/frame/sample image
-+ *
-+ * ex) PCM (2ch)
-+ *
-+ * period pos period pos
-+ * [n] [n + 1]
-+ * |<-------------------- period--------------------->|
-+ * ==|============================================ ... =|==
-+ * | |
-+ * ||<----- frame ----->|<------ frame ----->| ... |
-+ * |+--------------------+--------------------+- ... |
-+ * ||[ sample ][ sample ]|[ sample ][ sample ]| ... |
-+ * |+--------------------+--------------------+- ... |
-+ * ==|============================================ ... =|==
-+ */
-+
-+/*
-+ * FSI FIFO image
-+ *
-+ * | |
-+ * | |
-+ * | [ sample ] |
-+ * | [ sample ] |
-+ * | [ sample ] |
-+ * | [ sample ] |
-+ * --> go to codecs
- */
-
- /*
-@@ -131,12 +159,11 @@ typedef int (*set_rate_func)(struct device *dev, int is_porta, int rate, int ena
- struct fsi_stream {
- struct snd_pcm_substream *substream;
-
-- int fifo_max_num;
--
-- int buff_offset;
-- int buff_len;
-- int period_len;
-- int period_num;
-+ int fifo_sample_capa; /* sample capacity of FSI FIFO */
-+ int buff_sample_capa; /* sample capacity of ALSA buffer */
-+ int buff_sample_pos; /* sample position of ALSA buffer */
-+ int period_samples; /* sample number / 1 period */
-+ int period_pos; /* current period position */
-
- int uerr_num;
- int oerr_num;
-@@ -342,6 +369,16 @@ static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
- return shift;
- }
-
-+static int fsi_frame2sample(struct fsi_priv *fsi, int frames)
-+{
-+ return frames * fsi->chan_num;
-+}
-+
-+static int fsi_sample2frame(struct fsi_priv *fsi, int samples)
-+{
-+ return samples / fsi->chan_num;
-+}
-+
- static void fsi_stream_push(struct fsi_priv *fsi,
- int is_play,
- struct snd_pcm_substream *substream)
-@@ -350,10 +387,10 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- struct snd_pcm_runtime *runtime = substream->runtime;
-
- io->substream = substream;
-- io->buff_len = frames_to_bytes(runtime, runtime->buffer_size);
-- io->buff_offset = 0;
-- io->period_len = frames_to_bytes(runtime, runtime->period_size);
-- io->period_num = 0;
-+ io->buff_sample_capa = fsi_frame2sample(fsi, runtime->buffer_size);
-+ io->buff_sample_pos = 0;
-+ io->period_samples = fsi_frame2sample(fsi, runtime->period_size);
-+ io->period_pos = 0;
- io->oerr_num = -1; /* ignore 1st err */
- io->uerr_num = -1; /* ignore 1st err */
- }
-@@ -371,47 +408,26 @@ static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- dev_err(dai->dev, "under_run = %d\n", io->uerr_num);
-
- io->substream = NULL;
-- io->buff_len = 0;
-- io->buff_offset = 0;
-- io->period_len = 0;
-- io->period_num = 0;
-+ io->buff_sample_capa = 0;
-+ io->buff_sample_pos = 0;
-+ io->period_samples = 0;
-+ io->period_pos = 0;
- io->oerr_num = 0;
- io->uerr_num = 0;
- }
-
--static int fsi_get_fifo_data_num(struct fsi_priv *fsi, int is_play)
-+static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play)
- {
- u32 status;
-- int data_num;
-+ int frames;
-
- status = is_play ?
- fsi_reg_read(fsi, DOFF_ST) :
- fsi_reg_read(fsi, DIFF_ST);
-
-- data_num = 0x1ff & (status >> 8);
-- data_num *= fsi->chan_num;
--
-- return data_num;
--}
--
--static int fsi_len2num(int len, int width)
--{
-- return len / width;
--}
-+ frames = 0x1ff & (status >> 8);
-
--#define fsi_num2offset(a, b) fsi_num2len(a, b)
--static int fsi_num2len(int num, int width)
--{
-- return num * width;
--}
--
--static int fsi_get_frame_width(struct fsi_priv *fsi, int is_play)
--{
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-- struct snd_pcm_substream *substream = io->substream;
-- struct snd_pcm_runtime *runtime = substream->runtime;
--
-- return frames_to_bytes(runtime, 1) / fsi->chan_num;
-+ return fsi_frame2sample(fsi, frames);
- }
-
- static void fsi_count_fifo_err(struct fsi_priv *fsi)
-@@ -443,8 +459,10 @@ static u8 *fsi_dma_get_area(struct fsi_priv *fsi, int stream)
- {
- int is_play = fsi_stream_is_play(stream);
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct snd_pcm_runtime *runtime = io->substream->runtime;
-
-- return io->substream->runtime->dma_area + io->buff_offset;
-+ return runtime->dma_area +
-+ samples_to_bytes(runtime, io->buff_sample_pos);
- }
-
- static void fsi_dma_soft_push16(struct fsi_priv *fsi, int num)
-@@ -683,13 +701,14 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- struct fsi_master *master = fsi_get_master(fsi);
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
- u32 shift, i;
-+ int frame_capa;
-
- /* get on-chip RAM capacity */
- shift = fsi_master_read(master, FIFO_SZ);
- shift >>= fsi_get_port_shift(fsi, is_play);
- shift &= FIFO_SZ_MASK;
-- io->fifo_max_num = 256 << shift;
-- dev_dbg(dai->dev, "fifo = %d words\n", io->fifo_max_num);
-+ frame_capa = 256 << shift;
-+ dev_dbg(dai->dev, "fifo = %d words\n", frame_capa);
-
- /*
- * The maximum number of sample data varies depending
-@@ -711,9 +730,11 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- * 8 channels: 32 ( 32 x 8 = 256)
- */
- for (i = 1; i < fsi->chan_num; i <<= 1)
-- io->fifo_max_num >>= 1;
-+ frame_capa >>= 1;
- dev_dbg(dai->dev, "%d channel %d store\n",
-- fsi->chan_num, io->fifo_max_num);
-+ fsi->chan_num, frame_capa);
-+
-+ io->fifo_sample_capa = fsi_frame2sample(fsi, frame_capa);
-
- /*
- * set interrupt generation factor
-@@ -734,10 +755,10 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- struct snd_pcm_substream *substream = NULL;
- int is_play = fsi_stream_is_play(stream);
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-- int data_residue_num;
-- int data_num;
-- int data_num_max;
-- int ch_width;
-+ int sample_residues;
-+ int sample_width;
-+ int samples;
-+ int samples_max;
- int over_period;
- void (*fn)(struct fsi_priv *fsi, int size);
-
-@@ -753,36 +774,35 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- /* FSI FIFO has limit.
- * So, this driver can not send periods data at a time
- */
-- if (io->buff_offset >=
-- fsi_num2offset(io->period_num + 1, io->period_len)) {
-+ if (io->buff_sample_pos >=
-+ io->period_samples * (io->period_pos + 1)) {
-
- over_period = 1;
-- io->period_num = (io->period_num + 1) % runtime->periods;
-+ io->period_pos = (io->period_pos + 1) % runtime->periods;
-
-- if (0 == io->period_num)
-- io->buff_offset = 0;
-+ if (0 == io->period_pos)
-+ io->buff_sample_pos = 0;
- }
-
-- /* get 1 channel data width */
-- ch_width = fsi_get_frame_width(fsi, is_play);
-+ /* get 1 sample data width */
-+ sample_width = samples_to_bytes(runtime, 1);
-
-- /* get residue data number of alsa */
-- data_residue_num = fsi_len2num(io->buff_len - io->buff_offset,
-- ch_width);
-+ /* get number of residue samples */
-+ sample_residues = io->buff_sample_capa - io->buff_sample_pos;
-
- if (is_play) {
- /*
- * for play-back
- *
-- * data_num_max : number of FSI fifo free space
-- * data_num : number of ALSA residue data
-+ * samples_max : number of FSI fifo free samples space
-+ * samples : number of ALSA residue samples
- */
-- data_num_max = io->fifo_max_num * fsi->chan_num;
-- data_num_max -= fsi_get_fifo_data_num(fsi, is_play);
-+ samples_max = io->fifo_sample_capa;
-+ samples_max -= fsi_get_current_fifo_samples(fsi, is_play);
-
-- data_num = data_residue_num;
-+ samples = sample_residues;
-
-- switch (ch_width) {
-+ switch (sample_width) {
- case 2:
- fn = fsi_dma_soft_push16;
- break;
-@@ -796,13 +816,13 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- /*
- * for capture
- *
-- * data_num_max : number of ALSA free space
-- * data_num : number of data in FSI fifo
-+ * samples_max : number of ALSA free samples space
-+ * samples : number of samples in FSI fifo
- */
-- data_num_max = data_residue_num;
-- data_num = fsi_get_fifo_data_num(fsi, is_play);
-+ samples_max = sample_residues;
-+ samples = fsi_get_current_fifo_samples(fsi, is_play);
-
-- switch (ch_width) {
-+ switch (sample_width) {
- case 2:
- fn = fsi_dma_soft_pop16;
- break;
-@@ -814,12 +834,12 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- }
- }
-
-- data_num = min(data_num, data_num_max);
-+ samples = min(samples, samples_max);
-
-- fn(fsi, data_num);
-+ fn(fsi, samples);
-
-- /* update buff_offset */
-- io->buff_offset += fsi_num2offset(data_num, ch_width);
-+ /* update buff_sample_pos */
-+ io->buff_sample_pos += samples;
-
- if (over_period)
- snd_pcm_period_elapsed(substream);
-@@ -1107,16 +1127,14 @@ static int fsi_hw_free(struct snd_pcm_substream *substream)
-
- static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
- {
-- struct snd_pcm_runtime *runtime = substream->runtime;
- struct fsi_priv *fsi = fsi_get_priv(substream);
- struct fsi_stream *io = fsi_get_stream(fsi, fsi_is_play(substream));
-- long location;
-+ int samples_pos = io->buff_sample_pos - 1;
-
-- location = (io->buff_offset - 1);
-- if (location < 0)
-- location = 0;
-+ if (samples_pos < 0)
-+ samples_pos = 0;
-
-- return bytes_to_frames(runtime, location);
-+ return fsi_sample2frame(fsi, samples_pos);
- }
-
- static struct snd_pcm_ops fsi_pcm_ops = {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0084-ASoC-sh-fsi-remove-pm_runtime-from-fsi_dai_set_fmt.patch b/patches.kzm9g/0084-ASoC-sh-fsi-remove-pm_runtime-from-fsi_dai_set_fmt.patch
deleted file mode 100644
index af2fc0db301d94..00000000000000
--- a/patches.kzm9g/0084-ASoC-sh-fsi-remove-pm_runtime-from-fsi_dai_set_fmt.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From 387c7967931d638fd30d2a63ec171e42c71477bd Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:07 +0900
-Subject: ASoC: sh: fsi: remove pm_runtime from fsi_dai_set_fmt.
-
-pm_runtime_get/put_sync were used to access FSI register in fsi_dai_set_fmt
-which is called when ALSA probe.
-But this register value will disappear after pm_runtime_put_sync
-if platform is supporting RuntimePM.
-To solve this issue, this patch adds new variable for format,
-and remove pm_runtime_get/put_sync from fsi_dai_set_fmt.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 9478e0b60fb4a7adde72d4a86b826d396b607a61)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 52 ++++++++++++++++++++++++++++++++--------------------
- 1 file changed, 32 insertions(+), 20 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 98c8296..0a09ea2 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -176,8 +176,12 @@ struct fsi_priv {
- struct fsi_stream playback;
- struct fsi_stream capture;
-
-+ u32 do_fmt;
-+ u32 di_fmt;
-+
- int chan_num:16;
- int clk_master:1;
-+ int spdif:1;
-
- long rate;
-
-@@ -298,6 +302,11 @@ static int fsi_is_port_a(struct fsi_priv *fsi)
- return fsi->master->base == fsi->base;
- }
-
-+static int fsi_is_spdif(struct fsi_priv *fsi)
-+{
-+ return fsi->spdif;
-+}
-+
- static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream)
- {
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-@@ -893,11 +902,16 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
- u32 flags = fsi_get_info_flags(fsi);
-- u32 data;
-+ u32 data = 0;
- int is_play = fsi_is_play(substream);
-
- pm_runtime_get_sync(dai->dev);
-
-+ /* clock setting */
-+ if (fsi_is_clk_master(fsi))
-+ data = DIMD | DOMD;
-+
-+ fsi_reg_mask_set(fsi, CKG1, (DIMD | DOMD), data);
-
- /* clock inversion (CKG2) */
- data = 0;
-@@ -912,6 +926,16 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
-
- fsi_reg_write(fsi, CKG2, data);
-
-+ /* set format */
-+ fsi_reg_write(fsi, DO_FMT, fsi->do_fmt);
-+ fsi_reg_write(fsi, DI_FMT, fsi->di_fmt);
-+
-+ /* spdif ? */
-+ if (fsi_is_spdif(fsi)) {
-+ fsi_spdif_clk_ctrl(fsi, 1);
-+ fsi_reg_mask_set(fsi, OUT_SEL, DMMD, DMMD);
-+ }
-+
- /* irq clear */
- fsi_irq_disable(fsi, is_play);
- fsi_irq_clear_status(fsi);
-@@ -974,8 +998,8 @@ static int fsi_set_fmt_dai(struct fsi_priv *fsi, unsigned int fmt)
- return -EINVAL;
- }
-
-- fsi_reg_write(fsi, DO_FMT, data);
-- fsi_reg_write(fsi, DI_FMT, data);
-+ fsi->do_fmt = data;
-+ fsi->di_fmt = data;
-
- return 0;
- }
-@@ -990,11 +1014,10 @@ static int fsi_set_fmt_spdif(struct fsi_priv *fsi)
-
- data = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM;
- fsi->chan_num = 2;
-- fsi_spdif_clk_ctrl(fsi, 1);
-- fsi_reg_mask_set(fsi, OUT_SEL, DMMD, DMMD);
-+ fsi->spdif = 1;
-
-- fsi_reg_write(fsi, DO_FMT, data);
-- fsi_reg_write(fsi, DI_FMT, data);
-+ fsi->do_fmt = data;
-+ fsi->di_fmt = data;
-
- return 0;
- }
-@@ -1005,32 +1028,24 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
- struct fsi_master *master = fsi_get_master(fsi);
- set_rate_func set_rate = fsi_get_info_set_rate(master);
- u32 flags = fsi_get_info_flags(fsi);
-- u32 data = 0;
- int ret;
-
-- pm_runtime_get_sync(dai->dev);
--
- /* set master/slave audio interface */
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
-- data = DIMD | DOMD;
- fsi->clk_master = 1;
- break;
- case SND_SOC_DAIFMT_CBS_CFS:
- break;
- default:
-- ret = -EINVAL;
-- goto set_fmt_exit;
-+ return -EINVAL;
- }
-
- if (fsi_is_clk_master(fsi) && !set_rate) {
- dev_err(dai->dev, "platform doesn't have set_rate\n");
-- ret = -EINVAL;
-- goto set_fmt_exit;
-+ return -EINVAL;
- }
-
-- fsi_reg_mask_set(fsi, CKG1, (DIMD | DOMD), data);
--
- /* set format */
- switch (flags & SH_FSI_FMT_MASK) {
- case SH_FSI_FMT_DAI:
-@@ -1043,9 +1058,6 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
- ret = -EINVAL;
- }
-
--set_fmt_exit:
-- pm_runtime_put_sync(dai->dev);
--
- return ret;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0085-ASoC-sh-fsi-make-sure-fsi_stream_push-pop-access-by-.patch b/patches.kzm9g/0085-ASoC-sh-fsi-make-sure-fsi_stream_push-pop-access-by-.patch
deleted file mode 100644
index 577fe89dd9c4f3..00000000000000
--- a/patches.kzm9g/0085-ASoC-sh-fsi-make-sure-fsi_stream_push-pop-access-by-.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 9a2ab68a1322eb35bf0ac8176cf8d14052c4aefa Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:13 +0900
-Subject: ASoC: sh: fsi: make sure fsi_stream_push/pop access by spin lock
-
-fsi_stream_push/pop might be called in same time.
-This patch protect it.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 2da658927c9e28425ecb6b6a7a03094a012e8620)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 0a09ea2..e371db8 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -394,7 +394,10 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- {
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
- struct snd_pcm_runtime *runtime = substream->runtime;
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ unsigned long flags;
-
-+ spin_lock_irqsave(&master->lock, flags);
- io->substream = substream;
- io->buff_sample_capa = fsi_frame2sample(fsi, runtime->buffer_size);
- io->buff_sample_pos = 0;
-@@ -402,13 +405,17 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- io->period_pos = 0;
- io->oerr_num = -1; /* ignore 1st err */
- io->uerr_num = -1; /* ignore 1st err */
-+ spin_unlock_irqrestore(&master->lock, flags);
- }
-
- static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- {
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
- struct snd_soc_dai *dai = fsi_get_dai(io->substream);
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ unsigned long flags;
-
-+ spin_lock_irqsave(&master->lock, flags);
-
- if (io->oerr_num > 0)
- dev_err(dai->dev, "over_run = %d\n", io->oerr_num);
-@@ -423,6 +430,7 @@ static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- io->period_pos = 0;
- io->oerr_num = 0;
- io->uerr_num = 0;
-+ spin_unlock_irqrestore(&master->lock, flags);
- }
-
- static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0086-ASoC-sh-fsi-remove-fsi_module_init-kill.patch b/patches.kzm9g/0086-ASoC-sh-fsi-remove-fsi_module_init-kill.patch
deleted file mode 100644
index f6c8defb17fe75..00000000000000
--- a/patches.kzm9g/0086-ASoC-sh-fsi-remove-fsi_module_init-kill.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 775ff31c0db6d3de98d58f4f4f6c1d7614eb0ebc Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:30 +0900
-Subject: ASoC: sh: fsi: remove fsi_module_init/kill
-
-FSIA/B ports is enabled by default when power-on,
-and current FSI is supporting RuntimePM.
-In addition, current fsi_module_init/kill doesn't care
-simultaneous playback/recorde.
-This mean FSI port control is not needed.
-This patch remove fsi_module_init/kill
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 4c481253311dd5940ae7c26eaff6c6f63bd41fd8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 30 ------------------------------
- 1 file changed, 30 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index e371db8..c9cf84d 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -669,32 +669,11 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
-
- }
-
--#define fsi_module_init(m, d) __fsi_module_clk_ctrl(m, d, 1)
--#define fsi_module_kill(m, d) __fsi_module_clk_ctrl(m, d, 0)
--static void __fsi_module_clk_ctrl(struct fsi_master *master,
-- struct device *dev,
-- int enable)
--{
-- pm_runtime_get_sync(dev);
--
-- if (enable) {
-- /* enable only SR */
-- fsi_master_mask_set(master, SOFT_RST, FSISR, FSISR);
-- fsi_master_mask_set(master, SOFT_RST, PASR | PBSR, 0);
-- } else {
-- /* clear all registers */
-- fsi_master_mask_set(master, SOFT_RST, FSISR, 0);
-- }
--
-- pm_runtime_put_sync(dev);
--}
--
- #define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
- #define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0)
- static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- {
- struct fsi_master *master = fsi_get_master(fsi);
-- u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR;
- u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
- int is_master = fsi_is_clk_master(fsi);
-
-@@ -703,7 +682,6 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- else
- fsi_irq_disable(fsi, is_play);
-
-- fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0);
- if (is_master)
- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
- }
-@@ -1294,8 +1272,6 @@ static int fsi_probe(struct platform_device *pdev)
- pm_runtime_enable(&pdev->dev);
- dev_set_drvdata(&pdev->dev, master);
-
-- fsi_module_init(master, &pdev->dev);
--
- ret = request_irq(irq, &fsi_interrupt, IRQF_DISABLED,
- id_entry->name, master);
- if (ret) {
-@@ -1338,8 +1314,6 @@ static int fsi_remove(struct platform_device *pdev)
-
- master = dev_get_drvdata(&pdev->dev);
-
-- fsi_module_kill(master, &pdev->dev);
--
- free_irq(master->irq, master);
- pm_runtime_disable(&pdev->dev);
-
-@@ -1394,8 +1368,6 @@ static int fsi_suspend(struct device *dev)
- master->saved_clk_rst = fsi_master_read(master, CLK_RST);
- master->saved_soft_rst = fsi_master_read(master, SOFT_RST);
-
-- fsi_module_kill(master, dev);
--
- pm_runtime_put_sync(dev);
-
- return 0;
-@@ -1407,8 +1379,6 @@ static int fsi_resume(struct device *dev)
-
- pm_runtime_get_sync(dev);
-
-- fsi_module_init(master, dev);
--
- fsi_master_mask_set(master, SOFT_RST, 0xffff, master->saved_soft_rst);
- fsi_master_mask_set(master, CLK_RST, 0xffff, master->saved_clk_rst);
- fsi_core_mask_set(master, a_mclk, 0xffff, master->saved_a_mclk);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0087-ASoC-sh-fsi-cleanup-suspend-resume.patch b/patches.kzm9g/0087-ASoC-sh-fsi-cleanup-suspend-resume.patch
deleted file mode 100644
index 2396a52cbfcd75..00000000000000
--- a/patches.kzm9g/0087-ASoC-sh-fsi-cleanup-suspend-resume.patch
+++ /dev/null
@@ -1,202 +0,0 @@
-From fd2a98f748b7982d546c368f12e9c96d29e11559 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:35 +0900
-Subject: ASoC: sh: fsi: cleanup suspend/resume
-
-Current FSI driver was using saved_xxx variable for suspend/resume.
-OTOH, the start and stop of power/clock are controlled by
-fsi_hw_startup/fsi_hw_shutdown in current FSI driver.
-The all necessary registers value are set by fsi_hw_startup.
-
-So, if fsi_hw_shutdown is called when "suspend" is generated,
-and fsi_hw_startup is called at "resume",
-the saved_xxx are not needed.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit cda828cafe9df9a8b0687f1b8a17be2cd9cf1950)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 97 +++++++++++++++++++++++-------------------------------
- 1 file changed, 42 insertions(+), 55 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index c9cf84d..d2e28e4 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -184,13 +184,6 @@ struct fsi_priv {
- int spdif:1;
-
- long rate;
--
-- /* for suspend/resume */
-- u32 saved_do_fmt;
-- u32 saved_di_fmt;
-- u32 saved_ckg1;
-- u32 saved_ckg2;
-- u32 saved_out_sel;
- };
-
- struct fsi_core {
-@@ -211,14 +204,6 @@ struct fsi_master {
- struct fsi_core *core;
- struct sh_fsi_platform_info *info;
- spinlock_t lock;
--
-- /* for suspend/resume */
-- u32 saved_a_mclk;
-- u32 saved_b_mclk;
-- u32 saved_iemsk;
-- u32 saved_imsk;
-- u32 saved_clk_rst;
-- u32 saved_soft_rst;
- };
-
- /*
-@@ -388,6 +373,21 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples)
- return samples / fsi->chan_num;
- }
-
-+static int fsi_stream_is_working(struct fsi_priv *fsi,
-+ int is_play)
-+{
-+ struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ unsigned long flags;
-+ int ret;
-+
-+ spin_lock_irqsave(&master->lock, flags);
-+ ret = !!io->substream;
-+ spin_unlock_irqrestore(&master->lock, flags);
-+
-+ return ret;
-+}
-+
- static void fsi_stream_push(struct fsi_priv *fsi,
- int is_play,
- struct snd_pcm_substream *substream)
-@@ -666,7 +666,6 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
- }
-
- return ret;
--
- }
-
- #define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
-@@ -675,14 +674,13 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- {
- struct fsi_master *master = fsi_get_master(fsi);
- u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
-- int is_master = fsi_is_clk_master(fsi);
-
- if (enable)
- fsi_irq_enable(fsi, is_play);
- else
- fsi_irq_disable(fsi, is_play);
-
-- if (is_master)
-+ if (fsi_is_clk_master(fsi))
- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
- }
-
-@@ -1327,48 +1325,43 @@ static int fsi_remove(struct platform_device *pdev)
- }
-
- static void __fsi_suspend(struct fsi_priv *fsi,
-+ int is_play,
- struct device *dev)
- {
-- fsi->saved_do_fmt = fsi_reg_read(fsi, DO_FMT);
-- fsi->saved_di_fmt = fsi_reg_read(fsi, DI_FMT);
-- fsi->saved_ckg1 = fsi_reg_read(fsi, CKG1);
-- fsi->saved_ckg2 = fsi_reg_read(fsi, CKG2);
-- fsi->saved_out_sel = fsi_reg_read(fsi, OUT_SEL);
-+ if (!fsi_stream_is_working(fsi, is_play))
-+ return;
-
-- if (fsi_is_clk_master(fsi))
-- fsi_set_master_clk(dev, fsi, fsi->rate, 0);
-+ fsi_port_stop(fsi, is_play);
-+ fsi_hw_shutdown(fsi, is_play, dev);
- }
-
- static void __fsi_resume(struct fsi_priv *fsi,
-+ int is_play,
- struct device *dev)
- {
-- fsi_reg_write(fsi, DO_FMT, fsi->saved_do_fmt);
-- fsi_reg_write(fsi, DI_FMT, fsi->saved_di_fmt);
-- fsi_reg_write(fsi, CKG1, fsi->saved_ckg1);
-- fsi_reg_write(fsi, CKG2, fsi->saved_ckg2);
-- fsi_reg_write(fsi, OUT_SEL, fsi->saved_out_sel);
-+ if (!fsi_stream_is_working(fsi, is_play))
-+ return;
-
-- if (fsi_is_clk_master(fsi))
-+ fsi_hw_startup(fsi, is_play, dev);
-+
-+ if (fsi_is_clk_master(fsi) && fsi->rate)
- fsi_set_master_clk(dev, fsi, fsi->rate, 1);
-+
-+ fsi_port_start(fsi, is_play);
-+
- }
-
- static int fsi_suspend(struct device *dev)
- {
- struct fsi_master *master = dev_get_drvdata(dev);
-+ struct fsi_priv *fsia = &master->fsia;
-+ struct fsi_priv *fsib = &master->fsib;
-
-- pm_runtime_get_sync(dev);
--
-- __fsi_suspend(&master->fsia, dev);
-- __fsi_suspend(&master->fsib, dev);
-+ __fsi_suspend(fsia, 1, dev);
-+ __fsi_suspend(fsia, 0, dev);
-
-- master->saved_a_mclk = fsi_core_read(master, a_mclk);
-- master->saved_b_mclk = fsi_core_read(master, b_mclk);
-- master->saved_iemsk = fsi_core_read(master, iemsk);
-- master->saved_imsk = fsi_core_read(master, imsk);
-- master->saved_clk_rst = fsi_master_read(master, CLK_RST);
-- master->saved_soft_rst = fsi_master_read(master, SOFT_RST);
--
-- pm_runtime_put_sync(dev);
-+ __fsi_suspend(fsib, 1, dev);
-+ __fsi_suspend(fsib, 0, dev);
-
- return 0;
- }
-@@ -1376,20 +1369,14 @@ static int fsi_suspend(struct device *dev)
- static int fsi_resume(struct device *dev)
- {
- struct fsi_master *master = dev_get_drvdata(dev);
-+ struct fsi_priv *fsia = &master->fsia;
-+ struct fsi_priv *fsib = &master->fsib;
-
-- pm_runtime_get_sync(dev);
--
-- fsi_master_mask_set(master, SOFT_RST, 0xffff, master->saved_soft_rst);
-- fsi_master_mask_set(master, CLK_RST, 0xffff, master->saved_clk_rst);
-- fsi_core_mask_set(master, a_mclk, 0xffff, master->saved_a_mclk);
-- fsi_core_mask_set(master, b_mclk, 0xffff, master->saved_b_mclk);
-- fsi_core_mask_set(master, iemsk, 0xffff, master->saved_iemsk);
-- fsi_core_mask_set(master, imsk, 0xffff, master->saved_imsk);
--
-- __fsi_resume(&master->fsia, dev);
-- __fsi_resume(&master->fsib, dev);
-+ __fsi_resume(fsia, 1, dev);
-+ __fsi_resume(fsia, 0, dev);
-
-- pm_runtime_put_sync(dev);
-+ __fsi_resume(fsib, 1, dev);
-+ __fsi_resume(fsib, 0, dev);
-
- return 0;
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0088-ASoC-sh-fsi-add-fsi_hw_startup-shutdown.patch b/patches.kzm9g/0088-ASoC-sh-fsi-add-fsi_hw_startup-shutdown.patch
deleted file mode 100644
index ab0f66604fdf31..00000000000000
--- a/patches.kzm9g/0088-ASoC-sh-fsi-add-fsi_hw_startup-shutdown.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From fb099115bddf1865f0de965e6c137b8d8048e37f Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 May 2011 20:46:26 +0900
-Subject: ASoC: sh: fsi: add fsi_hw_startup/shutdown
-
-This patch is preparation of cleanup suspend/resume patch.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 23ca853392aebdaa56c8138746deb2002e03d827)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 43 +++++++++++++++++++++++++++++--------------
- 1 file changed, 29 insertions(+), 14 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index d2e28e4..8e112cc 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -689,7 +689,7 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- */
- static void fsi_fifo_init(struct fsi_priv *fsi,
- int is_play,
-- struct snd_soc_dai *dai)
-+ struct device *dev)
- {
- struct fsi_master *master = fsi_get_master(fsi);
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-@@ -701,7 +701,7 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- shift >>= fsi_get_port_shift(fsi, is_play);
- shift &= FIFO_SZ_MASK;
- frame_capa = 256 << shift;
-- dev_dbg(dai->dev, "fifo = %d words\n", frame_capa);
-+ dev_dbg(dev, "fifo = %d words\n", frame_capa);
-
- /*
- * The maximum number of sample data varies depending
-@@ -724,7 +724,7 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- */
- for (i = 1; i < fsi->chan_num; i <<= 1)
- frame_capa >>= 1;
-- dev_dbg(dai->dev, "%d channel %d store\n",
-+ dev_dbg(dev, "%d channel %d store\n",
- fsi->chan_num, frame_capa);
-
- io->fifo_sample_capa = fsi_frame2sample(fsi, frame_capa);
-@@ -881,15 +881,14 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
- * dai ops
- */
-
--static int fsi_dai_startup(struct snd_pcm_substream *substream,
-- struct snd_soc_dai *dai)
-+static int fsi_hw_startup(struct fsi_priv *fsi,
-+ int is_play,
-+ struct device *dev)
- {
-- struct fsi_priv *fsi = fsi_get_priv(substream);
- u32 flags = fsi_get_info_flags(fsi);
- u32 data = 0;
-- int is_play = fsi_is_play(substream);
-
-- pm_runtime_get_sync(dai->dev);
-+ pm_runtime_get_sync(dev);
-
- /* clock setting */
- if (fsi_is_clk_master(fsi))
-@@ -925,22 +924,38 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
- fsi_irq_clear_status(fsi);
-
- /* fifo init */
-- fsi_fifo_init(fsi, is_play, dai);
-+ fsi_fifo_init(fsi, is_play, dev);
-
- return 0;
- }
-
-+static void fsi_hw_shutdown(struct fsi_priv *fsi,
-+ int is_play,
-+ struct device *dev)
-+{
-+ if (fsi_is_clk_master(fsi))
-+ fsi_set_master_clk(dev, fsi, fsi->rate, 0);
-+
-+ pm_runtime_put_sync(dev);
-+}
-+
-+static int fsi_dai_startup(struct snd_pcm_substream *substream,
-+ struct snd_soc_dai *dai)
-+{
-+ struct fsi_priv *fsi = fsi_get_priv(substream);
-+ int is_play = fsi_is_play(substream);
-+
-+ return fsi_hw_startup(fsi, is_play, dai->dev);
-+}
-+
- static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-+ int is_play = fsi_is_play(substream);
-
-- if (fsi_is_clk_master(fsi))
-- fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0);
--
-+ fsi_hw_shutdown(fsi, is_play, dai->dev);
- fsi->rate = 0;
--
-- pm_runtime_put_sync(dai->dev);
- }
-
- static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0089-sound-irq-Remove-IRQF_DISABLED.patch b/patches.kzm9g/0089-sound-irq-Remove-IRQF_DISABLED.patch
deleted file mode 100644
index b08c273864047a..00000000000000
--- a/patches.kzm9g/0089-sound-irq-Remove-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 00e240dfffc278c30a57390dd1e129bcb4613e86 Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Thu, 22 Sep 2011 16:59:20 +0800
-Subject: sound: irq: Remove IRQF_DISABLED
-
-Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
-We run all interrupt handlers with interrupts disabled
-and we even check and yell when an interrupt handler
-returns with interrupts enabled (see commit [b738a50a:
-genirq: Warn when handler enables interrupts]).
-
-So now this flag is a NOOP and can be removed.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-(cherry picked from commit 88e24c3a4b30a6bd361f2b5ce602667a8161b2e8)
-
-Cherry-picked changes for:
- sound/soc/sh/fsi.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 8e112cc..1493ebf 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1285,7 +1285,7 @@ static int fsi_probe(struct platform_device *pdev)
- pm_runtime_enable(&pdev->dev);
- dev_set_drvdata(&pdev->dev, master);
-
-- ret = request_irq(irq, &fsi_interrupt, IRQF_DISABLED,
-+ ret = request_irq(irq, &fsi_interrupt, 0,
- id_entry->name, master);
- if (ret) {
- dev_err(&pdev->dev, "irq request err\n");
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0090-ASoC-sh-use-correct-__iomem-annotations.patch b/patches.kzm9g/0090-ASoC-sh-use-correct-__iomem-annotations.patch
deleted file mode 100644
index 306c72004b8ccd..00000000000000
--- a/patches.kzm9g/0090-ASoC-sh-use-correct-__iomem-annotations.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 03f1c40d29550119518b545adacb5cba60f2f67a Mon Sep 17 00:00:00 2001
-From: Arnd Bergmann <arnd@arndb.de>
-Date: Sun, 2 Oct 2011 22:28:02 +0200
-Subject: ASoC: sh: use correct __iomem annotations
-
-This removes a few unnecessary type casts and avoids
-sparse warnings.
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 00d579b1ea1200820b504a3e3cbbdb079a5ee808)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 1493ebf..a32fd16 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -210,7 +210,7 @@ struct fsi_master {
- * basic read write function
- */
-
--static void __fsi_reg_write(u32 reg, u32 data)
-+static void __fsi_reg_write(u32 __iomem *reg, u32 data)
- {
- /* valid data area is 24bit */
- data &= 0x00ffffff;
-@@ -218,12 +218,12 @@ static void __fsi_reg_write(u32 reg, u32 data)
- __raw_writel(data, reg);
- }
-
--static u32 __fsi_reg_read(u32 reg)
-+static u32 __fsi_reg_read(u32 __iomem *reg)
- {
- return __raw_readl(reg);
- }
-
--static void __fsi_reg_mask_set(u32 reg, u32 mask, u32 data)
-+static void __fsi_reg_mask_set(u32 __iomem *reg, u32 mask, u32 data)
- {
- u32 val = __fsi_reg_read(reg);
-
-@@ -250,7 +250,7 @@ static u32 _fsi_master_read(struct fsi_master *master, u32 reg)
- unsigned long flags;
-
- spin_lock_irqsave(&master->lock, flags);
-- ret = __fsi_reg_read((u32)(master->base + reg));
-+ ret = __fsi_reg_read(master->base + reg);
- spin_unlock_irqrestore(&master->lock, flags);
-
- return ret;
-@@ -264,7 +264,7 @@ static void _fsi_master_mask_set(struct fsi_master *master,
- unsigned long flags;
-
- spin_lock_irqsave(&master->lock, flags);
-- __fsi_reg_mask_set((u32)(master->base + reg), mask, data);
-+ __fsi_reg_mask_set(master->base + reg, mask, data);
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0091-sound-Add-module.h-to-the-previously-silent-sound-us.patch b/patches.kzm9g/0091-sound-Add-module.h-to-the-previously-silent-sound-us.patch
deleted file mode 100644
index 7ec039308d0198..00000000000000
--- a/patches.kzm9g/0091-sound-Add-module.h-to-the-previously-silent-sound-us.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From d8dddb115d296d8980cebee2527d6b4b875265b5 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Fri, 15 Jul 2011 12:38:28 -0400
-Subject: sound: Add module.h to the previously silent sound users
-
-Lots of sound drivers were getting module.h via the implicit presence
-of it in <linux/device.h> but we are going to clean that up. So
-fix up those users now.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit da155d5b40587815a4397e1a69382fe2366d940b)
-
-Cherry-picked changes to:
- sound/soc/sh/fsi-ak4642.c
- sound/soc/sh/fsi-da7210.c
- sound/soc/sh/fsi.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi-ak4642.c | 1 +
- sound/soc/sh/fsi-da7210.c | 1 +
- sound/soc/sh/fsi.c | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
-index 770a71a..dff64b9 100644
---- a/sound/soc/sh/fsi-ak4642.c
-+++ b/sound/soc/sh/fsi-ak4642.c
-@@ -10,6 +10,7 @@
- */
-
- #include <linux/platform_device.h>
-+#include <linux/module.h>
- #include <sound/sh_fsi.h>
-
- struct fsi_ak4642_data {
-diff --git a/sound/soc/sh/fsi-da7210.c b/sound/soc/sh/fsi-da7210.c
-index 59553fd..f5586b5b 100644
---- a/sound/soc/sh/fsi-da7210.c
-+++ b/sound/soc/sh/fsi-da7210.c
-@@ -11,6 +11,7 @@
- */
-
- #include <linux/platform_device.h>
-+#include <linux/module.h>
- #include <sound/sh_fsi.h>
-
- static int fsi_da7210_init(struct snd_soc_pcm_runtime *rtd)
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index a32fd16..3d7016e 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -16,6 +16,7 @@
- #include <linux/pm_runtime.h>
- #include <linux/io.h>
- #include <linux/slab.h>
-+#include <linux/module.h>
- #include <sound/soc.h>
- #include <sound/sh_fsi.h>
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0092-ASoC-fsi-fixup-compile-warning.patch b/patches.kzm9g/0092-ASoC-fsi-fixup-compile-warning.patch
deleted file mode 100644
index 2b2f7751945fa3..00000000000000
--- a/patches.kzm9g/0092-ASoC-fsi-fixup-compile-warning.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0d869ebdf0e3bbde84cf3a2ef58d98470f49cc07 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 31 Oct 2011 22:11:53 -0700
-Subject: ASoC: fsi: fixup compile warning
-
-This patch fixup below warning
-
-${linux}/sound/soc/sh/fsi.c:442:3:\
- warning: passing argument 1 of '__fsi_reg_read' makes pointer\
- from integer without a cast
-${linux}/sound/soc/sh/fsi.c:517:3: \
- warning: passing argument 1 of '__fsi_reg_write' makes pointer\
- from integer without a cast
-${linux}/sound/soc/sh/fsi.c:663:3: \
- warning: passing argument 1 of '__fsi_reg_mask_set' makes pointer\
- from integer without a cast
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 8918b843aff3236de6301b1137434d3f0bc0a0f5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 3d7016e..e620cb1 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -235,13 +235,13 @@ static void __fsi_reg_mask_set(u32 __iomem *reg, u32 mask, u32 data)
- }
-
- #define fsi_reg_write(p, r, d)\
-- __fsi_reg_write((u32)(p->base + REG_##r), d)
-+ __fsi_reg_write((p->base + REG_##r), d)
-
- #define fsi_reg_read(p, r)\
-- __fsi_reg_read((u32)(p->base + REG_##r))
-+ __fsi_reg_read((p->base + REG_##r))
-
- #define fsi_reg_mask_set(p, r, m, d)\
-- __fsi_reg_mask_set((u32)(p->base + REG_##r), m, d)
-+ __fsi_reg_mask_set((p->base + REG_##r), m, d)
-
- #define fsi_master_read(p, r) _fsi_master_read(p, MST_##r)
- #define fsi_core_read(p, r) _fsi_master_read(p, p->core->r)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0093-ASoC-fsi-add-valid-data-position-control-support.patch b/patches.kzm9g/0093-ASoC-fsi-add-valid-data-position-control-support.patch
deleted file mode 100644
index c1da63cccf9693..00000000000000
--- a/patches.kzm9g/0093-ASoC-fsi-add-valid-data-position-control-support.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From e763c47fab9fe188a39d5428a76ec75223742b2e Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 6 Nov 2011 22:05:25 -0800
-Subject: ASoC: fsi: add valid data position control support
-
-FSI2 can control valid data position, like
-package in front/back or stream mode (16bit x 2).
-But current fsi driver is assuming it was in-back.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 65ff03f4624d12ad6c19a01a0af7385eda09e4a6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index e620cb1..99ed610 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -32,7 +32,9 @@
- #define REG_DIDT 0x0020
- #define REG_DODT 0x0024
- #define REG_MUTE_ST 0x0028
-+#define REG_OUT_DMAC 0x002C
- #define REG_OUT_SEL 0x0030
-+#define REG_IN_DMAC 0x0038
-
- /* master register */
- #define MST_CLK_RST 0x0210
-@@ -886,6 +888,8 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
- int is_play,
- struct device *dev)
- {
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ int fsi_ver = master->core->ver;
- u32 flags = fsi_get_info_flags(fsi);
- u32 data = 0;
-
-@@ -920,6 +924,17 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
- fsi_reg_mask_set(fsi, OUT_SEL, DMMD, DMMD);
- }
-
-+ /*
-+ * FIXME
-+ *
-+ * FSI driver assumed that data package is in-back.
-+ * FSI2 chip can select it.
-+ */
-+ if (fsi_ver >= 2) {
-+ fsi_reg_write(fsi, OUT_DMAC, (1 << 4));
-+ fsi_reg_write(fsi, IN_DMAC, (1 << 4));
-+ }
-+
- /* irq clear */
- fsi_irq_disable(fsi, is_play);
- fsi_irq_clear_status(fsi);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0094-ASoC-Constify-snd_soc_dai_ops-structs.patch b/patches.kzm9g/0094-ASoC-Constify-snd_soc_dai_ops-structs.patch
deleted file mode 100644
index 7e67376df73f57..00000000000000
--- a/patches.kzm9g/0094-ASoC-Constify-snd_soc_dai_ops-structs.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From 1b06d3b9ab636321f4563d07584e88193bdbb245 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 23 Nov 2011 11:40:40 +0100
-Subject: ASoC: Constify snd_soc_dai_ops structs
-
-Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure")
-introduced the possibility to have constant DAI ops structures, yet this is
-barley used in both existing drivers and also new drivers being submitted,
-although none of them modifies its DAI ops structure. The later is not
-surprising since existing drivers are often used as templates for new drivers.
-So this patch just constifies all existing snd_soc_dai_ops structs to eliminate
-the issue altogether.
-
-The patch was generated with the following coccinelle semantic patch:
-// <smpl>
-@@
-identifier ops;
-@@
--struct snd_soc_dai_ops ops =
-+const struct snd_soc_dai_ops ops =
-{ ... };
-// </smpl>
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 85e7652d89293a6dab42bfd31f276f8bc072d4c5)
-
-Commits:
-
- sound/soc/atmel/atmel_ssc_dai.c
- sound/soc/au1x/psc-ac97.c
- sound/soc/au1x/psc-i2s.c
- sound/soc/blackfin/bf5xx-i2s.c
- sound/soc/blackfin/bf5xx-tdm.c
- sound/soc/codecs/88pm860x-codec.c
- sound/soc/codecs/ac97.c
- sound/soc/codecs/ad1836.c
- sound/soc/codecs/ad193x.c
- sound/soc/codecs/adau1373.c
- sound/soc/codecs/adau1701.c
- sound/soc/codecs/adav80x.c
- sound/soc/codecs/ak4104.c
- sound/soc/codecs/ak4535.c
- sound/soc/codecs/ak4641.c
- sound/soc/codecs/ak4642.c
- sound/soc/codecs/ak4671.c
- sound/soc/codecs/alc5623.c
- sound/soc/codecs/alc5632.c
- sound/soc/codecs/cq93vc.c
- sound/soc/codecs/cs4270.c
- sound/soc/codecs/cs4271.c
- sound/soc/codecs/cs42l51.c
- sound/soc/codecs/cs42l73.c
- sound/soc/codecs/da7210.c
- sound/soc/codecs/jz4740.c
- sound/soc/codecs/max98088.c
- sound/soc/codecs/max98095.c
- sound/soc/codecs/max9850.c
- sound/soc/codecs/rt5631.c
- sound/soc/codecs/sgtl5000.c
- sound/soc/codecs/sn95031.c
- sound/soc/codecs/ssm2602.c
- sound/soc/codecs/sta32x.c
- sound/soc/codecs/stac9766.c
- sound/soc/codecs/tlv320aic23.c
- sound/soc/codecs/tlv320aic26.c
- sound/soc/codecs/tlv320aic32x4.c
- sound/soc/codecs/tlv320aic3x.c
- sound/soc/codecs/tlv320dac33.c
- sound/soc/codecs/twl4030.c
- sound/soc/codecs/twl6040.c
- sound/soc/codecs/uda134x.c
- sound/soc/codecs/uda1380.c
- sound/soc/codecs/wl1273.c
- sound/soc/codecs/wm5100.c
- sound/soc/codecs/wm8350.c
- sound/soc/codecs/wm8400.c
- sound/soc/codecs/wm8510.c
- sound/soc/codecs/wm8523.c
- sound/soc/codecs/wm8580.c
- sound/soc/codecs/wm8711.c
- sound/soc/codecs/wm8728.c
- sound/soc/codecs/wm8731.c
- sound/soc/codecs/wm8737.c
- sound/soc/codecs/wm8741.c
- sound/soc/codecs/wm8750.c
- sound/soc/codecs/wm8753.c
- sound/soc/codecs/wm8770.c
- sound/soc/codecs/wm8776.c
- sound/soc/codecs/wm8804.c
- sound/soc/codecs/wm8900.c
- sound/soc/codecs/wm8903.c
- sound/soc/codecs/wm8904.c
- sound/soc/codecs/wm8940.c
- sound/soc/codecs/wm8955.c
- sound/soc/codecs/wm8960.c
- sound/soc/codecs/wm8961.c
- sound/soc/codecs/wm8962.c
- sound/soc/codecs/wm8971.c
- sound/soc/codecs/wm8974.c
- sound/soc/codecs/wm8978.c
- sound/soc/codecs/wm8983.c
- sound/soc/codecs/wm8985.c
- sound/soc/codecs/wm8988.c
- sound/soc/codecs/wm8990.c
- sound/soc/codecs/wm8991.c
- sound/soc/codecs/wm8993.c
- sound/soc/codecs/wm8994.c
- sound/soc/codecs/wm8995.c
- sound/soc/codecs/wm8996.c
- sound/soc/codecs/wm9081.c
- sound/soc/codecs/wm9705.c
- sound/soc/codecs/wm9712.c
- sound/soc/codecs/wm9713.c
- sound/soc/davinci/davinci-i2s.c
- sound/soc/davinci/davinci-mcasp.c
- sound/soc/davinci/davinci-vcif.c
- sound/soc/ep93xx/ep93xx-ac97.c
- sound/soc/ep93xx/ep93xx-i2s.c
- sound/soc/fsl/fsl_ssi.c
- sound/soc/fsl/mpc5200_psc_ac97.c
- sound/soc/fsl/mpc5200_psc_i2s.c
- sound/soc/imx/imx-ssi.c
- sound/soc/jz4740/jz4740-i2s.c
- sound/soc/kirkwood/kirkwood-i2s.c
- sound/soc/mxs/mxs-saif.c
- sound/soc/nuc900/nuc900-ac97.c
- sound/soc/omap/ams-delta.c
- sound/soc/omap/omap-hdmi.c
- sound/soc/omap/omap-mcbsp.c
- sound/soc/omap/omap-mcpdm.c
- sound/soc/pxa/pxa-ssp.c
- sound/soc/pxa/pxa2xx-ac97.c
- sound/soc/pxa/pxa2xx-i2s.c
- sound/soc/s6000/s6000-i2s.c
- sound/soc/samsung/ac97.c
- sound/soc/samsung/i2s.c
- sound/soc/samsung/pcm.c
- sound/soc/samsung/s3c2412-i2s.c
- sound/soc/samsung/s3c24xx-i2s.c
- sound/soc/samsung/spdif.c
- sound/soc/sh/hac.c
- sound/soc/sh/siu_dai.c
- sound/soc/sh/ssi.c
- sound/soc/soc-core.c
- sound/soc/tegra/tegra_i2s.c
- sound/soc/tegra/tegra_spdif.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 99ed610..aa30330 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1096,7 +1096,7 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
- return ret;
- }
-
--static struct snd_soc_dai_ops fsi_dai_ops = {
-+static const struct snd_soc_dai_ops fsi_dai_ops = {
- .startup = fsi_dai_startup,
- .shutdown = fsi_dai_shutdown,
- .trigger = fsi_dai_trigger,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0095-ASoC-fsi-ak4642-modify-specification-method-of-FSI-a.patch b/patches.kzm9g/0095-ASoC-fsi-ak4642-modify-specification-method-of-FSI-a.patch
deleted file mode 100644
index 4989859efecccf..00000000000000
--- a/patches.kzm9g/0095-ASoC-fsi-ak4642-modify-specification-method-of-FSI-a.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-From 8d40a58c9d7f03f7545bd01905bbe59ef789230a Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 23 Nov 2011 16:55:34 -0800
-Subject: ASoC: fsi-ak4642: modify specification method of FSI / ak464x
-
-Current fsi-ak4642 was using id_entry name in order to specify
-FSI port and ak464x codec.
-But it was no sense, no flexibility.
-Platform can specify FSI/ak464x pair by this patch.
-
-Acked-by: Paul Mundt <lethal@linux-sh.org>
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 45f3121615b2b354f7d95d30f795bc5fe0043e92)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 15 ++++-
- arch/arm/mach-shmobile/board-mackerel.c | 14 +++-
- arch/sh/boards/mach-se/7724/setup.c | 14 +++-
- include/sound/sh_fsi.h | 12 ++++
- sound/soc/sh/fsi-ak4642.c | 114 +++-----------------------------
- 5 files changed, 63 insertions(+), 106 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 3cbf5bf..59f0d2c 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -757,9 +757,22 @@ static struct platform_device fsi_device = {
- },
- };
-
-+static struct fsi_ak4642_info fsi2_ak4643_info = {
-+ .name = "AK4643",
-+ .card = "FSI2A-AK4643",
-+ .cpu_dai = "fsia-dai",
-+ .codec = "ak4642-codec.0-0013",
-+ .platform = "sh_fsi2",
-+ .id = FSI_PORT_A,
-+};
-+
- static struct platform_device fsi_ak4643_device = {
-- .name = "sh_fsi2_a_ak4643",
-+ .name = "fsi-ak4642-audio",
-+ .dev = {
-+ .platform_data = &fsi_info,
-+ },
- };
-+
- static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
- .icb[0] = {
- .meram_size = 0x100,
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 70eca5a..c2faf11 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -970,8 +970,20 @@ static struct platform_device fsi_device = {
- },
- };
-
-+static struct fsi_ak4642_info fsi2_ak4643_info = {
-+ .name = "AK4643",
-+ .card = "FSI2A-AK4643",
-+ .cpu_dai = "fsia-dai",
-+ .codec = "ak4642-codec.0-0013",
-+ .platform = "sh_fsi2",
-+ .id = FSI_PORT_A,
-+};
-+
- static struct platform_device fsi_ak4643_device = {
-- .name = "sh_fsi2_a_ak4643",
-+ .name = "fsi-ak4642-audio",
-+ .dev = {
-+ .platform_data = &fsi2_ak4643_info,
-+ },
- };
-
- /*
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index 1342feb..abc4d12 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -314,8 +314,20 @@ static struct platform_device fsi_device = {
- },
- };
-
-+static struct fsi_ak4642_info fsi_ak4642_info = {
-+ .name = "AK4642",
-+ .card = "FSIA-AK4642",
-+ .cpu_dai = "fsia-dai",
-+ .codec = "ak4642-codec.0-0012",
-+ .platform = "sh_fsi.0",
-+ .id = FSI_PORT_A,
-+};
-+
- static struct platform_device fsi_ak4642_device = {
-- .name = "sh_fsi_a_ak4642",
-+ .name = "fsi-ak4642-audio",
-+ .dev = {
-+ .platform_data = &fsi_ak4642_info,
-+ },
- };
-
- /* KEYSC in SoC (Needs SW33-2 set to ON) */
-diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
-index 9a155f9..9b1aaca 100644
---- a/include/sound/sh_fsi.h
-+++ b/include/sound/sh_fsi.h
-@@ -78,4 +78,16 @@ struct sh_fsi_platform_info {
- int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
- };
-
-+/*
-+ * for fsi-ak4642
-+ */
-+struct fsi_ak4642_info {
-+ const char *name;
-+ const char *card;
-+ const char *cpu_dai;
-+ const char *codec;
-+ const char *platform;
-+ int id;
-+};
-+
- #endif /* __SOUND_FSI_H */
-diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
-index dff64b9..11d2d7f 100644
---- a/sound/soc/sh/fsi-ak4642.c
-+++ b/sound/soc/sh/fsi-ak4642.c
-@@ -58,27 +58,23 @@ static struct platform_device *fsi_snd_device;
- static int fsi_ak4642_probe(struct platform_device *pdev)
- {
- int ret = -ENOMEM;
-- const struct platform_device_id *id_entry;
-- struct fsi_ak4642_data *pdata;
-+ struct fsi_ak4642_info *pinfo = pdev->dev.platform_data;
-
-- id_entry = pdev->id_entry;
-- if (!id_entry) {
-- dev_err(&pdev->dev, "unknown fsi ak4642\n");
-- return -ENODEV;
-+ if (!pinfo) {
-+ dev_err(&pdev->dev, "no info for fsi ak4642\n");
-+ goto out;
- }
-
-- pdata = (struct fsi_ak4642_data *)id_entry->driver_data;
--
-- fsi_snd_device = platform_device_alloc("soc-audio", pdata->id);
-+ fsi_snd_device = platform_device_alloc("soc-audio", pinfo->id);
- if (!fsi_snd_device)
- goto out;
-
-- fsi_dai_link.name = pdata->name;
-- fsi_dai_link.stream_name = pdata->name;
-- fsi_dai_link.cpu_dai_name = pdata->cpu_dai;
-- fsi_dai_link.platform_name = pdata->platform;
-- fsi_dai_link.codec_name = pdata->codec;
-- fsi_soc_card.name = pdata->card;
-+ fsi_dai_link.name = pinfo->name;
-+ fsi_dai_link.stream_name = pinfo->name;
-+ fsi_dai_link.cpu_dai_name = pinfo->cpu_dai;
-+ fsi_dai_link.platform_name = pinfo->platform;
-+ fsi_dai_link.codec_name = pinfo->codec;
-+ fsi_soc_card.name = pinfo->card;
-
- platform_set_drvdata(fsi_snd_device, &fsi_soc_card);
- ret = platform_device_add(fsi_snd_device);
-@@ -96,100 +92,12 @@ static int fsi_ak4642_remove(struct platform_device *pdev)
- return 0;
- }
-
--static struct fsi_ak4642_data fsi_a_ak4642 = {
-- .name = "AK4642",
-- .card = "FSIA-AK4642",
-- .cpu_dai = "fsia-dai",
-- .codec = "ak4642-codec.0-0012",
-- .platform = "sh_fsi.0",
-- .id = FSI_PORT_A,
--};
--
--static struct fsi_ak4642_data fsi_b_ak4642 = {
-- .name = "AK4642",
-- .card = "FSIB-AK4642",
-- .cpu_dai = "fsib-dai",
-- .codec = "ak4642-codec.0-0012",
-- .platform = "sh_fsi.0",
-- .id = FSI_PORT_B,
--};
--
--static struct fsi_ak4642_data fsi_a_ak4643 = {
-- .name = "AK4643",
-- .card = "FSIA-AK4643",
-- .cpu_dai = "fsia-dai",
-- .codec = "ak4642-codec.0-0013",
-- .platform = "sh_fsi.0",
-- .id = FSI_PORT_A,
--};
--
--static struct fsi_ak4642_data fsi_b_ak4643 = {
-- .name = "AK4643",
-- .card = "FSIB-AK4643",
-- .cpu_dai = "fsib-dai",
-- .codec = "ak4642-codec.0-0013",
-- .platform = "sh_fsi.0",
-- .id = FSI_PORT_B,
--};
--
--static struct fsi_ak4642_data fsi2_a_ak4642 = {
-- .name = "AK4642",
-- .card = "FSI2A-AK4642",
-- .cpu_dai = "fsia-dai",
-- .codec = "ak4642-codec.0-0012",
-- .platform = "sh_fsi2",
-- .id = FSI_PORT_A,
--};
--
--static struct fsi_ak4642_data fsi2_b_ak4642 = {
-- .name = "AK4642",
-- .card = "FSI2B-AK4642",
-- .cpu_dai = "fsib-dai",
-- .codec = "ak4642-codec.0-0012",
-- .platform = "sh_fsi2",
-- .id = FSI_PORT_B,
--};
--
--static struct fsi_ak4642_data fsi2_a_ak4643 = {
-- .name = "AK4643",
-- .card = "FSI2A-AK4643",
-- .cpu_dai = "fsia-dai",
-- .codec = "ak4642-codec.0-0013",
-- .platform = "sh_fsi2",
-- .id = FSI_PORT_A,
--};
--
--static struct fsi_ak4642_data fsi2_b_ak4643 = {
-- .name = "AK4643",
-- .card = "FSI2B-AK4643",
-- .cpu_dai = "fsib-dai",
-- .codec = "ak4642-codec.0-0013",
-- .platform = "sh_fsi2",
-- .id = FSI_PORT_B,
--};
--
--static struct platform_device_id fsi_id_table[] = {
-- /* FSI */
-- { "sh_fsi_a_ak4642", (kernel_ulong_t)&fsi_a_ak4642 },
-- { "sh_fsi_b_ak4642", (kernel_ulong_t)&fsi_b_ak4642 },
-- { "sh_fsi_a_ak4643", (kernel_ulong_t)&fsi_a_ak4643 },
-- { "sh_fsi_b_ak4643", (kernel_ulong_t)&fsi_b_ak4643 },
--
-- /* FSI 2 */
-- { "sh_fsi2_a_ak4642", (kernel_ulong_t)&fsi2_a_ak4642 },
-- { "sh_fsi2_b_ak4642", (kernel_ulong_t)&fsi2_b_ak4642 },
-- { "sh_fsi2_a_ak4643", (kernel_ulong_t)&fsi2_a_ak4643 },
-- { "sh_fsi2_b_ak4643", (kernel_ulong_t)&fsi2_b_ak4643 },
-- {},
--};
--
- static struct platform_driver fsi_ak4642 = {
- .driver = {
- .name = "fsi-ak4642-audio",
- },
- .probe = fsi_ak4642_probe,
- .remove = fsi_ak4642_remove,
-- .id_table = fsi_id_table,
- };
-
- static int __init fsi_ak4642_init(void)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0096-ASoC-Convert-sh-directory-to-module_platform_driver.patch b/patches.kzm9g/0096-ASoC-Convert-sh-directory-to-module_platform_driver.patch
deleted file mode 100644
index 2d3ef26867c324..00000000000000
--- a/patches.kzm9g/0096-ASoC-Convert-sh-directory-to-module_platform_driver.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 2233778f0f0d254f7583d8de6e7e2a0cdacd828a Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Fri, 25 Nov 2011 10:15:07 +0800
-Subject: ASoC: Convert sh directory to module_platform_driver
-
-Factor out some boilerplate code.
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit cb5e87387cfa8172faca36682e2df069b006efdf)
-
-Conflicts:
-
- sound/soc/sh/dma-sh7760.c
- sound/soc/sh/hac.c
- sound/soc/sh/siu_dai.c
- sound/soc/sh/ssi.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi-ak4642.c | 13 +------------
- sound/soc/sh/fsi-hdmi.c | 13 +------------
- sound/soc/sh/fsi.c | 13 +------------
- 3 files changed, 3 insertions(+), 36 deletions(-)
-
-diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
-index 11d2d7f..eb52778 100644
---- a/sound/soc/sh/fsi-ak4642.c
-+++ b/sound/soc/sh/fsi-ak4642.c
-@@ -100,18 +100,7 @@ static struct platform_driver fsi_ak4642 = {
- .remove = fsi_ak4642_remove,
- };
-
--static int __init fsi_ak4642_init(void)
--{
-- return platform_driver_register(&fsi_ak4642);
--}
--
--static void __exit fsi_ak4642_exit(void)
--{
-- platform_driver_unregister(&fsi_ak4642);
--}
--
--module_init(fsi_ak4642_init);
--module_exit(fsi_ak4642_exit);
-+module_platform_driver(fsi_ak4642);
-
- MODULE_LICENSE("GPL");
- MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
-diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c
-index d3d9fd8..31c4806 100644
---- a/sound/soc/sh/fsi-hdmi.c
-+++ b/sound/soc/sh/fsi-hdmi.c
-@@ -109,18 +109,7 @@ static struct platform_driver fsi_hdmi = {
- .id_table = fsi_id_table,
- };
-
--static int __init fsi_hdmi_init(void)
--{
-- return platform_driver_register(&fsi_hdmi);
--}
--
--static void __exit fsi_hdmi_exit(void)
--{
-- platform_driver_unregister(&fsi_hdmi);
--}
--
--module_init(fsi_hdmi_init);
--module_exit(fsi_hdmi_exit);
-+module_platform_driver(fsi_hdmi);
-
- MODULE_LICENSE("GPL");
- MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card");
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index aa30330..a27c306 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1468,18 +1468,7 @@ static struct platform_driver fsi_driver = {
- .id_table = fsi_id_table,
- };
-
--static int __init fsi_mobile_init(void)
--{
-- return platform_driver_register(&fsi_driver);
--}
--
--static void __exit fsi_mobile_exit(void)
--{
-- platform_driver_unregister(&fsi_driver);
--}
--
--module_init(fsi_mobile_init);
--module_exit(fsi_mobile_exit);
-+module_platform_driver(fsi_driver);
-
- MODULE_LICENSE("GPL");
- MODULE_DESCRIPTION("SuperH onchip FSI audio driver");
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0097-ASoC-Use-core-pm_runtime-callbacks-for-fsi.patch b/patches.kzm9g/0097-ASoC-Use-core-pm_runtime-callbacks-for-fsi.patch
deleted file mode 100644
index 73ea9f9eb091b1..00000000000000
--- a/patches.kzm9g/0097-ASoC-Use-core-pm_runtime-callbacks-for-fsi.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 8ed88c1062c61083442b13d3a30c68594fe8e8bb Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Sat, 3 Dec 2011 20:22:18 +0000
-Subject: ASoC: Use core pm_runtime callbacks for fsi
-
-Now that the core holds a pm_runtime reference to the device while the
-link is active there is no need for the driver to do so.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 27f478a65ff7b67b843250f0a2d1e8b306bf57b6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index a27c306..db6c89a 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -893,8 +893,6 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
- u32 flags = fsi_get_info_flags(fsi);
- u32 data = 0;
-
-- pm_runtime_get_sync(dev);
--
- /* clock setting */
- if (fsi_is_clk_master(fsi))
- data = DIMD | DOMD;
-@@ -951,8 +949,6 @@ static void fsi_hw_shutdown(struct fsi_priv *fsi,
- {
- if (fsi_is_clk_master(fsi))
- fsi_set_master_clk(dev, fsi, fsi->rate, 0);
--
-- pm_runtime_put_sync(dev);
- }
-
- static int fsi_dai_startup(struct snd_pcm_substream *substream,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0098-ASoC-sh-Add-.owner-to-struct-snd_soc_card.patch b/patches.kzm9g/0098-ASoC-sh-Add-.owner-to-struct-snd_soc_card.patch
deleted file mode 100644
index 202ef0fdaad866..00000000000000
--- a/patches.kzm9g/0098-ASoC-sh-Add-.owner-to-struct-snd_soc_card.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 5b12148992d0314cb7380b8112fda136fdfcea21 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Fri, 23 Dec 2011 14:53:32 +0800
-Subject: ASoC: sh: Add .owner to struct snd_soc_card
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add missing .owner of struct snd_soc_card. This prevents the module from being
-removed from underneath its users.
-
-Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 4a7042e59908231fc046aac88bd98454d886052d)
-
-Conflicts:
-
- sound/soc/sh/migor.c
- sound/soc/sh/sh7760-ac97.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi-ak4642.c | 1 +
- sound/soc/sh/fsi-da7210.c | 1 +
- sound/soc/sh/fsi-hdmi.c | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
-index eb52778..97f540a 100644
---- a/sound/soc/sh/fsi-ak4642.c
-+++ b/sound/soc/sh/fsi-ak4642.c
-@@ -49,6 +49,7 @@ static struct snd_soc_dai_link fsi_dai_link = {
- };
-
- static struct snd_soc_card fsi_soc_card = {
-+ .owner = THIS_MODULE,
- .dai_link = &fsi_dai_link,
- .num_links = 1,
- };
-diff --git a/sound/soc/sh/fsi-da7210.c b/sound/soc/sh/fsi-da7210.c
-index f5586b5b..1dd3354 100644
---- a/sound/soc/sh/fsi-da7210.c
-+++ b/sound/soc/sh/fsi-da7210.c
-@@ -44,6 +44,7 @@ static struct snd_soc_dai_link fsi_da7210_dai = {
-
- static struct snd_soc_card fsi_soc_card = {
- .name = "FSI-DA7210",
-+ .owner = THIS_MODULE,
- .dai_link = &fsi_da7210_dai,
- .num_links = 1,
- };
-diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c
-index 31c4806..edb4359 100644
---- a/sound/soc/sh/fsi-hdmi.c
-+++ b/sound/soc/sh/fsi-hdmi.c
-@@ -38,6 +38,7 @@ static struct snd_soc_dai_link fsi_dai_link = {
- };
-
- static struct snd_soc_card fsi_soc_card = {
-+ .owner = THIS_MODULE,
- .dai_link = &fsi_dai_link,
- .num_links = 1,
- };
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0099-ASoC-fsi-Remove-unneeded-empty-runtime-PM-callbacks.patch b/patches.kzm9g/0099-ASoC-fsi-Remove-unneeded-empty-runtime-PM-callbacks.patch
deleted file mode 100644
index 17080d74156a09..00000000000000
--- a/patches.kzm9g/0099-ASoC-fsi-Remove-unneeded-empty-runtime-PM-callbacks.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 9d4fdf34b1a908b8e82f8eaede7368f5a7eaed49 Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Wed, 25 Jan 2012 19:55:56 +0000
-Subject: ASoC: fsi: Remove unneeded empty runtime PM callbacks
-
-The runtime PM core no longer requires any callbacks so don't provide
-empty ones for it any more.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit bc122e34469de6ec4b7ca96d3a41724f9e4b1cf4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 14 --------------
- 1 file changed, 14 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index db6c89a..3241e5b 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1408,23 +1408,9 @@ static int fsi_resume(struct device *dev)
- return 0;
- }
-
--static int fsi_runtime_nop(struct device *dev)
--{
-- /* Runtime PM callback shared between ->runtime_suspend()
-- * and ->runtime_resume(). Simply returns success.
-- *
-- * This driver re-initializes all registers after
-- * pm_runtime_get_sync() anyway so there is no need
-- * to save and restore registers here.
-- */
-- return 0;
--}
--
- static struct dev_pm_ops fsi_pm_ops = {
- .suspend = fsi_suspend,
- .resume = fsi_resume,
-- .runtime_suspend = fsi_runtime_nop,
-- .runtime_resume = fsi_runtime_nop,
- };
-
- static struct fsi_core fsi1_core = {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0100-ASoC-fsi-reduce-runtime-calculation-by-using-pre-set.patch b/patches.kzm9g/0100-ASoC-fsi-reduce-runtime-calculation-by-using-pre-set.patch
deleted file mode 100644
index efef18df2ab60d..00000000000000
--- a/patches.kzm9g/0100-ASoC-fsi-reduce-runtime-calculation-by-using-pre-set.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From cb292ccc4561167afa92984b935da321e74f7b6c Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:50:09 -0800
-Subject: ASoC: fsi: reduce runtime calculation by using pre-setting
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit c1e6f10ea94715f00cce4c9aaf7fc91fb34ec52d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 3241e5b..0d78740 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -167,6 +167,7 @@ struct fsi_stream {
- int buff_sample_pos; /* sample position of ALSA buffer */
- int period_samples; /* sample number / 1 period */
- int period_pos; /* current period position */
-+ int sample_width; /* sample width */
-
- int uerr_num;
- int oerr_num;
-@@ -406,6 +407,7 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- io->buff_sample_pos = 0;
- io->period_samples = fsi_frame2sample(fsi, runtime->period_size);
- io->period_pos = 0;
-+ io->sample_width = samples_to_bytes(runtime, 1);
- io->oerr_num = -1; /* ignore 1st err */
- io->uerr_num = -1; /* ignore 1st err */
- spin_unlock_irqrestore(&master->lock, flags);
-@@ -431,6 +433,7 @@ static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- io->buff_sample_pos = 0;
- io->period_samples = 0;
- io->period_pos = 0;
-+ io->sample_width = 0;
- io->oerr_num = 0;
- io->uerr_num = 0;
- spin_unlock_irqrestore(&master->lock, flags);
-@@ -752,7 +755,6 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- int is_play = fsi_stream_is_play(stream);
- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
- int sample_residues;
-- int sample_width;
- int samples;
- int samples_max;
- int over_period;
-@@ -780,9 +782,6 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- io->buff_sample_pos = 0;
- }
-
-- /* get 1 sample data width */
-- sample_width = samples_to_bytes(runtime, 1);
--
- /* get number of residue samples */
- sample_residues = io->buff_sample_capa - io->buff_sample_pos;
-
-@@ -798,7 +797,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
-
- samples = sample_residues;
-
-- switch (sample_width) {
-+ switch (io->sample_width) {
- case 2:
- fn = fsi_dma_soft_push16;
- break;
-@@ -818,7 +817,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- samples_max = sample_residues;
- samples = fsi_get_current_fifo_samples(fsi, is_play);
-
-- switch (sample_width) {
-+ switch (io->sample_width) {
- case 2:
- fn = fsi_dma_soft_pop16;
- break;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0101-ASoC-fsi-tidyup-fsi_stream_xx-functions-were-gathere.patch b/patches.kzm9g/0101-ASoC-fsi-tidyup-fsi_stream_xx-functions-were-gathere.patch
deleted file mode 100644
index 9424b5e2f2a430..00000000000000
--- a/patches.kzm9g/0101-ASoC-fsi-tidyup-fsi_stream_xx-functions-were-gathere.patch
+++ /dev/null
@@ -1,204 +0,0 @@
-From 679d4975b9babdd83189da8b5f5d90f1a60a84d0 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:50:35 -0800
-Subject: ASoC: fsi: tidyup: fsi_stream_xx() functions were gathered
-
-This patch gathered fsi_stream_xxx() functions in order to make it readable.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 4e62d84d9da5190c303d6408180fbfee414d25bc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 115 ++++++++++++++++++++++++++---------------------------
- 1 file changed, 57 insertions(+), 58 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 0d78740..162416e 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -338,22 +338,6 @@ static u32 fsi_get_info_flags(struct fsi_priv *fsi)
- master->info->portb_flags;
- }
-
--static inline int fsi_stream_is_play(int stream)
--{
-- return stream == SNDRV_PCM_STREAM_PLAYBACK;
--}
--
--static inline int fsi_is_play(struct snd_pcm_substream *substream)
--{
-- return fsi_stream_is_play(substream->stream);
--}
--
--static inline struct fsi_stream *fsi_get_stream(struct fsi_priv *fsi,
-- int is_play)
--{
-- return is_play ? &fsi->playback : &fsi->capture;
--}
--
- static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
- {
- int is_porta = fsi_is_port_a(fsi);
-@@ -377,10 +361,60 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples)
- return samples / fsi->chan_num;
- }
-
-+static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play)
-+{
-+ u32 status;
-+ int frames;
-+
-+ status = is_play ?
-+ fsi_reg_read(fsi, DOFF_ST) :
-+ fsi_reg_read(fsi, DIFF_ST);
-+
-+ frames = 0x1ff & (status >> 8);
-+
-+ return fsi_frame2sample(fsi, frames);
-+}
-+
-+static void fsi_count_fifo_err(struct fsi_priv *fsi)
-+{
-+ u32 ostatus = fsi_reg_read(fsi, DOFF_ST);
-+ u32 istatus = fsi_reg_read(fsi, DIFF_ST);
-+
-+ if (ostatus & ERR_OVER)
-+ fsi->playback.oerr_num++;
-+
-+ if (ostatus & ERR_UNDER)
-+ fsi->playback.uerr_num++;
-+
-+ if (istatus & ERR_OVER)
-+ fsi->capture.oerr_num++;
-+
-+ if (istatus & ERR_UNDER)
-+ fsi->capture.uerr_num++;
-+
-+ fsi_reg_write(fsi, DOFF_ST, 0);
-+ fsi_reg_write(fsi, DIFF_ST, 0);
-+}
-+
-+/*
-+ * fsi_stream_xx() function
-+ */
-+#define fsi_is_play(substream) fsi_stream_is_play(substream->stream)
-+static inline int fsi_stream_is_play(int stream)
-+{
-+ return stream == SNDRV_PCM_STREAM_PLAYBACK;
-+}
-+
-+static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi,
-+ int is_play)
-+{
-+ return is_play ? &fsi->playback : &fsi->capture;
-+}
-+
- static int fsi_stream_is_working(struct fsi_priv *fsi,
- int is_play)
- {
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
- int ret;
-@@ -396,7 +430,7 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- int is_play,
- struct snd_pcm_substream *substream)
- {
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_pcm_runtime *runtime = substream->runtime;
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
-@@ -415,7 +449,7 @@ static void fsi_stream_push(struct fsi_priv *fsi,
-
- static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- {
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_soc_dai *dai = fsi_get_dai(io->substream);
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
-@@ -439,41 +473,6 @@ static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
--static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play)
--{
-- u32 status;
-- int frames;
--
-- status = is_play ?
-- fsi_reg_read(fsi, DOFF_ST) :
-- fsi_reg_read(fsi, DIFF_ST);
--
-- frames = 0x1ff & (status >> 8);
--
-- return fsi_frame2sample(fsi, frames);
--}
--
--static void fsi_count_fifo_err(struct fsi_priv *fsi)
--{
-- u32 ostatus = fsi_reg_read(fsi, DOFF_ST);
-- u32 istatus = fsi_reg_read(fsi, DIFF_ST);
--
-- if (ostatus & ERR_OVER)
-- fsi->playback.oerr_num++;
--
-- if (ostatus & ERR_UNDER)
-- fsi->playback.uerr_num++;
--
-- if (istatus & ERR_OVER)
-- fsi->capture.oerr_num++;
--
-- if (istatus & ERR_UNDER)
-- fsi->capture.uerr_num++;
--
-- fsi_reg_write(fsi, DOFF_ST, 0);
-- fsi_reg_write(fsi, DIFF_ST, 0);
--}
--
- /*
- * dma function
- */
-@@ -481,7 +480,7 @@ static void fsi_count_fifo_err(struct fsi_priv *fsi)
- static u8 *fsi_dma_get_area(struct fsi_priv *fsi, int stream)
- {
- int is_play = fsi_stream_is_play(stream);
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_pcm_runtime *runtime = io->substream->runtime;
-
- return runtime->dma_area +
-@@ -698,7 +697,7 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- struct device *dev)
- {
- struct fsi_master *master = fsi_get_master(fsi);
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- u32 shift, i;
- int frame_capa;
-
-@@ -753,7 +752,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- struct snd_pcm_runtime *runtime;
- struct snd_pcm_substream *substream = NULL;
- int is_play = fsi_stream_is_play(stream);
-- struct fsi_stream *io = fsi_get_stream(fsi, is_play);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- int sample_residues;
- int samples;
- int samples_max;
-@@ -1150,7 +1149,7 @@ static int fsi_hw_free(struct snd_pcm_substream *substream)
- static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- struct fsi_stream *io = fsi_get_stream(fsi, fsi_is_play(substream));
-+ struct fsi_stream *io = fsi_stream_get(fsi, fsi_is_play(substream));
- int samples_pos = io->buff_sample_pos - 1;
-
- if (samples_pos < 0)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0102-ASoC-fsi-data-push-pop-calculation-part-was-divided.patch b/patches.kzm9g/0102-ASoC-fsi-data-push-pop-calculation-part-was-divided.patch
deleted file mode 100644
index e675f10253a609..00000000000000
--- a/patches.kzm9g/0102-ASoC-fsi-data-push-pop-calculation-part-was-divided.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 3e4950e7f7503851e01dbdf5547513567442ac56 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:50:59 -0800
-Subject: ASoC: fsi: data push/pop calculation part was divided
-
-Next transfer data size of "push" and "pop" had calculated on shared function.
-But it was not readable code.
-This patch divided it into for push, and for pop.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 376cf38a90507f82d22b951b7776557aefe6109c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 104 +++++++++++++++++++++++------------------------------
- 1 file changed, 45 insertions(+), 59 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 162416e..cbb5643 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -747,17 +747,14 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- }
- }
-
--static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
-+static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-+ void (*run16)(struct fsi_priv *fsi, int size),
-+ void (*run32)(struct fsi_priv *fsi, int size),
-+ int samples)
- {
- struct snd_pcm_runtime *runtime;
-- struct snd_pcm_substream *substream = NULL;
-- int is_play = fsi_stream_is_play(stream);
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-- int sample_residues;
-- int samples;
-- int samples_max;
-+ struct snd_pcm_substream *substream;
- int over_period;
-- void (*fn)(struct fsi_priv *fsi, int size);
-
- if (!fsi ||
- !io->substream ||
-@@ -781,57 +778,17 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
- io->buff_sample_pos = 0;
- }
-
-- /* get number of residue samples */
-- sample_residues = io->buff_sample_capa - io->buff_sample_pos;
--
-- if (is_play) {
-- /*
-- * for play-back
-- *
-- * samples_max : number of FSI fifo free samples space
-- * samples : number of ALSA residue samples
-- */
-- samples_max = io->fifo_sample_capa;
-- samples_max -= fsi_get_current_fifo_samples(fsi, is_play);
--
-- samples = sample_residues;
--
-- switch (io->sample_width) {
-- case 2:
-- fn = fsi_dma_soft_push16;
-- break;
-- case 4:
-- fn = fsi_dma_soft_push32;
-- break;
-- default:
-- return -EINVAL;
-- }
-- } else {
-- /*
-- * for capture
-- *
-- * samples_max : number of ALSA free samples space
-- * samples : number of samples in FSI fifo
-- */
-- samples_max = sample_residues;
-- samples = fsi_get_current_fifo_samples(fsi, is_play);
--
-- switch (io->sample_width) {
-- case 2:
-- fn = fsi_dma_soft_pop16;
-- break;
-- case 4:
-- fn = fsi_dma_soft_pop32;
-- break;
-- default:
-- return -EINVAL;
-- }
-+ switch (io->sample_width) {
-+ case 2:
-+ run16(fsi, samples);
-+ break;
-+ case 4:
-+ run32(fsi, samples);
-+ break;
-+ default:
-+ return -EINVAL;
- }
-
-- samples = min(samples, samples_max);
--
-- fn(fsi, samples);
--
- /* update buff_sample_pos */
- io->buff_sample_pos += samples;
-
-@@ -843,12 +800,41 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
-
- static int fsi_data_pop(struct fsi_priv *fsi)
- {
-- return fsi_fifo_data_ctrl(fsi, SNDRV_PCM_STREAM_CAPTURE);
-+ int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_CAPTURE);
-+ int sample_residues; /* samples in FSI fifo */
-+ int sample_space; /* ALSA free samples space */
-+ int samples;
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-+
-+ sample_residues = fsi_get_current_fifo_samples(fsi, is_play);
-+ sample_space = io->buff_sample_capa - io->buff_sample_pos;
-+
-+ samples = min(sample_residues, sample_space);
-+
-+ return fsi_fifo_data_ctrl(fsi, io,
-+ fsi_dma_soft_pop16,
-+ fsi_dma_soft_pop32,
-+ samples);
- }
-
- static int fsi_data_push(struct fsi_priv *fsi)
- {
-- return fsi_fifo_data_ctrl(fsi, SNDRV_PCM_STREAM_PLAYBACK);
-+ int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_PLAYBACK);
-+ int sample_residues; /* ALSA residue samples */
-+ int sample_space; /* FSI fifo free samples space */
-+ int samples;
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-+
-+ sample_residues = io->buff_sample_capa - io->buff_sample_pos;
-+ sample_space = io->fifo_sample_capa -
-+ fsi_get_current_fifo_samples(fsi, is_play);
-+
-+ samples = min(sample_residues, sample_space);
-+
-+ return fsi_fifo_data_ctrl(fsi, io,
-+ fsi_dma_soft_push16,
-+ fsi_dma_soft_push32,
-+ samples);
- }
-
- static irqreturn_t fsi_interrupt(int irq, void *data)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0103-ASoC-fsi-rename-fsi_dma_soft_xxx-to-fsi_pio_xxx.patch b/patches.kzm9g/0103-ASoC-fsi-rename-fsi_dma_soft_xxx-to-fsi_pio_xxx.patch
deleted file mode 100644
index e41eb638bfa5cf..00000000000000
--- a/patches.kzm9g/0103-ASoC-fsi-rename-fsi_dma_soft_xxx-to-fsi_pio_xxx.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From ed808e04615f0b7e7ac019974418b8d32af510de Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:51:14 -0800
-Subject: ASoC: fsi: rename fsi_dma_soft_xxx() to fsi_pio_xxx()
-
-This is preparation for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit d78629e2a4457149bd21fdb0cdbbb1c3ec019d96)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 28 ++++++++++++++--------------
- 1 file changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index cbb5643..05307ac 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -474,10 +474,10 @@ static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
- }
-
- /*
-- * dma function
-+ * pio function
- */
-
--static u8 *fsi_dma_get_area(struct fsi_priv *fsi, int stream)
-+static u8 *fsi_pio_get_area(struct fsi_priv *fsi, int stream)
- {
- int is_play = fsi_stream_is_play(stream);
- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-@@ -487,47 +487,47 @@ static u8 *fsi_dma_get_area(struct fsi_priv *fsi, int stream)
- samples_to_bytes(runtime, io->buff_sample_pos);
- }
-
--static void fsi_dma_soft_push16(struct fsi_priv *fsi, int num)
-+static void fsi_pio_push16(struct fsi_priv *fsi, int num)
- {
- u16 *start;
- int i;
-
-- start = (u16 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
-+ start = (u16 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
-
- for (i = 0; i < num; i++)
- fsi_reg_write(fsi, DODT, ((u32)*(start + i) << 8));
- }
-
--static void fsi_dma_soft_pop16(struct fsi_priv *fsi, int num)
-+static void fsi_pio_pop16(struct fsi_priv *fsi, int num)
- {
- u16 *start;
- int i;
-
-- start = (u16 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
-+ start = (u16 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
-
-
- for (i = 0; i < num; i++)
- *(start + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
- }
-
--static void fsi_dma_soft_push32(struct fsi_priv *fsi, int num)
-+static void fsi_pio_push32(struct fsi_priv *fsi, int num)
- {
- u32 *start;
- int i;
-
-- start = (u32 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
-+ start = (u32 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
-
-
- for (i = 0; i < num; i++)
- fsi_reg_write(fsi, DODT, *(start + i));
- }
-
--static void fsi_dma_soft_pop32(struct fsi_priv *fsi, int num)
-+static void fsi_pio_pop32(struct fsi_priv *fsi, int num)
- {
- u32 *start;
- int i;
-
-- start = (u32 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
-+ start = (u32 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
-
- for (i = 0; i < num; i++)
- *(start + i) = fsi_reg_read(fsi, DIDT);
-@@ -812,8 +812,8 @@ static int fsi_data_pop(struct fsi_priv *fsi)
- samples = min(sample_residues, sample_space);
-
- return fsi_fifo_data_ctrl(fsi, io,
-- fsi_dma_soft_pop16,
-- fsi_dma_soft_pop32,
-+ fsi_pio_pop16,
-+ fsi_pio_pop32,
- samples);
- }
-
-@@ -832,8 +832,8 @@ static int fsi_data_push(struct fsi_priv *fsi)
- samples = min(sample_residues, sample_space);
-
- return fsi_fifo_data_ctrl(fsi, io,
-- fsi_dma_soft_push16,
-- fsi_dma_soft_push32,
-+ fsi_pio_push16,
-+ fsi_pio_push32,
- samples);
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0104-ASoC-fsi-tidyup-move-fsi_fifo_init-onto-fsi_hw_start.patch b/patches.kzm9g/0104-ASoC-fsi-tidyup-move-fsi_fifo_init-onto-fsi_hw_start.patch
deleted file mode 100644
index 4d8d3d2e539940..00000000000000
--- a/patches.kzm9g/0104-ASoC-fsi-tidyup-move-fsi_fifo_init-onto-fsi_hw_start.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From 4960931dddb3441619911b0fc1913646252466f0 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:51:29 -0800
-Subject: ASoC: fsi: tidyup: move fsi_fifo_init() onto fsi_hw_startup()
-
-fsi_fifo_init() is called only from fsi_hw_startup()
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit b49e8027810b674dc0bf0ba3d629c5fae52d78f3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 109 ++++++++++++++++++++++++++---------------------------
- 1 file changed, 54 insertions(+), 55 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 05307ac..79485ed 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -692,61 +692,6 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- /*
- * ctrl function
- */
--static void fsi_fifo_init(struct fsi_priv *fsi,
-- int is_play,
-- struct device *dev)
--{
-- struct fsi_master *master = fsi_get_master(fsi);
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-- u32 shift, i;
-- int frame_capa;
--
-- /* get on-chip RAM capacity */
-- shift = fsi_master_read(master, FIFO_SZ);
-- shift >>= fsi_get_port_shift(fsi, is_play);
-- shift &= FIFO_SZ_MASK;
-- frame_capa = 256 << shift;
-- dev_dbg(dev, "fifo = %d words\n", frame_capa);
--
-- /*
-- * The maximum number of sample data varies depending
-- * on the number of channels selected for the format.
-- *
-- * FIFOs are used in 4-channel units in 3-channel mode
-- * and in 8-channel units in 5- to 7-channel mode
-- * meaning that more FIFOs than the required size of DPRAM
-- * are used.
-- *
-- * ex) if 256 words of DP-RAM is connected
-- * 1 channel: 256 (256 x 1 = 256)
-- * 2 channels: 128 (128 x 2 = 256)
-- * 3 channels: 64 ( 64 x 3 = 192)
-- * 4 channels: 64 ( 64 x 4 = 256)
-- * 5 channels: 32 ( 32 x 5 = 160)
-- * 6 channels: 32 ( 32 x 6 = 192)
-- * 7 channels: 32 ( 32 x 7 = 224)
-- * 8 channels: 32 ( 32 x 8 = 256)
-- */
-- for (i = 1; i < fsi->chan_num; i <<= 1)
-- frame_capa >>= 1;
-- dev_dbg(dev, "%d channel %d store\n",
-- fsi->chan_num, frame_capa);
--
-- io->fifo_sample_capa = fsi_frame2sample(fsi, frame_capa);
--
-- /*
-- * set interrupt generation factor
-- * clear FIFO
-- */
-- if (is_play) {
-- fsi_reg_write(fsi, DOFF_CTL, IRQ_HALF);
-- fsi_reg_mask_set(fsi, DOFF_CTL, FIFO_CLR, FIFO_CLR);
-- } else {
-- fsi_reg_write(fsi, DIFF_CTL, IRQ_HALF);
-- fsi_reg_mask_set(fsi, DIFF_CTL, FIFO_CLR, FIFO_CLR);
-- }
--}
--
- static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
- void (*run16)(struct fsi_priv *fsi, int size),
- void (*run32)(struct fsi_priv *fsi, int size),
-@@ -867,6 +812,60 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
- /*
- * dai ops
- */
-+static void fsi_fifo_init(struct fsi_priv *fsi,
-+ int is_play,
-+ struct device *dev)
-+{
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-+ u32 shift, i;
-+ int frame_capa;
-+
-+ /* get on-chip RAM capacity */
-+ shift = fsi_master_read(master, FIFO_SZ);
-+ shift >>= fsi_get_port_shift(fsi, is_play);
-+ shift &= FIFO_SZ_MASK;
-+ frame_capa = 256 << shift;
-+ dev_dbg(dev, "fifo = %d words\n", frame_capa);
-+
-+ /*
-+ * The maximum number of sample data varies depending
-+ * on the number of channels selected for the format.
-+ *
-+ * FIFOs are used in 4-channel units in 3-channel mode
-+ * and in 8-channel units in 5- to 7-channel mode
-+ * meaning that more FIFOs than the required size of DPRAM
-+ * are used.
-+ *
-+ * ex) if 256 words of DP-RAM is connected
-+ * 1 channel: 256 (256 x 1 = 256)
-+ * 2 channels: 128 (128 x 2 = 256)
-+ * 3 channels: 64 ( 64 x 3 = 192)
-+ * 4 channels: 64 ( 64 x 4 = 256)
-+ * 5 channels: 32 ( 32 x 5 = 160)
-+ * 6 channels: 32 ( 32 x 6 = 192)
-+ * 7 channels: 32 ( 32 x 7 = 224)
-+ * 8 channels: 32 ( 32 x 8 = 256)
-+ */
-+ for (i = 1; i < fsi->chan_num; i <<= 1)
-+ frame_capa >>= 1;
-+ dev_dbg(dev, "%d channel %d store\n",
-+ fsi->chan_num, frame_capa);
-+
-+ io->fifo_sample_capa = fsi_frame2sample(fsi, frame_capa);
-+
-+ /*
-+ * set interrupt generation factor
-+ * clear FIFO
-+ */
-+ if (is_play) {
-+ fsi_reg_write(fsi, DOFF_CTL, IRQ_HALF);
-+ fsi_reg_mask_set(fsi, DOFF_CTL, FIFO_CLR, FIFO_CLR);
-+ } else {
-+ fsi_reg_write(fsi, DIFF_CTL, IRQ_HALF);
-+ fsi_reg_mask_set(fsi, DIFF_CTL, FIFO_CLR, FIFO_CLR);
-+ }
-+}
-
- static int fsi_hw_startup(struct fsi_priv *fsi,
- int is_play,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0105-ASoC-fsi-remove-unnecessary-parameter-from-fsi_hw_sh.patch b/patches.kzm9g/0105-ASoC-fsi-remove-unnecessary-parameter-from-fsi_hw_sh.patch
deleted file mode 100644
index 148b9f44361e29..00000000000000
--- a/patches.kzm9g/0105-ASoC-fsi-remove-unnecessary-parameter-from-fsi_hw_sh.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 6e68b51cdc84f44faaaa97ca596a1c88260b89d8 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:51:53 -0800
-Subject: ASoC: fsi: remove unnecessary parameter from fsi_hw_shutdown()
-
-This is preparation for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 41bba151939e21e21d18f7df005ce3a06714a69a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 79485ed..a0a9c36 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -927,7 +927,6 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
- }
-
- static void fsi_hw_shutdown(struct fsi_priv *fsi,
-- int is_play,
- struct device *dev)
- {
- if (fsi_is_clk_master(fsi))
-@@ -947,9 +946,8 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- int is_play = fsi_is_play(substream);
-
-- fsi_hw_shutdown(fsi, is_play, dai->dev);
-+ fsi_hw_shutdown(fsi, dai->dev);
- fsi->rate = 0;
- }
-
-@@ -1342,7 +1340,7 @@ static void __fsi_suspend(struct fsi_priv *fsi,
- return;
-
- fsi_port_stop(fsi, is_play);
-- fsi_hw_shutdown(fsi, is_play, dev);
-+ fsi_hw_shutdown(fsi, dev);
- }
-
- static void __fsi_resume(struct fsi_priv *fsi,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0106-ASoC-fsi-rename-fsi_stream_push-pop-to-fsi_stream_in.patch b/patches.kzm9g/0106-ASoC-fsi-rename-fsi_stream_push-pop-to-fsi_stream_in.patch
deleted file mode 100644
index 2da6f9f51d8d90..00000000000000
--- a/patches.kzm9g/0106-ASoC-fsi-rename-fsi_stream_push-pop-to-fsi_stream_in.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 8c2feb4527500fa4c1cc1f060fb73985b18a5969 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:52:07 -0800
-Subject: ASoC: fsi: rename fsi_stream_push/pop() to fsi_stream_init/quit()
-
-This is preparation for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 8c4152951cab90b52406afc72b62e9590bbe2d85)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index a0a9c36..2e2663b 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -426,7 +426,7 @@ static int fsi_stream_is_working(struct fsi_priv *fsi,
- return ret;
- }
-
--static void fsi_stream_push(struct fsi_priv *fsi,
-+static void fsi_stream_init(struct fsi_priv *fsi,
- int is_play,
- struct snd_pcm_substream *substream)
- {
-@@ -447,7 +447,7 @@ static void fsi_stream_push(struct fsi_priv *fsi,
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
--static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
-+static void fsi_stream_quit(struct fsi_priv *fsi, int is_play)
- {
- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_soc_dai *dai = fsi_get_dai(io->substream);
-@@ -960,13 +960,13 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
-- fsi_stream_push(fsi, is_play, substream);
-+ fsi_stream_init(fsi, is_play, substream);
- ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
- fsi_port_start(fsi, is_play);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- fsi_port_stop(fsi, is_play);
-- fsi_stream_pop(fsi, is_play);
-+ fsi_stream_quit(fsi, is_play);
- break;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0107-ASoC-fsi-modify-fsi_pio_get_area-parameter-and-using.patch b/patches.kzm9g/0107-ASoC-fsi-modify-fsi_pio_get_area-parameter-and-using.patch
deleted file mode 100644
index 838c0ddddbcbd2..00000000000000
--- a/patches.kzm9g/0107-ASoC-fsi-modify-fsi_pio_get_area-parameter-and-using.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From 2994ced4ba0546e601874e43b36f9bc6011a49f6 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:52:38 -0800
-Subject: ASoC: fsi: modify fsi_pio_get_area() parameter and using position
-
-This patch modify fsi_pio_get_area() parameter to use
-struct fsi_stream, and used it on fsi_fifo_data_ctrl().
-This is just prepare cleanup for DMAEngine support.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 95b0cf05976b7d0571e283b1fcd4c32095018cd6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 43 +++++++++++++++++--------------------------
- 1 file changed, 17 insertions(+), 26 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 2e2663b..c814d8a 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -477,58 +477,46 @@ static void fsi_stream_quit(struct fsi_priv *fsi, int is_play)
- * pio function
- */
-
--static u8 *fsi_pio_get_area(struct fsi_priv *fsi, int stream)
-+static u8 *fsi_pio_get_area(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- int is_play = fsi_stream_is_play(stream);
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_pcm_runtime *runtime = io->substream->runtime;
-
- return runtime->dma_area +
- samples_to_bytes(runtime, io->buff_sample_pos);
- }
-
--static void fsi_pio_push16(struct fsi_priv *fsi, int num)
-+static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int num)
- {
-- u16 *start;
-+ u16 *start = (u16 *)_buf;
- int i;
-
-- start = (u16 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
--
- for (i = 0; i < num; i++)
- fsi_reg_write(fsi, DODT, ((u32)*(start + i) << 8));
- }
-
--static void fsi_pio_pop16(struct fsi_priv *fsi, int num)
-+static void fsi_pio_pop16(struct fsi_priv *fsi, u8 *_buf, int num)
- {
-- u16 *start;
-+ u16 *start = (u16 *)_buf;
- int i;
-
-- start = (u16 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
--
--
- for (i = 0; i < num; i++)
- *(start + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
- }
-
--static void fsi_pio_push32(struct fsi_priv *fsi, int num)
-+static void fsi_pio_push32(struct fsi_priv *fsi, u8 *_buf, int num)
- {
-- u32 *start;
-+ u32 *start = (u32 *)_buf;
- int i;
-
-- start = (u32 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
--
--
- for (i = 0; i < num; i++)
- fsi_reg_write(fsi, DODT, *(start + i));
- }
-
--static void fsi_pio_pop32(struct fsi_priv *fsi, int num)
-+static void fsi_pio_pop32(struct fsi_priv *fsi, u8 *_buf, int num)
- {
-- u32 *start;
-+ u32 *start = (u32 *)_buf;
- int i;
-
-- start = (u32 *)fsi_pio_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
--
- for (i = 0; i < num; i++)
- *(start + i) = fsi_reg_read(fsi, DIDT);
- }
-@@ -693,12 +681,13 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- * ctrl function
- */
- static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-- void (*run16)(struct fsi_priv *fsi, int size),
-- void (*run32)(struct fsi_priv *fsi, int size),
-- int samples)
-+ void (*run16)(struct fsi_priv *fsi, u8 *buf, int samples),
-+ void (*run32)(struct fsi_priv *fsi, u8 *buf, int samples),
-+ int samples)
- {
- struct snd_pcm_runtime *runtime;
- struct snd_pcm_substream *substream;
-+ u8 *buf;
- int over_period;
-
- if (!fsi ||
-@@ -723,12 +712,14 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
- io->buff_sample_pos = 0;
- }
-
-+ buf = fsi_pio_get_area(fsi, io);
-+
- switch (io->sample_width) {
- case 2:
-- run16(fsi, samples);
-+ run16(fsi, buf, samples);
- break;
- case 4:
-- run32(fsi, samples);
-+ run32(fsi, buf, samples);
- break;
- default:
- return -EINVAL;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0108-ASoC-fsi-re-define-fsi_is_play-and-fsi_stream_is_pla.patch b/patches.kzm9g/0108-ASoC-fsi-re-define-fsi_is_play-and-fsi_stream_is_pla.patch
deleted file mode 100644
index c284e895279f66..00000000000000
--- a/patches.kzm9g/0108-ASoC-fsi-re-define-fsi_is_play-and-fsi_stream_is_pla.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 3e44f2caa7c0f3ce9496d578f1fea695c5e5646f Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:54:02 -0800
-Subject: ASoC: fsi: re-define fsi_is_play() and fsi_stream_is_play()
-
-This patch re-define fsi_is_play() and fsi_stream_is_play().
-fsi_data_pop/push() function keeps direct value of "is_play" at this point,
-but it will be removed soon.
-This is just prepare cleanup for DMAEngine support.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit a449e46754616a13e1bee649e37bcdf10d1b794a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index c814d8a..1cbe474 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -296,6 +296,11 @@ static int fsi_is_spdif(struct fsi_priv *fsi)
- return fsi->spdif;
- }
-
-+static int fsi_is_play(struct snd_pcm_substream *substream)
-+{
-+ return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
-+}
-+
- static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream)
- {
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-@@ -399,10 +404,10 @@ static void fsi_count_fifo_err(struct fsi_priv *fsi)
- /*
- * fsi_stream_xx() function
- */
--#define fsi_is_play(substream) fsi_stream_is_play(substream->stream)
--static inline int fsi_stream_is_play(int stream)
-+static inline int fsi_stream_is_play(struct fsi_priv *fsi,
-+ struct fsi_stream *io)
- {
-- return stream == SNDRV_PCM_STREAM_PLAYBACK;
-+ return &fsi->playback == io;
- }
-
- static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi,
-@@ -736,7 +741,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-
- static int fsi_data_pop(struct fsi_priv *fsi)
- {
-- int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_CAPTURE);
-+ int is_play = 0;
- int sample_residues; /* samples in FSI fifo */
- int sample_space; /* ALSA free samples space */
- int samples;
-@@ -755,7 +760,7 @@ static int fsi_data_pop(struct fsi_priv *fsi)
-
- static int fsi_data_push(struct fsi_priv *fsi)
- {
-- int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_PLAYBACK);
-+ int is_play = 1;
- int sample_residues; /* ALSA residue samples */
- int sample_space; /* FSI fifo free samples space */
- int samples;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0109-ASoC-fsi-use-fsi_stream-in-fsi_get_current_fifo_samp.patch b/patches.kzm9g/0109-ASoC-fsi-use-fsi_stream-in-fsi_get_current_fifo_samp.patch
deleted file mode 100644
index 0b895fb7e55e04..00000000000000
--- a/patches.kzm9g/0109-ASoC-fsi-use-fsi_stream-in-fsi_get_current_fifo_samp.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 374adbfae43dc4d5b0f0f9e7b14841df24cceea1 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:55:26 -0800
-Subject: ASoC: fsi: use fsi_stream in fsi_get_current_fifo_samples()
- parameter
-
-fsi_get_current_fifo_samples() uses fsi_stream instead of is_play.
-This is just prepare cleanup for DMAEngine support.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 7b1b3331e65e47b6abb32be0a3db46bcf423145a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 1cbe474..24dbe16 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -210,6 +210,8 @@ struct fsi_master {
- spinlock_t lock;
- };
-
-+static int fsi_stream_is_play(struct fsi_priv *fsi, struct fsi_stream *io);
-+
- /*
- * basic read write function
- */
-@@ -366,8 +368,10 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples)
- return samples / fsi->chan_num;
- }
-
--static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play)
-+static int fsi_get_current_fifo_samples(struct fsi_priv *fsi,
-+ struct fsi_stream *io)
- {
-+ int is_play = fsi_stream_is_play(fsi, io);
- u32 status;
- int frames;
-
-@@ -747,7 +751,7 @@ static int fsi_data_pop(struct fsi_priv *fsi)
- int samples;
- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-
-- sample_residues = fsi_get_current_fifo_samples(fsi, is_play);
-+ sample_residues = fsi_get_current_fifo_samples(fsi, io);
- sample_space = io->buff_sample_capa - io->buff_sample_pos;
-
- samples = min(sample_residues, sample_space);
-@@ -768,7 +772,7 @@ static int fsi_data_push(struct fsi_priv *fsi)
-
- sample_residues = io->buff_sample_capa - io->buff_sample_pos;
- sample_space = io->fifo_sample_capa -
-- fsi_get_current_fifo_samples(fsi, is_play);
-+ fsi_get_current_fifo_samples(fsi, io);
-
- samples = min(sample_residues, sample_space);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0110-ASoC-fsi-add-fsi_stream_handler-and-PIO-handler.patch b/patches.kzm9g/0110-ASoC-fsi-add-fsi_stream_handler-and-PIO-handler.patch
deleted file mode 100644
index 3346eefd93f023..00000000000000
--- a/patches.kzm9g/0110-ASoC-fsi-add-fsi_stream_handler-and-PIO-handler.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-From bb1acd92639a1c3dae57bbc1d457fba98f084a6d Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:55:55 -0800
-Subject: ASoC: fsi: add fsi_stream_handler and PIO handler
-
-This patch adds struct fsi_stream_handler and defined fsi_pio_push/pop_handler.
-these are controled by fsi_steam_xxx() function.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 5e97313ac483f03a9af661aada356980fe310e0d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++------
- 1 file changed, 118 insertions(+), 15 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 24dbe16..b02886a 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -159,18 +159,27 @@ typedef int (*set_rate_func)(struct device *dev, int is_porta, int rate, int ena
- * struct
- */
-
-+struct fsi_stream_handler;
- struct fsi_stream {
-- struct snd_pcm_substream *substream;
-
-+ /*
-+ * these are initialized by fsi_stream_init()
-+ */
-+ struct snd_pcm_substream *substream;
- int fifo_sample_capa; /* sample capacity of FSI FIFO */
- int buff_sample_capa; /* sample capacity of ALSA buffer */
- int buff_sample_pos; /* sample position of ALSA buffer */
- int period_samples; /* sample number / 1 period */
- int period_pos; /* current period position */
- int sample_width; /* sample width */
--
- int uerr_num;
- int oerr_num;
-+
-+ /*
-+ * thse are initialized by fsi_handler_init()
-+ */
-+ struct fsi_stream_handler *handler;
-+ struct fsi_priv *priv;
- };
-
- struct fsi_priv {
-@@ -190,6 +199,16 @@ struct fsi_priv {
- long rate;
- };
-
-+struct fsi_stream_handler {
-+ int (*probe)(struct fsi_priv *fsi, struct fsi_stream *io);
-+ int (*transfer)(struct fsi_priv *fsi, struct fsi_stream *io);
-+ int (*remove)(struct fsi_priv *fsi, struct fsi_stream *io);
-+};
-+#define fsi_stream_handler_call(io, func, args...) \
-+ (!(io) ? -ENODEV : \
-+ !((io)->handler->func) ? 0 : \
-+ (io)->handler->func(args))
-+
- struct fsi_core {
- int ver;
-
-@@ -435,6 +454,11 @@ static int fsi_stream_is_working(struct fsi_priv *fsi,
- return ret;
- }
-
-+static struct fsi_priv *fsi_stream_to_priv(struct fsi_stream *io)
-+{
-+ return io->priv;
-+}
-+
- static void fsi_stream_init(struct fsi_priv *fsi,
- int is_play,
- struct snd_pcm_substream *substream)
-@@ -482,6 +506,53 @@ static void fsi_stream_quit(struct fsi_priv *fsi, int is_play)
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
-+static int fsi_stream_transfer(struct fsi_stream *io)
-+{
-+ struct fsi_priv *fsi = fsi_stream_to_priv(io);
-+ if (!fsi)
-+ return -EIO;
-+
-+ return fsi_stream_handler_call(io, transfer, fsi, io);
-+}
-+
-+static int fsi_stream_probe(struct fsi_priv *fsi)
-+{
-+ struct fsi_stream *io;
-+ int ret1, ret2;
-+
-+ io = &fsi->playback;
-+ ret1 = fsi_stream_handler_call(io, probe, fsi, io);
-+
-+ io = &fsi->capture;
-+ ret2 = fsi_stream_handler_call(io, probe, fsi, io);
-+
-+ if (ret1 < 0)
-+ return ret1;
-+ if (ret2 < 0)
-+ return ret2;
-+
-+ return 0;
-+}
-+
-+static int fsi_stream_remove(struct fsi_priv *fsi)
-+{
-+ struct fsi_stream *io;
-+ int ret1, ret2;
-+
-+ io = &fsi->playback;
-+ ret1 = fsi_stream_handler_call(io, remove, fsi, io);
-+
-+ io = &fsi->capture;
-+ ret2 = fsi_stream_handler_call(io, remove, fsi, io);
-+
-+ if (ret1 < 0)
-+ return ret1;
-+ if (ret2 < 0)
-+ return ret2;
-+
-+ return 0;
-+}
-+
- /*
- * pio function
- */
-@@ -743,13 +814,11 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
- return 0;
- }
-
--static int fsi_data_pop(struct fsi_priv *fsi)
-+static int fsi_pio_pop(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- int is_play = 0;
- int sample_residues; /* samples in FSI fifo */
- int sample_space; /* ALSA free samples space */
- int samples;
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-
- sample_residues = fsi_get_current_fifo_samples(fsi, io);
- sample_space = io->buff_sample_capa - io->buff_sample_pos;
-@@ -762,13 +831,11 @@ static int fsi_data_pop(struct fsi_priv *fsi)
- samples);
- }
-
--static int fsi_data_push(struct fsi_priv *fsi)
-+static int fsi_pio_push(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- int is_play = 1;
- int sample_residues; /* ALSA residue samples */
- int sample_space; /* FSI fifo free samples space */
- int samples;
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-
- sample_residues = io->buff_sample_capa - io->buff_sample_pos;
- sample_space = io->fifo_sample_capa -
-@@ -782,6 +849,14 @@ static int fsi_data_push(struct fsi_priv *fsi)
- samples);
- }
-
-+static struct fsi_stream_handler fsi_pio_push_handler = {
-+ .transfer = fsi_pio_push,
-+};
-+
-+static struct fsi_stream_handler fsi_pio_pop_handler = {
-+ .transfer = fsi_pio_pop,
-+};
-+
- static irqreturn_t fsi_interrupt(int irq, void *data)
- {
- struct fsi_master *master = data;
-@@ -792,13 +867,13 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
- fsi_master_mask_set(master, SOFT_RST, IR, IR);
-
- if (int_st & AB_IO(1, AO_SHIFT))
-- fsi_data_push(&master->fsia);
-+ fsi_stream_transfer(&master->fsia.playback);
- if (int_st & AB_IO(1, BO_SHIFT))
-- fsi_data_push(&master->fsib);
-+ fsi_stream_transfer(&master->fsib.playback);
- if (int_st & AB_IO(1, AI_SHIFT))
-- fsi_data_pop(&master->fsia);
-+ fsi_stream_transfer(&master->fsia.capture);
- if (int_st & AB_IO(1, BI_SHIFT))
-- fsi_data_pop(&master->fsib);
-+ fsi_stream_transfer(&master->fsib.capture);
-
- fsi_count_fifo_err(&master->fsia);
- fsi_count_fifo_err(&master->fsib);
-@@ -955,14 +1030,16 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-+ struct fsi_stream *io = fsi_stream_get(fsi, fsi_is_play(substream));
- int is_play = fsi_is_play(substream);
- int ret = 0;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- fsi_stream_init(fsi, is_play, substream);
-- ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
-- fsi_port_start(fsi, is_play);
-+ ret = fsi_stream_transfer(io);
-+ if (0 == ret)
-+ fsi_port_start(fsi, is_play);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- fsi_port_stop(fsi, is_play);
-@@ -1224,6 +1301,13 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
- /*
- * platform function
- */
-+static void fsi_handler_init(struct fsi_priv *fsi)
-+{
-+ fsi->playback.handler = &fsi_pio_push_handler; /* default PIO */
-+ fsi->playback.priv = fsi;
-+ fsi->capture.handler = &fsi_pio_pop_handler; /* default PIO */
-+ fsi->capture.priv = fsi;
-+}
-
- static int fsi_probe(struct platform_device *pdev)
- {
-@@ -1270,10 +1354,22 @@ static int fsi_probe(struct platform_device *pdev)
- /* FSI A setting */
- master->fsia.base = master->base;
- master->fsia.master = master;
-+ fsi_handler_init(&master->fsia);
-+ ret = fsi_stream_probe(&master->fsia);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "FSIA stream probe failed\n");
-+ goto exit_iounmap;
-+ }
-
- /* FSI B setting */
- master->fsib.base = master->base + 0x40;
- master->fsib.master = master;
-+ fsi_handler_init(&master->fsib);
-+ ret = fsi_stream_probe(&master->fsib);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "FSIB stream probe failed\n");
-+ goto exit_fsia;
-+ }
-
- pm_runtime_enable(&pdev->dev);
- dev_set_drvdata(&pdev->dev, master);
-@@ -1282,7 +1378,7 @@ static int fsi_probe(struct platform_device *pdev)
- id_entry->name, master);
- if (ret) {
- dev_err(&pdev->dev, "irq request err\n");
-- goto exit_iounmap;
-+ goto exit_fsib;
- }
-
- ret = snd_soc_register_platform(&pdev->dev, &fsi_soc_platform);
-@@ -1304,6 +1400,10 @@ exit_snd_soc:
- snd_soc_unregister_platform(&pdev->dev);
- exit_free_irq:
- free_irq(irq, master);
-+exit_fsib:
-+ fsi_stream_remove(&master->fsib);
-+exit_fsia:
-+ fsi_stream_remove(&master->fsia);
- exit_iounmap:
- iounmap(master->base);
- pm_runtime_disable(&pdev->dev);
-@@ -1326,6 +1426,9 @@ static int fsi_remove(struct platform_device *pdev)
- snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(fsi_soc_dai));
- snd_soc_unregister_platform(&pdev->dev);
-
-+ fsi_stream_remove(&master->fsia);
-+ fsi_stream_remove(&master->fsib);
-+
- iounmap(master->base);
- kfree(master);
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0111-ASoC-fsi-tidyup-fsi_pio_xxx-are-gathered.patch b/patches.kzm9g/0111-ASoC-fsi-tidyup-fsi_pio_xxx-are-gathered.patch
deleted file mode 100644
index 2adddb04fdefd7..00000000000000
--- a/patches.kzm9g/0111-ASoC-fsi-tidyup-fsi_pio_xxx-are-gathered.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-From e31af8e7b9e4d0bffdab4e6c614f6b181bea962b Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:56:27 -0800
-Subject: ASoC: fsi: tidyup: fsi_pio_xxx() are gathered
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 1b0ca1a0c056c7c97b18e363f939f0635ca093af)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 101 ++++++++++++++++++++++++++---------------------------
- 1 file changed, 49 insertions(+), 52 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index b02886a..7c93b7c 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -554,54 +554,6 @@ static int fsi_stream_remove(struct fsi_priv *fsi)
- }
-
- /*
-- * pio function
-- */
--
--static u8 *fsi_pio_get_area(struct fsi_priv *fsi, struct fsi_stream *io)
--{
-- struct snd_pcm_runtime *runtime = io->substream->runtime;
--
-- return runtime->dma_area +
-- samples_to_bytes(runtime, io->buff_sample_pos);
--}
--
--static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int num)
--{
-- u16 *start = (u16 *)_buf;
-- int i;
--
-- for (i = 0; i < num; i++)
-- fsi_reg_write(fsi, DODT, ((u32)*(start + i) << 8));
--}
--
--static void fsi_pio_pop16(struct fsi_priv *fsi, u8 *_buf, int num)
--{
-- u16 *start = (u16 *)_buf;
-- int i;
--
-- for (i = 0; i < num; i++)
-- *(start + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
--}
--
--static void fsi_pio_push32(struct fsi_priv *fsi, u8 *_buf, int num)
--{
-- u32 *start = (u32 *)_buf;
-- int i;
--
-- for (i = 0; i < num; i++)
-- fsi_reg_write(fsi, DODT, *(start + i));
--}
--
--static void fsi_pio_pop32(struct fsi_priv *fsi, u8 *_buf, int num)
--{
-- u32 *start = (u32 *)_buf;
-- int i;
--
-- for (i = 0; i < num; i++)
-- *(start + i) = fsi_reg_read(fsi, DIDT);
--}
--
--/*
- * irq function
- */
-
-@@ -757,10 +709,55 @@ static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
- }
-
-+
- /*
-- * ctrl function
-+ * pio data transfer handler
- */
--static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-+static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int samples)
-+{
-+ u16 *buf = (u16 *)_buf;
-+ int i;
-+
-+ for (i = 0; i < samples; i++)
-+ fsi_reg_write(fsi, DODT, ((u32)*(buf + i) << 8));
-+}
-+
-+static void fsi_pio_pop16(struct fsi_priv *fsi, u8 *_buf, int samples)
-+{
-+ u16 *buf = (u16 *)_buf;
-+ int i;
-+
-+ for (i = 0; i < samples; i++)
-+ *(buf + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
-+}
-+
-+static void fsi_pio_push32(struct fsi_priv *fsi, u8 *_buf, int samples)
-+{
-+ u32 *buf = (u32 *)_buf;
-+ int i;
-+
-+ for (i = 0; i < samples; i++)
-+ fsi_reg_write(fsi, DODT, *(buf + i));
-+}
-+
-+static void fsi_pio_pop32(struct fsi_priv *fsi, u8 *_buf, int samples)
-+{
-+ u32 *buf = (u32 *)_buf;
-+ int i;
-+
-+ for (i = 0; i < samples; i++)
-+ *(buf + i) = fsi_reg_read(fsi, DIDT);
-+}
-+
-+static u8 *fsi_pio_get_area(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ struct snd_pcm_runtime *runtime = io->substream->runtime;
-+
-+ return runtime->dma_area +
-+ samples_to_bytes(runtime, io->buff_sample_pos);
-+}
-+
-+static int fsi_pio_transfer(struct fsi_priv *fsi, struct fsi_stream *io,
- void (*run16)(struct fsi_priv *fsi, u8 *buf, int samples),
- void (*run32)(struct fsi_priv *fsi, u8 *buf, int samples),
- int samples)
-@@ -825,7 +822,7 @@ static int fsi_pio_pop(struct fsi_priv *fsi, struct fsi_stream *io)
-
- samples = min(sample_residues, sample_space);
-
-- return fsi_fifo_data_ctrl(fsi, io,
-+ return fsi_pio_transfer(fsi, io,
- fsi_pio_pop16,
- fsi_pio_pop32,
- samples);
-@@ -843,7 +840,7 @@ static int fsi_pio_push(struct fsi_priv *fsi, struct fsi_stream *io)
-
- samples = min(sample_residues, sample_space);
-
-- return fsi_fifo_data_ctrl(fsi, io,
-+ return fsi_pio_transfer(fsi, io,
- fsi_pio_push16,
- fsi_pio_push32,
- samples);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0112-ASoC-fsi-don-t-use-is_play-as-a-parameter-of-fsi-fun.patch b/patches.kzm9g/0112-ASoC-fsi-don-t-use-is_play-as-a-parameter-of-fsi-fun.patch
deleted file mode 100644
index 1c02a3dc1a42e8..00000000000000
--- a/patches.kzm9g/0112-ASoC-fsi-don-t-use-is_play-as-a-parameter-of-fsi-fun.patch
+++ /dev/null
@@ -1,291 +0,0 @@
-From a1e81ab5ca7241fefe487653f39c9bcb665e3c3e Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:56:57 -0800
-Subject: ASoC: fsi: don't use is_play as a parameter of fsi functions
-
-is_play should be kept as local valuable.
-it prepare cleanup for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 938e2a8da5b2c1cb21c200e97736259948a3d12c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 94 ++++++++++++++++++++++++++----------------------------
- 1 file changed, 45 insertions(+), 49 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 7c93b7c..7dec144 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -364,8 +364,9 @@ static u32 fsi_get_info_flags(struct fsi_priv *fsi)
- master->info->portb_flags;
- }
-
--static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
-+static u32 fsi_get_port_shift(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-+ int is_play = fsi_stream_is_play(fsi, io);
- int is_porta = fsi_is_port_a(fsi);
- u32 shift;
-
-@@ -434,15 +435,14 @@ static inline int fsi_stream_is_play(struct fsi_priv *fsi,
- }
-
- static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi,
-- int is_play)
-+ struct snd_pcm_substream *substream)
- {
-- return is_play ? &fsi->playback : &fsi->capture;
-+ return fsi_is_play(substream) ? &fsi->playback : &fsi->capture;
- }
-
- static int fsi_stream_is_working(struct fsi_priv *fsi,
-- int is_play)
-+ struct fsi_stream *io)
- {
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
- int ret;
-@@ -460,10 +460,9 @@ static struct fsi_priv *fsi_stream_to_priv(struct fsi_stream *io)
- }
-
- static void fsi_stream_init(struct fsi_priv *fsi,
-- int is_play,
-+ struct fsi_stream *io,
- struct snd_pcm_substream *substream)
- {
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_pcm_runtime *runtime = substream->runtime;
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
-@@ -480,9 +479,8 @@ static void fsi_stream_init(struct fsi_priv *fsi,
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
--static void fsi_stream_quit(struct fsi_priv *fsi, int is_play)
-+static void fsi_stream_quit(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
- struct snd_soc_dai *dai = fsi_get_dai(io->substream);
- struct fsi_master *master = fsi_get_master(fsi);
- unsigned long flags;
-@@ -557,18 +555,18 @@ static int fsi_stream_remove(struct fsi_priv *fsi)
- * irq function
- */
-
--static void fsi_irq_enable(struct fsi_priv *fsi, int is_play)
-+static void fsi_irq_enable(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- u32 data = AB_IO(1, fsi_get_port_shift(fsi, is_play));
-+ u32 data = AB_IO(1, fsi_get_port_shift(fsi, io));
- struct fsi_master *master = fsi_get_master(fsi);
-
- fsi_core_mask_set(master, imsk, data, data);
- fsi_core_mask_set(master, iemsk, data, data);
- }
-
--static void fsi_irq_disable(struct fsi_priv *fsi, int is_play)
-+static void fsi_irq_disable(struct fsi_priv *fsi, struct fsi_stream *io)
- {
-- u32 data = AB_IO(1, fsi_get_port_shift(fsi, is_play));
-+ u32 data = AB_IO(1, fsi_get_port_shift(fsi, io));
- struct fsi_master *master = fsi_get_master(fsi);
-
- fsi_core_mask_set(master, imsk, data, 0);
-@@ -585,8 +583,8 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi)
- u32 data = 0;
- struct fsi_master *master = fsi_get_master(fsi);
-
-- data |= AB_IO(1, fsi_get_port_shift(fsi, 0));
-- data |= AB_IO(1, fsi_get_port_shift(fsi, 1));
-+ data |= AB_IO(1, fsi_get_port_shift(fsi, &fsi->playback));
-+ data |= AB_IO(1, fsi_get_port_shift(fsi, &fsi->capture));
-
- /* clear interrupt factor */
- fsi_core_mask_set(master, int_st, data, 0);
-@@ -695,15 +693,16 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
-
- #define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
- #define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0)
--static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
-+static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-+ int enable)
- {
- struct fsi_master *master = fsi_get_master(fsi);
- u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
-
- if (enable)
-- fsi_irq_enable(fsi, is_play);
-+ fsi_irq_enable(fsi, io);
- else
-- fsi_irq_disable(fsi, is_play);
-+ fsi_irq_disable(fsi, io);
-
- if (fsi_is_clk_master(fsi))
- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
-@@ -885,17 +884,17 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
- * dai ops
- */
- static void fsi_fifo_init(struct fsi_priv *fsi,
-- int is_play,
-+ struct fsi_stream *io,
- struct device *dev)
- {
- struct fsi_master *master = fsi_get_master(fsi);
-- struct fsi_stream *io = fsi_stream_get(fsi, is_play);
-+ int is_play = fsi_stream_is_play(fsi, io);
- u32 shift, i;
- int frame_capa;
-
- /* get on-chip RAM capacity */
- shift = fsi_master_read(master, FIFO_SZ);
-- shift >>= fsi_get_port_shift(fsi, is_play);
-+ shift >>= fsi_get_port_shift(fsi, io);
- shift &= FIFO_SZ_MASK;
- frame_capa = 256 << shift;
- dev_dbg(dev, "fifo = %d words\n", frame_capa);
-@@ -940,7 +939,7 @@ static void fsi_fifo_init(struct fsi_priv *fsi,
- }
-
- static int fsi_hw_startup(struct fsi_priv *fsi,
-- int is_play,
-+ struct fsi_stream *io,
- struct device *dev)
- {
- struct fsi_master *master = fsi_get_master(fsi);
-@@ -989,11 +988,11 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
- }
-
- /* irq clear */
-- fsi_irq_disable(fsi, is_play);
-+ fsi_irq_disable(fsi, io);
- fsi_irq_clear_status(fsi);
-
- /* fifo init */
-- fsi_fifo_init(fsi, is_play, dev);
-+ fsi_fifo_init(fsi, io, dev);
-
- return 0;
- }
-@@ -1009,9 +1008,8 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- int is_play = fsi_is_play(substream);
-
-- return fsi_hw_startup(fsi, is_play, dai->dev);
-+ return fsi_hw_startup(fsi, fsi_stream_get(fsi, substream), dai->dev);
- }
-
- static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
-@@ -1027,20 +1025,19 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- struct fsi_stream *io = fsi_stream_get(fsi, fsi_is_play(substream));
-- int is_play = fsi_is_play(substream);
-+ struct fsi_stream *io = fsi_stream_get(fsi, substream);
- int ret = 0;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
-- fsi_stream_init(fsi, is_play, substream);
-+ fsi_stream_init(fsi, io, substream);
- ret = fsi_stream_transfer(io);
- if (0 == ret)
-- fsi_port_start(fsi, is_play);
-+ fsi_port_start(fsi, io);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
-- fsi_port_stop(fsi, is_play);
-- fsi_stream_quit(fsi, is_play);
-+ fsi_port_stop(fsi, io);
-+ fsi_stream_quit(fsi, io);
- break;
- }
-
-@@ -1206,7 +1203,7 @@ static int fsi_hw_free(struct snd_pcm_substream *substream)
- static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
-- struct fsi_stream *io = fsi_stream_get(fsi, fsi_is_play(substream));
-+ struct fsi_stream *io = fsi_stream_get(fsi, substream);
- int samples_pos = io->buff_sample_pos - 1;
-
- if (samples_pos < 0)
-@@ -1433,30 +1430,29 @@ static int fsi_remove(struct platform_device *pdev)
- }
-
- static void __fsi_suspend(struct fsi_priv *fsi,
-- int is_play,
-+ struct fsi_stream *io,
- struct device *dev)
- {
-- if (!fsi_stream_is_working(fsi, is_play))
-+ if (!fsi_stream_is_working(fsi, io))
- return;
-
-- fsi_port_stop(fsi, is_play);
-+ fsi_port_stop(fsi, io);
- fsi_hw_shutdown(fsi, dev);
- }
-
- static void __fsi_resume(struct fsi_priv *fsi,
-- int is_play,
-+ struct fsi_stream *io,
- struct device *dev)
- {
-- if (!fsi_stream_is_working(fsi, is_play))
-+ if (!fsi_stream_is_working(fsi, io))
- return;
-
-- fsi_hw_startup(fsi, is_play, dev);
-+ fsi_hw_startup(fsi, io, dev);
-
- if (fsi_is_clk_master(fsi) && fsi->rate)
- fsi_set_master_clk(dev, fsi, fsi->rate, 1);
-
-- fsi_port_start(fsi, is_play);
--
-+ fsi_port_start(fsi, io);
- }
-
- static int fsi_suspend(struct device *dev)
-@@ -1465,11 +1461,11 @@ static int fsi_suspend(struct device *dev)
- struct fsi_priv *fsia = &master->fsia;
- struct fsi_priv *fsib = &master->fsib;
-
-- __fsi_suspend(fsia, 1, dev);
-- __fsi_suspend(fsia, 0, dev);
-+ __fsi_suspend(fsia, &fsia->playback, dev);
-+ __fsi_suspend(fsia, &fsia->capture, dev);
-
-- __fsi_suspend(fsib, 1, dev);
-- __fsi_suspend(fsib, 0, dev);
-+ __fsi_suspend(fsib, &fsib->playback, dev);
-+ __fsi_suspend(fsib, &fsib->capture, dev);
-
- return 0;
- }
-@@ -1480,11 +1476,11 @@ static int fsi_resume(struct device *dev)
- struct fsi_priv *fsia = &master->fsia;
- struct fsi_priv *fsib = &master->fsib;
-
-- __fsi_resume(fsia, 1, dev);
-- __fsi_resume(fsia, 0, dev);
-+ __fsi_resume(fsia, &fsia->playback, dev);
-+ __fsi_resume(fsia, &fsia->capture, dev);
-
-- __fsi_resume(fsib, 1, dev);
-- __fsi_resume(fsib, 0, dev);
-+ __fsi_resume(fsib, &fsib->playback, dev);
-+ __fsi_resume(fsib, &fsib->capture, dev);
-
- return 0;
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0113-ASoC-fsi-add-.start_stop-handler-to-fsi_stream_handl.patch b/patches.kzm9g/0113-ASoC-fsi-add-.start_stop-handler-to-fsi_stream_handl.patch
deleted file mode 100644
index 5ab76b525e120c..00000000000000
--- a/patches.kzm9g/0113-ASoC-fsi-add-.start_stop-handler-to-fsi_stream_handl.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From fa8ef8395e2e672608fb808bdc7261b25c561d1d Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:57:25 -0800
-Subject: ASoC: fsi: add .start_stop handler to fsi_stream_handler
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 180346ede352b12c72c5aeba2fc806fd32880c16)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 51 +++++++++++++++++++++++++++++----------------------
- 1 file changed, 29 insertions(+), 22 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 7dec144..8d05e59 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -203,6 +203,8 @@ struct fsi_stream_handler {
- int (*probe)(struct fsi_priv *fsi, struct fsi_stream *io);
- int (*transfer)(struct fsi_priv *fsi, struct fsi_stream *io);
- int (*remove)(struct fsi_priv *fsi, struct fsi_stream *io);
-+ void (*start_stop)(struct fsi_priv *fsi, struct fsi_stream *io,
-+ int enable);
- };
- #define fsi_stream_handler_call(io, func, args...) \
- (!(io) ? -ENODEV : \
-@@ -513,6 +515,12 @@ static int fsi_stream_transfer(struct fsi_stream *io)
- return fsi_stream_handler_call(io, transfer, fsi, io);
- }
-
-+#define fsi_stream_start(fsi, io)\
-+ fsi_stream_handler_call(io, start_stop, fsi, io, 1)
-+
-+#define fsi_stream_stop(fsi, io)\
-+ fsi_stream_handler_call(io, start_stop, fsi, io, 0)
-+
- static int fsi_stream_probe(struct fsi_priv *fsi)
- {
- struct fsi_stream *io;
-@@ -691,24 +699,6 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
- return ret;
- }
-
--#define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
--#define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0)
--static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, struct fsi_stream *io,
-- int enable)
--{
-- struct fsi_master *master = fsi_get_master(fsi);
-- u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
--
-- if (enable)
-- fsi_irq_enable(fsi, io);
-- else
-- fsi_irq_disable(fsi, io);
--
-- if (fsi_is_clk_master(fsi))
-- fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
--}
--
--
- /*
- * pio data transfer handler
- */
-@@ -845,12 +835,29 @@ static int fsi_pio_push(struct fsi_priv *fsi, struct fsi_stream *io)
- samples);
- }
-
-+static void fsi_pio_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
-+ int enable)
-+{
-+ struct fsi_master *master = fsi_get_master(fsi);
-+ u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
-+
-+ if (enable)
-+ fsi_irq_enable(fsi, io);
-+ else
-+ fsi_irq_disable(fsi, io);
-+
-+ if (fsi_is_clk_master(fsi))
-+ fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
-+}
-+
- static struct fsi_stream_handler fsi_pio_push_handler = {
- .transfer = fsi_pio_push,
-+ .start_stop = fsi_pio_start_stop,
- };
-
- static struct fsi_stream_handler fsi_pio_pop_handler = {
- .transfer = fsi_pio_pop,
-+ .start_stop = fsi_pio_start_stop,
- };
-
- static irqreturn_t fsi_interrupt(int irq, void *data)
-@@ -1033,10 +1040,10 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- fsi_stream_init(fsi, io, substream);
- ret = fsi_stream_transfer(io);
- if (0 == ret)
-- fsi_port_start(fsi, io);
-+ fsi_stream_start(fsi, io);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
-- fsi_port_stop(fsi, io);
-+ fsi_stream_stop(fsi, io);
- fsi_stream_quit(fsi, io);
- break;
- }
-@@ -1436,7 +1443,7 @@ static void __fsi_suspend(struct fsi_priv *fsi,
- if (!fsi_stream_is_working(fsi, io))
- return;
-
-- fsi_port_stop(fsi, io);
-+ fsi_stream_stop(fsi, io);
- fsi_hw_shutdown(fsi, dev);
- }
-
-@@ -1452,7 +1459,7 @@ static void __fsi_resume(struct fsi_priv *fsi,
- if (fsi_is_clk_master(fsi) && fsi->rate)
- fsi_set_master_clk(dev, fsi, fsi->rate, 1);
-
-- fsi_port_start(fsi, io);
-+ fsi_stream_start(fsi, io);
- }
-
- static int fsi_suspend(struct device *dev)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0114-ASoC-fsi-fsi_stream_is_working-care-substream-runtim.patch b/patches.kzm9g/0114-ASoC-fsi-fsi_stream_is_working-care-substream-runtim.patch
deleted file mode 100644
index 8ee621e129fe06..00000000000000
--- a/patches.kzm9g/0114-ASoC-fsi-fsi_stream_is_working-care-substream-runtim.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From fefc4953a08d796f8e66ab7e388b589f7a564aaa Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:57:40 -0800
-Subject: ASoC: fsi: fsi_stream_is_working() care substream->runtime
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 97df81873e9c1391319dd818bc4b6856517e4939)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 8d05e59..1e10184 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -450,7 +450,7 @@ static int fsi_stream_is_working(struct fsi_priv *fsi,
- int ret;
-
- spin_lock_irqsave(&master->lock, flags);
-- ret = !!io->substream;
-+ ret = !!(io->substream && io->substream->runtime);
- spin_unlock_irqrestore(&master->lock, flags);
-
- return ret;
-@@ -756,9 +756,7 @@ static int fsi_pio_transfer(struct fsi_priv *fsi, struct fsi_stream *io,
- u8 *buf;
- int over_period;
-
-- if (!fsi ||
-- !io->substream ||
-- !io->substream->runtime)
-+ if (!fsi_stream_is_working(fsi, io))
- return -EINVAL;
-
- over_period = 0;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0115-ASoC-fsi-PortA-B-information-was-controlled-by-sh_fs.patch b/patches.kzm9g/0115-ASoC-fsi-PortA-B-information-was-controlled-by-sh_fs.patch
deleted file mode 100644
index c2e73b55c5f5c9..00000000000000
--- a/patches.kzm9g/0115-ASoC-fsi-PortA-B-information-was-controlled-by-sh_fs.patch
+++ /dev/null
@@ -1,285 +0,0 @@
-From f6427f8081fdd148aeefb37a02f1603584529935 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:58:48 -0800
-Subject: ASoC: fsi: PortA/B information was controlled by sh_fsi_port_info
-
-Current FSI got each PortA/B parameter by porta_flags/portb_flags from platform.
-And .set_rate function was shared for PortA/B.
-This structure was not readable and not flexible.
-This patch adds sh_fsi_port_info, and its own settings was added on each platform.
-it is preparation for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit fec691e73bf20e1c8e6ecd8e3725e4745bec4e21)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ap4evb.c | 30 +++++++++++-------------------
- arch/arm/mach-shmobile/board-mackerel.c | 18 ++++++++----------
- arch/sh/boards/mach-ecovec24/setup.c | 4 +++-
- arch/sh/boards/mach-se/7724/setup.c | 4 +++-
- include/sound/sh_fsi.h | 10 +++++++---
- sound/soc/sh/fsi.c | 32 ++++++++++++++++----------------
- 6 files changed, 48 insertions(+), 50 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 59f0d2c..e969a15 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -712,26 +712,18 @@ fsi_set_rate_end:
- return ret;
- }
-
--static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
--{
-- int ret;
--
-- if (is_porta)
-- ret = fsi_ak4642_set_rate(dev, rate, enable);
-- else
-- ret = fsi_hdmi_set_rate(dev, rate, enable);
--
-- return ret;
--}
--
- static struct sh_fsi_platform_info fsi_info = {
-- .porta_flags = SH_FSI_BRS_INV,
--
-- .portb_flags = SH_FSI_BRS_INV |
-- SH_FSI_BRM_INV |
-- SH_FSI_LRS_INV |
-- SH_FSI_FMT_SPDIF,
-- .set_rate = fsi_set_rate,
-+ .port_a = {
-+ .flags = SH_FSI_BRS_INV,
-+ .set_rate = fsi_ak4642_set_rate,
-+ },
-+ .port_b = {
-+ .flags = SH_FSI_BRS_INV |
-+ SH_FSI_BRM_INV |
-+ SH_FSI_LRS_INV |
-+ SH_FSI_FMT_SPDIF,
-+ .set_rate = fsi_hdmi_set_rate,
-+ },
- };
-
- static struct resource fsi_resources[] = {
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index c2faf11..9207a56 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -881,7 +881,7 @@ static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
- return clk_enable(clk);
- }
-
--static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
-+static int fsi_b_set_rate(struct device *dev, int rate, int enable)
- {
- struct clk *fsib_clk;
- struct clk *fdiv_clk = &sh7372_fsidivb_clk;
-@@ -890,10 +890,6 @@ static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
- int ackmd_bpfmd;
- int ret;
-
-- /* FSIA is slave mode. nothing to do here */
-- if (is_porta)
-- return 0;
--
- /* clock start */
- switch (rate) {
- case 44100:
-@@ -937,14 +933,16 @@ fsi_set_rate_end:
- }
-
- static struct sh_fsi_platform_info fsi_info = {
-- .porta_flags = SH_FSI_BRS_INV,
--
-- .portb_flags = SH_FSI_BRS_INV |
-+ .port_a = {
-+ .flags = SH_FSI_BRS_INV,
-+ },
-+ .port_b = {
-+ .flags = SH_FSI_BRS_INV |
- SH_FSI_BRM_INV |
- SH_FSI_LRS_INV |
- SH_FSI_FMT_SPDIF,
--
-- .set_rate = fsi_set_rate,
-+ .set_rate = fsi_b_set_rate,
-+ }
- };
-
- static struct resource fsi_resources[] = {
-diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
-index 15e3bfd..9c09829 100644
---- a/arch/sh/boards/mach-ecovec24/setup.c
-+++ b/arch/sh/boards/mach-ecovec24/setup.c
-@@ -790,7 +790,9 @@ static struct platform_device camera_devices[] = {
-
- /* FSI */
- static struct sh_fsi_platform_info fsi_info = {
-- .portb_flags = SH_FSI_BRS_INV,
-+ .port_b = {
-+ .flags = SH_FSI_BRS_INV,
-+ },
- };
-
- static struct resource fsi_resources[] = {
-diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
-index abc4d12..7c66a3d 100644
---- a/arch/sh/boards/mach-se/7724/setup.c
-+++ b/arch/sh/boards/mach-se/7724/setup.c
-@@ -285,7 +285,9 @@ static struct platform_device ceu1_device = {
- /* FSI */
- /* change J20, J21, J22 pin to 1-2 connection to use slave mode */
- static struct sh_fsi_platform_info fsi_info = {
-- .porta_flags = SH_FSI_BRS_INV,
-+ .port_a = {
-+ .flags = SH_FSI_BRS_INV,
-+ },
- };
-
- static struct resource fsi_resources[] = {
-diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
-index 9b1aaca..78cd77a 100644
---- a/include/sound/sh_fsi.h
-+++ b/include/sound/sh_fsi.h
-@@ -72,10 +72,14 @@
- #define SH_FSI_BPFMD_32 (5 << 4)
- #define SH_FSI_BPFMD_16 (6 << 4)
-
-+struct sh_fsi_port_info {
-+ unsigned long flags;
-+ int (*set_rate)(struct device *dev, int rate, int enable);
-+};
-+
- struct sh_fsi_platform_info {
-- unsigned long porta_flags;
-- unsigned long portb_flags;
-- int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
-+ struct sh_fsi_port_info port_a;
-+ struct sh_fsi_port_info port_b;
- };
-
- /*
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 1e10184..75d0cda 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -116,7 +116,7 @@
-
- #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
-
--typedef int (*set_rate_func)(struct device *dev, int is_porta, int rate, int enable);
-+typedef int (*set_rate_func)(struct device *dev, int rate, int enable);
-
- /*
- * FSI driver use below type name for variable
-@@ -185,6 +185,7 @@ struct fsi_stream {
- struct fsi_priv {
- void __iomem *base;
- struct fsi_master *master;
-+ struct sh_fsi_port_info *info;
-
- struct fsi_stream playback;
- struct fsi_stream capture;
-@@ -227,7 +228,6 @@ struct fsi_master {
- struct fsi_priv fsia;
- struct fsi_priv fsib;
- struct fsi_core *core;
-- struct sh_fsi_platform_info *info;
- spinlock_t lock;
- };
-
-@@ -346,24 +346,20 @@ static struct fsi_priv *fsi_get_priv(struct snd_pcm_substream *substream)
- return fsi_get_priv_frm_dai(fsi_get_dai(substream));
- }
-
--static set_rate_func fsi_get_info_set_rate(struct fsi_master *master)
-+static set_rate_func fsi_get_info_set_rate(struct fsi_priv *fsi)
- {
-- if (!master->info)
-+ if (!fsi->info)
- return NULL;
-
-- return master->info->set_rate;
-+ return fsi->info->set_rate;
- }
-
- static u32 fsi_get_info_flags(struct fsi_priv *fsi)
- {
-- int is_porta = fsi_is_port_a(fsi);
-- struct fsi_master *master = fsi_get_master(fsi);
--
-- if (!master->info)
-+ if (!fsi->info)
- return 0;
-
-- return is_porta ? master->info->porta_flags :
-- master->info->portb_flags;
-+ return fsi->info->flags;
- }
-
- static u32 fsi_get_port_shift(struct fsi_priv *fsi, struct fsi_stream *io)
-@@ -628,11 +624,14 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
- long rate, int enable)
- {
- struct fsi_master *master = fsi_get_master(fsi);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-+ set_rate_func set_rate = fsi_get_info_set_rate(fsi);
- int fsi_ver = master->core->ver;
- int ret;
-
-- ret = set_rate(dev, fsi_is_port_a(fsi), rate, enable);
-+ if (!set_rate)
-+ return 0;
-+
-+ ret = set_rate(dev, rate, enable);
- if (ret < 0) /* error */
- return ret;
-
-@@ -1093,8 +1092,7 @@ static int fsi_set_fmt_spdif(struct fsi_priv *fsi)
- static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
- {
- struct fsi_priv *fsi = fsi_get_priv_frm_dai(dai);
-- struct fsi_master *master = fsi_get_master(fsi);
-- set_rate_func set_rate = fsi_get_info_set_rate(master);
-+ set_rate_func set_rate = fsi_get_info_set_rate(fsi);
- u32 flags = fsi_get_info_flags(fsi);
- int ret;
-
-@@ -1312,6 +1310,7 @@ static int fsi_probe(struct platform_device *pdev)
- {
- struct fsi_master *master;
- const struct platform_device_id *id_entry;
-+ struct sh_fsi_platform_info *info = pdev->dev.platform_data;
- struct resource *res;
- unsigned int irq;
- int ret;
-@@ -1346,13 +1345,13 @@ static int fsi_probe(struct platform_device *pdev)
-
- /* master setting */
- master->irq = irq;
-- master->info = pdev->dev.platform_data;
- master->core = (struct fsi_core *)id_entry->driver_data;
- spin_lock_init(&master->lock);
-
- /* FSI A setting */
- master->fsia.base = master->base;
- master->fsia.master = master;
-+ master->fsia.info = &info->port_a;
- fsi_handler_init(&master->fsia);
- ret = fsi_stream_probe(&master->fsia);
- if (ret < 0) {
-@@ -1363,6 +1362,7 @@ static int fsi_probe(struct platform_device *pdev)
- /* FSI B setting */
- master->fsib.base = master->base + 0x40;
- master->fsib.master = master;
-+ master->fsib.info = &info->port_b;
- fsi_handler_init(&master->fsib);
- ret = fsi_stream_probe(&master->fsib);
- if (ret < 0) {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0116-ASoC-fsi-add-.init-.quit-handler-support.patch b/patches.kzm9g/0116-ASoC-fsi-add-.init-.quit-handler-support.patch
deleted file mode 100644
index c52a74dac8d60a..00000000000000
--- a/patches.kzm9g/0116-ASoC-fsi-add-.init-.quit-handler-support.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 9f742c8745ad3dc5d35f20f7960914021773b346 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:59:02 -0800
-Subject: ASoC: fsi: add .init/.quit handler support
-
-This is preparation for DMAEngine support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 83344027cacf1944fe180907fa98ee4116ef33ea)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 75d0cda..79a0afb 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -201,6 +201,8 @@ struct fsi_priv {
- };
-
- struct fsi_stream_handler {
-+ int (*init)(struct fsi_priv *fsi, struct fsi_stream *io);
-+ int (*quit)(struct fsi_priv *fsi, struct fsi_stream *io);
- int (*probe)(struct fsi_priv *fsi, struct fsi_stream *io);
- int (*transfer)(struct fsi_priv *fsi, struct fsi_stream *io);
- int (*remove)(struct fsi_priv *fsi, struct fsi_stream *io);
-@@ -474,6 +476,7 @@ static void fsi_stream_init(struct fsi_priv *fsi,
- io->sample_width = samples_to_bytes(runtime, 1);
- io->oerr_num = -1; /* ignore 1st err */
- io->uerr_num = -1; /* ignore 1st err */
-+ fsi_stream_handler_call(io, init, fsi, io);
- spin_unlock_irqrestore(&master->lock, flags);
- }
-
-@@ -491,6 +494,7 @@ static void fsi_stream_quit(struct fsi_priv *fsi, struct fsi_stream *io)
- if (io->uerr_num > 0)
- dev_err(dai->dev, "under_run = %d\n", io->uerr_num);
-
-+ fsi_stream_handler_call(io, quit, fsi, io);
- io->substream = NULL;
- io->buff_sample_capa = 0;
- io->buff_sample_pos = 0;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0117-ASoC-fsi-fixup-fsi_pointer-calculation-method.patch b/patches.kzm9g/0117-ASoC-fsi-fixup-fsi_pointer-calculation-method.patch
deleted file mode 100644
index 92bbecdf5f1aff..00000000000000
--- a/patches.kzm9g/0117-ASoC-fsi-fixup-fsi_pointer-calculation-method.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From a7a2edc574ad5ea06820d9c52a14a22981b8d6f0 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 8 Feb 2012 16:57:29 -0800
-Subject: ASoC: fsi: fixup fsi_pointer() calculation method
-
-current fsi_pointer() calculation was not correct for FSI driver.
-This patch fix it up.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 1987877d869027ab63dc9df515e11f19279a8091)
-
-Conflicts:
-
- sound/soc/sh/fsi.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 6 +-----
- 1 file changed, 1 insertion(+), 5 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 79a0afb..1374680 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1211,12 +1211,8 @@ static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
- {
- struct fsi_priv *fsi = fsi_get_priv(substream);
- struct fsi_stream *io = fsi_stream_get(fsi, substream);
-- int samples_pos = io->buff_sample_pos - 1;
-
-- if (samples_pos < 0)
-- samples_pos = 0;
--
-- return fsi_sample2frame(fsi, samples_pos);
-+ return fsi_sample2frame(fsi, io->buff_sample_pos);
- }
-
- static struct snd_pcm_ops fsi_pcm_ops = {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0118-ASoC-fsi-Add-DMAEngine-support.patch b/patches.kzm9g/0118-ASoC-fsi-Add-DMAEngine-support.patch
deleted file mode 100644
index b54ad8d37586df..00000000000000
--- a/patches.kzm9g/0118-ASoC-fsi-Add-DMAEngine-support.patch
+++ /dev/null
@@ -1,316 +0,0 @@
-From 815f3e601467b439fa67c58bc2386d7b148e89b7 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 3 Feb 2012 00:59:33 -0800
-Subject: ASoC: fsi: Add DMAEngine support
-
-This patch supports DMAEngine to FSI driver.
-It supports only Tx case at this point.
-If platform/cpu doesn't support DMAEngine, FSI driver will
-use PIO transfer.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 7da9ced6066c654a22836c24bae509ef323e10a8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/sh_fsi.h | 2 +
- sound/soc/sh/fsi.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 234 insertions(+)
-
-diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
-index 78cd77a..b457e87 100644
---- a/include/sound/sh_fsi.h
-+++ b/include/sound/sh_fsi.h
-@@ -74,6 +74,8 @@
-
- struct sh_fsi_port_info {
- unsigned long flags;
-+ int tx_id;
-+ int rx_id;
- int (*set_rate)(struct device *dev, int rate, int enable);
- };
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 1374680..378cc5b 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -13,8 +13,11 @@
- */
-
- #include <linux/delay.h>
-+#include <linux/dma-mapping.h>
- #include <linux/pm_runtime.h>
- #include <linux/io.h>
-+#include <linux/scatterlist.h>
-+#include <linux/sh_dma.h>
- #include <linux/slab.h>
- #include <linux/module.h>
- #include <sound/soc.h>
-@@ -53,6 +56,7 @@
-
- /* DO_FMT */
- /* DI_FMT */
-+#define CR_BWS_MASK (0x3 << 20) /* FSI2 */
- #define CR_BWS_24 (0x0 << 20) /* FSI2 */
- #define CR_BWS_16 (0x1 << 20) /* FSI2 */
- #define CR_BWS_20 (0x2 << 20) /* FSI2 */
-@@ -68,6 +72,15 @@
- #define CR_TDM (0x4 << 4)
- #define CR_TDM_D (0x5 << 4)
-
-+/* OUT_DMAC */
-+/* IN_DMAC */
-+#define VDMD_MASK (0x3 << 4)
-+#define VDMD_FRONT (0x0 << 4) /* Package in front */
-+#define VDMD_BACK (0x1 << 4) /* Package in back */
-+#define VDMD_STREAM (0x2 << 4) /* Stream mode(16bit * 2) */
-+
-+#define DMA_ON (0x1 << 0)
-+
- /* DOFF_CTL */
- /* DIFF_CTL */
- #define IRQ_HALF 0x00100000
-@@ -180,6 +193,14 @@ struct fsi_stream {
- */
- struct fsi_stream_handler *handler;
- struct fsi_priv *priv;
-+
-+ /*
-+ * these are for DMAEngine
-+ */
-+ struct dma_chan *chan;
-+ struct sh_dmae_slave slave; /* see fsi_handler_init() */
-+ struct tasklet_struct tasklet;
-+ dma_addr_t dma;
- };
-
- struct fsi_priv {
-@@ -889,6 +910,212 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
- }
-
- /*
-+ * dma data transfer handler
-+ */
-+static int fsi_dma_init(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ struct snd_pcm_runtime *runtime = io->substream->runtime;
-+ struct snd_soc_dai *dai = fsi_get_dai(io->substream);
-+ enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
-+ DMA_TO_DEVICE : DMA_FROM_DEVICE;
-+
-+ io->dma = dma_map_single(dai->dev, runtime->dma_area,
-+ snd_pcm_lib_buffer_bytes(io->substream), dir);
-+ return 0;
-+}
-+
-+static int fsi_dma_quit(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ struct snd_soc_dai *dai = fsi_get_dai(io->substream);
-+ enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
-+ DMA_TO_DEVICE : DMA_FROM_DEVICE;
-+
-+ dma_unmap_single(dai->dev, io->dma,
-+ snd_pcm_lib_buffer_bytes(io->substream), dir);
-+ return 0;
-+}
-+
-+static void fsi_dma_complete(void *data)
-+{
-+ struct fsi_stream *io = (struct fsi_stream *)data;
-+ struct fsi_priv *fsi = fsi_stream_to_priv(io);
-+ struct snd_pcm_runtime *runtime = io->substream->runtime;
-+ struct snd_soc_dai *dai = fsi_get_dai(io->substream);
-+ enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
-+ DMA_TO_DEVICE : DMA_FROM_DEVICE;
-+
-+ dma_sync_single_for_cpu(dai->dev, io->dma,
-+ samples_to_bytes(runtime, io->period_samples), dir);
-+
-+ io->buff_sample_pos += io->period_samples;
-+ io->period_pos++;
-+
-+ if (io->period_pos >= runtime->periods) {
-+ io->period_pos = 0;
-+ io->buff_sample_pos = 0;
-+ }
-+
-+ fsi_count_fifo_err(fsi);
-+ fsi_stream_transfer(io);
-+
-+ snd_pcm_period_elapsed(io->substream);
-+}
-+
-+static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
-+{
-+ struct snd_pcm_runtime *runtime = io->substream->runtime;
-+
-+ return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
-+}
-+
-+static void fsi_dma_do_tasklet(unsigned long data)
-+{
-+ struct fsi_stream *io = (struct fsi_stream *)data;
-+ struct fsi_priv *fsi = fsi_stream_to_priv(io);
-+ struct dma_chan *chan;
-+ struct snd_soc_dai *dai;
-+ struct dma_async_tx_descriptor *desc;
-+ struct scatterlist sg;
-+ struct snd_pcm_runtime *runtime;
-+ enum dma_data_direction dir;
-+ dma_cookie_t cookie;
-+ int is_play = fsi_stream_is_play(fsi, io);
-+ int len;
-+ dma_addr_t buf;
-+
-+ if (!fsi_stream_is_working(fsi, io))
-+ return;
-+
-+ dai = fsi_get_dai(io->substream);
-+ chan = io->chan;
-+ runtime = io->substream->runtime;
-+ dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
-+ len = samples_to_bytes(runtime, io->period_samples);
-+ buf = fsi_dma_get_area(io);
-+
-+ dma_sync_single_for_device(dai->dev, io->dma, len, dir);
-+
-+ sg_init_table(&sg, 1);
-+ sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
-+ len , offset_in_page(buf));
-+ sg_dma_address(&sg) = buf;
-+ sg_dma_len(&sg) = len;
-+
-+ desc = chan->device->device_prep_slave_sg(chan, &sg, 1, dir,
-+ DMA_PREP_INTERRUPT |
-+ DMA_CTRL_ACK);
-+ if (!desc) {
-+ dev_err(dai->dev, "device_prep_slave_sg() fail\n");
-+ return;
-+ }
-+
-+ desc->callback = fsi_dma_complete;
-+ desc->callback_param = io;
-+
-+ cookie = desc->tx_submit(desc);
-+ if (cookie < 0) {
-+ dev_err(dai->dev, "tx_submit() fail\n");
-+ return;
-+ }
-+
-+ dma_async_issue_pending(chan);
-+
-+ /*
-+ * FIXME
-+ *
-+ * In DMAEngine case, codec and FSI cannot be started simultaneously
-+ * since FSI is using tasklet.
-+ * Therefore, in capture case, probably FSI FIFO will have got
-+ * overflow error in this point.
-+ * in that case, DMA cannot start transfer until error was cleared.
-+ */
-+ if (!is_play) {
-+ if (ERR_OVER & fsi_reg_read(fsi, DIFF_ST)) {
-+ fsi_reg_mask_set(fsi, DIFF_CTL, FIFO_CLR, FIFO_CLR);
-+ fsi_reg_write(fsi, DIFF_ST, 0);
-+ }
-+ }
-+}
-+
-+static bool fsi_dma_filter(struct dma_chan *chan, void *param)
-+{
-+ struct sh_dmae_slave *slave = param;
-+
-+ chan->private = slave;
-+
-+ return true;
-+}
-+
-+static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ tasklet_schedule(&io->tasklet);
-+
-+ return 0;
-+}
-+
-+static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
-+ int start)
-+{
-+ u32 bws;
-+ u32 dma;
-+
-+ switch (io->sample_width * start) {
-+ case 2:
-+ bws = CR_BWS_16;
-+ dma = VDMD_STREAM | DMA_ON;
-+ break;
-+ case 4:
-+ bws = CR_BWS_24;
-+ dma = VDMD_BACK | DMA_ON;
-+ break;
-+ default:
-+ bws = 0;
-+ dma = 0;
-+ }
-+
-+ fsi_reg_mask_set(fsi, DO_FMT, CR_BWS_MASK, bws);
-+ fsi_reg_write(fsi, OUT_DMAC, dma);
-+}
-+
-+static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ dma_cap_mask_t mask;
-+
-+ dma_cap_zero(mask);
-+ dma_cap_set(DMA_SLAVE, mask);
-+
-+ io->chan = dma_request_channel(mask, fsi_dma_filter, &io->slave);
-+ if (!io->chan)
-+ return -EIO;
-+
-+ tasklet_init(&io->tasklet, fsi_dma_do_tasklet, (unsigned long)io);
-+
-+ return 0;
-+}
-+
-+static int fsi_dma_remove(struct fsi_priv *fsi, struct fsi_stream *io)
-+{
-+ tasklet_kill(&io->tasklet);
-+
-+ fsi_stream_stop(fsi, io);
-+
-+ if (io->chan)
-+ dma_release_channel(io->chan);
-+
-+ io->chan = NULL;
-+ return 0;
-+}
-+
-+static struct fsi_stream_handler fsi_dma_push_handler = {
-+ .init = fsi_dma_init,
-+ .quit = fsi_dma_quit,
-+ .probe = fsi_dma_probe,
-+ .transfer = fsi_dma_transfer,
-+ .remove = fsi_dma_remove,
-+ .start_stop = fsi_dma_push_start_stop,
-+};
-+
-+/*
- * dai ops
- */
- static void fsi_fifo_init(struct fsi_priv *fsi,
-@@ -1304,6 +1531,11 @@ static void fsi_handler_init(struct fsi_priv *fsi)
- fsi->playback.priv = fsi;
- fsi->capture.handler = &fsi_pio_pop_handler; /* default PIO */
- fsi->capture.priv = fsi;
-+
-+ if (fsi->info->tx_id) {
-+ fsi->playback.slave.slave_id = fsi->info->tx_id;
-+ fsi->playback.handler = &fsi_dma_push_handler;
-+ }
- }
-
- static int fsi_probe(struct platform_device *pdev)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0119-ASoC-fsi-update-for-dmaengine-prep_slave_sg-fallout.patch b/patches.kzm9g/0119-ASoC-fsi-update-for-dmaengine-prep_slave_sg-fallout.patch
deleted file mode 100644
index 993e4a8926debb..00000000000000
--- a/patches.kzm9g/0119-ASoC-fsi-update-for-dmaengine-prep_slave_sg-fallout.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From d6964a7fc8d9cfbc0257030e420ed6dddc4f9a87 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Tue, 17 Apr 2012 19:13:04 -0700
-Subject: ASoC: fsi: update for dmaengine prep_slave_sg fallout.
-
-Leading up to the ->device_prep_slave_sg change in
-185ecb5f4fd43911c35956d4cc7d94a1da30417f 'dmaengine: add context
-parameter to prep_slave_sg and prep_dma_cyclic' a generic wrapper was
-added in place to guard against the API change, though the fsi driver
-wasn't updated in the process (presumably its dmaengine support hadn't
-been merged yet at the time). This trivially switches over to the new
-wrapper and gets it building again.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit cdf27f373781d8740b874b0b5c18142df32ebb52)
-
-N.B: This is not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/fsi.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
-index 378cc5b..74ed2df 100644
---- a/sound/soc/sh/fsi.c
-+++ b/sound/soc/sh/fsi.c
-@@ -1001,11 +1001,10 @@ static void fsi_dma_do_tasklet(unsigned long data)
- sg_dma_address(&sg) = buf;
- sg_dma_len(&sg) = len;
-
-- desc = chan->device->device_prep_slave_sg(chan, &sg, 1, dir,
-- DMA_PREP_INTERRUPT |
-- DMA_CTRL_ACK);
-+ desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir,
-+ DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- if (!desc) {
-- dev_err(dai->dev, "device_prep_slave_sg() fail\n");
-+ dev_err(dai->dev, "dmaengine_prep_slave_sg() fail\n");
- return;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0120-ASoC-add-generic-simple-card-support.patch b/patches.kzm9g/0120-ASoC-add-generic-simple-card-support.patch
deleted file mode 100644
index 55e724c70d040d..00000000000000
--- a/patches.kzm9g/0120-ASoC-add-generic-simple-card-support.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-From 9e1c94e5b246c84b209c492495aee356c9c5a697 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 8 Apr 2012 21:17:50 -0700
-Subject: ASoC: add generic simple-card support
-
-Current ASoC requires card.c file to each platforms in order to
-specifies its CPU and Codecs pair.
-But the differences between these were only value/strings of setting.
-In order to reduce duplicate driver, this patch adds generic/simple-card.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit f2390880ec0264a0ed26b32c23bc23435b4297da)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/sound/simple_card.h | 38 ++++++++++++++
- sound/soc/Kconfig | 3 ++
- sound/soc/Makefile | 1 +
- sound/soc/generic/Kconfig | 4 ++
- sound/soc/generic/Makefile | 3 ++
- sound/soc/generic/simple-card.c | 114 ++++++++++++++++++++++++++++++++++++++++
- 6 files changed, 163 insertions(+)
- create mode 100644 include/sound/simple_card.h
- create mode 100644 sound/soc/generic/Kconfig
- create mode 100644 sound/soc/generic/Makefile
- create mode 100644 sound/soc/generic/simple-card.c
-
-diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
-new file mode 100644
-index 0000000..4b62b8d
---- /dev/null
-+++ b/include/sound/simple_card.h
-@@ -0,0 +1,38 @@
-+/*
-+ * ASoC simple sound card support
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#ifndef __SIMPLE_CARD_H
-+#define __SIMPLE_CARD_H
-+
-+#include <sound/soc.h>
-+
-+struct asoc_simple_dai_init_info {
-+ unsigned int fmt;
-+ unsigned int cpu_daifmt;
-+ unsigned int codec_daifmt;
-+ unsigned int sysclk;
-+};
-+
-+struct asoc_simple_card_info {
-+ const char *name;
-+ const char *card;
-+ const char *cpu_dai;
-+ const char *codec;
-+ const char *platform;
-+ const char *codec_dai;
-+ struct asoc_simple_dai_init_info *init; /* for snd_link.init */
-+
-+ /* used in simple-card.c */
-+ struct snd_soc_dai_link snd_link;
-+ struct snd_soc_card snd_card;
-+};
-+
-+#endif /* __SIMPLE_CARD_H */
-diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
-index 8224db5..73e4a6f 100644
---- a/sound/soc/Kconfig
-+++ b/sound/soc/Kconfig
-@@ -61,5 +61,8 @@ source "sound/soc/txx9/Kconfig"
- # Supported codecs
- source "sound/soc/codecs/Kconfig"
-
-+# generic frame-work
-+source "sound/soc/generic/Kconfig"
-+
- endif # SND_SOC
-
-diff --git a/sound/soc/Makefile b/sound/soc/Makefile
-index adb5719..bb3caf8 100644
---- a/sound/soc/Makefile
-+++ b/sound/soc/Makefile
-@@ -2,6 +2,7 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o so
-
- obj-$(CONFIG_SND_SOC) += snd-soc-core.o
- obj-$(CONFIG_SND_SOC) += codecs/
-+obj-$(CONFIG_SND_SOC) += generic/
- obj-$(CONFIG_SND_SOC) += atmel/
- obj-$(CONFIG_SND_SOC) += au1x/
- obj-$(CONFIG_SND_SOC) += blackfin/
-diff --git a/sound/soc/generic/Kconfig b/sound/soc/generic/Kconfig
-new file mode 100644
-index 0000000..610f612
---- /dev/null
-+++ b/sound/soc/generic/Kconfig
-@@ -0,0 +1,4 @@
-+config SND_SIMPLE_CARD
-+ tristate "ASoC Simple sound card support"
-+ help
-+ This option enables generic simple sound card support
-diff --git a/sound/soc/generic/Makefile b/sound/soc/generic/Makefile
-new file mode 100644
-index 0000000..9c3b246
---- /dev/null
-+++ b/sound/soc/generic/Makefile
-@@ -0,0 +1,3 @@
-+snd-soc-simple-card-objs := simple-card.o
-+
-+obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o
-diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
-new file mode 100644
-index 0000000..b4b4cab
---- /dev/null
-+++ b/sound/soc/generic/simple-card.c
-@@ -0,0 +1,114 @@
-+/*
-+ * ASoC simple sound card support
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/platform_device.h>
-+#include <linux/module.h>
-+#include <sound/simple_card.h>
-+
-+#define asoc_simple_get_card_info(p) \
-+ container_of(p->dai_link, struct asoc_simple_card_info, snd_link)
-+
-+static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
-+{
-+ struct asoc_simple_card_info *cinfo = asoc_simple_get_card_info(rtd);
-+ struct asoc_simple_dai_init_info *iinfo = cinfo->init;
-+ struct snd_soc_dai *codec = rtd->codec_dai;
-+ struct snd_soc_dai *cpu = rtd->cpu_dai;
-+ unsigned int cpu_daifmt = iinfo->fmt | iinfo->cpu_daifmt;
-+ unsigned int codec_daifmt = iinfo->fmt | iinfo->codec_daifmt;
-+ int ret;
-+
-+ if (codec_daifmt) {
-+ ret = snd_soc_dai_set_fmt(codec, codec_daifmt);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ if (iinfo->sysclk) {
-+ ret = snd_soc_dai_set_sysclk(codec, 0, iinfo->sysclk, 0);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ if (cpu_daifmt) {
-+ ret = snd_soc_dai_set_fmt(cpu, cpu_daifmt);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ return 0;
-+}
-+
-+static int asoc_simple_card_probe(struct platform_device *pdev)
-+{
-+ struct asoc_simple_card_info *cinfo = pdev->dev.platform_data;
-+
-+ if (!cinfo) {
-+ dev_err(&pdev->dev, "no info for asoc-simple-card\n");
-+ return -EINVAL;
-+ }
-+
-+ if (!cinfo->name ||
-+ !cinfo->card ||
-+ !cinfo->cpu_dai ||
-+ !cinfo->codec ||
-+ !cinfo->platform ||
-+ !cinfo->codec_dai) {
-+ dev_err(&pdev->dev, "insufficient asoc_simple_card_info settings\n");
-+ return -EINVAL;
-+ }
-+
-+ /*
-+ * init snd_soc_dai_link
-+ */
-+ cinfo->snd_link.name = cinfo->name;
-+ cinfo->snd_link.stream_name = cinfo->name;
-+ cinfo->snd_link.cpu_dai_name = cinfo->cpu_dai;
-+ cinfo->snd_link.platform_name = cinfo->platform;
-+ cinfo->snd_link.codec_name = cinfo->codec;
-+ cinfo->snd_link.codec_dai_name = cinfo->codec_dai;
-+
-+ /* enable snd_link.init if cinfo has settings */
-+ if (cinfo->init)
-+ cinfo->snd_link.init = asoc_simple_card_dai_init;
-+
-+ /*
-+ * init snd_soc_card
-+ */
-+ cinfo->snd_card.name = cinfo->card;
-+ cinfo->snd_card.owner = THIS_MODULE;
-+ cinfo->snd_card.dai_link = &cinfo->snd_link;
-+ cinfo->snd_card.num_links = 1;
-+ cinfo->snd_card.dev = &pdev->dev;
-+
-+ return snd_soc_register_card(&cinfo->snd_card);
-+}
-+
-+static int asoc_simple_card_remove(struct platform_device *pdev)
-+{
-+ struct asoc_simple_card_info *cinfo = pdev->dev.platform_data;
-+
-+ return snd_soc_unregister_card(&cinfo->snd_card);
-+}
-+
-+static struct platform_driver asoc_simple_card = {
-+ .driver = {
-+ .name = "asoc-simple-card",
-+ },
-+ .probe = asoc_simple_card_probe,
-+ .remove = asoc_simple_card_remove,
-+};
-+
-+module_platform_driver(asoc_simple_card);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_DESCRIPTION("ASoC Simple Sound Card");
-+MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0121-ASoC-sh-fsi-select-simple-card-on-Kconfig.patch b/patches.kzm9g/0121-ASoC-sh-fsi-select-simple-card-on-Kconfig.patch
deleted file mode 100644
index 5c478bb8f2f33f..00000000000000
--- a/patches.kzm9g/0121-ASoC-sh-fsi-select-simple-card-on-Kconfig.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 466e94a3b185d97436c0ad54eac135d4127f2c61 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 8 Apr 2012 21:20:08 -0700
-Subject: ASoC: sh: fsi: select simple-card on Kconfig
-
-Current SuperH FSI require simple-card driver as sound card.
-This patch select it on Kconfig when FSI was selected.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit cd04461e2f491c81d30fb3b234cf43db3f098103)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/sh/Kconfig | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig
-index d8e06a6..fb8abc1 100644
---- a/sound/soc/sh/Kconfig
-+++ b/sound/soc/sh/Kconfig
-@@ -22,6 +22,7 @@ config SND_SOC_SH4_SSI
-
- config SND_SOC_SH4_FSI
- tristate "SH4 FSI support"
-+ select SND_SIMPLE_CARD
- help
- This option enables FSI sound support
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0122-ASoC-ak4642-convert-to-soc-cache.patch b/patches.kzm9g/0122-ASoC-ak4642-convert-to-soc-cache.patch
deleted file mode 100644
index 8af07324da4b95..00000000000000
--- a/patches.kzm9g/0122-ASoC-ak4642-convert-to-soc-cache.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 7e7b8eea233be75675adf28e0b77f8925cd3f294 Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Tue, 11 Oct 2011 20:20:53 +0800
-Subject: ASoC: ak4642: convert to soc-cache
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit b91470bb374ed7db0448696ec85a3ed4785da2ee)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 82 +++++++----------------------------------------
- 1 file changed, 12 insertions(+), 70 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 7d45197..30c8e2c 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -156,7 +156,6 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
- struct ak4642_priv {
- unsigned int sysclk;
- enum snd_soc_control_type control_type;
-- void *control_data;
- };
-
- /*
-@@ -175,64 +174,6 @@ static const u8 ak4642_reg[AK4642_CACHEREGNUM] = {
- 0x00,
- };
-
--/*
-- * read ak4642 register cache
-- */
--static inline unsigned int ak4642_read_reg_cache(struct snd_soc_codec *codec,
-- unsigned int reg)
--{
-- u16 *cache = codec->reg_cache;
-- if (reg >= AK4642_CACHEREGNUM)
-- return -1;
-- return cache[reg];
--}
--
--/*
-- * write ak4642 register cache
-- */
--static inline void ak4642_write_reg_cache(struct snd_soc_codec *codec,
-- u16 reg, unsigned int value)
--{
-- u16 *cache = codec->reg_cache;
-- if (reg >= AK4642_CACHEREGNUM)
-- return;
--
-- cache[reg] = value;
--}
--
--/*
-- * write to the AK4642 register space
-- */
--static int ak4642_write(struct snd_soc_codec *codec, unsigned int reg,
-- unsigned int value)
--{
-- u8 data[2];
--
-- /* data is
-- * D15..D8 AK4642 register offset
-- * D7...D0 register data
-- */
-- data[0] = reg & 0xff;
-- data[1] = value & 0xff;
--
-- if (codec->hw_write(codec->control_data, data, 2) == 2) {
-- ak4642_write_reg_cache(codec, reg, value);
-- return 0;
-- } else
-- return -EIO;
--}
--
--static int ak4642_sync(struct snd_soc_codec *codec)
--{
-- u16 *cache = codec->reg_cache;
-- int i, r = 0;
--
-- for (i = 0; i < AK4642_CACHEREGNUM; i++)
-- r |= ak4642_write(codec, i, cache[i]);
--
-- return r;
--};
--
- static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
-@@ -252,8 +193,8 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- */
- snd_soc_update_bits(codec, MD_CTL4, DACH, DACH);
- snd_soc_update_bits(codec, MD_CTL3, BST1, BST1);
-- ak4642_write(codec, L_IVC, 0x91); /* volume */
-- ak4642_write(codec, R_IVC, 0x91); /* volume */
-+ snd_soc_write(codec, L_IVC, 0x91); /* volume */
-+ snd_soc_write(codec, R_IVC, 0x91); /* volume */
- snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMMIN | PMDAC,
- PMVCM | PMMIN | PMDAC);
- snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, PMHP);
-@@ -272,9 +213,9 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- * This operation came from example code of
- * "ASAHI KASEI AK4642" (japanese) manual p94.
- */
-- ak4642_write(codec, SG_SL1, PMMP | MGAIN0);
-- ak4642_write(codec, TIMER, ZTM(0x3) | WTM(0x3));
-- ak4642_write(codec, ALC_CTL1, ALC | LMTH0);
-+ snd_soc_write(codec, SG_SL1, PMMP | MGAIN0);
-+ snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3));
-+ snd_soc_write(codec, ALC_CTL1, ALC | LMTH0);
- snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMADL,
- PMVCM | PMADL);
- snd_soc_update_bits(codec, PW_MGMT3, PMADR, PMADR);
-@@ -462,7 +403,7 @@ static struct snd_soc_dai_driver ak4642_dai = {
-
- static int ak4642_resume(struct snd_soc_codec *codec)
- {
-- ak4642_sync(codec);
-+ snd_soc_cache_sync(codec);
- return 0;
- }
-
-@@ -470,11 +411,15 @@ static int ak4642_resume(struct snd_soc_codec *codec)
- static int ak4642_probe(struct snd_soc_codec *codec)
- {
- struct ak4642_priv *ak4642 = snd_soc_codec_get_drvdata(codec);
-+ int ret;
-
- dev_info(codec->dev, "AK4642 Audio Codec %s", AK4642_VERSION);
-
-- codec->hw_write = (hw_write_t)i2c_master_send;
-- codec->control_data = ak4642->control_data;
-+ ret = snd_soc_codec_set_cache_io(codec, 8, 8, ak4642->control_type);
-+ if (ret < 0) {
-+ dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
-+ return ret;
-+ }
-
- snd_soc_add_controls(codec, ak4642_snd_controls,
- ARRAY_SIZE(ak4642_snd_controls));
-@@ -485,8 +430,6 @@ static int ak4642_probe(struct snd_soc_codec *codec)
- static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
- .probe = ak4642_probe,
- .resume = ak4642_resume,
-- .read = ak4642_read_reg_cache,
-- .write = ak4642_write,
- .reg_cache_size = ARRAY_SIZE(ak4642_reg),
- .reg_word_size = sizeof(u8),
- .reg_cache_default = ak4642_reg,
-@@ -504,7 +447,6 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c,
- return -ENOMEM;
-
- i2c_set_clientdata(i2c, ak4642);
-- ak4642->control_data = i2c;
- ak4642->control_type = SND_SOC_I2C;
-
- ret = snd_soc_register_codec(&i2c->dev,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0123-ASoC-ak4642-ak4642-was-tested.patch b/patches.kzm9g/0123-ASoC-ak4642-ak4642-was-tested.patch
deleted file mode 100644
index d2b3c3629faf05..00000000000000
--- a/patches.kzm9g/0123-ASoC-ak4642-ak4642-was-tested.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 10f6b67d626f47c3a8e2ff83181f8ca85f8c39b9 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 6 Nov 2011 22:04:53 -0800
-Subject: ASoC: ak4642: ak4642 was tested
-
-ak4642 was tested by ms7724se board
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 202113912ba117b5c5f36e45529921b4cca4be6a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 30c8e2c..96f6e2f 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -18,7 +18,7 @@
- * This is very simple driver.
- * It can use headphone output / stereo input only
- *
-- * AK4642 is not tested.
-+ * AK4642 is tested.
- * AK4643 is tested.
- */
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0124-ASoC-ak4642-add-ak4642_set_bias_level.patch b/patches.kzm9g/0124-ASoC-ak4642-add-ak4642_set_bias_level.patch
deleted file mode 100644
index 734a854e68588f..00000000000000
--- a/patches.kzm9g/0124-ASoC-ak4642-add-ak4642_set_bias_level.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 9c25a0a4023775793af9678041183eb80b268ac5 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 16:21:01 -0800
-Subject: ASoC: ak4642: add ak4642_set_bias_level()
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit ed2dd7da35cad3115c38fd42eecbecae899a1d7a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 33 +++++++++++++++++++++++++++++----
- 1 file changed, 29 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 96f6e2f..8946580 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -195,8 +195,8 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- snd_soc_update_bits(codec, MD_CTL3, BST1, BST1);
- snd_soc_write(codec, L_IVC, 0x91); /* volume */
- snd_soc_write(codec, R_IVC, 0x91); /* volume */
-- snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMMIN | PMDAC,
-- PMVCM | PMMIN | PMDAC);
-+ snd_soc_update_bits(codec, PW_MGMT1, PMMIN | PMDAC,
-+ PMMIN | PMDAC);
- snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, PMHP);
- snd_soc_update_bits(codec, PW_MGMT2, HPMTN, HPMTN);
- } else {
-@@ -216,8 +216,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- snd_soc_write(codec, SG_SL1, PMMP | MGAIN0);
- snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3));
- snd_soc_write(codec, ALC_CTL1, ALC | LMTH0);
-- snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMADL,
-- PMVCM | PMADL);
-+ snd_soc_update_bits(codec, PW_MGMT1, PMADL, PMADL);
- snd_soc_update_bits(codec, PW_MGMT3, PMADR, PMADR);
- }
-
-@@ -375,6 +374,22 @@ static int ak4642_dai_hw_params(struct snd_pcm_substream *substream,
- return 0;
- }
-
-+static int ak4642_set_bias_level(struct snd_soc_codec *codec,
-+ enum snd_soc_bias_level level)
-+{
-+ switch (level) {
-+ case SND_SOC_BIAS_OFF:
-+ snd_soc_write(codec, PW_MGMT1, 0x00);
-+ break;
-+ default:
-+ snd_soc_update_bits(codec, PW_MGMT1, PMVCM, PMVCM);
-+ break;
-+ }
-+ codec->dapm.bias_level = level;
-+
-+ return 0;
-+}
-+
- static struct snd_soc_dai_ops ak4642_dai_ops = {
- .startup = ak4642_dai_startup,
- .shutdown = ak4642_dai_shutdown,
-@@ -424,12 +439,22 @@ static int ak4642_probe(struct snd_soc_codec *codec)
- snd_soc_add_controls(codec, ak4642_snd_controls,
- ARRAY_SIZE(ak4642_snd_controls));
-
-+ ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-+
-+ return 0;
-+}
-+
-+static int ak4642_remove(struct snd_soc_codec *codec)
-+{
-+ ak4642_set_bias_level(codec, SND_SOC_BIAS_OFF);
- return 0;
- }
-
- static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
- .probe = ak4642_probe,
-+ .remove = ak4642_remove,
- .resume = ak4642_resume,
-+ .set_bias_level = ak4642_set_bias_level,
- .reg_cache_size = ARRAY_SIZE(ak4642_reg),
- .reg_word_size = sizeof(u8),
- .reg_cache_default = ak4642_reg,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0125-ASoC-ak4642-add-DAPM-support-for-HeadPhone-Output.patch b/patches.kzm9g/0125-ASoC-ak4642-add-DAPM-support-for-HeadPhone-Output.patch
deleted file mode 100644
index 821fa3dc100ae5..00000000000000
--- a/patches.kzm9g/0125-ASoC-ak4642-add-DAPM-support-for-HeadPhone-Output.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 846a99689a9e20740e47fa868766f9bc56afd969 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 16:21:31 -0800
-Subject: ASoC: ak4642: add DAPM support for HeadPhone Output
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 24747daea5610676fd1e2c2ca603c8822a085c87)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 44 +++++++++++++++++++++++++++++++++++---------
- 1 file changed, 35 insertions(+), 9 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 8946580..dd0c835 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -151,6 +151,37 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
- 0, 0xFF, 1, out_tlv),
- };
-
-+static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = {
-+ SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0),
-+};
-+
-+static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
-+
-+ /* Outputs */
-+ SND_SOC_DAPM_OUTPUT("HPOUTL"),
-+ SND_SOC_DAPM_OUTPUT("HPOUTR"),
-+
-+ SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0,
-+ &ak4642_hpout_mixer_controls[0],
-+ ARRAY_SIZE(ak4642_hpout_mixer_controls)),
-+
-+ SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0,
-+ &ak4642_hpout_mixer_controls[0],
-+ ARRAY_SIZE(ak4642_hpout_mixer_controls)),
-+
-+ /* DAC */
-+ SND_SOC_DAPM_DAC("DAC", "HiFi Playback", PW_MGMT1, 2, 0),
-+};
-+
-+static const struct snd_soc_dapm_route ak4642_intercon[] = {
-+
-+ /* Outputs */
-+ {"HPOUTL", NULL, "HPOUTL Mixer"},
-+ {"HPOUTR", NULL, "HPOUTR Mixer"},
-+
-+ {"HPOUTL Mixer", "DACH", "DAC"},
-+ {"HPOUTR Mixer", "DACH", "DAC"},
-+};
-
- /* codec private data */
- struct ak4642_priv {
-@@ -191,13 +222,8 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- * This operation came from example code of
- * "ASAHI KASEI AK4642" (japanese) manual p97.
- */
-- snd_soc_update_bits(codec, MD_CTL4, DACH, DACH);
-- snd_soc_update_bits(codec, MD_CTL3, BST1, BST1);
- snd_soc_write(codec, L_IVC, 0x91); /* volume */
- snd_soc_write(codec, R_IVC, 0x91); /* volume */
-- snd_soc_update_bits(codec, PW_MGMT1, PMMIN | PMDAC,
-- PMMIN | PMDAC);
-- snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, PMHP);
- snd_soc_update_bits(codec, PW_MGMT2, HPMTN, HPMTN);
- } else {
- /*
-@@ -232,10 +258,6 @@ static void ak4642_dai_shutdown(struct snd_pcm_substream *substream,
- if (is_play) {
- /* stop headphone output */
- snd_soc_update_bits(codec, PW_MGMT2, HPMTN, 0);
-- snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, 0);
-- snd_soc_update_bits(codec, PW_MGMT1, PMMIN | PMDAC, 0);
-- snd_soc_update_bits(codec, MD_CTL3, BST1, 0);
-- snd_soc_update_bits(codec, MD_CTL4, DACH, 0);
- } else {
- /* stop stereo input */
- snd_soc_update_bits(codec, PW_MGMT1, PMADL, 0);
-@@ -458,6 +480,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
- .reg_cache_size = ARRAY_SIZE(ak4642_reg),
- .reg_word_size = sizeof(u8),
- .reg_cache_default = ak4642_reg,
-+ .dapm_widgets = ak4642_dapm_widgets,
-+ .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets),
-+ .dapm_routes = ak4642_intercon,
-+ .num_dapm_routes = ARRAY_SIZE(ak4642_intercon),
- };
-
- #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0126-ASoC-ak4642-add-headphone-mute-switch-control.patch b/patches.kzm9g/0126-ASoC-ak4642-add-headphone-mute-switch-control.patch
deleted file mode 100644
index 9cb4990d757059..00000000000000
--- a/patches.kzm9g/0126-ASoC-ak4642-add-headphone-mute-switch-control.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From f77165fc08deee82107e20f35969d07a20340f94 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 16:21:42 -0800
-Subject: ASoC: ak4642: add headphone mute switch control
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 3c7035268c2c89942fe51a61833d1066b4a766eb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index dd0c835..f728181 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -149,6 +149,8 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
-
- SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
- 0, 0xFF, 1, out_tlv),
-+
-+ SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0),
- };
-
- static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = {
-@@ -224,7 +226,6 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- */
- snd_soc_write(codec, L_IVC, 0x91); /* volume */
- snd_soc_write(codec, R_IVC, 0x91); /* volume */
-- snd_soc_update_bits(codec, PW_MGMT2, HPMTN, HPMTN);
- } else {
- /*
- * start stereo input
-@@ -256,8 +257,6 @@ static void ak4642_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_codec *codec = dai->codec;
-
- if (is_play) {
-- /* stop headphone output */
-- snd_soc_update_bits(codec, PW_MGMT2, HPMTN, 0);
- } else {
- /* stop stereo input */
- snd_soc_update_bits(codec, PW_MGMT1, PMADL, 0);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0127-ASoC-ak4642-add-Line-out-support.patch b/patches.kzm9g/0127-ASoC-ak4642-add-Line-out-support.patch
deleted file mode 100644
index 7f11a0f54fa8b9..00000000000000
--- a/patches.kzm9g/0127-ASoC-ak4642-add-Line-out-support.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 5b5d2d5ef56e2faf823428eecd05c9fdc6d5945f Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 16:21:55 -0800
-Subject: ASoC: ak4642: add Line out support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit e8c83dbfb7fc0c3cec141112524906b029a1f413)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index f728181..0f2ee7f 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -157,11 +157,16 @@ static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = {
- SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0),
- };
-
-+static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = {
-+ SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0),
-+};
-+
- static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
-
- /* Outputs */
- SND_SOC_DAPM_OUTPUT("HPOUTL"),
- SND_SOC_DAPM_OUTPUT("HPOUTR"),
-+ SND_SOC_DAPM_OUTPUT("LINEOUT"),
-
- SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0,
- &ak4642_hpout_mixer_controls[0],
-@@ -171,6 +176,10 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
- &ak4642_hpout_mixer_controls[0],
- ARRAY_SIZE(ak4642_hpout_mixer_controls)),
-
-+ SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0,
-+ &ak4642_lout_mixer_controls[0],
-+ ARRAY_SIZE(ak4642_lout_mixer_controls)),
-+
- /* DAC */
- SND_SOC_DAPM_DAC("DAC", "HiFi Playback", PW_MGMT1, 2, 0),
- };
-@@ -180,9 +189,11 @@ static const struct snd_soc_dapm_route ak4642_intercon[] = {
- /* Outputs */
- {"HPOUTL", NULL, "HPOUTL Mixer"},
- {"HPOUTR", NULL, "HPOUTR Mixer"},
-+ {"LINEOUT", NULL, "LINEOUT Mixer"},
-
- {"HPOUTL Mixer", "DACH", "DAC"},
- {"HPOUTR Mixer", "DACH", "DAC"},
-+ {"LINEOUT Mixer", "DACL", "DAC"},
- };
-
- /* codec private data */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0128-ASoC-ak4642-add-ak4648-support.patch b/patches.kzm9g/0128-ASoC-ak4642-add-ak4648-support.patch
deleted file mode 100644
index 4a8bd0825771a8..00000000000000
--- a/patches.kzm9g/0128-ASoC-ak4642-add-ak4648-support.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 03977c4c632d21018c3b9bcc076c3b62aeb91579 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 16:22:05 -0800
-Subject: ASoC: ak4642: add ak4648 support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit a9317e8b6b53ab61d3ee764b6456596efd8c83b7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 44 ++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 36 insertions(+), 8 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 0f2ee7f..8a12db4 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -20,6 +20,7 @@
- *
- * AK4642 is tested.
- * AK4643 is tested.
-+ * AK4648 is tested.
- */
-
- #include <linux/delay.h>
-@@ -70,8 +71,6 @@
- #define HP_MS 0x23
- #define SPK_MS 0x24
-
--#define AK4642_CACHEREGNUM 0x25
--
- /* PW_MGMT1*/
- #define PMVCM (1 << 6) /* VCOM Power Management */
- #define PMMIN (1 << 5) /* MIN Input Power Management */
-@@ -205,7 +204,7 @@ struct ak4642_priv {
- /*
- * ak4642 register cache
- */
--static const u8 ak4642_reg[AK4642_CACHEREGNUM] = {
-+static const u8 ak4642_reg[] = {
- 0x00, 0x00, 0x01, 0x00,
- 0x02, 0x00, 0x00, 0x00,
- 0xe1, 0xe1, 0x18, 0x00,
-@@ -218,6 +217,19 @@ static const u8 ak4642_reg[AK4642_CACHEREGNUM] = {
- 0x00,
- };
-
-+static const u8 ak4648_reg[] = {
-+ 0x00, 0x00, 0x01, 0x00,
-+ 0x02, 0x00, 0x00, 0x00,
-+ 0xe1, 0xe1, 0x18, 0x00,
-+ 0xe1, 0x18, 0x11, 0xb8,
-+ 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x88, 0x88, 0x08,
-+};
-+
- static int ak4642_dai_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
- {
-@@ -487,9 +499,23 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
- .remove = ak4642_remove,
- .resume = ak4642_resume,
- .set_bias_level = ak4642_set_bias_level,
-- .reg_cache_size = ARRAY_SIZE(ak4642_reg),
-+ .reg_cache_default = ak4642_reg, /* ak4642 reg */
-+ .reg_cache_size = ARRAY_SIZE(ak4642_reg), /* ak4642 reg */
-+ .reg_word_size = sizeof(u8),
-+ .dapm_widgets = ak4642_dapm_widgets,
-+ .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets),
-+ .dapm_routes = ak4642_intercon,
-+ .num_dapm_routes = ARRAY_SIZE(ak4642_intercon),
-+};
-+
-+static struct snd_soc_codec_driver soc_codec_dev_ak4648 = {
-+ .probe = ak4642_probe,
-+ .remove = ak4642_remove,
-+ .resume = ak4642_resume,
-+ .set_bias_level = ak4642_set_bias_level,
-+ .reg_cache_default = ak4648_reg, /* ak4648 reg */
-+ .reg_cache_size = ARRAY_SIZE(ak4648_reg), /* ak4648 reg */
- .reg_word_size = sizeof(u8),
-- .reg_cache_default = ak4642_reg,
- .dapm_widgets = ak4642_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets),
- .dapm_routes = ak4642_intercon,
-@@ -511,7 +537,8 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c,
- ak4642->control_type = SND_SOC_I2C;
-
- ret = snd_soc_register_codec(&i2c->dev,
-- &soc_codec_dev_ak4642, &ak4642_dai, 1);
-+ (struct snd_soc_codec_driver *)id->driver_data,
-+ &ak4642_dai, 1);
- if (ret < 0)
- kfree(ak4642);
- return ret;
-@@ -525,8 +552,9 @@ static __devexit int ak4642_i2c_remove(struct i2c_client *client)
- }
-
- static const struct i2c_device_id ak4642_i2c_id[] = {
-- { "ak4642", 0 },
-- { "ak4643", 0 },
-+ { "ak4642", (kernel_ulong_t)&soc_codec_dev_ak4642 },
-+ { "ak4643", (kernel_ulong_t)&soc_codec_dev_ak4642 },
-+ { "ak4648", (kernel_ulong_t)&soc_codec_dev_ak4648 },
- { }
- };
- MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0129-ASoC-Remove-driver-versioning-from-ak4642.patch b/patches.kzm9g/0129-ASoC-Remove-driver-versioning-from-ak4642.patch
deleted file mode 100644
index 5b32a8991315bf..00000000000000
--- a/patches.kzm9g/0129-ASoC-Remove-driver-versioning-from-ak4642.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 5433d40ad2e432a05413d77baa7a3c0869fcc75c Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Sun, 27 Nov 2011 12:11:46 +0000
-Subject: ASoC: Remove driver versioning from ak4642
-
-It's never been updated so it can't be that useful and it makes the
-driver needlessly chatty.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 679acec1f240b433dc3879714655b6c6452385ea)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 8a12db4..a04eebf 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -31,8 +31,6 @@
- #include <sound/initval.h>
- #include <sound/tlv.h>
-
--#define AK4642_VERSION "0.0.1"
--
- #define PW_MGMT1 0x00
- #define PW_MGMT2 0x01
- #define SG_SL1 0x02
-@@ -472,8 +470,6 @@ static int ak4642_probe(struct snd_soc_codec *codec)
- struct ak4642_priv *ak4642 = snd_soc_codec_get_drvdata(codec);
- int ret;
-
-- dev_info(codec->dev, "AK4642 Audio Codec %s", AK4642_VERSION);
--
- ret = snd_soc_codec_set_cache_io(codec, 8, 8, ak4642->control_type);
- if (ret < 0) {
- dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0130-ASoC-Convert-ak4642-to-devm_kzalloc.patch b/patches.kzm9g/0130-ASoC-Convert-ak4642-to-devm_kzalloc.patch
deleted file mode 100644
index a9af28c5a85b10..00000000000000
--- a/patches.kzm9g/0130-ASoC-Convert-ak4642-to-devm_kzalloc.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From de89e5feef647f18b97650663538b91a7c11754c Mon Sep 17 00:00:00 2001
-From: Axel Lin <axel.lin@gmail.com>
-Date: Tue, 20 Dec 2011 14:40:12 +0800
-Subject: ASoC: Convert ak4642 to devm_kzalloc()
-
-Signed-off-by: Axel Lin <axel.lin@gmail.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 2ff49eea9b8a1d92c2ab09d803dfdc06f4f8e74b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index a04eebf..2cdcea2 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -525,7 +525,8 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c,
- struct ak4642_priv *ak4642;
- int ret;
-
-- ak4642 = kzalloc(sizeof(struct ak4642_priv), GFP_KERNEL);
-+ ak4642 = devm_kzalloc(&i2c->dev, sizeof(struct ak4642_priv),
-+ GFP_KERNEL);
- if (!ak4642)
- return -ENOMEM;
-
-@@ -535,15 +536,12 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c,
- ret = snd_soc_register_codec(&i2c->dev,
- (struct snd_soc_codec_driver *)id->driver_data,
- &ak4642_dai, 1);
-- if (ret < 0)
-- kfree(ak4642);
- return ret;
- }
-
- static __devexit int ak4642_i2c_remove(struct i2c_client *client)
- {
- snd_soc_unregister_codec(&client->dev);
-- kfree(i2c_get_clientdata(client));
- return 0;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0131-ASoC-ak4642-fixup-HeadPhone-L-R-dapm-settings.patch b/patches.kzm9g/0131-ASoC-ak4642-fixup-HeadPhone-L-R-dapm-settings.patch
deleted file mode 100644
index fb79827dfd5a65..00000000000000
--- a/patches.kzm9g/0131-ASoC-ak4642-fixup-HeadPhone-L-R-dapm-settings.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 74ca5f2a0fe5cb5938687814e9dbceb6e0da98fd Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 20 Feb 2012 20:14:16 -0800
-Subject: ASoC: ak4642: fixup HeadPhone L/R dapm settings
-
-Current ak4642 driver had wrong dapm settings for headphone L/R.
-If you select headphone L, and select R after that,
-headphone L setting was removed by R settings.
-
-This patch fixes it up.
-It provides just "Headphone Enable" to user side
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit e555cf363167f09efae96d32a363e24c4de16b7b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- sound/soc/codecs/ak4642.c | 31 ++++++++++++++++---------------
- 1 file changed, 16 insertions(+), 15 deletions(-)
-
-diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
-index 2cdcea2..6a9516ca 100644
---- a/sound/soc/codecs/ak4642.c
-+++ b/sound/soc/codecs/ak4642.c
-@@ -146,13 +146,10 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
-
- SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
- 0, 0xFF, 1, out_tlv),
--
-- SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0),
- };
-
--static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = {
-- SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0),
--};
-+static const struct snd_kcontrol_new ak4642_headphone_control =
-+ SOC_DAPM_SINGLE("Switch", PW_MGMT2, 6, 1, 0);
-
- static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = {
- SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0),
-@@ -165,13 +162,12 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
- SND_SOC_DAPM_OUTPUT("HPOUTR"),
- SND_SOC_DAPM_OUTPUT("LINEOUT"),
-
-- SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0,
-- &ak4642_hpout_mixer_controls[0],
-- ARRAY_SIZE(ak4642_hpout_mixer_controls)),
-+ SND_SOC_DAPM_PGA("HPL Out", PW_MGMT2, 5, 0, NULL, 0),
-+ SND_SOC_DAPM_PGA("HPR Out", PW_MGMT2, 4, 0, NULL, 0),
-+ SND_SOC_DAPM_SWITCH("Headphone Enable", SND_SOC_NOPM, 0, 0,
-+ &ak4642_headphone_control),
-
-- SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0,
-- &ak4642_hpout_mixer_controls[0],
-- ARRAY_SIZE(ak4642_hpout_mixer_controls)),
-+ SND_SOC_DAPM_PGA("DACH", MD_CTL4, 0, 0, NULL, 0),
-
- SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0,
- &ak4642_lout_mixer_controls[0],
-@@ -184,12 +180,17 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
- static const struct snd_soc_dapm_route ak4642_intercon[] = {
-
- /* Outputs */
-- {"HPOUTL", NULL, "HPOUTL Mixer"},
-- {"HPOUTR", NULL, "HPOUTR Mixer"},
-+ {"HPOUTL", NULL, "HPL Out"},
-+ {"HPOUTR", NULL, "HPR Out"},
- {"LINEOUT", NULL, "LINEOUT Mixer"},
-
-- {"HPOUTL Mixer", "DACH", "DAC"},
-- {"HPOUTR Mixer", "DACH", "DAC"},
-+ {"HPL Out", NULL, "Headphone Enable"},
-+ {"HPR Out", NULL, "Headphone Enable"},
-+
-+ {"Headphone Enable", "Switch", "DACH"},
-+
-+ {"DACH", NULL, "DAC"},
-+
- {"LINEOUT Mixer", "DACL", "DAC"},
- };
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0132-ARM-mach-shmobile-clock-r8a7740-add-SDHI-clock.patch b/patches.kzm9g/0132-ARM-mach-shmobile-clock-r8a7740-add-SDHI-clock.patch
deleted file mode 100644
index 6b9c9ad480c4c7..00000000000000
--- a/patches.kzm9g/0132-ARM-mach-shmobile-clock-r8a7740-add-SDHI-clock.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 08bfd254a0ea22a80db19e5b13cb6f7fa745ee5d Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:08:11 -0700
-Subject: ARM: mach-shmobile: clock-r8a7740: add SDHI clock
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 30535f4..5c6b548 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -356,8 +356,9 @@ enum {
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-
- MSTP329, MSTP323, MSTP320,
-+ MSTP314, MSTP313,
-
-- MSTP416, MSTP407, MSTP406,
-+ MSTP416, MSTP415, MSTP407, MSTP406,
-
- MSTP_NR
- };
-@@ -382,8 +383,11 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
- [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
- [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */
-+ [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
-+ [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
-
- [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */
-+ [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */
- [MSTP407] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-Func */
- [MSTP406] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 6, 0), /* USB Phy */
- };
-@@ -442,6 +446,10 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
- CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
- CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]),
-+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
-+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
-+
-+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]),
-
- /* ICK */
- CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0133-ARM-mach-shmobile-clock-r8a7740-add-MMCIF-clock.patch b/patches.kzm9g/0133-ARM-mach-shmobile-clock-r8a7740-add-MMCIF-clock.patch
deleted file mode 100644
index 1540498275ec9a..00000000000000
--- a/patches.kzm9g/0133-ARM-mach-shmobile-clock-r8a7740-add-MMCIF-clock.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 1e625ddaa54bdddc2e7c97a6776634b257512de4 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:08:29 -0700
-Subject: ARM: mach-shmobile: clock-r8a7740: add MMCIF clock
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 5c6b548..927d42a 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -356,7 +356,7 @@ enum {
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-
- MSTP329, MSTP323, MSTP320,
-- MSTP314, MSTP313,
-+ MSTP314, MSTP313, MSTP312,
-
- MSTP416, MSTP415, MSTP407, MSTP406,
-
-@@ -385,6 +385,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */
- [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
- [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
-+ [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */
-
- [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */
- [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */
-@@ -448,6 +449,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]),
- CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
- CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
-+ CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]),
-
- CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]),
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0134-ARM-mach-shmobile-r8a7740-reserve-DMA-memory-for-the.patch b/patches.kzm9g/0134-ARM-mach-shmobile-r8a7740-reserve-DMA-memory-for-the.patch
deleted file mode 100644
index 932f3f973a4284..00000000000000
--- a/patches.kzm9g/0134-ARM-mach-shmobile-r8a7740-reserve-DMA-memory-for-the.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From daaa13e4d7c9028792b6b51ef2e147993c6e9c91 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:10:05 -0700
-Subject: ARM: mach-shmobile: r8a7740: reserve DMA memory for the frame buffer
-
-The default 2MB size of DMA coherent memory isn't enough for allocate
-frame buffer memory.
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-r8a7740.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
-index 74e5234..5d92def 100644
---- a/arch/arm/mach-shmobile/setup-r8a7740.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
-@@ -18,6 +18,7 @@
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
- #include <linux/delay.h>
-+#include <linux/dma-mapping.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/io.h>
-@@ -59,6 +60,12 @@ static struct map_desc r8a7740_io_desc[] __initdata = {
- void __init r8a7740_map_io(void)
- {
- iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
-+
-+ /*
-+ * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
-+ * enough to allocate the frame buffer memory.
-+ */
-+ init_consistent_dma_size(12 << 20);
- }
-
- /* SCIFA0 */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0135-ARM-mach-shmobile-clock-r8a7740-add-FSI-clock.patch b/patches.kzm9g/0135-ARM-mach-shmobile-clock-r8a7740-add-FSI-clock.patch
deleted file mode 100644
index 4dd3b048f6d7a9..00000000000000
--- a/patches.kzm9g/0135-ARM-mach-shmobile-clock-r8a7740-add-FSI-clock.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From d46a82ccbc9c9caf9116bc62737f6ba9470012dc Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:20:41 -0700
-Subject: ARM: mach-shmobile: clock-r8a7740: add FSI clock
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-r8a7740.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
-index 927d42a..89a2f9d 100644
---- a/arch/arm/mach-shmobile/clock-r8a7740.c
-+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
-@@ -355,7 +355,7 @@ enum {
- MSTP222,
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-
-- MSTP329, MSTP323, MSTP320,
-+ MSTP329, MSTP328, MSTP323, MSTP320,
- MSTP314, MSTP313, MSTP312,
-
- MSTP416, MSTP415, MSTP407, MSTP406,
-@@ -381,6 +381,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP200] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
-
- [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
-+ [MSTP328] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /* FSI */
- [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
- [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */
- [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
-@@ -445,6 +446,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]),
-
- CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
-+ CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]),
- CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
- CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]),
- CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0136-ARM-mach-shmobile-armadillo800eva-add-SDHI0-support.patch b/patches.kzm9g/0136-ARM-mach-shmobile-armadillo800eva-add-SDHI0-support.patch
deleted file mode 100644
index fa5ba75066c6ed..00000000000000
--- a/patches.kzm9g/0136-ARM-mach-shmobile-armadillo800eva-add-SDHI0-support.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From f33fc2bf482665a0dc1d0fed1e0a180268235c11 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:09:19 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add SDHI0 support
-
-On armadillo800eva board,
-CD (= Card Detect) pin is not connected to SDHI0_CD.
-Then, we can use IRQ31 as card detect irq,
-but it needs chattering removal operation.
-We should use IRQ card detect in the future,
-but this patch use polling mode at this point.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-N.B: Not present upstream yet
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-armadillo800eva.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 71 ++++++++++++++++++++++++++
- 1 file changed, 71 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index c2affc4..fa5b541 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -28,6 +28,9 @@
- #include <linux/gpio_keys.h>
- #include <linux/sh_eth.h>
- #include <linux/videodev2.h>
-+#include <linux/mfd/tmio.h>
-+#include <linux/mmc/host.h>
-+#include <linux/mmc/sh_mobile_sdhi.h>
- #include <mach/common.h>
- #include <mach/irqs.h>
- #include <asm/page.h>
-@@ -184,6 +187,55 @@ static struct platform_device lcdc0_device = {
- },
- };
-
-+/* SDHI0 */
-+/*
-+ * FIXME
-+ *
-+ * It use polling mode here, since
-+ * CD (= Card Detect) pin is not connected to SDHI0_CD.
-+ * We can use IRQ31 as card detect irq,
-+ * but it needs chattering removal operation
-+ */
-+#define IRQ31 evt2irq(0x33E0)
-+static struct sh_mobile_sdhi_info sdhi0_info = {
-+ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
-+ MMC_CAP_NEEDS_POLL,
-+ .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-+ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
-+};
-+
-+static struct resource sdhi0_resources[] = {
-+ {
-+ .name = "SDHI0",
-+ .start = 0xe6850000,
-+ .end = 0xe6850100 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ /*
-+ * no SH_MOBILE_SDHI_IRQ_CARD_DETECT here
-+ */
-+ {
-+ .name = SH_MOBILE_SDHI_IRQ_SDCARD,
-+ .start = evt2irq(0x0E20),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ {
-+ .name = SH_MOBILE_SDHI_IRQ_SDIO,
-+ .start = evt2irq(0x0E40),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sdhi0_device = {
-+ .name = "sh_mobile_sdhi",
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &sdhi0_info,
-+ },
-+ .num_resources = ARRAY_SIZE(sdhi0_resources),
-+ .resource = sdhi0_resources,
-+};
-+
- /* I2C */
- static struct i2c_board_info i2c0_devices[] = {
- {
-@@ -222,6 +274,7 @@ static struct platform_device *eva_devices[] __initdata = {
- &lcdc0_device,
- &gpio_keys_device,
- &sh_eth_device,
-+ &sdhi0_device,
- };
-
- /*
-@@ -302,6 +355,24 @@ static void __init eva_init(void)
- gpio_request(GPIO_PORT18, NULL); /* PHY_RST */
- gpio_direction_output(GPIO_PORT18, 1);
-
-+ /* SDHI0 */
-+ gpio_request(GPIO_FN_SDHI0_CMD, NULL);
-+ gpio_request(GPIO_FN_SDHI0_CLK, NULL);
-+ gpio_request(GPIO_FN_SDHI0_D0, NULL);
-+ gpio_request(GPIO_FN_SDHI0_D1, NULL);
-+ gpio_request(GPIO_FN_SDHI0_D2, NULL);
-+ gpio_request(GPIO_FN_SDHI0_D3, NULL);
-+ gpio_request(GPIO_FN_SDHI0_WP, NULL);
-+
-+ gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */
-+ gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */
-+ gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */
-+ gpio_direction_output(GPIO_PORT17, 0);
-+ gpio_direction_output(GPIO_PORT74, 1);
-+ gpio_direction_output(GPIO_PORT75, 1);
-+
-+ /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
-+
- /*
- * CAUTION
- *
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0137-ARM-mach-shmobile-armadillo800eva-add-SDHI1-support.patch b/patches.kzm9g/0137-ARM-mach-shmobile-armadillo800eva-add-SDHI1-support.patch
deleted file mode 100644
index 95899dc599baa6..00000000000000
--- a/patches.kzm9g/0137-ARM-mach-shmobile-armadillo800eva-add-SDHI1-support.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 4c5dd88a2bfcca6a2bf0119f8a792e40e3280b22 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:09:31 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add SDHI1 support
-
-We can switch CON8/CON14 by SW1.5
-SDHI1 is CON8 (SW1.5 = ON)
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 66 +++++++++++++++++++++++++-
- 1 file changed, 65 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index fa5b541..2f4b7f9 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -90,7 +90,7 @@
- * 0 | Extension Bus | D8-D15 disable, eMMC enable
- * 1 | Extension Bus | D8-D15 enable, eMMC disable
- * -12345678-+---------------+----------------------------
-- * 0 | SDHI1 | COM8 enable, COM14 disable
-+ * 0 | SDHI1 | COM8 disable, COM14 enable
- * 1 | SDHI1 | COM8 enable, COM14 disable
- * -12345678-+---------------+----------------------------
- * 00 | JTAG | SH-X2
-@@ -236,6 +236,44 @@ static struct platform_device sdhi0_device = {
- .resource = sdhi0_resources,
- };
-
-+/* SDHI1 */
-+static struct sh_mobile_sdhi_info sdhi1_info = {
-+ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-+ .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-+ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
-+};
-+
-+static struct resource sdhi1_resources[] = {
-+ [0] = {
-+ .name = "SDHI1",
-+ .start = 0xe6860000,
-+ .end = 0xe6860100 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = evt2irq(0x0E80),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = evt2irq(0x0EA0),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = evt2irq(0x0EC0),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sdhi1_device = {
-+ .name = "sh_mobile_sdhi",
-+ .id = 1,
-+ .dev = {
-+ .platform_data = &sdhi1_info,
-+ },
-+ .num_resources = ARRAY_SIZE(sdhi1_resources),
-+ .resource = sdhi1_resources,
-+};
-+
- /* I2C */
- static struct i2c_board_info i2c0_devices[] = {
- {
-@@ -382,6 +420,32 @@ static void __init eva_init(void)
- gpio_request(GPIO_PORT176, NULL);
- gpio_direction_output(GPIO_PORT176, 1);
-
-+ /*
-+ * We can switch CON8/CON14 by SW1.5,
-+ * but it needs after DBGMD_SELECT_B
-+ */
-+ gpio_request(GPIO_PORT6, NULL);
-+ gpio_direction_input(GPIO_PORT6);
-+ if (gpio_get_value(GPIO_PORT6)) {
-+ /* CON14 enable */
-+ } else {
-+ /* CON8 (SDHI1) enable */
-+ gpio_request(GPIO_FN_SDHI1_CLK, NULL);
-+ gpio_request(GPIO_FN_SDHI1_CMD, NULL);
-+ gpio_request(GPIO_FN_SDHI1_D0, NULL);
-+ gpio_request(GPIO_FN_SDHI1_D1, NULL);
-+ gpio_request(GPIO_FN_SDHI1_D2, NULL);
-+ gpio_request(GPIO_FN_SDHI1_D3, NULL);
-+ gpio_request(GPIO_FN_SDHI1_CD, NULL);
-+ gpio_request(GPIO_FN_SDHI1_WP, NULL);
-+
-+ gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */
-+ gpio_direction_output(GPIO_PORT16, 1);
-+
-+ platform_device_register(&sdhi1_device);
-+ }
-+
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 32K*8way */
- l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0138-ARM-mach-shmobile-armadillo800eva-add-MMCIF-support.patch b/patches.kzm9g/0138-ARM-mach-shmobile-armadillo800eva-add-MMCIF-support.patch
deleted file mode 100644
index 90e1fde9b80810..00000000000000
--- a/patches.kzm9g/0138-ARM-mach-shmobile-armadillo800eva-add-MMCIF-support.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 31b40a107a29865822e41b242ffc8eb75f7faf08 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:09:42 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: add MMCIF support
-
-N.B: Not present upstream yet
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-armadillo800eva.c | 57 ++++++++++++++++++++++++++
- 1 file changed, 57 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index 2f4b7f9..eb97618 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -30,6 +30,7 @@
- #include <linux/videodev2.h>
- #include <linux/mfd/tmio.h>
- #include <linux/mmc/host.h>
-+#include <linux/mmc/sh_mmcif.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
- #include <mach/common.h>
- #include <mach/irqs.h>
-@@ -274,6 +275,44 @@ static struct platform_device sdhi1_device = {
- .resource = sdhi1_resources,
- };
-
-+/* MMCIF */
-+static struct sh_mmcif_plat_data sh_mmcif_plat = {
-+ .sup_pclk = 0,
-+ .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-+ .caps = MMC_CAP_4_BIT_DATA |
-+ MMC_CAP_8_BIT_DATA |
-+ MMC_CAP_NONREMOVABLE,
-+};
-+
-+static struct resource sh_mmcif_resources[] = {
-+ [0] = {
-+ .name = "MMCIF",
-+ .start = 0xe6bd0000,
-+ .end = 0xe6bd0100 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ /* MMC ERR */
-+ .start = evt2irq(0x1AC0),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ /* MMC NOR */
-+ .start = evt2irq(0x1AE0),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sh_mmcif_device = {
-+ .name = "sh_mmcif",
-+ .id = -1,
-+ .dev = {
-+ .platform_data = &sh_mmcif_plat,
-+ },
-+ .num_resources = ARRAY_SIZE(sh_mmcif_resources),
-+ .resource = sh_mmcif_resources,
-+};
-+
- /* I2C */
- static struct i2c_board_info i2c0_devices[] = {
- {
-@@ -313,6 +352,7 @@ static struct platform_device *eva_devices[] __initdata = {
- &gpio_keys_device,
- &sh_eth_device,
- &sdhi0_device,
-+ &sh_mmcif_device,
- };
-
- /*
-@@ -412,6 +452,23 @@ static void __init eva_init(void)
- /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
-
- /*
-+ * MMCIF
-+ *
-+ * Here doesn't care SW1.4 status,
-+ * since CON2 is not mounted.
-+ */
-+ gpio_request(GPIO_FN_MMC1_CLK_PORT103, NULL);
-+ gpio_request(GPIO_FN_MMC1_CMD_PORT104, NULL);
-+ gpio_request(GPIO_FN_MMC1_D0_PORT149, NULL);
-+ gpio_request(GPIO_FN_MMC1_D1_PORT148, NULL);
-+ gpio_request(GPIO_FN_MMC1_D2_PORT147, NULL);
-+ gpio_request(GPIO_FN_MMC1_D3_PORT146, NULL);
-+ gpio_request(GPIO_FN_MMC1_D4_PORT145, NULL);
-+ gpio_request(GPIO_FN_MMC1_D5_PORT144, NULL);
-+ gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL);
-+ gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL);
-+
-+ /*
- * CAUTION
- *
- * DBGMD/LCDC0/FSIA MUX
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0139-ARM-mach-shmobile-armadillo800eva-Add-FSI-WM8978-sup.patch b/patches.kzm9g/0139-ARM-mach-shmobile-armadillo800eva-Add-FSI-WM8978-sup.patch
deleted file mode 100644
index eb3642658f3d70..00000000000000
--- a/patches.kzm9g/0139-ARM-mach-shmobile-armadillo800eva-Add-FSI-WM8978-sup.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From bbfe67adb04a9203585aa910f5697c13a89db7d8 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 24 Apr 2012 02:20:57 -0700
-Subject: ARM: mach-shmobile: armadillo800eva: Add FSI-WM8978 support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-N.B: Not present upstream yet
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-armadillo800eva.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 1 +
- arch/arm/mach-shmobile/board-armadillo800eva.c | 97 ++++++++++++++++++++++++++
- 2 files changed, 98 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 7a1b589..91a4f32 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -79,6 +79,7 @@ config MACH_ARMADILLO800EVA
- bool "Armadillo-800 EVA board"
- depends on ARCH_R8A7740
- select ARCH_REQUIRE_GPIOLIB
-+ select SND_SOC_WM8978 if SND_SIMPLE_CARD
-
- comment "SH-Mobile System Configuration"
-
-diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
-index eb97618..0dc387b 100644
---- a/arch/arm/mach-shmobile/board-armadillo800eva.c
-+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
-@@ -42,6 +42,8 @@
- #include <asm/hardware/cache-l2x0.h>
- #include <mach/r8a7740.h>
- #include <video/sh_mobile_lcdc.h>
-+#include <sound/sh_fsi.h>
-+#include <sound/simple_card.h>
-
- /*
- * CON1 Camera Module
-@@ -101,6 +103,28 @@
- *-----------+---------------+----------------------------
- */
-
-+/*
-+ * FSI-WM8978
-+ *
-+ * this command is required when playback.
-+ *
-+ * # amixer set "Headphone" 50
-+ */
-+
-+/*
-+ * FIXME !!
-+ *
-+ * gpio_no_direction
-+ *
-+ * current gpio frame work doesn't have
-+ * the method to control only pull up/down/free.
-+ * this function should be replaced by correct gpio function
-+ */
-+static void __init gpio_no_direction(u32 addr)
-+{
-+ __raw_writeb(0x00, addr);
-+}
-+
- /* Ether */
- static struct sh_eth_plat_data sh_eth_platdata = {
- .phy = 0x00, /* LAN8710A */
-@@ -313,12 +337,68 @@ static struct platform_device sh_mmcif_device = {
- .resource = sh_mmcif_resources,
- };
-
-+/* FSI-WM8978 */
-+static struct sh_fsi_platform_info fsi_info = {
-+ .port_a = {
-+ },
-+};
-+
-+static struct resource fsi_resources[] = {
-+ [0] = {
-+ .name = "FSI",
-+ .start = 0xfe1f0000,
-+ .end = 0xfe1f8400 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = evt2irq(0x1840),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device fsi_device = {
-+ .name = "sh_fsi2",
-+ .id = -1,
-+ .num_resources = ARRAY_SIZE(fsi_resources),
-+ .resource = fsi_resources,
-+ .dev = {
-+ .platform_data = &fsi_info,
-+ },
-+};
-+
-+static struct asoc_simple_dai_init_info fsi_wm8978_init_info = {
-+ .fmt = SND_SOC_DAIFMT_I2S,
-+ .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
-+ .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
-+ .sysclk = 12288000,
-+};
-+
-+static struct asoc_simple_card_info fsi_wm8978_info = {
-+ .name = "wm8978",
-+ .card = "FSI2A-WM8978",
-+ .cpu_dai = "fsia-dai",
-+ .codec = "wm8978.0-001a",
-+ .platform = "sh_fsi2",
-+ .codec_dai = "wm8978-hifi",
-+ .init = &fsi_wm8978_init_info,
-+};
-+
-+static struct platform_device fsi_wm8978_device = {
-+ .name = "asoc-simple-card",
-+ .dev = {
-+ .platform_data = &fsi_wm8978_info,
-+ },
-+};
-+
- /* I2C */
- static struct i2c_board_info i2c0_devices[] = {
- {
- I2C_BOARD_INFO("st1232-ts", 0x55),
- .irq = evt2irq(0x0340),
- },
-+ {
-+ I2C_BOARD_INFO("wm8978", 0x1a),
-+ },
- };
-
- /* GPIO KEY */
-@@ -353,11 +433,15 @@ static struct platform_device *eva_devices[] __initdata = {
- &sh_eth_device,
- &sdhi0_device,
- &sh_mmcif_device,
-+ &fsi_device,
-+ &fsi_wm8978_device,
- };
-
- /*
- * board init
- */
-+#define GPIO_PORT7CR 0xe6050007
-+#define GPIO_PORT8CR 0xe6050008
- static void __init eva_init(void)
- {
- r8a7740_pinmux_init();
-@@ -468,6 +552,19 @@ static void __init eva_init(void)
- gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL);
- gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL);
-
-+ /* FSI */
-+ gpio_request(GPIO_FN_FSIAIBT, NULL);
-+ gpio_request(GPIO_FN_FSIAILR, NULL);
-+ gpio_request(GPIO_FN_FSIAOMC, NULL);
-+ gpio_request(GPIO_FN_FSIACK, NULL);
-+ gpio_request(GPIO_FN_FSIAOSLD, NULL);
-+ gpio_request(GPIO_FN_FSIAISLD_PORT5, NULL);
-+
-+ gpio_request(GPIO_PORT7, NULL);
-+ gpio_request(GPIO_PORT8, NULL);
-+ gpio_no_direction(GPIO_PORT7CR); /* FSIAOBT needs no direction */
-+ gpio_no_direction(GPIO_PORT8CR); /* FSIAOLR needs no direction */
-+
- /*
- * CAUTION
- *
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0140-ARM-mach-shmobile-Add-support-for-PINT-though-INTC-m.patch b/patches.kzm9g/0140-ARM-mach-shmobile-Add-support-for-PINT-though-INTC-m.patch
deleted file mode 100644
index c4a8edb5e25d1b..00000000000000
--- a/patches.kzm9g/0140-ARM-mach-shmobile-Add-support-for-PINT-though-INTC-m.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 6bd2390c23f97b846328d2f6f87cd786b3954d6c Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 17 Oct 2011 18:00:35 +0900
-Subject: ARM: mach-shmobile: Add support for PINT though INTC macros
-
-Add a INTC_PINT() macro with various helper bits to allow SoCs
-like sh73a0 to suppor the PINT hardware using regular INTC tables.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 91c088ae17c62f7741d9563e36935bc7a69a7e9e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/intc.h | 51 ++++++++++++++++++++++++++++++
- 1 file changed, 51 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/include/mach/intc.h
-index 1cd8b36..8b22258 100644
---- a/arch/arm/mach-shmobile/include/mach/intc.h
-+++ b/arch/arm/mach-shmobile/include/mach/intc.h
-@@ -192,4 +192,55 @@ static struct intc_desc p ## _desc __initdata = { \
- p ## _sense_registers, p ## _ack_registers) \
- }
-
-+#define INTC_PINT_E_EMPTY
-+#define INTC_PINT_E_NONE 0, 0, 0, 0, 0, 0, 0, 0,
-+#define INTC_PINT_E(p) \
-+ PINT ## p ## 0, PINT ## p ## 1, PINT ## p ## 2, PINT ## p ## 3, \
-+ PINT ## p ## 4, PINT ## p ## 5, PINT ## p ## 6, PINT ## p ## 7,
-+
-+#define INTC_PINT_V_NONE
-+#define INTC_PINT_V(p, vect) \
-+ vect(PINT ## p ## 0, 0), vect(PINT ## p ## 1, 1), \
-+ vect(PINT ## p ## 2, 2), vect(PINT ## p ## 3, 3), \
-+ vect(PINT ## p ## 4, 4), vect(PINT ## p ## 5, 5), \
-+ vect(PINT ## p ## 6, 6), vect(PINT ## p ## 7, 7),
-+
-+#define INTC_PINT(p, mask_reg, sense_base, str, \
-+ enums_1, enums_2, enums_3, enums_4, \
-+ vect_1, vect_2, vect_3, vect_4, \
-+ mask_a, mask_b, mask_c, mask_d, \
-+ sense_a, sense_b, sense_c, sense_d) \
-+ \
-+enum { \
-+ PINT ## p ## _UNUSED = 0, \
-+ enums_1 enums_2 enums_3 enums_4 \
-+}; \
-+ \
-+static struct intc_vect p ## _vectors[] __initdata = { \
-+ vect_1 vect_2 vect_3 vect_4 \
-+}; \
-+ \
-+static struct intc_mask_reg p ## _mask_registers[] __initdata = { \
-+ { mask_reg, 0, 32, /* PINTER */ \
-+ { mask_a mask_b mask_c mask_d } } \
-+}; \
-+ \
-+static struct intc_sense_reg p ## _sense_registers[] __initdata = { \
-+ { sense_base + 0x00, 16, 2, /* PINTCR */ \
-+ { sense_a } }, \
-+ { sense_base + 0x04, 16, 2, /* PINTCR */ \
-+ { sense_b } }, \
-+ { sense_base + 0x08, 16, 2, /* PINTCR */ \
-+ { sense_c } }, \
-+ { sense_base + 0x0c, 16, 2, /* PINTCR */ \
-+ { sense_d } }, \
-+}; \
-+ \
-+static struct intc_desc p ## _desc __initdata = { \
-+ .name = str, \
-+ .hw = INTC_HW_DESC(p ## _vectors, NULL, \
-+ p ## _mask_registers, NULL, \
-+ p ## _sense_registers, NULL), \
-+}
-+
- #endif /* __ASM_MACH_INTC_H */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0141-irq-Track-the-owner-of-irq-descriptor.patch b/patches.kzm9g/0141-irq-Track-the-owner-of-irq-descriptor.patch
deleted file mode 100644
index f8e709694bd6f8..00000000000000
--- a/patches.kzm9g/0141-irq-Track-the-owner-of-irq-descriptor.patch
+++ /dev/null
@@ -1,260 +0,0 @@
-From b26b3d7e3cb934148b64b1276087761b30a5b1be Mon Sep 17 00:00:00 2001
-From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
-Date: Mon, 11 Jul 2011 12:17:31 +0200
-Subject: irq: Track the owner of irq descriptor
-
-Interrupt descriptors can be allocated from modules. The interrupts
-are used by other modules, but we have no refcount on the module which
-provides the interrupts and there is no way to establish one on the
-device level as the interrupt using module is agnostic to the fact
-that the interrupt is provided by a module rather than by some builtin
-interrupt controller.
-
-To prevent removal of the interrupt providing module, we can track the
-owner of the interrupt descriptor, which also provides the relevant
-irq chip functions in the irq descriptor.
-
-request/setup_irq() can now acquire a refcount on the owner module to
-prevent unloading. free_irq() drops the refcount.
-
-Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
-Link: http://lkml.kernel.org/r/20110711101731.GA13804@Chamillionaire.breakpoint.cc
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit b6873807a7143b7d6d8b06809295e559d07d7deb)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/irq.h | 11 ++++++++++-
- include/linux/irqdesc.h | 1 +
- kernel/irq/irqdesc.c | 36 ++++++++++++++++++++++++------------
- kernel/irq/manage.c | 17 +++++++++++++----
- 4 files changed, 48 insertions(+), 17 deletions(-)
-
-diff --git a/include/linux/irq.h b/include/linux/irq.h
-index 094c211..58d1e49 100644
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -23,6 +23,7 @@
- #include <linux/errno.h>
- #include <linux/topology.h>
- #include <linux/wait.h>
-+#include <linux/module.h>
-
- #include <asm/irq.h>
- #include <asm/ptrace.h>
-@@ -548,7 +549,15 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
- return d->msi_desc;
- }
-
--int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node);
-+int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
-+ struct module *owner);
-+
-+static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
-+ int node)
-+{
-+ return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
-+}
-+
- void irq_free_descs(unsigned int irq, unsigned int cnt);
- int irq_reserve_irqs(unsigned int from, unsigned int cnt);
-
-diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
-index 2d921b3..150134a 100644
---- a/include/linux/irqdesc.h
-+++ b/include/linux/irqdesc.h
-@@ -66,6 +66,7 @@ struct irq_desc {
- #ifdef CONFIG_PROC_FS
- struct proc_dir_entry *dir;
- #endif
-+ struct module *owner;
- const char *name;
- } ____cacheline_internodealigned_in_smp;
-
-diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
-index 4c60a50..cb65d03 100644
---- a/kernel/irq/irqdesc.c
-+++ b/kernel/irq/irqdesc.c
-@@ -70,7 +70,8 @@ static inline void desc_smp_init(struct irq_desc *desc, int node) { }
- static inline int desc_node(struct irq_desc *desc) { return 0; }
- #endif
-
--static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node)
-+static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node,
-+ struct module *owner)
- {
- int cpu;
-
-@@ -86,6 +87,7 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node)
- desc->irq_count = 0;
- desc->irqs_unhandled = 0;
- desc->name = NULL;
-+ desc->owner = owner;
- for_each_possible_cpu(cpu)
- *per_cpu_ptr(desc->kstat_irqs, cpu) = 0;
- desc_smp_init(desc, node);
-@@ -128,7 +130,7 @@ static void free_masks(struct irq_desc *desc)
- static inline void free_masks(struct irq_desc *desc) { }
- #endif
-
--static struct irq_desc *alloc_desc(int irq, int node)
-+static struct irq_desc *alloc_desc(int irq, int node, struct module *owner)
- {
- struct irq_desc *desc;
- gfp_t gfp = GFP_KERNEL;
-@@ -147,7 +149,7 @@ static struct irq_desc *alloc_desc(int irq, int node)
- raw_spin_lock_init(&desc->lock);
- lockdep_set_class(&desc->lock, &irq_desc_lock_class);
-
-- desc_set_defaults(irq, desc, node);
-+ desc_set_defaults(irq, desc, node, owner);
-
- return desc;
-
-@@ -173,13 +175,14 @@ static void free_desc(unsigned int irq)
- kfree(desc);
- }
-
--static int alloc_descs(unsigned int start, unsigned int cnt, int node)
-+static int alloc_descs(unsigned int start, unsigned int cnt, int node,
-+ struct module *owner)
- {
- struct irq_desc *desc;
- int i;
-
- for (i = 0; i < cnt; i++) {
-- desc = alloc_desc(start + i, node);
-+ desc = alloc_desc(start + i, node, owner);
- if (!desc)
- goto err;
- mutex_lock(&sparse_irq_lock);
-@@ -227,7 +230,7 @@ int __init early_irq_init(void)
- nr_irqs = initcnt;
-
- for (i = 0; i < initcnt; i++) {
-- desc = alloc_desc(i, node);
-+ desc = alloc_desc(i, node, NULL);
- set_bit(i, allocated_irqs);
- irq_insert_desc(i, desc);
- }
-@@ -261,7 +264,7 @@ int __init early_irq_init(void)
- alloc_masks(&desc[i], GFP_KERNEL, node);
- raw_spin_lock_init(&desc[i].lock);
- lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
-- desc_set_defaults(i, &desc[i], node);
-+ desc_set_defaults(i, &desc[i], node, NULL);
- }
- return arch_early_irq_init();
- }
-@@ -276,8 +279,16 @@ static void free_desc(unsigned int irq)
- dynamic_irq_cleanup(irq);
- }
-
--static inline int alloc_descs(unsigned int start, unsigned int cnt, int node)
-+static inline int alloc_descs(unsigned int start, unsigned int cnt, int node,
-+ struct module *owner)
- {
-+ u32 i;
-+
-+ for (i = 0; i < cnt; i++) {
-+ struct irq_desc *desc = irq_to_desc(start + i);
-+
-+ desc->owner = owner;
-+ }
- return start;
- }
-
-@@ -337,7 +348,8 @@ EXPORT_SYMBOL_GPL(irq_free_descs);
- * Returns the first irq number or error code
- */
- int __ref
--irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)
-+__irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
-+ struct module *owner)
- {
- int start, ret;
-
-@@ -366,13 +378,13 @@ irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)
-
- bitmap_set(allocated_irqs, start, cnt);
- mutex_unlock(&sparse_irq_lock);
-- return alloc_descs(start, cnt, node);
-+ return alloc_descs(start, cnt, node, owner);
-
- err:
- mutex_unlock(&sparse_irq_lock);
- return ret;
- }
--EXPORT_SYMBOL_GPL(irq_alloc_descs);
-+EXPORT_SYMBOL_GPL(__irq_alloc_descs);
-
- /**
- * irq_reserve_irqs - mark irqs allocated
-@@ -440,7 +452,7 @@ void dynamic_irq_cleanup(unsigned int irq)
- unsigned long flags;
-
- raw_spin_lock_irqsave(&desc->lock, flags);
-- desc_set_defaults(irq, desc, desc_node(desc));
-+ desc_set_defaults(irq, desc, desc_node(desc), NULL);
- raw_spin_unlock_irqrestore(&desc->lock, flags);
- }
-
-diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
-index bbc6a35..83fb6f5 100644
---- a/kernel/irq/manage.c
-+++ b/kernel/irq/manage.c
-@@ -889,6 +889,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
-
- if (desc->irq_data.chip == &no_irq_chip)
- return -ENOSYS;
-+ if (!try_module_get(desc->owner))
-+ return -ENODEV;
- /*
- * Some drivers like serial.c use request_irq() heavily,
- * so we have to be careful not to interfere with a
-@@ -912,8 +914,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
- */
- nested = irq_settings_is_nested_thread(desc);
- if (nested) {
-- if (!new->thread_fn)
-- return -EINVAL;
-+ if (!new->thread_fn) {
-+ ret = -EINVAL;
-+ goto out_mput;
-+ }
- /*
- * Replace the primary handler which was provided from
- * the driver for non nested interrupt handling by the
-@@ -935,8 +939,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
-
- t = kthread_create(irq_thread, new, "irq/%d-%s", irq,
- new->name);
-- if (IS_ERR(t))
-- return PTR_ERR(t);
-+ if (IS_ERR(t)) {
-+ ret = PTR_ERR(t);
-+ goto out_mput;
-+ }
- /*
- * We keep the reference to the task struct even if
- * the thread dies to avoid that the interrupt code
-@@ -1133,6 +1139,8 @@ out_thread:
- kthread_stop(t);
- put_task_struct(t);
- }
-+out_mput:
-+ module_put(desc->owner);
- return ret;
- }
-
-@@ -1241,6 +1249,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
- put_task_struct(action->thread);
- }
-
-+ module_put(desc->owner);
- return action;
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0142-irq-add-irq_domain-translation-infrastructure.patch b/patches.kzm9g/0142-irq-add-irq_domain-translation-infrastructure.patch
deleted file mode 100644
index bdee569a1a2b3c..00000000000000
--- a/patches.kzm9g/0142-irq-add-irq_domain-translation-infrastructure.patch
+++ /dev/null
@@ -1,400 +0,0 @@
-From 9a23bed05c4e337589f8e76bed25c843979b77d5 Mon Sep 17 00:00:00 2001
-From: Grant Likely <grant.likely@secretlab.ca>
-Date: Tue, 26 Jul 2011 03:19:06 -0600
-Subject: irq: add irq_domain translation infrastructure
-
-This patch adds irq_domain infrastructure for translating from
-hardware irq numbers to linux irqs. This is particularly important
-for architectures adding device tree support because the current
-implementation (excluding PowerPC and SPARC) cannot handle
-translation for more than a single interrupt controller. irq_domain
-supports device tree translation for any number of interrupt
-controllers.
-
-This patch converts x86, Microblaze, ARM and MIPS to use irq_domain
-for device tree irq translation. x86 is untested beyond compiling it,
-irq_domain is enabled for MIPS and Microblaze, but the old behaviour is
-preserved until the core code is modified to actually register an
-irq_domain yet. On ARM it works and is required for much of the new
-ARM device tree board support.
-
-PowerPC has /not/ been converted to use this new infrastructure. It
-is still missing some features before it can replace the virq
-infrastructure already in powerpc (see documentation on
-irq_domain_map/unmap for details). Followup patches will add the
-missing pieces and migrate PowerPC to use irq_domain.
-
-SPARC has its own method of managing interrupts from the device tree
-and is unaffected by this change.
-
-Acked-by: Ralf Baechle <ralf@linux-mips.org>
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 08a543ad33fc188650801bd36eed4ffe272643e1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/Kconfig | 1 +
- arch/arm/include/asm/prom.h | 5 --
- arch/arm/kernel/devtree.c | 14 -----
- include/linux/irq.h | 6 +++
- include/linux/irqdomain.h | 81 +++++++++++++++++++++++++++++
- include/linux/of_irq.h | 4 ++
- kernel/irq/Kconfig | 4 ++
- kernel/irq/Makefile | 1 +
- kernel/irq/irqdomain.c | 122 ++++++++++++++++++++++++++++++++++++++++++++
- 9 files changed, 219 insertions(+), 19 deletions(-)
- create mode 100644 include/linux/irqdomain.h
- create mode 100644 kernel/irq/irqdomain.c
-
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index f9b212e..d7f1a02 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -1705,6 +1705,7 @@ config USE_OF
- bool "Flattened Device Tree support"
- select OF
- select OF_EARLY_FLATTREE
-+ select IRQ_DOMAIN
- help
- Include support for flattened device tree machine descriptions.
-
-diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
-index 11b8708..6f65ca8 100644
---- a/arch/arm/include/asm/prom.h
-+++ b/arch/arm/include/asm/prom.h
-@@ -16,11 +16,6 @@
- #include <asm/setup.h>
- #include <asm/irq.h>
-
--static inline void irq_dispose_mapping(unsigned int virq)
--{
-- return;
--}
--
- extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
- extern void arm_dt_memblock_reserve(void);
-
-diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
-index 0cdd7b4..1a33e9d 100644
---- a/arch/arm/kernel/devtree.c
-+++ b/arch/arm/kernel/devtree.c
-@@ -132,17 +132,3 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
-
- return mdesc_best;
- }
--
--/**
-- * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
-- *
-- * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
-- * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
-- * supported.
-- */
--unsigned int irq_create_of_mapping(struct device_node *controller,
-- const u32 *intspec, unsigned int intsize)
--{
-- return intspec[0];
--}
--EXPORT_SYMBOL_GPL(irq_create_of_mapping);
-diff --git a/include/linux/irq.h b/include/linux/irq.h
-index 58d1e49..d65dfca 100644
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -114,14 +114,18 @@ enum {
- };
-
- struct msi_desc;
-+struct irq_domain;
-
- /**
- * struct irq_data - per irq and irq chip data passed down to chip functions
- * @irq: interrupt number
-+ * @hwirq: hardware interrupt number, local to the interrupt domain
- * @node: node index useful for balancing
- * @state_use_accessors: status information for irq chip functions.
- * Use accessor functions to deal with it
- * @chip: low level interrupt hardware access
-+ * @domain: Interrupt translation domain; responsible for mapping
-+ * between hwirq number and linux irq number.
- * @handler_data: per-IRQ data for the irq_chip methods
- * @chip_data: platform-specific per-chip private data for the chip
- * methods, to allow shared chip implementations
-@@ -134,9 +138,11 @@ struct msi_desc;
- */
- struct irq_data {
- unsigned int irq;
-+ unsigned long hwirq;
- unsigned int node;
- unsigned int state_use_accessors;
- struct irq_chip *chip;
-+ struct irq_domain *domain;
- void *handler_data;
- void *chip_data;
- struct msi_desc *msi_desc;
-diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
-new file mode 100644
-index 0000000..8f2c10a
---- /dev/null
-+++ b/include/linux/irqdomain.h
-@@ -0,0 +1,81 @@
-+/*
-+ * irq_domain - IRQ translation domains
-+ *
-+ * Translation infrastructure between hw and linux irq numbers. This is
-+ * helpful for interrupt controllers to implement mapping between hardware
-+ * irq numbers and the Linux irq number space.
-+ *
-+ * irq_domains also have a hook for translating device tree interrupt
-+ * representation into a hardware irq number that can be mapped back to a
-+ * Linux irq number without any extra platform support code.
-+ *
-+ * irq_domain is expected to be embedded in an interrupt controller's private
-+ * data structure.
-+ */
-+#ifndef _LINUX_IRQDOMAIN_H
-+#define _LINUX_IRQDOMAIN_H
-+
-+#include <linux/irq.h>
-+
-+#ifdef CONFIG_IRQ_DOMAIN
-+struct device_node;
-+struct irq_domain;
-+
-+/**
-+ * struct irq_domain_ops - Methods for irq_domain objects
-+ * @to_irq: (optional) given a local hardware irq number, return the linux
-+ * irq number. If to_irq is not implemented, then the irq_domain
-+ * will use this translation: irq = (domain->irq_base + hwirq)
-+ * @dt_translate: Given a device tree node and interrupt specifier, decode
-+ * the hardware irq number and linux irq type value.
-+ */
-+struct irq_domain_ops {
-+ unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq);
-+
-+#ifdef CONFIG_OF
-+ int (*dt_translate)(struct irq_domain *d, struct device_node *node,
-+ const u32 *intspec, unsigned int intsize,
-+ unsigned long *out_hwirq, unsigned int *out_type);
-+#endif /* CONFIG_OF */
-+};
-+
-+/**
-+ * struct irq_domain - Hardware interrupt number translation object
-+ * @list: Element in global irq_domain list.
-+ * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator
-+ * of the irq_domain is responsible for allocating the array of
-+ * irq_desc structures.
-+ * @nr_irq: Number of irqs managed by the irq domain
-+ * @ops: pointer to irq_domain methods
-+ * @priv: private data pointer for use by owner. Not touched by irq_domain
-+ * core code.
-+ * @of_node: (optional) Pointer to device tree nodes associated with the
-+ * irq_domain. Used when decoding device tree interrupt specifiers.
-+ */
-+struct irq_domain {
-+ struct list_head list;
-+ unsigned int irq_base;
-+ unsigned int nr_irq;
-+ const struct irq_domain_ops *ops;
-+ void *priv;
-+ struct device_node *of_node;
-+};
-+
-+/**
-+ * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number
-+ *
-+ * Returns the linux irq number associated with a hardware irq. By default,
-+ * the mapping is irq == domain->irq_base + hwirq, but this mapping can
-+ * be overridden if the irq_domain implements a .to_irq() hook.
-+ */
-+static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
-+ unsigned long hwirq)
-+{
-+ return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq;
-+}
-+
-+extern void irq_domain_add(struct irq_domain *domain);
-+extern void irq_domain_del(struct irq_domain *domain);
-+#endif /* CONFIG_IRQ_DOMAIN */
-+
-+#endif /* _LINUX_IRQDOMAIN_H */
-diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
-index e6955f5..cd2e61c 100644
---- a/include/linux/of_irq.h
-+++ b/include/linux/of_irq.h
-@@ -63,6 +63,9 @@ extern int of_irq_map_one(struct device_node *device, int index,
- extern unsigned int irq_create_of_mapping(struct device_node *controller,
- const u32 *intspec,
- unsigned int intsize);
-+#ifdef CONFIG_IRQ_DOMAIN
-+extern void irq_dispose_mapping(unsigned int irq);
-+#endif
- extern int of_irq_to_resource(struct device_node *dev, int index,
- struct resource *r);
- extern int of_irq_count(struct device_node *dev);
-@@ -70,6 +73,7 @@ extern int of_irq_to_resource_table(struct device_node *dev,
- struct resource *res, int nr_irqs);
- extern struct device_node *of_irq_find_parent(struct device_node *child);
-
-+
- #endif /* CONFIG_OF_IRQ */
- #endif /* CONFIG_OF */
- #endif /* __OF_IRQ_H */
-diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig
-index d1d051b3..5a38bf4 100644
---- a/kernel/irq/Kconfig
-+++ b/kernel/irq/Kconfig
-@@ -52,6 +52,10 @@ config IRQ_EDGE_EOI_HANDLER
- config GENERIC_IRQ_CHIP
- bool
-
-+# Generic irq_domain hw <--> linux irq number translation
-+config IRQ_DOMAIN
-+ bool
-+
- # Support forced irq threading
- config IRQ_FORCED_THREADING
- bool
-diff --git a/kernel/irq/Makefile b/kernel/irq/Makefile
-index 7329005..fff1738 100644
---- a/kernel/irq/Makefile
-+++ b/kernel/irq/Makefile
-@@ -2,6 +2,7 @@
- obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o
- obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
- obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
-+obj-$(CONFIG_IRQ_DOMAIN) += irqdomain.o
- obj-$(CONFIG_PROC_FS) += proc.o
- obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o
- obj-$(CONFIG_PM_SLEEP) += pm.o
-diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
-new file mode 100644
-index 0000000..29c7bd4
---- /dev/null
-+++ b/kernel/irq/irqdomain.c
-@@ -0,0 +1,122 @@
-+#include <linux/irq.h>
-+#include <linux/irqdomain.h>
-+#include <linux/module.h>
-+#include <linux/mutex.h>
-+#include <linux/of.h>
-+
-+static LIST_HEAD(irq_domain_list);
-+static DEFINE_MUTEX(irq_domain_mutex);
-+
-+/**
-+ * irq_domain_add() - Register an irq_domain
-+ * @domain: ptr to initialized irq_domain structure
-+ *
-+ * Registers an irq_domain structure. The irq_domain must at a minimum be
-+ * initialized with an ops structure pointer, and either a ->to_irq hook or
-+ * a valid irq_base value. Everything else is optional.
-+ */
-+void irq_domain_add(struct irq_domain *domain)
-+{
-+ struct irq_data *d;
-+ int hwirq;
-+
-+ /*
-+ * This assumes that the irq_domain owner has already allocated
-+ * the irq_descs. This block will be removed when support for dynamic
-+ * allocation of irq_descs is added to irq_domain.
-+ */
-+ for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
-+ d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
-+ if (d || d->domain) {
-+ /* things are broken; just report, don't clean up */
-+ WARN(1, "error: irq_desc already assigned to a domain");
-+ return;
-+ }
-+ d->domain = domain;
-+ d->hwirq = hwirq;
-+ }
-+
-+ mutex_lock(&irq_domain_mutex);
-+ list_add(&domain->list, &irq_domain_list);
-+ mutex_unlock(&irq_domain_mutex);
-+}
-+
-+/**
-+ * irq_domain_del() - Unregister an irq_domain
-+ * @domain: ptr to registered irq_domain.
-+ */
-+void irq_domain_del(struct irq_domain *domain)
-+{
-+ struct irq_data *d;
-+ int hwirq;
-+
-+ mutex_lock(&irq_domain_mutex);
-+ list_del(&domain->list);
-+ mutex_unlock(&irq_domain_mutex);
-+
-+ /* Clear the irq_domain assignments */
-+ for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
-+ d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
-+ d->domain = NULL;
-+ }
-+}
-+
-+#if defined(CONFIG_OF_IRQ)
-+/**
-+ * irq_create_of_mapping() - Map a linux irq number from a DT interrupt spec
-+ *
-+ * Used by the device tree interrupt mapping code to translate a device tree
-+ * interrupt specifier to a valid linux irq number. Returns either a valid
-+ * linux IRQ number or 0.
-+ *
-+ * When the caller no longer need the irq number returned by this function it
-+ * should arrange to call irq_dispose_mapping().
-+ */
-+unsigned int irq_create_of_mapping(struct device_node *controller,
-+ const u32 *intspec, unsigned int intsize)
-+{
-+ struct irq_domain *domain;
-+ unsigned long hwirq;
-+ unsigned int irq, type;
-+ int rc = -EINVAL;
-+
-+ /* Find a domain which can translate the irq spec */
-+ mutex_lock(&irq_domain_mutex);
-+ list_for_each_entry(domain, &irq_domain_list, list) {
-+ if (!domain->ops->dt_translate)
-+ continue;
-+ rc = domain->ops->dt_translate(domain, controller,
-+ intspec, intsize, &hwirq, &type);
-+ if (rc == 0)
-+ break;
-+ }
-+ mutex_unlock(&irq_domain_mutex);
-+
-+ if (rc != 0)
-+ return 0;
-+
-+ irq = irq_domain_to_irq(domain, hwirq);
-+ if (type != IRQ_TYPE_NONE)
-+ irq_set_irq_type(irq, type);
-+ pr_debug("%s: mapped hwirq=%i to irq=%i, flags=%x\n",
-+ controller->full_name, (int)hwirq, irq, type);
-+ return irq;
-+}
-+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
-+
-+/**
-+ * irq_dispose_mapping() - Discard a mapping created by irq_create_of_mapping()
-+ * @irq: linux irq number to be discarded
-+ *
-+ * Calling this function indicates the caller no longer needs a reference to
-+ * the linux irq number returned by a prior call to irq_create_of_mapping().
-+ */
-+void irq_dispose_mapping(unsigned int irq)
-+{
-+ /*
-+ * nothing yet; will be filled when support for dynamic allocation of
-+ * irq_descs is added to irq_domain
-+ */
-+}
-+EXPORT_SYMBOL_GPL(irq_dispose_mapping);
-+#endif /* CONFIG_OF_IRQ */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0143-dt-irq-add-irq_domain_generate_simple-helper.patch b/patches.kzm9g/0143-dt-irq-add-irq_domain_generate_simple-helper.patch
deleted file mode 100644
index 725586004ea22b..00000000000000
--- a/patches.kzm9g/0143-dt-irq-add-irq_domain_generate_simple-helper.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From 3105f044552138b2b05fa35fd4af2290997dfcb1 Mon Sep 17 00:00:00 2001
-From: Grant Likely <grant.likely@secretlab.ca>
-Date: Tue, 26 Jul 2011 03:19:06 -0600
-Subject: dt/irq: add irq_domain_generate_simple() helper
-
-irq_domain_generate_simple() is an easy way to generate an irq translation
-domain for simple irq controllers. It assumes a flat 1:1 mapping from
-hardware irq number to an offset of the first linux irq number assigned
-to the controller
-
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 7e71330169d8056536b299290544980bccc6b300)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/irqdomain.h | 10 ++++++++
- kernel/irq/irqdomain.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 68 insertions(+)
-
-diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
-index 8f2c10a..e807ad6 100644
---- a/include/linux/irqdomain.h
-+++ b/include/linux/irqdomain.h
-@@ -16,6 +16,7 @@
- #define _LINUX_IRQDOMAIN_H
-
- #include <linux/irq.h>
-+#include <linux/mod_devicetable.h>
-
- #ifdef CONFIG_IRQ_DOMAIN
- struct device_node;
-@@ -78,4 +79,13 @@ extern void irq_domain_add(struct irq_domain *domain);
- extern void irq_domain_del(struct irq_domain *domain);
- #endif /* CONFIG_IRQ_DOMAIN */
-
-+#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
-+extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
-+extern void irq_domain_generate_simple(const struct of_device_id *match,
-+ u64 phys_base, unsigned int irq_start);
-+#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
-+static inline void irq_domain_generate_simple(const struct of_device_id *match,
-+ u64 phys_base, unsigned int irq_start) { }
-+#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
-+
- #endif /* _LINUX_IRQDOMAIN_H */
-diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
-index 29c7bd4..d5828da 100644
---- a/kernel/irq/irqdomain.c
-+++ b/kernel/irq/irqdomain.c
-@@ -3,6 +3,8 @@
- #include <linux/module.h>
- #include <linux/mutex.h>
- #include <linux/of.h>
-+#include <linux/of_address.h>
-+#include <linux/slab.h>
-
- static LIST_HEAD(irq_domain_list);
- static DEFINE_MUTEX(irq_domain_mutex);
-@@ -119,4 +121,60 @@ void irq_dispose_mapping(unsigned int irq)
- */
- }
- EXPORT_SYMBOL_GPL(irq_dispose_mapping);
-+
-+int irq_domain_simple_dt_translate(struct irq_domain *d,
-+ struct device_node *controller,
-+ const u32 *intspec, unsigned int intsize,
-+ unsigned long *out_hwirq, unsigned int *out_type)
-+{
-+ if (d->of_node != controller)
-+ return -EINVAL;
-+ if (intsize < 1)
-+ return -EINVAL;
-+
-+ *out_hwirq = intspec[0];
-+ *out_type = IRQ_TYPE_NONE;
-+ if (intsize > 1)
-+ *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
-+ return 0;
-+}
-+
-+struct irq_domain_ops irq_domain_simple_ops = {
-+ .dt_translate = irq_domain_simple_dt_translate,
-+};
-+EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
-+
-+/**
-+ * irq_domain_create_simple() - Set up a 'simple' translation range
-+ */
-+void irq_domain_add_simple(struct device_node *controller, int irq_base)
-+{
-+ struct irq_domain *domain;
-+
-+ domain = kzalloc(sizeof(*domain), GFP_KERNEL);
-+ if (!domain) {
-+ WARN_ON(1);
-+ return;
-+ }
-+
-+ domain->irq_base = irq_base;
-+ domain->of_node = of_node_get(controller);
-+ domain->ops = &irq_domain_simple_ops;
-+ irq_domain_add(domain);
-+}
-+EXPORT_SYMBOL_GPL(irq_domain_add_simple);
-+
-+void irq_domain_generate_simple(const struct of_device_id *match,
-+ u64 phys_base, unsigned int irq_start)
-+{
-+ struct device_node *node;
-+ pr_info("looking for phys_base=%llx, irq_start=%i\n",
-+ (unsigned long long) phys_base, (int) irq_start);
-+ node = of_find_matching_node_by_address(NULL, match, phys_base);
-+ if (node)
-+ irq_domain_add_simple(node, irq_start);
-+ else
-+ pr_info("no node found\n");
-+}
-+EXPORT_SYMBOL_GPL(irq_domain_generate_simple);
- #endif /* CONFIG_OF_IRQ */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0144-irq-Add-declaration-of-irq_domain_simple_ops-to-irqd.patch b/patches.kzm9g/0144-irq-Add-declaration-of-irq_domain_simple_ops-to-irqd.patch
deleted file mode 100644
index 5b27c51a0589f8..00000000000000
--- a/patches.kzm9g/0144-irq-Add-declaration-of-irq_domain_simple_ops-to-irqd.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From b4ba6a778992d1529517e6a5cd03cf1778529292 Mon Sep 17 00:00:00 2001
-From: Rob Herring <robherring2@gmail.com>
-Date: Wed, 14 Sep 2011 11:31:36 -0500
-Subject: irq: Add declaration of irq_domain_simple_ops to irqdomain.h
-
-irq_domain_simple_ops is exported, but is not declared in irqdomain.h,
-so add it.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Cc: Grant Likely <grant.likely@secretlab.ca>
-Cc: marc.zyngier@arm.com
-Cc: thomas.abraham@linaro.org
-Cc: jamie@jamieiles.com
-Cc: b-cousson@ti.com
-Cc: shawn.guo@linaro.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Link: http://lkml.kernel.org/r/1316017900-19918-2-git-send-email-robherring2@gmail.com
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit 5bd078dda4d4fbdb4bd138a6bd5b6e274c019ed2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/irqdomain.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
-index e807ad6..3ad553e 100644
---- a/include/linux/irqdomain.h
-+++ b/include/linux/irqdomain.h
-@@ -80,6 +80,7 @@ extern void irq_domain_del(struct irq_domain *domain);
- #endif /* CONFIG_IRQ_DOMAIN */
-
- #if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
-+extern struct irq_domain_ops irq_domain_simple_ops;
- extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
- extern void irq_domain_generate_simple(const struct of_device_id *match,
- u64 phys_base, unsigned int irq_start);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0145-irq-Fix-check-for-already-initialized-irq_domain-in-.patch b/patches.kzm9g/0145-irq-Fix-check-for-already-initialized-irq_domain-in-.patch
deleted file mode 100644
index 5378b2c7454bfa..00000000000000
--- a/patches.kzm9g/0145-irq-Fix-check-for-already-initialized-irq_domain-in-.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From e2aede6a87e8875da05a181d1b46d7ae99f3a3d6 Mon Sep 17 00:00:00 2001
-From: Rob Herring <robherring2@gmail.com>
-Date: Wed, 14 Sep 2011 11:31:37 -0500
-Subject: irq: Fix check for already initialized irq_domain in irq_domain_add
-
-The sanity check in irq_domain_add() tests desc->irq_data != NULL or
-irq_data->domain != NULL. This prevents adding an irq_domain to a irq
-descriptor when irq_data exists, which true when the irq descriptor
-exists.
-
-This went unnoticed so far as the simple domain code did not enter
-this code path because domain->nr_irqs is always 0 for the simple domains.
-
-Split the check for irq_data == NULL out and have a separate warning
-for it.
-
-[ tglx: Made the check for irq_data == NULL separate ]
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Cc: Grant Likely <grant.likely@secretlab.ca>
-Cc: marc.zyngier@arm.com
-Cc: thomas.abraham@linaro.org
-Cc: jamie@jamieiles.com
-Cc: b-cousson@ti.com
-Cc: shawn.guo@linaro.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Link: http://lkml.kernel.org/r/1316017900-19918-3-git-send-email-robherring2@gmail.com
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit eef24afb28561a5a9f4be8f8da97735b7e6a826f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/irq/irqdomain.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
-index d5828da..b57a377 100644
---- a/kernel/irq/irqdomain.c
-+++ b/kernel/irq/irqdomain.c
-@@ -29,7 +29,11 @@ void irq_domain_add(struct irq_domain *domain)
- */
- for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
- d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
-- if (d || d->domain) {
-+ if (!d) {
-+ WARN(1, "error: assigning domain to non existant irq_desc");
-+ return;
-+ }
-+ if (d->domain) {
- /* things are broken; just report, don't clean up */
- WARN(1, "error: irq_desc already assigned to a domain");
- return;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0146-irq-support-domains-with-non-zero-hwirq-base.patch b/patches.kzm9g/0146-irq-support-domains-with-non-zero-hwirq-base.patch
deleted file mode 100644
index 0815ecc54dd9d4..00000000000000
--- a/patches.kzm9g/0146-irq-support-domains-with-non-zero-hwirq-base.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From a5214f58a7b1bd8881d0b99b2bf728149ece07df Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Fri, 30 Sep 2011 10:48:38 -0500
-Subject: irq: support domains with non-zero hwirq base
-
-Interrupt controllers can have non-zero starting value for h/w irq numbers.
-Adding support in irq_domain allows the domain hwirq numbering to match
-the interrupt controllers' numbering.
-
-As this makes looping over irqs for a domain more complicated, add loop
-iterators to iterate over all hwirqs and irqs for a domain.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Reviewed-by: Jamie Iles <jamie@jamieiles.com>
-Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-Acked-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit 6d274309d0e64bdbdb6c50945ca2964596e8fa5a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/irqdomain.h | 16 +++++++++++++++-
- kernel/irq/irqdomain.c | 12 ++++++------
- 2 files changed, 21 insertions(+), 7 deletions(-)
-
-diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
-index 3ad553e..99834e58 100644
---- a/include/linux/irqdomain.h
-+++ b/include/linux/irqdomain.h
-@@ -47,6 +47,7 @@ struct irq_domain_ops {
- * of the irq_domain is responsible for allocating the array of
- * irq_desc structures.
- * @nr_irq: Number of irqs managed by the irq domain
-+ * @hwirq_base: Starting number for hwirqs managed by the irq domain
- * @ops: pointer to irq_domain methods
- * @priv: private data pointer for use by owner. Not touched by irq_domain
- * core code.
-@@ -57,6 +58,7 @@ struct irq_domain {
- struct list_head list;
- unsigned int irq_base;
- unsigned int nr_irq;
-+ unsigned int hwirq_base;
- const struct irq_domain_ops *ops;
- void *priv;
- struct device_node *of_node;
-@@ -72,9 +74,21 @@ struct irq_domain {
- static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
- unsigned long hwirq)
- {
-- return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq;
-+ if (d->ops->to_irq)
-+ return d->ops->to_irq(d, hwirq);
-+ if (WARN_ON(hwirq < d->hwirq_base))
-+ return 0;
-+ return d->irq_base + hwirq - d->hwirq_base;
- }
-
-+#define irq_domain_for_each_hwirq(d, hw) \
-+ for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++)
-+
-+#define irq_domain_for_each_irq(d, hw, irq) \
-+ for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \
-+ hw < d->hwirq_base + d->nr_irq; \
-+ hw++, irq = irq_domain_to_irq(d, hw))
-+
- extern void irq_domain_add(struct irq_domain *domain);
- extern void irq_domain_del(struct irq_domain *domain);
- #endif /* CONFIG_IRQ_DOMAIN */
-diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
-index b57a377..200ce83 100644
---- a/kernel/irq/irqdomain.c
-+++ b/kernel/irq/irqdomain.c
-@@ -20,15 +20,15 @@ static DEFINE_MUTEX(irq_domain_mutex);
- void irq_domain_add(struct irq_domain *domain)
- {
- struct irq_data *d;
-- int hwirq;
-+ int hwirq, irq;
-
- /*
- * This assumes that the irq_domain owner has already allocated
- * the irq_descs. This block will be removed when support for dynamic
- * allocation of irq_descs is added to irq_domain.
- */
-- for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
-- d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
-+ irq_domain_for_each_irq(domain, hwirq, irq) {
-+ d = irq_get_irq_data(irq);
- if (!d) {
- WARN(1, "error: assigning domain to non existant irq_desc");
- return;
-@@ -54,15 +54,15 @@ void irq_domain_add(struct irq_domain *domain)
- void irq_domain_del(struct irq_domain *domain)
- {
- struct irq_data *d;
-- int hwirq;
-+ int hwirq, irq;
-
- mutex_lock(&irq_domain_mutex);
- list_del(&domain->list);
- mutex_unlock(&irq_domain_mutex);
-
- /* Clear the irq_domain assignments */
-- for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) {
-- d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq));
-+ irq_domain_for_each_irq(domain, hwirq, irq) {
-+ d = irq_get_irq_data(irq);
- d->domain = NULL;
- }
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0147-genirq-Add-support-for-per-cpu-dev_id-interrupts.patch b/patches.kzm9g/0147-genirq-Add-support-for-per-cpu-dev_id-interrupts.patch
deleted file mode 100644
index 4f7bf8b3c9170b..00000000000000
--- a/patches.kzm9g/0147-genirq-Add-support-for-per-cpu-dev_id-interrupts.patch
+++ /dev/null
@@ -1,769 +0,0 @@
-From 2fa1dad96b9e8bff660071418480512a2539ce85 Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Fri, 23 Sep 2011 17:03:06 +0100
-Subject: genirq: Add support for per-cpu dev_id interrupts
-
-The ARM GIC interrupt controller offers per CPU interrupts (PPIs),
-which are usually used to connect local timers to each core. Each CPU
-has its own private interface to the GIC, and only sees the PPIs that
-are directly connect to it.
-
-While these timers are separate devices and have a separate interrupt
-line to a core, they all use the same IRQ number.
-
-For these devices, request_irq() is not the right API as it assumes
-that an IRQ number is visible by a number of CPUs (through the
-affinity setting), but makes it very awkward to express that an IRQ
-number can be handled by all CPUs, and yet be a different interrupt
-line on each CPU, requiring a different dev_id cookie to be passed
-back to the handler.
-
-The *_percpu_irq() functions is designed to overcome these
-limitations, by providing a per-cpu dev_id vector:
-
-int request_percpu_irq(unsigned int irq, irq_handler_t handler,
- const char *devname, void __percpu *percpu_dev_id);
-void free_percpu_irq(unsigned int, void __percpu *);
-int setup_percpu_irq(unsigned int irq, struct irqaction *new);
-void remove_percpu_irq(unsigned int irq, struct irqaction *act);
-void enable_percpu_irq(unsigned int irq);
-void disable_percpu_irq(unsigned int irq);
-
-The API has a number of limitations:
-- no interrupt sharing
-- no threading
-- common handler across all the CPUs
-
-Once the interrupt is requested using setup_percpu_irq() or
-request_percpu_irq(), it must be enabled by each core that wishes its
-local interrupt to be delivered.
-
-Based on an initial patch by Thomas Gleixner.
-
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-Cc: linux-arm-kernel@lists.infradead.org
-Link: http://lkml.kernel.org/r/1316793788-14500-2-git-send-email-marc.zyngier@arm.com
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit 31d9d9b6d83030f748d013e61502fa5477e2ac0e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/interrupt.h | 38 ++++++---
- include/linux/irq.h | 16 +++-
- include/linux/irqdesc.h | 1 +
- kernel/irq/chip.c | 64 +++++++++++++--
- kernel/irq/internals.h | 19 +++--
- kernel/irq/irqdesc.c | 32 +++++++-
- kernel/irq/manage.c | 202 +++++++++++++++++++++++++++++++++++++++++++---
- kernel/irq/settings.h | 7 ++
- 8 files changed, 345 insertions(+), 34 deletions(-)
-
-diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
-index b9490bf..6fe4e3c 100644
---- a/include/linux/interrupt.h
-+++ b/include/linux/interrupt.h
-@@ -98,6 +98,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
- * @flags: flags (see IRQF_* above)
- * @name: name of the device
- * @dev_id: cookie to identify the device
-+ * @percpu_dev_id: cookie to identify the device
- * @next: pointer to the next irqaction for shared interrupts
- * @irq: interrupt number
- * @dir: pointer to the proc/irq/NN/name entry
-@@ -107,17 +108,18 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
- * @thread_mask: bitmask for keeping track of @thread activity
- */
- struct irqaction {
-- irq_handler_t handler;
-- unsigned long flags;
-- void *dev_id;
-- struct irqaction *next;
-- int irq;
-- irq_handler_t thread_fn;
-- struct task_struct *thread;
-- unsigned long thread_flags;
-- unsigned long thread_mask;
-- const char *name;
-- struct proc_dir_entry *dir;
-+ irq_handler_t handler;
-+ unsigned long flags;
-+ void *dev_id;
-+ void __percpu *percpu_dev_id;
-+ struct irqaction *next;
-+ int irq;
-+ irq_handler_t thread_fn;
-+ struct task_struct *thread;
-+ unsigned long thread_flags;
-+ unsigned long thread_mask;
-+ const char *name;
-+ struct proc_dir_entry *dir;
- } ____cacheline_internodealigned_in_smp;
-
- extern irqreturn_t no_action(int cpl, void *dev_id);
-@@ -139,6 +141,10 @@ extern int __must_check
- request_any_context_irq(unsigned int irq, irq_handler_t handler,
- unsigned long flags, const char *name, void *dev_id);
-
-+extern int __must_check
-+request_percpu_irq(unsigned int irq, irq_handler_t handler,
-+ const char *devname, void __percpu *percpu_dev_id);
-+
- extern void exit_irq_thread(void);
- #else
-
-@@ -167,10 +173,18 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
- return request_irq(irq, handler, flags, name, dev_id);
- }
-
-+static inline int __must_check
-+request_percpu_irq(unsigned int irq, irq_handler_t handler,
-+ const char *devname, void __percpu *percpu_dev_id)
-+{
-+ return request_irq(irq, handler, 0, devname, percpu_dev_id);
-+}
-+
- static inline void exit_irq_thread(void) { }
- #endif
-
- extern void free_irq(unsigned int, void *);
-+extern void free_percpu_irq(unsigned int, void __percpu *);
-
- struct device;
-
-@@ -210,7 +224,9 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
-
- extern void disable_irq_nosync(unsigned int irq);
- extern void disable_irq(unsigned int irq);
-+extern void disable_percpu_irq(unsigned int irq);
- extern void enable_irq(unsigned int irq);
-+extern void enable_percpu_irq(unsigned int irq);
-
- /* The following three functions are for the core kernel use only. */
- #ifdef CONFIG_GENERIC_HARDIRQS
-diff --git a/include/linux/irq.h b/include/linux/irq.h
-index d65dfca..b6cbe62 100644
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -66,6 +66,7 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data);
- * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set)
- * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
- * IRQ_NESTED_TRHEAD - Interrupt nests into another thread
-+ * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable
- */
- enum {
- IRQ_TYPE_NONE = 0x00000000,
-@@ -88,12 +89,13 @@ enum {
- IRQ_MOVE_PCNTXT = (1 << 14),
- IRQ_NESTED_THREAD = (1 << 15),
- IRQ_NOTHREAD = (1 << 16),
-+ IRQ_PER_CPU_DEVID = (1 << 17),
- };
-
- #define IRQF_MODIFY_MASK \
- (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
- IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
-- IRQ_PER_CPU | IRQ_NESTED_THREAD)
-+ IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID)
-
- #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
-
-@@ -372,6 +374,8 @@ enum {
- struct irqaction;
- extern int setup_irq(unsigned int irq, struct irqaction *new);
- extern void remove_irq(unsigned int irq, struct irqaction *act);
-+extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
-+extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
-
- extern void irq_cpu_online(void);
- extern void irq_cpu_offline(void);
-@@ -399,6 +403,7 @@ extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
- extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
- extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
- extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
-+extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
- extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
- extern void handle_nested_irq(unsigned int irq);
-
-@@ -427,6 +432,8 @@ static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *c
- irq_set_chip_and_handler_name(irq, chip, handle, NULL);
- }
-
-+extern int irq_set_percpu_devid(unsigned int irq);
-+
- extern void
- __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
- const char *name);
-@@ -488,6 +495,13 @@ static inline void irq_set_nested_thread(unsigned int irq, bool nest)
- irq_clear_status_flags(irq, IRQ_NESTED_THREAD);
- }
-
-+static inline void irq_set_percpu_devid_flags(unsigned int irq)
-+{
-+ irq_set_status_flags(irq,
-+ IRQ_NOAUTOEN | IRQ_PER_CPU | IRQ_NOTHREAD |
-+ IRQ_NOPROBE | IRQ_PER_CPU_DEVID);
-+}
-+
- /* Handle dynamic irq creation and destruction */
- extern unsigned int create_irq_nr(unsigned int irq_want, int node);
- extern int create_irq(void);
-diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
-index 150134a..6b69c2c 100644
---- a/include/linux/irqdesc.h
-+++ b/include/linux/irqdesc.h
-@@ -53,6 +53,7 @@ struct irq_desc {
- unsigned long last_unhandled; /* Aging timer for unhandled count */
- unsigned int irqs_unhandled;
- raw_spinlock_t lock;
-+ struct cpumask *percpu_enabled;
- #ifdef CONFIG_SMP
- const struct cpumask *affinity_hint;
- struct irq_affinity_notify *affinity_notify;
-diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
-index 990965e..25784d6 100644
---- a/kernel/irq/chip.c
-+++ b/kernel/irq/chip.c
-@@ -26,7 +26,7 @@
- int irq_set_chip(unsigned int irq, struct irq_chip *chip)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
-
- if (!desc)
- return -EINVAL;
-@@ -54,7 +54,7 @@ EXPORT_SYMBOL(irq_set_chip);
- int irq_set_irq_type(unsigned int irq, unsigned int type)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
- int ret = 0;
-
- if (!desc)
-@@ -77,7 +77,7 @@ EXPORT_SYMBOL(irq_set_irq_type);
- int irq_set_handler_data(unsigned int irq, void *data)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
-
- if (!desc)
- return -EINVAL;
-@@ -97,7 +97,7 @@ EXPORT_SYMBOL(irq_set_handler_data);
- int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-
- if (!desc)
- return -EINVAL;
-@@ -118,7 +118,7 @@ int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
- int irq_set_chip_data(unsigned int irq, void *data)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
-
- if (!desc)
- return -EINVAL;
-@@ -206,6 +206,24 @@ void irq_disable(struct irq_desc *desc)
- }
- }
-
-+void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu)
-+{
-+ if (desc->irq_data.chip->irq_enable)
-+ desc->irq_data.chip->irq_enable(&desc->irq_data);
-+ else
-+ desc->irq_data.chip->irq_unmask(&desc->irq_data);
-+ cpumask_set_cpu(cpu, desc->percpu_enabled);
-+}
-+
-+void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu)
-+{
-+ if (desc->irq_data.chip->irq_disable)
-+ desc->irq_data.chip->irq_disable(&desc->irq_data);
-+ else
-+ desc->irq_data.chip->irq_mask(&desc->irq_data);
-+ cpumask_clear_cpu(cpu, desc->percpu_enabled);
-+}
-+
- static inline void mask_ack_irq(struct irq_desc *desc)
- {
- if (desc->irq_data.chip->irq_mask_ack)
-@@ -567,12 +585,44 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
- chip->irq_eoi(&desc->irq_data);
- }
-
-+/**
-+ * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
-+ * @irq: the interrupt number
-+ * @desc: the interrupt description structure for this irq
-+ *
-+ * Per CPU interrupts on SMP machines without locking requirements. Same as
-+ * handle_percpu_irq() above but with the following extras:
-+ *
-+ * action->percpu_dev_id is a pointer to percpu variables which
-+ * contain the real device id for the cpu on which this handler is
-+ * called
-+ */
-+void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)
-+{
-+ struct irq_chip *chip = irq_desc_get_chip(desc);
-+ struct irqaction *action = desc->action;
-+ void *dev_id = __this_cpu_ptr(action->percpu_dev_id);
-+ irqreturn_t res;
-+
-+ kstat_incr_irqs_this_cpu(irq, desc);
-+
-+ if (chip->irq_ack)
-+ chip->irq_ack(&desc->irq_data);
-+
-+ trace_irq_handler_entry(irq, action);
-+ res = action->handler(irq, dev_id);
-+ trace_irq_handler_exit(irq, action, res);
-+
-+ if (chip->irq_eoi)
-+ chip->irq_eoi(&desc->irq_data);
-+}
-+
- void
- __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
- const char *name)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0);
-
- if (!desc)
- return;
-@@ -616,7 +666,7 @@ irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
- void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
-
- if (!desc)
- return;
-diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
-index 62efdc4..e1a8b64 100644
---- a/kernel/irq/internals.h
-+++ b/kernel/irq/internals.h
-@@ -71,6 +71,8 @@ extern int irq_startup(struct irq_desc *desc, bool resend);
- extern void irq_shutdown(struct irq_desc *desc);
- extern void irq_enable(struct irq_desc *desc);
- extern void irq_disable(struct irq_desc *desc);
-+extern void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu);
-+extern void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu);
- extern void mask_irq(struct irq_desc *desc);
- extern void unmask_irq(struct irq_desc *desc);
-
-@@ -114,14 +116,21 @@ static inline void chip_bus_sync_unlock(struct irq_desc *desc)
- desc->irq_data.chip->irq_bus_sync_unlock(&desc->irq_data);
- }
-
-+#define _IRQ_DESC_CHECK (1 << 0)
-+#define _IRQ_DESC_PERCPU (1 << 1)
-+
-+#define IRQ_GET_DESC_CHECK_GLOBAL (_IRQ_DESC_CHECK)
-+#define IRQ_GET_DESC_CHECK_PERCPU (_IRQ_DESC_CHECK | _IRQ_DESC_PERCPU)
-+
- struct irq_desc *
--__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus);
-+__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
-+ unsigned int check);
- void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus);
-
- static inline struct irq_desc *
--irq_get_desc_buslock(unsigned int irq, unsigned long *flags)
-+irq_get_desc_buslock(unsigned int irq, unsigned long *flags, unsigned int check)
- {
-- return __irq_get_desc_lock(irq, flags, true);
-+ return __irq_get_desc_lock(irq, flags, true, check);
- }
-
- static inline void
-@@ -131,9 +140,9 @@ irq_put_desc_busunlock(struct irq_desc *desc, unsigned long flags)
- }
-
- static inline struct irq_desc *
--irq_get_desc_lock(unsigned int irq, unsigned long *flags)
-+irq_get_desc_lock(unsigned int irq, unsigned long *flags, unsigned int check)
- {
-- return __irq_get_desc_lock(irq, flags, false);
-+ return __irq_get_desc_lock(irq, flags, false, check);
- }
-
- static inline void
-diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
-index cb65d03..028e377 100644
---- a/kernel/irq/irqdesc.c
-+++ b/kernel/irq/irqdesc.c
-@@ -423,11 +423,22 @@ unsigned int irq_get_next_irq(unsigned int offset)
- }
-
- struct irq_desc *
--__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus)
-+__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
-+ unsigned int check)
- {
- struct irq_desc *desc = irq_to_desc(irq);
-
- if (desc) {
-+ if (check & _IRQ_DESC_CHECK) {
-+ if ((check & _IRQ_DESC_PERCPU) &&
-+ !irq_settings_is_per_cpu_devid(desc))
-+ return NULL;
-+
-+ if (!(check & _IRQ_DESC_PERCPU) &&
-+ irq_settings_is_per_cpu_devid(desc))
-+ return NULL;
-+ }
-+
- if (bus)
- chip_bus_lock(desc);
- raw_spin_lock_irqsave(&desc->lock, *flags);
-@@ -442,6 +453,25 @@ void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
- chip_bus_sync_unlock(desc);
- }
-
-+int irq_set_percpu_devid(unsigned int irq)
-+{
-+ struct irq_desc *desc = irq_to_desc(irq);
-+
-+ if (!desc)
-+ return -EINVAL;
-+
-+ if (desc->percpu_enabled)
-+ return -EINVAL;
-+
-+ desc->percpu_enabled = kzalloc(sizeof(*desc->percpu_enabled), GFP_KERNEL);
-+
-+ if (!desc->percpu_enabled)
-+ return -ENOMEM;
-+
-+ irq_set_percpu_devid_flags(irq);
-+ return 0;
-+}
-+
- /**
- * dynamic_irq_cleanup - cleanup a dynamically allocated irq
- * @irq: irq number to initialize
-diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
-index 83fb6f5..7923849 100644
---- a/kernel/irq/manage.c
-+++ b/kernel/irq/manage.c
-@@ -195,7 +195,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
- int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-
- if (!desc)
- return -EINVAL;
-@@ -356,7 +356,7 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
- static int __disable_irq_nosync(unsigned int irq)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-
- if (!desc)
- return -EINVAL;
-@@ -448,7 +448,7 @@ void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume)
- void enable_irq(unsigned int irq)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-
- if (!desc)
- return;
-@@ -491,7 +491,7 @@ static int set_irq_wake_real(unsigned int irq, unsigned int on)
- int irq_set_irq_wake(unsigned int irq, unsigned int on)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
- int ret = 0;
-
- if (!desc)
-@@ -532,7 +532,7 @@ EXPORT_SYMBOL(irq_set_irq_wake);
- int can_request_irq(unsigned int irq, unsigned long irqflags)
- {
- unsigned long flags;
-- struct irq_desc *desc = irq_get_desc_lock(irq, &flags);
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
- int canrequest = 0;
-
- if (!desc)
-@@ -1156,6 +1156,8 @@ int setup_irq(unsigned int irq, struct irqaction *act)
- int retval;
- struct irq_desc *desc = irq_to_desc(irq);
-
-+ if (WARN_ON(irq_settings_is_per_cpu_devid(desc)))
-+ return -EINVAL;
- chip_bus_lock(desc);
- retval = __setup_irq(irq, desc, act);
- chip_bus_sync_unlock(desc);
-@@ -1164,7 +1166,7 @@ int setup_irq(unsigned int irq, struct irqaction *act)
- }
- EXPORT_SYMBOL_GPL(setup_irq);
-
-- /*
-+/*
- * Internal function to unregister an irqaction - used to free
- * regular and special interrupts that are part of the architecture.
- */
-@@ -1262,7 +1264,10 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
- */
- void remove_irq(unsigned int irq, struct irqaction *act)
- {
-- __free_irq(irq, act->dev_id);
-+ struct irq_desc *desc = irq_to_desc(irq);
-+
-+ if (desc && !WARN_ON(irq_settings_is_per_cpu_devid(desc)))
-+ __free_irq(irq, act->dev_id);
- }
- EXPORT_SYMBOL_GPL(remove_irq);
-
-@@ -1284,7 +1289,7 @@ void free_irq(unsigned int irq, void *dev_id)
- {
- struct irq_desc *desc = irq_to_desc(irq);
-
-- if (!desc)
-+ if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
- return;
-
- #ifdef CONFIG_SMP
-@@ -1362,7 +1367,8 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
- if (!desc)
- return -EINVAL;
-
-- if (!irq_settings_can_request(desc))
-+ if (!irq_settings_can_request(desc) ||
-+ WARN_ON(irq_settings_is_per_cpu_devid(desc)))
- return -EINVAL;
-
- if (!handler) {
-@@ -1447,3 +1453,181 @@ int request_any_context_irq(unsigned int irq, irq_handler_t handler,
- return !ret ? IRQC_IS_HARDIRQ : ret;
- }
- EXPORT_SYMBOL_GPL(request_any_context_irq);
-+
-+void enable_percpu_irq(unsigned int irq)
-+{
-+ unsigned int cpu = smp_processor_id();
-+ unsigned long flags;
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
-+
-+ if (!desc)
-+ return;
-+
-+ irq_percpu_enable(desc, cpu);
-+ irq_put_desc_unlock(desc, flags);
-+}
-+
-+void disable_percpu_irq(unsigned int irq)
-+{
-+ unsigned int cpu = smp_processor_id();
-+ unsigned long flags;
-+ struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
-+
-+ if (!desc)
-+ return;
-+
-+ irq_percpu_disable(desc, cpu);
-+ irq_put_desc_unlock(desc, flags);
-+}
-+
-+/*
-+ * Internal function to unregister a percpu irqaction.
-+ */
-+static struct irqaction *__free_percpu_irq(unsigned int irq, void __percpu *dev_id)
-+{
-+ struct irq_desc *desc = irq_to_desc(irq);
-+ struct irqaction *action;
-+ unsigned long flags;
-+
-+ WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq);
-+
-+ if (!desc)
-+ return NULL;
-+
-+ raw_spin_lock_irqsave(&desc->lock, flags);
-+
-+ action = desc->action;
-+ if (!action || action->percpu_dev_id != dev_id) {
-+ WARN(1, "Trying to free already-free IRQ %d\n", irq);
-+ goto bad;
-+ }
-+
-+ if (!cpumask_empty(desc->percpu_enabled)) {
-+ WARN(1, "percpu IRQ %d still enabled on CPU%d!\n",
-+ irq, cpumask_first(desc->percpu_enabled));
-+ goto bad;
-+ }
-+
-+ /* Found it - now remove it from the list of entries: */
-+ desc->action = NULL;
-+
-+ raw_spin_unlock_irqrestore(&desc->lock, flags);
-+
-+ unregister_handler_proc(irq, action);
-+
-+ module_put(desc->owner);
-+ return action;
-+
-+bad:
-+ raw_spin_unlock_irqrestore(&desc->lock, flags);
-+ return NULL;
-+}
-+
-+/**
-+ * remove_percpu_irq - free a per-cpu interrupt
-+ * @irq: Interrupt line to free
-+ * @act: irqaction for the interrupt
-+ *
-+ * Used to remove interrupts statically setup by the early boot process.
-+ */
-+void remove_percpu_irq(unsigned int irq, struct irqaction *act)
-+{
-+ struct irq_desc *desc = irq_to_desc(irq);
-+
-+ if (desc && irq_settings_is_per_cpu_devid(desc))
-+ __free_percpu_irq(irq, act->percpu_dev_id);
-+}
-+
-+/**
-+ * free_percpu_irq - free an interrupt allocated with request_percpu_irq
-+ * @irq: Interrupt line to free
-+ * @dev_id: Device identity to free
-+ *
-+ * Remove a percpu interrupt handler. The handler is removed, but
-+ * the interrupt line is not disabled. This must be done on each
-+ * CPU before calling this function. The function does not return
-+ * until any executing interrupts for this IRQ have completed.
-+ *
-+ * This function must not be called from interrupt context.
-+ */
-+void free_percpu_irq(unsigned int irq, void __percpu *dev_id)
-+{
-+ struct irq_desc *desc = irq_to_desc(irq);
-+
-+ if (!desc || !irq_settings_is_per_cpu_devid(desc))
-+ return;
-+
-+ chip_bus_lock(desc);
-+ kfree(__free_percpu_irq(irq, dev_id));
-+ chip_bus_sync_unlock(desc);
-+}
-+
-+/**
-+ * setup_percpu_irq - setup a per-cpu interrupt
-+ * @irq: Interrupt line to setup
-+ * @act: irqaction for the interrupt
-+ *
-+ * Used to statically setup per-cpu interrupts in the early boot process.
-+ */
-+int setup_percpu_irq(unsigned int irq, struct irqaction *act)
-+{
-+ struct irq_desc *desc = irq_to_desc(irq);
-+ int retval;
-+
-+ if (!desc || !irq_settings_is_per_cpu_devid(desc))
-+ return -EINVAL;
-+ chip_bus_lock(desc);
-+ retval = __setup_irq(irq, desc, act);
-+ chip_bus_sync_unlock(desc);
-+
-+ return retval;
-+}
-+
-+/**
-+ * request_percpu_irq - allocate a percpu interrupt line
-+ * @irq: Interrupt line to allocate
-+ * @handler: Function to be called when the IRQ occurs.
-+ * @devname: An ascii name for the claiming device
-+ * @dev_id: A percpu cookie passed back to the handler function
-+ *
-+ * This call allocates interrupt resources, but doesn't
-+ * automatically enable the interrupt. It has to be done on each
-+ * CPU using enable_percpu_irq().
-+ *
-+ * Dev_id must be globally unique. It is a per-cpu variable, and
-+ * the handler gets called with the interrupted CPU's instance of
-+ * that variable.
-+ */
-+int request_percpu_irq(unsigned int irq, irq_handler_t handler,
-+ const char *devname, void __percpu *dev_id)
-+{
-+ struct irqaction *action;
-+ struct irq_desc *desc;
-+ int retval;
-+
-+ if (!dev_id)
-+ return -EINVAL;
-+
-+ desc = irq_to_desc(irq);
-+ if (!desc || !irq_settings_can_request(desc) ||
-+ !irq_settings_is_per_cpu_devid(desc))
-+ return -EINVAL;
-+
-+ action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
-+ if (!action)
-+ return -ENOMEM;
-+
-+ action->handler = handler;
-+ action->flags = IRQF_PERCPU;
-+ action->name = devname;
-+ action->percpu_dev_id = dev_id;
-+
-+ chip_bus_lock(desc);
-+ retval = __setup_irq(irq, desc, action);
-+ chip_bus_sync_unlock(desc);
-+
-+ if (retval)
-+ kfree(action);
-+
-+ return retval;
-+}
-diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
-index f166783..1162f10 100644
---- a/kernel/irq/settings.h
-+++ b/kernel/irq/settings.h
-@@ -13,6 +13,7 @@ enum {
- _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT,
- _IRQ_NO_BALANCING = IRQ_NO_BALANCING,
- _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD,
-+ _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID,
- _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK,
- };
-
-@@ -24,6 +25,7 @@ enum {
- #define IRQ_NOTHREAD GOT_YOU_MORON
- #define IRQ_NOAUTOEN GOT_YOU_MORON
- #define IRQ_NESTED_THREAD GOT_YOU_MORON
-+#define IRQ_PER_CPU_DEVID GOT_YOU_MORON
- #undef IRQF_MODIFY_MASK
- #define IRQF_MODIFY_MASK GOT_YOU_MORON
-
-@@ -39,6 +41,11 @@ static inline bool irq_settings_is_per_cpu(struct irq_desc *desc)
- return desc->status_use_accessors & _IRQ_PER_CPU;
- }
-
-+static inline bool irq_settings_is_per_cpu_devid(struct irq_desc *desc)
-+{
-+ return desc->status_use_accessors & _IRQ_PER_CPU_DEVID;
-+}
-+
- static inline void irq_settings_set_per_cpu(struct irq_desc *desc)
- {
- desc->status_use_accessors |= _IRQ_PER_CPU;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0148-ARM-introduce-handle_IRQ-not-to-dump-exception-stack.patch b/patches.kzm9g/0148-ARM-introduce-handle_IRQ-not-to-dump-exception-stack.patch
deleted file mode 100644
index 32f68f4a6ed50c..00000000000000
--- a/patches.kzm9g/0148-ARM-introduce-handle_IRQ-not-to-dump-exception-stack.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From ef24b31c6a52daa9cdf20cfe63c5dab8c8186926 Mon Sep 17 00:00:00 2001
-From: Russell King - ARM Linux <linux@arm.linux.org.uk>
-Date: Mon, 11 Jul 2011 22:25:43 +0100
-Subject: ARM: introduce handle_IRQ() not to dump exception stack
-
-On Mon, Jul 11, 2011 at 3:52 PM, Russell King - ARM Linux
-<linux@arm.linux.org.uk> wrote:
-
-...
-
-> The __exception annotation on a function causes this to happen:
->
-> [<c002406c>] (asm_do_IRQ+0x6c/0x8c) from [<c0024b84>]
-> (__irq_svc+0x44/0xcc)
-> Exception stack(0xc3897c78 to 0xc3897cc0)
-> 7c60: 4022d320 4022e000
-> 7c80: 08000075 00001000 c32273c0 c03ce1c0 c2b49b78 4022d000 c2b420b4 00000001
-> 7ca0: 00000000 c3897cfc 00000000 c3897cc0 c00afc54 c002edd8 00000013 ffffffff
->
-> Where that stack dump represents the pt_regs for the exception which
-> happened. Any function found in while unwinding will cause this to
-> be printed.
->
-> If you insert a C function between the IRQ assembly and asm_do_IRQ,
-> the
-> dump you get from asm_do_IRQ will be the stack for your function,
-> not
-> the pt_regs. That makes the feature useless.
->
-
-When __irq_svc - or any of the other exception handling assembly code -
-calls the C code, the stack pointer will be pointing at the pt_regs
-structure.
-
-All the entry points into C code from the exception handling code are
-marked with __exception or __exception_irq_enter to indicate that they
-are one of the functions which has pt_regs above them.
-
-Normally, when you've entered asm_do_IRQ() you will have this stack
-layout (higher address towards top):
-
- pt_regs
- asm_do_IRQ frame
-
-If you insert a C function between the exception assembly code and
-asm_do_IRQ, you end up with this stack layout instead:
-
- pt_regs
- your function frame
- asm_do_IRQ frame
-
-This means when we unwind, we'll get to asm_do_IRQ, and rather than
-dumping out the pt_regs, we'll dump out your functions stack frame
-instead, because that's what is above the asm_do_IRQ stack frame
-rather than the expected pt_regs structure.
-
-The fix is to introduce handle_IRQ() for no exception stack dump, so
-it can be called with MULTI_IRQ_HANDLER is selected and a C function
-is between the assembly code and the actual IRQ handling code.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-(cherry picked from commit a4841e39f7ca85ee2a40803ebac6221c6d8822c0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/irq.h | 1 +
- arch/arm/kernel/irq.c | 19 ++++++++++++++-----
- 2 files changed, 15 insertions(+), 5 deletions(-)
-
-diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
-index 2721a58..5a526af 100644
---- a/arch/arm/include/asm/irq.h
-+++ b/arch/arm/include/asm/irq.h
-@@ -23,6 +23,7 @@ struct pt_regs;
- extern void migrate_irqs(void);
-
- extern void asm_do_IRQ(unsigned int, struct pt_regs *);
-+void handle_IRQ(unsigned int, struct pt_regs *);
- void init_IRQ(void);
-
- #endif
-diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
-index 83bbad0..dbc1f41 100644
---- a/arch/arm/kernel/irq.c
-+++ b/arch/arm/kernel/irq.c
-@@ -67,12 +67,12 @@ int arch_show_interrupts(struct seq_file *p, int prec)
- }
-
- /*
-- * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
-- * come via this function. Instead, they should provide their
-- * own 'handler'
-+ * handle_IRQ handles all hardware IRQ's. Decoded IRQs should
-+ * not come via this function. Instead, they should provide their
-+ * own 'handler'. Used by platform code implementing C-based 1st
-+ * level decoding.
- */
--asmlinkage void __exception_irq_entry
--asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
-+void handle_IRQ(unsigned int irq, struct pt_regs *regs)
- {
- struct pt_regs *old_regs = set_irq_regs(regs);
-
-@@ -97,6 +97,15 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
- set_irq_regs(old_regs);
- }
-
-+/*
-+ * asm_do_IRQ is the interface to be used from assembly code.
-+ */
-+asmlinkage void __exception_irq_entry
-+asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
-+{
-+ handle_IRQ(irq, regs);
-+}
-+
- void set_irq_flags(unsigned int irq, unsigned int iflags)
- {
- unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0149-ARM-GIC-move-gic_chip_data-structure-declaration-to-.patch b/patches.kzm9g/0149-ARM-GIC-move-gic_chip_data-structure-declaration-to-.patch
deleted file mode 100644
index fabd6f1a934fe0..00000000000000
--- a/patches.kzm9g/0149-ARM-GIC-move-gic_chip_data-structure-declaration-to-.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From eb34882abb20009f826539498f60d94406fd7aca Mon Sep 17 00:00:00 2001
-From: Changhwan Youn <chaos.youn@samsung.com>
-Date: Sat, 16 Jul 2011 10:49:47 +0900
-Subject: ARM: GIC: move gic_chip_data structure declaration to header
-
-Since Samsung EXYNOS4210 cannot support register banking in GIC,
-so needs to update CPU interface base address.
-The 'gic_chip_data' is used for it, this patch moves gic_chip_data
-structure declaraton to arch/arm/include/asm/hardware/gic.h to use
-it.
-
-Cc: Russell King <rmk+kernel@arm.linux.org.uk>
-Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
-Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-(cherry picked from commit e807acbc6fd1d5ff115f9a8eae0c1af6cf1c46c6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 6 ------
- arch/arm/include/asm/hardware/gic.h | 6 ++++++
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 4ddd0a6..23564ed 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -38,12 +38,6 @@ static DEFINE_SPINLOCK(irq_controller_lock);
- /* Address of GIC 0 CPU interface */
- void __iomem *gic_cpu_base_addr __read_mostly;
-
--struct gic_chip_data {
-- unsigned int irq_offset;
-- void __iomem *dist_base;
-- void __iomem *cpu_base;
--};
--
- /*
- * Supported arch specific GIC irq extension.
- * Default make them NULL.
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index 0691f9d..435d3f8 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -41,6 +41,12 @@ void gic_secondary_init(unsigned int);
- void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
- void gic_enable_ppi(unsigned int);
-+
-+struct gic_chip_data {
-+ unsigned int irq_offset;
-+ void __iomem *dist_base;
-+ void __iomem *cpu_base;
-+};
- #endif
-
- #endif
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0150-ARM-CPU-hotplug-fix-abuse-of-irqdesc-node.patch b/patches.kzm9g/0150-ARM-CPU-hotplug-fix-abuse-of-irqdesc-node.patch
deleted file mode 100644
index d0fe540f728d32..00000000000000
--- a/patches.kzm9g/0150-ARM-CPU-hotplug-fix-abuse-of-irqdesc-node.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 937519bccf58b2af70bfaf0b199c9fe8a6bab3b5 Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Thu, 21 Jul 2011 14:51:13 +0100
-Subject: ARM: CPU hotplug: fix abuse of irqdesc->node
-
-irqdesc's node member is supposed to mark the numa node number for the
-interrupt. Our use of it is non-standard. Remove this, replacing the
-functionality with a test of the affinity mask.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 2ef75701d1711a1feee2a82b42a2597ddc05f88b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 1 -
- arch/arm/kernel/irq.c | 10 ++--------
- 2 files changed, 2 insertions(+), 9 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 23564ed..2ba61e5 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -183,7 +183,6 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
- bit = 1 << (cpu + shift);
-
- spin_lock(&irq_controller_lock);
-- d->node = cpu;
- val = readl_relaxed(reg) & ~mask;
- writel_relaxed(val | bit, reg);
- spin_unlock(&irq_controller_lock);
-diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
-index dbc1f41..3e34b1f 100644
---- a/arch/arm/kernel/irq.c
-+++ b/arch/arm/kernel/irq.c
-@@ -175,15 +175,9 @@ void migrate_irqs(void)
- bool affinity_broken = false;
-
- raw_spin_lock(&desc->lock);
-- do {
-- if (desc->action == NULL)
-- break;
--
-- if (d->node != cpu)
-- break;
--
-+ if (desc->action != NULL &&
-+ cpumask_test_cpu(smp_processor_id(), d->affinity))
- affinity_broken = migrate_one_irq(d);
-- } while (0);
- raw_spin_unlock(&desc->lock);
-
- if (affinity_broken && printk_ratelimit())
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0151-ARM-GIC-avoid-routing-interrupts-to-offline-CPUs.patch b/patches.kzm9g/0151-ARM-GIC-avoid-routing-interrupts-to-offline-CPUs.patch
deleted file mode 100644
index dcf5e862855203..00000000000000
--- a/patches.kzm9g/0151-ARM-GIC-avoid-routing-interrupts-to-offline-CPUs.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From aada114ebfda78d2fba02d654fa67b075e31d27d Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Thu, 21 Jul 2011 15:00:57 +0100
-Subject: ARM: GIC: avoid routing interrupts to offline CPUs
-
-The irq_set_affinity() method can be called with masks which include
-offline CPUs. This allows offline CPUs to have interrupts routed to
-them by writing to /proc/irq/*/smp_affinity after hotplug has taken
-a CPU offline. Fix this by ensuring that we select a target CPU
-present in both the required affinity and the online CPU mask.
-
-Ensure that we return IRQ_SET_MASK_OK (which happens to be 0) on
-success to ensure generic code copies the new mask into the irq_data
-structure.
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 5dfc54e087c15f823ee9b6541d2f0f314e69cbed)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 2ba61e5..3227ca9 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -173,10 +173,10 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
- {
- void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
- unsigned int shift = (d->irq % 4) * 8;
-- unsigned int cpu = cpumask_first(mask_val);
-+ unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
- u32 val, mask, bit;
-
-- if (cpu >= 8)
-+ if (cpu >= 8 || cpu >= nr_cpu_ids)
- return -EINVAL;
-
- mask = 0xff << shift;
-@@ -187,7 +187,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
- writel_relaxed(val | bit, reg);
- spin_unlock(&irq_controller_lock);
-
-- return 0;
-+ return IRQ_SET_MASK_OK;
- }
- #endif
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0152-ARM-gic-Use-cpu-pm-notifiers-to-save-gic-state.patch b/patches.kzm9g/0152-ARM-gic-Use-cpu-pm-notifiers-to-save-gic-state.patch
deleted file mode 100644
index 6e4f4718efcfe6..00000000000000
--- a/patches.kzm9g/0152-ARM-gic-Use-cpu-pm-notifiers-to-save-gic-state.patch
+++ /dev/null
@@ -1,268 +0,0 @@
-From ca0bcbc7836024b138b86d00c9c8e61c14ad4716 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Thu, 10 Feb 2011 12:54:10 -0800
-Subject: ARM: gic: Use cpu pm notifiers to save gic state
-
-When the cpu is powered down in a low power mode, the gic cpu
-interface may be reset, and when the cpu cluster is powered
-down, the gic distributor may also be reset.
-
-This patch uses CPU_PM_ENTER and CPU_PM_EXIT notifiers to save
-and restore the gic cpu interface registers, and the
-CPU_CLUSTER_PM_ENTER and CPU_CLUSTER_PM_EXIT notifiers to save
-and restore the gic distributor registers.
-
-Original-author: Gary King <gking@nvidia.com>
-Signed-off-by: Colin Cross <ccross@android.com>
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Tested-and-Acked-by: Shawn Guo <shawn.guo@linaro.org>
-Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
-(cherry picked from commit 254056f3b12563c11e6dbcfad2fbfce20a4f3302)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 187 ++++++++++++++++++++++++++++++++++++
- arch/arm/include/asm/hardware/gic.h | 8 ++
- 2 files changed, 195 insertions(+)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 3227ca9..66c7c48 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -26,6 +26,7 @@
- #include <linux/kernel.h>
- #include <linux/list.h>
- #include <linux/smp.h>
-+#include <linux/cpu_pm.h>
- #include <linux/cpumask.h>
- #include <linux/io.h>
-
-@@ -276,6 +277,8 @@ static void __init gic_dist_init(struct gic_chip_data *gic,
- if (gic_irqs > 1020)
- gic_irqs = 1020;
-
-+ gic->gic_irqs = gic_irqs;
-+
- /*
- * Set all global interrupts to be level triggered, active low.
- */
-@@ -343,6 +346,189 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
- writel_relaxed(1, base + GIC_CPU_CTRL);
- }
-
-+#ifdef CONFIG_CPU_PM
-+/*
-+ * Saves the GIC distributor registers during suspend or idle. Must be called
-+ * with interrupts disabled but before powering down the GIC. After calling
-+ * this function, no interrupts will be delivered by the GIC, and another
-+ * platform-specific wakeup source must be enabled.
-+ */
-+static void gic_dist_save(unsigned int gic_nr)
-+{
-+ unsigned int gic_irqs;
-+ void __iomem *dist_base;
-+ int i;
-+
-+ if (gic_nr >= MAX_GIC_NR)
-+ BUG();
-+
-+ gic_irqs = gic_data[gic_nr].gic_irqs;
-+ dist_base = gic_data[gic_nr].dist_base;
-+
-+ if (!dist_base)
-+ return;
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
-+ gic_data[gic_nr].saved_spi_conf[i] =
-+ readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-+ gic_data[gic_nr].saved_spi_target[i] =
-+ readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
-+ gic_data[gic_nr].saved_spi_enable[i] =
-+ readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
-+}
-+
-+/*
-+ * Restores the GIC distributor registers during resume or when coming out of
-+ * idle. Must be called before enabling interrupts. If a level interrupt
-+ * that occured while the GIC was suspended is still present, it will be
-+ * handled normally, but any edge interrupts that occured will not be seen by
-+ * the GIC and need to be handled by the platform-specific wakeup source.
-+ */
-+static void gic_dist_restore(unsigned int gic_nr)
-+{
-+ unsigned int gic_irqs;
-+ unsigned int i;
-+ void __iomem *dist_base;
-+
-+ if (gic_nr >= MAX_GIC_NR)
-+ BUG();
-+
-+ gic_irqs = gic_data[gic_nr].gic_irqs;
-+ dist_base = gic_data[gic_nr].dist_base;
-+
-+ if (!dist_base)
-+ return;
-+
-+ writel_relaxed(0, dist_base + GIC_DIST_CTRL);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
-+ writel_relaxed(gic_data[gic_nr].saved_spi_conf[i],
-+ dist_base + GIC_DIST_CONFIG + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-+ writel_relaxed(0xa0a0a0a0,
-+ dist_base + GIC_DIST_PRI + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-+ writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
-+ dist_base + GIC_DIST_TARGET + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
-+ writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
-+ dist_base + GIC_DIST_ENABLE_SET + i * 4);
-+
-+ writel_relaxed(1, dist_base + GIC_DIST_CTRL);
-+}
-+
-+static void gic_cpu_save(unsigned int gic_nr)
-+{
-+ int i;
-+ u32 *ptr;
-+ void __iomem *dist_base;
-+ void __iomem *cpu_base;
-+
-+ if (gic_nr >= MAX_GIC_NR)
-+ BUG();
-+
-+ dist_base = gic_data[gic_nr].dist_base;
-+ cpu_base = gic_data[gic_nr].cpu_base;
-+
-+ if (!dist_base || !cpu_base)
-+ return;
-+
-+ ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
-+ for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
-+ ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
-+
-+ ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
-+ for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
-+ ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
-+
-+}
-+
-+static void gic_cpu_restore(unsigned int gic_nr)
-+{
-+ int i;
-+ u32 *ptr;
-+ void __iomem *dist_base;
-+ void __iomem *cpu_base;
-+
-+ if (gic_nr >= MAX_GIC_NR)
-+ BUG();
-+
-+ dist_base = gic_data[gic_nr].dist_base;
-+ cpu_base = gic_data[gic_nr].cpu_base;
-+
-+ if (!dist_base || !cpu_base)
-+ return;
-+
-+ ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
-+ for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
-+ writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
-+
-+ ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
-+ for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
-+ writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
-+
-+ for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
-+ writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4);
-+
-+ writel_relaxed(0xf0, cpu_base + GIC_CPU_PRIMASK);
-+ writel_relaxed(1, cpu_base + GIC_CPU_CTRL);
-+}
-+
-+static int gic_notifier(struct notifier_block *self, unsigned long cmd, void *v)
-+{
-+ int i;
-+
-+ for (i = 0; i < MAX_GIC_NR; i++) {
-+ switch (cmd) {
-+ case CPU_PM_ENTER:
-+ gic_cpu_save(i);
-+ break;
-+ case CPU_PM_ENTER_FAILED:
-+ case CPU_PM_EXIT:
-+ gic_cpu_restore(i);
-+ break;
-+ case CPU_CLUSTER_PM_ENTER:
-+ gic_dist_save(i);
-+ break;
-+ case CPU_CLUSTER_PM_ENTER_FAILED:
-+ case CPU_CLUSTER_PM_EXIT:
-+ gic_dist_restore(i);
-+ break;
-+ }
-+ }
-+
-+ return NOTIFY_OK;
-+}
-+
-+static struct notifier_block gic_notifier_block = {
-+ .notifier_call = gic_notifier,
-+};
-+
-+static void __init gic_pm_init(struct gic_chip_data *gic)
-+{
-+ gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
-+ sizeof(u32));
-+ BUG_ON(!gic->saved_ppi_enable);
-+
-+ gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
-+ sizeof(u32));
-+ BUG_ON(!gic->saved_ppi_conf);
-+
-+ cpu_pm_register_notifier(&gic_notifier_block);
-+}
-+#else
-+static void __init gic_pm_init(struct gic_chip_data *gic)
-+{
-+}
-+#endif
-+
- void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
- void __iomem *dist_base, void __iomem *cpu_base)
- {
-@@ -360,6 +546,7 @@ void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
-
- gic_dist_init(gic, irq_start);
- gic_cpu_init(gic);
-+ gic_pm_init(gic);
- }
-
- void __cpuinit gic_secondary_init(unsigned int gic_nr)
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index 435d3f8..c562705 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -46,6 +46,14 @@ struct gic_chip_data {
- unsigned int irq_offset;
- void __iomem *dist_base;
- void __iomem *cpu_base;
-+#ifdef CONFIG_CPU_PM
-+ u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
-+ u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
-+ u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
-+ u32 __percpu *saved_ppi_enable;
-+ u32 __percpu *saved_ppi_conf;
-+#endif
-+ unsigned int gic_irqs;
- };
- #endif
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0153-ARM-7011-1-Add-ARM-cpu-topology-definition.patch b/patches.kzm9g/0153-ARM-7011-1-Add-ARM-cpu-topology-definition.patch
deleted file mode 100644
index f61fa457bdfa19..00000000000000
--- a/patches.kzm9g/0153-ARM-7011-1-Add-ARM-cpu-topology-definition.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-From b20aa3f7ccd0f3add1c52a930cac2efa98acda7d Mon Sep 17 00:00:00 2001
-From: Vincent Guittot <vincent.guittot@linaro.org>
-Date: Mon, 8 Aug 2011 13:21:59 +0100
-Subject: ARM: 7011/1: Add ARM cpu topology definition
-
-The affinity between ARM processors is defined in the MPIDR register.
-We can identify which processors are in the same cluster,
-and which ones have performance interdependency. We can define the
-cpu topology of ARM platform, that is then used by sched_mc and sched_smt.
-
-The default state of sched_mc and sched_smt config is disable.
-When enabled, the behavior of the scheduler can be modified with
-sched_mc_power_savings and sched_smt_power_savings sysfs interfaces.
-
-Changes since v4 :
-* Remove unnecessary parentheses and blank lines
-
-Changes since v3 :
-* Update the format of printk message
-* Remove blank line
-
-Changes since v2 :
-* Update the commit message and some comments
-
-Changes since v1 :
-* Update the commit message
-* Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h
-* Modify header of arch/arm/kernel/topology.c
-* Modify tests and manipulation of MPIDR's bitfields
-* Modify the place and dependancy of the config
-* Modify Noop functions
-
-Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
-Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit c9018aab8eee24b993c12c7aff7fc99d3d73f298)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/Kconfig | 25 +++++++
- arch/arm/include/asm/cputype.h | 6 ++
- arch/arm/include/asm/topology.h | 33 +++++++++
- arch/arm/kernel/Makefile | 1 +
- arch/arm/kernel/smp.c | 5 ++
- arch/arm/kernel/topology.c | 148 ++++++++++++++++++++++++++++++++++++++++
- 6 files changed, 218 insertions(+)
- create mode 100644 arch/arm/kernel/topology.c
-
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index d7f1a02..7692bca 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -1370,6 +1370,31 @@ config SMP_ON_UP
-
- If you don't know what to do here, say Y.
-
-+config ARM_CPU_TOPOLOGY
-+ bool "Support cpu topology definition"
-+ depends on SMP && CPU_V7
-+ default y
-+ help
-+ Support ARM cpu topology definition. The MPIDR register defines
-+ affinity between processors which is then used to describe the cpu
-+ topology of an ARM System.
-+
-+config SCHED_MC
-+ bool "Multi-core scheduler support"
-+ depends on ARM_CPU_TOPOLOGY
-+ help
-+ Multi-core scheduler support improves the CPU scheduler's decision
-+ making when dealing with multi-core CPU chips at a cost of slightly
-+ increased overhead in some places. If unsure say N here.
-+
-+config SCHED_SMT
-+ bool "SMT scheduler support"
-+ depends on ARM_CPU_TOPOLOGY
-+ help
-+ Improves the CPU scheduler's decision making when dealing with
-+ MultiThreading at a cost of slightly increased overhead in some
-+ places. If unsure say N here.
-+
- config HAVE_ARM_SCU
- bool
- depends on SMP
-diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
-index cd4458f..cb47d28 100644
---- a/arch/arm/include/asm/cputype.h
-+++ b/arch/arm/include/asm/cputype.h
-@@ -8,6 +8,7 @@
- #define CPUID_CACHETYPE 1
- #define CPUID_TCM 2
- #define CPUID_TLBTYPE 3
-+#define CPUID_MPIDR 5
-
- #define CPUID_EXT_PFR0 "c1, 0"
- #define CPUID_EXT_PFR1 "c1, 1"
-@@ -70,6 +71,11 @@ static inline unsigned int __attribute_const__ read_cpuid_tcmstatus(void)
- return read_cpuid(CPUID_TCM);
- }
-
-+static inline unsigned int __attribute_const__ read_cpuid_mpidr(void)
-+{
-+ return read_cpuid(CPUID_MPIDR);
-+}
-+
- /*
- * Intel's XScale3 core supports some v6 features (supersections, L2)
- * but advertises itself as v5 as it does not support the v6 ISA. For
-diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h
-index accbd7c..a7e457e 100644
---- a/arch/arm/include/asm/topology.h
-+++ b/arch/arm/include/asm/topology.h
-@@ -1,6 +1,39 @@
- #ifndef _ASM_ARM_TOPOLOGY_H
- #define _ASM_ARM_TOPOLOGY_H
-
-+#ifdef CONFIG_ARM_CPU_TOPOLOGY
-+
-+#include <linux/cpumask.h>
-+
-+struct cputopo_arm {
-+ int thread_id;
-+ int core_id;
-+ int socket_id;
-+ cpumask_t thread_sibling;
-+ cpumask_t core_sibling;
-+};
-+
-+extern struct cputopo_arm cpu_topology[NR_CPUS];
-+
-+#define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
-+#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
-+#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
-+#define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
-+
-+#define mc_capable() (cpu_topology[0].socket_id != -1)
-+#define smt_capable() (cpu_topology[0].thread_id != -1)
-+
-+void init_cpu_topology(void);
-+void store_cpu_topology(unsigned int cpuid);
-+const struct cpumask *cpu_coregroup_mask(unsigned int cpu);
-+
-+#else
-+
-+static inline void init_cpu_topology(void) { }
-+static inline void store_cpu_topology(unsigned int cpuid) { }
-+
-+#endif
-+
- #include <asm-generic/topology.h>
-
- #endif /* _ASM_ARM_TOPOLOGY_H */
-diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
-index a5b31af..816a481 100644
---- a/arch/arm/kernel/Makefile
-+++ b/arch/arm/kernel/Makefile
-@@ -61,6 +61,7 @@ obj-$(CONFIG_IWMMXT) += iwmmxt.o
- obj-$(CONFIG_CPU_HAS_PMU) += pmu.o
- obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
- AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
-+obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
-
- ifneq ($(CONFIG_ARCH_EBSA110),y)
- obj-y += io.o
-diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index e7f92a4..8e3a000 100644
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -31,6 +31,7 @@
- #include <asm/cacheflush.h>
- #include <asm/cpu.h>
- #include <asm/cputype.h>
-+#include <asm/topology.h>
- #include <asm/mmu_context.h>
- #include <asm/pgtable.h>
- #include <asm/pgalloc.h>
-@@ -268,6 +269,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
- struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
-
- cpu_info->loops_per_jiffy = loops_per_jiffy;
-+
-+ store_cpu_topology(cpuid);
- }
-
- /*
-@@ -358,6 +361,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
- {
- unsigned int ncores = num_possible_cpus();
-
-+ init_cpu_topology();
-+
- smp_store_cpu_info(smp_processor_id());
-
- /*
-diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
-new file mode 100644
-index 0000000..1040c00
---- /dev/null
-+++ b/arch/arm/kernel/topology.c
-@@ -0,0 +1,148 @@
-+/*
-+ * arch/arm/kernel/topology.c
-+ *
-+ * Copyright (C) 2011 Linaro Limited.
-+ * Written by: Vincent Guittot
-+ *
-+ * based on arch/sh/kernel/topology.c
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ */
-+
-+#include <linux/cpu.h>
-+#include <linux/cpumask.h>
-+#include <linux/init.h>
-+#include <linux/percpu.h>
-+#include <linux/node.h>
-+#include <linux/nodemask.h>
-+#include <linux/sched.h>
-+
-+#include <asm/cputype.h>
-+#include <asm/topology.h>
-+
-+#define MPIDR_SMP_BITMASK (0x3 << 30)
-+#define MPIDR_SMP_VALUE (0x2 << 30)
-+
-+#define MPIDR_MT_BITMASK (0x1 << 24)
-+
-+/*
-+ * These masks reflect the current use of the affinity levels.
-+ * The affinity level can be up to 16 bits according to ARM ARM
-+ */
-+
-+#define MPIDR_LEVEL0_MASK 0x3
-+#define MPIDR_LEVEL0_SHIFT 0
-+
-+#define MPIDR_LEVEL1_MASK 0xF
-+#define MPIDR_LEVEL1_SHIFT 8
-+
-+#define MPIDR_LEVEL2_MASK 0xFF
-+#define MPIDR_LEVEL2_SHIFT 16
-+
-+struct cputopo_arm cpu_topology[NR_CPUS];
-+
-+const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
-+{
-+ return &cpu_topology[cpu].core_sibling;
-+}
-+
-+/*
-+ * store_cpu_topology is called at boot when only one cpu is running
-+ * and with the mutex cpu_hotplug.lock locked, when several cpus have booted,
-+ * which prevents simultaneous write access to cpu_topology array
-+ */
-+void store_cpu_topology(unsigned int cpuid)
-+{
-+ struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid];
-+ unsigned int mpidr;
-+ unsigned int cpu;
-+
-+ /* If the cpu topology has been already set, just return */
-+ if (cpuid_topo->core_id != -1)
-+ return;
-+
-+ mpidr = read_cpuid_mpidr();
-+
-+ /* create cpu topology mapping */
-+ if ((mpidr & MPIDR_SMP_BITMASK) == MPIDR_SMP_VALUE) {
-+ /*
-+ * This is a multiprocessor system
-+ * multiprocessor format & multiprocessor mode field are set
-+ */
-+
-+ if (mpidr & MPIDR_MT_BITMASK) {
-+ /* core performance interdependency */
-+ cpuid_topo->thread_id = (mpidr >> MPIDR_LEVEL0_SHIFT)
-+ & MPIDR_LEVEL0_MASK;
-+ cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL1_SHIFT)
-+ & MPIDR_LEVEL1_MASK;
-+ cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL2_SHIFT)
-+ & MPIDR_LEVEL2_MASK;
-+ } else {
-+ /* largely independent cores */
-+ cpuid_topo->thread_id = -1;
-+ cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL0_SHIFT)
-+ & MPIDR_LEVEL0_MASK;
-+ cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL1_SHIFT)
-+ & MPIDR_LEVEL1_MASK;
-+ }
-+ } else {
-+ /*
-+ * This is an uniprocessor system
-+ * we are in multiprocessor format but uniprocessor system
-+ * or in the old uniprocessor format
-+ */
-+ cpuid_topo->thread_id = -1;
-+ cpuid_topo->core_id = 0;
-+ cpuid_topo->socket_id = -1;
-+ }
-+
-+ /* update core and thread sibling masks */
-+ for_each_possible_cpu(cpu) {
-+ struct cputopo_arm *cpu_topo = &cpu_topology[cpu];
-+
-+ if (cpuid_topo->socket_id == cpu_topo->socket_id) {
-+ cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
-+ if (cpu != cpuid)
-+ cpumask_set_cpu(cpu,
-+ &cpuid_topo->core_sibling);
-+
-+ if (cpuid_topo->core_id == cpu_topo->core_id) {
-+ cpumask_set_cpu(cpuid,
-+ &cpu_topo->thread_sibling);
-+ if (cpu != cpuid)
-+ cpumask_set_cpu(cpu,
-+ &cpuid_topo->thread_sibling);
-+ }
-+ }
-+ }
-+ smp_wmb();
-+
-+ printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
-+ cpuid, cpu_topology[cpuid].thread_id,
-+ cpu_topology[cpuid].core_id,
-+ cpu_topology[cpuid].socket_id, mpidr);
-+}
-+
-+/*
-+ * init_cpu_topology is called at boot when only one cpu is running
-+ * which prevent simultaneous write access to cpu_topology array
-+ */
-+void init_cpu_topology(void)
-+{
-+ unsigned int cpu;
-+
-+ /* init core mask */
-+ for_each_possible_cpu(cpu) {
-+ struct cputopo_arm *cpu_topo = &(cpu_topology[cpu]);
-+
-+ cpu_topo->thread_id = -1;
-+ cpu_topo->core_id = -1;
-+ cpu_topo->socket_id = -1;
-+ cpumask_clear(&cpu_topo->core_sibling);
-+ cpumask_clear(&cpu_topo->thread_sibling);
-+ }
-+ smp_wmb();
-+}
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0154-ARM-7060-1-smp-populate-logical-CPU-mapping-during-b.patch b/patches.kzm9g/0154-ARM-7060-1-smp-populate-logical-CPU-mapping-during-b.patch
deleted file mode 100644
index 8fca38f510a270..00000000000000
--- a/patches.kzm9g/0154-ARM-7060-1-smp-populate-logical-CPU-mapping-during-b.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From febe036de3201edeaadd1290d3cee9544b1b05f3 Mon Sep 17 00:00:00 2001
-From: Will Deacon <will.deacon@arm.com>
-Date: Tue, 23 Aug 2011 22:19:29 +0100
-Subject: ARM: 7060/1: smp: populate logical CPU mapping during boot
-
-To allow booting Linux on a CPU with physical ID != 0, we need to
-provide a mapping from the logical CPU number to the physical CPU
-number.
-
-This patch adds such a mapping and populates it during boot.
-
-Signed-off-by: Will Deacon <will.deacon@arm.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit d6257288c4052465feeff7e283e35ec0ed06ca03)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/smp.h | 6 ++++++
- arch/arm/kernel/smp.c | 15 +++++++++++++++
- 2 files changed, 21 insertions(+)
-
-diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
-index e42d96a..674ebcd 100644
---- a/arch/arm/include/asm/smp.h
-+++ b/arch/arm/include/asm/smp.h
-@@ -66,6 +66,12 @@ extern void platform_secondary_init(unsigned int cpu);
- extern void platform_smp_prepare_cpus(unsigned int);
-
- /*
-+ * Logical CPU mapping.
-+ */
-+extern int __cpu_logical_map[NR_CPUS];
-+#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
-+
-+/*
- * Initial data for bringing up a secondary CPU.
- */
- struct secondary_data {
-diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index 8e3a000..4db266c 100644
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -40,6 +40,7 @@
- #include <asm/tlbflush.h>
- #include <asm/ptrace.h>
- #include <asm/localtimer.h>
-+#include <asm/smp_plat.h>
-
- /*
- * as from 2.5, kernels no longer have an init_tasks structure
-@@ -260,6 +261,20 @@ void __ref cpu_die(void)
- }
- #endif /* CONFIG_HOTPLUG_CPU */
-
-+int __cpu_logical_map[NR_CPUS];
-+
-+void __init smp_setup_processor_id(void)
-+{
-+ int i;
-+ u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0;
-+
-+ cpu_logical_map(0) = cpu;
-+ for (i = 1; i < NR_CPUS; ++i)
-+ cpu_logical_map(i) = i == cpu ? 0 : i;
-+
-+ printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu);
-+}
-+
- /*
- * Called by both boot and secondaries to move global data into
- * per-processor storage.
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0155-ARM-gic-Allow-gic-arch-extensions-to-provide-irqchip.patch b/patches.kzm9g/0155-ARM-gic-Allow-gic-arch-extensions-to-provide-irqchip.patch
deleted file mode 100644
index d913adce00a8eb..00000000000000
--- a/patches.kzm9g/0155-ARM-gic-Allow-gic-arch-extensions-to-provide-irqchip.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 601c8c40dd8e17083b060418bb630c87e168be86 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Mon, 13 Jun 2011 00:45:59 +0000
-Subject: ARM: gic: Allow gic arch extensions to provide irqchip flags
-
-Tegra can benefit from the IRQCHIP_MASK_ON_SUSPEND flag, allow it
-to be passed to the gic irq chip.
-
-Signed-off-by: Colin Cross <ccross@android.com>
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Tested-and-Acked-by: Shawn Guo <shawn.guo@linaro.org>
-Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
-(cherry picked from commit 9c12845ee49716209cb2b087c0b47c3e37096bde)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 66c7c48..734db99 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -544,6 +544,7 @@ void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
- if (gic_nr == 0)
- gic_cpu_base_addr = cpu_base;
-
-+ gic_chip.flags |= gic_arch_extn.flags;
- gic_dist_init(gic, irq_start);
- gic_cpu_init(gic);
- gic_pm_init(gic);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0156-ARM-7061-1-gic-convert-logical-CPU-numbers-into-phys.patch b/patches.kzm9g/0156-ARM-7061-1-gic-convert-logical-CPU-numbers-into-phys.patch
deleted file mode 100644
index 35ff5eafc18b63..00000000000000
--- a/patches.kzm9g/0156-ARM-7061-1-gic-convert-logical-CPU-numbers-into-phys.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 0ff6ee62ebe17adfa97c1847cc1d7aea76b49d55 Mon Sep 17 00:00:00 2001
-From: Will Deacon <will.deacon@arm.com>
-Date: Tue, 23 Aug 2011 22:20:03 +0100
-Subject: ARM: 7061/1: gic: convert logical CPU numbers into physical numbers
-
-The GIC driver must convert logical CPU numbers passed in from Linux
-into physical CPU numbers that are understood by the hardware.
-
-This patch uses the new cpu_logical_map macro for performing the
-conversion inside the GIC driver.
-
-Signed-off-by: Will Deacon <will.deacon@arm.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 267840f3397fd9f6a2bdde14de38b9d29d525d7b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 17 ++++++++++++++---
- 1 file changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 734db99..8b5be72 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -181,7 +181,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
- return -EINVAL;
-
- mask = 0xff << shift;
-- bit = 1 << (cpu + shift);
-+ bit = 1 << (cpu_logical_map(cpu) + shift);
-
- spin_lock(&irq_controller_lock);
- val = readl_relaxed(reg) & ~mask;
-@@ -260,9 +260,15 @@ static void __init gic_dist_init(struct gic_chip_data *gic,
- unsigned int irq_start)
- {
- unsigned int gic_irqs, irq_limit, i;
-+ u32 cpumask;
- void __iomem *base = gic->dist_base;
-- u32 cpumask = 1 << smp_processor_id();
-+ u32 cpu = 0;
-
-+#ifdef CONFIG_SMP
-+ cpu = cpu_logical_map(smp_processor_id());
-+#endif
-+
-+ cpumask = 1 << cpu;
- cpumask |= cpumask << 8;
- cpumask |= cpumask << 16;
-
-@@ -570,7 +576,12 @@ void __cpuinit gic_enable_ppi(unsigned int irq)
- #ifdef CONFIG_SMP
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
- {
-- unsigned long map = *cpus_addr(*mask);
-+ int cpu;
-+ unsigned long map = 0;
-+
-+ /* Convert our logical CPU mask into a physical one. */
-+ for_each_cpu(cpu, mask)
-+ map |= 1 << cpu_logical_map(cpu);
-
- /*
- * Ensure that stores to Normal memory are visible to the
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0157-ARM-7123-1-smp-Add-an-IPI-handler-callable-from-C-co.patch b/patches.kzm9g/0157-ARM-7123-1-smp-Add-an-IPI-handler-callable-from-C-co.patch
deleted file mode 100644
index 4bbb1bf4efc932..00000000000000
--- a/patches.kzm9g/0157-ARM-7123-1-smp-Add-an-IPI-handler-callable-from-C-co.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 32e451b349e7eb7f702b46dd50e57585b0471889 Mon Sep 17 00:00:00 2001
-From: Shawn Guo <shawn.guo@linaro.org>
-Date: Thu, 6 Oct 2011 15:18:14 +0100
-Subject: ARM: 7123/1: smp: Add an IPI handler callable from C code
-
-In order to be able to handle IPI directly from C code instead of
-assembly code, introduce handle_IPI(), which is modeled after handle_IRQ().
-
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 0b5a1b95dcdfa451125132d5ce3f79a27ffb0950)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/smp.h | 5 +++++
- arch/arm/kernel/smp.c | 5 +++++
- 2 files changed, 10 insertions(+)
-
---- a/arch/arm/include/asm/smp.h
-+++ b/arch/arm/include/asm/smp.h
-@@ -33,6 +33,11 @@ extern void show_ipi_list(struct seq_fil
- asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);
-
- /*
-+ * Called from C code, this handles an IPI.
-+ */
-+void handle_IPI(int ipinr, struct pt_regs *regs);
-+
-+/*
- * Setup the set of possible CPUs (via set_cpu_possible)
- */
- extern void smp_init_cpus(void);
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -580,6 +580,11 @@ static void ipi_cpu_stop(unsigned int cp
- */
- asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
- {
-+ handle_IPI(ipinr, regs);
-+}
-+
-+void handle_IPI(int ipinr, struct pt_regs *regs)
-+{
- unsigned int cpu = smp_processor_id();
- struct pt_regs *old_regs = set_irq_regs(regs);
-
diff --git a/patches.kzm9g/0158-ARM-7124-1-smp-Add-a-localtimer-handler-callable-fro.patch b/patches.kzm9g/0158-ARM-7124-1-smp-Add-a-localtimer-handler-callable-fro.patch
deleted file mode 100644
index 1309618162715f..00000000000000
--- a/patches.kzm9g/0158-ARM-7124-1-smp-Add-a-localtimer-handler-callable-fro.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 3a88e40dec05b0d5d376ba18a7f6833b3f6d7be5 Mon Sep 17 00:00:00 2001
-From: Shawn Guo <shawn.guo@linaro.org>
-Date: Thu, 6 Oct 2011 15:19:14 +0100
-Subject: ARM: 7124/1: smp: Add a localtimer handler callable from C code
-
-In order to be able to handle localtimer directly from C code instead of
-assembly code, introduce handle_local_timer(), which is modeled after
-handle_IRQ().
-
-Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit 0af8aa0069e43f90d59666510342c05e97d8c4b8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/include/asm/localtimer.h | 4 ++++
- arch/arm/kernel/smp.c | 5 +++++
- 2 files changed, 9 insertions(+)
-
---- a/arch/arm/include/asm/localtimer.h
-+++ b/arch/arm/include/asm/localtimer.h
-@@ -22,6 +22,10 @@ void percpu_timer_setup(void);
- */
- asmlinkage void do_local_timer(struct pt_regs *);
-
-+/*
-+ * Called from C code
-+ */
-+void handle_local_timer(struct pt_regs *);
-
- #ifdef CONFIG_LOCAL_TIMERS
-
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -471,6 +471,11 @@ static void ipi_timer(void)
- #ifdef CONFIG_LOCAL_TIMERS
- asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs)
- {
-+ handle_local_timer(regs);
-+}
-+
-+void handle_local_timer(struct pt_regs *regs)
-+{
- struct pt_regs *old_regs = set_irq_regs(regs);
- int cpu = smp_processor_id();
-
diff --git a/patches.kzm9g/0159-ARM-gic-consolidate-PPI-handling.patch b/patches.kzm9g/0159-ARM-gic-consolidate-PPI-handling.patch
deleted file mode 100644
index 8adc7186273196..00000000000000
--- a/patches.kzm9g/0159-ARM-gic-consolidate-PPI-handling.patch
+++ /dev/null
@@ -1,532 +0,0 @@
-From c05f2488f4b9c5a88e74afd7b22a986c4378fb2b Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Wed, 20 Jul 2011 16:24:14 +0100
-Subject: ARM: gic: consolidate PPI handling
-
-PPI handling is a bit of an odd beast. It uses its own low level
-handling code and is hardwired to the local timers (hence lacking
-a registration interface).
-
-Instead, switch the low handling to the normal SPI handling code.
-PPIs are handled by the handle_percpu_devid_irq flow.
-
-This also allows the removal of some duplicated code.
-
-Cc: Kukjin Kim <kgene.kim@samsung.com>
-Cc: David Brown <davidb@codeaurora.org>
-Cc: Bryan Huntsman <bryanh@codeaurora.org>
-Cc: Tony Lindgren <tony@atomide.com>
-Cc: Paul Mundt <lethal@linux-sh.org>
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Cc: Thomas Gleixner <tglx@linutronix.de>
-Acked-by: David Brown <davidb@codeaurora.org>
-Tested-by: David Brown <davidb@codeaurora.org>
-Tested-by: Shawn Guo <shawn.guo@linaro.org>
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-(cherry picked from commit 292b293ceef2eda1f96f0c90b96e954d7bdabd1c)
-
-Conflicts:
-
- arch/arm/mach-exynos4/include/mach/entry-macro.S
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 75 +++++++++++++++++++++-
- arch/arm/include/asm/entry-macro-multi.S | 7 --
- arch/arm/include/asm/hardirq.h | 3
- arch/arm/include/asm/hardware/entry-macro-gic.S | 19 -----
- arch/arm/include/asm/localtimer.h | 11 +--
- arch/arm/include/asm/smp.h | 5 -
- arch/arm/kernel/irq.c | 3
- arch/arm/kernel/smp.c | 34 +--------
- arch/arm/mach-exynos4/include/mach/entry-macro.S | 13 ---
- arch/arm/mach-msm/board-msm8x60.c | 11 ---
- arch/arm/mach-msm/include/mach/entry-macro-qgic.S | 73 ---------------------
- arch/arm/mach-omap2/include/mach/entry-macro.S | 14 ----
- arch/arm/mach-shmobile/entry-intc.S | 3
- arch/arm/mach-shmobile/include/mach/entry-macro.S | 3
- 14 files changed, 88 insertions(+), 186 deletions(-)
-
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -29,10 +29,14 @@
- #include <linux/cpu_pm.h>
- #include <linux/cpumask.h>
- #include <linux/io.h>
-+#include <linux/interrupt.h>
-+#include <linux/percpu.h>
-+#include <linux/slab.h>
-
- #include <asm/irq.h>
- #include <asm/mach/irq.h>
- #include <asm/hardware/gic.h>
-+#include <asm/localtimer.h>
-
- static DEFINE_SPINLOCK(irq_controller_lock);
-
-@@ -256,6 +260,32 @@ void __init gic_cascade_irq(unsigned int
- irq_set_chained_handler(irq, gic_handle_cascade_irq);
- }
-
-+#ifdef CONFIG_LOCAL_TIMERS
-+#define gic_ppi_handler percpu_timer_handler
-+#else
-+static irqreturn_t gic_ppi_handler(int irq, void *dev_id)
-+{
-+ return IRQ_NONE;
-+}
-+#endif
-+
-+#define PPI_IRQACT(nr) \
-+ { \
-+ .handler = gic_ppi_handler, \
-+ .flags = IRQF_PERCPU | IRQF_TIMER, \
-+ .irq = nr, \
-+ .name = "PPI-" # nr, \
-+ }
-+
-+static struct irqaction ppi_irqaction_template[16] __initdata = {
-+ PPI_IRQACT(0), PPI_IRQACT(1), PPI_IRQACT(2), PPI_IRQACT(3),
-+ PPI_IRQACT(4), PPI_IRQACT(5), PPI_IRQACT(6), PPI_IRQACT(7),
-+ PPI_IRQACT(8), PPI_IRQACT(9), PPI_IRQACT(10), PPI_IRQACT(11),
-+ PPI_IRQACT(12), PPI_IRQACT(13), PPI_IRQACT(14), PPI_IRQACT(15),
-+};
-+
-+static struct irqaction *ppi_irqaction;
-+
- static void __init gic_dist_init(struct gic_chip_data *gic,
- unsigned int irq_start)
- {
-@@ -263,6 +293,7 @@ static void __init gic_dist_init(struct
- u32 cpumask;
- void __iomem *base = gic->dist_base;
- u32 cpu = 0;
-+ u32 nrppis = 0, ppi_base = 0;
-
- #ifdef CONFIG_SMP
- cpu = cpu_logical_map(smp_processor_id());
-@@ -286,6 +317,33 @@ static void __init gic_dist_init(struct
- gic->gic_irqs = gic_irqs;
-
- /*
-+ * Nobody would be insane enough to use PPIs on a secondary
-+ * GIC, right?
-+ */
-+ if (gic == &gic_data[0]) {
-+ nrppis = (32 - irq_start) & 31;
-+
-+ /* The GIC only supports up to 16 PPIs. */
-+ if (nrppis > 16)
-+ BUG();
-+
-+ ppi_base = gic->irq_offset + 32 - nrppis;
-+
-+ ppi_irqaction = kmemdup(&ppi_irqaction_template[16 - nrppis],
-+ sizeof(*ppi_irqaction) * nrppis,
-+ GFP_KERNEL);
-+
-+ if (nrppis && !ppi_irqaction) {
-+ pr_err("GIC: Can't allocate PPI memory");
-+ nrppis = 0;
-+ ppi_base = 0;
-+ }
-+ }
-+
-+ pr_info("Configuring GIC with %d sources (%d PPIs)\n",
-+ gic_irqs, (gic == &gic_data[0]) ? nrppis : 0);
-+
-+ /*
- * Set all global interrupts to be level triggered, active low.
- */
- for (i = 32; i < gic_irqs; i += 16)
-@@ -320,7 +378,22 @@ static void __init gic_dist_init(struct
- /*
- * Setup the Linux IRQ subsystem.
- */
-- for (i = irq_start; i < irq_limit; i++) {
-+ for (i = 0; i < nrppis; i++) {
-+ int ppi = i + ppi_base;
-+ int err;
-+
-+ irq_set_percpu_devid(ppi);
-+ irq_set_chip_and_handler(ppi, &gic_chip,
-+ handle_percpu_devid_irq);
-+ irq_set_chip_data(ppi, gic);
-+ set_irq_flags(ppi, IRQF_VALID | IRQF_NOAUTOEN);
-+
-+ err = setup_percpu_irq(ppi, &ppi_irqaction[i]);
-+ if (err)
-+ pr_err("GIC: can't setup PPI%d (%d)\n", ppi, err);
-+ }
-+
-+ for (i = irq_start + nrppis; i < irq_limit; i++) {
- irq_set_chip_and_handler(i, &gic_chip, handle_fasteoi_irq);
- irq_set_chip_data(i, gic);
- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
---- a/arch/arm/include/asm/entry-macro-multi.S
-+++ b/arch/arm/include/asm/entry-macro-multi.S
-@@ -25,13 +25,6 @@
- movne r1, sp
- adrne lr, BSYM(1b)
- bne do_IPI
--
--#ifdef CONFIG_LOCAL_TIMERS
-- test_for_ltirq r0, r2, r6, lr
-- movne r0, sp
-- adrne lr, BSYM(1b)
-- bne do_local_timer
--#endif
- #endif
- 9997:
- .endm
---- a/arch/arm/include/asm/hardirq.h
-+++ b/arch/arm/include/asm/hardirq.h
-@@ -9,9 +9,6 @@
-
- typedef struct {
- unsigned int __softirq_pending;
--#ifdef CONFIG_LOCAL_TIMERS
-- unsigned int local_timer_irqs;
--#endif
- #ifdef CONFIG_SMP
- unsigned int ipi_irqs[NR_IPI];
- #endif
---- a/arch/arm/include/asm/hardware/entry-macro-gic.S
-+++ b/arch/arm/include/asm/hardware/entry-macro-gic.S
-@@ -22,15 +22,11 @@
- * interrupt controller spec. To wit:
- *
- * Interrupts 0-15 are IPI
-- * 16-28 are reserved
-- * 29-31 are local. We allow 30 to be used for the watchdog.
-+ * 16-31 are local. We allow 30 to be used for the watchdog.
- * 32-1020 are global
- * 1021-1022 are reserved
- * 1023 is "spurious" (no interrupt)
- *
-- * For now, we ignore all local interrupts so only return an interrupt if it's
-- * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.
-- *
- * A simple read from the controller will tell us the number of the highest
- * priority enabled interrupt. We then just need to check whether it is in the
- * valid range for an IRQ (30-1020 inclusive).
-@@ -43,7 +39,7 @@
-
- ldr \tmp, =1021
- bic \irqnr, \irqstat, #0x1c00
-- cmp \irqnr, #29
-+ cmp \irqnr, #15
- cmpcc \irqnr, \irqnr
- cmpne \irqnr, \tmp
- cmpcs \irqnr, \irqnr
-@@ -62,14 +58,3 @@
- strcc \irqstat, [\base, #GIC_CPU_EOI]
- cmpcs \irqnr, \irqnr
- .endm
--
--/* As above, this assumes that irqstat and base are preserved.. */
--
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- bic \irqnr, \irqstat, #0x1c00
-- mov \tmp, #0
-- cmp \irqnr, #29
-- moveq \tmp, #1
-- streq \irqstat, [\base, #GIC_CPU_EOI]
-- cmp \tmp, #0
-- .endm
---- a/arch/arm/include/asm/localtimer.h
-+++ b/arch/arm/include/asm/localtimer.h
-@@ -10,6 +10,8 @@
- #ifndef __ASM_ARM_LOCALTIMER_H
- #define __ASM_ARM_LOCALTIMER_H
-
-+#include <linux/interrupt.h>
-+
- struct clock_event_device;
-
- /*
-@@ -18,14 +20,9 @@ struct clock_event_device;
- void percpu_timer_setup(void);
-
- /*
-- * Called from assembly, this is the local timer IRQ handler
-- */
--asmlinkage void do_local_timer(struct pt_regs *);
--
--/*
-- * Called from C code
-+ * Per-cpu timer IRQ handler
- */
--void handle_local_timer(struct pt_regs *);
-+irqreturn_t percpu_timer_handler(int irq, void *dev_id);
-
- #ifdef CONFIG_LOCAL_TIMERS
-
---- a/arch/arm/include/asm/smp.h
-+++ b/arch/arm/include/asm/smp.h
-@@ -99,9 +99,4 @@ extern void platform_cpu_enable(unsigned
- extern void arch_send_call_function_single_ipi(int cpu);
- extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
-
--/*
-- * show local interrupt info
-- */
--extern void show_local_irqs(struct seq_file *, int);
--
- #endif /* ifndef __ASM_ARM_SMP_H */
---- a/arch/arm/kernel/irq.c
-+++ b/arch/arm/kernel/irq.c
-@@ -59,9 +59,6 @@ int arch_show_interrupts(struct seq_file
- #ifdef CONFIG_SMP
- show_ipi_list(p, prec);
- #endif
--#ifdef CONFIG_LOCAL_TIMERS
-- show_local_irqs(p, prec);
--#endif
- seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
- return 0;
- }
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -450,10 +450,6 @@ u64 smp_irq_stat_cpu(unsigned int cpu)
- for (i = 0; i < NR_IPI; i++)
- sum += __get_irq_stat(cpu, ipi_irqs[i]);
-
--#ifdef CONFIG_LOCAL_TIMERS
-- sum += __get_irq_stat(cpu, local_timer_irqs);
--#endif
--
- return sum;
- }
-
-@@ -469,36 +465,16 @@ static void ipi_timer(void)
- }
-
- #ifdef CONFIG_LOCAL_TIMERS
--asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs)
-+irqreturn_t percpu_timer_handler(int irq, void *dev_id)
- {
-- handle_local_timer(regs);
--}
--
--void handle_local_timer(struct pt_regs *regs)
--{
-- struct pt_regs *old_regs = set_irq_regs(regs);
-- int cpu = smp_processor_id();
-+ struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
-
- if (local_timer_ack()) {
-- __inc_irq_stat(cpu, local_timer_irqs);
-- irq_enter();
-- ipi_timer();
-- irq_exit();
-+ evt->event_handler(evt);
-+ return IRQ_HANDLED;
- }
-
-- set_irq_regs(old_regs);
--}
--
--void show_local_irqs(struct seq_file *p, int prec)
--{
-- unsigned int cpu;
--
-- seq_printf(p, "%*s: ", prec, "LOC");
--
-- for_each_present_cpu(cpu)
-- seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs));
--
-- seq_printf(p, " Local timer interrupts\n");
-+ return IRQ_NONE;
- }
- #endif
-
---- a/arch/arm/mach-exynos4/include/mach/entry-macro.S
-+++ b/arch/arm/mach-exynos4/include/mach/entry-macro.S
-@@ -50,7 +50,7 @@
-
- bic \irqnr, \irqstat, #0x1c00
-
-- cmp \irqnr, #29
-+ cmp \irqnr, #15
- cmpcc \irqnr, \irqnr
- cmpne \irqnr, \tmp
- cmpcs \irqnr, \irqnr
-@@ -71,14 +71,3 @@
- strcc \irqstat, [\base, #GIC_CPU_EOI]
- cmpcs \irqnr, \irqnr
- .endm
--
-- /* As above, this assumes that irqstat and base are preserved.. */
--
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- bic \irqnr, \irqstat, #0x1c00
-- mov \tmp, #0
-- cmp \irqnr, #29
-- moveq \tmp, #1
-- streq \irqstat, [\base, #GIC_CPU_EOI]
-- cmp \tmp, #0
-- .endm
---- a/arch/arm/mach-msm/board-msm8x60.c
-+++ b/arch/arm/mach-msm/board-msm8x60.c
-@@ -36,8 +36,6 @@ static void __init msm8x60_map_io(void)
-
- static void __init msm8x60_init_irq(void)
- {
-- unsigned int i;
--
- gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
- (void *)MSM_QGIC_CPU_BASE);
-
-@@ -49,15 +47,6 @@ static void __init msm8x60_init_irq(void
- */
- if (!machine_is_msm8x60_sim())
- writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
--
-- /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
-- * as they are configured as level, which does not play nice with
-- * handle_percpu_irq.
-- */
-- for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
-- if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
-- irq_set_handler(i, handle_percpu_irq);
-- }
- }
-
- static void __init msm8x60_init(void)
---- a/arch/arm/mach-msm/include/mach/entry-macro-qgic.S
-+++ b/arch/arm/mach-msm/include/mach/entry-macro-qgic.S
-@@ -8,81 +8,10 @@
- * warranty of any kind, whether express or implied.
- */
-
--#include <mach/hardware.h>
--#include <asm/hardware/gic.h>
-+#include <asm/hardware/entry-macro-gic.S>
-
- .macro disable_fiq
- .endm
-
-- .macro get_irqnr_preamble, base, tmp
-- ldr \base, =gic_cpu_base_addr
-- ldr \base, [\base]
-- .endm
--
- .macro arch_ret_to_user, tmp1, tmp2
- .endm
--
-- /*
-- * The interrupt numbering scheme is defined in the
-- * interrupt controller spec. To wit:
-- *
-- * Migrated the code from ARM MP port to be more consistent
-- * with interrupt processing , the following still holds true
-- * however, all interrupts are treated the same regardless of
-- * if they are local IPI or PPI
-- *
-- * Interrupts 0-15 are IPI
-- * 16-31 are PPI
-- * (16-18 are the timers)
-- * 32-1020 are global
-- * 1021-1022 are reserved
-- * 1023 is "spurious" (no interrupt)
-- *
-- * A simple read from the controller will tell us the number of the
-- * highest priority enabled interrupt. We then just need to check
-- * whether it is in the valid range for an IRQ (0-1020 inclusive).
-- *
-- * Base ARM code assumes that the local (private) peripheral interrupts
-- * are not valid, we treat them differently, in that the privates are
-- * handled like normal shared interrupts with the exception that only
-- * one processor can register the interrupt and the handler must be
-- * the same for all processors.
-- */
--
-- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
--
-- ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 =srcCPU,
-- 9-0 =int # */
--
-- bic \irqnr, \irqstat, #0x1c00 @mask src
-- cmp \irqnr, #15
-- ldr \tmp, =1021
-- cmpcc \irqnr, \irqnr
-- cmpne \irqnr, \tmp
-- cmpcs \irqnr, \irqnr
--
-- .endm
--
-- /* We assume that irqstat (the raw value of the IRQ acknowledge
-- * register) is preserved from the macro above.
-- * If there is an IPI, we immediately signal end of interrupt on the
-- * controller, since this requires the original irqstat value which
-- * we won't easily be able to recreate later.
-- */
-- .macro test_for_ipi, irqnr, irqstat, base, tmp
-- bic \irqnr, \irqstat, #0x1c00
-- cmp \irqnr, #16
-- strcc \irqstat, [\base, #GIC_CPU_EOI]
-- cmpcs \irqnr, \irqnr
-- .endm
--
-- /* As above, this assumes that irqstat and base are preserved.. */
--
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- bic \irqnr, \irqstat, #0x1c00
-- mov \tmp, #0
-- cmp \irqnr, #16
-- moveq \tmp, #1
-- streq \irqstat, [\base, #GIC_CPU_EOI]
-- cmp \tmp, #0
-- .endm
---- a/arch/arm/mach-omap2/include/mach/entry-macro.S
-+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
-@@ -78,7 +78,7 @@
- 4401: ldr \irqstat, [\base, #GIC_CPU_INTACK]
- ldr \tmp, =1021
- bic \irqnr, \irqstat, #0x1c00
-- cmp \irqnr, #29
-+ cmp \irqnr, #15
- cmpcc \irqnr, \irqnr
- cmpne \irqnr, \tmp
- cmpcs \irqnr, \irqnr
-@@ -101,18 +101,6 @@
- it cs
- cmpcs \irqnr, \irqnr
- .endm
--
-- /* As above, this assumes that irqstat and base are preserved */
--
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- bic \irqnr, \irqstat, #0x1c00
-- mov \tmp, #0
-- cmp \irqnr, #29
-- itt eq
-- moveq \tmp, #1
-- streq \irqstat, [\base, #GIC_CPU_EOI]
-- cmp \tmp, #0
-- .endm
- #endif /* CONFIG_SMP */
-
- #else /* MULTI_OMAP2 */
---- a/arch/arm/mach-shmobile/entry-intc.S
-+++ b/arch/arm/mach-shmobile/entry-intc.S
-@@ -51,7 +51,4 @@
- .macro test_for_ipi, irqnr, irqstat, base, tmp
- .endm
-
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- .endm
--
- arch_irq_handler shmobile_handle_irq_intc
---- a/arch/arm/mach-shmobile/include/mach/entry-macro.S
-+++ b/arch/arm/mach-shmobile/include/mach/entry-macro.S
-@@ -27,8 +27,5 @@
- .macro test_for_ipi, irqnr, irqstat, base, tmp
- .endm
-
-- .macro test_for_ltirq, irqnr, irqstat, base, tmp
-- .endm
--
- .macro arch_ret_to_user, tmp1, tmp2
- .endm
diff --git a/patches.kzm9g/0160-ARM-GIC-Add-global-gic_handle_irq-function.patch b/patches.kzm9g/0160-ARM-GIC-Add-global-gic_handle_irq-function.patch
deleted file mode 100644
index 3b5ba5af83e05a..00000000000000
--- a/patches.kzm9g/0160-ARM-GIC-Add-global-gic_handle_irq-function.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From a0ef51f4b57f8a01b252ac767519d2a4002d2a4c Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Tue, 6 Sep 2011 09:56:17 +0100
-Subject: ARM: GIC: Add global gic_handle_irq() function
-
-Provide the GIC code with a low level handler that can be used
-by platforms using CONFIG_MULTI_IRQ_HANDLER.
-
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-(cherry picked from commit 562e0027d21bf64838178e2f5157df3d5833972e)
-
-Conflicts:
-
- arch/arm/common/gic.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 27 ++++++++++++++++++++++++++-
- arch/arm/include/asm/hardware/gic.h | 1 +
- 2 files changed, 27 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 95ad8d1..7a73799 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -26,7 +26,6 @@
- #include <linux/kernel.h>
- #include <linux/list.h>
- #include <linux/smp.h>
--#include <linux/cpu_pm.h>
- #include <linux/cpumask.h>
- #include <linux/io.h>
- #include <linux/interrupt.h>
-@@ -211,6 +210,32 @@ static int gic_set_wake(struct irq_data *d, unsigned int on)
- #define gic_set_wake NULL
- #endif
-
-+asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
-+{
-+ u32 irqstat, irqnr;
-+ struct gic_chip_data *gic = &gic_data[0];
-+ void __iomem *cpu_base = gic->cpu_base;
-+
-+ do {
-+ irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
-+ irqnr = irqstat & ~0x1c00;
-+
-+ if (likely(irqnr > 15 && irqnr < 1021)) {
-+ //irqnr = irqnr + gic->irq_offset;
-+ handle_IRQ(irqnr, regs);
-+ continue;
-+ }
-+ if (irqnr < 16) {
-+ writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
-+#ifdef CONFIG_SMP
-+ handle_IPI(irqnr, regs);
-+#endif
-+ continue;
-+ }
-+ break;
-+ } while (1);
-+}
-+
- static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
- {
- struct gic_chip_data *chip_data = irq_get_handler_data(irq);
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index c562705..615c336 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -38,6 +38,7 @@ extern struct irq_chip gic_arch_extn;
-
- void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
- void gic_secondary_init(unsigned int);
-+void gic_handle_irq(struct pt_regs *regs);
- void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
- void gic_enable_ppi(unsigned int);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0161-ARM-twd-register-clockevents-device-before-enabling-.patch b/patches.kzm9g/0161-ARM-twd-register-clockevents-device-before-enabling-.patch
deleted file mode 100644
index d48fa9face4e46..00000000000000
--- a/patches.kzm9g/0161-ARM-twd-register-clockevents-device-before-enabling-.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 1322ac36bc746ca63e1968e96b8945ee1ab85fff Mon Sep 17 00:00:00 2001
-From: Will Deacon <will.deacon@arm.com>
-Date: Wed, 20 Jul 2011 14:18:46 +0100
-Subject: ARM: twd: register clockevents device before enabling PPI
-
-The smp_twd clockevents driver currently enables the local timer PPI
-before the clockevents device is registered. This can lead to a kernel
-panic if a spurious timer interrupt is generated before registration
-has completed since the kernel will treat it as an IPI timer.
-
-This patch moves the clockevents device registration before the IRQ
-unmasking so that we can always handle timer interrupts once they can
-occur.
-
-Acked-by: Marc Zyngier <marc.zyngier@arm.com>
-Signed-off-by: Will Deacon <will.deacon@arm.com>
-(cherry picked from commit dfc40b24c0a37593724f3317cd485c73ee878c18)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/kernel/smp_twd.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
-index 2c277d4..01c1862 100644
---- a/arch/arm/kernel/smp_twd.c
-+++ b/arch/arm/kernel/smp_twd.c
-@@ -137,8 +137,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
- clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
- clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
-
-+ clockevents_register_device(clk);
-+
- /* Make sure our local interrupt controller has this enabled */
- gic_enable_ppi(clk->irq);
--
-- clockevents_register_device(clk);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0162-ARM-EXYNOS4-set-the-affinity-of-mct1-interrupt-using.patch b/patches.kzm9g/0162-ARM-EXYNOS4-set-the-affinity-of-mct1-interrupt-using.patch
deleted file mode 100644
index 248a87aa58227b..00000000000000
--- a/patches.kzm9g/0162-ARM-EXYNOS4-set-the-affinity-of-mct1-interrupt-using.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From bf7b78d246e27b2b276b600fb145f8ccef7246e7 Mon Sep 17 00:00:00 2001
-From: Changhwan Youn <chaos.youn@samsung.com>
-Date: Sat, 16 Jul 2011 10:49:44 +0900
-Subject: ARM: EXYNOS4: set the affinity of mct1 interrupt using IRQ_MCT_L1
-
-IRQ_MCT_L1 is connected directly to GIC in external GIC mapping,
-while in internal GIC mapping, it is connected to GIC through
-interrupt combiner. Therfore the affinity for mct1 event timer
-interrupt should be changed through IRQ_MCT_L1.
-
-Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
-Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-(cherry picked from commit a8769a594a6d061f8018048a7cd1546924c61a5c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-exynos4/mct.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c
-index 14ac10b..1ae059b 100644
---- a/arch/arm/mach-exynos4/mct.c
-+++ b/arch/arm/mach-exynos4/mct.c
-@@ -383,8 +383,8 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
- setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
- } else {
- mct_tick1_event_irq.dev_id = &mct_tick[cpu];
-- irq_set_affinity(IRQ_MCT1, cpumask_of(1));
- setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
-+ irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
- }
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0163-genirq-percpu-allow-interrupt-type-to-be-set-at-enab.patch b/patches.kzm9g/0163-genirq-percpu-allow-interrupt-type-to-be-set-at-enab.patch
deleted file mode 100644
index d60c9da5ca867a..00000000000000
--- a/patches.kzm9g/0163-genirq-percpu-allow-interrupt-type-to-be-set-at-enab.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 34377e3bf1795c5e592b3135913ae0f7147bbb85 Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Fri, 30 Sep 2011 10:48:47 +0100
-Subject: genirq: percpu: allow interrupt type to be set at enable time
-
-As request_percpu_irq() doesn't allow for a percpu interrupt to have
-its type configured (it is generally impossible to configure it on all
-CPUs at once), add a 'type' argument to enable_percpu_irq().
-
-This allows some low-level, board specific init code to be switched to
-a generic API.
-
-[ tglx: Added WARN_ON argument ]
-
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-Cc: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-(cherry picked from commit 1e7c5fd29487ee88cb3abac945bafa60ae026146)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/interrupt.h | 2 +-
- kernel/irq/manage.c | 15 ++++++++++++++-
- 2 files changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
-index 6fe4e3c..8854a4c 100644
---- a/include/linux/interrupt.h
-+++ b/include/linux/interrupt.h
-@@ -226,7 +226,7 @@ extern void disable_irq_nosync(unsigned int irq);
- extern void disable_irq(unsigned int irq);
- extern void disable_percpu_irq(unsigned int irq);
- extern void enable_irq(unsigned int irq);
--extern void enable_percpu_irq(unsigned int irq);
-+extern void enable_percpu_irq(unsigned int irq, unsigned int type);
-
- /* The following three functions are for the core kernel use only. */
- #ifdef CONFIG_GENERIC_HARDIRQS
-diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
-index 7923849..fea7c71 100644
---- a/kernel/irq/manage.c
-+++ b/kernel/irq/manage.c
-@@ -1454,7 +1454,7 @@ int request_any_context_irq(unsigned int irq, irq_handler_t handler,
- }
- EXPORT_SYMBOL_GPL(request_any_context_irq);
-
--void enable_percpu_irq(unsigned int irq)
-+void enable_percpu_irq(unsigned int irq, unsigned int type)
- {
- unsigned int cpu = smp_processor_id();
- unsigned long flags;
-@@ -1463,7 +1463,20 @@ void enable_percpu_irq(unsigned int irq)
- if (!desc)
- return;
-
-+ type &= IRQ_TYPE_SENSE_MASK;
-+ if (type != IRQ_TYPE_NONE) {
-+ int ret;
-+
-+ ret = __irq_set_trigger(desc, irq, type);
-+
-+ if (ret) {
-+ WARN(1, "failed to set type for IRQ%d\n, irq");
-+ goto out;
-+ }
-+ }
-+
- irq_percpu_enable(desc, cpu);
-+out:
- irq_put_desc_unlock(desc, flags);
- }
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0164-ARM-gic-local-timers-use-the-request_percpu_irq-inte.patch b/patches.kzm9g/0164-ARM-gic-local-timers-use-the-request_percpu_irq-inte.patch
deleted file mode 100644
index 8ac729d89bf87a..00000000000000
--- a/patches.kzm9g/0164-ARM-gic-local-timers-use-the-request_percpu_irq-inte.patch
+++ /dev/null
@@ -1,489 +0,0 @@
-From f14b02ced1783bf8d9c2825ab79c26cd5d6bc635 Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Fri, 22 Jul 2011 12:52:37 +0100
-Subject: ARM: gic, local timers: use the request_percpu_irq() interface
-
-This patch remove the hardcoded link between local timers and PPIs,
-and convert the PPI users (TWD, MCT and MSM timers) to the new
-*_percpu_irq interface. Also some collateral cleanup
-(local_timer_ack() is gone, and the interrupt handler is strictly
-private to each driver).
-
-PPIs are now useable for more than just the local timers.
-
-Additional testing by David Brown (msm8250 and msm8660) and
-Shawn Guo (imx6q).
-
-Cc: David Brown <davidb@codeaurora.org>
-Cc: Thomas Gleixner <tglx@linutronix.de>
-Acked-by: David Brown <davidb@codeaurora.org>
-Tested-by: David Brown <davidb@codeaurora.org>
-Tested-by: Shawn Guo <shawn.guo@linaro.org>
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-(cherry picked from commit 28af690a284dfcb627bd69d0963db1c0f412cb8c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 52 ---------------------------
- arch/arm/include/asm/hardware/gic.h | 1
- arch/arm/include/asm/localtimer.h | 16 +++-----
- arch/arm/include/asm/smp_twd.h | 2 -
- arch/arm/kernel/smp.c | 16 --------
- arch/arm/kernel/smp_twd.c | 47 +++++++++++++++++++++++-
- arch/arm/mach-exynos4/mct.c | 7 ++-
- arch/arm/mach-msm/timer.c | 69 ++++++++++++++++++++----------------
- 8 files changed, 99 insertions(+), 111 deletions(-)
-
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -35,7 +35,6 @@
- #include <asm/irq.h>
- #include <asm/mach/irq.h>
- #include <asm/hardware/gic.h>
--#include <asm/localtimer.h>
-
- static DEFINE_SPINLOCK(irq_controller_lock);
-
-@@ -285,32 +284,6 @@ void __init gic_cascade_irq(unsigned int
- irq_set_chained_handler(irq, gic_handle_cascade_irq);
- }
-
--#ifdef CONFIG_LOCAL_TIMERS
--#define gic_ppi_handler percpu_timer_handler
--#else
--static irqreturn_t gic_ppi_handler(int irq, void *dev_id)
--{
-- return IRQ_NONE;
--}
--#endif
--
--#define PPI_IRQACT(nr) \
-- { \
-- .handler = gic_ppi_handler, \
-- .flags = IRQF_PERCPU | IRQF_TIMER, \
-- .irq = nr, \
-- .name = "PPI-" # nr, \
-- }
--
--static struct irqaction ppi_irqaction_template[16] __initdata = {
-- PPI_IRQACT(0), PPI_IRQACT(1), PPI_IRQACT(2), PPI_IRQACT(3),
-- PPI_IRQACT(4), PPI_IRQACT(5), PPI_IRQACT(6), PPI_IRQACT(7),
-- PPI_IRQACT(8), PPI_IRQACT(9), PPI_IRQACT(10), PPI_IRQACT(11),
-- PPI_IRQACT(12), PPI_IRQACT(13), PPI_IRQACT(14), PPI_IRQACT(15),
--};
--
--static struct irqaction *ppi_irqaction;
--
- static void __init gic_dist_init(struct gic_chip_data *gic,
- unsigned int irq_start)
- {
-@@ -353,16 +326,6 @@ static void __init gic_dist_init(struct
- BUG();
-
- ppi_base = gic->irq_offset + 32 - nrppis;
--
-- ppi_irqaction = kmemdup(&ppi_irqaction_template[16 - nrppis],
-- sizeof(*ppi_irqaction) * nrppis,
-- GFP_KERNEL);
--
-- if (nrppis && !ppi_irqaction) {
-- pr_err("GIC: Can't allocate PPI memory");
-- nrppis = 0;
-- ppi_base = 0;
-- }
- }
-
- pr_info("Configuring GIC with %d sources (%d PPIs)\n",
-@@ -405,17 +368,12 @@ static void __init gic_dist_init(struct
- */
- for (i = 0; i < nrppis; i++) {
- int ppi = i + ppi_base;
-- int err;
-
- irq_set_percpu_devid(ppi);
- irq_set_chip_and_handler(ppi, &gic_chip,
- handle_percpu_devid_irq);
- irq_set_chip_data(ppi, gic);
- set_irq_flags(ppi, IRQF_VALID | IRQF_NOAUTOEN);
--
-- err = setup_percpu_irq(ppi, &ppi_irqaction[i]);
-- if (err)
-- pr_err("GIC: can't setup PPI%d (%d)\n", ppi, err);
- }
-
- for (i = irq_start + nrppis; i < irq_limit; i++) {
-@@ -661,16 +619,6 @@ void __cpuinit gic_secondary_init(unsign
- gic_cpu_init(&gic_data[gic_nr]);
- }
-
--void __cpuinit gic_enable_ppi(unsigned int irq)
--{
-- unsigned long flags;
--
-- local_irq_save(flags);
-- irq_set_status_flags(irq, IRQ_NOPROBE);
-- gic_unmask_irq(irq_get_irq_data(irq));
-- local_irq_restore(flags);
--}
--
- #ifdef CONFIG_SMP
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
- {
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -41,7 +41,6 @@ void gic_secondary_init(unsigned int);
- void gic_handle_irq(struct pt_regs *regs);
- void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
--void gic_enable_ppi(unsigned int);
-
- struct gic_chip_data {
- unsigned int irq_offset;
---- a/arch/arm/include/asm/localtimer.h
-+++ b/arch/arm/include/asm/localtimer.h
-@@ -19,26 +19,20 @@ struct clock_event_device;
- */
- void percpu_timer_setup(void);
-
--/*
-- * Per-cpu timer IRQ handler
-- */
--irqreturn_t percpu_timer_handler(int irq, void *dev_id);
--
- #ifdef CONFIG_LOCAL_TIMERS
-
- #ifdef CONFIG_HAVE_ARM_TWD
-
- #include "smp_twd.h"
-
--#define local_timer_ack() twd_timer_ack()
-+#define local_timer_stop(c) twd_timer_stop((c))
-
- #else
-
- /*
-- * Platform provides this to acknowledge a local timer IRQ.
-- * Returns true if the local timer IRQ is to be processed.
-+ * Stop the local timer
- */
--int local_timer_ack(void);
-+void local_timer_stop(struct clock_event_device *);
-
- #endif
-
-@@ -53,6 +47,10 @@ static inline int local_timer_setup(stru
- {
- return -ENXIO;
- }
-+
-+static inline void local_timer_stop(struct clock_event_device *evt)
-+{
-+}
- #endif
-
- #endif
---- a/arch/arm/include/asm/smp_twd.h
-+++ b/arch/arm/include/asm/smp_twd.h
-@@ -22,7 +22,7 @@ struct clock_event_device;
-
- extern void __iomem *twd_base;
-
--int twd_timer_ack(void);
- void twd_timer_setup(struct clock_event_device *);
-+void twd_timer_stop(struct clock_event_device *);
-
- #endif
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -464,20 +464,6 @@ static void ipi_timer(void)
- evt->event_handler(evt);
- }
-
--#ifdef CONFIG_LOCAL_TIMERS
--irqreturn_t percpu_timer_handler(int irq, void *dev_id)
--{
-- struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
--
-- if (local_timer_ack()) {
-- evt->event_handler(evt);
-- return IRQ_HANDLED;
-- }
--
-- return IRQ_NONE;
--}
--#endif
--
- #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
- static void smp_timer_broadcast(const struct cpumask *mask)
- {
-@@ -528,7 +514,7 @@ static void percpu_timer_stop(void)
- unsigned int cpu = smp_processor_id();
- struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
-
-- evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
-+ local_timer_stop(evt);
- }
- #endif
-
---- a/arch/arm/kernel/smp_twd.c
-+++ b/arch/arm/kernel/smp_twd.c
-@@ -19,6 +19,7 @@
- #include <linux/io.h>
-
- #include <asm/smp_twd.h>
-+#include <asm/localtimer.h>
- #include <asm/hardware/gic.h>
-
- /* set up by the platform code */
-@@ -26,6 +27,8 @@ void __iomem *twd_base;
-
- static unsigned long twd_timer_rate;
-
-+static struct clock_event_device __percpu **twd_evt;
-+
- static void twd_set_mode(enum clock_event_mode mode,
- struct clock_event_device *clk)
- {
-@@ -80,6 +83,12 @@ int twd_timer_ack(void)
- return 0;
- }
-
-+void twd_timer_stop(struct clock_event_device *clk)
-+{
-+ twd_set_mode(CLOCK_EVT_MODE_UNUSED, clk);
-+ disable_percpu_irq(clk->irq);
-+}
-+
- static void __cpuinit twd_calibrate_rate(void)
- {
- unsigned long count;
-@@ -119,11 +128,43 @@ static void __cpuinit twd_calibrate_rate
- }
- }
-
-+static irqreturn_t twd_handler(int irq, void *dev_id)
-+{
-+ struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
-+
-+ if (twd_timer_ack()) {
-+ evt->event_handler(evt);
-+ return IRQ_HANDLED;
-+ }
-+
-+ return IRQ_NONE;
-+}
-+
- /*
- * Setup the local clock events for a CPU.
- */
- void __cpuinit twd_timer_setup(struct clock_event_device *clk)
- {
-+ struct clock_event_device **this_cpu_clk;
-+
-+ if (!twd_evt) {
-+ int err;
-+
-+ twd_evt = alloc_percpu(struct clock_event_device *);
-+ if (!twd_evt) {
-+ pr_err("twd: can't allocate memory\n");
-+ return;
-+ }
-+
-+ err = request_percpu_irq(clk->irq, twd_handler,
-+ "twd", twd_evt);
-+ if (err) {
-+ pr_err("twd: can't register interrupt %d (%d)\n",
-+ clk->irq, err);
-+ return;
-+ }
-+ }
-+
- twd_calibrate_rate();
-
- clk->name = "local_timer";
-@@ -137,8 +178,10 @@ void __cpuinit twd_timer_setup(struct cl
- clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
- clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
-
-+ this_cpu_clk = __this_cpu_ptr(twd_evt);
-+ *this_cpu_clk = clk;
-+
- clockevents_register_device(clk);
-
-- /* Make sure our local interrupt controller has this enabled */
-- gic_enable_ppi(clk->irq);
-+ enable_percpu_irq(clk->irq, 0);
- }
---- a/arch/arm/mach-exynos4/mct.c
-+++ b/arch/arm/mach-exynos4/mct.c
-@@ -380,9 +380,11 @@ static void exynos4_mct_tick_init(struct
-
- if (cpu == 0) {
- mct_tick0_event_irq.dev_id = &mct_tick[cpu];
-+ evt->irq = IRQ_MCT_L0;
- setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
- } else {
- mct_tick1_event_irq.dev_id = &mct_tick[cpu];
-+ evt->irq = IRQ_MCT_L1;
- setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
- irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
- }
-@@ -394,9 +396,10 @@ void __cpuinit local_timer_setup(struct
- exynos4_mct_tick_init(evt);
- }
-
--int local_timer_ack(void)
-+void local_timer_stop(struct clock_event_device *evt)
- {
-- return 0;
-+ evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
-+ disable_irq(evt->irq);
- }
-
- #endif /* CONFIG_LOCAL_TIMERS */
---- a/arch/arm/mach-msm/timer.c
-+++ b/arch/arm/mach-msm/timer.c
-@@ -71,12 +71,16 @@ enum timer_location {
- struct msm_clock {
- struct clock_event_device clockevent;
- struct clocksource clocksource;
-- struct irqaction irq;
-+ unsigned int irq;
- void __iomem *regbase;
- uint32_t freq;
- uint32_t shift;
- void __iomem *global_counter;
- void __iomem *local_counter;
-+ union {
-+ struct clock_event_device *evt;
-+ struct clock_event_device __percpu **percpu_evt;
-+ };
- };
-
- enum {
-@@ -87,13 +91,10 @@ enum {
-
-
- static struct msm_clock msm_clocks[];
--static struct clock_event_device *local_clock_event;
-
- static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
- {
-- struct clock_event_device *evt = dev_id;
-- if (smp_processor_id() != 0)
-- evt = local_clock_event;
-+ struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
- if (evt->event_handler == NULL)
- return IRQ_HANDLED;
- evt->event_handler(evt);
-@@ -171,13 +172,7 @@ static struct msm_clock msm_clocks[] = {
- .mask = CLOCKSOURCE_MASK(32),
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
- },
-- .irq = {
-- .name = "gp_timer",
-- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
-- .handler = msm_timer_interrupt,
-- .dev_id = &msm_clocks[0].clockevent,
-- .irq = INT_GP_TIMER_EXP
-- },
-+ .irq = INT_GP_TIMER_EXP,
- .freq = GPT_HZ,
- },
- [MSM_CLOCK_DGT] = {
-@@ -196,13 +191,7 @@ static struct msm_clock msm_clocks[] = {
- .mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)),
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
- },
-- .irq = {
-- .name = "dg_timer",
-- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
-- .handler = msm_timer_interrupt,
-- .dev_id = &msm_clocks[1].clockevent,
-- .irq = INT_DEBUG_TIMER_EXP
-- },
-+ .irq = INT_DEBUG_TIMER_EXP,
- .freq = DGT_HZ >> MSM_DGT_SHIFT,
- .shift = MSM_DGT_SHIFT,
- }
-@@ -261,10 +250,30 @@ static void __init msm_timer_init(void)
- printk(KERN_ERR "msm_timer_init: clocksource_register "
- "failed for %s\n", cs->name);
-
-- res = setup_irq(clock->irq.irq, &clock->irq);
-+ ce->irq = clock->irq;
-+ if (cpu_is_msm8x60() || cpu_is_msm8960()) {
-+ clock->percpu_evt = alloc_percpu(struct clock_event_device *);
-+ if (!clock->percpu_evt) {
-+ pr_err("msm_timer_init: memory allocation "
-+ "failed for %s\n", ce->name);
-+ continue;
-+ }
-+
-+ *__this_cpu_ptr(clock->percpu_evt) = ce;
-+ res = request_percpu_irq(ce->irq, msm_timer_interrupt,
-+ ce->name, clock->percpu_evt);
-+ if (!res)
-+ enable_percpu_irq(ce->irq, 0);
-+ } else {
-+ clock->evt = ce;
-+ res = request_irq(ce->irq, msm_timer_interrupt,
-+ IRQF_TIMER | IRQF_NOBALANCING | IRQF_TRIGGER_RISING,
-+ ce->name, &clock->evt);
-+ }
-+
- if (res)
-- printk(KERN_ERR "msm_timer_init: setup_irq "
-- "failed for %s\n", cs->name);
-+ pr_err("msm_timer_init: request_irq failed for %s\n",
-+ ce->name);
-
- clockevents_register_device(ce);
- }
-@@ -273,6 +282,7 @@ static void __init msm_timer_init(void)
- #ifdef CONFIG_SMP
- int __cpuinit local_timer_setup(struct clock_event_device *evt)
- {
-+ static bool local_timer_inited;
- struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
-
- /* Use existing clock_event for cpu 0 */
-@@ -281,12 +291,13 @@ int __cpuinit local_timer_setup(struct c
-
- writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
-
-- if (!local_clock_event) {
-+ if (!local_timer_inited) {
- writel(0, clock->regbase + TIMER_ENABLE);
- writel(0, clock->regbase + TIMER_CLEAR);
- writel(~0, clock->regbase + TIMER_MATCH_VAL);
-+ local_timer_inited = true;
- }
-- evt->irq = clock->irq.irq;
-+ evt->irq = clock->irq;
- evt->name = "local_timer";
- evt->features = CLOCK_EVT_FEAT_ONESHOT;
- evt->rating = clock->clockevent.rating;
-@@ -298,17 +309,17 @@ int __cpuinit local_timer_setup(struct c
- clockevent_delta2ns(0xf0000000 >> clock->shift, evt);
- evt->min_delta_ns = clockevent_delta2ns(4, evt);
-
-- local_clock_event = evt;
--
-- gic_enable_ppi(clock->irq.irq);
-+ *__this_cpu_ptr(clock->percpu_evt) = evt;
-+ enable_percpu_irq(evt->irq, 0);
-
- clockevents_register_device(evt);
- return 0;
- }
-
--inline int local_timer_ack(void)
-+void local_timer_stop(struct clock_event_device *evt)
- {
-- return 1;
-+ evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
-+ disable_percpu_irq(evt->irq);
- }
-
- #endif
diff --git a/patches.kzm9g/0165-ARM-gic-add-irq_domain-support.patch b/patches.kzm9g/0165-ARM-gic-add-irq_domain-support.patch
deleted file mode 100644
index 8d19407bf44649..00000000000000
--- a/patches.kzm9g/0165-ARM-gic-add-irq_domain-support.patch
+++ /dev/null
@@ -1,288 +0,0 @@
-From 6e52acb78212f9cfc7fb843fb01cb197a06d1b3e Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Wed, 28 Sep 2011 21:25:31 -0500
-Subject: ARM: gic: add irq_domain support
-
-Convert the gic interrupt controller to use irq domains in preparation
-for device-tree binding and MULTI_IRQ. This allows for translation between
-GIC interrupt IDs and Linux irq numbers.
-
-The meaning of irq_offset has changed. It now is just the number of skipped
-GIC interrupt IDs for the controller. It will be 16 for primary GIC and 32
-for secondary GICs.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Cc: Marc Zyngier <marc.zyngier@arm.com>
-Reviewed-by: Jamie Iles <jamie@jamieiles.com>
-Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 4294f8baaf174c9aa57886e7ed27caf4b02578f6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/Kconfig | 1 +
- arch/arm/common/gic.c | 118 +++++++++++++++++-------------------
- arch/arm/include/asm/hardware/gic.h | 7 ++-
- 3 files changed, 63 insertions(+), 63 deletions(-)
-
-diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
-index 4b71766..74df9ca 100644
---- a/arch/arm/common/Kconfig
-+++ b/arch/arm/common/Kconfig
-@@ -1,4 +1,5 @@
- config ARM_GIC
-+ select IRQ_DOMAIN
- bool
-
- config ARM_VIC
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 5f7b4e2..7286e89 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -24,10 +24,12 @@
- */
- #include <linux/init.h>
- #include <linux/kernel.h>
-+#include <linux/export.h>
- #include <linux/list.h>
- #include <linux/smp.h>
- #include <linux/cpumask.h>
- #include <linux/io.h>
-+#include <linux/irqdomain.h>
- #include <linux/interrupt.h>
- #include <linux/percpu.h>
- #include <linux/slab.h>
-@@ -74,8 +76,7 @@ static inline void __iomem *gic_cpu_base(struct irq_data *d)
-
- static inline unsigned int gic_irq(struct irq_data *d)
- {
-- struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
-- return d->irq - gic_data->irq_offset;
-+ return d->hwirq;
- }
-
- /*
-@@ -83,7 +84,7 @@ static inline unsigned int gic_irq(struct irq_data *d)
- */
- static void gic_mask_irq(struct irq_data *d)
- {
-- u32 mask = 1 << (d->irq % 32);
-+ u32 mask = 1 << (gic_irq(d) % 32);
-
- spin_lock(&irq_controller_lock);
- writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
-@@ -94,7 +95,7 @@ static void gic_mask_irq(struct irq_data *d)
-
- static void gic_unmask_irq(struct irq_data *d)
- {
-- u32 mask = 1 << (d->irq % 32);
-+ u32 mask = 1 << (gic_irq(d) % 32);
-
- spin_lock(&irq_controller_lock);
- if (gic_arch_extn.irq_unmask)
-@@ -175,7 +176,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
- bool force)
- {
- void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
-- unsigned int shift = (d->irq % 4) * 8;
-+ unsigned int shift = (gic_irq(d) % 4) * 8;
- unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
- u32 val, mask, bit;
-
-@@ -252,7 +253,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
- if (gic_irq == 1023)
- goto out;
-
-- cascade_irq = gic_irq + chip_data->irq_offset;
-+ cascade_irq = irq_domain_to_irq(&chip_data->domain, gic_irq);
- if (unlikely(gic_irq < 32 || gic_irq > 1020 || cascade_irq >= NR_IRQS))
- do_bad_IRQ(cascade_irq, desc);
- else
-@@ -284,14 +285,14 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
- irq_set_chained_handler(irq, gic_handle_cascade_irq);
- }
-
--static void __init gic_dist_init(struct gic_chip_data *gic,
-- unsigned int irq_start)
-+static void __init gic_dist_init(struct gic_chip_data *gic)
- {
-- unsigned int gic_irqs, irq_limit, i;
-+ unsigned int i, irq;
- u32 cpumask;
-+ unsigned int gic_irqs = gic->gic_irqs;
-+ struct irq_domain *domain = &gic->domain;
- void __iomem *base = gic->dist_base;
- u32 cpu = 0;
-- u32 nrppis = 0, ppi_base = 0;
-
- #ifdef CONFIG_SMP
- cpu = cpu_logical_map(smp_processor_id());
-@@ -304,34 +305,6 @@ static void __init gic_dist_init(struct gic_chip_data *gic,
- writel_relaxed(0, base + GIC_DIST_CTRL);
-
- /*
-- * Find out how many interrupts are supported.
-- * The GIC only supports up to 1020 interrupt sources.
-- */
-- gic_irqs = readl_relaxed(base + GIC_DIST_CTR) & 0x1f;
-- gic_irqs = (gic_irqs + 1) * 32;
-- if (gic_irqs > 1020)
-- gic_irqs = 1020;
--
-- gic->gic_irqs = gic_irqs;
--
-- /*
-- * Nobody would be insane enough to use PPIs on a secondary
-- * GIC, right?
-- */
-- if (gic == &gic_data[0]) {
-- nrppis = (32 - irq_start) & 31;
--
-- /* The GIC only supports up to 16 PPIs. */
-- if (nrppis > 16)
-- BUG();
--
-- ppi_base = gic->irq_offset + 32 - nrppis;
-- }
--
-- pr_info("Configuring GIC with %d sources (%d PPIs)\n",
-- gic_irqs, (gic == &gic_data[0]) ? nrppis : 0);
--
-- /*
- * Set all global interrupts to be level triggered, active low.
- */
- for (i = 32; i < gic_irqs; i += 16)
-@@ -357,29 +330,20 @@ static void __init gic_dist_init(struct gic_chip_data *gic,
- writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
-
- /*
-- * Limit number of interrupts registered to the platform maximum
-- */
-- irq_limit = gic->irq_offset + gic_irqs;
-- if (WARN_ON(irq_limit > NR_IRQS))
-- irq_limit = NR_IRQS;
--
-- /*
- * Setup the Linux IRQ subsystem.
- */
-- for (i = 0; i < nrppis; i++) {
-- int ppi = i + ppi_base;
--
-- irq_set_percpu_devid(ppi);
-- irq_set_chip_and_handler(ppi, &gic_chip,
-- handle_percpu_devid_irq);
-- irq_set_chip_data(ppi, gic);
-- set_irq_flags(ppi, IRQF_VALID | IRQF_NOAUTOEN);
-- }
--
-- for (i = irq_start + nrppis; i < irq_limit; i++) {
-- irq_set_chip_and_handler(i, &gic_chip, handle_fasteoi_irq);
-- irq_set_chip_data(i, gic);
-- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
-+ irq_domain_for_each_irq(domain, i, irq) {
-+ if (i < 32) {
-+ irq_set_percpu_devid(irq);
-+ irq_set_chip_and_handler(irq, &gic_chip,
-+ handle_percpu_devid_irq);
-+ set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
-+ } else {
-+ irq_set_chip_and_handler(irq, &gic_chip,
-+ handle_fasteoi_irq);
-+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-+ }
-+ irq_set_chip_data(irq, gic);
- }
-
- writel_relaxed(1, base + GIC_DIST_CTRL);
-@@ -591,23 +555,53 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
- }
- #endif
-
-+const struct irq_domain_ops gic_irq_domain_ops = {
-+};
-+
- void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
- void __iomem *dist_base, void __iomem *cpu_base)
- {
- struct gic_chip_data *gic;
-+ struct irq_domain *domain;
-+ int gic_irqs;
-
- BUG_ON(gic_nr >= MAX_GIC_NR);
-
- gic = &gic_data[gic_nr];
-+ domain = &gic->domain;
- gic->dist_base = dist_base;
- gic->cpu_base = cpu_base;
-- gic->irq_offset = (irq_start - 1) & ~31;
-
-- if (gic_nr == 0)
-+ /*
-+ * For primary GICs, skip over SGIs.
-+ * For secondary GICs, skip over PPIs, too.
-+ */
-+ if (gic_nr == 0) {
- gic_cpu_base_addr = cpu_base;
-+ domain->hwirq_base = 16;
-+ irq_start = (irq_start & ~31) + 16;
-+ } else
-+ domain->hwirq_base = 32;
-+
-+ /*
-+ * Find out how many interrupts are supported.
-+ * The GIC only supports up to 1020 interrupt sources.
-+ */
-+ gic_irqs = readl_relaxed(dist_base + GIC_DIST_CTR) & 0x1f;
-+ gic_irqs = (gic_irqs + 1) * 32;
-+ if (gic_irqs > 1020)
-+ gic_irqs = 1020;
-+ gic->gic_irqs = gic_irqs;
-+
-+ domain->nr_irq = gic_irqs - domain->hwirq_base;
-+ domain->irq_base = irq_alloc_descs(-1, irq_start, domain->nr_irq,
-+ numa_node_id());
-+ domain->priv = gic;
-+ domain->ops = &gic_irq_domain_ops;
-+ irq_domain_add(domain);
-
- gic_chip.flags |= gic_arch_extn.flags;
-- gic_dist_init(gic, irq_start);
-+ gic_dist_init(gic);
- gic_cpu_init(gic);
- gic_pm_init(gic);
- }
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index a61f11e..06a540b 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -33,6 +33,9 @@
- #define GIC_DIST_SOFTINT 0xf00
-
- #ifndef __ASSEMBLY__
-+#include <linux/irqdomain.h>
-+struct device_node;
-+
- extern void __iomem *gic_cpu_base_addr;
- extern struct irq_chip gic_arch_extn;
-
-@@ -43,7 +46,6 @@ void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
- void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
-
- struct gic_chip_data {
-- unsigned int irq_offset;
- void __iomem *dist_base;
- void __iomem *cpu_base;
- #ifdef CONFIG_CPU_PM
-@@ -53,6 +55,9 @@ struct gic_chip_data {
- u32 __percpu *saved_ppi_enable;
- u32 __percpu *saved_ppi_conf;
- #endif
-+#ifdef CONFIG_IRQ_DOMAIN
-+ struct irq_domain domain;
-+#endif
- unsigned int gic_irqs;
- };
- #endif
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0166-ARM-gic-add-OF-based-initialization.patch b/patches.kzm9g/0166-ARM-gic-add-OF-based-initialization.patch
deleted file mode 100644
index 58570564418f2d..00000000000000
--- a/patches.kzm9g/0166-ARM-gic-add-OF-based-initialization.patch
+++ /dev/null
@@ -1,195 +0,0 @@
-From 5f7a0ce78ca6151ea78331f4f474e4984e9d70a1 Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Wed, 28 Sep 2011 21:27:52 -0500
-Subject: ARM: gic: add OF based initialization
-
-This adds ARM gic interrupt controller initialization using device tree
-data.
-
-The initialization function is intended to be called by of_irq_init
-function like this:
-
-const static struct of_device_id irq_match[] = {
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
- {}
-};
-
-static void __init init_irqs(void)
-{
- of_irq_init(irq_match);
-}
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Reviewed-by: Jamie Iles <jamie@jamieiles.com>
-Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
-Acked-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit b3f7ed0324091e2cb23fe1b3c10570700f614014)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/devicetree/bindings/arm/gic.txt | 55 ++++++++++++++++++++++++
- arch/arm/common/gic.c | 61 +++++++++++++++++++++++++++
- arch/arm/include/asm/hardware/gic.h | 1 +
- 3 files changed, 117 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/arm/gic.txt
-
-diff --git a/Documentation/devicetree/bindings/arm/gic.txt b/Documentation/devicetree/bindings/arm/gic.txt
-new file mode 100644
-index 0000000..52916b4
---- /dev/null
-+++ b/Documentation/devicetree/bindings/arm/gic.txt
-@@ -0,0 +1,55 @@
-+* ARM Generic Interrupt Controller
-+
-+ARM SMP cores are often associated with a GIC, providing per processor
-+interrupts (PPI), shared processor interrupts (SPI) and software
-+generated interrupts (SGI).
-+
-+Primary GIC is attached directly to the CPU and typically has PPIs and SGIs.
-+Secondary GICs are cascaded into the upward interrupt controller and do not
-+have PPIs or SGIs.
-+
-+Main node required properties:
-+
-+- compatible : should be one of:
-+ "arm,cortex-a9-gic"
-+ "arm,arm11mp-gic"
-+- interrupt-controller : Identifies the node as an interrupt controller
-+- #interrupt-cells : Specifies the number of cells needed to encode an
-+ interrupt source. The type shall be a <u32> and the value shall be 3.
-+
-+ The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
-+ interrupts.
-+
-+ The 2nd cell contains the interrupt number for the interrupt type.
-+ SPI interrupts are in the range [0-987]. PPI interrupts are in the
-+ range [0-15].
-+
-+ The 3rd cell is the flags, encoded as follows:
-+ bits[3:0] trigger type and level flags.
-+ 1 = low-to-high edge triggered
-+ 2 = high-to-low edge triggered
-+ 4 = active high level-sensitive
-+ 8 = active low level-sensitive
-+ bits[15:8] PPI interrupt cpu mask. Each bit corresponds to each of
-+ the 8 possible cpus attached to the GIC. A bit set to '1' indicated
-+ the interrupt is wired to that CPU. Only valid for PPI interrupts.
-+
-+- reg : Specifies base physical address(s) and size of the GIC registers. The
-+ first region is the GIC distributor register base and size. The 2nd region is
-+ the GIC cpu interface register base and size.
-+
-+Optional
-+- interrupts : Interrupt source of the parent interrupt controller. Only
-+ present on secondary GICs.
-+
-+Example:
-+
-+ intc: interrupt-controller@fff11000 {
-+ compatible = "arm,cortex-a9-gic";
-+ #interrupt-cells = <3>;
-+ #address-cells = <1>;
-+ interrupt-controller;
-+ reg = <0xfff11000 0x1000>,
-+ <0xfff10100 0x100>;
-+ };
-+
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 7286e89..0976555 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -29,6 +29,9 @@
- #include <linux/smp.h>
- #include <linux/cpumask.h>
- #include <linux/io.h>
-+#include <linux/of.h>
-+#include <linux/of_address.h>
-+#include <linux/of_irq.h>
- #include <linux/irqdomain.h>
- #include <linux/interrupt.h>
- #include <linux/percpu.h>
-@@ -555,7 +558,33 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
- }
- #endif
-
-+#ifdef CONFIG_OF
-+static int gic_irq_domain_dt_translate(struct irq_domain *d,
-+ struct device_node *controller,
-+ const u32 *intspec, unsigned int intsize,
-+ unsigned long *out_hwirq, unsigned int *out_type)
-+{
-+ if (d->of_node != controller)
-+ return -EINVAL;
-+ if (intsize < 3)
-+ return -EINVAL;
-+
-+ /* Get the interrupt number and add 16 to skip over SGIs */
-+ *out_hwirq = intspec[1] + 16;
-+
-+ /* For SPIs, we need to add 16 more to get the GIC irq ID number */
-+ if (!intspec[0])
-+ *out_hwirq += 16;
-+
-+ *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
-+ return 0;
-+}
-+#endif
-+
- const struct irq_domain_ops gic_irq_domain_ops = {
-+#ifdef CONFIG_OF
-+ .dt_translate = gic_irq_domain_dt_translate,
-+#endif
- };
-
- void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
-@@ -633,3 +662,35 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
- writel_relaxed(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);
- }
- #endif
-+
-+#ifdef CONFIG_OF
-+static int gic_cnt __initdata = 0;
-+
-+int __init gic_of_init(struct device_node *node, struct device_node *parent)
-+{
-+ void __iomem *cpu_base;
-+ void __iomem *dist_base;
-+ int irq;
-+ struct irq_domain *domain = &gic_data[gic_cnt].domain;
-+
-+ if (WARN_ON(!node))
-+ return -ENODEV;
-+
-+ dist_base = of_iomap(node, 0);
-+ WARN(!dist_base, "unable to map gic dist registers\n");
-+
-+ cpu_base = of_iomap(node, 1);
-+ WARN(!cpu_base, "unable to map gic cpu registers\n");
-+
-+ domain->of_node = of_node_get(node);
-+
-+ gic_init(gic_cnt, 16, dist_base, cpu_base);
-+
-+ if (parent) {
-+ irq = irq_of_parse_and_map(node, 0);
-+ gic_cascade_irq(gic_cnt, irq);
-+ }
-+ gic_cnt++;
-+ return 0;
-+}
-+#endif
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index 06a540b..da822f6 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -40,6 +40,7 @@ extern void __iomem *gic_cpu_base_addr;
- extern struct irq_chip gic_arch_extn;
-
- void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
-+int gic_of_init(struct device_node *node, struct device_node *parent);
- void gic_secondary_init(unsigned int);
- void gic_handle_irq(struct pt_regs *regs);
- void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0167-ARM-gic-fix-irq_alloc_descs-handling-for-sparse-irq.patch b/patches.kzm9g/0167-ARM-gic-fix-irq_alloc_descs-handling-for-sparse-irq.patch
deleted file mode 100644
index 3ca00b31596a53..00000000000000
--- a/patches.kzm9g/0167-ARM-gic-fix-irq_alloc_descs-handling-for-sparse-irq.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From 69c8cbbe40b940304234d68ffa5092a8f1197f45 Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Fri, 21 Oct 2011 17:14:27 -0500
-Subject: ARM: gic: fix irq_alloc_descs handling for sparse irq
-
-Commit "ARM: gic: add irq_domain support" (b49b6ff) breaks SPARSE_IRQ
-on platforms with GIC. When SPARSE_IRQ is enabled, all NR_IRQS or
-mach_desc->nr_irqs will be allocated by arch_probe_nr_irqs(). This caused
-irq_alloc_descs to allocate irq_descs after the pre-allocated space.
-
-Make irq_alloc_descs search for an exact irq range and assume it has
-been pre-allocated on failure. For DT probing dynamic allocation is used.
-DT enabled platforms should set their nr_irqs to NR_IRQ_LEGACY and have all
-irq_chips allocate their irq_descs with irq_alloc_descs if SPARSE_IRQ is
-enabled.
-
-gic_init irq_start param is changed to be signed with negative meaning do
-dynamic Linux irq assigment.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-(cherry picked from commit f37a53cc5d8a8fb199e41386d125d8c2ed9e54ef)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 15 +++++++++++----
- arch/arm/include/asm/hardware/gic.h | 2 +-
- 2 files changed, 12 insertions(+), 5 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 0976555..0ad3584 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -24,6 +24,7 @@
- */
- #include <linux/init.h>
- #include <linux/kernel.h>
-+#include <linux/err.h>
- #include <linux/export.h>
- #include <linux/list.h>
- #include <linux/smp.h>
-@@ -587,7 +588,7 @@ const struct irq_domain_ops gic_irq_domain_ops = {
- #endif
- };
-
--void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
-+void __init gic_init(unsigned int gic_nr, int irq_start,
- void __iomem *dist_base, void __iomem *cpu_base)
- {
- struct gic_chip_data *gic;
-@@ -608,7 +609,8 @@ void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
- if (gic_nr == 0) {
- gic_cpu_base_addr = cpu_base;
- domain->hwirq_base = 16;
-- irq_start = (irq_start & ~31) + 16;
-+ if (irq_start > 0)
-+ irq_start = (irq_start & ~31) + 16;
- } else
- domain->hwirq_base = 32;
-
-@@ -623,8 +625,13 @@ void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
- gic->gic_irqs = gic_irqs;
-
- domain->nr_irq = gic_irqs - domain->hwirq_base;
-- domain->irq_base = irq_alloc_descs(-1, irq_start, domain->nr_irq,
-+ domain->irq_base = irq_alloc_descs(irq_start, 16, domain->nr_irq,
- numa_node_id());
-+ if (IS_ERR_VALUE(domain->irq_base)) {
-+ WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
-+ irq_start);
-+ domain->irq_base = irq_start;
-+ }
- domain->priv = gic;
- domain->ops = &gic_irq_domain_ops;
- irq_domain_add(domain);
-@@ -684,7 +691,7 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
-
- domain->of_node = of_node_get(node);
-
-- gic_init(gic_cnt, 16, dist_base, cpu_base);
-+ gic_init(gic_cnt, -1, dist_base, cpu_base);
-
- if (parent) {
- irq = irq_of_parse_and_map(node, 0);
-diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
-index da822f6..b7641d6 100644
---- a/arch/arm/include/asm/hardware/gic.h
-+++ b/arch/arm/include/asm/hardware/gic.h
-@@ -39,7 +39,7 @@ struct device_node;
- extern void __iomem *gic_cpu_base_addr;
- extern struct irq_chip gic_arch_extn;
-
--void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
-+void gic_init(unsigned int, int, void __iomem *, void __iomem *);
- int gic_of_init(struct device_node *node, struct device_node *parent);
- void gic_secondary_init(unsigned int);
- void gic_handle_irq(struct pt_regs *regs);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0168-ARM-gic-use-module.h-instead-of-export.h.patch b/patches.kzm9g/0168-ARM-gic-use-module.h-instead-of-export.h.patch
deleted file mode 100644
index 57daec9d76260e..00000000000000
--- a/patches.kzm9g/0168-ARM-gic-use-module.h-instead-of-export.h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 821b37ef872cbc43bfd3b3c3d9b85aeebe863349 Mon Sep 17 00:00:00 2001
-From: Arnd Bergmann <arnd@arndb.de>
-Date: Tue, 1 Nov 2011 00:28:37 +0100
-Subject: ARM: gic: use module.h instead of export.h
-
-The module.h cleanup series is not merged at this point, so use the
-older header file for now, to make it build either way.
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-(cherry picked from commit 7e1efcf5d2039fb7a91e21df32f4175dbca4d61c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 0ad3584..f4b2864 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -25,7 +25,7 @@
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/err.h>
--#include <linux/export.h>
-+#include <linux/module.h>
- #include <linux/list.h>
- #include <linux/smp.h>
- #include <linux/cpumask.h>
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0169-ARM-7176-1-cpu_pm-register-GIC-PM-notifier-only-once.patch b/patches.kzm9g/0169-ARM-7176-1-cpu_pm-register-GIC-PM-notifier-only-once.patch
deleted file mode 100644
index 2f1510de03f150..00000000000000
--- a/patches.kzm9g/0169-ARM-7176-1-cpu_pm-register-GIC-PM-notifier-only-once.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c17eb62ef5e57dbca9e3789f931edae8d0af6247 Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <Marc.Zyngier@arm.com>
-Date: Fri, 25 Nov 2011 17:58:19 +0100
-Subject: ARM: 7176/1: cpu_pm: register GIC PM notifier only once
-
-When multiple GICs exist on a platform (RealView PB1176/11MP),
-we must make sure the PM notifier block is only registered
-once, otherwise we end up corrupting the PM notifier list.
-
-The fix is to only register the notifier when initializing
-the first GIC, as the power management functions seem
-to iterate over all the registered GICs.
-
-Tested on PB11MP and PB1176.
-
-Reported-by: Will Deacon <will.deacon@arm.com>
-Tested-by: Will Deacon <will.deacon@arm.com>
-Cc: Colin Cross <ccross@android.com>
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit abdd7b91dab2f8b2e32e90e4b7e809ffb462a662)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index f4b2864..432c879 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -551,7 +551,8 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
- sizeof(u32));
- BUG_ON(!gic->saved_ppi_conf);
-
-- cpu_pm_register_notifier(&gic_notifier_block);
-+ if (gic == &gic_data[0])
-+ cpu_pm_register_notifier(&gic_notifier_block);
- }
- #else
- static void __init gic_pm_init(struct gic_chip_data *gic)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0170-ARM-7177-1-GIC-avoid-skipping-non-existent-PPIs-in-i.patch b/patches.kzm9g/0170-ARM-7177-1-GIC-avoid-skipping-non-existent-PPIs-in-i.patch
deleted file mode 100644
index 5ee8e3eb9bf4b4..00000000000000
--- a/patches.kzm9g/0170-ARM-7177-1-GIC-avoid-skipping-non-existent-PPIs-in-i.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From c7dd20bb08c673ce9ce055074c77d92760bc03ac Mon Sep 17 00:00:00 2001
-From: Will Deacon <will.deacon@arm.com>
-Date: Fri, 25 Nov 2011 19:23:36 +0100
-Subject: ARM: 7177/1: GIC: avoid skipping non-existent PPIs in irq_start
- calculation
-
-Commit 4294f8baa ("ARM: gic: add irq_domain support") defines irq_start
-as irq_start = (irq_start & ~31) + 16; On a platform with a GIC and a
-CPU without PPIs, this results in irq_start being off by 16.
-
-This patch fixes gic_init so that we only carve out a PPI space when
-PPIs exist for the GIC being initialised.
-
-Cc: Rob Herring <rob.herring@calxeda.com>
-Signed-off-by: Will Deacon <will.deacon@arm.com>
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit fe41db7b3aca512e19b8ef4fbd5ad55545005d25)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/common/gic.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
-index 432c879..0b95dc5 100644
---- a/arch/arm/common/gic.c
-+++ b/arch/arm/common/gic.c
-@@ -607,13 +607,16 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
- * For primary GICs, skip over SGIs.
- * For secondary GICs, skip over PPIs, too.
- */
-+ domain->hwirq_base = 32;
- if (gic_nr == 0) {
- gic_cpu_base_addr = cpu_base;
-- domain->hwirq_base = 16;
-- if (irq_start > 0)
-- irq_start = (irq_start & ~31) + 16;
-- } else
-- domain->hwirq_base = 32;
-+
-+ if ((irq_start & 31) > 0) {
-+ domain->hwirq_base = 16;
-+ if (irq_start != -1)
-+ irq_start = (irq_start & ~31) + 16;
-+ }
-+ }
-
- /*
- * Find out how many interrupts are supported.
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0171-ARM-mach-shmobile-clock-sh73a0-tidyup-CKSCR-main-clo.patch b/patches.kzm9g/0171-ARM-mach-shmobile-clock-sh73a0-tidyup-CKSCR-main-clo.patch
deleted file mode 100644
index 4cdc9a6b45eb52..00000000000000
--- a/patches.kzm9g/0171-ARM-mach-shmobile-clock-sh73a0-tidyup-CKSCR-main-clo.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f62259f22080ff97053936c271bb057b6cd2b7b1 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Fri, 26 Aug 2011 07:27:45 +0000
-Subject: ARM: mach-shmobile: clock-sh73a0: tidyup CKSCR main clock selecter
-
-MAINCKSEL is [29:28], not [27:24]
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 86d84083cfb15dd9594eefff7859e982770930d0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 9fc2830..44a923d 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -365,7 +365,7 @@ void __init sh73a0_clock_init(void)
- __raw_writel(0x108, SD2CKCR);
-
- /* detect main clock parent */
-- switch ((__raw_readl(CKSCR) >> 24) & 0x03) {
-+ switch ((__raw_readl(CKSCR) >> 28) & 0x03) {
- case 0:
- main_clk.parent = &sh73a0_extal1_clk;
- break;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0172-ARM-mach-shmobile-sh73a0-PFC-pull-up-support-for-SDH.patch b/patches.kzm9g/0172-ARM-mach-shmobile-sh73a0-PFC-pull-up-support-for-SDH.patch
deleted file mode 100644
index 6eaaca6e91668a..00000000000000
--- a/patches.kzm9g/0172-ARM-mach-shmobile-sh73a0-PFC-pull-up-support-for-SDH.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-From 78057d7b664fb1d2f584807f5511dca73e595df9 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 18 Aug 2011 04:32:08 +0000
-Subject: ARM: mach-shmobile: sh73a0 PFC pull-up support for SDHI0+2
-
-Extend the existing sh73a0 PFC code with pull-ups for
-SDHI0 and SDHI2. Without this patch only SDHI1 has
-pull-up support on sh73a0. Needed by boards that make
-use of the internal pull-up resistor support built in
-the SoC.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 09dafe9e4e266c7868454a532c9ca762aa5c40a5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/sh73a0.h | 13 +++++
- arch/arm/mach-shmobile/pfc-sh73a0.c | 77 ++++++++++++++++++++++------
- 2 files changed, 75 insertions(+), 15 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-index 216c3d6..b385e97 100644
---- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
-+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-@@ -451,11 +451,23 @@ enum {
- GPIO_FN_KEYIN5_PU,
- GPIO_FN_KEYIN6_PU,
- GPIO_FN_KEYIN7_PU,
-+ GPIO_FN_SDHICD0_PU,
-+ GPIO_FN_SDHID0_0_PU,
-+ GPIO_FN_SDHID0_1_PU,
-+ GPIO_FN_SDHID0_2_PU,
-+ GPIO_FN_SDHID0_3_PU,
-+ GPIO_FN_SDHICMD0_PU,
-+ GPIO_FN_SDHIWP0_PU,
- GPIO_FN_SDHID1_0_PU,
- GPIO_FN_SDHID1_1_PU,
- GPIO_FN_SDHID1_2_PU,
- GPIO_FN_SDHID1_3_PU,
- GPIO_FN_SDHICMD1_PU,
-+ GPIO_FN_SDHID2_0_PU,
-+ GPIO_FN_SDHID2_1_PU,
-+ GPIO_FN_SDHID2_2_PU,
-+ GPIO_FN_SDHID2_3_PU,
-+ GPIO_FN_SDHICMD2_PU,
- GPIO_FN_MMCCMD0_PU,
- GPIO_FN_MMCCMD1_PU,
- GPIO_FN_FSIACK_PU,
-@@ -463,6 +475,7 @@ enum {
- GPIO_FN_FSIAIBT_PU,
- GPIO_FN_FSIAISLD_PU,
- };
-+
- /* DMA slave IDs */
- enum {
- SHDMA_SLAVE_INVALID,
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index d8915c6..599016e 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -476,13 +476,26 @@ enum {
- KEYIN5_PU_MARK,
- KEYIN6_PU_MARK,
- KEYIN7_PU_MARK,
-+ SDHICD0_PU_MARK,
-+ SDHID0_0_PU_MARK,
-+ SDHID0_1_PU_MARK,
-+ SDHID0_2_PU_MARK,
-+ SDHID0_3_PU_MARK,
-+ SDHICMD0_PU_MARK,
-+ SDHIWP0_PU_MARK,
- SDHID1_0_PU_MARK,
- SDHID1_1_PU_MARK,
- SDHID1_2_PU_MARK,
- SDHID1_3_PU_MARK,
- SDHICMD1_PU_MARK,
-+ SDHID2_0_PU_MARK,
-+ SDHID2_1_PU_MARK,
-+ SDHID2_2_PU_MARK,
-+ SDHID2_3_PU_MARK,
-+ SDHICMD2_PU_MARK,
- MMCCMD0_PU_MARK,
- MMCCMD1_PU_MARK,
-+ FSIBISLD_PU_MARK,
- FSIACK_PU_MARK,
- FSIAILR_PU_MARK,
- FSIAIBT_PU_MARK,
-@@ -1336,19 +1349,28 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(TS_SCK4_MARK, PORT268_FN3),
- PINMUX_DATA(SDHICMD2_MARK, PORT269_FN1),
- PINMUX_DATA(MMCCLK0_MARK, PORT270_FN1, MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCD0_0_MARK, PORT271_FN1, MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCD0_1_MARK, PORT272_FN1, MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCD0_2_MARK, PORT273_FN1, MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCD0_3_MARK, PORT274_FN1, MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCD0_4_MARK, PORT275_FN1, MSEL4CR_MSEL15_0), \
-+ PINMUX_DATA(MMCD0_0_MARK, PORT271_FN1, PORT271_IN_PU,
-+ MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_1_MARK, PORT272_FN1, PORT272_IN_PU,
-+ MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_2_MARK, PORT273_FN1, PORT273_IN_PU,
-+ MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_3_MARK, PORT274_FN1, PORT274_IN_PU,
-+ MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_4_MARK, PORT275_FN1, PORT275_IN_PU,
-+ MSEL4CR_MSEL15_0), \
- PINMUX_DATA(TS_SPSYNC5_MARK, PORT275_FN3),
-- PINMUX_DATA(MMCD0_5_MARK, PORT276_FN1, MSEL4CR_MSEL15_0), \
-+ PINMUX_DATA(MMCD0_5_MARK, PORT276_FN1, PORT276_IN_PU,
-+ MSEL4CR_MSEL15_0), \
- PINMUX_DATA(TS_SDAT5_MARK, PORT276_FN3),
-- PINMUX_DATA(MMCD0_6_MARK, PORT277_FN1, MSEL4CR_MSEL15_0), \
-+ PINMUX_DATA(MMCD0_6_MARK, PORT277_FN1, PORT277_IN_PU,
-+ MSEL4CR_MSEL15_0), \
- PINMUX_DATA(TS_SDEN5_MARK, PORT277_FN3),
-- PINMUX_DATA(MMCD0_7_MARK, PORT278_FN1, MSEL4CR_MSEL15_0), \
-+ PINMUX_DATA(MMCD0_7_MARK, PORT278_FN1, PORT278_IN_PU,
-+ MSEL4CR_MSEL15_0), \
- PINMUX_DATA(TS_SCK5_MARK, PORT278_FN3),
-- PINMUX_DATA(MMCCMD0_MARK, PORT279_FN1, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCCMD0_MARK, PORT279_FN1, PORT279_IN_PU,
-+ MSEL4CR_MSEL15_0),
- PINMUX_DATA(RESETOUTS__MARK, PORT281_FN1), \
- PINMUX_DATA(EXTAL2OUT_MARK, PORT281_FN2),
- PINMUX_DATA(MCP_WAIT__MCP_FRB_MARK, PORT288_FN1),
-@@ -1465,16 +1487,29 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(KEYIN6_PU_MARK, PORT72_FN2, PORT72_IN_PU),
- PINMUX_DATA(KEYIN7_PU_MARK, PORT73_FN2, PORT73_IN_PU),
-
-- PINMUX_DATA(SDHID1_0_PU_MARK, PORT259_IN_PU, PORT259_FN1),
-- PINMUX_DATA(SDHID1_1_PU_MARK, PORT260_IN_PU, PORT260_FN1),
-- PINMUX_DATA(SDHID1_2_PU_MARK, PORT261_IN_PU, PORT261_FN1),
-- PINMUX_DATA(SDHID1_3_PU_MARK, PORT262_IN_PU, PORT262_FN1),
-- PINMUX_DATA(SDHICMD1_PU_MARK, PORT263_IN_PU, PORT263_FN1),
-+ PINMUX_DATA(SDHICD0_PU_MARK, PORT251_FN1, PORT251_IN_PU),
-+ PINMUX_DATA(SDHID0_0_PU_MARK, PORT252_FN1, PORT252_IN_PU),
-+ PINMUX_DATA(SDHID0_1_PU_MARK, PORT253_FN1, PORT253_IN_PU),
-+ PINMUX_DATA(SDHID0_2_PU_MARK, PORT254_FN1, PORT254_IN_PU),
-+ PINMUX_DATA(SDHID0_3_PU_MARK, PORT255_FN1, PORT255_IN_PU),
-+ PINMUX_DATA(SDHICMD0_PU_MARK, PORT256_FN1, PORT256_IN_PU),
-+ PINMUX_DATA(SDHIWP0_PU_MARK, PORT257_FN1, PORT256_IN_PU),
-+ PINMUX_DATA(SDHID1_0_PU_MARK, PORT259_FN1, PORT259_IN_PU),
-+ PINMUX_DATA(SDHID1_1_PU_MARK, PORT260_FN1, PORT260_IN_PU),
-+ PINMUX_DATA(SDHID1_2_PU_MARK, PORT261_FN1, PORT261_IN_PU),
-+ PINMUX_DATA(SDHID1_3_PU_MARK, PORT262_FN1, PORT262_IN_PU),
-+ PINMUX_DATA(SDHICMD1_PU_MARK, PORT263_FN1, PORT263_IN_PU),
-+ PINMUX_DATA(SDHID2_0_PU_MARK, PORT265_FN1, PORT265_IN_PU),
-+ PINMUX_DATA(SDHID2_1_PU_MARK, PORT266_FN1, PORT266_IN_PU),
-+ PINMUX_DATA(SDHID2_2_PU_MARK, PORT267_FN1, PORT267_IN_PU),
-+ PINMUX_DATA(SDHID2_3_PU_MARK, PORT268_FN1, PORT268_IN_PU),
-+ PINMUX_DATA(SDHICMD2_PU_MARK, PORT269_FN1, PORT269_IN_PU),
-
- PINMUX_DATA(MMCCMD0_PU_MARK, PORT279_FN1, PORT279_IN_PU,
- MSEL4CR_MSEL15_0),
-- PINMUX_DATA(MMCCMD1_PU_MARK, PORT297_FN2, PORT279_IN_PU,
-+ PINMUX_DATA(MMCCMD1_PU_MARK, PORT297_FN2, PORT297_IN_PU,
- MSEL4CR_MSEL15_1),
-+ PINMUX_DATA(FSIBISLD_PU_MARK, PORT39_FN1, PORT39_IN_PU),
- PINMUX_DATA(FSIACK_PU_MARK, PORT49_FN1, PORT49_IN_PU),
- PINMUX_DATA(FSIAILR_PU_MARK, PORT50_FN5, PORT50_IN_PU),
- PINMUX_DATA(FSIAIBT_PU_MARK, PORT51_FN5, PORT51_IN_PU),
-@@ -2126,11 +2161,23 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(KEYIN5_PU),
- GPIO_FN(KEYIN6_PU),
- GPIO_FN(KEYIN7_PU),
-+ GPIO_FN(SDHICD0_PU),
-+ GPIO_FN(SDHID0_0_PU),
-+ GPIO_FN(SDHID0_1_PU),
-+ GPIO_FN(SDHID0_2_PU),
-+ GPIO_FN(SDHID0_3_PU),
-+ GPIO_FN(SDHICMD0_PU),
-+ GPIO_FN(SDHIWP0_PU),
- GPIO_FN(SDHID1_0_PU),
- GPIO_FN(SDHID1_1_PU),
- GPIO_FN(SDHID1_2_PU),
- GPIO_FN(SDHID1_3_PU),
- GPIO_FN(SDHICMD1_PU),
-+ GPIO_FN(SDHID2_0_PU),
-+ GPIO_FN(SDHID2_1_PU),
-+ GPIO_FN(SDHID2_2_PU),
-+ GPIO_FN(SDHID2_3_PU),
-+ GPIO_FN(SDHICMD2_PU),
- GPIO_FN(MMCCMD0_PU),
- GPIO_FN(MMCCMD1_PU),
- GPIO_FN(FSIACK_PU),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0173-ARM-shmobile-convert-logical-CPU-numbers-to-physical.patch b/patches.kzm9g/0173-ARM-shmobile-convert-logical-CPU-numbers-to-physical.patch
deleted file mode 100644
index b5b7d6d9163127..00000000000000
--- a/patches.kzm9g/0173-ARM-shmobile-convert-logical-CPU-numbers-to-physical.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 99e07f2cb417d9c739ff222b73d8a4040486249f Mon Sep 17 00:00:00 2001
-From: Will Deacon <will.deacon@arm.com>
-Date: Tue, 9 Aug 2011 12:13:53 +0100
-Subject: ARM: shmobile: convert logical CPU numbers to physical numbers
-
-This patch uses the new cpu_logical_map() macro for converting logical
-CPU numbers into physical numbers when dealing with the SCU in the SMP
-boot path for sh73a0.
-
-Cc: Magnus Damm <magnus.damm@gmail.com>
-Cc: Paul Mundt <lethal@linux-sh.org>
-Signed-off-by: Will Deacon <will.deacon@arm.com>
-(cherry picked from commit f80ca52cab8f999246ed2e4daa90eb40cb810822)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/smp-sh73a0.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
-index 3ffdbc9..be1ade7 100644
---- a/arch/arm/mach-shmobile/smp-sh73a0.c
-+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
-@@ -74,6 +74,8 @@ void __cpuinit sh73a0_secondary_init(unsigned int cpu)
-
- int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
- {
-+ cpu = cpu_logical_map(cpu);
-+
- /* enable cache coherency */
- modify_scu_cpu_psr(0, 3 << (cpu * 8));
-
-@@ -87,6 +89,8 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
-
- void __init sh73a0_smp_prepare_cpus(void)
- {
-+ int cpu = cpu_logical_map(0);
-+
- scu_enable(scu_base_addr());
-
- /* Map the reset vector (in headsmp.S) */
-@@ -94,5 +98,5 @@ void __init sh73a0_smp_prepare_cpus(void)
- __raw_writel(__pa(shmobile_secondary_vector), __io(SBAR));
-
- /* enable cache coherency on CPU0 */
-- modify_scu_cpu_psr(0, 3 << (0 * 8));
-+ modify_scu_cpu_psr(0, 3 << (cpu * 8));
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0174-ARM-mach-shmobile-sh73a0-GPIO-IRQ-support.patch b/patches.kzm9g/0174-ARM-mach-shmobile-sh73a0-GPIO-IRQ-support.patch
deleted file mode 100644
index 176239b986de4e..00000000000000
--- a/patches.kzm9g/0174-ARM-mach-shmobile-sh73a0-GPIO-IRQ-support.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From ce81dcdbb5efaf6b9e1662138e6ce62833cb584d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 28 Sep 2011 16:55:45 +0900
-Subject: ARM: mach-shmobile: sh73a0 GPIO IRQ support
-
-This patch adds support for sh73a0 GPIO IRQs by making use
-of the PFC GPIO IRQ feature. Only IRQ pins are supported
-at this time. In the future when PINT interrupts also are
-supported properly we can easily extend the table with such
-information. Also, the sh73a0 is currently making use of
-the GIC for external interrupt which is rather unflexible
-when it comes to triggering configuration at this point.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 13fc7e7c2cd08a884f76eeb940957160b296d5c3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-sh73a0.c | 41 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 41 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index 599016e..0e24ac4 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -22,6 +22,7 @@
- #include <linux/kernel.h>
- #include <linux/gpio.h>
- #include <mach/sh73a0.h>
-+#include <mach/irqs.h>
-
- #define CPU_ALL_PORT(fn, pfx, sfx) \
- PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
-@@ -2698,6 +2699,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
- { },
- };
-
-+#define EXT_IRQ(n) gic_spi((n) + 1) /* GIC SPI starting from 1 for IRQ0 */
-+
-+static struct pinmux_irq pinmux_irqs[] = {
-+ PINMUX_IRQ(EXT_IRQ(19), PORT9_FN0),
-+ PINMUX_IRQ(EXT_IRQ(1), PORT10_FN0),
-+ PINMUX_IRQ(EXT_IRQ(0), PORT11_FN0),
-+ PINMUX_IRQ(EXT_IRQ(18), PORT13_FN0),
-+ PINMUX_IRQ(EXT_IRQ(20), PORT14_FN0),
-+ PINMUX_IRQ(EXT_IRQ(21), PORT15_FN0),
-+ PINMUX_IRQ(EXT_IRQ(31), PORT26_FN0),
-+ PINMUX_IRQ(EXT_IRQ(30), PORT27_FN0),
-+ PINMUX_IRQ(EXT_IRQ(29), PORT28_FN0),
-+ PINMUX_IRQ(EXT_IRQ(22), PORT40_FN0),
-+ PINMUX_IRQ(EXT_IRQ(23), PORT53_FN0),
-+ PINMUX_IRQ(EXT_IRQ(10), PORT54_FN0),
-+ PINMUX_IRQ(EXT_IRQ(9), PORT56_FN0),
-+ PINMUX_IRQ(EXT_IRQ(26), PORT115_FN0),
-+ PINMUX_IRQ(EXT_IRQ(27), PORT116_FN0),
-+ PINMUX_IRQ(EXT_IRQ(28), PORT117_FN0),
-+ PINMUX_IRQ(EXT_IRQ(24), PORT118_FN0),
-+ PINMUX_IRQ(EXT_IRQ(6), PORT147_FN0),
-+ PINMUX_IRQ(EXT_IRQ(2), PORT149_FN0),
-+ PINMUX_IRQ(EXT_IRQ(7), PORT150_FN0),
-+ PINMUX_IRQ(EXT_IRQ(12), PORT156_FN0),
-+ PINMUX_IRQ(EXT_IRQ(4), PORT159_FN0),
-+ PINMUX_IRQ(EXT_IRQ(25), PORT164_FN0),
-+ PINMUX_IRQ(EXT_IRQ(8), PORT223_FN0),
-+ PINMUX_IRQ(EXT_IRQ(3), PORT224_FN0),
-+ PINMUX_IRQ(EXT_IRQ(5), PORT227_FN0),
-+ PINMUX_IRQ(EXT_IRQ(17), PORT234_FN0),
-+ PINMUX_IRQ(EXT_IRQ(11), PORT238_FN0),
-+ PINMUX_IRQ(EXT_IRQ(13), PORT239_FN0),
-+ PINMUX_IRQ(EXT_IRQ(16), PORT249_FN0),
-+ PINMUX_IRQ(EXT_IRQ(14), PORT251_FN0),
-+ PINMUX_IRQ(EXT_IRQ(9), PORT308_FN0),
-+};
-+
- static struct pinmux_info sh73a0_pinmux_info = {
- .name = "sh73a0_pfc",
- .reserved_id = PINMUX_RESERVED,
-@@ -2718,6 +2756,9 @@ static struct pinmux_info sh73a0_pinmux_info = {
-
- .gpio_data = pinmux_data,
- .gpio_data_size = ARRAY_SIZE(pinmux_data),
-+
-+ .gpio_irq = pinmux_irqs,
-+ .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
- };
-
- void sh73a0_pinmux_init(void)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0175-ARM-mach-shmobile-Use-common-INTC-IRQ-code-on-sh73a0.patch b/patches.kzm9g/0175-ARM-mach-shmobile-Use-common-INTC-IRQ-code-on-sh73a0.patch
deleted file mode 100644
index 40dc2454aad3d4..00000000000000
--- a/patches.kzm9g/0175-ARM-mach-shmobile-Use-common-INTC-IRQ-code-on-sh73a0.patch
+++ /dev/null
@@ -1,259 +0,0 @@
-From 3c8de348dc6f41d179ea079f2530837ce0808d97 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 12 Oct 2011 16:21:42 +0900
-Subject: ARM: mach-shmobile: Use common INTC IRQ code on sh73a0
-
-Improve IRQ triggering support by making use of the macro
-INTC_IRQ_PINS_32() for INTCA on sh73a0. Unfortunately it
-is not as easy as just using the macro as-is, we need to
-do mask and unmaks in the GIC but configure other bits
-and ack in INTCA. Update GPIO IRQ mappings while at it.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a1993055efcc14fd6d213b936d28a41ea52e1d3d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/intc-sh73a0.c | 122 +++++++++++++++++++++++++++++++++++
- arch/arm/mach-shmobile/pfc-sh73a0.c | 68 +++++++++----------
- 2 files changed, 157 insertions(+), 33 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
-index a911a60..836e815 100644
---- a/arch/arm/mach-shmobile/intc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
-@@ -22,6 +22,7 @@
- #include <linux/irq.h>
- #include <linux/io.h>
- #include <linux/sh_intc.h>
-+#include <mach/intc.h>
- #include <asm/hardware/gic.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
-@@ -255,20 +256,141 @@ static int sh73a0_set_wake(struct irq_data *data, unsigned int on)
- return 0; /* always allow wakeup */
- }
-
-+#define RELOC_BASE 0x1000
-+
-+/* INTCA IRQ pins at INTCS + 0x1000 to make space for GIC+INTC handling */
-+#define INTCS_VECT_RELOC(n, vect) INTCS_VECT((n), (vect) + RELOC_BASE)
-+
-+INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000,
-+ INTCS_VECT_RELOC, "sh73a0-intca-irq-pins");
-+
-+static int to_gic_irq(struct irq_data *data)
-+{
-+ unsigned int vect = irq2evt(data->irq) - INTCS_VECT_BASE;
-+
-+ if (vect >= 0x3200)
-+ vect -= 0x3000;
-+ else
-+ vect -= 0x0200;
-+
-+ return gic_spi((vect >> 5) + 1);
-+}
-+
-+static int to_intca_reloc_irq(struct irq_data *data)
-+{
-+ return data->irq + (RELOC_BASE >> 5);
-+}
-+
-+#define irq_cb(cb, irq) irq_get_chip(irq)->cb(irq_get_irq_data(irq))
-+#define irq_cbp(cb, irq, p...) irq_get_chip(irq)->cb(irq_get_irq_data(irq), p)
-+
-+static void intca_gic_enable(struct irq_data *data)
-+{
-+ irq_cb(irq_unmask, to_intca_reloc_irq(data));
-+ irq_cb(irq_unmask, to_gic_irq(data));
-+}
-+
-+static void intca_gic_disable(struct irq_data *data)
-+{
-+ irq_cb(irq_mask, to_gic_irq(data));
-+ irq_cb(irq_mask, to_intca_reloc_irq(data));
-+}
-+
-+static void intca_gic_mask_ack(struct irq_data *data)
-+{
-+ irq_cb(irq_mask, to_gic_irq(data));
-+ irq_cb(irq_mask_ack, to_intca_reloc_irq(data));
-+}
-+
-+static void intca_gic_eoi(struct irq_data *data)
-+{
-+ irq_cb(irq_eoi, to_gic_irq(data));
-+}
-+
-+static int intca_gic_set_type(struct irq_data *data, unsigned int type)
-+{
-+ return irq_cbp(irq_set_type, to_intca_reloc_irq(data), type);
-+}
-+
-+static int intca_gic_set_wake(struct irq_data *data, unsigned int on)
-+{
-+ return irq_cbp(irq_set_wake, to_intca_reloc_irq(data), on);
-+}
-+
-+#ifdef CONFIG_SMP
-+static int intca_gic_set_affinity(struct irq_data *data,
-+ const struct cpumask *cpumask,
-+ bool force)
-+{
-+ return irq_cbp(irq_set_affinity, to_gic_irq(data), cpumask, force);
-+}
-+#endif
-+
-+struct irq_chip intca_gic_irq_chip = {
-+ .name = "INTCA-GIC",
-+ .irq_mask = intca_gic_disable,
-+ .irq_unmask = intca_gic_enable,
-+ .irq_mask_ack = intca_gic_mask_ack,
-+ .irq_eoi = intca_gic_eoi,
-+ .irq_enable = intca_gic_enable,
-+ .irq_disable = intca_gic_disable,
-+ .irq_shutdown = intca_gic_disable,
-+ .irq_set_type = intca_gic_set_type,
-+ .irq_set_wake = intca_gic_set_wake,
-+#ifdef CONFIG_SMP
-+ .irq_set_affinity = intca_gic_set_affinity,
-+#endif
-+};
-+
-+static int to_intc_vect(int irq)
-+{
-+ unsigned int irq_pin = irq - gic_spi(1);
-+ unsigned int offs;
-+
-+ if (irq_pin < 16)
-+ offs = 0x0200;
-+ else
-+ offs = 0x3000;
-+
-+ return offs + (irq_pin << 5);
-+}
-+
-+static irqreturn_t sh73a0_irq_pin_demux(int irq, void *dev_id)
-+{
-+ generic_handle_irq(intcs_evt2irq(to_intc_vect(irq)));
-+ return IRQ_HANDLED;
-+}
-+
-+static struct irqaction sh73a0_irq_pin_cascade[32];
-+
- void __init sh73a0_init_irq(void)
- {
- void __iomem *gic_dist_base = __io(0xf0001000);
- void __iomem *gic_cpu_base = __io(0xf0000100);
- void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
-+ int k, n;
-
- gic_init(0, 29, gic_dist_base, gic_cpu_base);
- gic_arch_extn.irq_set_wake = sh73a0_set_wake;
-
- register_intc_controller(&intcs_desc);
-+ register_intc_controller(&intca_irq_pins_desc);
-
- /* demux using INTEVTSA */
- sh73a0_intcs_cascade.name = "INTCS cascade";
- sh73a0_intcs_cascade.handler = sh73a0_intcs_demux;
- sh73a0_intcs_cascade.dev_id = intevtsa;
- setup_irq(gic_spi(50), &sh73a0_intcs_cascade);
-+
-+ /* IRQ pins require special handling through INTCA and GIC */
-+ for (k = 0; k < 32; k++) {
-+ sh73a0_irq_pin_cascade[k].name = "INTCA-GIC cascade";
-+ sh73a0_irq_pin_cascade[k].handler = sh73a0_irq_pin_demux;
-+ setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
-+
-+ n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
-+ irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
-+ handle_level_irq, "level");
-+ set_irq_flags(n, IRQF_VALID); /* yuck */
-+ }
- }
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index 0e24ac4..cf7c7bb 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -2699,41 +2699,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
- { },
- };
-
--#define EXT_IRQ(n) gic_spi((n) + 1) /* GIC SPI starting from 1 for IRQ0 */
-+/* IRQ pins through INTCS with IRQ0->15 from 0x200 and IRQ16-31 from 0x3200 */
-+#define EXT_IRQ16L(n) intcs_evt2irq(0x200 + ((n) << 5))
-+#define EXT_IRQ16H(n) intcs_evt2irq(0x3200 + ((n - 16) << 5))
-
- static struct pinmux_irq pinmux_irqs[] = {
-- PINMUX_IRQ(EXT_IRQ(19), PORT9_FN0),
-- PINMUX_IRQ(EXT_IRQ(1), PORT10_FN0),
-- PINMUX_IRQ(EXT_IRQ(0), PORT11_FN0),
-- PINMUX_IRQ(EXT_IRQ(18), PORT13_FN0),
-- PINMUX_IRQ(EXT_IRQ(20), PORT14_FN0),
-- PINMUX_IRQ(EXT_IRQ(21), PORT15_FN0),
-- PINMUX_IRQ(EXT_IRQ(31), PORT26_FN0),
-- PINMUX_IRQ(EXT_IRQ(30), PORT27_FN0),
-- PINMUX_IRQ(EXT_IRQ(29), PORT28_FN0),
-- PINMUX_IRQ(EXT_IRQ(22), PORT40_FN0),
-- PINMUX_IRQ(EXT_IRQ(23), PORT53_FN0),
-- PINMUX_IRQ(EXT_IRQ(10), PORT54_FN0),
-- PINMUX_IRQ(EXT_IRQ(9), PORT56_FN0),
-- PINMUX_IRQ(EXT_IRQ(26), PORT115_FN0),
-- PINMUX_IRQ(EXT_IRQ(27), PORT116_FN0),
-- PINMUX_IRQ(EXT_IRQ(28), PORT117_FN0),
-- PINMUX_IRQ(EXT_IRQ(24), PORT118_FN0),
-- PINMUX_IRQ(EXT_IRQ(6), PORT147_FN0),
-- PINMUX_IRQ(EXT_IRQ(2), PORT149_FN0),
-- PINMUX_IRQ(EXT_IRQ(7), PORT150_FN0),
-- PINMUX_IRQ(EXT_IRQ(12), PORT156_FN0),
-- PINMUX_IRQ(EXT_IRQ(4), PORT159_FN0),
-- PINMUX_IRQ(EXT_IRQ(25), PORT164_FN0),
-- PINMUX_IRQ(EXT_IRQ(8), PORT223_FN0),
-- PINMUX_IRQ(EXT_IRQ(3), PORT224_FN0),
-- PINMUX_IRQ(EXT_IRQ(5), PORT227_FN0),
-- PINMUX_IRQ(EXT_IRQ(17), PORT234_FN0),
-- PINMUX_IRQ(EXT_IRQ(11), PORT238_FN0),
-- PINMUX_IRQ(EXT_IRQ(13), PORT239_FN0),
-- PINMUX_IRQ(EXT_IRQ(16), PORT249_FN0),
-- PINMUX_IRQ(EXT_IRQ(14), PORT251_FN0),
-- PINMUX_IRQ(EXT_IRQ(9), PORT308_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(19), PORT9_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(1), PORT10_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(0), PORT11_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(18), PORT13_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(20), PORT14_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(21), PORT15_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(31), PORT26_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(30), PORT27_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(29), PORT28_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(22), PORT40_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(23), PORT53_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(10), PORT54_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(9), PORT56_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(26), PORT115_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(27), PORT116_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(28), PORT117_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(24), PORT118_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(6), PORT147_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(2), PORT149_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(7), PORT150_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(12), PORT156_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(4), PORT159_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(25), PORT164_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(8), PORT223_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(3), PORT224_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(5), PORT227_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(17), PORT234_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(11), PORT238_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(13), PORT239_FN0),
-+ PINMUX_IRQ(EXT_IRQ16H(16), PORT249_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(14), PORT251_FN0),
-+ PINMUX_IRQ(EXT_IRQ16L(9), PORT308_FN0),
- };
-
- static struct pinmux_info sh73a0_pinmux_info = {
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0176-ARM-mach-shmobile-sh73a0-and-AG5EVM-PINT-support.patch b/patches.kzm9g/0176-ARM-mach-shmobile-sh73a0-and-AG5EVM-PINT-support.patch
deleted file mode 100644
index 743aebd5c9a5fb..00000000000000
--- a/patches.kzm9g/0176-ARM-mach-shmobile-sh73a0-and-AG5EVM-PINT-support.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-From ba8cc79e847a7743d3c835c92fb2f73c32871f3d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 17 Oct 2011 18:00:52 +0900
-Subject: ARM: mach-shmobile: sh73a0 and AG5EVM PINT support
-
-Support PINT on sh73a0 and AG5EVM using INTC PINT macros.
-
-With this patch applied the AG5EVM ethernet is handled
-through one of the chained sh73a0 PINT interrupt controllers.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 566aad39df77211467078e0b3dcd62100f56b5e4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 17 +-------
- arch/arm/mach-shmobile/include/mach/sh73a0.h | 4 ++
- arch/arm/mach-shmobile/intc-sh73a0.c | 65 ++++++++++++++++++++++++++++
- 3 files changed, 71 insertions(+), 15 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index f04ee16..430c723 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -59,7 +59,7 @@ static struct resource smsc9220_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- [1] = {
-- .start = gic_spi(33), /* PINT1 */
-+ .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
- .flags = IORESOURCE_IRQ,
- },
- };
-@@ -445,19 +445,6 @@ static void __init ag5evm_map_io(void)
- shmobile_setup_console();
- }
-
--#define PINTC_ADDR 0xe6900000
--#define PINTER0A (PINTC_ADDR + 0xa0)
--#define PINTCR0A (PINTC_ADDR + 0xb0)
--
--void __init ag5evm_init_irq(void)
--{
-- sh73a0_init_irq();
--
-- /* setup PINT: enable PINTA2 as active low */
-- __raw_writel(__raw_readl(PINTER0A) | (1<<29), PINTER0A);
-- __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
--}
--
- #define DSI0PHYCR 0xe615006c
-
- static void __init ag5evm_init(void)
-@@ -584,7 +571,7 @@ struct sys_timer ag5evm_timer = {
-
- MACHINE_START(AG5EVM, "ag5evm")
- .map_io = ag5evm_map_io,
-- .init_irq = ag5evm_init_irq,
-+ .init_irq = sh73a0_init_irq,
- .handle_irq = shmobile_handle_irq_gic,
- .init_machine = ag5evm_init,
- .timer = &ag5evm_timer,
-diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-index b385e97..18ae6a9 100644
---- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
-+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-@@ -507,4 +507,8 @@ enum {
- SHDMA_SLAVE_MMCIF_RX,
- };
-
-+/* PINT interrupts are located at Linux IRQ 768 and up */
-+#define SH73A0_PINT0_IRQ(irq) ((irq) + 768)
-+#define SH73A0_PINT1_IRQ(irq) ((irq) + 800)
-+
- #endif /* __ASM_SH73A0_H__ */
-diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
-index 836e815..1eda6b0 100644
---- a/arch/arm/mach-shmobile/intc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
-@@ -23,6 +23,7 @@
- #include <linux/io.h>
- #include <linux/sh_intc.h>
- #include <mach/intc.h>
-+#include <mach/sh73a0.h>
- #include <asm/hardware/gic.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
-@@ -363,6 +364,59 @@ static irqreturn_t sh73a0_irq_pin_demux(int irq, void *dev_id)
-
- static struct irqaction sh73a0_irq_pin_cascade[32];
-
-+#define PINTER0 0xe69000a0
-+#define PINTER1 0xe69000a4
-+#define PINTRR0 0xe69000d0
-+#define PINTRR1 0xe69000d4
-+
-+#define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq))
-+#define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8))
-+#define PINT0C_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 16))
-+#define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24))
-+#define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq))
-+
-+INTC_PINT(intc_pint0, PINTER0, 0xe69000b0, "sh73a0-pint0", \
-+ INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \
-+ INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \
-+ INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \
-+ INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \
-+ INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D));
-+
-+INTC_PINT(intc_pint1, PINTER1, 0xe69000c0, "sh73a0-pint1", \
-+ INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \
-+ INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \
-+ INTC_PINT_V_NONE, INTC_PINT_V_NONE, \
-+ INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E(E), \
-+ INTC_PINT_E(E), INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E_NONE);
-+
-+static struct irqaction sh73a0_pint0_cascade;
-+static struct irqaction sh73a0_pint1_cascade;
-+
-+static void pint_demux(unsigned long rr, unsigned long er, int base_irq)
-+{
-+ unsigned long value = ioread32(rr) & ioread32(er);
-+ int k;
-+
-+ for (k = 0; k < 32; k++) {
-+ if (value & (1 << (31 - k))) {
-+ generic_handle_irq(base_irq + k);
-+ iowrite32(~(1 << (31 - k)), rr);
-+ }
-+ }
-+}
-+
-+static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id)
-+{
-+ pint_demux(PINTRR0, PINTER0, SH73A0_PINT0_IRQ(0));
-+ return IRQ_HANDLED;
-+}
-+
-+static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id)
-+{
-+ pint_demux(PINTRR1, PINTER1, SH73A0_PINT1_IRQ(0));
-+ return IRQ_HANDLED;
-+}
-+
- void __init sh73a0_init_irq(void)
- {
- void __iomem *gic_dist_base = __io(0xf0001000);
-@@ -375,6 +429,8 @@ void __init sh73a0_init_irq(void)
-
- register_intc_controller(&intcs_desc);
- register_intc_controller(&intca_irq_pins_desc);
-+ register_intc_controller(&intc_pint0_desc);
-+ register_intc_controller(&intc_pint1_desc);
-
- /* demux using INTEVTSA */
- sh73a0_intcs_cascade.name = "INTCS cascade";
-@@ -393,4 +449,13 @@ void __init sh73a0_init_irq(void)
- handle_level_irq, "level");
- set_irq_flags(n, IRQF_VALID); /* yuck */
- }
-+
-+ /* PINT pins are sanely tied to the GIC as SPI */
-+ sh73a0_pint0_cascade.name = "PINT0 cascade";
-+ sh73a0_pint0_cascade.handler = sh73a0_pint0_demux;
-+ setup_irq(gic_spi(33), &sh73a0_pint0_cascade);
-+
-+ sh73a0_pint1_cascade.name = "PINT1 cascade";
-+ sh73a0_pint1_cascade.handler = sh73a0_pint1_demux;
-+ setup_irq(gic_spi(34), &sh73a0_pint1_cascade);
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0177-ARM-mach-shmobile-Kota2-TPU-LED-platform-data.patch b/patches.kzm9g/0177-ARM-mach-shmobile-Kota2-TPU-LED-platform-data.patch
deleted file mode 100644
index fa192b7c37d745..00000000000000
--- a/patches.kzm9g/0177-ARM-mach-shmobile-Kota2-TPU-LED-platform-data.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 9335e7d7f5827af9446ac83c09eef75942d2cc90 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 22 Nov 2011 15:44:58 +0900
-Subject: ARM: mach-shmobile: Kota2 TPU LED platform data
-
-This patch updates the Kota2 board support code to
-use the recently merged TPU LED driver whenever
-possible.
-
-The sh73a0 SoC has 5 TPU hardware blocks each with
-4 timer channels which in theory allows a total of
-20 LEDs to be controlled by "leds-renesas-tpu"
-driver instances. The Kota2 board has 4 LEDs connected
-to GPIO pins that also come with TPU pin functions, so
-this patch ties up these 4 LEDS and leaves the remaining
-3 LEDS for the GPIO based LED driver.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 33661c9e2062865acde9d421c971f1c142cf99ca)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kota2.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 44a923d..7df1f11 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -113,6 +113,12 @@ static struct clk main_clk = {
- .ops = &main_clk_ops,
- };
-
-+/* Divide Main clock by two */
-+static struct clk main_div2_clk = {
-+ .ops = &div2_clk_ops,
-+ .parent = &main_clk,
-+};
-+
- /* PLL0, PLL1, PLL2, PLL3 */
- static unsigned long pll_recalc(struct clk *clk)
- {
-@@ -181,6 +187,7 @@ static struct clk *main_clks[] = {
- &extal1_div2_clk,
- &extal2_div2_clk,
- &main_clk,
-+ &main_div2_clk,
- &pll0_clk,
- &pll1_clk,
- &pll2_clk,
-@@ -268,6 +275,7 @@ enum { MSTP001,
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
- MSTP331, MSTP329, MSTP325, MSTP323, MSTP318,
- MSTP314, MSTP313, MSTP312, MSTP311,
-+ MSTP303, MSTP302, MSTP301, MSTP300,
- MSTP411, MSTP410, MSTP403,
- MSTP_NR };
-
-@@ -301,6 +309,10 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */
- [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
- [MSTP311] = MSTP(&div6_clks[DIV6_SDHI2], SMSTPCR3, 11, 0), /* SDHI2 */
-+ [MSTP303] = MSTP(&main_div2_clk, SMSTPCR3, 3, 0), /* TPU1 */
-+ [MSTP302] = MSTP(&main_div2_clk, SMSTPCR3, 2, 0), /* TPU2 */
-+ [MSTP301] = MSTP(&main_div2_clk, SMSTPCR3, 1, 0), /* TPU3 */
-+ [MSTP300] = MSTP(&main_div2_clk, SMSTPCR3, 0, 0), /* TPU4 */
- [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */
- [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */
- [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
-@@ -350,6 +362,10 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
- CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
- CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
-+ CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */
-+ CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */
-+ CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */
-+ CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */
- CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
- CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
- CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0178-ARM-mach-shmobile-SH73A0-external-Ethernet-fix.patch b/patches.kzm9g/0178-ARM-mach-shmobile-SH73A0-external-Ethernet-fix.patch
deleted file mode 100644
index 1b5f95e33a0a48..00000000000000
--- a/patches.kzm9g/0178-ARM-mach-shmobile-SH73A0-external-Ethernet-fix.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 1eb5e4702a14dfefa6593c24c5bea8c6d3184407 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 22 Nov 2011 15:23:17 +0900
-Subject: ARM: mach-shmobile: SH73A0 external Ethernet fix
-
-Keep the ZB clock enabled on sh73a0 to allow the BSC
-to access external peripherals hooked up to CS signals.
-
-This is needed to unbreak Ethernet support on sh73a0 boards
-such as AG5EVM and Kota2 together with the following patch:
-
- 794d78f drivers: sh: late disabling of clocks V2
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 9bcc0a5d0de137b3a154dc951c5ff70dce815879)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 7df1f11..2985363 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -250,7 +250,7 @@ static struct clk div6_clks[DIV6_NR] = {
- [DIV6_VCK1] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR1, 0),
- [DIV6_VCK2] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR2, 0),
- [DIV6_VCK3] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR3, 0),
-- [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, 0),
-+ [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, CLK_ENABLE_ON_INIT),
- [DIV6_FLCTL] = SH_CLK_DIV6(&pll1_div2_clk, FLCKCR, 0),
- [DIV6_SDHI0] = SH_CLK_DIV6(&pll1_div2_clk, SD0CKCR, 0),
- [DIV6_SDHI1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0179-sh-clkfwk-clock-sh73a0-all-div6_clks-use-SH_CLK_DIV6.patch b/patches.kzm9g/0179-sh-clkfwk-clock-sh73a0-all-div6_clks-use-SH_CLK_DIV6.patch
deleted file mode 100644
index ac00157228b01d..00000000000000
--- a/patches.kzm9g/0179-sh-clkfwk-clock-sh73a0-all-div6_clks-use-SH_CLK_DIV6.patch
+++ /dev/null
@@ -1,233 +0,0 @@
-From bad42bcc41d498bed5fd01177b1073d32e551584 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 5 Dec 2011 22:29:15 -0800
-Subject: sh: clkfwk: clock-sh73a0: all div6_clks use SH_CLK_DIV6_EXT()
-
-Current div6 clocks can specify their current parent clocks
-from its register value if it is registered
-by sh_clk_div6_reparent_register().
-This patch modifies all div6 clocks into SH_CLK_DIV6_EXT().
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit d4775356bb39eaa305844cc6cc4c267236535956)
-
-Conflicts:
-
- arch/arm/mach-shmobile/clock-sh73a0.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 141 ++++++++++++++++++++++-----
- arch/arm/mach-shmobile/include/mach/common.h | 2 +
- 2 files changed, 120 insertions(+), 23 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 2985363..462a964 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -92,6 +92,24 @@ static struct clk_ops div2_clk_ops = {
- .recalc = div2_recalc,
- };
-
-+static unsigned long div7_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate / 7;
-+}
-+
-+static struct clk_ops div7_clk_ops = {
-+ .recalc = div7_recalc,
-+};
-+
-+static unsigned long div13_recalc(struct clk *clk)
-+{
-+ return clk->parent->rate / 13;
-+}
-+
-+static struct clk_ops div13_clk_ops = {
-+ .recalc = div13_recalc,
-+};
-+
- /* Divide extal1 by two */
- static struct clk extal1_div2_clk = {
- .ops = &div2_clk_ops,
-@@ -113,7 +131,6 @@ static struct clk main_clk = {
- .ops = &main_clk_ops,
- };
-
--/* Divide Main clock by two */
- static struct clk main_div2_clk = {
- .ops = &div2_clk_ops,
- .parent = &main_clk,
-@@ -174,12 +191,29 @@ static struct clk pll3_clk = {
- .enable_bit = 3,
- };
-
--/* Divide PLL1 by two */
-+/* Divide PLL */
- static struct clk pll1_div2_clk = {
- .ops = &div2_clk_ops,
- .parent = &pll1_clk,
- };
-
-+static struct clk pll1_div7_clk = {
-+ .ops = &div7_clk_ops,
-+ .parent = &pll1_clk,
-+};
-+
-+static struct clk pll1_div13_clk = {
-+ .ops = &div13_clk_ops,
-+ .parent = &pll1_clk,
-+};
-+
-+/* External input clock */
-+struct clk sh73a0_extcki_clk = {
-+};
-+
-+struct clk sh73a0_extalr_clk = {
-+};
-+
- static struct clk *main_clks[] = {
- &r_clk,
- &sh73a0_extal1_clk,
-@@ -193,6 +227,10 @@ static struct clk *main_clks[] = {
- &pll2_clk,
- &pll3_clk,
- &pll1_div2_clk,
-+ &pll1_div7_clk,
-+ &pll1_div13_clk,
-+ &sh73a0_extcki_clk,
-+ &sh73a0_extalr_clk,
- };
-
- static void div4_kick(struct clk *clk)
-@@ -246,27 +284,84 @@ enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1,
- DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P,
- DIV6_NR };
-
-+static struct clk *vck_parent[8] = {
-+ [0] = &pll1_div2_clk,
-+ [1] = &pll2_clk,
-+ [2] = &sh73a0_extcki_clk,
-+ [3] = &sh73a0_extal2_clk,
-+ [4] = &main_div2_clk,
-+ [5] = &sh73a0_extalr_clk,
-+ [6] = &main_clk,
-+};
-+
-+static struct clk *pll_parent[4] = {
-+ [0] = &pll1_div2_clk,
-+ [1] = &pll2_clk,
-+ [2] = &pll1_div13_clk,
-+};
-+
-+static struct clk *hsi_parent[4] = {
-+ [0] = &pll1_div2_clk,
-+ [1] = &pll2_clk,
-+ [2] = &pll1_div7_clk,
-+};
-+
-+static struct clk *pll_extal2_parent[] = {
-+ [0] = &pll1_div2_clk,
-+ [1] = &pll2_clk,
-+ [2] = &sh73a0_extal2_clk,
-+ [3] = &sh73a0_extal2_clk,
-+};
-+
-+static struct clk *dsi_parent[8] = {
-+ [0] = &pll1_div2_clk,
-+ [1] = &pll2_clk,
-+ [2] = &main_clk,
-+ [3] = &sh73a0_extal2_clk,
-+ [4] = &sh73a0_extcki_clk,
-+};
-+
- static struct clk div6_clks[DIV6_NR] = {
-- [DIV6_VCK1] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR1, 0),
-- [DIV6_VCK2] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR2, 0),
-- [DIV6_VCK3] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR3, 0),
-- [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, CLK_ENABLE_ON_INIT),
-- [DIV6_FLCTL] = SH_CLK_DIV6(&pll1_div2_clk, FLCKCR, 0),
-- [DIV6_SDHI0] = SH_CLK_DIV6(&pll1_div2_clk, SD0CKCR, 0),
-- [DIV6_SDHI1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
-- [DIV6_SDHI2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
-- [DIV6_FSIA] = SH_CLK_DIV6(&pll1_div2_clk, FSIACKCR, 0),
-- [DIV6_FSIB] = SH_CLK_DIV6(&pll1_div2_clk, FSIBCKCR, 0),
-- [DIV6_SUB] = SH_CLK_DIV6(&sh73a0_extal2_clk, SUBCKCR, 0),
-- [DIV6_SPUA] = SH_CLK_DIV6(&pll1_div2_clk, SPUACKCR, 0),
-- [DIV6_SPUV] = SH_CLK_DIV6(&pll1_div2_clk, SPUVCKCR, 0),
-- [DIV6_MSU] = SH_CLK_DIV6(&pll1_div2_clk, MSUCKCR, 0),
-- [DIV6_HSI] = SH_CLK_DIV6(&pll1_div2_clk, HSICKCR, 0),
-- [DIV6_MFG1] = SH_CLK_DIV6(&pll1_div2_clk, MFCK1CR, 0),
-- [DIV6_MFG2] = SH_CLK_DIV6(&pll1_div2_clk, MFCK2CR, 0),
-- [DIV6_DSIT] = SH_CLK_DIV6(&pll1_div2_clk, DSITCKCR, 0),
-- [DIV6_DSI0P] = SH_CLK_DIV6(&pll1_div2_clk, DSI0PCKCR, 0),
-- [DIV6_DSI1P] = SH_CLK_DIV6(&pll1_div2_clk, DSI1PCKCR, 0),
-+ [DIV6_VCK1] = SH_CLK_DIV6_EXT(VCLKCR1, 0,
-+ vck_parent, ARRAY_SIZE(vck_parent), 12, 3),
-+ [DIV6_VCK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0,
-+ vck_parent, ARRAY_SIZE(vck_parent), 12, 3),
-+ [DIV6_VCK3] = SH_CLK_DIV6_EXT(VCLKCR3, 0,
-+ vck_parent, ARRAY_SIZE(vck_parent), 12, 3),
-+ [DIV6_ZB1] = SH_CLK_DIV6_EXT(ZBCKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_FLCTL] = SH_CLK_DIV6_EXT(FLCKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_SDHI0] = SH_CLK_DIV6_EXT(SD0CKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 6, 2),
-+ [DIV6_SDHI1] = SH_CLK_DIV6_EXT(SD1CKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 6, 2),
-+ [DIV6_SDHI2] = SH_CLK_DIV6_EXT(SD2CKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 6, 2),
-+ [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 6, 1),
-+ [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 6, 1),
-+ [DIV6_SUB] = SH_CLK_DIV6_EXT(SUBCKCR, 0,
-+ pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2),
-+ [DIV6_SPUA] = SH_CLK_DIV6_EXT(SPUACKCR, 0,
-+ pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2),
-+ [DIV6_SPUV] = SH_CLK_DIV6_EXT(SPUVCKCR, 0,
-+ pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2),
-+ [DIV6_MSU] = SH_CLK_DIV6_EXT(MSUCKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_HSI] = SH_CLK_DIV6_EXT(HSICKCR, 0,
-+ hsi_parent, ARRAY_SIZE(hsi_parent), 6, 2),
-+ [DIV6_MFG1] = SH_CLK_DIV6_EXT(MFCK1CR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_MFG2] = SH_CLK_DIV6_EXT(MFCK2CR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_DSIT] = SH_CLK_DIV6_EXT(DSITCKCR, 0,
-+ pll_parent, ARRAY_SIZE(pll_parent), 7, 1),
-+ [DIV6_DSI0P] = SH_CLK_DIV6_EXT(DSI0PCKCR, 0,
-+ dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
-+ [DIV6_DSI1P] = SH_CLK_DIV6_EXT(DSI1PCKCR, 0,
-+ dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
- };
-
- enum { MSTP001,
-@@ -403,7 +498,7 @@ void __init sh73a0_clock_init(void)
- ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
-
- if (!ret)
-- ret = sh_clk_div6_register(div6_clks, DIV6_NR);
-+ ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR);
-
- if (!ret)
- ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index 2e21a77..6ccc1a5 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -48,6 +48,8 @@ extern void sh73a0_clock_init(void);
- extern void sh73a0_pinmux_init(void);
- extern struct clk sh73a0_extal1_clk;
- extern struct clk sh73a0_extal2_clk;
-+extern struct clk sh73a0_extcki_clk;
-+extern struct clk sh73a0_extalr_clk;
-
- extern unsigned int sh73a0_get_core_count(void);
- extern void sh73a0_secondary_init(unsigned int cpu);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0180-arm-mach-shmobile-add-a-resource-name-for-shdma.patch b/patches.kzm9g/0180-arm-mach-shmobile-add-a-resource-name-for-shdma.patch
deleted file mode 100644
index f4b2b450e5fbbb..00000000000000
--- a/patches.kzm9g/0180-arm-mach-shmobile-add-a-resource-name-for-shdma.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 40c376c78cee48972ac8e0486c07f5908c96bc32 Mon Sep 17 00:00:00 2001
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 10 Jan 2012 14:21:31 +0900
-Subject: arm: mach-shmobile: add a resource name for shdma
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 20052462948795914011f2fea0e77767d55cb48b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-sh7372.c | 6 +++---
- arch/arm/mach-shmobile/setup-sh73a0.c | 2 +-
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/arch/arm/mach-shmobile/setup-sh7372.c
-+++ b/arch/arm/mach-shmobile/setup-sh7372.c
-@@ -505,7 +505,7 @@ static struct resource sh7372_dmae0_reso
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error IRQ */
-+ .name = "error_irq",
- .start = evt2irq(0x20c0),
- .end = evt2irq(0x20c0),
- .flags = IORESOURCE_IRQ,
-@@ -533,7 +533,7 @@ static struct resource sh7372_dmae1_reso
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error IRQ */
-+ .name = "error_irq",
- .start = evt2irq(0x21c0),
- .end = evt2irq(0x21c0),
- .flags = IORESOURCE_IRQ,
-@@ -561,7 +561,7 @@ static struct resource sh7372_dmae2_reso
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error IRQ */
-+ .name = "error_irq",
- .start = evt2irq(0x22c0),
- .end = evt2irq(0x22c0),
- .flags = IORESOURCE_IRQ,
---- a/arch/arm/mach-shmobile/setup-sh73a0.c
-+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
-@@ -607,7 +607,7 @@ static struct resource sh73a0_dmae_resou
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error IRQ */
-+ .name = "error_irq",
- .start = gic_spi(129),
- .end = gic_spi(129),
- .flags = IORESOURCE_IRQ,
diff --git a/patches.kzm9g/0181-ARM-mach-shmobile-sh73a0-PINT-IRQ-base-fix.patch b/patches.kzm9g/0181-ARM-mach-shmobile-sh73a0-PINT-IRQ-base-fix.patch
deleted file mode 100644
index 664a4e23ed16ab..00000000000000
--- a/patches.kzm9g/0181-ARM-mach-shmobile-sh73a0-PINT-IRQ-base-fix.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 4e5dece84e3d3a529290121151c5acddcdf54c2f Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 17 Jan 2012 20:05:40 +0900
-Subject: ARM: mach-shmobile: sh73a0 PINT IRQ base fix
-
-Bump up the sh73a0 PINT IRQ base from 768 to 800 to avoid
-collision with INTCS vectors for IRQ16->IRQ32 at 0x3xxx.
-
-Without this fix the sh73a0 IRQ pin handling code collides
-with the PINT code which results in hangs on Kota2 during boot.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 0df1a838d678fc6ab49f983a19e905f6a42297a0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/sh73a0.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-index 18ae6a9..8567d65 100644
---- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
-+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-@@ -507,8 +507,8 @@ enum {
- SHDMA_SLAVE_MMCIF_RX,
- };
-
--/* PINT interrupts are located at Linux IRQ 768 and up */
--#define SH73A0_PINT0_IRQ(irq) ((irq) + 768)
--#define SH73A0_PINT1_IRQ(irq) ((irq) + 800)
-+/* PINT interrupts are located at Linux IRQ 800 and up */
-+#define SH73A0_PINT0_IRQ(irq) ((irq) + 800)
-+#define SH73A0_PINT1_IRQ(irq) ((irq) + 832)
-
- #endif /* __ASM_SH73A0_H__ */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0182-ARM-mach-shmobile-sh73a0-IRQ-sparse-alloc-fix.patch b/patches.kzm9g/0182-ARM-mach-shmobile-sh73a0-IRQ-sparse-alloc-fix.patch
deleted file mode 100644
index 7728a5fe6f71b7..00000000000000
--- a/patches.kzm9g/0182-ARM-mach-shmobile-sh73a0-IRQ-sparse-alloc-fix.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 10188333a01d34499c18ef18f31d7d44fcd1cd83 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 17 Jan 2012 20:10:49 +0900
-Subject: ARM: mach-shmobile: sh73a0 IRQ sparse alloc fix
-
-Fix the sh73a0 external IRQ pin code to properly support
-CONFIG_SPARSE_IRQ=y by allocating IRQ descriptors for the
-cascaded IRQs associated with external IRQ pins.
-
-Without this fix it is impossible to request IRQ0->IRQ31
-on the Kota2 board when sparse IRQs are enabled.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit e2c31b3fdd48274e9deb450e21279e54dfa02ccd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/intc-sh73a0.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
-index 1eda6b0..9857595 100644
---- a/arch/arm/mach-shmobile/intc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
-@@ -19,6 +19,7 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/interrupt.h>
-+#include <linux/module.h>
- #include <linux/irq.h>
- #include <linux/io.h>
- #include <linux/sh_intc.h>
-@@ -445,6 +446,7 @@ void __init sh73a0_init_irq(void)
- setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
-
- n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
-+ WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n);
- irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
- handle_level_irq, "level");
- set_irq_flags(n, IRQF_VALID); /* yuck */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0183-ARM-mach-shmobile-clock-sh73a0-add-DSIxPHY-clock-sup.patch b/patches.kzm9g/0183-ARM-mach-shmobile-clock-sh73a0-add-DSIxPHY-clock-sup.patch
deleted file mode 100644
index 6fa182efb75a9b..00000000000000
--- a/patches.kzm9g/0183-ARM-mach-shmobile-clock-sh73a0-add-DSIxPHY-clock-sup.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 90907d664dd2f682cef86afd0ebe8f638f20d01c Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Jan 2012 21:10:02 -0800
-Subject: ARM: mach-shmobile: clock-sh73a0: add DSIxPHY clock support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit f5948bac5f22e7697fc782e45bdca20a27368512)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ag5evm.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 113 ++++++++++++++++++++++++++++++++++
- 1 file changed, 113 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 462a964..4d8d140 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -364,6 +364,114 @@ static struct clk div6_clks[DIV6_NR] = {
- dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
- };
-
-+/* DSI DIV */
-+static unsigned long dsiphy_recalc(struct clk *clk)
-+{
-+ u32 value;
-+
-+ value = __raw_readl(clk->mapping->base);
-+
-+ /* FIXME */
-+ if (!(value & 0x000B8000))
-+ return clk->parent->rate;
-+
-+ value &= 0x3f;
-+ value += 1;
-+
-+ if ((value < 12) ||
-+ (value > 33)) {
-+ pr_err("DSIPHY has wrong value (%d)", value);
-+ return 0;
-+ }
-+
-+ return clk->parent->rate / value;
-+}
-+
-+static long dsiphy_round_rate(struct clk *clk, unsigned long rate)
-+{
-+ return clk_rate_mult_range_round(clk, 12, 33, rate);
-+}
-+
-+static void dsiphy_disable(struct clk *clk)
-+{
-+ u32 value;
-+
-+ value = __raw_readl(clk->mapping->base);
-+ value &= ~0x000B8000;
-+
-+ __raw_writel(value , clk->mapping->base);
-+}
-+
-+static int dsiphy_enable(struct clk *clk)
-+{
-+ u32 value;
-+ int multi;
-+
-+ value = __raw_readl(clk->mapping->base);
-+ multi = (value & 0x3f) + 1;
-+
-+ if ((multi < 12) || (multi > 33))
-+ return -EIO;
-+
-+ __raw_writel(value | 0x000B8000, clk->mapping->base);
-+
-+ return 0;
-+}
-+
-+static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
-+{
-+ u32 value;
-+ int idx;
-+
-+ idx = rate / clk->parent->rate;
-+ if ((idx < 12) || (idx > 33))
-+ return -EINVAL;
-+
-+ idx += -1;
-+
-+ value = __raw_readl(clk->mapping->base);
-+ value = (value & ~0x3f) + idx;
-+
-+ __raw_writel(value, clk->mapping->base);
-+
-+ return 0;
-+}
-+
-+static struct clk_ops dsiphy_clk_ops = {
-+ .recalc = dsiphy_recalc,
-+ .round_rate = dsiphy_round_rate,
-+ .set_rate = dsiphy_set_rate,
-+ .enable = dsiphy_enable,
-+ .disable = dsiphy_disable,
-+};
-+
-+static struct clk_mapping dsi0phy_clk_mapping = {
-+ .phys = DSI0PHYCR,
-+ .len = 4,
-+};
-+
-+static struct clk_mapping dsi1phy_clk_mapping = {
-+ .phys = DSI1PHYCR,
-+ .len = 4,
-+};
-+
-+static struct clk dsi0phy_clk = {
-+ .ops = &dsiphy_clk_ops,
-+ .parent = &div6_clks[DIV6_DSI0P], /* late install */
-+ .mapping = &dsi0phy_clk_mapping,
-+};
-+
-+static struct clk dsi1phy_clk = {
-+ .ops = &dsiphy_clk_ops,
-+ .parent = &div6_clks[DIV6_DSI1P], /* late install */
-+ .mapping = &dsi1phy_clk_mapping,
-+};
-+
-+static struct clk *late_main_clks[] = {
-+ &dsi0phy_clk,
-+ &dsi1phy_clk,
-+};
-+
- enum { MSTP001,
- MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
- MSTP219,
-@@ -428,6 +536,8 @@ static struct clk_lookup lookups[] = {
- CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
- CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
- CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
-+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
-+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
-
- /* MSTP32 clocks */
- CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
-@@ -503,6 +613,9 @@ void __init sh73a0_clock_init(void)
- if (!ret)
- ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
-
-+ for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
-+ ret = clk_register(late_main_clks[k]);
-+
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- if (!ret)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0184-ARM-shmobile-remove-NR_IRQS.patch b/patches.kzm9g/0184-ARM-shmobile-remove-NR_IRQS.patch
deleted file mode 100644
index 6d89d574930bd1..00000000000000
--- a/patches.kzm9g/0184-ARM-shmobile-remove-NR_IRQS.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From c62cfb4b929686d7bf2c9854d00677c2e9448648 Mon Sep 17 00:00:00 2001
-From: Rob Herring <rob.herring@calxeda.com>
-Date: Tue, 3 Jan 2012 16:57:33 -0600
-Subject: ARM: shmobile: remove NR_IRQS
-
-Remove NR_IRQS and explicitly include mach/irqs.h as needed. shmobile
-properly allocates irq_descs for each irqchip, so setting .nr_irqs for
-each machine is not needed.
-
-Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-(cherry picked from commit 250a27237e0e0694f8f8451594a0f03e0a4f5a73)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ag5evm.c
- arch/arm/mach-shmobile/board-bonito.c
- arch/arm/mach-shmobile/board-g3evm.c
- arch/arm/mach-shmobile/board-g4evm.c
- arch/arm/mach-shmobile/board-kota2.c
- arch/arm/mach-shmobile/board-mackerel.c
- arch/arm/mach-shmobile/board-marzen.c
- arch/arm/mach-shmobile/include/mach/irqs.h
- arch/arm/mach-shmobile/intc-r8a7740.c
- arch/arm/mach-shmobile/intc-sh7367.c
- arch/arm/mach-shmobile/intc-sh7372.c
- arch/arm/mach-shmobile/intc-sh7377.c
- arch/arm/mach-shmobile/setup-r8a7740.c
- arch/arm/mach-shmobile/setup-r8a7779.c
- arch/arm/mach-shmobile/setup-sh7367.c
- arch/arm/mach-shmobile/setup-sh7372.c
- arch/arm/mach-shmobile/setup-sh7377.c
- arch/arm/mach-shmobile/setup-sh73a0.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/setup-sh73a0.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
-index 20e71e5..7bf740e 100644
---- a/arch/arm/mach-shmobile/setup-sh73a0.c
-+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
-@@ -31,6 +31,7 @@
- #include <linux/sh_intc.h>
- #include <linux/sh_timer.h>
- #include <mach/hardware.h>
-+#include <mach/irqs.h>
- #include <mach/sh73a0.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0185-ARM-mach-shmobile-sh73a0-PSTR-32-bit-access-fix.patch b/patches.kzm9g/0185-ARM-mach-shmobile-sh73a0-PSTR-32-bit-access-fix.patch
deleted file mode 100644
index 9bd9e8bce9fedb..00000000000000
--- a/patches.kzm9g/0185-ARM-mach-shmobile-sh73a0-PSTR-32-bit-access-fix.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 0a9ecd90d97895db2561a1dbaa0d106b293c52e0 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Mon, 30 Jan 2012 11:03:49 +0900
-Subject: ARM: mach-shmobile: sh73a0 PSTR 32-bit access fix
-
-Convert the sh73a0 SMP code to use 32-bit PSTR access.
-
-This fixes wakeup from deep sleep for sh73a0 secondary CPUs.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 689189fb014203965ed89833d8d5566424540c9d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/smp-sh73a0.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
-index be1ade7..55d58c5 100644
---- a/arch/arm/mach-shmobile/smp-sh73a0.c
-+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
-@@ -79,7 +79,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
- /* enable cache coherency */
- modify_scu_cpu_psr(0, 3 << (cpu * 8));
-
-- if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
-+ if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
- __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */
- else
- __raw_writel(1 << cpu, __io(SRESCR)); /* reset */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0186-ARM-mach-shmobile-sh73a0-sh_clk_ops-rename.patch b/patches.kzm9g/0186-ARM-mach-shmobile-sh73a0-sh_clk_ops-rename.patch
deleted file mode 100644
index 85ca1f56af2f27..00000000000000
--- a/patches.kzm9g/0186-ARM-mach-shmobile-sh73a0-sh_clk_ops-rename.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From f60efe916f290bb106e6578b3653af1f253f2dc6 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 22:16:52 +0900
-Subject: ARM: mach-shmobile: sh73a0 sh_clk_ops rename
-
-Convert sh73a0 to use sh_clk_ops.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 7bcda508bfd9715c1a6a0589107c8c9d508f732e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 4d8d140..41f8293 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -88,7 +88,7 @@ static unsigned long div2_recalc(struct clk *clk)
- return clk->parent->rate / 2;
- }
-
--static struct clk_ops div2_clk_ops = {
-+static struct sh_clk_ops div2_clk_ops = {
- .recalc = div2_recalc,
- };
-
-@@ -97,7 +97,7 @@ static unsigned long div7_recalc(struct clk *clk)
- return clk->parent->rate / 7;
- }
-
--static struct clk_ops div7_clk_ops = {
-+static struct sh_clk_ops div7_clk_ops = {
- .recalc = div7_recalc,
- };
-
-@@ -106,7 +106,7 @@ static unsigned long div13_recalc(struct clk *clk)
- return clk->parent->rate / 13;
- }
-
--static struct clk_ops div13_clk_ops = {
-+static struct sh_clk_ops div13_clk_ops = {
- .recalc = div13_recalc,
- };
-
-@@ -122,7 +122,7 @@ static struct clk extal2_div2_clk = {
- .parent = &sh73a0_extal2_clk,
- };
-
--static struct clk_ops main_clk_ops = {
-+static struct sh_clk_ops main_clk_ops = {
- .recalc = followparent_recalc,
- };
-
-@@ -155,7 +155,7 @@ static unsigned long pll_recalc(struct clk *clk)
- return clk->parent->rate * mult;
- }
-
--static struct clk_ops pll_clk_ops = {
-+static struct sh_clk_ops pll_clk_ops = {
- .recalc = pll_recalc,
- };
-
-@@ -437,7 +437,7 @@ static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
- return 0;
- }
-
--static struct clk_ops dsiphy_clk_ops = {
-+static struct sh_clk_ops dsiphy_clk_ops = {
- .recalc = dsiphy_recalc,
- .round_rate = dsiphy_round_rate,
- .set_rate = dsiphy_set_rate,
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0187-ARM-mach-shmobile-sh73a0-map_io-and-init_early-updat.patch b/patches.kzm9g/0187-ARM-mach-shmobile-sh73a0-map_io-and-init_early-updat.patch
deleted file mode 100644
index 6f774b9048f285..00000000000000
--- a/patches.kzm9g/0187-ARM-mach-shmobile-sh73a0-map_io-and-init_early-updat.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From c46683358d9052c0bfb2388c2f046aeb20d3716b Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 29 Feb 2012 21:37:27 +0900
-Subject: ARM: mach-shmobile: sh73a0 map_io and init_early update
-
-Update the sh73a0 SoC and the AG5EVM and Kota2 boards to make use
-of the functions sh73a0_map_io() and sh73a0_add_early_devices().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 50e15c34f0072324fee9faaae71b129e8b419913)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-ag5evm.c
- arch/arm/mach-shmobile/board-kota2.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 24 +-----------------------
- arch/arm/mach-shmobile/include/mach/common.h | 1 +
- arch/arm/mach-shmobile/setup-sh73a0.c | 22 ++++++++++++++++++++++
- 3 files changed, 24 insertions(+), 23 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 430c723..7f50dab 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -46,7 +46,6 @@
- #include <mach/common.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
--#include <asm/mach/map.h>
- #include <asm/mach/time.h>
- #include <asm/hardware/gic.h>
- #include <asm/hardware/cache-l2x0.h>
-@@ -424,27 +423,6 @@ static struct platform_device *ag5evm_devices[] __initdata = {
- &sdhi1_device,
- };
-
--static struct map_desc ag5evm_io_desc[] __initdata = {
-- /* create a 1:1 entity map for 0xe6xxxxxx
-- * used by CPGA, INTC and PFC.
-- */
-- {
-- .virtual = 0xe6000000,
-- .pfn = __phys_to_pfn(0xe6000000),
-- .length = 256 << 20,
-- .type = MT_DEVICE_NONSHARED
-- },
--};
--
--static void __init ag5evm_map_io(void)
--{
-- iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
--
-- /* setup early devices and console here as well */
-- sh73a0_add_early_devices();
-- shmobile_setup_console();
--}
--
- #define DSI0PHYCR 0xe615006c
-
- static void __init ag5evm_init(void)
-@@ -570,7 +548,7 @@ struct sys_timer ag5evm_timer = {
- };
-
- MACHINE_START(AG5EVM, "ag5evm")
-- .map_io = ag5evm_map_io,
-+ .map_io = sh73a0_map_io,
- .init_irq = sh73a0_init_irq,
- .handle_irq = shmobile_handle_irq_gic,
- .init_machine = ag5evm_init,
-diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
-index 6ccc1a5..c77b3a1 100644
---- a/arch/arm/mach-shmobile/include/mach/common.h
-+++ b/arch/arm/mach-shmobile/include/mach/common.h
-@@ -42,6 +42,7 @@ extern struct clk sh7372_extal1_clk;
- extern struct clk sh7372_extal2_clk;
-
- extern void sh73a0_init_irq(void);
-+extern void sh73a0_map_io(void);
- extern void sh73a0_add_early_devices(void);
- extern void sh73a0_add_standard_devices(void);
- extern void sh73a0_clock_init(void);
-diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
-index 7bf740e..ce9d5c8 100644
---- a/arch/arm/mach-shmobile/setup-sh73a0.c
-+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
-@@ -33,9 +33,28 @@
- #include <mach/hardware.h>
- #include <mach/irqs.h>
- #include <mach/sh73a0.h>
-+#include <mach/common.h>
- #include <asm/mach-types.h>
-+#include <asm/mach/map.h>
- #include <asm/mach/arch.h>
-
-+static struct map_desc sh73a0_io_desc[] __initdata = {
-+ /* create a 1:1 entity map for 0xe6xxxxxx
-+ * used by CPGA, INTC and PFC.
-+ */
-+ {
-+ .virtual = 0xe6000000,
-+ .pfn = __phys_to_pfn(0xe6000000),
-+ .length = 256 << 20,
-+ .type = MT_DEVICE_NONSHARED
-+ },
-+};
-+
-+void __init sh73a0_map_io(void)
-+{
-+ iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
-+}
-+
- static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe6c40000,
- .flags = UPF_BOOT_AUTOCONF,
-@@ -672,4 +691,7 @@ void __init sh73a0_add_early_devices(void)
- {
- early_platform_add_devices(sh73a0_early_devices,
- ARRAY_SIZE(sh73a0_early_devices));
-+
-+ /* setup early console here as well */
-+ shmobile_setup_console();
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0188-ARM-mach-shmobile-sh73a0-AG5EVM-and-Kota2-timer-rewo.patch b/patches.kzm9g/0188-ARM-mach-shmobile-sh73a0-AG5EVM-and-Kota2-timer-rewo.patch
deleted file mode 100644
index eddd543811fe87..00000000000000
--- a/patches.kzm9g/0188-ARM-mach-shmobile-sh73a0-AG5EVM-and-Kota2-timer-rewo.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From c646dee2f2e54015d3930520d89364374e2b86ec Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Tue, 6 Mar 2012 17:36:45 +0900
-Subject: ARM: mach-shmobile: sh73a0, AG5EVM and Kota2 timer rework
-
-Move the SoC specific timer code from AG5EVM and Kota2
-to sh73a0 setup code. This makes is possible to share
-the SoC specific timer code across boards and it also
-removes the need for a board specific timer structure.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 3be26fdba82a2ae8ed568ab5d4a0a2e252f18b13)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kota2.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 14 +-------------
- arch/arm/mach-shmobile/setup-sh73a0.c | 10 ++++++++++
- 2 files changed, 11 insertions(+), 13 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 7f50dab..5c2fa46 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -46,7 +46,6 @@
- #include <mach/common.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
--#include <asm/mach/time.h>
- #include <asm/hardware/gic.h>
- #include <asm/hardware/cache-l2x0.h>
- #include <asm/traps.h>
-@@ -536,21 +535,10 @@ static void __init ag5evm_init(void)
- platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
- }
-
--static void __init ag5evm_timer_init(void)
--{
-- sh73a0_clock_init();
-- shmobile_timer.init();
-- return;
--}
--
--struct sys_timer ag5evm_timer = {
-- .init = ag5evm_timer_init,
--};
--
- MACHINE_START(AG5EVM, "ag5evm")
- .map_io = sh73a0_map_io,
- .init_irq = sh73a0_init_irq,
- .handle_irq = shmobile_handle_irq_gic,
- .init_machine = ag5evm_init,
-- .timer = &ag5evm_timer,
-+ .timer = &shmobile_timer,
- MACHINE_END
-diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
-index ce9d5c8..5bebffc 100644
---- a/arch/arm/mach-shmobile/setup-sh73a0.c
-+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
-@@ -37,6 +37,7 @@
- #include <asm/mach-types.h>
- #include <asm/mach/map.h>
- #include <asm/mach/arch.h>
-+#include <asm/mach/time.h>
-
- static struct map_desc sh73a0_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
-@@ -687,6 +688,12 @@ void __init sh73a0_add_standard_devices(void)
- ARRAY_SIZE(sh73a0_late_devices));
- }
-
-+static void __init sh73a0_earlytimer_init(void)
-+{
-+ sh73a0_clock_init();
-+ shmobile_earlytimer_init();
-+}
-+
- void __init sh73a0_add_early_devices(void)
- {
- early_platform_add_devices(sh73a0_early_devices,
-@@ -694,4 +701,7 @@ void __init sh73a0_add_early_devices(void)
-
- /* setup early console here as well */
- shmobile_setup_console();
-+
-+ /* override timer setup with soc-specific code */
-+ shmobile_timer.init = sh73a0_earlytimer_init;
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0189-ARM-mach-shmobile-sh73a0-add-MMC-data-pin-pull-up.patch b/patches.kzm9g/0189-ARM-mach-shmobile-sh73a0-add-MMC-data-pin-pull-up.patch
deleted file mode 100644
index 3b19b6c94a84c8..00000000000000
--- a/patches.kzm9g/0189-ARM-mach-shmobile-sh73a0-add-MMC-data-pin-pull-up.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 9cdeaf23e42138066404492c82f3c7b1f0d1de64 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 Nov 2011 18:44:24 -0800
-Subject: ARM: mach-shmobile: sh73a0: add MMC data pin pull-up
-
-This patch adds MMC data pin pull-up option for pfc-sh73a0.c,
-and select it on ag5evm board.
-The MMC read/write will be error without this patch.
-
-Cc: Takashi YOSHII <takashi.yoshii.zj@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 052008edf31383f866b2ec1b12604fc411c2d986)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-ag5evm.c | 16 ++++++-------
- arch/arm/mach-shmobile/include/mach/sh73a0.h | 8 +++++++
- arch/arm/mach-shmobile/pfc-sh73a0.c | 34 ++++++++++++++++++++++++++++
- 3 files changed, 50 insertions(+), 8 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
-index 5c2fa46..6574235 100644
---- a/arch/arm/mach-shmobile/board-ag5evm.c
-+++ b/arch/arm/mach-shmobile/board-ag5evm.c
-@@ -463,14 +463,14 @@ static void __init ag5evm_init(void)
- /* enable MMCIF */
- gpio_request(GPIO_FN_MMCCLK0, NULL);
- gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
-- gpio_request(GPIO_FN_MMCD0_0, NULL);
-- gpio_request(GPIO_FN_MMCD0_1, NULL);
-- gpio_request(GPIO_FN_MMCD0_2, NULL);
-- gpio_request(GPIO_FN_MMCD0_3, NULL);
-- gpio_request(GPIO_FN_MMCD0_4, NULL);
-- gpio_request(GPIO_FN_MMCD0_5, NULL);
-- gpio_request(GPIO_FN_MMCD0_6, NULL);
-- gpio_request(GPIO_FN_MMCD0_7, NULL);
-+ gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
- gpio_request(GPIO_PORT208, NULL); /* Reset */
- gpio_direction_output(GPIO_PORT208, 1);
-
-diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-index 8567d65..cad5757 100644
---- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
-+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-@@ -470,6 +470,14 @@ enum {
- GPIO_FN_SDHICMD2_PU,
- GPIO_FN_MMCCMD0_PU,
- GPIO_FN_MMCCMD1_PU,
-+ GPIO_FN_MMCD0_0_PU,
-+ GPIO_FN_MMCD0_1_PU,
-+ GPIO_FN_MMCD0_2_PU,
-+ GPIO_FN_MMCD0_3_PU,
-+ GPIO_FN_MMCD0_4_PU,
-+ GPIO_FN_MMCD0_5_PU,
-+ GPIO_FN_MMCD0_6_PU,
-+ GPIO_FN_MMCD0_7_PU,
- GPIO_FN_FSIACK_PU,
- GPIO_FN_FSIAILR_PU,
- GPIO_FN_FSIAIBT_PU,
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index cf7c7bb..e05634c 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -496,6 +496,14 @@ enum {
- SDHICMD2_PU_MARK,
- MMCCMD0_PU_MARK,
- MMCCMD1_PU_MARK,
-+ MMCD0_0_PU_MARK,
-+ MMCD0_1_PU_MARK,
-+ MMCD0_2_PU_MARK,
-+ MMCD0_3_PU_MARK,
-+ MMCD0_4_PU_MARK,
-+ MMCD0_5_PU_MARK,
-+ MMCD0_6_PU_MARK,
-+ MMCD0_7_PU_MARK,
- FSIBISLD_PU_MARK,
- FSIACK_PU_MARK,
- FSIAILR_PU_MARK,
-@@ -1510,6 +1518,24 @@ static pinmux_enum_t pinmux_data[] = {
- MSEL4CR_MSEL15_0),
- PINMUX_DATA(MMCCMD1_PU_MARK, PORT297_FN2, PORT297_IN_PU,
- MSEL4CR_MSEL15_1),
-+
-+ PINMUX_DATA(MMCD0_0_PU_MARK,
-+ PORT271_FN1, PORT271_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_1_PU_MARK,
-+ PORT272_FN1, PORT272_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_2_PU_MARK,
-+ PORT273_FN1, PORT273_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_3_PU_MARK,
-+ PORT274_FN1, PORT274_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_4_PU_MARK,
-+ PORT275_FN1, PORT275_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_5_PU_MARK,
-+ PORT276_FN1, PORT276_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_6_PU_MARK,
-+ PORT277_FN1, PORT277_IN_PU, MSEL4CR_MSEL15_0),
-+ PINMUX_DATA(MMCD0_7_PU_MARK,
-+ PORT278_FN1, PORT278_IN_PU, MSEL4CR_MSEL15_0),
-+
- PINMUX_DATA(FSIBISLD_PU_MARK, PORT39_FN1, PORT39_IN_PU),
- PINMUX_DATA(FSIACK_PU_MARK, PORT49_FN1, PORT49_IN_PU),
- PINMUX_DATA(FSIAILR_PU_MARK, PORT50_FN5, PORT50_IN_PU),
-@@ -2181,6 +2207,14 @@ static struct pinmux_gpio pinmux_gpios[] = {
- GPIO_FN(SDHICMD2_PU),
- GPIO_FN(MMCCMD0_PU),
- GPIO_FN(MMCCMD1_PU),
-+ GPIO_FN(MMCD0_0_PU),
-+ GPIO_FN(MMCD0_1_PU),
-+ GPIO_FN(MMCD0_2_PU),
-+ GPIO_FN(MMCD0_3_PU),
-+ GPIO_FN(MMCD0_4_PU),
-+ GPIO_FN(MMCD0_5_PU),
-+ GPIO_FN(MMCD0_6_PU),
-+ GPIO_FN(MMCD0_7_PU),
- GPIO_FN(FSIACK_PU),
- GPIO_FN(FSIAILR_PU),
- GPIO_FN(FSIAIBT_PU),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0190-ARM-Update-mach-types.patch b/patches.kzm9g/0190-ARM-Update-mach-types.patch
deleted file mode 100644
index ddd8004441b3bb..00000000000000
--- a/patches.kzm9g/0190-ARM-Update-mach-types.patch
+++ /dev/null
@@ -1,640 +0,0 @@
-From cfb81e862a2f3eca3aa5225ed4a103da16ae27c4 Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@arm.linux.org.uk>
-Date: Thu, 26 Apr 2012 08:44:25 +0100
-Subject: ARM: Update mach-types
-
-Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit d098bc7d58ebda22a6554b6c9df1056802d9900f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/tools/mach-types | 505 +++++++++++++++++++++++++---------------------
- 1 file changed, 271 insertions(+), 234 deletions(-)
-
-diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
-index f9c9f33..2997e56 100644
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -16,7 +16,7 @@
- # are merged into mainline or have been edited in the machine database
- # within the last 12 months. References to machine_is_NAME() do not count!
- #
--# Last update: Tue Dec 6 11:07:38 2011
-+# Last update: Thu Apr 26 08:44:23 2012
- #
- # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
- #
-@@ -205,6 +205,7 @@ omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970
- snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986
- omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993
- smdk2412 MACH_SMDK2412 SMDK2412 1009
-+bkde303 MACH_BKDE303 BKDE303 1021
- smdk2413 MACH_SMDK2413 SMDK2413 1022
- aml_m5900 MACH_AML_M5900 AML_M5900 1024
- balloon3 MACH_BALLOON3 BALLOON3 1029
-@@ -381,8 +382,6 @@ davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157
- at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159
- omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160
- magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162
--btmavb101 MACH_BTMAVB101 BTMAVB101 2172
--btmawb101 MACH_BTMAWB101 BTMAWB101 2173
- tx25 MACH_TX25 TX25 2177
- omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178
- anw6410 MACH_ANW6410 ANW6410 2183
-@@ -397,7 +396,6 @@ net2big_v2 MACH_NET2BIG_V2 NET2BIG_V2 2204
- net5big_v2 MACH_NET5BIG_V2 NET5BIG_V2 2206
- inetspace_v2 MACH_INETSPACE_V2 INETSPACE_V2 2208
- at91sam9g45ekes MACH_AT91SAM9G45EKES AT91SAM9G45EKES 2212
--pc7302 MACH_PC7302 PC7302 2220
- spear600 MACH_SPEAR600 SPEAR600 2236
- spear300 MACH_SPEAR300 SPEAR300 2237
- lilly1131 MACH_LILLY1131 LILLY1131 2239
-@@ -407,7 +405,6 @@ d2net MACH_D2NET D2NET 2282
- bigdisk MACH_BIGDISK BIGDISK 2283
- at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288
- bcmring MACH_BCMRING BCMRING 2289
--dp6xx MACH_DP6XX DP6XX 2302
- mahimahi MACH_MAHIMAHI MAHIMAHI 2304
- smdk6442 MACH_SMDK6442 SMDK6442 2324
- openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325
-@@ -444,8 +441,6 @@ mx28evk MACH_MX28EVK MX28EVK 2531
- smartq5 MACH_SMARTQ5 SMARTQ5 2534
- davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
- mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
--riot_bei2 MACH_RIOT_BEI2 RIOT_BEI2 2576
--riot_x37 MACH_RIOT_X37 RIOT_X37 2578
- pca101 MACH_PCA101 PCA101 2595
- capc7117 MACH_CAPC7117 CAPC7117 2612
- icontrol MACH_ICONTROL ICONTROL 2624
-@@ -460,7 +455,6 @@ spear320 MACH_SPEAR320 SPEAR320 2661
- aquila MACH_AQUILA AQUILA 2676
- esata_sheevaplug MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
- msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679
--ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683
- terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697
- msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703
- msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704
-@@ -479,8 +473,6 @@ wbd222 MACH_WBD222 WBD222 2753
- msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755
- msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756
- tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758
--nanos MACH_NANOS NANOS 2759
--stamp9g45 MACH_STAMP9G45 STAMP9G45 2761
- cns3420vb MACH_CNS3420VB CNS3420VB 2776
- omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791
- ti8168evm MACH_TI8168EVM TI8168EVM 2800
-@@ -490,12 +482,9 @@ eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821
- eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
- eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
- smdkc210 MACH_SMDKC210 SMDKC210 2838
--pca102 MACH_PCA102 PCA102 2843
-+pcaal1 MACH_PCAAL1 PCAAL1 2843
- t5325 MACH_T5325 T5325 2846
- income MACH_INCOME INCOME 2849
--vvbox_sdorig2 MACH_VVBOX_SDORIG2 VVBOX_SDORIG2 2857
--vvbox_sdlite2 MACH_VVBOX_SDLITE2 VVBOX_SDLITE2 2858
--vvbox_sdpro4 MACH_VVBOX_SDPRO4 VVBOX_SDPRO4 2859
- mx257sx MACH_MX257SX MX257SX 2861
- goni MACH_GONI GONI 2862
- bv07 MACH_BV07 BV07 2882
-@@ -504,6 +493,7 @@ devixp MACH_DEVIXP DEVIXP 2885
- miccpt MACH_MICCPT MICCPT 2886
- mic256 MACH_MIC256 MIC256 2887
- u5500 MACH_U5500 U5500 2890
-+pov15hd MACH_POV15HD POV15HD 2910
- linkstation_lschl MACH_LINKSTATION_LSCHL LINKSTATION_LSCHL 2913
- smdkv310 MACH_SMDKV310 SMDKV310 2925
- wm8505_7in_netbook MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK 2928
-@@ -537,243 +527,24 @@ trimslice MACH_TRIMSLICE TRIMSLICE 3209
- mackerel MACH_MACKEREL MACKEREL 3211
- kaen MACH_KAEN KAEN 3217
- nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220
--dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226
--quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227
--abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228
--svcid MACH_SVCID SVCID 3229
- msm8960_sim MACH_MSM8960_SIM MSM8960_SIM 3230
- msm8960_rumi3 MACH_MSM8960_RUMI3 MSM8960_RUMI3 3231
--icon_g MACH_ICON_G ICON_G 3232
--mb3 MACH_MB3 MB3 3233
- gsia18s MACH_GSIA18S GSIA18S 3234
--pivicc MACH_PIVICC PIVICC 3235
--pcm048 MACH_PCM048 PCM048 3236
--dds MACH_DDS DDS 3237
--chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238
--ts48xx MACH_TS48XX TS48XX 3239
--tonga2_tfttimer MACH_TONGA2_TFTTIMER TONGA2_TFTTIMER 3240
--whistler MACH_WHISTLER WHISTLER 3241
--asl_phoenix MACH_ASL_PHOENIX ASL_PHOENIX 3242
--at91sam9263otlite MACH_AT91SAM9263OTLITE AT91SAM9263OTLITE 3243
--ddplug MACH_DDPLUG DDPLUG 3244
--d2plug MACH_D2PLUG D2PLUG 3245
--kzm9d MACH_KZM9D KZM9D 3246
--verdi_lte MACH_VERDI_LTE VERDI_LTE 3247
--nanozoom MACH_NANOZOOM NANOZOOM 3248
--dm3730_som_lv MACH_DM3730_SOM_LV DM3730_SOM_LV 3249
--dm3730_torpedo MACH_DM3730_TORPEDO DM3730_TORPEDO 3250
--anchovy MACH_ANCHOVY ANCHOVY 3251
--re2rev20 MACH_RE2REV20 RE2REV20 3253
--re2rev21 MACH_RE2REV21 RE2REV21 3254
--cns21xx MACH_CNS21XX CNS21XX 3255
--rider MACH_RIDER RIDER 3257
--nsk330 MACH_NSK330 NSK330 3258
--cns2133evb MACH_CNS2133EVB CNS2133EVB 3259
--z3_816x_mod MACH_Z3_816X_MOD Z3_816X_MOD 3260
--z3_814x_mod MACH_Z3_814X_MOD Z3_814X_MOD 3261
--beect MACH_BEECT BEECT 3262
--dma_thunderbug MACH_DMA_THUNDERBUG DMA_THUNDERBUG 3263
--omn_at91sam9g20 MACH_OMN_AT91SAM9G20 OMN_AT91SAM9G20 3264
--mx25_e2s_uc MACH_MX25_E2S_UC MX25_E2S_UC 3265
--mione MACH_MIONE MIONE 3266
--top9000_tcu MACH_TOP9000_TCU TOP9000_TCU 3267
--top9000_bsl MACH_TOP9000_BSL TOP9000_BSL 3268
--kingdom MACH_KINGDOM KINGDOM 3269
--armadillo460 MACH_ARMADILLO460 ARMADILLO460 3270
--lq2 MACH_LQ2 LQ2 3271
--sweda_tms2 MACH_SWEDA_TMS2 SWEDA_TMS2 3272
- mx53_loco MACH_MX53_LOCO MX53_LOCO 3273
--acer_a8 MACH_ACER_A8 ACER_A8 3275
--acer_gauguin MACH_ACER_GAUGUIN ACER_GAUGUIN 3276
--guppy MACH_GUPPY GUPPY 3277
--mx61_ard MACH_MX61_ARD MX61_ARD 3278
- tx53 MACH_TX53 TX53 3279
--omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280
--uemd MACH_UEMD UEMD 3281
--ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282
--rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283
- encore MACH_ENCORE ENCORE 3284
--hkdkc100 MACH_HKDKC100 HKDKC100 3285
--ts42xx MACH_TS42XX TS42XX 3286
--aebl MACH_AEBL AEBL 3287
- wario MACH_WARIO WARIO 3288
--gfs_spm MACH_GFS_SPM GFS_SPM 3289
- cm_t3730 MACH_CM_T3730 CM_T3730 3290
--isc3 MACH_ISC3 ISC3 3291
--rascal MACH_RASCAL RASCAL 3292
- hrefv60 MACH_HREFV60 HREFV60 3293
--tpt_2_0 MACH_TPT_2_0 TPT_2_0 3294
--splendor MACH_SPLENDOR SPLENDOR 3296
--msm8x60_qt MACH_MSM8X60_QT MSM8X60_QT 3298
--htc_hd_mini MACH_HTC_HD_MINI HTC_HD_MINI 3299
--athene MACH_ATHENE ATHENE 3300
--deep_r_ek_1 MACH_DEEP_R_EK_1 DEEP_R_EK_1 3301
--vivow_ct MACH_VIVOW_CT VIVOW_CT 3302
--nery_1000 MACH_NERY_1000 NERY_1000 3303
--rfl109145_ssrv MACH_RFL109145_SSRV RFL109145_SSRV 3304
--nmh MACH_NMH NMH 3305
--wn802t MACH_WN802T WN802T 3306
--dragonet MACH_DRAGONET DRAGONET 3307
--at91sam9263desk16l MACH_AT91SAM9263DESK16L AT91SAM9263DESK16L 3309
--bcmhana_sv MACH_BCMHANA_SV BCMHANA_SV 3310
--bcmhana_tablet MACH_BCMHANA_TABLET BCMHANA_TABLET 3311
--koi MACH_KOI KOI 3312
--ts4800 MACH_TS4800 TS4800 3313
--tqma9263 MACH_TQMA9263 TQMA9263 3314
--holiday MACH_HOLIDAY HOLIDAY 3315
--pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317
--hwgw6410 MACH_HWGW6410 HWGW6410 3318
--shenzhou MACH_SHENZHOU SHENZHOU 3319
--cwme9210 MACH_CWME9210 CWME9210 3320
--cwme9210js MACH_CWME9210JS CWME9210JS 3321
--colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323
--w21 MACH_W21 W21 3324
--polysat1 MACH_POLYSAT1 POLYSAT1 3325
--dataway MACH_DATAWAY DATAWAY 3326
--cobral138 MACH_COBRAL138 COBRAL138 3327
--roverpcs8 MACH_ROVERPCS8 ROVERPCS8 3328
--marvelc MACH_MARVELC MARVELC 3329
--navefihid MACH_NAVEFIHID NAVEFIHID 3330
--dm365_cv100 MACH_DM365_CV100 DM365_CV100 3331
--able MACH_ABLE ABLE 3332
--legacy MACH_LEGACY LEGACY 3333
--icong MACH_ICONG ICONG 3334
--rover_g8 MACH_ROVER_G8 ROVER_G8 3335
--t5388p MACH_T5388P T5388P 3336
--dingo MACH_DINGO DINGO 3337
--goflexhome MACH_GOFLEXHOME GOFLEXHOME 3338
--lanreadyfn511 MACH_LANREADYFN511 LANREADYFN511 3340
--omap3_baia MACH_OMAP3_BAIA OMAP3_BAIA 3341
--omap3smartdisplay MACH_OMAP3SMARTDISPLAY OMAP3SMARTDISPLAY 3342
--xilinx MACH_XILINX XILINX 3343
--a2f MACH_A2F A2F 3344
--sky25 MACH_SKY25 SKY25 3345
--ccmx53 MACH_CCMX53 CCMX53 3346
--ccmx53js MACH_CCMX53JS CCMX53JS 3347
--ccwmx53 MACH_CCWMX53 CCWMX53 3348
--ccwmx53js MACH_CCWMX53JS CCWMX53JS 3349
--frisms MACH_FRISMS FRISMS 3350
--msm7x27a_ffa MACH_MSM7X27A_FFA MSM7X27A_FFA 3351
--msm7x27a_surf MACH_MSM7X27A_SURF MSM7X27A_SURF 3352
--msm7x27a_rumi3 MACH_MSM7X27A_RUMI3 MSM7X27A_RUMI3 3353
--dimmsam9g20 MACH_DIMMSAM9G20 DIMMSAM9G20 3354
--dimm_imx28 MACH_DIMM_IMX28 DIMM_IMX28 3355
--amk_a4 MACH_AMK_A4 AMK_A4 3356
--gnet_sgme MACH_GNET_SGME GNET_SGME 3357
--shooter_u MACH_SHOOTER_U SHOOTER_U 3358
--vmx53 MACH_VMX53 VMX53 3359
--rhino MACH_RHINO RHINO 3360
- armlex4210 MACH_ARMLEX4210 ARMLEX4210 3361
--swarcoextmodem MACH_SWARCOEXTMODEM SWARCOEXTMODEM 3362
- snowball MACH_SNOWBALL SNOWBALL 3363
--pcm049 MACH_PCM049 PCM049 3364
--vigor MACH_VIGOR VIGOR 3365
--oslo_amundsen MACH_OSLO_AMUNDSEN OSLO_AMUNDSEN 3366
--gsl_diamond MACH_GSL_DIAMOND GSL_DIAMOND 3367
--cv2201 MACH_CV2201 CV2201 3368
--cv2202 MACH_CV2202 CV2202 3369
--cv2203 MACH_CV2203 CV2203 3370
--vit_ibox MACH_VIT_IBOX VIT_IBOX 3371
--dm6441_esp MACH_DM6441_ESP DM6441_ESP 3372
--at91sam9x5ek MACH_AT91SAM9X5EK AT91SAM9X5EK 3373
--libra MACH_LIBRA LIBRA 3374
--easycrrh MACH_EASYCRRH EASYCRRH 3375
--tripel MACH_TRIPEL TRIPEL 3376
--endian_mini MACH_ENDIAN_MINI ENDIAN_MINI 3377
- xilinx_ep107 MACH_XILINX_EP107 XILINX_EP107 3378
- nuri MACH_NURI NURI 3379
--janus MACH_JANUS JANUS 3380
--ddnas MACH_DDNAS DDNAS 3381
--tag MACH_TAG TAG 3382
--tagw MACH_TAGW TAGW 3383
--nitrogen_vm_imx51 MACH_NITROGEN_VM_IMX51 NITROGEN_VM_IMX51 3384
--viprinet MACH_VIPRINET VIPRINET 3385
--bockw MACH_BOCKW BOCKW 3386
--eva2000 MACH_EVA2000 EVA2000 3387
--steelyard MACH_STEELYARD STEELYARD 3388
--nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392
--geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393
--spear1340 MACH_SPEAR1340 SPEAR1340 3394
--rexmas MACH_REXMAS REXMAS 3395
--msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396
--msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398
--msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399
--helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400
--mif10p MACH_MIF10P MIF10P 3401
--iam28 MACH_IAM28 IAM28 3402
--picasso MACH_PICASSO PICASSO 3403
--mr301a MACH_MR301A MR301A 3404
--notle MACH_NOTLE NOTLE 3405
--eelx2 MACH_EELX2 EELX2 3406
--moon MACH_MOON MOON 3407
--ruby MACH_RUBY RUBY 3408
--goldengate MACH_GOLDENGATE GOLDENGATE 3409
--ctbu_gen2 MACH_CTBU_GEN2 CTBU_GEN2 3410
--kmp_am17_01 MACH_KMP_AM17_01 KMP_AM17_01 3411
- wtplug MACH_WTPLUG WTPLUG 3412
--mx27su2 MACH_MX27SU2 MX27SU2 3413
--nb31 MACH_NB31 NB31 3414
--hjsdu MACH_HJSDU HJSDU 3415
--td3_rev1 MACH_TD3_REV1 TD3_REV1 3416
--eag_ci4000 MACH_EAG_CI4000 EAG_CI4000 3417
--net5big_nand_v2 MACH_NET5BIG_NAND_V2 NET5BIG_NAND_V2 3418
--cpx2 MACH_CPX2 CPX2 3419
--net2big_nand_v2 MACH_NET2BIG_NAND_V2 NET2BIG_NAND_V2 3420
--ecuv5 MACH_ECUV5 ECUV5 3421
--hsgx6d MACH_HSGX6D HSGX6D 3422
--dawad7 MACH_DAWAD7 DAWAD7 3423
--sam9repeater MACH_SAM9REPEATER SAM9REPEATER 3424
--gt_i5700 MACH_GT_I5700 GT_I5700 3425
--ctera_plug_c2 MACH_CTERA_PLUG_C2 CTERA_PLUG_C2 3426
--marvelct MACH_MARVELCT MARVELCT 3427
--ag11005 MACH_AG11005 AG11005 3428
--vangogh MACH_VANGOGH VANGOGH 3430
--matrix505 MACH_MATRIX505 MATRIX505 3431
--oce_nigma MACH_OCE_NIGMA OCE_NIGMA 3432
--t55 MACH_T55 T55 3433
--bio3k MACH_BIO3K BIO3K 3434
--expressct MACH_EXPRESSCT EXPRESSCT 3435
--cardhu MACH_CARDHU CARDHU 3436
--aruba MACH_ARUBA ARUBA 3437
--bonaire MACH_BONAIRE BONAIRE 3438
--nuc700evb MACH_NUC700EVB NUC700EVB 3439
--nuc710evb MACH_NUC710EVB NUC710EVB 3440
--nuc740evb MACH_NUC740EVB NUC740EVB 3441
--nuc745evb MACH_NUC745EVB NUC745EVB 3442
--transcede MACH_TRANSCEDE TRANSCEDE 3443
--mora MACH_MORA MORA 3444
--nda_evm MACH_NDA_EVM NDA_EVM 3445
--timu MACH_TIMU TIMU 3446
--expressh MACH_EXPRESSH EXPRESSH 3447
- veridis_a300 MACH_VERIDIS_A300 VERIDIS_A300 3448
--dm368_leopard MACH_DM368_LEOPARD DM368_LEOPARD 3449
--omap_mcop MACH_OMAP_MCOP OMAP_MCOP 3450
--tritip MACH_TRITIP TRITIP 3451
--sm1k MACH_SM1K SM1K 3452
--monch MACH_MONCH MONCH 3453
--curacao MACH_CURACAO CURACAO 3454
- origen MACH_ORIGEN ORIGEN 3455
--epc10 MACH_EPC10 EPC10 3456
--sgh_i740 MACH_SGH_I740 SGH_I740 3457
--tuna MACH_TUNA TUNA 3458
--mx51_tulip MACH_MX51_TULIP MX51_TULIP 3459
--mx51_aster7 MACH_MX51_ASTER7 MX51_ASTER7 3460
--acro37xbrd MACH_ACRO37XBRD ACRO37XBRD 3461
--elke MACH_ELKE ELKE 3462
--sbc6000x MACH_SBC6000X SBC6000X 3463
--r1801e MACH_R1801E R1801E 3464
--h1600 MACH_H1600 H1600 3465
--mini210 MACH_MINI210 MINI210 3466
--mini8168 MACH_MINI8168 MINI8168 3467
--pc7308 MACH_PC7308 PC7308 3468
--kmm2m01 MACH_KMM2M01 KMM2M01 3470
--mx51erebus MACH_MX51EREBUS MX51EREBUS 3471
- wm8650refboard MACH_WM8650REFBOARD WM8650REFBOARD 3472
--tuxrail MACH_TUXRAIL TUXRAIL 3473
--arthur MACH_ARTHUR ARTHUR 3474
--doorboy MACH_DOORBOY DOORBOY 3475
- xarina MACH_XARINA XARINA 3476
--roverx7 MACH_ROVERX7 ROVERX7 3477
- sdvr MACH_SDVR SDVR 3478
- acer_maya MACH_ACER_MAYA ACER_MAYA 3479
- pico MACH_PICO PICO 3480
-@@ -999,6 +770,7 @@ promwad_jade MACH_PROMWAD_JADE PROMWAD_JADE 3708
- amp MACH_AMP AMP 3709
- gnet_amp MACH_GNET_AMP GNET_AMP 3710
- toques MACH_TOQUES TOQUES 3711
-+apx4devkit MACH_APX4DEVKIT APX4DEVKIT 3712
- dct_storm MACH_DCT_STORM DCT_STORM 3713
- owl MACH_OWL OWL 3715
- cogent_csb1741 MACH_COGENT_CSB1741 COGENT_CSB1741 3716
-@@ -1063,7 +835,6 @@ shelter MACH_SHELTER SHELTER 3778
- omap3_devkit8500 MACH_OMAP3_DEVKIT8500 OMAP3_DEVKIT8500 3779
- edgetd MACH_EDGETD EDGETD 3780
- copperyard MACH_COPPERYARD COPPERYARD 3781
--edge MACH_EDGE EDGE 3782
- edge_u MACH_EDGE_U EDGE_U 3783
- edge_td MACH_EDGE_TD EDGE_TD 3784
- wdss MACH_WDSS WDSS 3785
-@@ -1169,3 +940,269 @@ elite_ulk MACH_ELITE_ULK ELITE_ULK 3888
- pov2 MACH_POV2 POV2 3889
- ipod_touch_2g MACH_IPOD_TOUCH_2G IPOD_TOUCH_2G 3890
- da850_pqab MACH_DA850_PQAB DA850_PQAB 3891
-+fermi MACH_FERMI FERMI 3892
-+ccardwmx28 MACH_CCARDWMX28 CCARDWMX28 3893
-+ccardmx28 MACH_CCARDMX28 CCARDMX28 3894
-+fs20_fcm2050 MACH_FS20_FCM2050 FS20_FCM2050 3895
-+kinetis MACH_KINETIS KINETIS 3896
-+kai MACH_KAI KAI 3897
-+bcthb2 MACH_BCTHB2 BCTHB2 3898
-+inels3_cu MACH_INELS3_CU INELS3_CU 3899
-+da850_apollo MACH_DA850_APOLLO DA850_APOLLO 3901
-+tracnas MACH_TRACNAS TRACNAS 3902
-+mityarm335x MACH_MITYARM335X MITYARM335X 3903
-+xcgz7x MACH_XCGZ7X XCGZ7X 3904
-+cubox MACH_CUBOX CUBOX 3905
-+terminator MACH_TERMINATOR TERMINATOR 3906
-+eye03 MACH_EYE03 EYE03 3907
-+kota3 MACH_KOTA3 KOTA3 3908
-+pscpe MACH_PSCPE PSCPE 3910
-+akt1100 MACH_AKT1100 AKT1100 3911
-+pcaaxl2 MACH_PCAAXL2 PCAAXL2 3912
-+primodd_ct MACH_PRIMODD_CT PRIMODD_CT 3913
-+nsbc MACH_NSBC NSBC 3914
-+meson2_skt MACH_MESON2_SKT MESON2_SKT 3915
-+meson2_ref MACH_MESON2_REF MESON2_REF 3916
-+ccardwmx28js MACH_CCARDWMX28JS CCARDWMX28JS 3917
-+ccardmx28js MACH_CCARDMX28JS CCARDMX28JS 3918
-+indico MACH_INDICO INDICO 3919
-+msm8960dt MACH_MSM8960DT MSM8960DT 3920
-+primods MACH_PRIMODS PRIMODS 3921
-+beluga_m1388 MACH_BELUGA_M1388 BELUGA_M1388 3922
-+primotd MACH_PRIMOTD PRIMOTD 3923
-+varan_master MACH_VARAN_MASTER VARAN_MASTER 3924
-+primodd MACH_PRIMODD PRIMODD 3925
-+jetduo MACH_JETDUO JETDUO 3926
-+mx53_umobo MACH_MX53_UMOBO MX53_UMOBO 3927
-+trats MACH_TRATS TRATS 3928
-+starcraft MACH_STARCRAFT STARCRAFT 3929
-+qseven_tegra2 MACH_QSEVEN_TEGRA2 QSEVEN_TEGRA2 3930
-+lichee_sun4i_devbd MACH_LICHEE_SUN4I_DEVBD LICHEE_SUN4I_DEVBD 3931
-+movenow MACH_MOVENOW MOVENOW 3932
-+golf_u MACH_GOLF_U GOLF_U 3933
-+msm7627a_evb MACH_MSM7627A_EVB MSM7627A_EVB 3934
-+rambo MACH_RAMBO RAMBO 3935
-+golfu MACH_GOLFU GOLFU 3936
-+mango310 MACH_MANGO310 MANGO310 3937
-+dns343 MACH_DNS343 DNS343 3938
-+var_som_om44 MACH_VAR_SOM_OM44 VAR_SOM_OM44 3939
-+naon MACH_NAON NAON 3940
-+vp4000 MACH_VP4000 VP4000 3941
-+impcard MACH_IMPCARD IMPCARD 3942
-+smoovcam MACH_SMOOVCAM SMOOVCAM 3943
-+cobham3725 MACH_COBHAM3725 COBHAM3725 3944
-+cobham3730 MACH_COBHAM3730 COBHAM3730 3945
-+cobham3703 MACH_COBHAM3703 COBHAM3703 3946
-+quetzal MACH_QUETZAL QUETZAL 3947
-+apq8064_cdp MACH_APQ8064_CDP APQ8064_CDP 3948
-+apq8064_mtp MACH_APQ8064_MTP APQ8064_MTP 3949
-+apq8064_fluid MACH_APQ8064_FLUID APQ8064_FLUID 3950
-+apq8064_liquid MACH_APQ8064_LIQUID APQ8064_LIQUID 3951
-+mango210 MACH_MANGO210 MANGO210 3952
-+mango100 MACH_MANGO100 MANGO100 3953
-+mango24 MACH_MANGO24 MANGO24 3954
-+mango64 MACH_MANGO64 MANGO64 3955
-+nsa320 MACH_NSA320 NSA320 3956
-+elv_ccu2 MACH_ELV_CCU2 ELV_CCU2 3957
-+triton_x00 MACH_TRITON_X00 TRITON_X00 3958
-+triton_1500_2000 MACH_TRITON_1500_2000 TRITON_1500_2000 3959
-+pogoplugv4 MACH_POGOPLUGV4 POGOPLUGV4 3960
-+venus_cl MACH_VENUS_CL VENUS_CL 3961
-+vulcano_g20 MACH_VULCANO_G20 VULCANO_G20 3962
-+sgs_i9100 MACH_SGS_I9100 SGS_I9100 3963
-+stsv2 MACH_STSV2 STSV2 3964
-+csb1724 MACH_CSB1724 CSB1724 3965
-+omapl138_lcdk MACH_OMAPL138_LCDK OMAPL138_LCDK 3966
-+pvd_mx25 MACH_PVD_MX25 PVD_MX25 3968
-+meson6_skt MACH_MESON6_SKT MESON6_SKT 3969
-+meson6_ref MACH_MESON6_REF MESON6_REF 3970
-+pxm MACH_PXM PXM 3971
-+pogoplugv3 MACH_POGOPLUGV3 POGOPLUGV3 3973
-+mlp89626 MACH_MLP89626 MLP89626 3974
-+iomegahmndce MACH_IOMEGAHMNDCE IOMEGAHMNDCE 3975
-+pogoplugv3pci MACH_POGOPLUGV3PCI POGOPLUGV3PCI 3976
-+bntv250 MACH_BNTV250 BNTV250 3977
-+mx53_qseven MACH_MX53_QSEVEN MX53_QSEVEN 3978
-+gtl_it1100 MACH_GTL_IT1100 GTL_IT1100 3979
-+mx6q_sabresd MACH_MX6Q_SABRESD MX6Q_SABRESD 3980
-+mt4 MACH_MT4 MT4 3981
-+jumbo_d MACH_JUMBO_D JUMBO_D 3982
-+jumbo_i MACH_JUMBO_I JUMBO_I 3983
-+fs20_dmp MACH_FS20_DMP FS20_DMP 3984
-+dns320 MACH_DNS320 DNS320 3985
-+mx28bacos MACH_MX28BACOS MX28BACOS 3986
-+tl80 MACH_TL80 TL80 3987
-+polatis_nic_1001 MACH_POLATIS_NIC_1001 POLATIS_NIC_1001 3988
-+tely MACH_TELY TELY 3989
-+u8520 MACH_U8520 U8520 3990
-+manta MACH_MANTA MANTA 3991
-+mpq8064_cdp MACH_MPQ8064_CDP MPQ8064_CDP 3993
-+mpq8064_dtv MACH_MPQ8064_DTV MPQ8064_DTV 3995
-+dm368som MACH_DM368SOM DM368SOM 3996
-+gprisb2 MACH_GPRISB2 GPRISB2 3997
-+chammid MACH_CHAMMID CHAMMID 3998
-+seoul2 MACH_SEOUL2 SEOUL2 3999
-+omap4_nooktablet MACH_OMAP4_NOOKTABLET OMAP4_NOOKTABLET 4000
-+aalto MACH_AALTO AALTO 4001
-+metro MACH_METRO METRO 4002
-+cydm3730 MACH_CYDM3730 CYDM3730 4003
-+tqma53 MACH_TQMA53 TQMA53 4004
-+msm7627a_qrd3 MACH_MSM7627A_QRD3 MSM7627A_QRD3 4005
-+mx28_canby MACH_MX28_CANBY MX28_CANBY 4006
-+tiger MACH_TIGER TIGER 4007
-+pcats_9307_type_a MACH_PCATS_9307_TYPE_A PCATS_9307_TYPE_A 4008
-+pcats_9307_type_o MACH_PCATS_9307_TYPE_O PCATS_9307_TYPE_O 4009
-+pcats_9307_type_r MACH_PCATS_9307_TYPE_R PCATS_9307_TYPE_R 4010
-+streamplug MACH_STREAMPLUG STREAMPLUG 4011
-+icechicken_dev MACH_ICECHICKEN_DEV ICECHICKEN_DEV 4012
-+hedgehog MACH_HEDGEHOG HEDGEHOG 4013
-+yusend_obc MACH_YUSEND_OBC YUSEND_OBC 4014
-+imxninja MACH_IMXNINJA IMXNINJA 4015
-+omap4_jarod MACH_OMAP4_JAROD OMAP4_JAROD 4016
-+eco5_pk MACH_ECO5_PK ECO5_PK 4017
-+qj2440 MACH_QJ2440 QJ2440 4018
-+mx6q_mercury MACH_MX6Q_MERCURY MX6Q_MERCURY 4019
-+cm6810 MACH_CM6810 CM6810 4020
-+omap4_torpedo MACH_OMAP4_TORPEDO OMAP4_TORPEDO 4021
-+nsa310 MACH_NSA310 NSA310 4022
-+tmx536 MACH_TMX536 TMX536 4023
-+ktt20 MACH_KTT20 KTT20 4024
-+dragonix MACH_DRAGONIX DRAGONIX 4025
-+lungching MACH_LUNGCHING LUNGCHING 4026
-+bulogics MACH_BULOGICS BULOGICS 4027
-+mx535_sx MACH_MX535_SX MX535_SX 4028
-+ngui3250 MACH_NGUI3250 NGUI3250 4029
-+salutec_dac MACH_SALUTEC_DAC SALUTEC_DAC 4030
-+loco MACH_LOCO LOCO 4031
-+ctera_plug_usi MACH_CTERA_PLUG_USI CTERA_PLUG_USI 4032
-+scepter MACH_SCEPTER SCEPTER 4033
-+sga MACH_SGA SGA 4034
-+p_81_j5 MACH_P_81_J5 P_81_J5 4035
-+p_81_o4 MACH_P_81_O4 P_81_O4 4036
-+msm8625_surf MACH_MSM8625_SURF MSM8625_SURF 4037
-+carallon_shark MACH_CARALLON_SHARK CARALLON_SHARK 4038
-+ordog MACH_ORDOG ORDOG 4040
-+puente_io MACH_PUENTE_IO PUENTE_IO 4041
-+msm8625_evb MACH_MSM8625_EVB MSM8625_EVB 4042
-+ev_am1707 MACH_EV_AM1707 EV_AM1707 4043
-+ev_am1707e2 MACH_EV_AM1707E2 EV_AM1707E2 4044
-+ev_am3517e2 MACH_EV_AM3517E2 EV_AM3517E2 4045
-+calabria MACH_CALABRIA CALABRIA 4046
-+ev_imx287 MACH_EV_IMX287 EV_IMX287 4047
-+erau MACH_ERAU ERAU 4048
-+sichuan MACH_SICHUAN SICHUAN 4049
-+davinci_da850 MACH_DAVINCI_DA850 DAVINCI_DA850 4051
-+omap138_trunarc MACH_OMAP138_TRUNARC OMAP138_TRUNARC 4052
-+bcm4761 MACH_BCM4761 BCM4761 4053
-+picasso_e2 MACH_PICASSO_E2 PICASSO_E2 4054
-+picasso_mf MACH_PICASSO_MF PICASSO_MF 4055
-+miro MACH_MIRO MIRO 4056
-+at91sam9g20ewon3 MACH_AT91SAM9G20EWON3 AT91SAM9G20EWON3 4057
-+yoyo MACH_YOYO YOYO 4058
-+windjkl MACH_WINDJKL WINDJKL 4059
-+monarudo MACH_MONARUDO MONARUDO 4060
-+batan MACH_BATAN BATAN 4061
-+tadao MACH_TADAO TADAO 4062
-+baso MACH_BASO BASO 4063
-+mahon MACH_MAHON MAHON 4064
-+villec2 MACH_VILLEC2 VILLEC2 4065
-+asi1230 MACH_ASI1230 ASI1230 4066
-+alaska MACH_ALASKA ALASKA 4067
-+swarco_shdsl2 MACH_SWARCO_SHDSL2 SWARCO_SHDSL2 4068
-+oxrtu MACH_OXRTU OXRTU 4069
-+omap5_panda MACH_OMAP5_PANDA OMAP5_PANDA 4070
-+c8000 MACH_C8000 C8000 4072
-+bje_display3_5 MACH_BJE_DISPLAY3_5 BJE_DISPLAY3_5 4073
-+picomod7 MACH_PICOMOD7 PICOMOD7 4074
-+picocom5 MACH_PICOCOM5 PICOCOM5 4075
-+qblissa8 MACH_QBLISSA8 QBLISSA8 4076
-+armstonea8 MACH_ARMSTONEA8 ARMSTONEA8 4077
-+netdcu14 MACH_NETDCU14 NETDCU14 4078
-+at91sam9x5_epiphan MACH_AT91SAM9X5_EPIPHAN AT91SAM9X5_EPIPHAN 4079
-+p2u MACH_P2U P2U 4080
-+doris MACH_DORIS DORIS 4081
-+j49 MACH_J49 J49 4082
-+vdss2e MACH_VDSS2E VDSS2E 4083
-+vc300 MACH_VC300 VC300 4084
-+ns115_pad_test MACH_NS115_PAD_TEST NS115_PAD_TEST 4085
-+ns115_pad_ref MACH_NS115_PAD_REF NS115_PAD_REF 4086
-+ns115_phone_test MACH_NS115_PHONE_TEST NS115_PHONE_TEST 4087
-+ns115_phone_ref MACH_NS115_PHONE_REF NS115_PHONE_REF 4088
-+golfc MACH_GOLFC GOLFC 4089
-+xerox_olympus MACH_XEROX_OLYMPUS XEROX_OLYMPUS 4090
-+mx6sl_arm2 MACH_MX6SL_ARM2 MX6SL_ARM2 4091
-+csb1701_csb1726 MACH_CSB1701_CSB1726 CSB1701_CSB1726 4092
-+at91sam9xeek MACH_AT91SAM9XEEK AT91SAM9XEEK 4093
-+ebv210 MACH_EBV210 EBV210 4094
-+msm7627a_qrd7 MACH_MSM7627A_QRD7 MSM7627A_QRD7 4095
-+svthin MACH_SVTHIN SVTHIN 4096
-+duovero MACH_DUOVERO DUOVERO 4097
-+chupacabra MACH_CHUPACABRA CHUPACABRA 4098
-+scorpion MACH_SCORPION SCORPION 4099
-+davinci_he_hmi10 MACH_DAVINCI_HE_HMI10 DAVINCI_HE_HMI10 4100
-+topkick MACH_TOPKICK TOPKICK 4101
-+m3_auguestrush MACH_M3_AUGUESTRUSH M3_AUGUESTRUSH 4102
-+ipc335x MACH_IPC335X IPC335X 4103
-+sun4i MACH_SUN4I SUN4I 4104
-+imx233_olinuxino MACH_IMX233_OLINUXINO IMX233_OLINUXINO 4105
-+k2_wl MACH_K2_WL K2_WL 4106
-+k2_ul MACH_K2_UL K2_UL 4107
-+k2_cl MACH_K2_CL K2_CL 4108
-+minbari_w MACH_MINBARI_W MINBARI_W 4109
-+minbari_m MACH_MINBARI_M MINBARI_M 4110
-+k035 MACH_K035 K035 4111
-+ariel MACH_ARIEL ARIEL 4112
-+arielsaarc MACH_ARIELSAARC ARIELSAARC 4113
-+arieldkb MACH_ARIELDKB ARIELDKB 4114
-+armadillo810 MACH_ARMADILLO810 ARMADILLO810 4115
-+tam335x MACH_TAM335X TAM335X 4116
-+grouper MACH_GROUPER GROUPER 4117
-+mpcsa21_9g20 MACH_MPCSA21_9G20 MPCSA21_9G20 4118
-+m6u_cpu MACH_M6U_CPU M6U_CPU 4119
-+davinci_dp10 MACH_DAVINCI_DP10 DAVINCI_DP10 4120
-+ginkgo MACH_GINKGO GINKGO 4121
-+cgt_qmx6 MACH_CGT_QMX6 CGT_QMX6 4122
-+profpga MACH_PROFPGA PROFPGA 4123
-+acfx100oc MACH_ACFX100OC ACFX100OC 4124
-+acfx100nb MACH_ACFX100NB ACFX100NB 4125
-+capricorn MACH_CAPRICORN CAPRICORN 4126
-+pisces MACH_PISCES PISCES 4127
-+aries MACH_ARIES ARIES 4128
-+cancer MACH_CANCER CANCER 4129
-+leo MACH_LEO LEO 4130
-+virgo MACH_VIRGO VIRGO 4131
-+sagittarius MACH_SAGITTARIUS SAGITTARIUS 4132
-+devil MACH_DEVIL DEVIL 4133
-+ballantines MACH_BALLANTINES BALLANTINES 4134
-+omap3_procerusvpu MACH_OMAP3_PROCERUSVPU OMAP3_PROCERUSVPU 4135
-+my27 MACH_MY27 MY27 4136
-+sun6i MACH_SUN6I SUN6I 4137
-+sun5i MACH_SUN5I SUN5I 4138
-+mx512_mx MACH_MX512_MX MX512_MX 4139
-+kzm9g MACH_KZM9G KZM9G 4140
-+vdstbn MACH_VDSTBN VDSTBN 4141
-+cfa10036 MACH_CFA10036 CFA10036 4142
-+cfa10049 MACH_CFA10049 CFA10049 4143
-+pcm051 MACH_PCM051 PCM051 4144
-+vybrid_vf7xx MACH_VYBRID_VF7XX VYBRID_VF7XX 4145
-+vybrid_vf6xx MACH_VYBRID_VF6XX VYBRID_VF6XX 4146
-+vybrid_vf5xx MACH_VYBRID_VF5XX VYBRID_VF5XX 4147
-+vybrid_vf4xx MACH_VYBRID_VF4XX VYBRID_VF4XX 4148
-+aria_g25 MACH_ARIA_G25 ARIA_G25 4149
-+bcm21553 MACH_BCM21553 BCM21553 4150
-+smdk5410 MACH_SMDK5410 SMDK5410 4151
-+lpc18xx MACH_LPC18XX LPC18XX 4152
-+oratisparty MACH_ORATISPARTY ORATISPARTY 4153
-+qseven MACH_QSEVEN QSEVEN 4154
-+gmv_generic MACH_GMV_GENERIC GMV_GENERIC 4155
-+th_link_eth MACH_TH_LINK_ETH TH_LINK_ETH 4156
-+tn_muninn MACH_TN_MUNINN TN_MUNINN 4157
-+rampage MACH_RAMPAGE RAMPAGE 4158
-+visstrim_mv10 MACH_VISSTRIM_MV10 VISSTRIM_MV10 4159
-+mx28_wilma MACH_MX28_WILMA MX28_WILMA 4164
-+msm8625_ffa MACH_MSM8625_FFA MSM8625_FFA 4166
-+vpu101 MACH_VPU101 VPU101 4167
-+baileys MACH_BAILEYS BAILEYS 4169
-+familybox MACH_FAMILYBOX FAMILYBOX 4170
-+ensemble_mx35 MACH_ENSEMBLE_MX35 ENSEMBLE_MX35 4171
-+sc_sps_1 MACH_SC_SPS_1 SC_SPS_1 4172
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0191-ARM-mach-shmobile-add-KZM-A9-GT-board-support.patch b/patches.kzm9g/0191-ARM-mach-shmobile-add-KZM-A9-GT-board-support.patch
deleted file mode 100644
index 5dc9d3b14ed7ab..00000000000000
--- a/patches.kzm9g/0191-ARM-mach-shmobile-add-KZM-A9-GT-board-support.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From c3845eb19812059fd44fb6a6993c5bef692ee796 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 10 Apr 2012 20:57:31 -0700
-Subject: ARM: mach-shmobile: add KZM-A9-GT board support
-
-This adds very basic KZM-A9-GT board (SH73a0) support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5935278004610be17b89eab399d35ea0527bb6b2)
-
-Conflicts:
-
- arch/arm/mach-shmobile/Kconfig
- arch/arm/mach-shmobile/Makefile
- arch/arm/mach-shmobile/board-kzm9g.c
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 5 +++
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/board-kzm9g.c | 60 ++++++++++++++++++++++++++++++++++++
- 3 files changed, 66 insertions(+)
- create mode 100644 arch/arm/mach-shmobile/board-kzm9g.c
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 91a4f32..23be741 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -81,6 +81,11 @@ config MACH_ARMADILLO800EVA
- select ARCH_REQUIRE_GPIOLIB
- select SND_SOC_WM8978 if SND_SIMPLE_CARD
-
-+config MACH_KZM9G
-+ bool "KZM-A9-GT board"
-+ depends on ARCH_SH73A0
-+ select ARCH_REQUIRE_GPIOLIB
-+
- comment "SH-Mobile System Configuration"
-
- config CPU_HAS_INTEVT
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index c599c5c..36bd37d 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -45,6 +45,7 @@ obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
- obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
- obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
- obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
-+obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
-
- # Framework support
- obj-$(CONFIG_SMP) += $(smp-y)
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-new file mode 100644
-index 0000000..a7f05f6
---- /dev/null
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -0,0 +1,60 @@
-+/*
-+ * KZM-A9-GT board support
-+ *
-+ * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+#include <linux/gpio.h>
-+#include <linux/io.h>
-+#include <linux/irq.h>
-+#include <linux/platform_device.h>
-+#include <mach/sh73a0.h>
-+#include <mach/common.h>
-+#include <asm/hardware/cache-l2x0.h>
-+#include <asm/hardware/gic.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
-+
-+static struct platform_device *kzm_devices[] __initdata = {
-+};
-+
-+static void __init kzm_init(void)
-+{
-+ sh73a0_pinmux_init();
-+
-+ /* enable SCIFA4 */
-+ gpio_request(GPIO_FN_SCIFA4_TXD, NULL);
-+ gpio_request(GPIO_FN_SCIFA4_RXD, NULL);
-+ gpio_request(GPIO_FN_SCIFA4_RTS_, NULL);
-+ gpio_request(GPIO_FN_SCIFA4_CTS_, NULL);
-+
-+#ifdef CONFIG_CACHE_L2X0
-+ /* Early BRESP enable, Shared attribute override enable, 64K*8way */
-+ l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
-+#endif
-+
-+ sh73a0_add_standard_devices();
-+ platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
-+}
-+
-+MACHINE_START(KZM9G, "kzm9g")
-+ .map_io = sh73a0_map_io,
-+ .init_early = sh73a0_add_early_devices,
-+ .nr_irqs = NR_IRQS_LEGACY,
-+ .init_irq = sh73a0_init_irq,
-+ .handle_irq = gic_handle_irq,
-+ .init_machine = kzm_init,
-+ .timer = &shmobile_timer,
-+MACHINE_END
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0192-ARM-mach-shmobile-kzm9g-add-defconfig.patch b/patches.kzm9g/0192-ARM-mach-shmobile-kzm9g-add-defconfig.patch
deleted file mode 100644
index 14a7dd42b1c4b0..00000000000000
--- a/patches.kzm9g/0192-ARM-mach-shmobile-kzm9g-add-defconfig.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From ed3eb21cec58c7403ba87eaf5b9a1fa79fc82432 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 10 Apr 2012 20:57:45 -0700
-Subject: ARM: mach-shmobile: kzm9g: add defconfig
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e9ea2fb38c9d5f8cb80e359cc853fb6449f3635a)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/configs/kzm9g_defconfig | 127 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 127 insertions(+)
- create mode 100644 arch/arm/configs/kzm9g_defconfig
-
-diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
-new file mode 100644
-index 0000000..164c5d2
---- /dev/null
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -0,0 +1,127 @@
-+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
-+CONFIG_EXPERIMENTAL=y
-+# CONFIG_LOCALVERSION_AUTO is not set
-+CONFIG_SYSVIPC=y
-+CONFIG_IKCONFIG=y
-+CONFIG_IKCONFIG_PROC=y
-+CONFIG_LOG_BUF_SHIFT=16
-+CONFIG_NAMESPACES=y
-+# CONFIG_UTS_NS is not set
-+# CONFIG_IPC_NS is not set
-+# CONFIG_USER_NS is not set
-+# CONFIG_PID_NS is not set
-+# CONFIG_NET_NS is not set
-+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-+CONFIG_SYSCTL_SYSCALL=y
-+CONFIG_EMBEDDED=y
-+CONFIG_SLAB=y
-+CONFIG_MODULES=y
-+CONFIG_MODULE_FORCE_LOAD=y
-+CONFIG_MODULE_UNLOAD=y
-+# CONFIG_BLK_DEV_BSG is not set
-+# CONFIG_IOSCHED_DEADLINE is not set
-+# CONFIG_IOSCHED_CFQ is not set
-+CONFIG_ARCH_SHMOBILE=y
-+CONFIG_ARCH_SH73A0=y
-+CONFIG_MACH_KZM9G=y
-+CONFIG_MEMORY_START=0x41000000
-+CONFIG_MEMORY_SIZE=0x1f000000
-+CONFIG_ARM_ERRATA_743622=y
-+CONFIG_ARM_ERRATA_754322=y
-+CONFIG_NO_HZ=y
-+CONFIG_HIGH_RES_TIMERS=y
-+CONFIG_PREEMPT=y
-+CONFIG_AEABI=y
-+# CONFIG_OABI_COMPAT is not set
-+CONFIG_HIGHMEM=y
-+CONFIG_ZBOOT_ROM_TEXT=0x0
-+CONFIG_ZBOOT_ROM_BSS=0x0
-+CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=serial"
-+CONFIG_KEXEC=y
-+CONFIG_VFP=y
-+CONFIG_NEON=y
-+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-+CONFIG_PM_RUNTIME=y
-+CONFIG_NET=y
-+CONFIG_PACKET=y
-+CONFIG_UNIX=y
-+CONFIG_INET=y
-+CONFIG_IP_PNP=y
-+CONFIG_IP_PNP_DHCP=y
-+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-+# CONFIG_INET_XFRM_MODE_BEET is not set
-+# CONFIG_INET_LRO is not set
-+# CONFIG_INET_DIAG is not set
-+# CONFIG_IPV6 is not set
-+CONFIG_IRDA=y
-+CONFIG_SH_IRDA=y
-+# CONFIG_WIRELESS is not set
-+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-+CONFIG_SCSI=y
-+CONFIG_BLK_DEV_SD=y
-+CONFIG_NETDEVICES=y
-+CONFIG_SMSC911X=y
-+# CONFIG_WLAN is not set
-+CONFIG_INPUT_SPARSEKMAP=y
-+# CONFIG_INPUT_MOUSEDEV is not set
-+CONFIG_INPUT_EVDEV=y
-+# CONFIG_KEYBOARD_ATKBD is not set
-+CONFIG_KEYBOARD_GPIO=y
-+CONFIG_KEYBOARD_SH_KEYSC=y
-+# CONFIG_INPUT_MOUSE is not set
-+CONFIG_INPUT_TOUCHSCREEN=y
-+CONFIG_TOUCHSCREEN_ST1232=y
-+# CONFIG_LEGACY_PTYS is not set
-+CONFIG_SERIAL_SH_SCI=y
-+CONFIG_SERIAL_SH_SCI_NR_UARTS=9
-+CONFIG_SERIAL_SH_SCI_CONSOLE=y
-+# CONFIG_HW_RANDOM is not set
-+CONFIG_I2C_CHARDEV=y
-+CONFIG_I2C_SH_MOBILE=y
-+CONFIG_POWER_SUPPLY=y
-+# CONFIG_HWMON is not set
-+CONFIG_FB=y
-+CONFIG_FB_SH_MOBILE_LCDC=y
-+CONFIG_FRAMEBUFFER_CONSOLE=y
-+CONFIG_LOGO=y
-+CONFIG_FB_SH_MOBILE_MERAM=y
-+# CONFIG_HID_SUPPORT is not set
-+CONFIG_USB=y
-+CONFIG_USB_DEVICEFS=y
-+CONFIG_USB_R8A66597_HCD=y
-+CONFIG_USB_STORAGE=y
-+CONFIG_MMC=y
-+# CONFIG_MMC_BLOCK_BOUNCE is not set
-+CONFIG_MMC_SDHI=y
-+CONFIG_MMC_SH_MMCIF=y
-+CONFIG_NEW_LEDS=y
-+CONFIG_LEDS_CLASS=y
-+CONFIG_RTC_CLASS=y
-+CONFIG_DMADEVICES=y
-+CONFIG_SH_DMAE=y
-+CONFIG_ASYNC_TX_DMA=y
-+CONFIG_STAGING=y
-+# CONFIG_DNOTIFY is not set
-+# CONFIG_INOTIFY_USER is not set
-+CONFIG_VFAT_FS=y
-+CONFIG_TMPFS=y
-+# CONFIG_MISC_FILESYSTEMS is not set
-+CONFIG_NFS_FS=y
-+CONFIG_NFS_V3=y
-+CONFIG_NFS_V3_ACL=y
-+CONFIG_NFS_V4=y
-+CONFIG_NFS_V4_1=y
-+CONFIG_ROOT_NFS=y
-+CONFIG_NLS_CODEPAGE_437=y
-+CONFIG_NLS_ISO8859_1=y
-+CONFIG_MAGIC_SYSRQ=y
-+CONFIG_DETECT_HUNG_TASK=y
-+CONFIG_DEBUG_INFO=y
-+# CONFIG_FTRACE is not set
-+CONFIG_DEBUG_USER=y
-+CONFIG_CRYPTO=y
-+CONFIG_CRYPTO_CBC=y
-+CONFIG_CRYPTO_MD5=y
-+CONFIG_CRYPTO_DES=y
-+CONFIG_CRC16=y
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0193-ARM-mach-shmobile-Invalidate-caches-when-booting-sec.patch b/patches.kzm9g/0193-ARM-mach-shmobile-Invalidate-caches-when-booting-sec.patch
deleted file mode 100644
index b473444b3267d9..00000000000000
--- a/patches.kzm9g/0193-ARM-mach-shmobile-Invalidate-caches-when-booting-sec.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 2a87f8d5cd1d9ca2c80e4dcdab9adff42185567d Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Wed, 9 May 2012 16:24:59 +0900
-Subject: ARM / mach-shmobile: Invalidate caches when booting secondary cores
-
-Make sure L1 caches are invalidated when booting secondary
-cores. Needed to boot all mach-shmobile SMP systems that
-are using Cortex-A9 including sh73a0, r8a7779 and EMEV2.
-
-Thanks to imx and tegra guys for actual code.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5fab7b501bf29c08c5b01627b496b6b766bd0165)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/headsmp.S | 56 +++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 55 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
-index 26079d9..75abb74 100644
---- a/arch/arm/mach-shmobile/headsmp.S
-+++ b/arch/arm/mach-shmobile/headsmp.S
-@@ -16,6 +16,59 @@
-
- __INIT
-
-+/* Cache invalidation nicked from arch/arm/mach-imx/head-v7.S, thanks!
-+ *
-+ * The secondary kernel init calls v7_flush_dcache_all before it enables
-+ * the L1; however, the L1 comes out of reset in an undefined state, so
-+ * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
-+ * of cache lines with uninitialized data and uninitialized tags to get
-+ * written out to memory, which does really unpleasant things to the main
-+ * processor. We fix this by performing an invalidate, rather than a
-+ * clean + invalidate, before jumping into the kernel.
-+ *
-+ * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
-+ * to be called for both secondary cores startup and primary core resume
-+ * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S.
-+ */
-+ENTRY(v7_invalidate_l1)
-+ mov r0, #0
-+ mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
-+ mcr p15, 2, r0, c0, c0, 0
-+ mrc p15, 1, r0, c0, c0, 0
-+
-+ ldr r1, =0x7fff
-+ and r2, r1, r0, lsr #13
-+
-+ ldr r1, =0x3ff
-+
-+ and r3, r1, r0, lsr #3 @ NumWays - 1
-+ add r2, r2, #1 @ NumSets
-+
-+ and r0, r0, #0x7
-+ add r0, r0, #4 @ SetShift
-+
-+ clz r1, r3 @ WayShift
-+ add r4, r3, #1 @ NumWays
-+1: sub r2, r2, #1 @ NumSets--
-+ mov r3, r4 @ Temp = NumWays
-+2: subs r3, r3, #1 @ Temp--
-+ mov r5, r3, lsl r1
-+ mov r6, r2, lsl r0
-+ orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
-+ mcr p15, 0, r5, c7, c6, 2
-+ bgt 2b
-+ cmp r2, #0
-+ bgt 1b
-+ dsb
-+ isb
-+ mov pc, lr
-+ENDPROC(v7_invalidate_l1)
-+
-+ENTRY(shmobile_invalidate_start)
-+ bl v7_invalidate_l1
-+ b secondary_startup
-+ENDPROC(shmobile_invalidate_start)
-+
- /*
- * Reset vector for secondary CPUs.
- * This will be mapped at address 0 by SBAR register.
-@@ -24,4 +77,5 @@
- .align 12
- ENTRY(shmobile_secondary_vector)
- ldr pc, 1f
--1: .long secondary_startup - PAGE_OFFSET + PLAT_PHYS_OFFSET
-+1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET
-+ENDPROC(shmobile_secondary_vector)
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0194-ARM-mach-shmobile-kzm9g-enable-SMP-boot.patch b/patches.kzm9g/0194-ARM-mach-shmobile-kzm9g-enable-SMP-boot.patch
deleted file mode 100644
index c1400e4c840887..00000000000000
--- a/patches.kzm9g/0194-ARM-mach-shmobile-kzm9g-enable-SMP-boot.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 1b1b557076119efd097b7d294dd0a28b36e8842c Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Thu, 10 May 2012 00:10:29 -0700
-Subject: ARM: mach-shmobile: kzm9g: enable SMP boot
-
-Update the KZM9G defconfig and the code in platsmp.c to support SMP on
-the sh73a0 based KZM9G board. Also fix up the earlyprintk setting that
-was previously incorrect.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 1f3bcdd68cf4b27bddb128c401466c9fc7ba96bd)
-
-Conflicts:
-
- arch/arm/mach-shmobile/platsmp.c
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/configs/kzm9g_defconfig | 4 +++-
- arch/arm/mach-shmobile/platsmp.c | 10 ++++++----
- 2 files changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
-index 164c5d2..de8712b 100644
---- a/arch/arm/configs/kzm9g_defconfig
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -30,13 +30,15 @@ CONFIG_ARM_ERRATA_743622=y
- CONFIG_ARM_ERRATA_754322=y
- CONFIG_NO_HZ=y
- CONFIG_HIGH_RES_TIMERS=y
-+CONFIG_SMP=y
-+CONFIG_SCHED_MC=y
- CONFIG_PREEMPT=y
- CONFIG_AEABI=y
- # CONFIG_OABI_COMPAT is not set
- CONFIG_HIGHMEM=y
- CONFIG_ZBOOT_ROM_TEXT=0x0
- CONFIG_ZBOOT_ROM_BSS=0x0
--CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=serial"
-+CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200"
- CONFIG_KEXEC=y
- CONFIG_VFP=y
- CONFIG_NEON=y
-diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
-index f3888fe..2cc8930 100644
---- a/arch/arm/mach-shmobile/platsmp.c
-+++ b/arch/arm/mach-shmobile/platsmp.c
-@@ -21,9 +21,11 @@
- #include <asm/mach-types.h>
- #include <mach/common.h>
-
-+#define is_sh73a0() (machine_is_ag5evm() || machine_is_kzm9g())
-+
- static unsigned int __init shmobile_smp_get_core_count(void)
- {
-- if (machine_is_ag5evm())
-+ if (is_sh73a0())
- return sh73a0_get_core_count();
-
- return 1;
-@@ -31,7 +33,7 @@ static unsigned int __init shmobile_smp_get_core_count(void)
-
- static void __init shmobile_smp_prepare_cpus(void)
- {
-- if (machine_is_ag5evm())
-+ if (is_sh73a0())
- sh73a0_smp_prepare_cpus();
- }
-
-@@ -39,13 +41,13 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
- {
- trace_hardirqs_off();
-
-- if (machine_is_ag5evm())
-+ if (is_sh73a0())
- sh73a0_secondary_init(cpu);
- }
-
- int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
- {
-- if (machine_is_ag5evm())
-+ if (is_sh73a0())
- return sh73a0_boot_secondary(cpu);
-
- return -ENOSYS;
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0195-ARM-mach-shmobile-kzm9g-add-LCDC-support.patch b/patches.kzm9g/0195-ARM-mach-shmobile-kzm9g-add-LCDC-support.patch
deleted file mode 100644
index 35748e50b4e097..00000000000000
--- a/patches.kzm9g/0195-ARM-mach-shmobile-kzm9g-add-LCDC-support.patch
+++ /dev/null
@@ -1,204 +0,0 @@
-From 769707e6bbe540cf277c165031d34f12fdd38f13 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 10 Apr 2012 20:58:33 -0700
-Subject: ARM: mach-shmobile: kzm9g: add LCDC support
-
-AS3711 chip initalization is required for enabling LCDC backlight,
-but there is no driver for this chip.
-So, this patch sends its settings when boot.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kzm9g.c
-
-N.B: Not present in mainline yet
-
-Signed-off-by; Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 144 +++++++++++++++++++++++++++++++++++
- 1 file changed, 144 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index a7f05f6..3e3da46 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -16,20 +16,133 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-+
-+#include <linux/delay.h>
- #include <linux/gpio.h>
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/platform_device.h>
-+#include <linux/videodev2.h>
-+#include <mach/irqs.h>
- #include <mach/sh73a0.h>
- #include <mach/common.h>
- #include <asm/hardware/cache-l2x0.h>
- #include <asm/hardware/gic.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
-+#include <video/sh_mobile_lcdc.h>
-+
-+/* LCDC */
-+static struct fb_videomode kzm_lcdc_mode = {
-+ .name = "WVGA Panel",
-+ .xres = 800,
-+ .yres = 480,
-+ .left_margin = 220,
-+ .right_margin = 110,
-+ .hsync_len = 70,
-+ .upper_margin = 20,
-+ .lower_margin = 5,
-+ .vsync_len = 5,
-+ .sync = 0,
-+};
-+
-+static struct sh_mobile_lcdc_info lcdc_info = {
-+ .clock_source = LCDC_CLK_BUS,
-+ .ch[0] = {
-+ .chan = LCDC_CHAN_MAINLCD,
-+ .fourcc = V4L2_PIX_FMT_RGB565,
-+ .interface_type = RGB24,
-+ .lcd_modes = &kzm_lcdc_mode,
-+ .num_modes = 1,
-+ .clock_divider = 5,
-+ .flags = 0,
-+ .panel_cfg = {
-+ .width = 152,
-+ .height = 91,
-+ },
-+ }
-+};
-+
-+static struct resource lcdc_resources[] = {
-+ [0] = {
-+ .name = "LCDC",
-+ .start = 0xfe940000,
-+ .end = 0xfe943fff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = intcs_evt2irq(0x580),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device lcdc_device = {
-+ .name = "sh_mobile_lcdc_fb",
-+ .num_resources = ARRAY_SIZE(lcdc_resources),
-+ .resource = lcdc_resources,
-+ .dev = {
-+ .platform_data = &lcdc_info,
-+ .coherent_dma_mask = ~0,
-+ },
-+};
-
- static struct platform_device *kzm_devices[] __initdata = {
-+ &lcdc_device,
- };
-
-+/*
-+ * FIXME
-+ *
-+ * This is quick hack for enabling LCDC backlight
-+ */
-+static int __init as3711_enable_lcdc_backlight(void)
-+{
-+ struct i2c_adapter *a = i2c_get_adapter(0);
-+ struct i2c_msg msg;
-+ int i, ret;
-+ __u8 magic[] = {
-+ 0x40, 0x2a,
-+ 0x43, 0x3c,
-+ 0x44, 0x3c,
-+ 0x45, 0x3c,
-+ 0x54, 0x03,
-+ 0x51, 0x00,
-+ 0x51, 0x01,
-+ 0xff, 0x00, /* wait */
-+ 0x43, 0xf0,
-+ 0x44, 0xf0,
-+ 0x45, 0xf0,
-+ };
-+
-+ if (!machine_is_kzm9g())
-+ return 0;
-+
-+ if (!a)
-+ return 0;
-+
-+ msg.addr = 0x40;
-+ msg.len = 2;
-+ msg.flags = 0;
-+
-+ for (i = 0; i < ARRAY_SIZE(magic); i += 2) {
-+ msg.buf = magic + i;
-+
-+ if (0xff == msg.buf[0]) {
-+ udelay(500);
-+ continue;
-+ }
-+
-+ ret = i2c_transfer(a, &msg, 1);
-+ if (ret < 0) {
-+ pr_err("i2c transfer fail\n");
-+ break;
-+ }
-+ }
-+
-+ return 0;
-+}
-+device_initcall(as3711_enable_lcdc_backlight);
-+
- static void __init kzm_init(void)
- {
- sh73a0_pinmux_init();
-@@ -40,6 +153,37 @@ static void __init kzm_init(void)
- gpio_request(GPIO_FN_SCIFA4_RTS_, NULL);
- gpio_request(GPIO_FN_SCIFA4_CTS_, NULL);
-
-+ /* LCDC */
-+ gpio_request(GPIO_FN_LCDD23, NULL);
-+ gpio_request(GPIO_FN_LCDD22, NULL);
-+ gpio_request(GPIO_FN_LCDD21, NULL);
-+ gpio_request(GPIO_FN_LCDD20, NULL);
-+ gpio_request(GPIO_FN_LCDD19, NULL);
-+ gpio_request(GPIO_FN_LCDD18, NULL);
-+ gpio_request(GPIO_FN_LCDD17, NULL);
-+ gpio_request(GPIO_FN_LCDD16, NULL);
-+ gpio_request(GPIO_FN_LCDD15, NULL);
-+ gpio_request(GPIO_FN_LCDD14, NULL);
-+ gpio_request(GPIO_FN_LCDD13, NULL);
-+ gpio_request(GPIO_FN_LCDD12, NULL);
-+ gpio_request(GPIO_FN_LCDD11, NULL);
-+ gpio_request(GPIO_FN_LCDD10, NULL);
-+ gpio_request(GPIO_FN_LCDD9, NULL);
-+ gpio_request(GPIO_FN_LCDD8, NULL);
-+ gpio_request(GPIO_FN_LCDD7, NULL);
-+ gpio_request(GPIO_FN_LCDD6, NULL);
-+ gpio_request(GPIO_FN_LCDD5, NULL);
-+ gpio_request(GPIO_FN_LCDD4, NULL);
-+ gpio_request(GPIO_FN_LCDD3, NULL);
-+ gpio_request(GPIO_FN_LCDD2, NULL);
-+ gpio_request(GPIO_FN_LCDD1, NULL);
-+ gpio_request(GPIO_FN_LCDD0, NULL);
-+ gpio_request(GPIO_FN_LCDDISP, NULL);
-+ gpio_request(GPIO_FN_LCDDCK, NULL);
-+
-+ gpio_request(GPIO_PORT222, NULL);
-+ gpio_direction_output(GPIO_PORT222, 1);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0196-ARM-mach-shmobile-kzm9g-add-ST1232-Touchscreen-suppo.patch b/patches.kzm9g/0196-ARM-mach-shmobile-kzm9g-add-ST1232-Touchscreen-suppo.patch
deleted file mode 100644
index a01de3958ec6f4..00000000000000
--- a/patches.kzm9g/0196-ARM-mach-shmobile-kzm9g-add-ST1232-Touchscreen-suppo.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From ce9a312895c8fb5fc0115d5ed5f4434382d4ed8c Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Tue, 10 Apr 2012 20:58:45 -0700
-Subject: ARM: mach-shmobile: kzm9g: add ST1232 Touchscreen support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 3ab21c0e494efe064b425d48ac985cde5ee7f84b)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index 3e3da46..f6a0b4f 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -21,6 +21,7 @@
- #include <linux/gpio.h>
- #include <linux/io.h>
- #include <linux/irq.h>
-+#include <linux/i2c.h>
- #include <linux/platform_device.h>
- #include <linux/videodev2.h>
- #include <mach/irqs.h>
-@@ -86,6 +87,13 @@ static struct platform_device lcdc_device = {
- },
- };
-
-+static struct i2c_board_info i2c1_devices[] = {
-+ {
-+ I2C_BOARD_INFO("st1232-ts", 0x55),
-+ .irq = intcs_evt2irq(0x300), /* IRQ8 */
-+ },
-+};
-+
- static struct platform_device *kzm_devices[] __initdata = {
- &lcdc_device,
- };
-@@ -184,11 +192,17 @@ static void __init kzm_init(void)
- gpio_request(GPIO_PORT222, NULL);
- gpio_direction_output(GPIO_PORT222, 1);
-
-+ /* Touchscreen */
-+ gpio_request(GPIO_PORT223, NULL); /* IRQ8 */
-+ gpio_direction_input(GPIO_PORT223);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
- #endif
-
-+ i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
-+
- sh73a0_add_standard_devices();
- platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
- }
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0197-ARM-mach-shmobile-pfc-sh73a0-fixup-MSEL2CR-MSEL18-fo.patch b/patches.kzm9g/0197-ARM-mach-shmobile-pfc-sh73a0-fixup-MSEL2CR-MSEL18-fo.patch
deleted file mode 100644
index 2c262cfbe501ab..00000000000000
--- a/patches.kzm9g/0197-ARM-mach-shmobile-pfc-sh73a0-fixup-MSEL2CR-MSEL18-fo.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 035b90a42dfd87de422594b3f28649d5d8473bbf Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:52:48 -0700
-Subject: ARM: mach-shmobile: pfc-sh73a0: fixup MSEL2CR MSEL18 for I2C-3
-
-MSEL2CR MSEL18 should be 1 if I2C-3
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0abfeea3f3664f55f21691ac37e9570a60733d4a)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/pfc-sh73a0.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
-index e05634c..4a547b8 100644
---- a/arch/arm/mach-shmobile/pfc-sh73a0.c
-+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
-@@ -829,14 +829,14 @@ static pinmux_enum_t pinmux_data[] = {
- PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0,
- MSEL2CR_MSEL16_1), \
- PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0,
-- MSEL2CR_MSEL18_0), \
-+ MSEL2CR_MSEL18_1), \
- PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \
- PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7),
- PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \
- PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0,
- MSEL2CR_MSEL16_1), \
- PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0,
-- MSEL2CR_MSEL18_0), \
-+ MSEL2CR_MSEL18_1), \
- PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7),
- PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \
- PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4),
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0198-ARM-mach-shmobile-sh73a0.h-add-GPIO_NR.patch b/patches.kzm9g/0198-ARM-mach-shmobile-sh73a0.h-add-GPIO_NR.patch
deleted file mode 100644
index 16e18fa18327ac..00000000000000
--- a/patches.kzm9g/0198-ARM-mach-shmobile-sh73a0.h-add-GPIO_NR.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 69ba92bca9d23c243e05e120711d7f08684b6ab6 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:53:07 -0700
-Subject: ARM: mach-shmobile: sh73a0.h: add GPIO_NR
-
-GPIO_NR is added in order to clarify end of GPIO array.
-We can add extra GPIO from it.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9f75dc78817e88353e37fab381b26e7e2d825f82)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/include/mach/sh73a0.h | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-index cad5757..ac75857 100644
---- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
-+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
-@@ -482,6 +482,9 @@ enum {
- GPIO_FN_FSIAILR_PU,
- GPIO_FN_FSIAIBT_PU,
- GPIO_FN_FSIAISLD_PU,
-+
-+ /* end of GPIO */
-+ GPIO_NR,
- };
-
- /* DMA slave IDs */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0199-ARM-mach-shmobile-kzm9g-correct-screen-direction.patch b/patches.kzm9g/0199-ARM-mach-shmobile-kzm9g-correct-screen-direction.patch
deleted file mode 100644
index 4fee96b17089ab..00000000000000
--- a/patches.kzm9g/0199-ARM-mach-shmobile-kzm9g-correct-screen-direction.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From d2ff6b7cebae68d0d9214c3da5494392fc7fca86 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:53:24 -0700
-Subject: ARM: mach-shmobile: kzm9g: correct screen direction
-
-The correct screen direction of KZM9G board needs
-PORT226/SC settings.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d0e0f1d0aa08fc01530ce48dce490a4401d35a5d)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index f6a0b4f..5674147 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -189,8 +189,10 @@ static void __init kzm_init(void)
- gpio_request(GPIO_FN_LCDDISP, NULL);
- gpio_request(GPIO_FN_LCDDCK, NULL);
-
-- gpio_request(GPIO_PORT222, NULL);
-+ gpio_request(GPIO_PORT222, NULL); /* LCDCDON */
-+ gpio_request(GPIO_PORT226, NULL); /* SC */
- gpio_direction_output(GPIO_PORT222, 1);
-+ gpio_direction_output(GPIO_PORT226, 1);
-
- /* Touchscreen */
- gpio_request(GPIO_PORT223, NULL); /* IRQ8 */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0200-ARM-mach-shmobile-kzm9g-add-MMCIF-support.patch b/patches.kzm9g/0200-ARM-mach-shmobile-kzm9g-add-MMCIF-support.patch
deleted file mode 100644
index 9537d6f6f2dddc..00000000000000
--- a/patches.kzm9g/0200-ARM-mach-shmobile-kzm9g-add-MMCIF-support.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 29e424292a84c4db615e64beff9ed6ee66b11ca5 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:53:40 -0700
-Subject: ARM: mach-shmobile: kzm9g: add MMCIF support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9cf94db3e4281bd6597d6bb585253106226882f3)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kzm9g.c
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 49 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 49 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index 5674147..5b486ae 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -22,6 +22,8 @@
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/i2c.h>
-+#include <linux/mmc/host.h>
-+#include <linux/mmc/sh_mmcif.h>
- #include <linux/platform_device.h>
- #include <linux/videodev2.h>
- #include <mach/irqs.h>
-@@ -87,6 +89,40 @@ static struct platform_device lcdc_device = {
- },
- };
-
-+/* MMCIF */
-+static struct resource sh_mmcif_resources[] = {
-+ [0] = {
-+ .name = "MMCIF",
-+ .start = 0xe6bd0000,
-+ .end = 0xe6bd00ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = gic_spi(141),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = gic_spi(140),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct sh_mmcif_plat_data sh_mmcif_platdata = {
-+ .ocr = MMC_VDD_165_195,
-+ .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
-+};
-+
-+static struct platform_device mmc_device = {
-+ .name = "sh_mmcif",
-+ .dev = {
-+ .dma_mask = NULL,
-+ .coherent_dma_mask = 0xffffffff,
-+ .platform_data = &sh_mmcif_platdata,
-+ },
-+ .num_resources = ARRAY_SIZE(sh_mmcif_resources),
-+ .resource = sh_mmcif_resources,
-+};
-+
- static struct i2c_board_info i2c1_devices[] = {
- {
- I2C_BOARD_INFO("st1232-ts", 0x55),
-@@ -96,6 +132,7 @@ static struct i2c_board_info i2c1_devices[] = {
-
- static struct platform_device *kzm_devices[] __initdata = {
- &lcdc_device,
-+ &mmc_device,
- };
-
- /*
-@@ -198,6 +235,18 @@ static void __init kzm_init(void)
- gpio_request(GPIO_PORT223, NULL); /* IRQ8 */
- gpio_direction_input(GPIO_PORT223);
-
-+ /* enable MMCIF */
-+ gpio_request(GPIO_FN_MMCCLK0, NULL);
-+ gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
-+ gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0201-ARM-mach-shmobile-kzm9g-add-SDHI-support.patch b/patches.kzm9g/0201-ARM-mach-shmobile-kzm9g-add-SDHI-support.patch
deleted file mode 100644
index 07c931e3a0a8e0..00000000000000
--- a/patches.kzm9g/0201-ARM-mach-shmobile-kzm9g-add-SDHI-support.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 27b7da290bfcf60ddaac4156bebd710b96cfdcc0 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:53:59 -0700
-Subject: ARM: mach-shmobile: kzm9g: add SDHI support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d80a008054f895469e955975740bf07751c1449f)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 57 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 57 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index 5b486ae..a964e56 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -24,6 +24,8 @@
- #include <linux/i2c.h>
- #include <linux/mmc/host.h>
- #include <linux/mmc/sh_mmcif.h>
-+#include <linux/mmc/sh_mobile_sdhi.h>
-+#include <linux/mfd/tmio.h>
- #include <linux/platform_device.h>
- #include <linux/videodev2.h>
- #include <mach/irqs.h>
-@@ -123,6 +125,47 @@ static struct platform_device mmc_device = {
- .resource = sh_mmcif_resources,
- };
-
-+/* SDHI */
-+static struct sh_mobile_sdhi_info sdhi0_info = {
-+ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
-+ .tmio_caps = MMC_CAP_SD_HIGHSPEED,
-+ .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
-+};
-+
-+static struct resource sdhi0_resources[] = {
-+ [0] = {
-+ .name = "SDHI0",
-+ .start = 0xee100000,
-+ .end = 0xee1000ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
-+ .start = gic_spi(83),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .name = SH_MOBILE_SDHI_IRQ_SDCARD,
-+ .start = gic_spi(84),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .name = SH_MOBILE_SDHI_IRQ_SDIO,
-+ .start = gic_spi(85),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device sdhi0_device = {
-+ .name = "sh_mobile_sdhi",
-+ .num_resources = ARRAY_SIZE(sdhi0_resources),
-+ .resource = sdhi0_resources,
-+ .dev = {
-+ .platform_data = &sdhi0_info,
-+ },
-+};
-+
-+/* I2C */
- static struct i2c_board_info i2c1_devices[] = {
- {
- I2C_BOARD_INFO("st1232-ts", 0x55),
-@@ -133,6 +176,7 @@ static struct i2c_board_info i2c1_devices[] = {
- static struct platform_device *kzm_devices[] __initdata = {
- &lcdc_device,
- &mmc_device,
-+ &sdhi0_device,
- };
-
- /*
-@@ -247,6 +291,19 @@ static void __init kzm_init(void)
- gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
- gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
-
-+ /* enable SD */
-+ gpio_request(GPIO_FN_SDHIWP0, NULL);
-+ gpio_request(GPIO_FN_SDHICD0, NULL);
-+ gpio_request(GPIO_FN_SDHICMD0, NULL);
-+ gpio_request(GPIO_FN_SDHICLK0, NULL);
-+ gpio_request(GPIO_FN_SDHID0_3, NULL);
-+ gpio_request(GPIO_FN_SDHID0_2, NULL);
-+ gpio_request(GPIO_FN_SDHID0_1, NULL);
-+ gpio_request(GPIO_FN_SDHID0_0, NULL);
-+ gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
-+ gpio_request(GPIO_PORT15, NULL);
-+ gpio_direction_output(GPIO_PORT15, 1); /* power */
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0202-ARM-mach-shmobile-kzm9g-add-PCF8757-gpio-key.patch b/patches.kzm9g/0202-ARM-mach-shmobile-kzm9g-add-PCF8757-gpio-key.patch
deleted file mode 100644
index 5f9909fbcc14c3..00000000000000
--- a/patches.kzm9g/0202-ARM-mach-shmobile-kzm9g-add-PCF8757-gpio-key.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From f1f2cdcdd22c1c750f6cee76e6af0ce531fa5b21 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Sun, 22 Apr 2012 23:54:14 -0700
-Subject: ARM: mach-shmobile: kzm9g: add PCF8757 gpio-key
-
-This patch adds extra GPIO via PCF8757 chip,
-and use it as gpio-key.
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d5fbabd3d5ab8c06d4f576efb63cd2af65a729ae)
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kzm9g.c
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/board-kzm9g.c | 59 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 59 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index a964e56..7289ed5 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -19,9 +19,12 @@
-
- #include <linux/delay.h>
- #include <linux/gpio.h>
-+#include <linux/gpio_keys.h>
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/i2c.h>
-+#include <linux/i2c/pcf857x.h>
-+#include <linux/input.h>
- #include <linux/mmc/host.h>
- #include <linux/mmc/sh_mmcif.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
-@@ -37,6 +40,18 @@
- #include <asm/mach/arch.h>
- #include <video/sh_mobile_lcdc.h>
-
-+/*
-+ * external GPIO
-+ */
-+#define GPIO_PCF8575_BASE (GPIO_NR)
-+#define GPIO_PCF8575_PORT10 (GPIO_NR + 8)
-+#define GPIO_PCF8575_PORT11 (GPIO_NR + 9)
-+#define GPIO_PCF8575_PORT12 (GPIO_NR + 10)
-+#define GPIO_PCF8575_PORT13 (GPIO_NR + 11)
-+#define GPIO_PCF8575_PORT14 (GPIO_NR + 12)
-+#define GPIO_PCF8575_PORT15 (GPIO_NR + 13)
-+#define GPIO_PCF8575_PORT16 (GPIO_NR + 14)
-+
- /* LCDC */
- static struct fb_videomode kzm_lcdc_mode = {
- .name = "WVGA Panel",
-@@ -165,7 +180,38 @@ static struct platform_device sdhi0_device = {
- },
- };
-
-+/* KEY */
-+#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
-+
-+static struct gpio_keys_button gpio_buttons[] = {
-+ GPIO_KEY(KEY_BACK, GPIO_PCF8575_PORT10, "SW3"),
-+ GPIO_KEY(KEY_RIGHT, GPIO_PCF8575_PORT11, "SW2-R"),
-+ GPIO_KEY(KEY_LEFT, GPIO_PCF8575_PORT12, "SW2-L"),
-+ GPIO_KEY(KEY_ENTER, GPIO_PCF8575_PORT13, "SW2-P"),
-+ GPIO_KEY(KEY_UP, GPIO_PCF8575_PORT14, "SW2-U"),
-+ GPIO_KEY(KEY_DOWN, GPIO_PCF8575_PORT15, "SW2-D"),
-+ GPIO_KEY(KEY_HOME, GPIO_PCF8575_PORT16, "SW1"),
-+};
-+
-+static struct gpio_keys_platform_data gpio_key_info = {
-+ .buttons = gpio_buttons,
-+ .nbuttons = ARRAY_SIZE(gpio_buttons),
-+ .poll_interval = 250, /* poling at this point */
-+};
-+
-+static struct platform_device gpio_keys_device = {
-+ /* gpio-pcf857x.c driver doesn't support gpio_to_irq() */
-+ .name = "gpio-keys-polled",
-+ .dev = {
-+ .platform_data = &gpio_key_info,
-+ },
-+};
-+
- /* I2C */
-+static struct pcf857x_platform_data pcf8575_pdata = {
-+ .gpio_base = GPIO_PCF8575_BASE,
-+};
-+
- static struct i2c_board_info i2c1_devices[] = {
- {
- I2C_BOARD_INFO("st1232-ts", 0x55),
-@@ -173,10 +219,18 @@ static struct i2c_board_info i2c1_devices[] = {
- },
- };
-
-+static struct i2c_board_info i2c3_devices[] = {
-+ {
-+ I2C_BOARD_INFO("pcf8575", 0x20),
-+ .platform_data = &pcf8575_pdata,
-+ },
-+};
-+
- static struct platform_device *kzm_devices[] __initdata = {
- &lcdc_device,
- &mmc_device,
- &sdhi0_device,
-+ &gpio_keys_device,
- };
-
- /*
-@@ -304,12 +358,17 @@ static void __init kzm_init(void)
- gpio_request(GPIO_PORT15, NULL);
- gpio_direction_output(GPIO_PORT15, 1); /* power */
-
-+ /* I2C 3 */
-+ gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
-+ gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
- #endif
-
- i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
-+ i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));
-
- sh73a0_add_standard_devices();
- platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0203-ARM-mach-shmobile-kzm9g-defconfig-update.patch b/patches.kzm9g/0203-ARM-mach-shmobile-kzm9g-defconfig-update.patch
deleted file mode 100644
index 1ccf5bdd609a8c..00000000000000
--- a/patches.kzm9g/0203-ARM-mach-shmobile-kzm9g-defconfig-update.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 68fa5ce1e0101a7d9d78d485dd3245b583ef88f6 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 25 Apr 2012 20:58:06 -0700
-Subject: ARM: mach-shmobile: kzm9g: defconfig update
-
-This patch enable GPIO-KEY/FSI,
-and remove debug settings,
-and be cleanuped by c2330e286f68f1c408b4aa6515ba49d57f05beae script
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Simon Horman <horms@verge.net.au>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit cc2504524b5b14dc03682dc1f04fb1644f692767)
-
-N.B: Not present in mainline yet
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/configs/kzm9g_defconfig | 24 +++++++++++++++++-------
- 1 file changed, 17 insertions(+), 7 deletions(-)
-
-diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
-index de8712b..e3ebc20 100644
---- a/arch/arm/configs/kzm9g_defconfig
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -22,6 +22,7 @@ CONFIG_MODULE_UNLOAD=y
- # CONFIG_IOSCHED_DEADLINE is not set
- # CONFIG_IOSCHED_CFQ is not set
- CONFIG_ARCH_SHMOBILE=y
-+CONFIG_KEYBOARD_GPIO_POLLED=y
- CONFIG_ARCH_SH73A0=y
- CONFIG_MACH_KZM9G=y
- CONFIG_MEMORY_START=0x41000000
-@@ -69,8 +70,6 @@ CONFIG_INPUT_SPARSEKMAP=y
- # CONFIG_INPUT_MOUSEDEV is not set
- CONFIG_INPUT_EVDEV=y
- # CONFIG_KEYBOARD_ATKBD is not set
--CONFIG_KEYBOARD_GPIO=y
--CONFIG_KEYBOARD_SH_KEYSC=y
- # CONFIG_INPUT_MOUSE is not set
- CONFIG_INPUT_TOUCHSCREEN=y
- CONFIG_TOUCHSCREEN_ST1232=y
-@@ -81,13 +80,22 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
- # CONFIG_HW_RANDOM is not set
- CONFIG_I2C_CHARDEV=y
- CONFIG_I2C_SH_MOBILE=y
--CONFIG_POWER_SUPPLY=y
-+CONFIG_GPIO_PCF857X=y
- # CONFIG_HWMON is not set
- CONFIG_FB=y
- CONFIG_FB_SH_MOBILE_LCDC=y
- CONFIG_FRAMEBUFFER_CONSOLE=y
- CONFIG_LOGO=y
- CONFIG_FB_SH_MOBILE_MERAM=y
-+CONFIG_SOUND=y
-+CONFIG_SND=y
-+# CONFIG_SND_SUPPORT_OLD_API is not set
-+# CONFIG_SND_VERBOSE_PROCFS is not set
-+# CONFIG_SND_DRIVERS is not set
-+# CONFIG_SND_ARM is not set
-+# CONFIG_SND_USB is not set
-+CONFIG_SND_SOC=y
-+CONFIG_SND_SOC_SH4_FSI=y
- # CONFIG_HID_SUPPORT is not set
- CONFIG_USB=y
- CONFIG_USB_DEVICEFS=y
-@@ -117,11 +125,13 @@ CONFIG_NFS_V4_1=y
- CONFIG_ROOT_NFS=y
- CONFIG_NLS_CODEPAGE_437=y
- CONFIG_NLS_ISO8859_1=y
--CONFIG_MAGIC_SYSRQ=y
--CONFIG_DETECT_HUNG_TASK=y
--CONFIG_DEBUG_INFO=y
-+# CONFIG_ENABLE_WARN_DEPRECATED is not set
-+# CONFIG_ENABLE_MUST_CHECK is not set
-+# CONFIG_SCHED_DEBUG is not set
-+# CONFIG_DEBUG_PREEMPT is not set
-+# CONFIG_DEBUG_BUGVERBOSE is not set
- # CONFIG_FTRACE is not set
--CONFIG_DEBUG_USER=y
-+# CONFIG_ARM_UNWIND is not set
- CONFIG_CRYPTO=y
- CONFIG_CRYPTO_CBC=y
- CONFIG_CRYPTO_MD5=y
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0204-ARM-mach-shmobile-clock-sh73a0-add-FSI-clock.patch b/patches.kzm9g/0204-ARM-mach-shmobile-clock-sh73a0-add-FSI-clock.patch
deleted file mode 100644
index 270f943c78bf72..00000000000000
--- a/patches.kzm9g/0204-ARM-mach-shmobile-clock-sh73a0-add-FSI-clock.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 390deea0373e34a3e2f85ca0917ebb7c595f84fb Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 Apr 2012 00:03:10 -0700
-Subject: ARM: mach-shmobile: clock-sh73a0: add FSI clock
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-N.B: Not present upstream
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 41f8293..012b284 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -476,7 +476,7 @@ enum { MSTP001,
- MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
- MSTP219,
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-- MSTP331, MSTP329, MSTP325, MSTP323, MSTP318,
-+ MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP318,
- MSTP314, MSTP313, MSTP312, MSTP311,
- MSTP303, MSTP302, MSTP301, MSTP300,
- MSTP411, MSTP410, MSTP403,
-@@ -505,6 +505,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
- [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
- [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
-+ [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/
- [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
- [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
- [MSTP318] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 18, 0), /* SY-DMAC */
-@@ -560,6 +561,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
- CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
- CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
-+ CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
- CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
- CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
- CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP318]), /* SY-DMAC */
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/0205-ARM-mach-shmobile-kzm9g-add-FSI-AK4648-support.patch b/patches.kzm9g/0205-ARM-mach-shmobile-kzm9g-add-FSI-AK4648-support.patch
deleted file mode 100644
index 6c75eb1ffbbb74..00000000000000
--- a/patches.kzm9g/0205-ARM-mach-shmobile-kzm9g-add-FSI-AK4648-support.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 850ebb2205ed29cae92c91419d06fb9e91a2cafa Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Mon, 23 Apr 2012 00:03:25 -0700
-Subject: ARM: mach-shmobile: kzm9g: add FSI-AK4648 support
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-Conflicts:
-
- arch/arm/mach-shmobile/board-kzm9g.c
-
-N.B: Not present upstream
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Kconfig | 1 +
- arch/arm/mach-shmobile/board-kzm9g.c | 79 ++++++++++++++++++++++++++++++++++++
- 2 files changed, 80 insertions(+)
-
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 23be741..9020c1b 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -85,6 +85,7 @@ config MACH_KZM9G
- bool "KZM-A9-GT board"
- depends on ARCH_SH73A0
- select ARCH_REQUIRE_GPIOLIB
-+ select SND_SOC_AK4642 if SND_SIMPLE_CARD
-
- comment "SH-Mobile System Configuration"
-
-diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
-index 7289ed5..855ae85 100644
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -31,6 +31,8 @@
- #include <linux/mfd/tmio.h>
- #include <linux/platform_device.h>
- #include <linux/videodev2.h>
-+#include <sound/sh_fsi.h>
-+#include <sound/simple_card.h>
- #include <mach/irqs.h>
- #include <mach/sh73a0.h>
- #include <mach/common.h>
-@@ -52,6 +54,14 @@
- #define GPIO_PCF8575_PORT15 (GPIO_NR + 13)
- #define GPIO_PCF8575_PORT16 (GPIO_NR + 14)
-
-+/*
-+ * FSI-AK4648
-+ *
-+ * this command is required when playback.
-+ *
-+ * # amixer set "LINEOUT Mixer DACL" on
-+ */
-+
- /* LCDC */
- static struct fb_videomode kzm_lcdc_mode = {
- .name = "WVGA Panel",
-@@ -207,11 +217,70 @@ static struct platform_device gpio_keys_device = {
- },
- };
-
-+/* FSI-AK4648 */
-+static struct sh_fsi_platform_info fsi_info = {
-+ .port_a = {
-+ },
-+};
-+
-+static struct resource fsi_resources[] = {
-+ [0] = {
-+ .name = "FSI",
-+ .start = 0xEC230000,
-+ .end = 0xEC230400 - 1,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = gic_spi(146),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device fsi_device = {
-+ .name = "sh_fsi2",
-+ .id = -1,
-+ .num_resources = ARRAY_SIZE(fsi_resources),
-+ .resource = fsi_resources,
-+ .dev = {
-+ .platform_data = &fsi_info,
-+ },
-+};
-+
-+static struct asoc_simple_dai_init_info fsi2_ak4648_init_info = {
-+ .fmt = SND_SOC_DAIFMT_LEFT_J,
-+ .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
-+ .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
-+ .sysclk = 11289600,
-+};
-+
-+static struct asoc_simple_card_info fsi2_ak4648_info = {
-+ .name = "AK4648",
-+ .card = "FSI2A-AK4648",
-+ .cpu_dai = "fsia-dai",
-+ .codec = "ak4642-codec.0-0012",
-+ .platform = "sh_fsi2",
-+ .codec_dai = "ak4642-hifi",
-+ .init = &fsi2_ak4648_init_info,
-+};
-+
-+static struct platform_device fsi_ak4648_device = {
-+ .name = "asoc-simple-card",
-+ .dev = {
-+ .platform_data = &fsi2_ak4648_info,
-+ },
-+};
-+
- /* I2C */
- static struct pcf857x_platform_data pcf8575_pdata = {
- .gpio_base = GPIO_PCF8575_BASE,
- };
-
-+static struct i2c_board_info i2c0_devices[] = {
-+ {
-+ I2C_BOARD_INFO("ak4648", 0x12),
-+ }
-+};
-+
- static struct i2c_board_info i2c1_devices[] = {
- {
- I2C_BOARD_INFO("st1232-ts", 0x55),
-@@ -231,6 +300,8 @@ static struct platform_device *kzm_devices[] __initdata = {
- &mmc_device,
- &sdhi0_device,
- &gpio_keys_device,
-+ &fsi_device,
-+ &fsi_ak4648_device,
- };
-
- /*
-@@ -362,11 +433,19 @@ static void __init kzm_init(void)
- gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
- gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL);
-
-+ /* enable FSI2 port A (ak4648) */
-+ gpio_request(GPIO_FN_FSIACK, NULL);
-+ gpio_request(GPIO_FN_FSIAILR, NULL);
-+ gpio_request(GPIO_FN_FSIAIBT, NULL);
-+ gpio_request(GPIO_FN_FSIAISLD, NULL);
-+ gpio_request(GPIO_FN_FSIAOSLD, NULL);
-+
- #ifdef CONFIG_CACHE_L2X0
- /* Early BRESP enable, Shared attribute override enable, 64K*8way */
- l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
- #endif
-
-+ i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
- i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
- i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));
-
---
-1.7.10.2.565.gbd578b5
-
diff --git a/patches.kzm9g/arm-mach-shmobile-kzm9d-add-defconfig.patch b/patches.kzm9g/arm-mach-shmobile-kzm9d-add-defconfig.patch
deleted file mode 100644
index e7452c7b56b98b..00000000000000
--- a/patches.kzm9g/arm-mach-shmobile-kzm9d-add-defconfig.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Fri Jul 6 03:28:47 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 6 Jul 2012 19:28:30 +0900
-Subject: ARM: mach-shmobile: kzm9d: Add defconfig
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Message-ID: <1341570511-15470-2-git-send-email-horms@verge.net.au>
-
-
-From: Magnus Damm <damm@opensource.se>
-
-Original work by Magnus Damm, tested and tweaked by Simon Horman
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
-N.B: Not present upstream yet
----
- arch/arm/configs/kzm9d_defconfig | 89 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 89 insertions(+)
- create mode 100644 arch/arm/configs/kzm9d_defconfig
-
---- /dev/null
-+++ b/arch/arm/configs/kzm9d_defconfig
-@@ -0,0 +1,89 @@
-+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
-+CONFIG_EXPERIMENTAL=y
-+CONFIG_SYSVIPC=y
-+CONFIG_NO_HZ=y
-+CONFIG_IKCONFIG=y
-+CONFIG_IKCONFIG_PROC=y
-+CONFIG_LOG_BUF_SHIFT=16
-+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-+CONFIG_SYSCTL_SYSCALL=y
-+CONFIG_EMBEDDED=y
-+CONFIG_SLAB=y
-+# CONFIG_BLK_DEV_BSG is not set
-+# CONFIG_IOSCHED_DEADLINE is not set
-+# CONFIG_IOSCHED_CFQ is not set
-+CONFIG_ARCH_SHMOBILE=y
-+CONFIG_ARCH_EMEV2=y
-+CONFIG_MACH_KZM9D=y
-+CONFIG_MEMORY_START=0x40000000
-+CONFIG_MEMORY_SIZE=0x10000000
-+# CONFIG_SH_TIMER_TMU is not set
-+# CONFIG_SWP_EMULATE is not set
-+# CONFIG_CACHE_L2X0 is not set
-+CONFIG_SMP=y
-+CONFIG_NR_CPUS=2
-+CONFIG_HOTPLUG_CPU=y
-+# CONFIG_LOCAL_TIMERS is not set
-+CONFIG_AEABI=y
-+# CONFIG_OABI_COMPAT is not set
-+# CONFIG_CROSS_MEMORY_ATTACH is not set
-+CONFIG_FORCE_MAX_ZONEORDER=13
-+CONFIG_ZBOOT_ROM_TEXT=0x0
-+CONFIG_ZBOOT_ROM_BSS=0x0
-+CONFIG_ARM_APPENDED_DTB=y
-+CONFIG_CMDLINE="console=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M@0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
-+CONFIG_CMDLINE_FORCE=y
-+CONFIG_VFP=y
-+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-+# CONFIG_SUSPEND is not set
-+CONFIG_NET=y
-+CONFIG_PACKET=y
-+CONFIG_UNIX=y
-+CONFIG_INET=y
-+CONFIG_IP_PNP=y
-+CONFIG_IP_PNP_DHCP=y
-+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-+# CONFIG_INET_XFRM_MODE_BEET is not set
-+# CONFIG_INET_LRO is not set
-+# CONFIG_INET_DIAG is not set
-+# CONFIG_IPV6 is not set
-+# CONFIG_WIRELESS is not set
-+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-+# CONFIG_BLK_DEV is not set
-+CONFIG_NETDEVICES=y
-+# CONFIG_NET_VENDOR_BROADCOM is not set
-+# CONFIG_NET_VENDOR_CHELSIO is not set
-+# CONFIG_NET_VENDOR_CIRRUS is not set
-+# CONFIG_NET_VENDOR_FARADAY is not set
-+# CONFIG_NET_VENDOR_INTEL is not set
-+# CONFIG_NET_VENDOR_MARVELL is not set
-+# CONFIG_NET_VENDOR_MICREL is not set
-+# CONFIG_NET_VENDOR_NATSEMI is not set
-+# CONFIG_NET_VENDOR_SEEQ is not set
-+CONFIG_SMSC911X=y
-+# CONFIG_NET_VENDOR_STMICRO is not set
-+# CONFIG_NET_VENDOR_WIZNET is not set
-+# CONFIG_WLAN is not set
-+# CONFIG_INPUT_MOUSEDEV is not set
-+# CONFIG_INPUT_KEYBOARD is not set
-+# CONFIG_INPUT_MOUSE is not set
-+# CONFIG_SERIO is not set
-+# CONFIG_LEGACY_PTYS is not set
-+# CONFIG_DEVKMEM is not set
-+CONFIG_SERIAL_8250=y
-+CONFIG_SERIAL_8250_CONSOLE=y
-+CONFIG_SERIAL_8250_EM=y
-+# CONFIG_HW_RANDOM is not set
-+CONFIG_GPIOLIB=y
-+CONFIG_GPIO_EM=y
-+# CONFIG_HWMON is not set
-+# CONFIG_HID_SUPPORT is not set
-+# CONFIG_USB_SUPPORT is not set
-+# CONFIG_IOMMU_SUPPORT is not set
-+# CONFIG_DNOTIFY is not set
-+CONFIG_TMPFS=y
-+# CONFIG_MISC_FILESYSTEMS is not set
-+CONFIG_NFS_FS=y
-+CONFIG_ROOT_NFS=y
-+# CONFIG_FTRACE is not set
diff --git a/patches.kzm9g/arm-mach-shmobile-kzm9d-defconfig-enable-net_ethernet.patch b/patches.kzm9g/arm-mach-shmobile-kzm9d-defconfig-enable-net_ethernet.patch
deleted file mode 100644
index dcd7c219d8c4ac..00000000000000
--- a/patches.kzm9g/arm-mach-shmobile-kzm9d-defconfig-enable-net_ethernet.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Fri Jul 6 03:28:44 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 6 Jul 2012 19:28:31 +0900
-Subject: ARM: mach-shmobile: kzm9d: defconfig enable NET_ETHERNET
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Message-ID: <1341570511-15470-3-git-send-email-horms@verge.net.au>
-
-
-Enable NET_ETHERNET which will allow the SMSC911x/921x ethernet driver to
-be compiled.
-
-N.B: Not present or necessary upstream
-N.B: Already present in LTSI
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/configs/kzm9d_defconfig | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/arm/configs/kzm9d_defconfig
-+++ b/arch/arm/configs/kzm9d_defconfig
-@@ -52,6 +52,7 @@ CONFIG_IP_PNP_DHCP=y
- CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
- # CONFIG_BLK_DEV is not set
- CONFIG_NETDEVICES=y
-+CONFIG_NET_ETHERNET=y
- # CONFIG_NET_VENDOR_BROADCOM is not set
- # CONFIG_NET_VENDOR_CHELSIO is not set
- # CONFIG_NET_VENDOR_CIRRUS is not set
diff --git a/patches.kzm9g/arm-shmobile-sh73a0-bugfix-sy-dmac-number.patch b/patches.kzm9g/arm-shmobile-sh73a0-bugfix-sy-dmac-number.patch
deleted file mode 100644
index 771486ee8fb98a..00000000000000
--- a/patches.kzm9g/arm-shmobile-sh73a0-bugfix-sy-dmac-number.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From horms@vergenet.net Thu Jun 21 17:52:36 2012
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 22 Jun 2012 09:51:53 +0900
-Subject: [PATCH] ARM: shmobile: sh73a0: bugfix: SY-DMAC number
-To: ltsi-dev@lists.linuxfoundation.org
-Cc: Greg KH <gregkh@linuxfoundation.org>
-Message-ID: <1340326313-1672-1-git-send-email-horms@verge.net.au>
-
-
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-
-681e1b3eeb3606e06a7c4984e8058df84296f8bb
-(ARM: mach-shmobile: sh73a0 DMA Engine support for SY-DMAC)
-adds SY-DMAC, but it is 218, not 318
-
-This patch is based on v2.0 manual
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Acked-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 32103c7ba7d274bcb3ace48bc3366e1df37ebb56)
-
-Conflicts:
- arch/arm/mach-shmobile/clock-sh73a0.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
-
----
-
-Greg, this is a bugfix for the sh73a0 and thus my work on the KZM9G
-(not the D!) board.
----
- arch/arm/mach-shmobile/clock-sh73a0.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
-index 012b284..a7ae9c3 100644
---- a/arch/arm/mach-shmobile/clock-sh73a0.c
-+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
-@@ -474,9 +474,9 @@ static struct clk *late_main_clks[] = {
-
- enum { MSTP001,
- MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
-- MSTP219,
-+ MSTP219, MSTP218,
- MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-- MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP318,
-+ MSTP331, MSTP329, MSTP328, MSTP325, MSTP323,
- MSTP314, MSTP313, MSTP312, MSTP311,
- MSTP303, MSTP302, MSTP301, MSTP300,
- MSTP411, MSTP410, MSTP403,
-@@ -496,6 +496,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */
- [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
- [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */
-+ [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* SY-DMAC */
- [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
- [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
- [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
-@@ -508,7 +509,6 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/
- [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
- [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
-- [MSTP318] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 18, 0), /* SY-DMAC */
- [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */
- [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */
- [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
-@@ -552,6 +552,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
- CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
- CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
-+ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */
- CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
- CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
- CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
-@@ -564,7 +565,6 @@ static struct clk_lookup lookups[] = {
- CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
- CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
- CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
-- CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP318]), /* SY-DMAC */
- CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
- CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
- CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
---
-1.7.10.2.484.gcd07cc5
-
diff --git a/patches.kzm9g/ltsi-arm-shmobile-kzm9g-support-real-time-clock.patch b/patches.kzm9g/ltsi-arm-shmobile-kzm9g-support-real-time-clock.patch
deleted file mode 100644
index fd8fbdfe6d2a50..00000000000000
--- a/patches.kzm9g/ltsi-arm-shmobile-kzm9g-support-real-time-clock.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon Jun 18 04:06:00 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Mon, 18 Jun 2012 20:06:02 +0900
-Subject: LTSI: ARM: shmobile: kzm9g: Support Real Time Clock
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FDF0B9A.6030404@kmckk.co.jp>
-
-
-KZM-A9-GT board has RTC device r2025d at I2C channel 0
-with slave address 0x64.
-
-This patch enables reading and writing hardware real time clock on
-KZM-A9-GT board. Interrupt is not yet supported.
-
-How to test this patch using user space command.
-
-Read RTC
- # hwclock -r
-
-Copy system clock to RTC
- # hwclock -w
-
-Shutdown and power off the board, and wait a while, then power on again.
-Check RTC still keeps correct date.
-
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/configs/kzm9g_defconfig | 1 +
- arch/arm/mach-shmobile/board-kzm9g.c | 3 +++
- 2 files changed, 4 insertions(+)
-
---- a/arch/arm/configs/kzm9g_defconfig
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -108,6 +108,7 @@ CONFIG_MMC_SH_MMCIF=y
- CONFIG_NEW_LEDS=y
- CONFIG_LEDS_CLASS=y
- CONFIG_RTC_CLASS=y
-+CONFIG_RTC_DRV_RS5C372=y
- CONFIG_DMADEVICES=y
- CONFIG_SH_DMAE=y
- CONFIG_ASYNC_TX_DMA=y
---- a/arch/arm/mach-shmobile/board-kzm9g.c
-+++ b/arch/arm/mach-shmobile/board-kzm9g.c
-@@ -278,6 +278,9 @@ static struct pcf857x_platform_data pcf8
- static struct i2c_board_info i2c0_devices[] = {
- {
- I2C_BOARD_INFO("ak4648", 0x12),
-+ },
-+ {
-+ I2C_BOARD_INFO("r2025sd", 0x32),
- }
- };
-
diff --git a/patches.kzm9g/ltsi-bugfix-add-config_i2c-to-kzm9g_defconfig.patch b/patches.kzm9g/ltsi-bugfix-add-config_i2c-to-kzm9g_defconfig.patch
deleted file mode 100644
index 35557987dff9ce..00000000000000
--- a/patches.kzm9g/ltsi-bugfix-add-config_i2c-to-kzm9g_defconfig.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon Jun 18 02:55:43 2012
-From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
-Date: Mon, 18 Jun 2012 18:55:45 +0900
-Subject: LTSI: bugfix: add CONFIG_I2C to kzm9g_defconfig
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FDEFB21.1090608@kmckk.co.jp>
-
-
-
-Build fails for kzm9g because CONFIG_I2C=y is missing in kzm9g_defconfig.
-
-$ make kzm9g_defconfig
-$ make
-
- ...
-
- CC arch/arm/mach-shmobile/board-kzm9g.o
-arch/arm/mach-shmobile/board-kzm9g.c: In function 'as3711_enable_lcdc_backlight':
-arch/arm/mach-shmobile/board-kzm9g.c:314:9: error: implicit declaration of function 'i2c_get_adapter' [-Werror=implicit-function-declaration]
-arch/arm/mach-shmobile/board-kzm9g.c:314:26: warning: initialization makes pointer from integer without a cast [enabled by default]
-arch/arm/mach-shmobile/board-kzm9g.c:349:3: error: implicit declaration of function 'i2c_transfer' [-Werror=implicit-function-declaration]
-cc1: some warnings being treated as errors
-make[1]: *** [arch/arm/mach-shmobile/board-kzm9g.o] Error 1
-make: *** [arch/arm/mach-shmobile] Error 2
-
-This patch solves this problem.
-
-Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
----
- arch/arm/configs/kzm9g_defconfig | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
-index e3ebc20..ff7b698 100644
---- a/arch/arm/configs/kzm9g_defconfig
-+++ b/arch/arm/configs/kzm9g_defconfig
-@@ -78,6 +78,7 @@ CONFIG_SERIAL_SH_SCI=y
- CONFIG_SERIAL_SH_SCI_NR_UARTS=9
- CONFIG_SERIAL_SH_SCI_CONSOLE=y
- # CONFIG_HW_RANDOM is not set
-+CONFIG_I2C=y
- CONFIG_I2C_CHARDEV=y
- CONFIG_I2C_SH_MOBILE=y
- CONFIG_GPIO_PCF857X=y
---
-1.7.9.5
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.kzm9g/of-address-add-of_find_matching_node_by_address-helper.patch b/patches.kzm9g/of-address-add-of_find_matching_node_by_address-helper.patch
deleted file mode 100644
index 3b44383d869a99..00000000000000
--- a/patches.kzm9g/of-address-add-of_find_matching_node_by_address-helper.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Grant Likely <grant.likely@secretlab.ca>
-Subject: of/address: Add of_find_matching_node_by_address helper
-
-of_find_matching_node_by_address() can be used to find a device tree
-node for a device at a specific address.
-
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 90e33f62e027d330485d03598e1b2d8db3ff031c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/of/address.c | 18 ++++++++++++++++++
- include/linux/of_address.h | 4 ++++
- 2 files changed, 22 insertions(+)
-
-diff --git a/drivers/of/address.c b/drivers/of/address.c
-index b4559c5..da1f4b9 100644
---- a/drivers/of/address.c
-+++ b/drivers/of/address.c
-@@ -577,6 +577,24 @@ int of_address_to_resource(struct device_node *dev, int index,
- }
- EXPORT_SYMBOL_GPL(of_address_to_resource);
-
-+struct device_node *of_find_matching_node_by_address(struct device_node *from,
-+ const struct of_device_id *matches,
-+ u64 base_address)
-+{
-+ struct device_node *dn = of_find_matching_node(from, matches);
-+ struct resource res;
-+
-+ while (dn) {
-+ if (of_address_to_resource(dn, 0, &res))
-+ continue;
-+ if (res.start == base_address)
-+ return dn;
-+ dn = of_find_matching_node(dn, matches);
-+ }
-+
-+ return NULL;
-+}
-+
-
- /**
- * of_iomap - Maps the memory mapped IO for a given device_node
-diff --git a/include/linux/of_address.h b/include/linux/of_address.h
-index 2feda6ee..bdfc20d 100644
---- a/include/linux/of_address.h
-+++ b/include/linux/of_address.h
-@@ -6,6 +6,10 @@
- extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
- extern int of_address_to_resource(struct device_node *dev, int index,
- struct resource *r);
-+extern struct device_node *of_find_matching_node_by_address(
-+ struct device_node *from,
-+ const struct of_device_id *matches,
-+ u64 base_address);
- extern void __iomem *of_iomap(struct device_node *device, int index);
-
- /* Extract an address from a device, returns the region size and
---
-1.7.10.2.484.gcd07cc5
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
diff --git a/patches.ltsi/ltsi-makefile-addition.patch b/patches.ltsi/ltsi-makefile-addition.patch
index c7db1e56b253f4..9375db7226b67a 100644
--- a/patches.ltsi/ltsi-makefile-addition.patch
+++ b/patches.ltsi/ltsi-makefile-addition.patch
@@ -17,10 +17,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 3
- PATCHLEVEL = 0
- SUBLEVEL = 38
+ PATCHLEVEL = 4
+ SUBLEVEL = 11
-EXTRAVERSION =
+EXTRAVERSION = -ltsi
- NAME = Sneaky Weasel
+ NAME = Saber-toothed Squirrel
# *DOCUMENTATION*
diff --git a/patches.lttng/0018-staging-add-LTTng-to-build.patch b/patches.lttng/0018-staging-add-LTTng-to-build.patch
index 11da1a29e36cde..085e790e148ed3 100644
--- a/patches.lttng/0018-staging-add-LTTng-to-build.patch
+++ b/patches.lttng/0018-staging-add-LTTng-to-build.patch
@@ -12,19 +12,19 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
-@@ -78,6 +78,8 @@ source "drivers/staging/line6/Kconfig"
+@@ -64,6 +64,8 @@ source "drivers/staging/phison/Kconfig"
- source "drivers/gpu/drm/vmwgfx/Kconfig"
+ source "drivers/staging/line6/Kconfig"
+source "drivers/staging/lttng/Kconfig"
+
- source "drivers/gpu/drm/nouveau/Kconfig"
-
source "drivers/staging/octeon/Kconfig"
+
+ source "drivers/staging/serqt_usb2/Kconfig"
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
-@@ -32,6 +32,7 @@ obj-$(CONFIG_TRANZPORT) += frontier/
- obj-$(CONFIG_POHMELFS) += pohmelfs/
+@@ -24,6 +24,7 @@ obj-$(CONFIG_RTS5139) += rts5139/
+ obj-$(CONFIG_TRANZPORT) += frontier/
obj-$(CONFIG_IDE_PHISON) += phison/
obj-$(CONFIG_LINE6_USB) += line6/
+obj-$(CONFIG_LTTNG) += lttng/
diff --git a/patches.lttng/0019-staging-Add-LTTng-entry-to-MAINTAINERS-file.patch b/patches.lttng/0019-staging-Add-LTTng-entry-to-MAINTAINERS-file.patch
index 23ee572006d6d0..0cba56ccbf1659 100644
--- a/patches.lttng/0019-staging-Add-LTTng-entry-to-MAINTAINERS-file.patch
+++ b/patches.lttng/0019-staging-Add-LTTng-entry-to-MAINTAINERS-file.patch
@@ -11,7 +11,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -4022,6 +4022,13 @@ W: http://ltp.sourceforge.net/
+@@ -4248,6 +4248,13 @@ T: git git://github.com/linux-test-proje
T: git git://ltp.git.sourceforge.net/gitroot/ltp/ltp-dev
S: Maintained
@@ -24,4 +24,4 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
M32R ARCHITECTURE
M: Hirokazu Takata <takata@linux-m32r.org>
- L: linux-m32r@ml.linux-m32r.org
+ L: linux-m32r@ml.linux-m32r.org (moderated for non-subscribers)
diff --git a/patches.pramfs/08-pramfs-headers.patch b/patches.pramfs/08-pramfs-headers.patch
index 143f221e8dfbdd..36b246063e789e 100644
--- a/patches.pramfs/08-pramfs-headers.patch
+++ b/patches.pramfs/08-pramfs-headers.patch
@@ -307,7 +307,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
+#endif /* __PRAM_H */
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -405,6 +405,7 @@ struct kobject;
+@@ -414,6 +414,7 @@ struct kobject;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
@@ -315,7 +315,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
struct vm_area_struct;
struct vfsmount;
struct cred;
-@@ -2347,6 +2348,7 @@ extern int nonseekable_open(struct inode
+@@ -2409,6 +2410,7 @@ extern int nonseekable_open(struct inode
#ifdef CONFIG_FS_XIP
extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
loff_t *ppos);
@@ -325,14 +325,13 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
size_t len, loff_t *ppos);
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
-@@ -41,6 +41,7 @@
- #define NFS_SUPER_MAGIC 0x6969
- #define OPENPROM_SUPER_MAGIC 0x9fa1
- #define PROC_SUPER_MAGIC 0x9fa0
+@@ -68,5 +68,6 @@
+ #define MTD_INODE_FS_MAGIC 0x11307854
+ #define ANON_INODE_FS_MAGIC 0x09041934
+
+#define PRAM_SUPER_MAGIC 0xEFFA
- #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
- #define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
+ #endif /* __LINUX_MAGIC_H__ */
--- /dev/null
+++ b/include/linux/pram_fs.h
@@ -0,0 +1,130 @@
diff --git a/patches.pramfs/17-pramfs-makefile-and-kconfig.patch b/patches.pramfs/17-pramfs-makefile-and-kconfig.patch
index 9988f85966be3f..6206fb44bdef8c 100644
--- a/patches.pramfs/17-pramfs-makefile-and-kconfig.patch
+++ b/patches.pramfs/17-pramfs-makefile-and-kconfig.patch
@@ -24,8 +24,8 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -5049,6 +5049,15 @@ S: Maintained
- F: drivers/net/pptp.c
+@@ -5351,6 +5351,15 @@ S: Maintained
+ F: drivers/net/ppp/pptp.c
W: http://sourceforge.net/projects/accel-pptp
+PRAM FILE SYSTEM
@@ -42,7 +42,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
L: kpreempt-tech@lists.sourceforge.net
--- a/arch/Kconfig
+++ b/arch/Kconfig
-@@ -97,6 +97,9 @@ config USER_RETURN_NOTIFIER
+@@ -112,6 +112,9 @@ config USER_RETURN_NOTIFIER
config HAVE_IOREMAP_PROT
bool
@@ -54,8 +54,8 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -22,6 +22,7 @@ config X86
- select HAVE_OPROFILE
+@@ -23,6 +23,7 @@ config X86
+ select HAVE_PCSPKR_PLATFORM
select HAVE_PERF_EVENTS
select HAVE_IRQ_WORK
+ select HAVE_SET_MEMORY_RO
@@ -64,7 +64,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
select HAVE_MEMBLOCK
--- a/fs/Kconfig
+++ b/fs/Kconfig
-@@ -13,7 +13,7 @@ source "fs/ext4/Kconfig"
+@@ -17,7 +17,7 @@ source "fs/ext4/Kconfig"
config FS_XIP
# execute in place
bool
@@ -73,7 +73,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
default y
source "fs/jbd/Kconfig"
-@@ -25,7 +25,8 @@ config FS_MBCACHE
+@@ -29,7 +29,8 @@ config FS_MBCACHE
default y if EXT2_FS=y && EXT2_FS_XATTR
default y if EXT3_FS=y && EXT3_FS_XATTR
default y if EXT4_FS=y && EXT4_FS_XATTR
@@ -83,7 +83,7 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
source "fs/reiserfs/Kconfig"
source "fs/jfs/Kconfig"
-@@ -207,6 +208,7 @@ source "fs/romfs/Kconfig"
+@@ -219,6 +220,7 @@ source "fs/romfs/Kconfig"
source "fs/pstore/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
@@ -93,8 +93,8 @@ Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
endif # MISC_FILESYSTEMS
--- a/fs/Makefile
+++ b/fs/Makefile
-@@ -124,3 +124,4 @@ obj-$(CONFIG_GFS2_FS) += gfs2/
- obj-$(CONFIG_EXOFS_FS) += exofs/
+@@ -125,3 +125,4 @@ obj-$(CONFIG_GFS2_FS) += gfs2/
+ obj-y += exofs/ # Multiple modules
obj-$(CONFIG_CEPH_FS) += ceph/
obj-$(CONFIG_PSTORE) += pstore/
+obj-$(CONFIG_PRAMFS) += pramfs/
diff --git a/patches.r8a66597-udc/001-usb-gadget-add-platform-module-alias-where-it-is-missing.patch b/patches.r8a66597-udc/001-usb-gadget-add-platform-module-alias-where-it-is-missing.patch
deleted file mode 100644
index 47b46d786bbf8c..00000000000000
--- a/patches.r8a66597-udc/001-usb-gadget-add-platform-module-alias-where-it-is-missing.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:26 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:23 +0900
-Subject: [LTSI-dev] [PATCH 01/12] usb: gadget: add platform module alias where it is missing
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B1F.6040202@renesas.com>
-
-
->From 2db193dbaf8523e7ebfd9d16add47a85435b6b54 Mon Sep 17 00:00:00 2001
-From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-Date: Wed, 29 Jun 2011 16:41:55 +0300
-Subject: usb: gadget: add platform module alias where it is missing
-
-Without it udev won't be able to load the driver once it notices the
-device unbound.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 86081d7be34e0f80dc5c46391ec927fc4f350462)
-
-Conflicts:
-
- drivers/usb/gadget/ci13xxx_msm.c
- drivers/usb/gadget/mv_udc_core.c
- drivers/usb/gadget/net2272.c
- drivers/usb/gadget/s3c-hsudc.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -1679,6 +1679,7 @@ static struct platform_driver r8a66597_d
- .name = (char *) udc_name,
- },
- };
-+MODULE_ALIAS("platform:r8a66597_udc");
-
- static int __init r8a66597_udc_init(void)
- {
diff --git a/patches.r8a66597-udc/002-usb-update-email-address-in-r8a66597-udc-and-m66592-udc.patch b/patches.r8a66597-udc/002-usb-update-email-address-in-r8a66597-udc-and-m66592-udc.patch
deleted file mode 100644
index f269dfd3cdd867..00000000000000
--- a/patches.r8a66597-udc/002-usb-update-email-address-in-r8a66597-udc-and-m66592-udc.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:22:33 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:28 +0900
-Subject: [LTSI-dev] [PATCH 02/12] usb: update email address in r8a66597-udc and m66592-udc
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B24.2010604@renesas.com>
-
-
->From d747c5ba902336200056de795e1187109178c59a Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 8 Jul 2011 14:51:21 +0900
-Subject: usb: update email address in r8a66597-udc and m66592-udc
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 5db05c09ac107ef957b7a052d7bba8190c93b460)
-
-Conflicts:
-
- drivers/usb/gadget/m66592-udc.c
- drivers/usb/gadget/m66592-udc.h
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 2 +-
- drivers/usb/gadget/r8a66597-udc.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -3,7 +3,7 @@
- *
- * Copyright (C) 2006-2009 Renesas Solutions Corp.
- *
-- * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
-+ * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -3,7 +3,7 @@
- *
- * Copyright (C) 2007-2009 Renesas Solutions Corp.
- *
-- * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
-+ * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
diff --git a/patches.r8a66597-udc/003-usb-gadget-r8a66597-udc-make-buswait-configurable-through-platform-data.patch b/patches.r8a66597-udc/003-usb-gadget-r8a66597-udc-make-buswait-configurable-through-platform-data.patch
deleted file mode 100644
index a2bc8474783f59..00000000000000
--- a/patches.r8a66597-udc/003-usb-gadget-r8a66597-udc-make-buswait-configurable-through-platform-data.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:22:40 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:35 +0900
-Subject: [LTSI-dev] [PATCH 03/12] usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B2B.7010109@renesas.com>
-
-
->From 0d5a5cc7d8b2da62c70d9ab7a9cdd626b889c745 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 8 Jul 2011 14:51:27 +0900
-Subject: usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
-
-BUSWAIT is a 4-bit-wide value that controls the number of access waits
-from the CPU to on-chip USB module. b'0000 inserts 0 wait (2 access
-cycles) and b'1111 inserts 15 waits (17 access cycles, hardware
-initial value), respectively.
-
-BUSWAIT value depends on peripheral clock frequency supplied to on-chip
-of each CPU, hence should be configurable through platform data.
-
-Note that this patch assumes that b'0000 (0 wait, 2 access cycles) is
-rerely used and considered as invalid. If valid 'buswait' data is not
-provided by platform, initial b'1111 (15 waits, 17 access cycles) will
-be applied as a safe default.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 5154e9f126c1d2ee8f5f93d9954f83d82b2d5e64)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 6 +++++-
- include/linux/usb/r8a66597.h | 3 +++
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -576,7 +576,11 @@ static void init_controller(struct r8a66
- u16 endian = r8a66597->pdata->endian ? BIGEND : 0;
-
- if (r8a66597->pdata->on_chip) {
-- r8a66597_bset(r8a66597, 0x04, SYSCFG1);
-+ if (r8a66597->pdata->buswait)
-+ r8a66597_write(r8a66597, r8a66597->pdata->buswait,
-+ SYSCFG1);
-+ else
-+ r8a66597_write(r8a66597, 0x0f, SYSCFG1);
- r8a66597_bset(r8a66597, HSE, SYSCFG0);
-
- r8a66597_bclr(r8a66597, USBE, SYSCFG0);
---- a/include/linux/usb/r8a66597.h
-+++ b/include/linux/usb/r8a66597.h
-@@ -31,6 +31,9 @@ struct r8a66597_platdata {
- /* This callback can control port power instead of DVSTCTR register. */
- void (*port_power)(int port, int power);
-
-+ /* This parameter is for BUSWAIT */
-+ u16 buswait;
-+
- /* set one = on chip controller, set zero = external controller */
- unsigned on_chip:1;
-
diff --git a/patches.r8a66597-udc/004-usb-gadget-r8a66597-udc-add-support-for-test_mode.patch b/patches.r8a66597-udc/004-usb-gadget-r8a66597-udc-add-support-for-test_mode.patch
deleted file mode 100644
index e187abf2946dc4..00000000000000
--- a/patches.r8a66597-udc/004-usb-gadget-r8a66597-udc-add-support-for-test_mode.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:26 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:41 +0900
-Subject: [LTSI-dev] [PATCH 04/12] usb: gadget: r8a66597-udc: add support for TEST_MODE
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B31.90404@renesas.com>
-
-
->From b136f6dc4b62945390fa5fb8dcc2d876f894a11b Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 8 Jul 2011 14:51:14 +0900
-Subject: usb: gadget: r8a66597-udc: add support for TEST_MODE
-
-The USB high speed device must support the TEST_MODE, but the driver
-didn't support it. When we sent the SET_FEATURE for TEST_MODE to
-the driver, the request was successful, but the module didn't enter
-the TEST_MODE.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 96fe53ef5498ba130b2f054f2de38e090ddaa55f)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 23 ++++++++++++++++++++++-
- 1 file changed, 22 insertions(+), 1 deletion(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -622,6 +622,7 @@ static void disable_controller(struct r8
- {
- if (r8a66597->pdata->on_chip) {
- r8a66597_bset(r8a66597, SCKE, SYSCFG0);
-+ r8a66597_bclr(r8a66597, UTST, TESTMODE);
-
- /* disable interrupts */
- r8a66597_write(r8a66597, 0, INTENB0);
-@@ -639,6 +640,7 @@ static void disable_controller(struct r8
- r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
-
- } else {
-+ r8a66597_bclr(r8a66597, UTST, TESTMODE);
- r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
- udelay(1);
- r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
-@@ -1003,10 +1005,29 @@ static void clear_feature(struct r8a6659
-
- static void set_feature(struct r8a66597 *r8a66597, struct usb_ctrlrequest *ctrl)
- {
-+ u16 tmp;
-+ int timeout = 3000;
-
- switch (ctrl->bRequestType & USB_RECIP_MASK) {
- case USB_RECIP_DEVICE:
-- control_end(r8a66597, 1);
-+ switch (le16_to_cpu(ctrl->wValue)) {
-+ case USB_DEVICE_TEST_MODE:
-+ control_end(r8a66597, 1);
-+ /* Wait for the completion of status stage */
-+ do {
-+ tmp = r8a66597_read(r8a66597, INTSTS0) & CTSQ;
-+ udelay(1);
-+ } while (tmp != CS_IDST || timeout-- > 0);
-+
-+ if (tmp == CS_IDST)
-+ r8a66597_bset(r8a66597,
-+ le16_to_cpu(ctrl->wIndex >> 8),
-+ TESTMODE);
-+ break;
-+ default:
-+ pipe_stall(r8a66597, 0);
-+ break;
-+ }
- break;
- case USB_RECIP_INTERFACE:
- control_end(r8a66597, 1);
diff --git a/patches.r8a66597-udc/005-usb-gadget-clean-up-fsf-boilerplate-text.patch b/patches.r8a66597-udc/005-usb-gadget-clean-up-fsf-boilerplate-text.patch
deleted file mode 100644
index f4c3082086838f..00000000000000
--- a/patches.r8a66597-udc/005-usb-gadget-clean-up-fsf-boilerplate-text.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:29 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:51 +0900
-Subject: [LTSI-dev] [PATCH 05/12] usb gadget: clean up FSF boilerplate text
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B3B.4070502@renesas.com>
-
-
->From 4c3d87deff2bb6be573b7f9c1c6736e66fad712a Mon Sep 17 00:00:00 2001
-From: Klaus Schwarzkopf <schwarzkopf@sensortherm.de>
-Date: Fri, 9 Sep 2011 16:10:44 +0200
-Subject: usb gadget: clean up FSF boilerplate text
-
-remove the following two paragraphs as they are not needed:
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,59
-Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 28c9fc68ebd32d473a8787d05c74e3f39c6c866b)
-
-Conflicts:
-
- drivers/usb/gadget/amd5536udc.c
- drivers/usb/gadget/amd5536udc.h
- drivers/usb/gadget/at91_udc.c
- drivers/usb/gadget/at91_udc.h
- drivers/usb/gadget/cdc2.c
- drivers/usb/gadget/ci13xxx_msm.c
- drivers/usb/gadget/composite.c
- drivers/usb/gadget/config.c
- drivers/usb/gadget/dbgp.c
- drivers/usb/gadget/dummy_hcd.c
- drivers/usb/gadget/epautoconf.c
- drivers/usb/gadget/ether.c
- drivers/usb/gadget/f_ecm.c
- drivers/usb/gadget/f_eem.c
- drivers/usb/gadget/f_fs.c
- drivers/usb/gadget/f_hid.c
- drivers/usb/gadget/f_loopback.c
- drivers/usb/gadget/f_ncm.c
- drivers/usb/gadget/f_obex.c
- drivers/usb/gadget/f_phonet.c
- drivers/usb/gadget/f_rndis.c
- drivers/usb/gadget/f_sourcesink.c
- drivers/usb/gadget/f_subset.c
- drivers/usb/gadget/f_uvc.c
- drivers/usb/gadget/f_uvc.h
- drivers/usb/gadget/fusb300_udc.c
- drivers/usb/gadget/fusb300_udc.h
- drivers/usb/gadget/g_ffs.c
- drivers/usb/gadget/hid.c
- drivers/usb/gadget/imx_udc.h
- drivers/usb/gadget/inode.c
- drivers/usb/gadget/langwell_udc.c
- drivers/usb/gadget/langwell_udc.h
- drivers/usb/gadget/m66592-udc.c
- drivers/usb/gadget/m66592-udc.h
- drivers/usb/gadget/mass_storage.c
- drivers/usb/gadget/multi.c
- drivers/usb/gadget/ncm.c
- drivers/usb/gadget/ndis.h
- drivers/usb/gadget/net2280.c
- drivers/usb/gadget/net2280.h
- drivers/usb/gadget/omap_udc.c
- drivers/usb/gadget/pch_udc.c
- drivers/usb/gadget/printer.c
- drivers/usb/gadget/pxa25x_udc.c
- drivers/usb/gadget/pxa25x_udc.h
- drivers/usb/gadget/pxa27x_udc.c
- drivers/usb/gadget/pxa27x_udc.h
- drivers/usb/gadget/s3c2410_udc.c
- drivers/usb/gadget/s3c2410_udc.h
- drivers/usb/gadget/storage_common.c
- drivers/usb/gadget/u_ether.c
- drivers/usb/gadget/u_ether.h
- drivers/usb/gadget/uvc.h
- drivers/usb/gadget/uvc_queue.c
- drivers/usb/gadget/uvc_v4l2.c
- drivers/usb/gadget/uvc_video.c
- drivers/usb/gadget/webcam.c
- drivers/usb/gadget/zero.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 10 ----------
- drivers/usb/gadget/r8a66597-udc.h | 10 ----------
- 2 files changed, 20 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -8,16 +8,6 @@
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-- *
- */
-
- #include <linux/module.h>
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -8,16 +8,6 @@
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-- *
- */
-
- #ifndef __R8A66597_H__
diff --git a/patches.r8a66597-udc/006-usb-irq-remove-irqf_disabled.patch b/patches.r8a66597-udc/006-usb-irq-remove-irqf_disabled.patch
deleted file mode 100644
index bcd8c99863547c..00000000000000
--- a/patches.r8a66597-udc/006-usb-irq-remove-irqf_disabled.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:31 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:22:59 +0900
-Subject: [LTSI-dev] [PATCH 06/12] USB: irq: Remove IRQF_DISABLED
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B43.3050307@renesas.com>
-
-
->From 1c1d88148ed0c54c58f7426b49c417c44bb68eeb Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Wed, 7 Sep 2011 16:10:52 +0800
-Subject: USB: irq: Remove IRQF_DISABLED
-
-This flag is a NOOP and can be removed now.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit b5dd18d8747010e3f3eb1cc76a49f94291938559)
-
-Conflicts:
-
- drivers/usb/core/hcd-pci.c
- drivers/usb/gadget/at91_udc.c
- drivers/usb/gadget/fusb300_udc.c
- drivers/usb/gadget/imx_udc.c
- drivers/usb/gadget/m66592-udc.c
- drivers/usb/gadget/mv_udc_core.c
- drivers/usb/gadget/omap_udc.c
- drivers/usb/gadget/pxa25x_udc.c
- drivers/usb/gadget/r8a66597-udc.c
- drivers/usb/gadget/s3c2410_udc.c
- drivers/usb/host/ehci-ath79.c
- drivers/usb/host/ehci-au1xxx.c
- drivers/usb/host/ehci-fsl.c
- drivers/usb/host/ehci-mxc.c
- drivers/usb/host/ehci-octeon.c
- drivers/usb/host/ehci-omap.c
- drivers/usb/host/ehci-orion.c
- drivers/usb/host/ehci-ps3.c
- drivers/usb/host/ehci-s5p.c
- drivers/usb/host/ehci-sh.c
- drivers/usb/host/ehci-spear.c
- drivers/usb/host/ehci-tegra.c
- drivers/usb/host/ehci-vt8500.c
- drivers/usb/host/fhci-hcd.c
- drivers/usb/host/imx21-hcd.c
- drivers/usb/host/isp116x-hcd.c
- drivers/usb/host/isp1362-hcd.c
- drivers/usb/host/isp1760-if.c
- drivers/usb/host/ohci-ath79.c
- drivers/usb/host/ohci-au1xxx.c
- drivers/usb/host/ohci-da8xx.c
- drivers/usb/host/ohci-ep93xx.c
- drivers/usb/host/ohci-octeon.c
- drivers/usb/host/ohci-omap.c
- drivers/usb/host/ohci-omap3.c
- drivers/usb/host/ohci-pnx4008.c
- drivers/usb/host/ohci-pnx8550.c
- drivers/usb/host/ohci-ppc-of.c
- drivers/usb/host/ohci-ppc-soc.c
- drivers/usb/host/ohci-ps3.c
- drivers/usb/host/ohci-pxa27x.c
- drivers/usb/host/ohci-s3c2410.c
- drivers/usb/host/ohci-sa1111.c
- drivers/usb/host/ohci-sh.c
- drivers/usb/host/ohci-sm501.c
- drivers/usb/host/ohci-spear.c
- drivers/usb/host/ohci-ssb.c
- drivers/usb/host/ohci-tmio.c
- drivers/usb/host/r8a66597-hcd.c
- drivers/usb/host/sl811-hcd.c
- drivers/usb/host/xhci-pci.c
- drivers/usb/musb/musbhsdma.c
- drivers/usb/otg/isp1301_omap.c
- drivers/usb/renesas_usbhs/mod.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -1618,7 +1618,7 @@ static int __init r8a66597_probe(struct
-
- disable_controller(r8a66597); /* make sure controller is disabled */
-
-- ret = request_irq(irq, r8a66597_irq, IRQF_DISABLED | IRQF_SHARED,
-+ ret = request_irq(irq, r8a66597_irq, IRQF_SHARED,
- udc_name, r8a66597);
- if (ret < 0) {
- printk(KERN_ERR "request_irq error (%d)\n", ret);
diff --git a/patches.r8a66597-udc/007-usb-gadget-r8a66597-udc-change-prototype-of-r8a66597_write_fifo.patch b/patches.r8a66597-udc/007-usb-gadget-r8a66597-udc-change-prototype-of-r8a66597_write_fifo.patch
deleted file mode 100644
index cdcc57b087b05e..00000000000000
--- a/patches.r8a66597-udc/007-usb-gadget-r8a66597-udc-change-prototype-of-r8a66597_write_fifo.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:10 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:05 +0900
-Subject: [LTSI-dev] [PATCH 07/12] usb: gadget: r8a66597-udc: change prototype of r8a66597_write_fifo
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B49.5010102@renesas.com>
-
-
->From f29c87e4cdae1df5b2871e87c67799bc51766e2a Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 30 Sep 2011 20:07:08 +0900
-Subject: usb: gadget: r8a66597-udc: change prototype of r8a66597_write_fifo
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 0a85577627fc81936d3dbdfb349964024adcb01d)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 4 ++--
- drivers/usb/gadget/r8a66597-udc.h | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -723,7 +723,7 @@ static void irq_ep0_write(struct r8a6659
- /* write fifo */
- if (req->req.buf) {
- if (size > 0)
-- r8a66597_write_fifo(r8a66597, ep->fifoaddr, buf, size);
-+ r8a66597_write_fifo(r8a66597, ep, buf, size);
- if ((size == 0) || ((size % ep->ep.maxpacket) != 0))
- r8a66597_bset(r8a66597, BVAL, ep->fifoctr);
- }
-@@ -770,7 +770,7 @@ static void irq_packet_write(struct r8a6
-
- /* write fifo */
- if (req->req.buf) {
-- r8a66597_write_fifo(r8a66597, ep->fifoaddr, buf, size);
-+ r8a66597_write_fifo(r8a66597, ep, buf, size);
- if ((size == 0)
- || ((size % ep->ep.maxpacket) != 0)
- || ((bufsize != ep->ep.maxpacket)
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -173,11 +173,11 @@ static inline void r8a66597_write(struct
- }
-
- static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
-- unsigned long offset,
-+ struct r8a66597_ep *ep,
- unsigned char *buf,
- int len)
- {
-- void __iomem *fifoaddr = r8a66597->reg + offset;
-+ void __iomem *fifoaddr = r8a66597->reg + ep->fifoaddr;
- int adj = 0;
- int i;
-
diff --git a/patches.r8a66597-udc/008-usb-r8a66597-hcd-add-function-for-external-controller.patch b/patches.r8a66597-udc/008-usb-r8a66597-hcd-add-function-for-external-controller.patch
deleted file mode 100644
index 0ed2690e2f4af5..00000000000000
--- a/patches.r8a66597-udc/008-usb-r8a66597-hcd-add-function-for-external-controller.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:19 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:15 +0900
-Subject: [LTSI-dev] [PATCH 08/12] usb: r8a66597-hcd: add function for external controller
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B53.2070602@renesas.com>
-
-
->From 8eb5b6c291ca376adaff5cd123cfc39e186b30ee Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 7 Jul 2011 09:57:10 +0900
-Subject: usb: r8a66597-hcd: add function for external controller
-
-R8A66597 has the pin of WR0 and WR1. So, if one write-pin of CPU
-connects to the pins, we have to change the setting of FIFOSEL
-register in the controller. If we don't change the setting,
-the controller cannot send the data of odd length.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit f2e9039a43b01f01cab9dfaea2cad5f304fb3343)
-
-Conflicts:
-
- drivers/usb/host/r8a66597-hcd.c
- drivers/usb/host/r8a66597.h
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- include/linux/usb/r8a66597.h | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/include/linux/usb/r8a66597.h
-+++ b/include/linux/usb/r8a66597.h
-@@ -45,6 +45,9 @@ struct r8a66597_platdata {
-
- /* set one = big endian, set zero = little endian */
- unsigned endian:1;
-+
-+ /* (external controller only) set one = WR0_N shorted to WR1_N */
-+ unsigned wr0_shorted_to_wr1:1;
- };
-
- /* Register definitions */
diff --git a/patches.r8a66597-udc/009-usb-gadget-r8a66597-udc-add-function-for-external-controller.patch b/patches.r8a66597-udc/009-usb-gadget-r8a66597-udc-add-function-for-external-controller.patch
deleted file mode 100644
index e3017c7bb7810d..00000000000000
--- a/patches.r8a66597-udc/009-usb-gadget-r8a66597-udc-add-function-for-external-controller.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:25 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:22 +0900
-Subject: [LTSI-dev] [PATCH 09/12] usb: gadget: r8a66597-udc: add function for external controller
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B5A.8080304@renesas.com>
-
-
->From 0a5c27afa82c8b475eca91e74664dd90f4827faf Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 30 Sep 2011 20:07:21 +0900
-Subject: usb: gadget: r8a66597-udc: add function for external controller
-
-R8A66597 has the pin of WR0 and WR1. So, if one write-pin of CPU
-connects to the pins, we have to change the setting of FIFOSEL
-register in the controller. If we don't change the setting,
-the controller cannot send the data of odd length.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 5c481a639068ac34bd1dcd183f37b7a65d0e3841)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.h | 34 +++++++++++++++++++---------------
- 1 file changed, 19 insertions(+), 15 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -172,6 +172,21 @@ static inline void r8a66597_write(struct
- iowrite16(val, r8a66597->reg + offset);
- }
-
-+static inline void r8a66597_mdfy(struct r8a66597 *r8a66597,
-+ u16 val, u16 pat, unsigned long offset)
-+{
-+ u16 tmp;
-+ tmp = r8a66597_read(r8a66597, offset);
-+ tmp = tmp & (~pat);
-+ tmp = tmp | val;
-+ r8a66597_write(r8a66597, tmp, offset);
-+}
-+
-+#define r8a66597_bclr(r8a66597, val, offset) \
-+ r8a66597_mdfy(r8a66597, 0, val, offset)
-+#define r8a66597_bset(r8a66597, val, offset) \
-+ r8a66597_mdfy(r8a66597, val, 0, offset)
-+
- static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
- struct r8a66597_ep *ep,
- unsigned char *buf,
-@@ -205,18 +220,12 @@ static inline void r8a66597_write_fifo(s
- adj = 0x01; /* 16-bit wide */
- }
-
-+ if (r8a66597->pdata->wr0_shorted_to_wr1)
-+ r8a66597_bclr(r8a66597, MBW_16, ep->fifosel);
- for (i = 0; i < len; i++)
- iowrite8(buf[i], fifoaddr + adj - (i & adj));
--}
--
--static inline void r8a66597_mdfy(struct r8a66597 *r8a66597,
-- u16 val, u16 pat, unsigned long offset)
--{
-- u16 tmp;
-- tmp = r8a66597_read(r8a66597, offset);
-- tmp = tmp & (~pat);
-- tmp = tmp | val;
-- r8a66597_write(r8a66597, tmp, offset);
-+ if (r8a66597->pdata->wr0_shorted_to_wr1)
-+ r8a66597_bclr(r8a66597, MBW_16, ep->fifosel);
- }
-
- static inline u16 get_xtal_from_pdata(struct r8a66597_platdata *pdata)
-@@ -241,11 +250,6 @@ static inline u16 get_xtal_from_pdata(st
- return clock;
- }
-
--#define r8a66597_bclr(r8a66597, val, offset) \
-- r8a66597_mdfy(r8a66597, 0, val, offset)
--#define r8a66597_bset(r8a66597, val, offset) \
-- r8a66597_mdfy(r8a66597, val, 0, offset)
--
- #define get_pipectr_addr(pipenum) (PIPE1CTR + (pipenum - 1) * 2)
-
- #define enable_irq_ready(r8a66597, pipenum) \
diff --git a/patches.r8a66597-udc/010-usb-gadget-r8a66597-udc-use-dev_-instead-of-printk.patch b/patches.r8a66597-udc/010-usb-gadget-r8a66597-udc-use-dev_-instead-of-printk.patch
deleted file mode 100644
index 5eed4afb8bb172..00000000000000
--- a/patches.r8a66597-udc/010-usb-gadget-r8a66597-udc-use-dev_-instead-of-printk.patch
+++ /dev/null
@@ -1,311 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:33 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:28 +0900
-Subject: [LTSI-dev] [PATCH 10/12] usb: gadget: r8a66597-udc: use dev_*() instead of printk()
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B60.1090300@renesas.com>
-
-
->From 427c3968e29e2754b6ec7639ada0cc87b6dbecf9 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 30 Sep 2011 20:07:30 +0900
-Subject: usb: gadget: r8a66597-udc: use dev_*() instead of printk()
-
-This patch also fix the balance of braces.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit 12158f4280b4d42ef03b70a47d11b48dd8aad511)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 99 ++++++++++++++++++++++----------------
- drivers/usb/gadget/r8a66597-udc.h | 1
- 2 files changed, 60 insertions(+), 40 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -105,13 +105,15 @@ static inline u16 control_reg_get_pid(st
- u16 pid = 0;
- unsigned long offset;
-
-- if (pipenum == 0)
-+ if (pipenum == 0) {
- pid = r8a66597_read(r8a66597, DCPCTR) & PID;
-- else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
- offset = get_pipectr_addr(pipenum);
- pid = r8a66597_read(r8a66597, offset) & PID;
-- } else
-- printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597), "unexpect pipe num (%d)\n",
-+ pipenum);
-+ }
-
- return pid;
- }
-@@ -121,13 +123,15 @@ static inline void control_reg_set_pid(s
- {
- unsigned long offset;
-
-- if (pipenum == 0)
-+ if (pipenum == 0) {
- r8a66597_mdfy(r8a66597, pid, PID, DCPCTR);
-- else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
- offset = get_pipectr_addr(pipenum);
- r8a66597_mdfy(r8a66597, pid, PID, offset);
-- } else
-- printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597), "unexpect pipe num (%d)\n",
-+ pipenum);
-+ }
- }
-
- static inline void pipe_start(struct r8a66597 *r8a66597, u16 pipenum)
-@@ -150,13 +154,15 @@ static inline u16 control_reg_get(struct
- u16 ret = 0;
- unsigned long offset;
-
-- if (pipenum == 0)
-+ if (pipenum == 0) {
- ret = r8a66597_read(r8a66597, DCPCTR);
-- else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
- offset = get_pipectr_addr(pipenum);
- ret = r8a66597_read(r8a66597, offset);
-- } else
-- printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597), "unexpect pipe num (%d)\n",
-+ pipenum);
-+ }
-
- return ret;
- }
-@@ -167,13 +173,15 @@ static inline void control_reg_sqclr(str
-
- pipe_stop(r8a66597, pipenum);
-
-- if (pipenum == 0)
-+ if (pipenum == 0) {
- r8a66597_bset(r8a66597, SQCLR, DCPCTR);
-- else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
- offset = get_pipectr_addr(pipenum);
- r8a66597_bset(r8a66597, SQCLR, offset);
-- } else
-- printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597), "unexpect pipe num (%d)\n",
-+ pipenum);
-+ }
- }
-
- static inline int get_buffer_size(struct r8a66597 *r8a66597, u16 pipenum)
-@@ -287,17 +295,18 @@ static void pipe_buffer_release(struct r
- if (info->pipe == 0)
- return;
-
-- if (is_bulk_pipe(info->pipe))
-+ if (is_bulk_pipe(info->pipe)) {
- r8a66597->bulk--;
-- else if (is_interrupt_pipe(info->pipe))
-+ } else if (is_interrupt_pipe(info->pipe)) {
- r8a66597->interrupt--;
-- else if (is_isoc_pipe(info->pipe)) {
-+ } else if (is_isoc_pipe(info->pipe)) {
- r8a66597->isochronous--;
- if (info->type == R8A66597_BULK)
- r8a66597->bulk--;
-- } else
-- printk(KERN_ERR "ep_release: unexpect pipenum (%d)\n",
-- info->pipe);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "ep_release: unexpect pipenum (%d)\n", info->pipe);
-+ }
- }
-
- static void pipe_initialize(struct r8a66597_ep *ep)
-@@ -371,7 +380,8 @@ static int alloc_pipe_config(struct r8a6
- case USB_ENDPOINT_XFER_BULK:
- if (r8a66597->bulk >= R8A66597_MAX_NUM_BULK) {
- if (r8a66597->isochronous >= R8A66597_MAX_NUM_ISOC) {
-- printk(KERN_ERR "bulk pipe is insufficient\n");
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "bulk pipe is insufficient\n");
- return -ENODEV;
- } else {
- info.pipe = R8A66597_BASE_PIPENUM_ISOC
-@@ -387,7 +397,8 @@ static int alloc_pipe_config(struct r8a6
- break;
- case USB_ENDPOINT_XFER_INT:
- if (r8a66597->interrupt >= R8A66597_MAX_NUM_INT) {
-- printk(KERN_ERR "interrupt pipe is insufficient\n");
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "interrupt pipe is insufficient\n");
- return -ENODEV;
- }
- info.pipe = R8A66597_BASE_PIPENUM_INT + r8a66597->interrupt;
-@@ -396,7 +407,8 @@ static int alloc_pipe_config(struct r8a6
- break;
- case USB_ENDPOINT_XFER_ISOC:
- if (r8a66597->isochronous >= R8A66597_MAX_NUM_ISOC) {
-- printk(KERN_ERR "isochronous pipe is insufficient\n");
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "isochronous pipe is insufficient\n");
- return -ENODEV;
- }
- info.pipe = R8A66597_BASE_PIPENUM_ISOC + r8a66597->isochronous;
-@@ -404,7 +416,7 @@ static int alloc_pipe_config(struct r8a6
- counter = &r8a66597->isochronous;
- break;
- default:
-- printk(KERN_ERR "unexpect xfer type\n");
-+ dev_err(r8a66597_to_dev(r8a66597), "unexpect xfer type\n");
- return -EINVAL;
- }
- ep->type = info.type;
-@@ -419,7 +431,8 @@ static int alloc_pipe_config(struct r8a6
-
- ret = pipe_buffer_setting(r8a66597, &info);
- if (ret < 0) {
-- printk(KERN_ERR "pipe_buffer_setting fail\n");
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "pipe_buffer_setting fail\n");
- return ret;
- }
-
-@@ -554,7 +567,8 @@ static void start_ep0(struct r8a66597_ep
- control_end(ep->r8a66597, 0);
- break;
- default:
-- printk(KERN_ERR "start_ep0: unexpect ctsq(%x)\n", ctsq);
-+ dev_err(r8a66597_to_dev(ep->r8a66597),
-+ "start_ep0: unexpect ctsq(%x)\n", ctsq);
- break;
- }
- }
-@@ -708,7 +722,8 @@ static void irq_ep0_write(struct r8a6659
- do {
- tmp = r8a66597_read(r8a66597, ep->fifoctr);
- if (i++ > 100000) {
-- printk(KERN_ERR "pipe0 is busy. maybe cpu i/o bus"
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "pipe0 is busy. maybe cpu i/o bus "
- "conflict. please power off this controller.");
- return;
- }
-@@ -759,7 +774,8 @@ static void irq_packet_write(struct r8a6
- if (unlikely((tmp & FRDY) == 0)) {
- pipe_stop(r8a66597, pipenum);
- pipe_irq_disable(r8a66597, pipenum);
-- printk(KERN_ERR "write fifo not ready. pipnum=%d\n", pipenum);
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "write fifo not ready. pipnum=%d\n", pipenum);
- return;
- }
-
-@@ -809,7 +825,7 @@ static void irq_packet_read(struct r8a66
- req->req.status = -EPIPE;
- pipe_stop(r8a66597, pipenum);
- pipe_irq_disable(r8a66597, pipenum);
-- printk(KERN_ERR "read fifo not ready");
-+ dev_err(r8a66597_to_dev(r8a66597), "read fifo not ready");
- return;
- }
-
-@@ -1085,7 +1101,7 @@ static void r8a66597_update_usb_speed(st
- break;
- default:
- r8a66597->gadget.speed = USB_SPEED_UNKNOWN;
-- printk(KERN_ERR "USB speed unknown\n");
-+ dev_err(r8a66597_to_dev(r8a66597), "USB speed unknown\n");
- }
- }
-
-@@ -1148,7 +1164,8 @@ __acquires(r8a66597->lock)
- control_end(r8a66597, 0);
- break;
- default:
-- printk(KERN_ERR "ctrl_stage: unexpect ctsq(%x)\n", ctsq);
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "ctrl_stage: unexpect ctsq(%x)\n", ctsq);
- break;
- }
- }
-@@ -1448,13 +1465,15 @@ int usb_gadget_probe_driver(struct usb_g
-
- retval = device_add(&r8a66597->gadget.dev);
- if (retval) {
-- printk(KERN_ERR "device_add error (%d)\n", retval);
-+ dev_err(r8a66597_to_dev(r8a66597), "device_add error (%d)\n",
-+ retval);
- goto error;
- }
-
- retval = bind(&r8a66597->gadget);
- if (retval) {
-- printk(KERN_ERR "bind to driver error (%d)\n", retval);
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "bind to driver error (%d)\n", retval);
- device_del(&r8a66597->gadget.dev);
- goto error;
- }
-@@ -1554,7 +1573,7 @@ static int __init r8a66597_probe(struct
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENODEV;
-- printk(KERN_ERR "platform_get_resource error.\n");
-+ dev_err(&pdev->dev, "platform_get_resource error.\n");
- goto clean_up;
- }
-
-@@ -1564,14 +1583,14 @@ static int __init r8a66597_probe(struct
-
- if (irq < 0) {
- ret = -ENODEV;
-- printk(KERN_ERR "platform_get_irq error.\n");
-+ dev_err(&pdev->dev, "platform_get_irq error.\n");
- goto clean_up;
- }
-
- reg = ioremap(res->start, resource_size(res));
- if (reg == NULL) {
- ret = -ENOMEM;
-- printk(KERN_ERR "ioremap error.\n");
-+ dev_err(&pdev->dev, "ioremap error.\n");
- goto clean_up;
- }
-
-@@ -1579,7 +1598,7 @@ static int __init r8a66597_probe(struct
- r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL);
- if (r8a66597 == NULL) {
- ret = -ENOMEM;
-- printk(KERN_ERR "kzalloc error\n");
-+ dev_err(&pdev->dev, "kzalloc error\n");
- goto clean_up;
- }
-
-@@ -1621,7 +1640,7 @@ static int __init r8a66597_probe(struct
- ret = request_irq(irq, r8a66597_irq, IRQF_SHARED,
- udc_name, r8a66597);
- if (ret < 0) {
-- printk(KERN_ERR "request_irq error (%d)\n", ret);
-+ dev_err(&pdev->dev, "request_irq error (%d)\n", ret);
- goto clean_up2;
- }
-
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -114,6 +114,7 @@ struct r8a66597 {
- #define gadget_to_r8a66597(_gadget) \
- container_of(_gadget, struct r8a66597, gadget)
- #define r8a66597_to_gadget(r8a66597) (&r8a66597->gadget)
-+#define r8a66597_to_dev(r8a66597) (r8a66597->gadget.dev.parent)
-
- static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset)
- {
diff --git a/patches.r8a66597-udc/011-usb-gadget-r8a66597-udc-add-support-for-sudmac.patch b/patches.r8a66597-udc/011-usb-gadget-r8a66597-udc-add-support-for-sudmac.patch
deleted file mode 100644
index 8a7a41d91eaea3..00000000000000
--- a/patches.r8a66597-udc/011-usb-gadget-r8a66597-udc-add-support-for-sudmac.patch
+++ /dev/null
@@ -1,664 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:37 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:32 +0900
-Subject: [LTSI-dev] [PATCH 11/12] usb: gadget: r8a66597-udc: add support for SUDMAC
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B64.4080400@renesas.com>
-
-
->From 5011d0b167a9536dd46c10afb8afa96c60bb4193 Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 30 Sep 2011 20:07:38 +0900
-Subject: usb: gadget: r8a66597-udc: add support for SUDMAC
-
-SH7757 has a USB function with internal DMA controller (SUDMAC).
-This patch supports the SUDMAC. The SUDMAC is incompatible with
-general-purpose DMAC. So, it doesn't use dmaengine.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-(cherry picked from commit b8a56e17e18cca2402b390c10b8d7f3cd0f6265b)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 364 ++++++++++++++++++++++++++++++++++++--
- drivers/usb/gadget/r8a66597-udc.h | 26 ++
- include/linux/usb/r8a66597.h | 60 ++++++
- 3 files changed, 430 insertions(+), 20 deletions(-)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -18,13 +18,14 @@
- #include <linux/clk.h>
- #include <linux/err.h>
- #include <linux/slab.h>
-+#include <linux/dma-mapping.h>
-
- #include <linux/usb/ch9.h>
- #include <linux/usb/gadget.h>
-
- #include "r8a66597-udc.h"
-
--#define DRIVER_VERSION "2009-08-18"
-+#define DRIVER_VERSION "2011-09-26"
-
- static const char udc_name[] = "r8a66597_udc";
- static const char *r8a66597_ep_name[] = {
-@@ -184,6 +185,54 @@ static inline void control_reg_sqclr(str
- }
- }
-
-+static void control_reg_sqset(struct r8a66597 *r8a66597, u16 pipenum)
-+{
-+ unsigned long offset;
-+
-+ pipe_stop(r8a66597, pipenum);
-+
-+ if (pipenum == 0) {
-+ r8a66597_bset(r8a66597, SQSET, DCPCTR);
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ offset = get_pipectr_addr(pipenum);
-+ r8a66597_bset(r8a66597, SQSET, offset);
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "unexpect pipe num(%d)\n", pipenum);
-+ }
-+}
-+
-+static u16 control_reg_sqmon(struct r8a66597 *r8a66597, u16 pipenum)
-+{
-+ unsigned long offset;
-+
-+ if (pipenum == 0) {
-+ return r8a66597_read(r8a66597, DCPCTR) & SQMON;
-+ } else if (pipenum < R8A66597_MAX_NUM_PIPE) {
-+ offset = get_pipectr_addr(pipenum);
-+ return r8a66597_read(r8a66597, offset) & SQMON;
-+ } else {
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "unexpect pipe num(%d)\n", pipenum);
-+ }
-+
-+ return 0;
-+}
-+
-+static u16 save_usb_toggle(struct r8a66597 *r8a66597, u16 pipenum)
-+{
-+ return control_reg_sqmon(r8a66597, pipenum);
-+}
-+
-+static void restore_usb_toggle(struct r8a66597 *r8a66597, u16 pipenum,
-+ u16 toggle)
-+{
-+ if (toggle)
-+ control_reg_sqset(r8a66597, pipenum);
-+ else
-+ control_reg_sqclr(r8a66597, pipenum);
-+}
-+
- static inline int get_buffer_size(struct r8a66597 *r8a66597, u16 pipenum)
- {
- u16 tmp;
-@@ -220,18 +269,51 @@ static inline unsigned short mbw_value(s
- return MBW_16;
- }
-
-+static void r8a66597_change_curpipe(struct r8a66597 *r8a66597, u16 pipenum,
-+ u16 isel, u16 fifosel)
-+{
-+ u16 tmp, mask, loop;
-+ int i = 0;
-+
-+ if (!pipenum) {
-+ mask = ISEL | CURPIPE;
-+ loop = isel;
-+ } else {
-+ mask = CURPIPE;
-+ loop = pipenum;
-+ }
-+ r8a66597_mdfy(r8a66597, loop, mask, fifosel);
-+
-+ do {
-+ tmp = r8a66597_read(r8a66597, fifosel);
-+ if (i++ > 1000000) {
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "r8a66597: register%x, loop %x "
-+ "is timeout\n", fifosel, loop);
-+ break;
-+ }
-+ ndelay(1);
-+ } while ((tmp & mask) != loop);
-+}
-+
- static inline void pipe_change(struct r8a66597 *r8a66597, u16 pipenum)
- {
- struct r8a66597_ep *ep = r8a66597->pipenum2ep[pipenum];
-
- if (ep->use_dma)
-- return;
-+ r8a66597_bclr(r8a66597, DREQE, ep->fifosel);
-
- r8a66597_mdfy(r8a66597, pipenum, CURPIPE, ep->fifosel);
-
- ndelay(450);
-
-- r8a66597_bset(r8a66597, mbw_value(r8a66597), ep->fifosel);
-+ if (r8a66597_is_sudmac(r8a66597) && ep->use_dma)
-+ r8a66597_bclr(r8a66597, mbw_value(r8a66597), ep->fifosel);
-+ else
-+ r8a66597_bset(r8a66597, mbw_value(r8a66597), ep->fifosel);
-+
-+ if (ep->use_dma)
-+ r8a66597_bset(r8a66597, DREQE, ep->fifosel);
- }
-
- static int pipe_buffer_setting(struct r8a66597 *r8a66597,
-@@ -336,9 +418,15 @@ static void r8a66597_ep_setting(struct r
- ep->fifoaddr = CFIFO;
- ep->fifosel = CFIFOSEL;
- ep->fifoctr = CFIFOCTR;
-- ep->fifotrn = 0;
-
- ep->pipectr = get_pipectr_addr(pipenum);
-+ if (is_bulk_pipe(pipenum) || is_isoc_pipe(pipenum)) {
-+ ep->pipetre = get_pipetre_addr(pipenum);
-+ ep->pipetrn = get_pipetrn_addr(pipenum);
-+ } else {
-+ ep->pipetre = 0;
-+ ep->pipetrn = 0;
-+ }
- ep->pipenum = pipenum;
- ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize);
- r8a66597->pipenum2ep[pipenum] = ep;
-@@ -498,6 +586,124 @@ static void start_ep0_write(struct r8a66
- }
- }
-
-+static void disable_fifosel(struct r8a66597 *r8a66597, u16 pipenum,
-+ u16 fifosel)
-+{
-+ u16 tmp;
-+
-+ tmp = r8a66597_read(r8a66597, fifosel) & CURPIPE;
-+ if (tmp == pipenum)
-+ r8a66597_change_curpipe(r8a66597, 0, 0, fifosel);
-+}
-+
-+static void change_bfre_mode(struct r8a66597 *r8a66597, u16 pipenum,
-+ int enable)
-+{
-+ struct r8a66597_ep *ep = r8a66597->pipenum2ep[pipenum];
-+ u16 tmp, toggle;
-+
-+ /* check current BFRE bit */
-+ r8a66597_write(r8a66597, pipenum, PIPESEL);
-+ tmp = r8a66597_read(r8a66597, PIPECFG) & R8A66597_BFRE;
-+ if ((enable && tmp) || (!enable && !tmp))
-+ return;
-+
-+ /* change BFRE bit */
-+ pipe_stop(r8a66597, pipenum);
-+ disable_fifosel(r8a66597, pipenum, CFIFOSEL);
-+ disable_fifosel(r8a66597, pipenum, D0FIFOSEL);
-+ disable_fifosel(r8a66597, pipenum, D1FIFOSEL);
-+
-+ toggle = save_usb_toggle(r8a66597, pipenum);
-+
-+ r8a66597_write(r8a66597, pipenum, PIPESEL);
-+ if (enable)
-+ r8a66597_bset(r8a66597, R8A66597_BFRE, PIPECFG);
-+ else
-+ r8a66597_bclr(r8a66597, R8A66597_BFRE, PIPECFG);
-+
-+ /* initialize for internal BFRE flag */
-+ r8a66597_bset(r8a66597, ACLRM, ep->pipectr);
-+ r8a66597_bclr(r8a66597, ACLRM, ep->pipectr);
-+
-+ restore_usb_toggle(r8a66597, pipenum, toggle);
-+}
-+
-+static int sudmac_alloc_channel(struct r8a66597 *r8a66597,
-+ struct r8a66597_ep *ep,
-+ struct r8a66597_request *req)
-+{
-+ struct r8a66597_dma *dma;
-+
-+ if (!r8a66597_is_sudmac(r8a66597))
-+ return -ENODEV;
-+
-+ /* Check transfer type */
-+ if (!is_bulk_pipe(ep->pipenum))
-+ return -EIO;
-+
-+ if (r8a66597->dma.used)
-+ return -EBUSY;
-+
-+ /* set SUDMAC parameters */
-+ dma = &r8a66597->dma;
-+ dma->used = 1;
-+ if (ep->desc->bEndpointAddress & USB_DIR_IN) {
-+ dma->dir = 1;
-+ } else {
-+ dma->dir = 0;
-+ change_bfre_mode(r8a66597, ep->pipenum, 1);
-+ }
-+
-+ /* set r8a66597_ep paramters */
-+ ep->use_dma = 1;
-+ ep->dma = dma;
-+ ep->fifoaddr = D0FIFO;
-+ ep->fifosel = D0FIFOSEL;
-+ ep->fifoctr = D0FIFOCTR;
-+
-+ /* dma mapping */
-+ req->req.dma = dma_map_single(r8a66597_to_dev(ep->r8a66597),
-+ req->req.buf, req->req.length,
-+ dma->dir ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
-+
-+ return 0;
-+}
-+
-+static void sudmac_free_channel(struct r8a66597 *r8a66597,
-+ struct r8a66597_ep *ep,
-+ struct r8a66597_request *req)
-+{
-+ if (!r8a66597_is_sudmac(r8a66597))
-+ return;
-+
-+ dma_unmap_single(r8a66597_to_dev(ep->r8a66597),
-+ req->req.dma, req->req.length,
-+ ep->dma->dir ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
-+
-+ r8a66597_bclr(r8a66597, DREQE, ep->fifosel);
-+ r8a66597_change_curpipe(r8a66597, 0, 0, ep->fifosel);
-+
-+ ep->dma->used = 0;
-+ ep->use_dma = 0;
-+ ep->fifoaddr = CFIFO;
-+ ep->fifosel = CFIFOSEL;
-+ ep->fifoctr = CFIFOCTR;
-+}
-+
-+static void sudmac_start(struct r8a66597 *r8a66597, struct r8a66597_ep *ep,
-+ struct r8a66597_request *req)
-+{
-+ BUG_ON(req->req.length == 0);
-+
-+ r8a66597_sudmac_write(r8a66597, LBA_WAIT, CH0CFG);
-+ r8a66597_sudmac_write(r8a66597, req->req.dma, CH0BA);
-+ r8a66597_sudmac_write(r8a66597, req->req.length, CH0BBC);
-+ r8a66597_sudmac_write(r8a66597, CH0ENDE, DINTCTRL);
-+
-+ r8a66597_sudmac_write(r8a66597, DEN, CH0DEN);
-+}
-+
- static void start_packet_write(struct r8a66597_ep *ep,
- struct r8a66597_request *req)
- {
-@@ -508,11 +714,29 @@ static void start_packet_write(struct r8
- disable_irq_empty(r8a66597, ep->pipenum);
- pipe_start(r8a66597, ep->pipenum);
-
-- tmp = r8a66597_read(r8a66597, ep->fifoctr);
-- if (unlikely((tmp & FRDY) == 0))
-- pipe_irq_enable(r8a66597, ep->pipenum);
-- else
-- irq_packet_write(ep, req);
-+ if (req->req.length == 0) {
-+ transfer_complete(ep, req, 0);
-+ } else {
-+ r8a66597_write(r8a66597, ~(1 << ep->pipenum), BRDYSTS);
-+ if (sudmac_alloc_channel(r8a66597, ep, req) < 0) {
-+ /* PIO mode */
-+ pipe_change(r8a66597, ep->pipenum);
-+ disable_irq_empty(r8a66597, ep->pipenum);
-+ pipe_start(r8a66597, ep->pipenum);
-+ tmp = r8a66597_read(r8a66597, ep->fifoctr);
-+ if (unlikely((tmp & FRDY) == 0))
-+ pipe_irq_enable(r8a66597, ep->pipenum);
-+ else
-+ irq_packet_write(ep, req);
-+ } else {
-+ /* DMA mode */
-+ pipe_change(r8a66597, ep->pipenum);
-+ disable_irq_nrdy(r8a66597, ep->pipenum);
-+ pipe_start(r8a66597, ep->pipenum);
-+ enable_irq_nrdy(r8a66597, ep->pipenum);
-+ sudmac_start(r8a66597, ep, req);
-+ }
-+ }
- }
-
- static void start_packet_read(struct r8a66597_ep *ep,
-@@ -527,17 +751,26 @@ static void start_packet_read(struct r8a
- pipe_start(r8a66597, pipenum);
- pipe_irq_enable(r8a66597, pipenum);
- } else {
-- if (ep->use_dma) {
-- r8a66597_bset(r8a66597, TRCLR, ep->fifosel);
-- pipe_change(r8a66597, pipenum);
-- r8a66597_bset(r8a66597, TRENB, ep->fifosel);
-+ pipe_stop(r8a66597, pipenum);
-+ if (ep->pipetre) {
-+ enable_irq_nrdy(r8a66597, pipenum);
-+ r8a66597_write(r8a66597, TRCLR, ep->pipetre);
- r8a66597_write(r8a66597,
-- (req->req.length + ep->ep.maxpacket - 1)
-- / ep->ep.maxpacket,
-- ep->fifotrn);
-+ DIV_ROUND_UP(req->req.length, ep->ep.maxpacket),
-+ ep->pipetrn);
-+ r8a66597_bset(r8a66597, TRENB, ep->pipetre);
-+ }
-+
-+ if (sudmac_alloc_channel(r8a66597, ep, req) < 0) {
-+ /* PIO mode */
-+ change_bfre_mode(r8a66597, ep->pipenum, 0);
-+ pipe_start(r8a66597, pipenum); /* trigger once */
-+ pipe_irq_enable(r8a66597, pipenum);
-+ } else {
-+ pipe_change(r8a66597, pipenum);
-+ sudmac_start(r8a66597, ep, req);
-+ pipe_start(r8a66597, pipenum); /* trigger once */
- }
-- pipe_start(r8a66597, pipenum); /* trigger once */
-- pipe_irq_enable(r8a66597, pipenum);
- }
- }
-
-@@ -694,6 +927,9 @@ __acquires(r8a66597->lock)
- if (!list_empty(&ep->queue))
- restart = 1;
-
-+ if (ep->use_dma)
-+ sudmac_free_channel(ep->r8a66597, ep, req);
-+
- spin_unlock(&ep->r8a66597->lock);
- req->req.complete(&ep->ep, &req->req);
- spin_lock(&ep->r8a66597->lock);
-@@ -1170,6 +1406,65 @@ __acquires(r8a66597->lock)
- }
- }
-
-+static void sudmac_finish(struct r8a66597 *r8a66597, struct r8a66597_ep *ep)
-+{
-+ u16 pipenum;
-+ struct r8a66597_request *req;
-+ u32 len;
-+ int i = 0;
-+
-+ pipenum = ep->pipenum;
-+ pipe_change(r8a66597, pipenum);
-+
-+ while (!(r8a66597_read(r8a66597, ep->fifoctr) & FRDY)) {
-+ udelay(1);
-+ if (unlikely(i++ >= 10000)) { /* timeout = 10 msec */
-+ dev_err(r8a66597_to_dev(r8a66597),
-+ "%s: FRDY was not set (%d)\n",
-+ __func__, pipenum);
-+ return;
-+ }
-+ }
-+
-+ r8a66597_bset(r8a66597, BCLR, ep->fifoctr);
-+ req = get_request_from_ep(ep);
-+
-+ /* prepare parameters */
-+ len = r8a66597_sudmac_read(r8a66597, CH0CBC);
-+ req->req.actual += len;
-+
-+ /* clear */
-+ r8a66597_sudmac_write(r8a66597, CH0STCLR, DSTSCLR);
-+
-+ /* check transfer finish */
-+ if ((!req->req.zero && (req->req.actual == req->req.length))
-+ || (len % ep->ep.maxpacket)) {
-+ if (ep->dma->dir) {
-+ disable_irq_ready(r8a66597, pipenum);
-+ enable_irq_empty(r8a66597, pipenum);
-+ } else {
-+ /* Clear the interrupt flag for next transfer */
-+ r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
-+ transfer_complete(ep, req, 0);
-+ }
-+ }
-+}
-+
-+static void r8a66597_sudmac_irq(struct r8a66597 *r8a66597)
-+{
-+ u32 irqsts;
-+ struct r8a66597_ep *ep;
-+ u16 pipenum;
-+
-+ irqsts = r8a66597_sudmac_read(r8a66597, DINTSTS);
-+ if (irqsts & CH0ENDS) {
-+ r8a66597_sudmac_write(r8a66597, CH0ENDC, DINTSTSCLR);
-+ pipenum = (r8a66597_read(r8a66597, D0FIFOSEL) & CURPIPE);
-+ ep = r8a66597->pipenum2ep[pipenum];
-+ sudmac_finish(r8a66597, ep);
-+ }
-+}
-+
- static irqreturn_t r8a66597_irq(int irq, void *_r8a66597)
- {
- struct r8a66597 *r8a66597 = _r8a66597;
-@@ -1180,6 +1475,9 @@ static irqreturn_t r8a66597_irq(int irq,
- u16 savepipe;
- u16 mask0;
-
-+ if (r8a66597_is_sudmac(r8a66597))
-+ r8a66597_sudmac_irq(r8a66597);
-+
- spin_lock(&r8a66597->lock);
-
- intsts0 = r8a66597_read(r8a66597, INTSTS0);
-@@ -1541,6 +1839,8 @@ static int __exit r8a66597_remove(struct
-
- del_timer_sync(&r8a66597->timer);
- iounmap(r8a66597->reg);
-+ if (r8a66597->pdata->sudmac)
-+ iounmap(r8a66597->sudmac_reg);
- free_irq(platform_get_irq(pdev, 0), r8a66597);
- r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req);
- #ifdef CONFIG_HAVE_CLK
-@@ -1557,6 +1857,26 @@ static void nop_completion(struct usb_ep
- {
- }
-
-+static int __init r8a66597_sudmac_ioremap(struct r8a66597 *r8a66597,
-+ struct platform_device *pdev)
-+{
-+ struct resource *res;
-+
-+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sudmac");
-+ if (!res) {
-+ dev_err(&pdev->dev, "platform_get_resource error(sudmac).\n");
-+ return -ENODEV;
-+ }
-+
-+ r8a66597->sudmac_reg = ioremap(res->start, resource_size(res));
-+ if (r8a66597->sudmac_reg == NULL) {
-+ dev_err(&pdev->dev, "ioremap error(sudmac).\n");
-+ return -ENOMEM;
-+ }
-+
-+ return 0;
-+}
-+
- static int __init r8a66597_probe(struct platform_device *pdev)
- {
- #ifdef CONFIG_HAVE_CLK
-@@ -1634,6 +1954,11 @@ static int __init r8a66597_probe(struct
- clk_enable(r8a66597->clk);
- }
- #endif
-+ if (r8a66597->pdata->sudmac) {
-+ ret = r8a66597_sudmac_ioremap(r8a66597, pdev);
-+ if (ret < 0)
-+ goto clean_up2;
-+ }
-
- disable_controller(r8a66597); /* make sure controller is disabled */
-
-@@ -1666,7 +1991,6 @@ static int __init r8a66597_probe(struct
- r8a66597->ep[0].fifoaddr = CFIFO;
- r8a66597->ep[0].fifosel = CFIFOSEL;
- r8a66597->ep[0].fifoctr = CFIFOCTR;
-- r8a66597->ep[0].fifotrn = 0;
- r8a66597->ep[0].pipectr = get_pipectr_addr(0);
- r8a66597->pipenum2ep[0] = &r8a66597->ep[0];
- r8a66597->epaddr2ep[0] = &r8a66597->ep[0];
-@@ -1695,6 +2019,8 @@ clean_up2:
- #endif
- clean_up:
- if (r8a66597) {
-+ if (r8a66597->sudmac_reg)
-+ iounmap(r8a66597->sudmac_reg);
- if (r8a66597->ep0_req)
- r8a66597_free_request(&r8a66597->ep[0].ep,
- r8a66597->ep0_req);
---- a/drivers/usb/gadget/r8a66597-udc.h
-+++ b/drivers/usb/gadget/r8a66597-udc.h
-@@ -43,6 +43,7 @@
- ((pipenum >= R8A66597_BASE_PIPENUM_ISOC) && \
- (pipenum < (R8A66597_BASE_PIPENUM_ISOC + R8A66597_MAX_NUM_ISOC)))
-
-+#define r8a66597_is_sudmac(r8a66597) (r8a66597->pdata->sudmac)
- struct r8a66597_pipe_info {
- u16 pipe;
- u16 epnum;
-@@ -60,6 +61,7 @@ struct r8a66597_request {
- struct r8a66597_ep {
- struct usb_ep ep;
- struct r8a66597 *r8a66597;
-+ struct r8a66597_dma *dma;
-
- struct list_head queue;
- unsigned busy:1;
-@@ -75,13 +77,20 @@ struct r8a66597_ep {
- unsigned char fifoaddr;
- unsigned char fifosel;
- unsigned char fifoctr;
-- unsigned char fifotrn;
- unsigned char pipectr;
-+ unsigned char pipetre;
-+ unsigned char pipetrn;
-+};
-+
-+struct r8a66597_dma {
-+ unsigned used:1;
-+ unsigned dir:1; /* 1 = IN(write), 0 = OUT(read) */
- };
-
- struct r8a66597 {
- spinlock_t lock;
- void __iomem *reg;
-+ void __iomem *sudmac_reg;
-
- #ifdef CONFIG_HAVE_CLK
- struct clk *clk;
-@@ -94,6 +103,7 @@ struct r8a66597 {
- struct r8a66597_ep ep[R8A66597_MAX_NUM_PIPE];
- struct r8a66597_ep *pipenum2ep[R8A66597_MAX_NUM_PIPE];
- struct r8a66597_ep *epaddr2ep[16];
-+ struct r8a66597_dma dma;
-
- struct timer_list timer;
- struct usb_request *ep0_req; /* for internal request */
-@@ -251,7 +261,21 @@ static inline u16 get_xtal_from_pdata(st
- return clock;
- }
-
-+static inline u32 r8a66597_sudmac_read(struct r8a66597 *r8a66597,
-+ unsigned long offset)
-+{
-+ return ioread32(r8a66597->sudmac_reg + offset);
-+}
-+
-+static inline void r8a66597_sudmac_write(struct r8a66597 *r8a66597, u32 val,
-+ unsigned long offset)
-+{
-+ iowrite32(val, r8a66597->sudmac_reg + offset);
-+}
-+
- #define get_pipectr_addr(pipenum) (PIPE1CTR + (pipenum - 1) * 2)
-+#define get_pipetre_addr(pipenum) (PIPE1TRE + (pipenum - 1) * 4)
-+#define get_pipetrn_addr(pipenum) (PIPE1TRN + (pipenum - 1) * 4)
-
- #define enable_irq_ready(r8a66597, pipenum) \
- enable_pipe_irq(r8a66597, pipenum, BRDYENB)
---- a/include/linux/usb/r8a66597.h
-+++ b/include/linux/usb/r8a66597.h
-@@ -48,6 +48,9 @@ struct r8a66597_platdata {
-
- /* (external controller only) set one = WR0_N shorted to WR1_N */
- unsigned wr0_shorted_to_wr1:1;
-+
-+ /* set one = using SUDMAC */
-+ unsigned sudmac:1;
- };
-
- /* Register definitions */
-@@ -417,5 +420,62 @@ struct r8a66597_platdata {
- #define USBSPD 0x00C0
- #define RTPORT 0x0001
-
-+/* SUDMAC registers */
-+#define CH0CFG 0x00
-+#define CH1CFG 0x04
-+#define CH0BA 0x10
-+#define CH1BA 0x14
-+#define CH0BBC 0x18
-+#define CH1BBC 0x1C
-+#define CH0CA 0x20
-+#define CH1CA 0x24
-+#define CH0CBC 0x28
-+#define CH1CBC 0x2C
-+#define CH0DEN 0x30
-+#define CH1DEN 0x34
-+#define DSTSCLR 0x38
-+#define DBUFCTRL 0x3C
-+#define DINTCTRL 0x40
-+#define DINTSTS 0x44
-+#define DINTSTSCLR 0x48
-+#define CH0SHCTRL 0x50
-+#define CH1SHCTRL 0x54
-+
-+/* SUDMAC Configuration Registers */
-+#define SENDBUFM 0x1000 /* b12: Transmit Buffer Mode */
-+#define RCVENDM 0x0100 /* b8: Receive Data Transfer End Mode */
-+#define LBA_WAIT 0x0030 /* b5-4: Local Bus Access Wait */
-+
-+/* DMA Enable Registers */
-+#define DEN 0x0001 /* b1: DMA Transfer Enable */
-+
-+/* DMA Status Clear Register */
-+#define CH1STCLR 0x0002 /* b2: Ch1 DMA Status Clear */
-+#define CH0STCLR 0x0001 /* b1: Ch0 DMA Status Clear */
-+
-+/* DMA Buffer Control Register */
-+#define CH1BUFW 0x0200 /* b9: Ch1 DMA Buffer Data Transfer Enable */
-+#define CH0BUFW 0x0100 /* b8: Ch0 DMA Buffer Data Transfer Enable */
-+#define CH1BUFS 0x0002 /* b2: Ch1 DMA Buffer Data Status */
-+#define CH0BUFS 0x0001 /* b1: Ch0 DMA Buffer Data Status */
-+
-+/* DMA Interrupt Control Register */
-+#define CH1ERRE 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Enable */
-+#define CH0ERRE 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Enable */
-+#define CH1ENDE 0x0002 /* b2: Ch1 DMA Transfer End Int Enable */
-+#define CH0ENDE 0x0001 /* b1: Ch0 DMA Transfer End Int Enable */
-+
-+/* DMA Interrupt Status Register */
-+#define CH1ERRS 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Status */
-+#define CH0ERRS 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Status */
-+#define CH1ENDS 0x0002 /* b2: Ch1 DMA Transfer End Int Status */
-+#define CH0ENDS 0x0001 /* b1: Ch0 DMA Transfer End Int Status */
-+
-+/* DMA Interrupt Status Clear Register */
-+#define CH1ERRC 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Stat Clear */
-+#define CH0ERRC 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Stat Clear */
-+#define CH1ENDC 0x0002 /* b2: Ch1 DMA Transfer End Int Stat Clear */
-+#define CH0ENDC 0x0001 /* b1: Ch0 DMA Transfer End Int Stat Clear */
-+
- #endif /* __LINUX_USB_R8A66597_H */
-
diff --git a/patches.r8a66597-udc/012-usb-gadget-r8a66597-udc-fix-flush-fifo-handling.patch b/patches.r8a66597-udc/012-usb-gadget-r8a66597-udc-fix-flush-fifo-handling.patch
deleted file mode 100644
index 0516a9e70cbc7a..00000000000000
--- a/patches.r8a66597-udc/012-usb-gadget-r8a66597-udc-fix-flush-fifo-handling.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 23:23:40 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 29 May 2012 15:23:36 +0900
-Subject: [LTSI-dev] [PATCH 12/12] usb: gadget: r8a66597-udc: fix flush fifo handling
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC46B68.2050500@renesas.com>
-
-
->From 4014d3e59bb75141c49cf7161f385ff1bdaf2eed Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 31 Oct 2011 16:01:33 +0900
-Subject: usb: gadget: r8a66597-udc: fix flush fifo handling
-
-The "BCLR" in CFIFOCTR/DnFIFOCTR can flush the fifo of "CPU side" only.
-To flush the fifo of "SIE side", we have to use the "ACLRM" in PIPEnCTR.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 05bb7013038a2b609aef14ad4e07afe031daec49)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/usb/gadget/r8a66597-udc.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/drivers/usb/gadget/r8a66597-udc.c
-+++ b/drivers/usb/gadget/r8a66597-udc.c
-@@ -1718,6 +1718,8 @@ static void r8a66597_fifo_flush(struct u
- if (list_empty(&ep->queue) && !ep->busy) {
- pipe_stop(ep->r8a66597, ep->pipenum);
- r8a66597_bclr(ep->r8a66597, BCLR, ep->fifoctr);
-+ r8a66597_write(ep->r8a66597, ACLRM, ep->pipectr);
-+ r8a66597_write(ep->r8a66597, 0, ep->pipectr);
- }
- spin_unlock_irqrestore(&ep->r8a66597->lock, flags);
- }
diff --git a/patches.runtime_pm/0001-Revert-PM-Runtime-Automatically-retry-failed-autosus.patch b/patches.runtime_pm/0001-Revert-PM-Runtime-Automatically-retry-failed-autosus.patch
deleted file mode 100644
index e81ab237fbf736..00000000000000
--- a/patches.runtime_pm/0001-Revert-PM-Runtime-Automatically-retry-failed-autosus.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 9875e01a633d878cb016cff8a349da2a090b4720 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Sat, 21 Apr 2012 02:09:00 +0900
-Subject: Revert "PM / Runtime: Automatically retry failed autosuspends"
-
-This reverts commit 8dc9c7911421d8e45901ffaf483b5dca99cbb055.
-
-The origin of this change, 886486b792e4f6f96d4fbe8ec5bf20811cab7d6a,
-will be included in a fuller backport of PM which follows.
-The reason for reverting this is to avoid conflicts when
-backporting other PM fixes to the same file.
----
- Documentation/power/runtime_pm.txt | 10 ----------
- drivers/base/power/runtime.c | 18 ++----------------
- 2 files changed, 2 insertions(+), 26 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 6ade987..b24875b 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -708,16 +708,6 @@ will behave normally, not taking the autosuspend delay into account.
- Similarly, if the power.use_autosuspend field isn't set then the autosuspend
- helper functions will behave just like the non-autosuspend counterparts.
-
--Under some circumstances a driver or subsystem may want to prevent a device
--from autosuspending immediately, even though the usage counter is zero and the
--autosuspend delay time has expired. If the ->runtime_suspend() callback
--returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is
--in the future (as it normally would be if the callback invoked
--pm_runtime_mark_last_busy()), the PM core will automatically reschedule the
--autosuspend. The ->runtime_suspend() callback can't do this rescheduling
--itself because no suspend requests of any kind are accepted while the device is
--suspending (i.e., while the callback is running).
--
- The implementation is well suited for asynchronous use in interrupt contexts.
- However such use inevitably involves races, because the PM core can't
- synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 1023392..0d4587b 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -278,9 +278,6 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- * If a deferred resume was requested while the callback was running then carry
- * it out; otherwise send an idle notification for the device (if the suspend
- * failed) or for its parent (if the suspend succeeded).
-- * If ->runtime_suspend failed with -EAGAIN or -EBUSY, and if the RPM_AUTO
-- * flag is set and the next autosuspend-delay expiration time is in the
-- * future, schedule another autosuspend attempt.
- *
- * This function must be called under dev->power.lock with interrupts disabled.
- */
-@@ -392,21 +389,10 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- if (retval) {
- __update_runtime_status(dev, RPM_ACTIVE);
- dev->power.deferred_resume = 0;
-- if (retval == -EAGAIN || retval == -EBUSY) {
-+ if (retval == -EAGAIN || retval == -EBUSY)
- dev->power.runtime_error = 0;
--
-- /*
-- * If the callback routine failed an autosuspend, and
-- * if the last_busy time has been updated so that there
-- * is a new autosuspend expiration time, automatically
-- * reschedule another autosuspend.
-- */
-- if ((rpmflags & RPM_AUTO) &&
-- pm_runtime_autosuspend_expiration(dev) != 0)
-- goto repeat;
-- } else {
-+ else
- pm_runtime_cancel_pending(dev);
-- }
- } else {
- no_callback:
- __update_runtime_status(dev, RPM_SUSPENDED);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0002-PM-Domains-Rename-struct-dev_power_domain-to-struct-.patch b/patches.runtime_pm/0002-PM-Domains-Rename-struct-dev_power_domain-to-struct-.patch
deleted file mode 100644
index 9dd71557ecdca7..00000000000000
--- a/patches.runtime_pm/0002-PM-Domains-Rename-struct-dev_power_domain-to-struct-.patch
+++ /dev/null
@@ -1,397 +0,0 @@
-From 2693f3ae83d1066e9b83faafa2a92c933aee9667 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 23 Jun 2011 01:52:55 +0200
-Subject: PM / Domains: Rename struct dev_power_domain to struct dev_pm_domain
-
-The naming convention used by commit 7538e3db6e015e890825fbd9f86599b
-(PM: Add support for device power domains), which introduced the
-struct dev_power_domain type for representing device power domains,
-evidently confuses some developers who tend to think that objects
-of this type must correspond to "power domains" as defined by
-hardware, which is not the case. Namely, at the kernel level, a
-struct dev_power_domain object can represent arbitrary set of devices
-that are mutually dependent power management-wise and need not belong
-to one hardware power domain. To avoid that confusion, rename struct
-dev_power_domain to struct dev_pm_domain and rename the related
-pointers in struct device and struct pm_clk_notifier_block from
-pwr_domain to pm_domain.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 564b905ab10d17fb42f86aa8b7b9b796276d1336)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 8 ++++----
- arch/arm/mach-omap1/pm_bus.c | 8 ++++----
- arch/arm/mach-shmobile/pm_runtime.c | 8 ++++----
- arch/arm/plat-omap/omap_device.c | 4 ++--
- arch/sh/kernel/cpu/shmobile/pm_runtime.c | 6 +++---
- drivers/base/power/clock_ops.c | 14 +++++++-------
- drivers/base/power/main.c | 30 +++++++++++++++---------------
- drivers/base/power/runtime.c | 12 ++++++------
- include/linux/device.h | 4 ++--
- include/linux/pm.h | 2 +-
- include/linux/pm_runtime.h | 2 +-
- 11 files changed, 49 insertions(+), 49 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 64565aa..85c6f98 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -506,8 +506,8 @@ routines. Nevertheless, different callback pointers are used in case there is a
- situation where it actually matters.
-
-
--Device Power Domains
----------------------
-+Device Power Management Domains
-+-------------------------------
- Sometimes devices share reference clocks or other power resources. In those
- cases it generally is not possible to put devices into low-power states
- individually. Instead, a set of devices sharing a power resource can be put
-@@ -516,8 +516,8 @@ power resource. Of course, they also need to be put into the full-power state
- together, by turning the shared power resource on. A set of devices with this
- property is often referred to as a power domain.
-
--Support for power domains is provided through the pwr_domain field of struct
--device. This field is a pointer to an object of type struct dev_power_domain,
-+Support for power domains is provided through the pm_domain field of struct
-+device. This field is a pointer to an object of type struct dev_pm_domain,
- defined in include/linux/pm.h, providing a set of power management callbacks
- analogous to the subsystem-level and device driver callbacks that are executed
- for the given device during all power transitions, instead of the respective
-diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
-index 334fb88..212f331 100644
---- a/arch/arm/mach-omap1/pm_bus.c
-+++ b/arch/arm/mach-omap1/pm_bus.c
-@@ -49,20 +49,20 @@ static int omap1_pm_runtime_resume(struct device *dev)
- return pm_generic_runtime_resume(dev);
- }
-
--static struct dev_power_domain default_power_domain = {
-+static struct dev_pm_domain default_pm_domain = {
- .ops = {
- .runtime_suspend = omap1_pm_runtime_suspend,
- .runtime_resume = omap1_pm_runtime_resume,
- USE_PLATFORM_PM_SLEEP_OPS
- },
- };
--#define OMAP1_PWR_DOMAIN (&default_power_domain)
-+#define OMAP1_PM_DOMAIN (&default_pm_domain)
- #else
--#define OMAP1_PWR_DOMAIN NULL
-+#define OMAP1_PM_DOMAIN NULL
- #endif /* CONFIG_PM_RUNTIME */
-
- static struct pm_clk_notifier_block platform_bus_notifier = {
-- .pwr_domain = OMAP1_PWR_DOMAIN,
-+ .pm_domain = OMAP1_PM_DOMAIN,
- .con_ids = { "ick", "fck", NULL, },
- };
-
-diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
-index 2d1b67a..99802d2 100644
---- a/arch/arm/mach-shmobile/pm_runtime.c
-+++ b/arch/arm/mach-shmobile/pm_runtime.c
-@@ -28,7 +28,7 @@ static int default_platform_runtime_idle(struct device *dev)
- return pm_runtime_suspend(dev);
- }
-
--static struct dev_power_domain default_power_domain = {
-+static struct dev_pm_domain default_pm_domain = {
- .ops = {
- .runtime_suspend = pm_runtime_clk_suspend,
- .runtime_resume = pm_runtime_clk_resume,
-@@ -37,16 +37,16 @@ static struct dev_power_domain default_power_domain = {
- },
- };
-
--#define DEFAULT_PWR_DOMAIN_PTR (&default_power_domain)
-+#define DEFAULT_PM_DOMAIN_PTR (&default_pm_domain)
-
- #else
-
--#define DEFAULT_PWR_DOMAIN_PTR NULL
-+#define DEFAULT_PM_DOMAIN_PTR NULL
-
- #endif /* CONFIG_PM_RUNTIME */
-
- static struct pm_clk_notifier_block platform_bus_notifier = {
-- .pwr_domain = DEFAULT_PWR_DOMAIN_PTR,
-+ .pm_domain = DEFAULT_PM_DOMAIN_PTR,
- .con_ids = { NULL, },
- };
-
-diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
-index 49fc0df..d21579b 100644
---- a/arch/arm/plat-omap/omap_device.c
-+++ b/arch/arm/plat-omap/omap_device.c
-@@ -564,7 +564,7 @@ static int _od_runtime_resume(struct device *dev)
- return pm_generic_runtime_resume(dev);
- }
-
--static struct dev_power_domain omap_device_power_domain = {
-+static struct dev_pm_domain omap_device_pm_domain = {
- .ops = {
- .runtime_suspend = _od_runtime_suspend,
- .runtime_idle = _od_runtime_idle,
-@@ -586,7 +586,7 @@ int omap_device_register(struct omap_device *od)
- pr_debug("omap_device: %s: registering\n", od->pdev.name);
-
- od->pdev.dev.parent = &omap_device_parent;
-- od->pdev.dev.pwr_domain = &omap_device_power_domain;
-+ od->pdev.dev.pm_domain = &omap_device_pm_domain;
- return platform_device_register(&od->pdev);
- }
-
-diff --git a/arch/sh/kernel/cpu/shmobile/pm_runtime.c b/arch/sh/kernel/cpu/shmobile/pm_runtime.c
-index 64c807c..bf280c8 100644
---- a/arch/sh/kernel/cpu/shmobile/pm_runtime.c
-+++ b/arch/sh/kernel/cpu/shmobile/pm_runtime.c
-@@ -256,7 +256,7 @@ out:
- return ret;
- }
-
--static struct dev_power_domain default_power_domain = {
-+static struct dev_pm_domain default_pm_domain = {
- .ops = {
- .runtime_suspend = default_platform_runtime_suspend,
- .runtime_resume = default_platform_runtime_resume,
-@@ -285,7 +285,7 @@ static int platform_bus_notify(struct notifier_block *nb,
- hwblk_disable(hwblk_info, hwblk);
- /* make sure driver re-inits itself once */
- __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags);
-- dev->pwr_domain = &default_power_domain;
-+ dev->pm_domain = &default_pm_domain;
- break;
- /* TODO: add BUS_NOTIFY_BIND_DRIVER and increase idle count */
- case BUS_NOTIFY_BOUND_DRIVER:
-@@ -299,7 +299,7 @@ static int platform_bus_notify(struct notifier_block *nb,
- __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags);
- break;
- case BUS_NOTIFY_DEL_DEVICE:
-- dev->pwr_domain = NULL;
-+ dev->pm_domain = NULL;
- break;
- }
- return 0;
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index ad367c4..c562481 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -278,11 +278,11 @@ int pm_runtime_clk_resume(struct device *dev)
- *
- * For this function to work, @nb must be a member of an object of type
- * struct pm_clk_notifier_block containing all of the requisite data.
-- * Specifically, the pwr_domain member of that object is copied to the device's
-- * pwr_domain field and its con_ids member is used to populate the device's list
-+ * Specifically, the pm_domain member of that object is copied to the device's
-+ * pm_domain field and its con_ids member is used to populate the device's list
- * of runtime PM clocks, depending on @action.
- *
-- * If the device's pwr_domain field is already populated with a value different
-+ * If the device's pm_domain field is already populated with a value different
- * from the one stored in the struct pm_clk_notifier_block object, the function
- * does nothing.
- */
-@@ -300,14 +300,14 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
-
- switch (action) {
- case BUS_NOTIFY_ADD_DEVICE:
-- if (dev->pwr_domain)
-+ if (dev->pm_domain)
- break;
-
- error = pm_runtime_clk_init(dev);
- if (error)
- break;
-
-- dev->pwr_domain = clknb->pwr_domain;
-+ dev->pm_domain = clknb->pm_domain;
- if (clknb->con_ids[0]) {
- for (con_id = clknb->con_ids; *con_id; con_id++)
- pm_runtime_clk_add(dev, *con_id);
-@@ -317,10 +317,10 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
-
- break;
- case BUS_NOTIFY_DEL_DEVICE:
-- if (dev->pwr_domain != clknb->pwr_domain)
-+ if (dev->pm_domain != clknb->pm_domain)
- break;
-
-- dev->pwr_domain = NULL;
-+ dev->pm_domain = NULL;
- pm_runtime_clk_destroy(dev);
- break;
- }
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 06f09bf..85b591a 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -425,9 +425,9 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
- TRACE_DEVICE(dev);
- TRACE_RESUME(0);
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "EARLY power domain ");
-- error = pm_noirq_op(dev, &dev->pwr_domain->ops, state);
-+ error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
- } else if (dev->type && dev->type->pm) {
- pm_dev_dbg(dev, state, "EARLY type ");
- error = pm_noirq_op(dev, dev->type->pm, state);
-@@ -521,9 +521,9 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- if (!dev->power.is_suspended)
- goto Unlock;
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "power domain ");
-- error = pm_op(dev, &dev->pwr_domain->ops, state);
-+ error = pm_op(dev, &dev->pm_domain->ops, state);
- goto End;
- }
-
-@@ -641,10 +641,10 @@ static void device_complete(struct device *dev, pm_message_t state)
- {
- device_lock(dev);
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "completing power domain ");
-- if (dev->pwr_domain->ops.complete)
-- dev->pwr_domain->ops.complete(dev);
-+ if (dev->pm_domain->ops.complete)
-+ dev->pm_domain->ops.complete(dev);
- } else if (dev->type && dev->type->pm) {
- pm_dev_dbg(dev, state, "completing type ");
- if (dev->type->pm->complete)
-@@ -744,9 +744,9 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
- {
- int error;
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "LATE power domain ");
-- error = pm_noirq_op(dev, &dev->pwr_domain->ops, state);
-+ error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
- if (error)
- return error;
- } else if (dev->type && dev->type->pm) {
-@@ -853,9 +853,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- goto Unlock;
- }
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "power domain ");
-- error = pm_op(dev, &dev->pwr_domain->ops, state);
-+ error = pm_op(dev, &dev->pm_domain->ops, state);
- goto End;
- }
-
-@@ -982,11 +982,11 @@ static int device_prepare(struct device *dev, pm_message_t state)
-
- device_lock(dev);
-
-- if (dev->pwr_domain) {
-+ if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "preparing power domain ");
-- if (dev->pwr_domain->ops.prepare)
-- error = dev->pwr_domain->ops.prepare(dev);
-- suspend_report_result(dev->pwr_domain->ops.prepare, error);
-+ if (dev->pm_domain->ops.prepare)
-+ error = dev->pm_domain->ops.prepare(dev);
-+ suspend_report_result(dev->pm_domain->ops.prepare, error);
- if (error)
- goto End;
- } else if (dev->type && dev->type->pm) {
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 0d4587b..5f5c423 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -213,8 +213,8 @@ static int rpm_idle(struct device *dev, int rpmflags)
-
- dev->power.idle_notification = true;
-
-- if (dev->pwr_domain)
-- callback = dev->pwr_domain->ops.runtime_idle;
-+ if (dev->pm_domain)
-+ callback = dev->pm_domain->ops.runtime_idle;
- else if (dev->type && dev->type->pm)
- callback = dev->type->pm->runtime_idle;
- else if (dev->class && dev->class->pm)
-@@ -374,8 +374,8 @@ static int rpm_suspend(struct device *dev, int rpmflags)
-
- __update_runtime_status(dev, RPM_SUSPENDING);
-
-- if (dev->pwr_domain)
-- callback = dev->pwr_domain->ops.runtime_suspend;
-+ if (dev->pm_domain)
-+ callback = dev->pm_domain->ops.runtime_suspend;
- else if (dev->type && dev->type->pm)
- callback = dev->type->pm->runtime_suspend;
- else if (dev->class && dev->class->pm)
-@@ -573,8 +573,8 @@ static int rpm_resume(struct device *dev, int rpmflags)
-
- __update_runtime_status(dev, RPM_RESUMING);
-
-- if (dev->pwr_domain)
-- callback = dev->pwr_domain->ops.runtime_resume;
-+ if (dev->pm_domain)
-+ callback = dev->pm_domain->ops.runtime_resume;
- else if (dev->type && dev->type->pm)
- callback = dev->type->pm->runtime_resume;
- else if (dev->class && dev->class->pm)
-diff --git a/include/linux/device.h b/include/linux/device.h
-index 680656e..ad8ecfd 100644
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -585,7 +585,7 @@ struct device_dma_parameters {
- * minimizes board-specific #ifdefs in drivers.
- * @power: For device power management.
- * See Documentation/power/devices.txt for details.
-- * @pwr_domain: Provide callbacks that are executed during system suspend,
-+ * @pm_domain: Provide callbacks that are executed during system suspend,
- * hibernation, system resume and during runtime PM transitions
- * along with subsystem-level and driver-level callbacks.
- * @numa_node: NUMA node this device is close to.
-@@ -636,7 +636,7 @@ struct device {
- void *platform_data; /* Platform specific data, device
- core doesn't touch it */
- struct dev_pm_info power;
-- struct dev_power_domain *pwr_domain;
-+ struct dev_pm_domain *pm_domain;
-
- #ifdef CONFIG_NUMA
- int numa_node; /* NUMA node this device is close to */
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 411e4f4..e396320 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -472,7 +472,7 @@ extern void update_pm_runtime_accounting(struct device *dev);
- * hibernation, system resume and during runtime PM transitions along with
- * subsystem-level and driver-level callbacks.
- */
--struct dev_power_domain {
-+struct dev_pm_domain {
- struct dev_pm_ops ops;
- };
-
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 878cf84..ef91904 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -247,7 +247,7 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
-
- struct pm_clk_notifier_block {
- struct notifier_block nb;
-- struct dev_power_domain *pwr_domain;
-+ struct dev_pm_domain *pm_domain;
- char *con_ids[];
- };
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0003-PM-subsys_data-in-struct-dev_pm_info-need-not-depend.patch b/patches.runtime_pm/0003-PM-subsys_data-in-struct-dev_pm_info-need-not-depend.patch
deleted file mode 100644
index d80f1486cbd3fa..00000000000000
--- a/patches.runtime_pm/0003-PM-subsys_data-in-struct-dev_pm_info-need-not-depend.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 475efc5f01d3a5fa3641c6e11e5f1981ddfaa52c Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 23 Jun 2011 01:53:04 +0200
-Subject: PM: subsys_data in struct dev_pm_info need not depend on RM_RUNTIME
-
-The subsys_data field of struct dev_pm_info, introduced by commit
-1d2b71f61b6a10216274e27b717becf9ae101fc7 (PM / Runtime: Add subsystem
-data field to struct dev_pm_info), is going to be used even if
-CONFIG_PM_RUNTIME is not set, so move it from under the #ifdef.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit dc6e4e56e6ef473a696a1ab24f80b79b9aceb92d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index e396320..7e8f076 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -461,8 +461,8 @@ struct dev_pm_info {
- unsigned long active_jiffies;
- unsigned long suspended_jiffies;
- unsigned long accounting_timestamp;
-- void *subsys_data; /* Owned by the subsystem. */
- #endif
-+ void *subsys_data; /* Owned by the subsystem. */
- };
-
- extern void update_pm_runtime_accounting(struct device *dev);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0004-PM-Domains-Support-for-generic-I-O-PM-domains-v8.patch b/patches.runtime_pm/0004-PM-Domains-Support-for-generic-I-O-PM-domains-v8.patch
deleted file mode 100644
index aa72cbe35abfbb..00000000000000
--- a/patches.runtime_pm/0004-PM-Domains-Support-for-generic-I-O-PM-domains-v8.patch
+++ /dev/null
@@ -1,656 +0,0 @@
-From fbbeb16d1177d1a4de3242dc5e7c7bfd7ffeb10c Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:12:45 +0200
-Subject: PM / Domains: Support for generic I/O PM domains (v8)
-
-Introduce common headers, helper functions and callbacks allowing
-platforms to use simple generic power domains for runtime power
-management.
-
-Introduce struct generic_pm_domain to be used for representing
-power domains that each contain a number of devices and may be
-parent domains or subdomains with respect to other power domains.
-Among other things, this structure includes callbacks to be
-provided by platforms for performing specific tasks related to
-power management (i.e. ->stop_device() may disable a device's
-clocks, while ->start_device() may enable them, ->power_off() is
-supposed to remove power from the entire power domain
-and ->power_on() is supposed to restore it).
-
-Introduce functions that can be used as power domain runtime PM
-callbacks, pm_genpd_runtime_suspend() and pm_genpd_runtime_resume(),
-as well as helper functions for the initialization of a power
-domain represented by a struct generic_power_domain object,
-adding a device to or removing a device from it and adding or
-removing subdomains.
-
-Introduce configuration option CONFIG_PM_GENERIC_DOMAINS to be
-selected by the platforms that want to use the new code.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit f721889ff65afa6243c463832c74dee3bed418d5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/Makefile | 1 +
- drivers/base/power/domain.c | 494 +++++++++++++++++++++++++++++++++++++++++++
- include/linux/pm_domain.h | 78 +++++++
- kernel/power/Kconfig | 4 +
- 4 files changed, 577 insertions(+)
- create mode 100644 drivers/base/power/domain.c
- create mode 100644 include/linux/pm_domain.h
-
-diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
-index 3647e11..2639ae7 100644
---- a/drivers/base/power/Makefile
-+++ b/drivers/base/power/Makefile
-@@ -3,6 +3,7 @@ obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
- obj-$(CONFIG_PM_RUNTIME) += runtime.o
- obj-$(CONFIG_PM_TRACE_RTC) += trace.o
- obj-$(CONFIG_PM_OPP) += opp.o
-+obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o
- obj-$(CONFIG_HAVE_CLK) += clock_ops.o
-
- ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
-\ No newline at end of file
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-new file mode 100644
-index 0000000..fd31be3
---- /dev/null
-+++ b/drivers/base/power/domain.c
-@@ -0,0 +1,494 @@
-+/*
-+ * drivers/base/power/domain.c - Common code related to device power domains.
-+ *
-+ * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
-+ *
-+ * This file is released under the GPLv2.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+#include <linux/pm_runtime.h>
-+#include <linux/pm_domain.h>
-+#include <linux/slab.h>
-+#include <linux/err.h>
-+
-+#ifdef CONFIG_PM_RUNTIME
-+
-+static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
-+{
-+ if (!WARN_ON(genpd->sd_count == 0))
-+ genpd->sd_count--;
-+}
-+
-+/**
-+ * __pm_genpd_save_device - Save the pre-suspend state of a device.
-+ * @dle: Device list entry of the device to save the state of.
-+ * @genpd: PM domain the device belongs to.
-+ */
-+static int __pm_genpd_save_device(struct dev_list_entry *dle,
-+ struct generic_pm_domain *genpd)
-+{
-+ struct device *dev = dle->dev;
-+ struct device_driver *drv = dev->driver;
-+ int ret = 0;
-+
-+ if (dle->need_restore)
-+ return 0;
-+
-+ if (drv && drv->pm && drv->pm->runtime_suspend) {
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ ret = drv->pm->runtime_suspend(dev);
-+
-+ if (genpd->stop_device)
-+ genpd->stop_device(dev);
-+ }
-+
-+ if (!ret)
-+ dle->need_restore = true;
-+
-+ return ret;
-+}
-+
-+/**
-+ * __pm_genpd_restore_device - Restore the pre-suspend state of a device.
-+ * @dle: Device list entry of the device to restore the state of.
-+ * @genpd: PM domain the device belongs to.
-+ */
-+static void __pm_genpd_restore_device(struct dev_list_entry *dle,
-+ struct generic_pm_domain *genpd)
-+{
-+ struct device *dev = dle->dev;
-+ struct device_driver *drv = dev->driver;
-+
-+ if (!dle->need_restore)
-+ return;
-+
-+ if (drv && drv->pm && drv->pm->runtime_resume) {
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ drv->pm->runtime_resume(dev);
-+
-+ if (genpd->stop_device)
-+ genpd->stop_device(dev);
-+ }
-+
-+ dle->need_restore = false;
-+}
-+
-+/**
-+ * pm_genpd_poweroff - Remove power from a given PM domain.
-+ * @genpd: PM domain to power down.
-+ *
-+ * If all of the @genpd's devices have been suspended and all of its subdomains
-+ * have been powered down, run the runtime suspend callbacks provided by all of
-+ * the @genpd's devices' drivers and remove power from @genpd.
-+ */
-+static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
-+{
-+ struct generic_pm_domain *parent;
-+ struct dev_list_entry *dle;
-+ unsigned int not_suspended;
-+ int ret;
-+
-+ if (genpd->power_is_off)
-+ return 0;
-+
-+ if (genpd->sd_count > 0)
-+ return -EBUSY;
-+
-+ not_suspended = 0;
-+ list_for_each_entry(dle, &genpd->dev_list, node)
-+ if (dle->dev->driver && !pm_runtime_suspended(dle->dev))
-+ not_suspended++;
-+
-+ if (not_suspended > genpd->in_progress)
-+ return -EBUSY;
-+
-+ if (genpd->gov && genpd->gov->power_down_ok) {
-+ if (!genpd->gov->power_down_ok(&genpd->domain))
-+ return -EAGAIN;
-+ }
-+
-+ list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
-+ ret = __pm_genpd_save_device(dle, genpd);
-+ if (ret)
-+ goto err_dev;
-+ }
-+
-+ if (genpd->power_off)
-+ genpd->power_off(genpd);
-+
-+ genpd->power_is_off = true;
-+
-+ parent = genpd->parent;
-+ if (parent) {
-+ genpd_sd_counter_dec(parent);
-+ if (parent->sd_count == 0)
-+ queue_work(pm_wq, &parent->power_off_work);
-+ }
-+
-+ return 0;
-+
-+ err_dev:
-+ list_for_each_entry_continue(dle, &genpd->dev_list, node)
-+ __pm_genpd_restore_device(dle, genpd);
-+
-+ return ret;
-+}
-+
-+/**
-+ * genpd_power_off_work_fn - Power off PM domain whose subdomain count is 0.
-+ * @work: Work structure used for scheduling the execution of this function.
-+ */
-+static void genpd_power_off_work_fn(struct work_struct *work)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ genpd = container_of(work, struct generic_pm_domain, power_off_work);
-+
-+ if (genpd->parent)
-+ mutex_lock(&genpd->parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ pm_genpd_poweroff(genpd);
-+ mutex_unlock(&genpd->lock);
-+ if (genpd->parent)
-+ mutex_unlock(&genpd->parent->lock);
-+}
-+
-+/**
-+ * pm_genpd_runtime_suspend - Suspend a device belonging to I/O PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Carry out a runtime suspend of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_runtime_suspend(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (IS_ERR_OR_NULL(dev->pm_domain))
-+ return -EINVAL;
-+
-+ genpd = container_of(dev->pm_domain, struct generic_pm_domain, domain);
-+
-+ if (genpd->parent)
-+ mutex_lock(&genpd->parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+
-+ if (genpd->stop_device) {
-+ int ret = genpd->stop_device(dev);
-+ if (ret)
-+ goto out;
-+ }
-+ genpd->in_progress++;
-+ pm_genpd_poweroff(genpd);
-+ genpd->in_progress--;
-+
-+ out:
-+ mutex_unlock(&genpd->lock);
-+ if (genpd->parent)
-+ mutex_unlock(&genpd->parent->lock);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * @genpd: PM domain to power up.
-+ *
-+ * Restore power to @genpd and all of its parents so that it is possible to
-+ * resume a device belonging to it.
-+ */
-+static int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+{
-+ int ret = 0;
-+
-+ start:
-+ if (genpd->parent)
-+ mutex_lock(&genpd->parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+
-+ if (!genpd->power_is_off)
-+ goto out;
-+
-+ if (genpd->parent && genpd->parent->power_is_off) {
-+ mutex_unlock(&genpd->lock);
-+ mutex_unlock(&genpd->parent->lock);
-+
-+ ret = pm_genpd_poweron(genpd->parent);
-+ if (ret)
-+ return ret;
-+
-+ goto start;
-+ }
-+
-+ if (genpd->power_on) {
-+ int ret = genpd->power_on(genpd);
-+ if (ret)
-+ goto out;
-+ }
-+
-+ genpd->power_is_off = false;
-+ if (genpd->parent)
-+ genpd->parent->sd_count++;
-+
-+ out:
-+ mutex_unlock(&genpd->lock);
-+ if (genpd->parent)
-+ mutex_unlock(&genpd->parent->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
-+ * @dev: Device to resume.
-+ *
-+ * Carry out a runtime resume of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_runtime_resume(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+ struct dev_list_entry *dle;
-+ int ret;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (IS_ERR_OR_NULL(dev->pm_domain))
-+ return -EINVAL;
-+
-+ genpd = container_of(dev->pm_domain, struct generic_pm_domain, domain);
-+
-+ ret = pm_genpd_poweron(genpd);
-+ if (ret)
-+ return ret;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ list_for_each_entry(dle, &genpd->dev_list, node) {
-+ if (dle->dev == dev) {
-+ __pm_genpd_restore_device(dle, genpd);
-+ break;
-+ }
-+ }
-+
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ mutex_unlock(&genpd->lock);
-+
-+ return 0;
-+}
-+
-+#else
-+
-+static inline void genpd_power_off_work_fn(struct work_struct *work) {}
-+
-+#define pm_genpd_runtime_suspend NULL
-+#define pm_genpd_runtime_resume NULL
-+
-+#endif /* CONFIG_PM_RUNTIME */
-+
-+/**
-+ * pm_genpd_add_device - Add a device to an I/O PM domain.
-+ * @genpd: PM domain to add the device to.
-+ * @dev: Device to be added.
-+ */
-+int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ struct dev_list_entry *dle;
-+ int ret = 0;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(dev))
-+ return -EINVAL;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ if (genpd->power_is_off) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ list_for_each_entry(dle, &genpd->dev_list, node)
-+ if (dle->dev == dev) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ dle = kzalloc(sizeof(*dle), GFP_KERNEL);
-+ if (!dle) {
-+ ret = -ENOMEM;
-+ goto out;
-+ }
-+
-+ dle->dev = dev;
-+ dle->need_restore = false;
-+ list_add_tail(&dle->node, &genpd->dev_list);
-+
-+ spin_lock_irq(&dev->power.lock);
-+ dev->pm_domain = &genpd->domain;
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ out:
-+ mutex_unlock(&genpd->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_remove_device - Remove a device from an I/O PM domain.
-+ * @genpd: PM domain to remove the device from.
-+ * @dev: Device to be removed.
-+ */
-+int pm_genpd_remove_device(struct generic_pm_domain *genpd,
-+ struct device *dev)
-+{
-+ struct dev_list_entry *dle;
-+ int ret = -EINVAL;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(dev))
-+ return -EINVAL;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ list_for_each_entry(dle, &genpd->dev_list, node) {
-+ if (dle->dev != dev)
-+ continue;
-+
-+ spin_lock_irq(&dev->power.lock);
-+ dev->pm_domain = NULL;
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ list_del(&dle->node);
-+ kfree(dle);
-+
-+ ret = 0;
-+ break;
-+ }
-+
-+ mutex_unlock(&genpd->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
-+ * @genpd: Master PM domain to add the subdomain to.
-+ * @new_subdomain: Subdomain to be added.
-+ */
-+int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *new_subdomain)
-+{
-+ struct generic_pm_domain *subdomain;
-+ int ret = 0;
-+
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(new_subdomain))
-+ return -EINVAL;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ if (genpd->power_is_off && !new_subdomain->power_is_off) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ list_for_each_entry(subdomain, &genpd->sd_list, sd_node) {
-+ if (subdomain == new_subdomain) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+ }
-+
-+ mutex_lock_nested(&new_subdomain->lock, SINGLE_DEPTH_NESTING);
-+
-+ list_add_tail(&new_subdomain->sd_node, &genpd->sd_list);
-+ new_subdomain->parent = genpd;
-+ if (!subdomain->power_is_off)
-+ genpd->sd_count++;
-+
-+ mutex_unlock(&new_subdomain->lock);
-+
-+ out:
-+ mutex_unlock(&genpd->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_remove_subdomain - Remove a subdomain from an I/O PM domain.
-+ * @genpd: Master PM domain to remove the subdomain from.
-+ * @target: Subdomain to be removed.
-+ */
-+int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *target)
-+{
-+ struct generic_pm_domain *subdomain;
-+ int ret = -EINVAL;
-+
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(target))
-+ return -EINVAL;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ list_for_each_entry(subdomain, &genpd->sd_list, sd_node) {
-+ if (subdomain != target)
-+ continue;
-+
-+ mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
-+
-+ list_del(&subdomain->sd_node);
-+ subdomain->parent = NULL;
-+ if (!subdomain->power_is_off)
-+ genpd_sd_counter_dec(genpd);
-+
-+ mutex_unlock(&subdomain->lock);
-+
-+ ret = 0;
-+ break;
-+ }
-+
-+ mutex_unlock(&genpd->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_init - Initialize a generic I/O PM domain object.
-+ * @genpd: PM domain object to initialize.
-+ * @gov: PM domain governor to associate with the domain (may be NULL).
-+ * @is_off: Initial value of the domain's power_is_off field.
-+ */
-+void pm_genpd_init(struct generic_pm_domain *genpd,
-+ struct dev_power_governor *gov, bool is_off)
-+{
-+ if (IS_ERR_OR_NULL(genpd))
-+ return;
-+
-+ INIT_LIST_HEAD(&genpd->sd_node);
-+ genpd->parent = NULL;
-+ INIT_LIST_HEAD(&genpd->dev_list);
-+ INIT_LIST_HEAD(&genpd->sd_list);
-+ mutex_init(&genpd->lock);
-+ genpd->gov = gov;
-+ INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
-+ genpd->in_progress = 0;
-+ genpd->sd_count = 0;
-+ genpd->power_is_off = is_off;
-+ genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
-+ genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume;
-+ genpd->domain.ops.runtime_idle = pm_generic_runtime_idle;
-+}
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-new file mode 100644
-index 0000000..b1a22c6
---- /dev/null
-+++ b/include/linux/pm_domain.h
-@@ -0,0 +1,78 @@
-+/*
-+ * pm_domain.h - Definitions and headers related to device power domains.
-+ *
-+ * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
-+ *
-+ * This file is released under the GPLv2.
-+ */
-+
-+#ifndef _LINUX_PM_DOMAIN_H
-+#define _LINUX_PM_DOMAIN_H
-+
-+#include <linux/device.h>
-+
-+struct dev_power_governor {
-+ bool (*power_down_ok)(struct dev_pm_domain *domain);
-+};
-+
-+struct generic_pm_domain {
-+ struct dev_pm_domain domain; /* PM domain operations */
-+ struct list_head sd_node; /* Node in the parent's subdomain list */
-+ struct generic_pm_domain *parent; /* Parent PM domain */
-+ struct list_head sd_list; /* List of dubdomains */
-+ struct list_head dev_list; /* List of devices */
-+ struct mutex lock;
-+ struct dev_power_governor *gov;
-+ struct work_struct power_off_work;
-+ unsigned int in_progress; /* Number of devices being suspended now */
-+ unsigned int sd_count; /* Number of subdomains with power "on" */
-+ bool power_is_off; /* Whether or not power has been removed */
-+ int (*power_off)(struct generic_pm_domain *domain);
-+ int (*power_on)(struct generic_pm_domain *domain);
-+ int (*start_device)(struct device *dev);
-+ int (*stop_device)(struct device *dev);
-+};
-+
-+struct dev_list_entry {
-+ struct list_head node;
-+ struct device *dev;
-+ bool need_restore;
-+};
-+
-+#ifdef CONFIG_PM_GENERIC_DOMAINS
-+extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
-+ struct device *dev);
-+extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
-+ struct device *dev);
-+extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *new_subdomain);
-+extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *target);
-+extern void pm_genpd_init(struct generic_pm_domain *genpd,
-+ struct dev_power_governor *gov, bool is_off);
-+#else
-+static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
-+ struct device *dev)
-+{
-+ return -ENOSYS;
-+}
-+static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
-+ struct device *dev)
-+{
-+ return -ENOSYS;
-+}
-+static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *new_sd)
-+{
-+ return -ENOSYS;
-+}
-+static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-+ struct generic_pm_domain *target)
-+{
-+ return -ENOSYS;
-+}
-+static inline void pm_genpd_init(struct generic_pm_domain *genpd,
-+ struct dev_power_governor *gov, bool is_off) {}
-+#endif
-+
-+#endif /* _LINUX_PM_DOMAIN_H */
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 87f4d24..e83ac25 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -227,3 +227,7 @@ config PM_OPP
- config PM_RUNTIME_CLK
- def_bool y
- depends on PM_RUNTIME && HAVE_CLK
-+
-+config PM_GENERIC_DOMAINS
-+ bool
-+ depends on PM
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0005-PM-Introduce-generic-noirq-callback-routines-for-sub.patch b/patches.runtime_pm/0005-PM-Introduce-generic-noirq-callback-routines-for-sub.patch
deleted file mode 100644
index 57e59666c63e43..00000000000000
--- a/patches.runtime_pm/0005-PM-Introduce-generic-noirq-callback-routines-for-sub.patch
+++ /dev/null
@@ -1,340 +0,0 @@
-From 1e0186440adf4fb452073ff23de4e99b06f07fdc Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:12:59 +0200
-Subject: PM: Introduce generic "noirq" callback routines for subsystems (v2)
-
-Introduce generic "noirq" power management callback routines for
-subsystems in addition to the "regular" generic PM callback routines.
-
-The new routines will be used, among other things, for implementing
-system-wide PM transitions support for generic PM domains.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e5291928839877f8e73c2643ee1d3fe0bcdcaf5c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 32 +++++++++++-
- drivers/base/power/generic_ops.c | 98 ++++++++++++++++++++++++++++++------
- include/linux/pm.h | 6 +++
- 3 files changed, 119 insertions(+), 17 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index b24875b..4b011b1 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -606,32 +606,60 @@ driver/base/power/generic_ops.c:
- callback provided by its driver and return its result, or return 0 if not
- defined
-
-+ int pm_generic_suspend_noirq(struct device *dev);
-+ - if pm_runtime_suspended(dev) returns "false", invoke the ->suspend_noirq()
-+ callback provided by the device's driver and return its result, or return
-+ 0 if not defined
-+
- int pm_generic_resume(struct device *dev);
- - invoke the ->resume() callback provided by the driver of this device and,
- if successful, change the device's runtime PM status to 'active'
-
-+ int pm_generic_resume_noirq(struct device *dev);
-+ - invoke the ->resume_noirq() callback provided by the driver of this device
-+
- int pm_generic_freeze(struct device *dev);
- - if the device has not been suspended at run time, invoke the ->freeze()
- callback provided by its driver and return its result, or return 0 if not
- defined
-
-+ int pm_generic_freeze_noirq(struct device *dev);
-+ - if pm_runtime_suspended(dev) returns "false", invoke the ->freeze_noirq()
-+ callback provided by the device's driver and return its result, or return
-+ 0 if not defined
-+
- int pm_generic_thaw(struct device *dev);
- - if the device has not been suspended at run time, invoke the ->thaw()
- callback provided by its driver and return its result, or return 0 if not
- defined
-
-+ int pm_generic_thaw_noirq(struct device *dev);
-+ - if pm_runtime_suspended(dev) returns "false", invoke the ->thaw_noirq()
-+ callback provided by the device's driver and return its result, or return
-+ 0 if not defined
-+
- int pm_generic_poweroff(struct device *dev);
- - if the device has not been suspended at run time, invoke the ->poweroff()
- callback provided by its driver and return its result, or return 0 if not
- defined
-
-+ int pm_generic_poweroff_noirq(struct device *dev);
-+ - if pm_runtime_suspended(dev) returns "false", run the ->poweroff_noirq()
-+ callback provided by the device's driver and return its result, or return
-+ 0 if not defined
-+
- int pm_generic_restore(struct device *dev);
- - invoke the ->restore() callback provided by the driver of this device and,
- if successful, change the device's runtime PM status to 'active'
-
-+ int pm_generic_restore_noirq(struct device *dev);
-+ - invoke the ->restore_noirq() callback provided by the device's driver
-+
- These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(),
--->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(),
--or ->restore() callback pointers in the subsystem-level dev_pm_ops structures.
-+->runtime_resume(), ->suspend(), ->suspend_noirq(), ->resume(),
-+->resume_noirq(), ->freeze(), ->freeze_noirq(), ->thaw(), ->thaw_noirq(),
-+->poweroff(), ->poweroff_noirq(), ->restore(), ->restore_noirq() callback
-+pointers in the subsystem-level dev_pm_ops structures.
-
- If a subsystem wishes to use all of them at the same time, it can simply assign
- the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index cb3bb36..9508df7 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -94,12 +94,13 @@ int pm_generic_prepare(struct device *dev)
- * __pm_generic_call - Generic suspend/freeze/poweroff/thaw subsystem callback.
- * @dev: Device to handle.
- * @event: PM transition of the system under way.
-+ * @bool: Whether or not this is the "noirq" stage.
- *
- * If the device has not been suspended at run time, execute the
- * suspend/freeze/poweroff/thaw callback provided by its driver, if defined, and
- * return its error code. Otherwise, return zero.
- */
--static int __pm_generic_call(struct device *dev, int event)
-+static int __pm_generic_call(struct device *dev, int event, bool noirq)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- int (*callback)(struct device *);
-@@ -109,16 +110,16 @@ static int __pm_generic_call(struct device *dev, int event)
-
- switch (event) {
- case PM_EVENT_SUSPEND:
-- callback = pm->suspend;
-+ callback = noirq ? pm->suspend_noirq : pm->suspend;
- break;
- case PM_EVENT_FREEZE:
-- callback = pm->freeze;
-+ callback = noirq ? pm->freeze_noirq : pm->freeze;
- break;
- case PM_EVENT_HIBERNATE:
-- callback = pm->poweroff;
-+ callback = noirq ? pm->poweroff_noirq : pm->poweroff;
- break;
- case PM_EVENT_THAW:
-- callback = pm->thaw;
-+ callback = noirq ? pm->thaw_noirq : pm->thaw;
- break;
- default:
- callback = NULL;
-@@ -129,42 +130,82 @@ static int __pm_generic_call(struct device *dev, int event)
- }
-
- /**
-+ * pm_generic_suspend_noirq - Generic suspend_noirq callback for subsystems.
-+ * @dev: Device to suspend.
-+ */
-+int pm_generic_suspend_noirq(struct device *dev)
-+{
-+ return __pm_generic_call(dev, PM_EVENT_SUSPEND, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_suspend_noirq);
-+
-+/**
- * pm_generic_suspend - Generic suspend callback for subsystems.
- * @dev: Device to suspend.
- */
- int pm_generic_suspend(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_SUSPEND);
-+ return __pm_generic_call(dev, PM_EVENT_SUSPEND, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_suspend);
-
- /**
-+ * pm_generic_freeze_noirq - Generic freeze_noirq callback for subsystems.
-+ * @dev: Device to freeze.
-+ */
-+int pm_generic_freeze_noirq(struct device *dev)
-+{
-+ return __pm_generic_call(dev, PM_EVENT_FREEZE, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_freeze_noirq);
-+
-+/**
- * pm_generic_freeze - Generic freeze callback for subsystems.
- * @dev: Device to freeze.
- */
- int pm_generic_freeze(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_FREEZE);
-+ return __pm_generic_call(dev, PM_EVENT_FREEZE, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_freeze);
-
- /**
-+ * pm_generic_poweroff_noirq - Generic poweroff_noirq callback for subsystems.
-+ * @dev: Device to handle.
-+ */
-+int pm_generic_poweroff_noirq(struct device *dev)
-+{
-+ return __pm_generic_call(dev, PM_EVENT_HIBERNATE, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_poweroff_noirq);
-+
-+/**
- * pm_generic_poweroff - Generic poweroff callback for subsystems.
- * @dev: Device to handle.
- */
- int pm_generic_poweroff(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_HIBERNATE);
-+ return __pm_generic_call(dev, PM_EVENT_HIBERNATE, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_poweroff);
-
- /**
-+ * pm_generic_thaw_noirq - Generic thaw_noirq callback for subsystems.
-+ * @dev: Device to thaw.
-+ */
-+int pm_generic_thaw_noirq(struct device *dev)
-+{
-+ return __pm_generic_call(dev, PM_EVENT_THAW, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_thaw_noirq);
-+
-+/**
- * pm_generic_thaw - Generic thaw callback for subsystems.
- * @dev: Device to thaw.
- */
- int pm_generic_thaw(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_THAW);
-+ return __pm_generic_call(dev, PM_EVENT_THAW, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_thaw);
-
-@@ -172,12 +213,13 @@ EXPORT_SYMBOL_GPL(pm_generic_thaw);
- * __pm_generic_resume - Generic resume/restore callback for subsystems.
- * @dev: Device to handle.
- * @event: PM transition of the system under way.
-+ * @bool: Whether or not this is the "noirq" stage.
- *
- * Execute the resume/resotre callback provided by the @dev's driver, if
- * defined. If it returns 0, change the device's runtime PM status to 'active'.
- * Return the callback's error code.
- */
--static int __pm_generic_resume(struct device *dev, int event)
-+static int __pm_generic_resume(struct device *dev, int event, bool noirq)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- int (*callback)(struct device *);
-@@ -188,10 +230,10 @@ static int __pm_generic_resume(struct device *dev, int event)
-
- switch (event) {
- case PM_EVENT_RESUME:
-- callback = pm->resume;
-+ callback = noirq ? pm->resume_noirq : pm->resume;
- break;
- case PM_EVENT_RESTORE:
-- callback = pm->restore;
-+ callback = noirq ? pm->restore_noirq : pm->restore;
- break;
- default:
- callback = NULL;
-@@ -202,7 +244,7 @@ static int __pm_generic_resume(struct device *dev, int event)
- return 0;
-
- ret = callback(dev);
-- if (!ret && pm_runtime_enabled(dev)) {
-+ if (!ret && !noirq && pm_runtime_enabled(dev)) {
- pm_runtime_disable(dev);
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-@@ -212,22 +254,42 @@ static int __pm_generic_resume(struct device *dev, int event)
- }
-
- /**
-+ * pm_generic_resume_noirq - Generic resume_noirq callback for subsystems.
-+ * @dev: Device to resume.
-+ */
-+int pm_generic_resume_noirq(struct device *dev)
-+{
-+ return __pm_generic_resume(dev, PM_EVENT_RESUME, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_resume_noirq);
-+
-+/**
- * pm_generic_resume - Generic resume callback for subsystems.
- * @dev: Device to resume.
- */
- int pm_generic_resume(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESUME);
-+ return __pm_generic_resume(dev, PM_EVENT_RESUME, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_resume);
-
- /**
-+ * pm_generic_restore_noirq - Generic restore_noirq callback for subsystems.
-+ * @dev: Device to restore.
-+ */
-+int pm_generic_restore_noirq(struct device *dev)
-+{
-+ return __pm_generic_resume(dev, PM_EVENT_RESTORE, true);
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_restore_noirq);
-+
-+/**
- * pm_generic_restore - Generic restore callback for subsystems.
- * @dev: Device to restore.
- */
- int pm_generic_restore(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESTORE);
-+ return __pm_generic_resume(dev, PM_EVENT_RESTORE, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_restore);
-
-@@ -256,11 +318,17 @@ struct dev_pm_ops generic_subsys_pm_ops = {
- #ifdef CONFIG_PM_SLEEP
- .prepare = pm_generic_prepare,
- .suspend = pm_generic_suspend,
-+ .suspend_noirq = pm_generic_suspend_noirq,
- .resume = pm_generic_resume,
-+ .resume_noirq = pm_generic_resume_noirq,
- .freeze = pm_generic_freeze,
-+ .freeze_noirq = pm_generic_freeze_noirq,
- .thaw = pm_generic_thaw,
-+ .thaw_noirq = pm_generic_thaw_noirq,
- .poweroff = pm_generic_poweroff,
-+ .poweroff_noirq = pm_generic_poweroff_noirq,
- .restore = pm_generic_restore,
-+ .restore_noirq = pm_generic_restore_noirq,
- .complete = pm_generic_complete,
- #endif
- #ifdef CONFIG_PM_RUNTIME
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 7e8f076..f7c84c9 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -553,11 +553,17 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
- extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
-
- extern int pm_generic_prepare(struct device *dev);
-+extern int pm_generic_suspend_noirq(struct device *dev);
- extern int pm_generic_suspend(struct device *dev);
-+extern int pm_generic_resume_noirq(struct device *dev);
- extern int pm_generic_resume(struct device *dev);
-+extern int pm_generic_freeze_noirq(struct device *dev);
- extern int pm_generic_freeze(struct device *dev);
-+extern int pm_generic_thaw_noirq(struct device *dev);
- extern int pm_generic_thaw(struct device *dev);
-+extern int pm_generic_restore_noirq(struct device *dev);
- extern int pm_generic_restore(struct device *dev);
-+extern int pm_generic_poweroff_noirq(struct device *dev);
- extern int pm_generic_poweroff(struct device *dev);
- extern void pm_generic_complete(struct device *dev);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0006-PM-Domains-Move-code-from-under-ifdef-CONFIG_PM_RUNT.patch b/patches.runtime_pm/0006-PM-Domains-Move-code-from-under-ifdef-CONFIG_PM_RUNT.patch
deleted file mode 100644
index 372f7df3c82ef3..00000000000000
--- a/patches.runtime_pm/0006-PM-Domains-Move-code-from-under-ifdef-CONFIG_PM_RUNT.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-From 5eb38f7619fb43ea0097cefa9dbf005f18cc42a1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:13:10 +0200
-Subject: PM / Domains: Move code from under #ifdef CONFIG_PM_RUNTIME (v2)
-
-There is some code in drivers/base/power/domain.c that will be useful
-for both runtime PM and system-wide power transitions, so make it
-depend on CONFIG_PM instead of CONFIG_PM_RUNTIME.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 5248051b9afb6684cd817b2fbdaefa5063761dab)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 120 +++++++++++++++++++++++--------------------
- 1 file changed, 65 insertions(+), 55 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index fd31be3..f14ba32 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -14,7 +14,15 @@
- #include <linux/slab.h>
- #include <linux/err.h>
-
--#ifdef CONFIG_PM_RUNTIME
-+#ifdef CONFIG_PM
-+
-+static struct generic_pm_domain *dev_to_genpd(struct device *dev)
-+{
-+ if (IS_ERR_OR_NULL(dev->pm_domain))
-+ return ERR_PTR(-EINVAL);
-+
-+ return container_of(dev->pm_domain, struct generic_pm_domain, domain);
-+}
-
- static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- {
-@@ -23,6 +31,58 @@ static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- }
-
- /**
-+ * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * @genpd: PM domain to power up.
-+ *
-+ * Restore power to @genpd and all of its parents so that it is possible to
-+ * resume a device belonging to it.
-+ */
-+static int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+{
-+ int ret = 0;
-+
-+ start:
-+ if (genpd->parent)
-+ mutex_lock(&genpd->parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+
-+ if (!genpd->power_is_off)
-+ goto out;
-+
-+ if (genpd->parent && genpd->parent->power_is_off) {
-+ mutex_unlock(&genpd->lock);
-+ mutex_unlock(&genpd->parent->lock);
-+
-+ ret = pm_genpd_poweron(genpd->parent);
-+ if (ret)
-+ return ret;
-+
-+ goto start;
-+ }
-+
-+ if (genpd->power_on) {
-+ int ret = genpd->power_on(genpd);
-+ if (ret)
-+ goto out;
-+ }
-+
-+ genpd->power_is_off = false;
-+ if (genpd->parent)
-+ genpd->parent->sd_count++;
-+
-+ out:
-+ mutex_unlock(&genpd->lock);
-+ if (genpd->parent)
-+ mutex_unlock(&genpd->parent->lock);
-+
-+ return ret;
-+}
-+
-+#endif /* CONFIG_PM */
-+
-+#ifdef CONFIG_PM_RUNTIME
-+
-+/**
- * __pm_genpd_save_device - Save the pre-suspend state of a device.
- * @dle: Device list entry of the device to save the state of.
- * @genpd: PM domain the device belongs to.
-@@ -174,11 +234,10 @@ static int pm_genpd_runtime_suspend(struct device *dev)
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (IS_ERR_OR_NULL(dev->pm_domain))
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
- return -EINVAL;
-
-- genpd = container_of(dev->pm_domain, struct generic_pm_domain, domain);
--
- if (genpd->parent)
- mutex_lock(&genpd->parent->lock);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-@@ -201,54 +260,6 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- }
-
- /**
-- * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-- * @genpd: PM domain to power up.
-- *
-- * Restore power to @genpd and all of its parents so that it is possible to
-- * resume a device belonging to it.
-- */
--static int pm_genpd_poweron(struct generic_pm_domain *genpd)
--{
-- int ret = 0;
--
-- start:
-- if (genpd->parent)
-- mutex_lock(&genpd->parent->lock);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
--
-- if (!genpd->power_is_off)
-- goto out;
--
-- if (genpd->parent && genpd->parent->power_is_off) {
-- mutex_unlock(&genpd->lock);
-- mutex_unlock(&genpd->parent->lock);
--
-- ret = pm_genpd_poweron(genpd->parent);
-- if (ret)
-- return ret;
--
-- goto start;
-- }
--
-- if (genpd->power_on) {
-- int ret = genpd->power_on(genpd);
-- if (ret)
-- goto out;
-- }
--
-- genpd->power_is_off = false;
-- if (genpd->parent)
-- genpd->parent->sd_count++;
--
-- out:
-- mutex_unlock(&genpd->lock);
-- if (genpd->parent)
-- mutex_unlock(&genpd->parent->lock);
--
-- return ret;
--}
--
--/**
- * pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
- * @dev: Device to resume.
- *
-@@ -264,11 +275,10 @@ static int pm_genpd_runtime_resume(struct device *dev)
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (IS_ERR_OR_NULL(dev->pm_domain))
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
- return -EINVAL;
-
-- genpd = container_of(dev->pm_domain, struct generic_pm_domain, domain);
--
- ret = pm_genpd_poweron(genpd);
- if (ret)
- return ret;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0007-PM-Domains-System-wide-transitions-support-for-gener.patch b/patches.runtime_pm/0007-PM-Domains-System-wide-transitions-support-for-gener.patch
deleted file mode 100644
index 9487f1dfa507d0..00000000000000
--- a/patches.runtime_pm/0007-PM-Domains-System-wide-transitions-support-for-gener.patch
+++ /dev/null
@@ -1,735 +0,0 @@
-From e09ec39629e6f819c4828081038af88e531664cd Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:13:19 +0200
-Subject: PM / Domains: System-wide transitions support for generic domains
- (v5)
-
-Make generic PM domains support system-wide power transitions
-(system suspend and hibernation). Add suspend, resume, freeze, thaw,
-poweroff and restore callbacks to be associated with struct
-generic_pm_domain objects and make pm_genpd_init() use them as
-appropriate.
-
-The new callbacks do nothing for devices belonging to power domains
-that were powered down at run time (before the transition). For the
-other devices the action carried out depends on the type of the
-transition. During system suspend the power domain .suspend()
-callback executes pm_generic_suspend() for the device, while the
-PM domain .suspend_noirq() callback runs pm_generic_suspend_noirq()
-for it, stops it and eventually removes power from the PM domain it
-belongs to (after all devices in the domain have been stopped and its
-subdomains have been powered off).
-
-During system resume the PM domain .resume_noirq() callback
-restores power to the PM domain (when executed for it first time),
-starts the device and executes pm_generic_resume_noirq() for it,
-while the .resume() callback executes pm_generic_resume() for the
-device. Finally, the .complete() callback executes pm_runtime_idle()
-for the device which should put it back into the suspended state if
-its runtime PM usage count is equal to zero at that time.
-
-The actions carried out during hibernation and resume from it are
-analogous to the ones described above.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 596ba34bcd2978ee9823cc1d84df230576f8ffb9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 551 +++++++++++++++++++++++++++++++++++++++++--
- include/linux/pm_domain.h | 12 +
- 2 files changed, 548 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index f14ba32..33086e9 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -21,7 +21,7 @@ static struct generic_pm_domain *dev_to_genpd(struct device *dev)
- if (IS_ERR_OR_NULL(dev->pm_domain))
- return ERR_PTR(-EINVAL);
-
-- return container_of(dev->pm_domain, struct generic_pm_domain, domain);
-+ return pd_to_genpd(dev->pm_domain);
- }
-
- static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
-@@ -46,7 +46,8 @@ static int pm_genpd_poweron(struct generic_pm_domain *genpd)
- mutex_lock(&genpd->parent->lock);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-
-- if (!genpd->power_is_off)
-+ if (!genpd->power_is_off
-+ || (genpd->prepared_count > 0 && genpd->suspend_power_off))
- goto out;
-
- if (genpd->parent && genpd->parent->power_is_off) {
-@@ -155,7 +156,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- unsigned int not_suspended;
- int ret;
-
-- if (genpd->power_is_off)
-+ if (genpd->power_is_off || genpd->prepared_count > 0)
- return 0;
-
- if (genpd->sd_count > 0)
-@@ -260,6 +261,27 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- }
-
- /**
-+ * __pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
-+ * @dev: Device to resume.
-+ * @genpd: PM domain the device belongs to.
-+ */
-+static void __pm_genpd_runtime_resume(struct device *dev,
-+ struct generic_pm_domain *genpd)
-+{
-+ struct dev_list_entry *dle;
-+
-+ list_for_each_entry(dle, &genpd->dev_list, node) {
-+ if (dle->dev == dev) {
-+ __pm_genpd_restore_device(dle, genpd);
-+ break;
-+ }
-+ }
-+
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+}
-+
-+/**
- * pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
- * @dev: Device to resume.
- *
-@@ -270,7 +292,6 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- static int pm_genpd_runtime_resume(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-- struct dev_list_entry *dle;
- int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-@@ -284,17 +305,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
- return ret;
-
- mutex_lock(&genpd->lock);
--
-- list_for_each_entry(dle, &genpd->dev_list, node) {
-- if (dle->dev == dev) {
-- __pm_genpd_restore_device(dle, genpd);
-- break;
-- }
-- }
--
-- if (genpd->start_device)
-- genpd->start_device(dev);
--
-+ __pm_genpd_runtime_resume(dev, genpd);
- mutex_unlock(&genpd->lock);
-
- return 0;
-@@ -303,12 +314,493 @@ static int pm_genpd_runtime_resume(struct device *dev)
- #else
-
- static inline void genpd_power_off_work_fn(struct work_struct *work) {}
-+static inline void __pm_genpd_runtime_resume(struct device *dev,
-+ struct generic_pm_domain *genpd) {}
-
- #define pm_genpd_runtime_suspend NULL
- #define pm_genpd_runtime_resume NULL
-
- #endif /* CONFIG_PM_RUNTIME */
-
-+#ifdef CONFIG_PM_SLEEP
-+
-+/**
-+ * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its parents.
-+ * @genpd: PM domain to power off, if possible.
-+ *
-+ * Check if the given PM domain can be powered off (during system suspend or
-+ * hibernation) and do that if so. Also, in that case propagate to its parent.
-+ *
-+ * This function is only called in "noirq" stages of system power transitions,
-+ * so it need not acquire locks (all of the "noirq" callbacks are executed
-+ * sequentially, so it is guaranteed that it will never run twice in parallel).
-+ */
-+static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
-+{
-+ struct generic_pm_domain *parent = genpd->parent;
-+
-+ if (genpd->power_is_off)
-+ return;
-+
-+ if (genpd->suspended_count != genpd->device_count || genpd->sd_count > 0)
-+ return;
-+
-+ if (genpd->power_off)
-+ genpd->power_off(genpd);
-+
-+ genpd->power_is_off = true;
-+ if (parent) {
-+ genpd_sd_counter_dec(parent);
-+ pm_genpd_sync_poweroff(parent);
-+ }
-+}
-+
-+/**
-+ * pm_genpd_prepare - Start power transition of a device in a PM domain.
-+ * @dev: Device to start the transition of.
-+ *
-+ * Start a power transition of a device (during a system-wide power transition)
-+ * under the assumption that its pm_domain field points to the domain member of
-+ * an object of type struct generic_pm_domain representing a PM domain
-+ * consisting of I/O devices.
-+ */
-+static int pm_genpd_prepare(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ if (genpd->prepared_count++ == 0)
-+ genpd->suspend_power_off = genpd->power_is_off;
-+
-+ if (genpd->suspend_power_off) {
-+ mutex_unlock(&genpd->lock);
-+ return 0;
-+ }
-+
-+ /*
-+ * If the device is in the (runtime) "suspended" state, call
-+ * .start_device() for it, if defined.
-+ */
-+ if (pm_runtime_suspended(dev))
-+ __pm_genpd_runtime_resume(dev, genpd);
-+
-+ /*
-+ * Do not check if runtime resume is pending at this point, because it
-+ * has been taken care of already and if pm_genpd_poweron() ran at this
-+ * point as a result of the check, it would deadlock.
-+ */
-+ __pm_runtime_disable(dev, false);
-+
-+ mutex_unlock(&genpd->lock);
-+
-+ return pm_generic_prepare(dev);
-+}
-+
-+/**
-+ * pm_genpd_suspend - Suspend a device belonging to an I/O PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Suspend a device under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_suspend(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_suspend(dev);
-+}
-+
-+/**
-+ * pm_genpd_suspend_noirq - Late suspend of a device from an I/O PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Carry out a late suspend of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_suspend_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+ int ret;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
-+ ret = pm_generic_suspend_noirq(dev);
-+ if (ret)
-+ return ret;
-+
-+ if (genpd->stop_device)
-+ genpd->stop_device(dev);
-+
-+ /*
-+ * Since all of the "noirq" callbacks are executed sequentially, it is
-+ * guaranteed that this function will never run twice in parallel for
-+ * the same PM domain, so it is not necessary to use locking here.
-+ */
-+ genpd->suspended_count++;
-+ pm_genpd_sync_poweroff(genpd);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_genpd_resume_noirq - Early resume of a device from an I/O power domain.
-+ * @dev: Device to resume.
-+ *
-+ * Carry out an early resume of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_resume_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
-+ /*
-+ * Since all of the "noirq" callbacks are executed sequentially, it is
-+ * guaranteed that this function will never run twice in parallel for
-+ * the same PM domain, so it is not necessary to use locking here.
-+ */
-+ pm_genpd_poweron(genpd);
-+ genpd->suspended_count--;
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ return pm_generic_resume_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_resume - Resume a device belonging to an I/O power domain.
-+ * @dev: Device to resume.
-+ *
-+ * Resume a device under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a power domain consisting of I/O devices.
-+ */
-+static int pm_genpd_resume(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_resume(dev);
-+}
-+
-+/**
-+ * pm_genpd_freeze - Freeze a device belonging to an I/O power domain.
-+ * @dev: Device to freeze.
-+ *
-+ * Freeze a device under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a power domain consisting of I/O devices.
-+ */
-+static int pm_genpd_freeze(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_freeze(dev);
-+}
-+
-+/**
-+ * pm_genpd_freeze_noirq - Late freeze of a device from an I/O power domain.
-+ * @dev: Device to freeze.
-+ *
-+ * Carry out a late freeze of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_freeze_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+ int ret;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
-+ ret = pm_generic_freeze_noirq(dev);
-+ if (ret)
-+ return ret;
-+
-+ if (genpd->stop_device)
-+ genpd->stop_device(dev);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_genpd_thaw_noirq - Early thaw of a device from an I/O power domain.
-+ * @dev: Device to thaw.
-+ *
-+ * Carry out an early thaw of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_thaw_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ return pm_generic_thaw_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_thaw - Thaw a device belonging to an I/O power domain.
-+ * @dev: Device to thaw.
-+ *
-+ * Thaw a device under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a power domain consisting of I/O devices.
-+ */
-+static int pm_genpd_thaw(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_thaw(dev);
-+}
-+
-+/**
-+ * pm_genpd_dev_poweroff - Power off a device belonging to an I/O PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Power off a device under the assumption that its pm_domain field points to
-+ * the domain member of an object of type struct generic_pm_domain representing
-+ * a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_dev_poweroff(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_poweroff(dev);
-+}
-+
-+/**
-+ * pm_genpd_dev_poweroff_noirq - Late power off of a device from a PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Carry out a late powering off of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a PM domain consisting of I/O devices.
-+ */
-+static int pm_genpd_dev_poweroff_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+ int ret;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
-+ ret = pm_generic_poweroff_noirq(dev);
-+ if (ret)
-+ return ret;
-+
-+ if (genpd->stop_device)
-+ genpd->stop_device(dev);
-+
-+ /*
-+ * Since all of the "noirq" callbacks are executed sequentially, it is
-+ * guaranteed that this function will never run twice in parallel for
-+ * the same PM domain, so it is not necessary to use locking here.
-+ */
-+ genpd->suspended_count++;
-+ pm_genpd_sync_poweroff(genpd);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_genpd_restore_noirq - Early restore of a device from an I/O power domain.
-+ * @dev: Device to resume.
-+ *
-+ * Carry out an early restore of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_restore_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ /*
-+ * Since all of the "noirq" callbacks are executed sequentially, it is
-+ * guaranteed that this function will never run twice in parallel for
-+ * the same PM domain, so it is not necessary to use locking here.
-+ */
-+ genpd->power_is_off = true;
-+ if (genpd->suspend_power_off) {
-+ /*
-+ * The boot kernel might put the domain into the power on state,
-+ * so make sure it really is powered off.
-+ */
-+ if (genpd->power_off)
-+ genpd->power_off(genpd);
-+ return 0;
-+ }
-+
-+ pm_genpd_poweron(genpd);
-+ genpd->suspended_count--;
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-+
-+ return pm_generic_restore_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_restore - Restore a device belonging to an I/O power domain.
-+ * @dev: Device to resume.
-+ *
-+ * Restore a device under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a power domain consisting of I/O devices.
-+ */
-+static int pm_genpd_restore(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : pm_generic_restore(dev);
-+}
-+
-+/**
-+ * pm_genpd_complete - Complete power transition of a device in a power domain.
-+ * @dev: Device to complete the transition of.
-+ *
-+ * Complete a power transition of a device (during a system-wide power
-+ * transition) under the assumption that its pm_domain field points to the
-+ * domain member of an object of type struct generic_pm_domain representing
-+ * a power domain consisting of I/O devices.
-+ */
-+static void pm_genpd_complete(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+ bool run_complete;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return;
-+
-+ mutex_lock(&genpd->lock);
-+
-+ run_complete = !genpd->suspend_power_off;
-+ if (--genpd->prepared_count == 0)
-+ genpd->suspend_power_off = false;
-+
-+ mutex_unlock(&genpd->lock);
-+
-+ if (run_complete) {
-+ pm_generic_complete(dev);
-+ pm_runtime_enable(dev);
-+ }
-+}
-+
-+#else
-+
-+#define pm_genpd_prepare NULL
-+#define pm_genpd_suspend NULL
-+#define pm_genpd_suspend_noirq NULL
-+#define pm_genpd_resume_noirq NULL
-+#define pm_genpd_resume NULL
-+#define pm_genpd_freeze NULL
-+#define pm_genpd_freeze_noirq NULL
-+#define pm_genpd_thaw_noirq NULL
-+#define pm_genpd_thaw NULL
-+#define pm_genpd_dev_poweroff_noirq NULL
-+#define pm_genpd_dev_poweroff NULL
-+#define pm_genpd_restore_noirq NULL
-+#define pm_genpd_restore NULL
-+#define pm_genpd_complete NULL
-+
-+#endif /* CONFIG_PM_SLEEP */
-+
- /**
- * pm_genpd_add_device - Add a device to an I/O PM domain.
- * @genpd: PM domain to add the device to.
-@@ -331,6 +823,11 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- goto out;
- }
-
-+ if (genpd->prepared_count > 0) {
-+ ret = -EAGAIN;
-+ goto out;
-+ }
-+
- list_for_each_entry(dle, &genpd->dev_list, node)
- if (dle->dev == dev) {
- ret = -EINVAL;
-@@ -346,6 +843,7 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- dle->dev = dev;
- dle->need_restore = false;
- list_add_tail(&dle->node, &genpd->dev_list);
-+ genpd->device_count++;
-
- spin_lock_irq(&dev->power.lock);
- dev->pm_domain = &genpd->domain;
-@@ -375,6 +873,11 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
-
- mutex_lock(&genpd->lock);
-
-+ if (genpd->prepared_count > 0) {
-+ ret = -EAGAIN;
-+ goto out;
-+ }
-+
- list_for_each_entry(dle, &genpd->dev_list, node) {
- if (dle->dev != dev)
- continue;
-@@ -383,6 +886,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- dev->pm_domain = NULL;
- spin_unlock_irq(&dev->power.lock);
-
-+ genpd->device_count--;
- list_del(&dle->node);
- kfree(dle);
-
-@@ -390,6 +894,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- break;
- }
-
-+ out:
- mutex_unlock(&genpd->lock);
-
- return ret;
-@@ -498,7 +1003,23 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->in_progress = 0;
- genpd->sd_count = 0;
- genpd->power_is_off = is_off;
-+ genpd->device_count = 0;
-+ genpd->suspended_count = 0;
- genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
- genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume;
- genpd->domain.ops.runtime_idle = pm_generic_runtime_idle;
-+ genpd->domain.ops.prepare = pm_genpd_prepare;
-+ genpd->domain.ops.suspend = pm_genpd_suspend;
-+ genpd->domain.ops.suspend_noirq = pm_genpd_suspend_noirq;
-+ genpd->domain.ops.resume_noirq = pm_genpd_resume_noirq;
-+ genpd->domain.ops.resume = pm_genpd_resume;
-+ genpd->domain.ops.freeze = pm_genpd_freeze;
-+ genpd->domain.ops.freeze_noirq = pm_genpd_freeze_noirq;
-+ genpd->domain.ops.thaw_noirq = pm_genpd_thaw_noirq;
-+ genpd->domain.ops.thaw = pm_genpd_thaw;
-+ genpd->domain.ops.poweroff = pm_genpd_dev_poweroff;
-+ genpd->domain.ops.poweroff_noirq = pm_genpd_dev_poweroff_noirq;
-+ genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
-+ genpd->domain.ops.restore = pm_genpd_restore;
-+ genpd->domain.ops.complete = pm_genpd_complete;
- }
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index b1a22c6..7961b0d 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -11,6 +11,9 @@
-
- #include <linux/device.h>
-
-+#define GPD_IN_SUSPEND 1
-+#define GPD_POWER_OFF 2
-+
- struct dev_power_governor {
- bool (*power_down_ok)(struct dev_pm_domain *domain);
- };
-@@ -27,12 +30,21 @@ struct generic_pm_domain {
- unsigned int in_progress; /* Number of devices being suspended now */
- unsigned int sd_count; /* Number of subdomains with power "on" */
- bool power_is_off; /* Whether or not power has been removed */
-+ unsigned int device_count; /* Number of devices */
-+ unsigned int suspended_count; /* System suspend device counter */
-+ unsigned int prepared_count; /* Suspend counter of prepared devices */
-+ bool suspend_power_off; /* Power status before system suspend */
- int (*power_off)(struct generic_pm_domain *domain);
- int (*power_on)(struct generic_pm_domain *domain);
- int (*start_device)(struct device *dev);
- int (*stop_device)(struct device *dev);
- };
-
-+static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
-+{
-+ return container_of(pd, struct generic_pm_domain, domain);
-+}
-+
- struct dev_list_entry {
- struct list_head node;
- struct device *dev;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0008-PM-Domains-Wakeup-devices-support-for-system-sleep-t.patch b/patches.runtime_pm/0008-PM-Domains-Wakeup-devices-support-for-system-sleep-t.patch
deleted file mode 100644
index 61f2ef9a969819..00000000000000
--- a/patches.runtime_pm/0008-PM-Domains-Wakeup-devices-support-for-system-sleep-t.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 1330bb213d5359301a54b8a8bee21fdec208be57 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:13:29 +0200
-Subject: PM / Domains: Wakeup devices support for system sleep transitions
-
-There is the problem how to handle devices set up to wake up the
-system from sleep states during system-wide power transitions.
-In some cases, those devices can be turned off entirely, because the
-wakeup signals will be generated on their behalf anyway. In some
-other cases, they will generate wakeup signals if their clocks are
-stopped, but only if power is not removed from them. Finally, in
-some cases, they can only generate wakeup signals if power is not
-removed from them and their clocks are enabled.
-
-To allow platform-specific code to decide whether or not to put
-wakeup devices (and their PM domains) into low-power state during
-system-wide transitions, such as system suspend, introduce a new
-generic PM domain callback, .active_wakeup(), that will be used
-during the "noirq" phase of system suspend and hibernation (after
-image creation) to decide what to do with wakeup devices.
-Specifically, if this callback is present and returns "true", the
-generic PM domain code will not execute .stop_device() for the
-given wakeup device and its PM domain won't be powered off.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit d4f2d87a8b46c14c4307c690c92bd08229f66ecf)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 8 ++++++++
- include/linux/pm_domain.h | 1 +
- 2 files changed, 9 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 33086e9..1aed94c 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -450,6 +450,10 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (ret)
- return ret;
-
-+ if (device_may_wakeup(dev)
-+ && genpd->active_wakeup && genpd->active_wakeup(dev))
-+ return 0;
-+
- if (genpd->stop_device)
- genpd->stop_device(dev);
-
-@@ -670,6 +674,10 @@ static int pm_genpd_dev_poweroff_noirq(struct device *dev)
- if (ret)
- return ret;
-
-+ if (device_may_wakeup(dev)
-+ && genpd->active_wakeup && genpd->active_wakeup(dev))
-+ return 0;
-+
- if (genpd->stop_device)
- genpd->stop_device(dev);
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 7961b0d..98491ee 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -38,6 +38,7 @@ struct generic_pm_domain {
- int (*power_on)(struct generic_pm_domain *domain);
- int (*start_device)(struct device *dev);
- int (*stop_device)(struct device *dev);
-+ bool (*active_wakeup)(struct device *dev);
- };
-
- static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0009-PM-Allow-the-clocks-management-code-to-be-used-durin.patch b/patches.runtime_pm/0009-PM-Allow-the-clocks-management-code-to-be-used-durin.patch
deleted file mode 100644
index bbd647fe98620c..00000000000000
--- a/patches.runtime_pm/0009-PM-Allow-the-clocks-management-code-to-be-used-durin.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 60fe6d8f2058c122a37b053523a76fc791ea3cef Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:13:37 +0200
-Subject: PM: Allow the clocks management code to be used during system
- suspend
-
-The common clocks management code in drivers/base/power/clock_ops.c
-is going to be used during system-wide power transitions as well as
-for runtime PM, so it shouldn't depend on CONFIG_PM_RUNTIME.
-However, the suspend/resume functions provided by it for
-CONFIG_PM_RUNTIME unset, to be used during system-wide power
-transitions, should not behave in the same way as their counterparts
-defined for CONFIG_PM_RUNTIME set, because in that case the clocks
-are managed differently at run time.
-
-The names of the functions still contain the word "runtime" after
-this change, but that is going to be modified by a separate patch
-later.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit b7b95920aa2e89e655afe9913ee0e55855ceda90)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 60 +++++++++++++++++++++++++++++++++++++++-
- include/linux/pm_runtime.h | 2 +-
- kernel/power/Kconfig | 4 +--
- 3 files changed, 62 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index c562481..2fb9c12 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -15,7 +15,7 @@
- #include <linux/slab.h>
- #include <linux/err.h>
-
--#ifdef CONFIG_PM_RUNTIME
-+#ifdef CONFIG_PM
-
- struct pm_runtime_clk_data {
- struct list_head clock_list;
-@@ -191,6 +191,10 @@ void pm_runtime_clk_destroy(struct device *dev)
- kfree(prd);
- }
-
-+#endif /* CONFIG_PM */
-+
-+#ifdef CONFIG_PM_RUNTIME
-+
- /**
- * pm_runtime_clk_acquire - Acquire a device clock.
- * @dev: Device whose clock is to be acquired.
-@@ -330,6 +334,60 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
-
- #else /* !CONFIG_PM_RUNTIME */
-
-+#ifdef CONFIG_PM
-+
-+/**
-+ * pm_runtime_clk_suspend - Disable clocks in a device's PM clock list.
-+ * @dev: Device to disable the clocks for.
-+ */
-+int pm_runtime_clk_suspend(struct device *dev)
-+{
-+ struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clock_entry *ce;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ /* If there is no driver, the clocks are already disabled. */
-+ if (!prd || !dev->driver)
-+ return 0;
-+
-+ mutex_lock(&prd->lock);
-+
-+ list_for_each_entry_reverse(ce, &prd->clock_list, node)
-+ clk_disable(ce->clk);
-+
-+ mutex_unlock(&prd->lock);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_runtime_clk_resume - Enable clocks in a device's PM clock list.
-+ * @dev: Device to enable the clocks for.
-+ */
-+int pm_runtime_clk_resume(struct device *dev)
-+{
-+ struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clock_entry *ce;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ /* If there is no driver, the clocks should remain disabled. */
-+ if (!prd || !dev->driver)
-+ return 0;
-+
-+ mutex_lock(&prd->lock);
-+
-+ list_for_each_entry(ce, &prd->clock_list, node)
-+ clk_enable(ce->clk);
-+
-+ mutex_unlock(&prd->lock);
-+
-+ return 0;
-+}
-+
-+#endif /* CONFIG_PM */
-+
- /**
- * enable_clock - Enable a device clock.
- * @dev: Device whose clock is to be enabled.
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index ef91904..1bd5063 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -251,7 +251,7 @@ struct pm_clk_notifier_block {
- char *con_ids[];
- };
-
--#ifdef CONFIG_PM_RUNTIME_CLK
-+#ifdef CONFIG_PM_CLK
- extern int pm_runtime_clk_init(struct device *dev);
- extern void pm_runtime_clk_destroy(struct device *dev);
- extern int pm_runtime_clk_add(struct device *dev, const char *con_id);
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index e83ac25..7b856b3 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -224,9 +224,9 @@ config PM_OPP
- implementations a ready to use framework to manage OPPs.
- For more information, read <file:Documentation/power/opp.txt>
-
--config PM_RUNTIME_CLK
-+config PM_CLK
- def_bool y
-- depends on PM_RUNTIME && HAVE_CLK
-+ depends on PM && HAVE_CLK
-
- config PM_GENERIC_DOMAINS
- bool
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0010-PM-Rename-clock-management-functions.patch b/patches.runtime_pm/0010-PM-Rename-clock-management-functions.patch
deleted file mode 100644
index 32ad36cee3fa04..00000000000000
--- a/patches.runtime_pm/0010-PM-Rename-clock-management-functions.patch
+++ /dev/null
@@ -1,588 +0,0 @@
-From cfd761906963c2b03706d637466730ba34ba37d1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:13:44 +0200
-Subject: PM: Rename clock management functions
-
-The common PM clock management functions may be used for system
-suspend/resume as well as for runtime PM, so rename them
-accordingly. Modify kerneldoc comments describing these functions
-and kernel messages printed by them, so that they refer to power
-management in general rather that to runtime PM.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 3d5c30367cbc0c55c93bb158e824e00badc7ddc4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-omap1/pm_bus.c | 6 +-
- arch/arm/mach-shmobile/pm_runtime.c | 6 +-
- drivers/base/power/clock_ops.c | 188 +++++++++++++++++------------------
- include/linux/pm_runtime.h | 28 +++---
- 4 files changed, 114 insertions(+), 114 deletions(-)
-
-diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
-index 212f331..943072d 100644
---- a/arch/arm/mach-omap1/pm_bus.c
-+++ b/arch/arm/mach-omap1/pm_bus.c
-@@ -32,7 +32,7 @@ static int omap1_pm_runtime_suspend(struct device *dev)
- if (ret)
- return ret;
-
-- ret = pm_runtime_clk_suspend(dev);
-+ ret = pm_clk_suspend(dev);
- if (ret) {
- pm_generic_runtime_resume(dev);
- return ret;
-@@ -45,7 +45,7 @@ static int omap1_pm_runtime_resume(struct device *dev)
- {
- dev_dbg(dev, "%s\n", __func__);
-
-- pm_runtime_clk_resume(dev);
-+ pm_clk_resume(dev);
- return pm_generic_runtime_resume(dev);
- }
-
-@@ -71,7 +71,7 @@ static int __init omap1_pm_runtime_init(void)
- if (!cpu_class_is_omap1())
- return -ENODEV;
-
-- pm_runtime_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
-+ pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
-
- return 0;
- }
-diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
-index 99802d2..2bcde1c 100644
---- a/arch/arm/mach-shmobile/pm_runtime.c
-+++ b/arch/arm/mach-shmobile/pm_runtime.c
-@@ -30,8 +30,8 @@ static int default_platform_runtime_idle(struct device *dev)
-
- static struct dev_pm_domain default_pm_domain = {
- .ops = {
-- .runtime_suspend = pm_runtime_clk_suspend,
-- .runtime_resume = pm_runtime_clk_resume,
-+ .runtime_suspend = pm_clk_suspend,
-+ .runtime_resume = pm_clk_resume,
- .runtime_idle = default_platform_runtime_idle,
- USE_PLATFORM_PM_SLEEP_OPS
- },
-@@ -52,7 +52,7 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
-
- static int __init sh_pm_runtime_init(void)
- {
-- pm_runtime_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
-+ pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
- return 0;
- }
- core_initcall(sh_pm_runtime_init);
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index 2fb9c12..a846b2f 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -17,7 +17,7 @@
-
- #ifdef CONFIG_PM
-
--struct pm_runtime_clk_data {
-+struct pm_clk_data {
- struct list_head clock_list;
- struct mutex lock;
- };
-@@ -36,25 +36,25 @@ struct pm_clock_entry {
- enum pce_status status;
- };
-
--static struct pm_runtime_clk_data *__to_prd(struct device *dev)
-+static struct pm_clk_data *__to_pcd(struct device *dev)
- {
- return dev ? dev->power.subsys_data : NULL;
- }
-
- /**
-- * pm_runtime_clk_add - Start using a device clock for runtime PM.
-- * @dev: Device whose clock is going to be used for runtime PM.
-+ * pm_clk_add - Start using a device clock for power management.
-+ * @dev: Device whose clock is going to be used for power management.
- * @con_id: Connection ID of the clock.
- *
- * Add the clock represented by @con_id to the list of clocks used for
-- * the runtime PM of @dev.
-+ * the power management of @dev.
- */
--int pm_runtime_clk_add(struct device *dev, const char *con_id)
-+int pm_clk_add(struct device *dev, const char *con_id)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
-- if (!prd)
-+ if (!pcd)
- return -EINVAL;
-
- ce = kzalloc(sizeof(*ce), GFP_KERNEL);
-@@ -73,20 +73,20 @@ int pm_runtime_clk_add(struct device *dev, const char *con_id)
- }
- }
-
-- mutex_lock(&prd->lock);
-- list_add_tail(&ce->node, &prd->clock_list);
-- mutex_unlock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-+ list_add_tail(&ce->node, &pcd->clock_list);
-+ mutex_unlock(&pcd->lock);
- return 0;
- }
-
- /**
-- * __pm_runtime_clk_remove - Destroy runtime PM clock entry.
-- * @ce: Runtime PM clock entry to destroy.
-+ * __pm_clk_remove - Destroy PM clock entry.
-+ * @ce: PM clock entry to destroy.
- *
-- * This routine must be called under the mutex protecting the runtime PM list
-- * of clocks corresponding the the @ce's device.
-+ * This routine must be called under the mutex protecting the PM list of clocks
-+ * corresponding the the @ce's device.
- */
--static void __pm_runtime_clk_remove(struct pm_clock_entry *ce)
-+static void __pm_clk_remove(struct pm_clock_entry *ce)
- {
- if (!ce)
- return;
-@@ -108,87 +108,87 @@ static void __pm_runtime_clk_remove(struct pm_clock_entry *ce)
- }
-
- /**
-- * pm_runtime_clk_remove - Stop using a device clock for runtime PM.
-- * @dev: Device whose clock should not be used for runtime PM any more.
-+ * pm_clk_remove - Stop using a device clock for power management.
-+ * @dev: Device whose clock should not be used for PM any more.
- * @con_id: Connection ID of the clock.
- *
- * Remove the clock represented by @con_id from the list of clocks used for
-- * the runtime PM of @dev.
-+ * the power management of @dev.
- */
--void pm_runtime_clk_remove(struct device *dev, const char *con_id)
-+void pm_clk_remove(struct device *dev, const char *con_id)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
-- if (!prd)
-+ if (!pcd)
- return;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry(ce, &prd->clock_list, node) {
-+ list_for_each_entry(ce, &pcd->clock_list, node) {
- if (!con_id && !ce->con_id) {
-- __pm_runtime_clk_remove(ce);
-+ __pm_clk_remove(ce);
- break;
- } else if (!con_id || !ce->con_id) {
- continue;
- } else if (!strcmp(con_id, ce->con_id)) {
-- __pm_runtime_clk_remove(ce);
-+ __pm_clk_remove(ce);
- break;
- }
- }
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
- }
-
- /**
-- * pm_runtime_clk_init - Initialize a device's list of runtime PM clocks.
-- * @dev: Device to initialize the list of runtime PM clocks for.
-+ * pm_clk_init - Initialize a device's list of power management clocks.
-+ * @dev: Device to initialize the list of PM clocks for.
- *
-- * Allocate a struct pm_runtime_clk_data object, initialize its lock member and
-+ * Allocate a struct pm_clk_data object, initialize its lock member and
- * make the @dev's power.subsys_data field point to it.
- */
--int pm_runtime_clk_init(struct device *dev)
-+int pm_clk_init(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd;
-+ struct pm_clk_data *pcd;
-
-- prd = kzalloc(sizeof(*prd), GFP_KERNEL);
-- if (!prd) {
-- dev_err(dev, "Not enough memory fo runtime PM data.\n");
-+ pcd = kzalloc(sizeof(*pcd), GFP_KERNEL);
-+ if (!pcd) {
-+ dev_err(dev, "Not enough memory for PM clock data.\n");
- return -ENOMEM;
- }
-
-- INIT_LIST_HEAD(&prd->clock_list);
-- mutex_init(&prd->lock);
-- dev->power.subsys_data = prd;
-+ INIT_LIST_HEAD(&pcd->clock_list);
-+ mutex_init(&pcd->lock);
-+ dev->power.subsys_data = pcd;
- return 0;
- }
-
- /**
-- * pm_runtime_clk_destroy - Destroy a device's list of runtime PM clocks.
-- * @dev: Device to destroy the list of runtime PM clocks for.
-+ * pm_clk_destroy - Destroy a device's list of power management clocks.
-+ * @dev: Device to destroy the list of PM clocks for.
- *
- * Clear the @dev's power.subsys_data field, remove the list of clock entries
-- * from the struct pm_runtime_clk_data object pointed to by it before and free
-+ * from the struct pm_clk_data object pointed to by it before and free
- * that object.
- */
--void pm_runtime_clk_destroy(struct device *dev)
-+void pm_clk_destroy(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce, *c;
-
-- if (!prd)
-+ if (!pcd)
- return;
-
- dev->power.subsys_data = NULL;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry_safe_reverse(ce, c, &prd->clock_list, node)
-- __pm_runtime_clk_remove(ce);
-+ list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node)
-+ __pm_clk_remove(ce);
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
-
-- kfree(prd);
-+ kfree(pcd);
- }
-
- #endif /* CONFIG_PM */
-@@ -196,11 +196,11 @@ void pm_runtime_clk_destroy(struct device *dev)
- #ifdef CONFIG_PM_RUNTIME
-
- /**
-- * pm_runtime_clk_acquire - Acquire a device clock.
-+ * pm_clk_acquire - Acquire a device clock.
- * @dev: Device whose clock is to be acquired.
- * @con_id: Connection ID of the clock.
- */
--static void pm_runtime_clk_acquire(struct device *dev,
-+static void pm_clk_acquire(struct device *dev,
- struct pm_clock_entry *ce)
- {
- ce->clk = clk_get(dev, ce->con_id);
-@@ -213,24 +213,24 @@ static void pm_runtime_clk_acquire(struct device *dev,
- }
-
- /**
-- * pm_runtime_clk_suspend - Disable clocks in a device's runtime PM clock list.
-+ * pm_clk_suspend - Disable clocks in a device's PM clock list.
- * @dev: Device to disable the clocks for.
- */
--int pm_runtime_clk_suspend(struct device *dev)
-+int pm_clk_suspend(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (!prd)
-+ if (!pcd)
- return 0;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry_reverse(ce, &prd->clock_list, node) {
-+ list_for_each_entry_reverse(ce, &pcd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
-- pm_runtime_clk_acquire(dev, ce);
-+ pm_clk_acquire(dev, ce);
-
- if (ce->status < PCE_STATUS_ERROR) {
- clk_disable(ce->clk);
-@@ -238,30 +238,30 @@ int pm_runtime_clk_suspend(struct device *dev)
- }
- }
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
-
- return 0;
- }
-
- /**
-- * pm_runtime_clk_resume - Enable clocks in a device's runtime PM clock list.
-+ * pm_clk_resume - Enable clocks in a device's PM clock list.
- * @dev: Device to enable the clocks for.
- */
--int pm_runtime_clk_resume(struct device *dev)
-+int pm_clk_resume(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (!prd)
-+ if (!pcd)
- return 0;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry(ce, &prd->clock_list, node) {
-+ list_for_each_entry(ce, &pcd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
-- pm_runtime_clk_acquire(dev, ce);
-+ pm_clk_acquire(dev, ce);
-
- if (ce->status < PCE_STATUS_ERROR) {
- clk_enable(ce->clk);
-@@ -269,13 +269,13 @@ int pm_runtime_clk_resume(struct device *dev)
- }
- }
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
-
- return 0;
- }
-
- /**
-- * pm_runtime_clk_notify - Notify routine for device addition and removal.
-+ * pm_clk_notify - Notify routine for device addition and removal.
- * @nb: Notifier block object this function is a member of.
- * @action: Operation being carried out by the caller.
- * @data: Device the routine is being run for.
-@@ -284,13 +284,13 @@ int pm_runtime_clk_resume(struct device *dev)
- * struct pm_clk_notifier_block containing all of the requisite data.
- * Specifically, the pm_domain member of that object is copied to the device's
- * pm_domain field and its con_ids member is used to populate the device's list
-- * of runtime PM clocks, depending on @action.
-+ * of PM clocks, depending on @action.
- *
- * If the device's pm_domain field is already populated with a value different
- * from the one stored in the struct pm_clk_notifier_block object, the function
- * does nothing.
- */
--static int pm_runtime_clk_notify(struct notifier_block *nb,
-+static int pm_clk_notify(struct notifier_block *nb,
- unsigned long action, void *data)
- {
- struct pm_clk_notifier_block *clknb;
-@@ -307,16 +307,16 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
- if (dev->pm_domain)
- break;
-
-- error = pm_runtime_clk_init(dev);
-+ error = pm_clk_init(dev);
- if (error)
- break;
-
- dev->pm_domain = clknb->pm_domain;
- if (clknb->con_ids[0]) {
- for (con_id = clknb->con_ids; *con_id; con_id++)
-- pm_runtime_clk_add(dev, *con_id);
-+ pm_clk_add(dev, *con_id);
- } else {
-- pm_runtime_clk_add(dev, NULL);
-+ pm_clk_add(dev, NULL);
- }
-
- break;
-@@ -325,7 +325,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
- break;
-
- dev->pm_domain = NULL;
-- pm_runtime_clk_destroy(dev);
-+ pm_clk_destroy(dev);
- break;
- }
-
-@@ -337,51 +337,51 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
- #ifdef CONFIG_PM
-
- /**
-- * pm_runtime_clk_suspend - Disable clocks in a device's PM clock list.
-+ * pm_clk_suspend - Disable clocks in a device's PM clock list.
- * @dev: Device to disable the clocks for.
- */
--int pm_runtime_clk_suspend(struct device *dev)
-+int pm_clk_suspend(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- /* If there is no driver, the clocks are already disabled. */
-- if (!prd || !dev->driver)
-+ if (!pcd || !dev->driver)
- return 0;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry_reverse(ce, &prd->clock_list, node)
-+ list_for_each_entry_reverse(ce, &pcd->clock_list, node)
- clk_disable(ce->clk);
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
-
- return 0;
- }
-
- /**
-- * pm_runtime_clk_resume - Enable clocks in a device's PM clock list.
-+ * pm_clk_resume - Enable clocks in a device's PM clock list.
- * @dev: Device to enable the clocks for.
- */
--int pm_runtime_clk_resume(struct device *dev)
-+int pm_clk_resume(struct device *dev)
- {
-- struct pm_runtime_clk_data *prd = __to_prd(dev);
-+ struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- /* If there is no driver, the clocks should remain disabled. */
-- if (!prd || !dev->driver)
-+ if (!pcd || !dev->driver)
- return 0;
-
-- mutex_lock(&prd->lock);
-+ mutex_lock(&pcd->lock);
-
-- list_for_each_entry(ce, &prd->clock_list, node)
-+ list_for_each_entry(ce, &pcd->clock_list, node)
- clk_enable(ce->clk);
-
-- mutex_unlock(&prd->lock);
-+ mutex_unlock(&pcd->lock);
-
- return 0;
- }
-@@ -423,7 +423,7 @@ static void disable_clock(struct device *dev, const char *con_id)
- }
-
- /**
-- * pm_runtime_clk_notify - Notify routine for device addition and removal.
-+ * pm_clk_notify - Notify routine for device addition and removal.
- * @nb: Notifier block object this function is a member of.
- * @action: Operation being carried out by the caller.
- * @data: Device the routine is being run for.
-@@ -433,7 +433,7 @@ static void disable_clock(struct device *dev, const char *con_id)
- * Specifically, the con_ids member of that object is used to enable or disable
- * the device's clocks, depending on @action.
- */
--static int pm_runtime_clk_notify(struct notifier_block *nb,
-+static int pm_clk_notify(struct notifier_block *nb,
- unsigned long action, void *data)
- {
- struct pm_clk_notifier_block *clknb;
-@@ -469,21 +469,21 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
- #endif /* !CONFIG_PM_RUNTIME */
-
- /**
-- * pm_runtime_clk_add_notifier - Add bus type notifier for runtime PM clocks.
-+ * pm_clk_add_notifier - Add bus type notifier for power management clocks.
- * @bus: Bus type to add the notifier to.
- * @clknb: Notifier to be added to the given bus type.
- *
- * The nb member of @clknb is not expected to be initialized and its
-- * notifier_call member will be replaced with pm_runtime_clk_notify(). However,
-+ * notifier_call member will be replaced with pm_clk_notify(). However,
- * the remaining members of @clknb should be populated prior to calling this
- * routine.
- */
--void pm_runtime_clk_add_notifier(struct bus_type *bus,
-+void pm_clk_add_notifier(struct bus_type *bus,
- struct pm_clk_notifier_block *clknb)
- {
- if (!bus || !clknb)
- return;
-
-- clknb->nb.notifier_call = pm_runtime_clk_notify;
-+ clknb->nb.notifier_call = pm_clk_notify;
- bus_register_notifier(bus, &clknb->nb);
- }
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 1bd5063..dfb8539 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -252,36 +252,36 @@ struct pm_clk_notifier_block {
- };
-
- #ifdef CONFIG_PM_CLK
--extern int pm_runtime_clk_init(struct device *dev);
--extern void pm_runtime_clk_destroy(struct device *dev);
--extern int pm_runtime_clk_add(struct device *dev, const char *con_id);
--extern void pm_runtime_clk_remove(struct device *dev, const char *con_id);
--extern int pm_runtime_clk_suspend(struct device *dev);
--extern int pm_runtime_clk_resume(struct device *dev);
-+extern int pm_clk_init(struct device *dev);
-+extern void pm_clk_destroy(struct device *dev);
-+extern int pm_clk_add(struct device *dev, const char *con_id);
-+extern void pm_clk_remove(struct device *dev, const char *con_id);
-+extern int pm_clk_suspend(struct device *dev);
-+extern int pm_clk_resume(struct device *dev);
- #else
--static inline int pm_runtime_clk_init(struct device *dev)
-+static inline int pm_clk_init(struct device *dev)
- {
- return -EINVAL;
- }
--static inline void pm_runtime_clk_destroy(struct device *dev)
-+static inline void pm_clk_destroy(struct device *dev)
- {
- }
--static inline int pm_runtime_clk_add(struct device *dev, const char *con_id)
-+static inline int pm_clk_add(struct device *dev, const char *con_id)
- {
- return -EINVAL;
- }
--static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id)
-+static inline void pm_clk_remove(struct device *dev, const char *con_id)
- {
- }
--#define pm_runtime_clock_suspend NULL
--#define pm_runtime_clock_resume NULL
-+#define pm_clk_suspend NULL
-+#define pm_clk_resume NULL
- #endif
-
- #ifdef CONFIG_HAVE_CLK
--extern void pm_runtime_clk_add_notifier(struct bus_type *bus,
-+extern void pm_clk_add_notifier(struct bus_type *bus,
- struct pm_clk_notifier_block *clknb);
- #else
--static inline void pm_runtime_clk_add_notifier(struct bus_type *bus,
-+static inline void pm_clk_add_notifier(struct bus_type *bus,
- struct pm_clk_notifier_block *clknb)
- {
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0011-PM-Runtime-Update-documentation-of-interactions-with.patch b/patches.runtime_pm/0011-PM-Runtime-Update-documentation-of-interactions-with.patch
deleted file mode 100644
index 3d59c0725444f9..00000000000000
--- a/patches.runtime_pm/0011-PM-Runtime-Update-documentation-of-interactions-with.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 313112d5f92eba88e4ce0e40e8b1614c6a7210d5 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:29:05 +0200
-Subject: PM / Runtime: Update documentation of interactions with system sleep
-
-The documents describing the interactions between runtime PM and
-system sleep generally refer to the model in which the system sleep
-state is entered through a global firmware or hardware operation.
-As a result, some recommendations given in there are not entirely
-suitable for systems in which this is not the case. Update the
-documentation to take the existence of those systems into account.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 455716e9b12ba93e93181ac88bef62e4eb5ac66c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 6 +++---
- Documentation/power/runtime_pm.txt | 27 +++++++++++++++++++--------
- 2 files changed, 22 insertions(+), 11 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 85c6f98..3384d59 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be
- disabled. This all depends on the hardware and the design of the subsystem and
- device driver in question.
-
--During system-wide resume from a sleep state it's best to put devices into the
--full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to
--that document for more information regarding this particular issue as well as
-+During system-wide resume from a sleep state it's easiest to put devices into
-+the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer
-+to that document for more information regarding this particular issue as well as
- for information on the device runtime power management framework in general.
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 4b011b1..513c52e 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -553,9 +553,9 @@ suspend routine). It may be necessary to resume the device and suspend it again
- in order to do so. The same is true if the driver uses different power levels
- or other settings for run-time suspend and system sleep.
-
--During system resume, devices generally should be brought back to full power,
--even if they were suspended before the system sleep began. There are several
--reasons for this, including:
-+During system resume, the simplest approach is to bring all devices back to full
-+power, even if they had been suspended before the system suspend began. There
-+are several reasons for this, including:
-
- * The device might need to switch power levels, wake-up settings, etc.
-
-@@ -572,16 +572,27 @@ reasons for this, including:
- * Even though the device was suspended, if its usage counter was > 0 then most
- likely it would need a run-time resume in the near future anyway.
-
-- * Always going back to full power is simplest.
--
--If the device was suspended before the sleep began, then its run-time PM status
--will have to be updated to reflect the actual post-system sleep status. The way
--to do this is:
-+If the device had been suspended before the system suspend began and it's
-+brought back to full power during resume, then its run-time PM status will have
-+to be updated to reflect the actual post-system sleep status. The way to do
-+this is:
-
- pm_runtime_disable(dev);
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-
-+On some systems, however, system sleep is not entered through a global firmware
-+or hardware operation. Instead, all hardware components are put into low-power
-+states directly by the kernel in a coordinated way. Then, the system sleep
-+state effectively follows from the states the hardware components end up in
-+and the system is woken up from that state by a hardware interrupt or a similar
-+mechanism entirely under the kernel's control. As a result, the kernel never
-+gives control away and the states of all devices during resume are precisely
-+known to it. If that is the case and none of the situations listed above takes
-+place (in particular, if the system is not waking up from hibernation), it may
-+be more efficient to leave the devices that had been suspended before the system
-+suspend began in the suspended state.
-+
- 7. Generic subsystem callbacks
-
- Subsystems may wish to conserve code space by using the set of generic power
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0012-PM-Runtime-Return-special-error-code-if-runtime-PM-i.patch b/patches.runtime_pm/0012-PM-Runtime-Return-special-error-code-if-runtime-PM-i.patch
deleted file mode 100644
index 194d416d8f5014..00000000000000
--- a/patches.runtime_pm/0012-PM-Runtime-Return-special-error-code-if-runtime-PM-i.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 143c483c6f44d21be959051e4d494de9709a96cb Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 1 Jul 2011 22:29:15 +0200
-Subject: PM / Runtime: Return special error code if runtime PM is disabled
-
-Some callers of pm_runtime_get_sync() and other runtime PM helper
-functions, scsi_autopm_get_host() and scsi_autopm_get_device() in
-particular, need to distinguish error codes returned when runtime PM
-is disabled (i.e. power.disable_depth is nonzero for the given
-device) from error codes returned in other situations. For this
-reason, make the runtime PM helper functions return -EACCES when
-power.disable_depth is nonzero and ensure that this error code
-won't be returned by them in any other circumstances. Modify
-scsi_autopm_get_host() and scsi_autopm_get_device() to check the
-error code returned by pm_runtime_get_sync() and ignore -EACCES.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 632e270e01d8a1ee9e8ea56c83028727f17b1d17)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 6 ++++--
- drivers/base/power/runtime.c | 9 +++++----
- drivers/scsi/scsi_pm.c | 8 ++++----
- 3 files changed, 13 insertions(+), 10 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 513c52e..0ec3d61 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -291,7 +291,8 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- - execute the subsystem-level suspend callback for the device; returns 0 on
- success, 1 if the device's run-time PM status was already 'suspended', or
- error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt
-- to suspend the device again in future
-+ to suspend the device again in future and -EACCES means that
-+ 'power.disable_depth' is different from 0
-
- int pm_runtime_autosuspend(struct device *dev);
- - same as pm_runtime_suspend() except that the autosuspend delay is taken
-@@ -304,7 +305,8 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- success, 1 if the device's run-time PM status was already 'active' or
- error code on failure, where -EAGAIN means it may be safe to attempt to
- resume the device again in future, but 'power.runtime_error' should be
-- checked additionally
-+ checked additionally, and -EACCES means that 'power.disable_depth' is
-+ different from 0
-
- int pm_request_idle(struct device *dev);
- - submit a request to execute the subsystem-level idle callback for the
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 5f5c423..ee99025 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -135,8 +135,9 @@ static int rpm_check_suspend_allowed(struct device *dev)
-
- if (dev->power.runtime_error)
- retval = -EINVAL;
-- else if (atomic_read(&dev->power.usage_count) > 0
-- || dev->power.disable_depth > 0)
-+ else if (dev->power.disable_depth > 0)
-+ retval = -EACCES;
-+ else if (atomic_read(&dev->power.usage_count) > 0)
- retval = -EAGAIN;
- else if (!pm_children_suspended(dev))
- retval = -EBUSY;
-@@ -262,7 +263,7 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- spin_lock_irq(&dev->power.lock);
- }
- dev->power.runtime_error = retval;
-- return retval;
-+ return retval != -EACCES ? retval : -EIO;
- }
-
- /**
-@@ -458,7 +459,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
- if (dev->power.runtime_error)
- retval = -EINVAL;
- else if (dev->power.disable_depth > 0)
-- retval = -EAGAIN;
-+ retval = -EACCES;
- if (retval)
- goto out;
-
-diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
-index 122a5a2..995cdd5 100644
---- a/drivers/scsi/scsi_pm.c
-+++ b/drivers/scsi/scsi_pm.c
-@@ -159,9 +159,9 @@ int scsi_autopm_get_device(struct scsi_device *sdev)
- int err;
-
- err = pm_runtime_get_sync(&sdev->sdev_gendev);
-- if (err < 0)
-+ if (err < 0 && err !=-EACCES)
- pm_runtime_put_sync(&sdev->sdev_gendev);
-- else if (err > 0)
-+ else
- err = 0;
- return err;
- }
-@@ -188,9 +188,9 @@ int scsi_autopm_get_host(struct Scsi_Host *shost)
- int err;
-
- err = pm_runtime_get_sync(&shost->shost_gendev);
-- if (err < 0)
-+ if (err < 0 && err !=-EACCES)
- pm_runtime_put_sync(&shost->shost_gendev);
-- else if (err > 0)
-+ else
- err = 0;
- return err;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0013-PM-Limit-race-conditions-between-runtime-PM-and-syst.patch b/patches.runtime_pm/0013-PM-Limit-race-conditions-between-runtime-PM-and-syst.patch
deleted file mode 100644
index 1ac0565a3702e2..00000000000000
--- a/patches.runtime_pm/0013-PM-Limit-race-conditions-between-runtime-PM-and-syst.patch
+++ /dev/null
@@ -1,224 +0,0 @@
-From e548d5f9651fa90d90090a843c9495c4fcb38600 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 6 Jul 2011 10:51:58 +0200
-Subject: PM: Limit race conditions between runtime PM and system sleep (v2)
-
-One of the roles of the PM core is to prevent different PM callbacks
-executed for the same device object from racing with each other.
-Unfortunately, after commit e8665002477f0278f84f898145b1f141ba26ee26
-(PM: Allow pm_runtime_suspend() to succeed during system suspend)
-runtime PM callbacks may be executed concurrently with system
-suspend/resume callbacks for the same device.
-
-The main reason for commit e8665002477f0278f84f898145b1f141ba26ee26
-was that some subsystems and device drivers wanted to use runtime PM
-helpers, pm_runtime_suspend() and pm_runtime_put_sync() in
-particular, for carrying out the suspend of devices in their
-.suspend() callbacks. However, as it's been determined recently,
-there are multiple reasons not to do so, inlcuding:
-
- * The caller really doesn't control the runtime PM usage counters,
- because user space can access them through sysfs and effectively
- block runtime PM. That means using pm_runtime_suspend() or
- pm_runtime_get_sync() to suspend devices during system suspend
- may or may not work.
-
- * If a driver calls pm_runtime_suspend() from its .suspend()
- callback, it causes the subsystem's .runtime_suspend() callback to
- be executed, which leads to the call sequence:
-
- subsys->suspend(dev)
- driver->suspend(dev)
- pm_runtime_suspend(dev)
- subsys->runtime_suspend(dev)
-
- recursive from the subsystem's point of view. For some subsystems
- that may actually work (e.g. the platform bus type), but for some
- it will fail in a rather spectacular fashion (e.g. PCI). In each
- case it means a layering violation.
-
- * Both the subsystem and the driver can provide .suspend_noirq()
- callbacks for system suspend that can do whatever the
- .runtime_suspend() callbacks do just fine, so it really isn't
- necessary to call pm_runtime_suspend() during system suspend.
-
- * The runtime PM's handling of wakeup devices is usually different
- from the system suspend's one, so .runtime_suspend() may simply be
- inappropriate for system suspend.
-
- * System suspend is supposed to work even if CONFIG_PM_RUNTIME is
- unset.
-
- * The runtime PM workqueue is frozen before system suspend, so if
- whatever the driver is going to do during system suspend depends
- on it, that simply won't work.
-
-Still, there is a good reason to allow pm_runtime_resume() to
-succeed during system suspend and resume (for instance, some
-subsystems and device drivers may legitimately use it to ensure that
-their devices are in full-power states before suspending them).
-Moreover, there is no reason to prevent runtime PM callbacks from
-being executed in parallel with the system suspend/resume .prepare()
-and .complete() callbacks and the code removed by commit
-e8665002477f0278f84f898145b1f141ba26ee26 went too far in this
-respect. On the other hand, runtime PM callbacks, including
-.runtime_resume(), must not be executed during system suspend's
-"late" stage of suspending devices and during system resume's "early"
-device resume stage.
-
-Taking all of the above into consideration, make the PM core
-acquire a runtime PM reference to every device and resume it if
-there's a runtime PM resume request pending right before executing
-the subsystem-level .suspend() callback for it. Make the PM core
-drop references to all devices right after executing the
-subsystem-level .resume() callbacks for them. Additionally,
-make the PM core disable the runtime PM framework for all devices
-during system suspend, after executing the subsystem-level .suspend()
-callbacks for them, and enable the runtime PM framework for all
-devices during system resume, right before executing the
-subsystem-level .resume() callbacks for them.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 1e2ef05bb8cf851a694d38e9170c89e7ff052741)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 21 +++++++++++++++++++++
- drivers/base/power/main.c | 35 +++++++++++++++++++++++------------
- 2 files changed, 44 insertions(+), 12 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 0ec3d61..d50dd1a 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -583,6 +583,13 @@ this is:
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-
-+The PM core always increments the run-time usage counter before calling the
-+->suspend() callback and decrements it after calling the ->resume() callback.
-+Hence disabling run-time PM temporarily like this will not cause any runtime
-+suspend attempts to be permanently lost. If the usage count goes to zero
-+following the return of the ->resume() callback, the ->runtime_idle() callback
-+will be invoked as usual.
-+
- On some systems, however, system sleep is not entered through a global firmware
- or hardware operation. Instead, all hardware components are put into low-power
- states directly by the kernel in a coordinated way. Then, the system sleep
-@@ -595,6 +602,20 @@ place (in particular, if the system is not waking up from hibernation), it may
- be more efficient to leave the devices that had been suspended before the system
- suspend began in the suspended state.
-
-+The PM core does its best to reduce the probability of race conditions between
-+the runtime PM and system suspend/resume (and hibernation) callbacks by carrying
-+out the following operations:
-+
-+ * During system suspend it calls pm_runtime_get_noresume() and
-+ pm_runtime_barrier() for every device right before executing the
-+ subsystem-level .suspend() callback for it. In addition to that it calls
-+ pm_runtime_disable() for every device right after executing the
-+ subsystem-level .suspend() callback for it.
-+
-+ * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync()
-+ for every device right before and right after executing the subsystem-level
-+ .resume() callback for it, respectively.
-+
- 7. Generic subsystem callbacks
-
- Subsystems may wish to conserve code space by using the set of generic power
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 85b591a..a854591 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -505,6 +505,7 @@ static int legacy_resume(struct device *dev, int (*cb)(struct device *dev))
- static int device_resume(struct device *dev, pm_message_t state, bool async)
- {
- int error = 0;
-+ bool put = false;
-
- TRACE_DEVICE(dev);
- TRACE_RESUME(0);
-@@ -521,6 +522,9 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- if (!dev->power.is_suspended)
- goto Unlock;
-
-+ pm_runtime_enable(dev);
-+ put = true;
-+
- if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "power domain ");
- error = pm_op(dev, &dev->pm_domain->ops, state);
-@@ -563,6 +567,10 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- complete_all(&dev->power.completion);
-
- TRACE_RESUME(error);
-+
-+ if (put)
-+ pm_runtime_put_sync(dev);
-+
- return error;
- }
-
-@@ -843,16 +851,22 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- int error = 0;
-
- dpm_wait_for_children(dev, async);
-- device_lock(dev);
-
- if (async_error)
-- goto Unlock;
-+ return 0;
-+
-+ pm_runtime_get_noresume(dev);
-+ if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
-+ pm_wakeup_event(dev, 0);
-
- if (pm_wakeup_pending()) {
-+ pm_runtime_put_sync(dev);
- async_error = -EBUSY;
-- goto Unlock;
-+ return 0;
- }
-
-+ device_lock(dev);
-+
- if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "power domain ");
- error = pm_op(dev, &dev->pm_domain->ops, state);
-@@ -890,12 +904,15 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- End:
- dev->power.is_suspended = !error;
-
-- Unlock:
- device_unlock(dev);
- complete_all(&dev->power.completion);
-
-- if (error)
-+ if (error) {
-+ pm_runtime_put_sync(dev);
- async_error = error;
-+ } else if (dev->power.is_suspended) {
-+ __pm_runtime_disable(dev, false);
-+ }
-
- return error;
- }
-@@ -1035,13 +1052,7 @@ int dpm_prepare(pm_message_t state)
- get_device(dev);
- mutex_unlock(&dpm_list_mtx);
-
-- pm_runtime_get_noresume(dev);
-- if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
-- pm_wakeup_event(dev, 0);
--
-- pm_runtime_put_sync(dev);
-- error = pm_wakeup_pending() ?
-- -EBUSY : device_prepare(dev, state);
-+ error = device_prepare(dev, state);
-
- mutex_lock(&dpm_list_mtx);
- if (error) {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0014-PM-Runtime-Improve-documentation-of-enable-disable-a.patch b/patches.runtime_pm/0014-PM-Runtime-Improve-documentation-of-enable-disable-a.patch
deleted file mode 100644
index 6eb6a532903c4c..00000000000000
--- a/patches.runtime_pm/0014-PM-Runtime-Improve-documentation-of-enable-disable-a.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 24acf9a9be8bb6115cd58f5453c1bf18b69243f0 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 6 Jul 2011 10:52:06 +0200
-Subject: PM / Runtime: Improve documentation of enable, disable and barrier
-
-The runtime PM documentation in Documentation/power/runtime_pm.txt
-doesn't say that pm_runtime_enable() and pm_runtime_disable() work by
-operating on power.disable_depth, which is wrong, because the
-possibility of nesting disables doesn't follow from the description
-of these functions. Also, there is no description of
-pm_runtime_barrier() at all in the document, which is confusing.
-Improve the documentation by fixing those issues.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e358bad75ff13210f5211cac9f93d76170d43f89)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 18 ++++++++++++++----
- 1 file changed, 14 insertions(+), 4 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index d50dd1a..ca15bbb 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -369,17 +369,27 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- pm_runtime_autosuspend(dev) and return its result
-
- void pm_runtime_enable(struct device *dev);
-- - enable the run-time PM helper functions to run the device bus type's
-- run-time PM callbacks described in Section 2
-+ - decrement the device's 'power.disable_depth' field; if that field is equal
-+ to zero, the run-time PM helper functions can execute subsystem-level
-+ callbacks described in Section 2 for the device
-
- int pm_runtime_disable(struct device *dev);
-- - prevent the run-time PM helper functions from running subsystem-level
-- run-time PM callbacks for the device, make sure that all of the pending
-+ - increment the device's 'power.disable_depth' field (if the value of that
-+ field was previously zero, this prevents subsystem-level runtime PM
-+ callbacks from being run for the device), make sure that all of the pending
- run-time PM operations on the device are either completed or canceled;
- returns 1 if there was a resume request pending and it was necessary to
- execute the subsystem-level resume callback for the device to satisfy that
- request, otherwise 0 is returned
-
-+ int pm_runtime_barrier(struct device *dev);
-+ - check if there's a resume request pending for the device and resume it
-+ (synchronously) in that case, cancel any other pending runtime PM requests
-+ regarding it and wait for all runtime PM operations on it in progress to
-+ complete; returns 1 if there was a resume request pending and it was
-+ necessary to execute the subsystem-level resume callback for the device to
-+ satisfy that request, otherwise 0 is returned
-+
- void pm_suspend_ignore_children(struct device *dev, bool enable);
- - set/unset the power.ignore_children flag of the device
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0015-PM-Runtime-Replace-run-time-with-runtime-in-document.patch b/patches.runtime_pm/0015-PM-Runtime-Replace-run-time-with-runtime-in-document.patch
deleted file mode 100644
index 9586970c7ffae8..00000000000000
--- a/patches.runtime_pm/0015-PM-Runtime-Replace-run-time-with-runtime-in-document.patch
+++ /dev/null
@@ -1,685 +0,0 @@
-From 653b76192ea82c4960de68f8ef2991a6b648fe03 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 6 Jul 2011 10:52:13 +0200
-Subject: PM / Runtime: Replace "run-time" with "runtime" in documentation
-
-The runtime PM documentation and kerneldoc comments sometimes spell
-"runtime" with a dash (i.e. "run-time"). Replace all of those
-instances with "runtime" to make the naming consistent.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 62052ab1d1a456f5f62f8b753e12d10ca1a83604)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 130 ++++++++++++++++++------------------
- drivers/base/power/runtime.c | 66 +++++++++---------
- 2 files changed, 98 insertions(+), 98 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index ca15bbb..40e47c7 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -1,39 +1,39 @@
--Run-time Power Management Framework for I/O Devices
-+Runtime Power Management Framework for I/O Devices
-
- (C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
- (C) 2010 Alan Stern <stern@rowland.harvard.edu>
-
- 1. Introduction
-
--Support for run-time power management (run-time PM) of I/O devices is provided
-+Support for runtime power management (runtime PM) of I/O devices is provided
- at the power management core (PM core) level by means of:
-
- * The power management workqueue pm_wq in which bus types and device drivers can
- put their PM-related work items. It is strongly recommended that pm_wq be
-- used for queuing all work items related to run-time PM, because this allows
-+ used for queuing all work items related to runtime PM, because this allows
- them to be synchronized with system-wide power transitions (suspend to RAM,
- hibernation and resume from system sleep states). pm_wq is declared in
- include/linux/pm_runtime.h and defined in kernel/power/main.c.
-
--* A number of run-time PM fields in the 'power' member of 'struct device' (which
-+* A number of runtime PM fields in the 'power' member of 'struct device' (which
- is of the type 'struct dev_pm_info', defined in include/linux/pm.h) that can
-- be used for synchronizing run-time PM operations with one another.
-+ be used for synchronizing runtime PM operations with one another.
-
--* Three device run-time PM callbacks in 'struct dev_pm_ops' (defined in
-+* Three device runtime PM callbacks in 'struct dev_pm_ops' (defined in
- include/linux/pm.h).
-
- * A set of helper functions defined in drivers/base/power/runtime.c that can be
-- used for carrying out run-time PM operations in such a way that the
-+ used for carrying out runtime PM operations in such a way that the
- synchronization between them is taken care of by the PM core. Bus types and
- device drivers are encouraged to use these functions.
-
--The run-time PM callbacks present in 'struct dev_pm_ops', the device run-time PM
-+The runtime PM callbacks present in 'struct dev_pm_ops', the device runtime PM
- fields of 'struct dev_pm_info' and the core helper functions provided for
--run-time PM are described below.
-+runtime PM are described below.
-
--2. Device Run-time PM Callbacks
-+2. Device Runtime PM Callbacks
-
--There are three device run-time PM callbacks defined in 'struct dev_pm_ops':
-+There are three device runtime PM callbacks defined in 'struct dev_pm_ops':
-
- struct dev_pm_ops {
- ...
-@@ -72,11 +72,11 @@ knows what to do to handle the device).
- not mean that the device has been put into a low power state. It is
- supposed to mean, however, that the device will not process data and will
- not communicate with the CPU(s) and RAM until the subsystem-level resume
-- callback is executed for it. The run-time PM status of a device after
-+ callback is executed for it. The runtime PM status of a device after
- successful execution of the subsystem-level suspend callback is 'suspended'.
-
- * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN,
-- the device's run-time PM status is 'active', which means that the device
-+ the device's runtime PM status is 'active', which means that the device
- _must_ be fully operational afterwards.
-
- * If the subsystem-level suspend callback returns an error code different
-@@ -104,7 +104,7 @@ the device).
-
- * Once the subsystem-level resume callback has completed successfully, the PM
- core regards the device as fully operational, which means that the device
-- _must_ be able to complete I/O operations as needed. The run-time PM status
-+ _must_ be able to complete I/O operations as needed. The runtime PM status
- of the device is then 'active'.
-
- * If the subsystem-level resume callback returns an error code, the PM core
-@@ -130,7 +130,7 @@ device in that case. The value returned by this callback is ignored by the PM
- core.
-
- The helper functions provided by the PM core, described in Section 4, guarantee
--that the following constraints are met with respect to the bus type's run-time
-+that the following constraints are met with respect to the bus type's runtime
- PM callbacks:
-
- (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute
-@@ -142,7 +142,7 @@ PM callbacks:
-
- (2) ->runtime_idle() and ->runtime_suspend() can only be executed for 'active'
- devices (i.e. the PM core will only execute ->runtime_idle() or
-- ->runtime_suspend() for the devices the run-time PM status of which is
-+ ->runtime_suspend() for the devices the runtime PM status of which is
- 'active').
-
- (3) ->runtime_idle() and ->runtime_suspend() can only be executed for a device
-@@ -151,7 +151,7 @@ PM callbacks:
- flag of which is set.
-
- (4) ->runtime_resume() can only be executed for 'suspended' devices (i.e. the
-- PM core will only execute ->runtime_resume() for the devices the run-time
-+ PM core will only execute ->runtime_resume() for the devices the runtime
- PM status of which is 'suspended').
-
- Additionally, the helper functions provided by the PM core obey the following
-@@ -171,9 +171,9 @@ rules:
- scheduled requests to execute the other callbacks for the same device,
- except for scheduled autosuspends.
-
--3. Run-time PM Device Fields
-+3. Runtime PM Device Fields
-
--The following device run-time PM fields are present in 'struct dev_pm_info', as
-+The following device runtime PM fields are present in 'struct dev_pm_info', as
- defined in include/linux/pm.h:
-
- struct timer_list suspend_timer;
-@@ -205,7 +205,7 @@ defined in include/linux/pm.h:
-
- unsigned int disable_depth;
- - used for disabling the helper funcions (they work normally if this is
-- equal to zero); the initial value of it is 1 (i.e. run-time PM is
-+ equal to zero); the initial value of it is 1 (i.e. runtime PM is
- initially disabled for all devices)
-
- unsigned int runtime_error;
-@@ -229,10 +229,10 @@ defined in include/linux/pm.h:
- suspend to complete; means "start a resume as soon as you've suspended"
-
- unsigned int run_wake;
-- - set if the device is capable of generating run-time wake-up events
-+ - set if the device is capable of generating runtime wake-up events
-
- enum rpm_status runtime_status;
-- - the run-time PM status of the device; this field's initial value is
-+ - the runtime PM status of the device; this field's initial value is
- RPM_SUSPENDED, which means that each device is initially regarded by the
- PM core as 'suspended', regardless of its real hardware status
-
-@@ -243,7 +243,7 @@ defined in include/linux/pm.h:
- and pm_runtime_forbid() helper functions
-
- unsigned int no_callbacks;
-- - indicates that the device does not use the run-time PM callbacks (see
-+ - indicates that the device does not use the runtime PM callbacks (see
- Section 8); it may be modified only by the pm_runtime_no_callbacks()
- helper function
-
-@@ -270,16 +270,16 @@ defined in include/linux/pm.h:
-
- All of the above fields are members of the 'power' member of 'struct device'.
-
--4. Run-time PM Device Helper Functions
-+4. Runtime PM Device Helper Functions
-
--The following run-time PM helper functions are defined in
-+The following runtime PM helper functions are defined in
- drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- void pm_runtime_init(struct device *dev);
-- - initialize the device run-time PM fields in 'struct dev_pm_info'
-+ - initialize the device runtime PM fields in 'struct dev_pm_info'
-
- void pm_runtime_remove(struct device *dev);
-- - make sure that the run-time PM of the device will be disabled after
-+ - make sure that the runtime PM of the device will be disabled after
- removing the device from device hierarchy
-
- int pm_runtime_idle(struct device *dev);
-@@ -289,7 +289,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- int pm_runtime_suspend(struct device *dev);
- - execute the subsystem-level suspend callback for the device; returns 0 on
-- success, 1 if the device's run-time PM status was already 'suspended', or
-+ success, 1 if the device's runtime PM status was already 'suspended', or
- error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt
- to suspend the device again in future and -EACCES means that
- 'power.disable_depth' is different from 0
-@@ -302,7 +302,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- int pm_runtime_resume(struct device *dev);
- - execute the subsystem-level resume callback for the device; returns 0 on
-- success, 1 if the device's run-time PM status was already 'active' or
-+ success, 1 if the device's runtime PM status was already 'active' or
- error code on failure, where -EAGAIN means it may be safe to attempt to
- resume the device again in future, but 'power.runtime_error' should be
- checked additionally, and -EACCES means that 'power.disable_depth' is
-@@ -323,7 +323,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- device in future, where 'delay' is the time to wait before queuing up a
- suspend work item in pm_wq, in milliseconds (if 'delay' is zero, the work
- item is queued up immediately); returns 0 on success, 1 if the device's PM
-- run-time status was already 'suspended', or error code if the request
-+ runtime status was already 'suspended', or error code if the request
- hasn't been scheduled (or queued up if 'delay' is 0); if the execution of
- ->runtime_suspend() is already scheduled and not yet expired, the new
- value of 'delay' will be used as the time to wait
-@@ -331,7 +331,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- int pm_request_resume(struct device *dev);
- - submit a request to execute the subsystem-level resume callback for the
- device (the request is represented by a work item in pm_wq); returns 0 on
-- success, 1 if the device's run-time PM status was already 'active', or
-+ success, 1 if the device's runtime PM status was already 'active', or
- error code if the request hasn't been queued up
-
- void pm_runtime_get_noresume(struct device *dev);
-@@ -370,14 +370,14 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- void pm_runtime_enable(struct device *dev);
- - decrement the device's 'power.disable_depth' field; if that field is equal
-- to zero, the run-time PM helper functions can execute subsystem-level
-+ to zero, the runtime PM helper functions can execute subsystem-level
- callbacks described in Section 2 for the device
-
- int pm_runtime_disable(struct device *dev);
- - increment the device's 'power.disable_depth' field (if the value of that
- field was previously zero, this prevents subsystem-level runtime PM
- callbacks from being run for the device), make sure that all of the pending
-- run-time PM operations on the device are either completed or canceled;
-+ runtime PM operations on the device are either completed or canceled;
- returns 1 if there was a resume request pending and it was necessary to
- execute the subsystem-level resume callback for the device to satisfy that
- request, otherwise 0 is returned
-@@ -394,7 +394,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- - set/unset the power.ignore_children flag of the device
-
- int pm_runtime_set_active(struct device *dev);
-- - clear the device's 'power.runtime_error' flag, set the device's run-time
-+ - clear the device's 'power.runtime_error' flag, set the device's runtime
- PM status to 'active' and update its parent's counter of 'active'
- children as appropriate (it is only valid to use this function if
- 'power.runtime_error' is set or 'power.disable_depth' is greater than
-@@ -402,7 +402,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- which is not active and the 'power.ignore_children' flag of which is unset
-
- void pm_runtime_set_suspended(struct device *dev);
-- - clear the device's 'power.runtime_error' flag, set the device's run-time
-+ - clear the device's 'power.runtime_error' flag, set the device's runtime
- PM status to 'suspended' and update its parent's counter of 'active'
- children as appropriate (it is only valid to use this function if
- 'power.runtime_error' is set or 'power.disable_depth' is greater than
-@@ -423,7 +423,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- effectively prevent the device from being power managed at run time)
-
- void pm_runtime_no_callbacks(struct device *dev);
-- - set the power.no_callbacks flag for the device and remove the run-time
-+ - set the power.no_callbacks flag for the device and remove the runtime
- PM attributes from /sys/devices/.../power (or prevent them from being
- added when the device is registered)
-
-@@ -443,7 +443,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
- - set the power.autosuspend_delay value to 'delay' (expressed in
-- milliseconds); if 'delay' is negative then run-time suspends are
-+ milliseconds); if 'delay' is negative then runtime suspends are
- prevented
-
- unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
-@@ -482,35 +482,35 @@ pm_runtime_resume()
- pm_runtime_get_sync()
- pm_runtime_put_sync_suspend()
-
--5. Run-time PM Initialization, Device Probing and Removal
-+5. Runtime PM Initialization, Device Probing and Removal
-
--Initially, the run-time PM is disabled for all devices, which means that the
--majority of the run-time PM helper funtions described in Section 4 will return
-+Initially, the runtime PM is disabled for all devices, which means that the
-+majority of the runtime PM helper funtions described in Section 4 will return
- -EAGAIN until pm_runtime_enable() is called for the device.
-
--In addition to that, the initial run-time PM status of all devices is
-+In addition to that, the initial runtime PM status of all devices is
- 'suspended', but it need not reflect the actual physical state of the device.
- Thus, if the device is initially active (i.e. it is able to process I/O), its
--run-time PM status must be changed to 'active', with the help of
-+runtime PM status must be changed to 'active', with the help of
- pm_runtime_set_active(), before pm_runtime_enable() is called for the device.
-
--However, if the device has a parent and the parent's run-time PM is enabled,
-+However, if the device has a parent and the parent's runtime PM is enabled,
- calling pm_runtime_set_active() for the device will affect the parent, unless
- the parent's 'power.ignore_children' flag is set. Namely, in that case the
- parent won't be able to suspend at run time, using the PM core's helper
- functions, as long as the child's status is 'active', even if the child's
--run-time PM is still disabled (i.e. pm_runtime_enable() hasn't been called for
-+runtime PM is still disabled (i.e. pm_runtime_enable() hasn't been called for
- the child yet or pm_runtime_disable() has been called for it). For this reason,
- once pm_runtime_set_active() has been called for the device, pm_runtime_enable()
--should be called for it too as soon as reasonably possible or its run-time PM
-+should be called for it too as soon as reasonably possible or its runtime PM
- status should be changed back to 'suspended' with the help of
- pm_runtime_set_suspended().
-
--If the default initial run-time PM status of the device (i.e. 'suspended')
-+If the default initial runtime PM status of the device (i.e. 'suspended')
- reflects the actual state of the device, its bus type's or its driver's
- ->probe() callback will likely need to wake it up using one of the PM core's
- helper functions described in Section 4. In that case, pm_runtime_resume()
--should be used. Of course, for this purpose the device's run-time PM has to be
-+should be used. Of course, for this purpose the device's runtime PM has to be
- enabled earlier by calling pm_runtime_enable().
-
- If the device bus type's or driver's ->probe() callback runs
-@@ -541,29 +541,29 @@ The user space can effectively disallow the driver of the device to power manage
- it at run time by changing the value of its /sys/devices/.../power/control
- attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
- this mechanism may also be used by the driver to effectively turn off the
--run-time power management of the device until the user space turns it on.
--Namely, during the initialization the driver can make sure that the run-time PM
-+runtime power management of the device until the user space turns it on.
-+Namely, during the initialization the driver can make sure that the runtime PM
- status of the device is 'active' and call pm_runtime_forbid(). It should be
- noted, however, that if the user space has already intentionally changed the
- value of /sys/devices/.../power/control to "auto" to allow the driver to power
- manage the device at run time, the driver may confuse it by using
- pm_runtime_forbid() this way.
-
--6. Run-time PM and System Sleep
-+6. Runtime PM and System Sleep
-
--Run-time PM and system sleep (i.e., system suspend and hibernation, also known
-+Runtime PM and system sleep (i.e., system suspend and hibernation, also known
- as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of
- ways. If a device is active when a system sleep starts, everything is
- straightforward. But what should happen if the device is already suspended?
-
--The device may have different wake-up settings for run-time PM and system sleep.
--For example, remote wake-up may be enabled for run-time suspend but disallowed
-+The device may have different wake-up settings for runtime PM and system sleep.
-+For example, remote wake-up may be enabled for runtime suspend but disallowed
- for system sleep (device_may_wakeup(dev) returns 'false'). When this happens,
- the subsystem-level system suspend callback is responsible for changing the
- device's wake-up setting (it may leave that to the device driver's system
- suspend routine). It may be necessary to resume the device and suspend it again
- in order to do so. The same is true if the driver uses different power levels
--or other settings for run-time suspend and system sleep.
-+or other settings for runtime suspend and system sleep.
-
- During system resume, the simplest approach is to bring all devices back to full
- power, even if they had been suspended before the system suspend began. There
-@@ -582,10 +582,10 @@ are several reasons for this, including:
- * The device might need to be reset.
-
- * Even though the device was suspended, if its usage counter was > 0 then most
-- likely it would need a run-time resume in the near future anyway.
-+ likely it would need a runtime resume in the near future anyway.
-
- If the device had been suspended before the system suspend began and it's
--brought back to full power during resume, then its run-time PM status will have
-+brought back to full power during resume, then its runtime PM status will have
- to be updated to reflect the actual post-system sleep status. The way to do
- this is:
-
-@@ -593,9 +593,9 @@ this is:
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-
--The PM core always increments the run-time usage counter before calling the
-+The PM core always increments the runtime usage counter before calling the
- ->suspend() callback and decrements it after calling the ->resume() callback.
--Hence disabling run-time PM temporarily like this will not cause any runtime
-+Hence disabling runtime PM temporarily like this will not cause any runtime
- suspend attempts to be permanently lost. If the usage count goes to zero
- following the return of the ->resume() callback, the ->runtime_idle() callback
- will be invoked as usual.
-@@ -710,8 +710,8 @@ the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
- dev_pm_ops structure pointer.
-
- Device drivers that wish to use the same function as a system suspend, freeze,
--poweroff and run-time suspend callback, and similarly for system resume, thaw,
--restore, and run-time resume, can achieve this with the help of the
-+poweroff and runtime suspend callback, and similarly for system resume, thaw,
-+restore, and runtime resume, can achieve this with the help of the
- UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
- last argument to NULL).
-
-@@ -721,7 +721,7 @@ Some "devices" are only logical sub-devices of their parent and cannot be
- power-managed on their own. (The prototype example is a USB interface. Entire
- USB devices can go into low-power mode or send wake-up requests, but neither is
- possible for individual interfaces.) The drivers for these devices have no
--need of run-time PM callbacks; if the callbacks did exist, ->runtime_suspend()
-+need of runtime PM callbacks; if the callbacks did exist, ->runtime_suspend()
- and ->runtime_resume() would always return 0 without doing anything else and
- ->runtime_idle() would always call pm_runtime_suspend().
-
-@@ -729,7 +729,7 @@ Subsystems can tell the PM core about these devices by calling
- pm_runtime_no_callbacks(). This should be done after the device structure is
- initialized and before it is registered (although after device registration is
- also okay). The routine will set the device's power.no_callbacks flag and
--prevent the non-debugging run-time PM sysfs attributes from being created.
-+prevent the non-debugging runtime PM sysfs attributes from being created.
-
- When power.no_callbacks is set, the PM core will not invoke the
- ->runtime_idle(), ->runtime_suspend(), or ->runtime_resume() callbacks.
-@@ -737,7 +737,7 @@ Instead it will assume that suspends and resumes always succeed and that idle
- devices should be suspended.
-
- As a consequence, the PM core will never directly inform the device's subsystem
--or driver about run-time power changes. Instead, the driver for the device's
-+or driver about runtime power changes. Instead, the driver for the device's
- parent must take responsibility for telling the device's driver when the
- parent's power state changes.
-
-@@ -748,13 +748,13 @@ A device should be put in a low-power state only when there's some reason to
- think it will remain in that state for a substantial time. A common heuristic
- says that a device which hasn't been used for a while is liable to remain
- unused; following this advice, drivers should not allow devices to be suspended
--at run-time until they have been inactive for some minimum period. Even when
-+at runtime until they have been inactive for some minimum period. Even when
- the heuristic ends up being non-optimal, it will still prevent devices from
- "bouncing" too rapidly between low-power and full-power states.
-
- The term "autosuspend" is an historical remnant. It doesn't mean that the
- device is automatically suspended (the subsystem or driver still has to call
--the appropriate PM routines); rather it means that run-time suspends will
-+the appropriate PM routines); rather it means that runtime suspends will
- automatically be delayed until the desired period of inactivity has elapsed.
-
- Inactivity is determined based on the power.last_busy field. Drivers should
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index ee99025..be7b982 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -1,5 +1,5 @@
- /*
-- * drivers/base/power/runtime.c - Helper functions for device run-time PM
-+ * drivers/base/power/runtime.c - Helper functions for device runtime PM
- *
- * Copyright (c) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
- * Copyright (C) 2010 Alan Stern <stern@rowland.harvard.edu>
-@@ -159,7 +159,7 @@ static int rpm_check_suspend_allowed(struct device *dev)
- * @dev: Device to notify the bus type about.
- * @rpmflags: Flag bits.
- *
-- * Check if the device's run-time PM status allows it to be suspended. If
-+ * Check if the device's runtime PM status allows it to be suspended. If
- * another idle notification has been started earlier, return immediately. If
- * the RPM_ASYNC flag is set then queue an idle-notification request; otherwise
- * run the ->runtime_idle() callback directly.
-@@ -267,11 +267,11 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- }
-
- /**
-- * rpm_suspend - Carry out run-time suspend of given device.
-+ * rpm_suspend - Carry out runtime suspend of given device.
- * @dev: Device to suspend.
- * @rpmflags: Flag bits.
- *
-- * Check if the device's run-time PM status allows it to be suspended. If
-+ * Check if the device's runtime PM status allows it to be suspended. If
- * another suspend has been started earlier, either return immediately or wait
- * for it to finish, depending on the RPM_NOWAIT and RPM_ASYNC flags. Cancel a
- * pending idle notification. If the RPM_ASYNC flag is set then queue a
-@@ -430,11 +430,11 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- }
-
- /**
-- * rpm_resume - Carry out run-time resume of given device.
-+ * rpm_resume - Carry out runtime resume of given device.
- * @dev: Device to resume.
- * @rpmflags: Flag bits.
- *
-- * Check if the device's run-time PM status allows it to be resumed. Cancel
-+ * Check if the device's runtime PM status allows it to be resumed. Cancel
- * any scheduled or pending requests. If another resume has been started
- * earlier, either return immediately or wait for it to finish, depending on the
- * RPM_NOWAIT and RPM_ASYNC flags. Similarly, if there's a suspend running in
-@@ -551,7 +551,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
-
- spin_lock(&parent->power.lock);
- /*
-- * We can resume if the parent's run-time PM is disabled or it
-+ * We can resume if the parent's runtime PM is disabled or it
- * is set to ignore children.
- */
- if (!parent->power.disable_depth
-@@ -615,11 +615,11 @@ static int rpm_resume(struct device *dev, int rpmflags)
- }
-
- /**
-- * pm_runtime_work - Universal run-time PM work function.
-+ * pm_runtime_work - Universal runtime PM work function.
- * @work: Work structure used for scheduling the execution of this function.
- *
- * Use @work to get the device object the work is to be done for, determine what
-- * is to be done and execute the appropriate run-time PM function.
-+ * is to be done and execute the appropriate runtime PM function.
- */
- static void pm_runtime_work(struct work_struct *work)
- {
-@@ -718,7 +718,7 @@ int pm_schedule_suspend(struct device *dev, unsigned int delay)
- EXPORT_SYMBOL_GPL(pm_schedule_suspend);
-
- /**
-- * __pm_runtime_idle - Entry point for run-time idle operations.
-+ * __pm_runtime_idle - Entry point for runtime idle operations.
- * @dev: Device to send idle notification for.
- * @rpmflags: Flag bits.
- *
-@@ -747,7 +747,7 @@ int __pm_runtime_idle(struct device *dev, int rpmflags)
- EXPORT_SYMBOL_GPL(__pm_runtime_idle);
-
- /**
-- * __pm_runtime_suspend - Entry point for run-time put/suspend operations.
-+ * __pm_runtime_suspend - Entry point for runtime put/suspend operations.
- * @dev: Device to suspend.
- * @rpmflags: Flag bits.
- *
-@@ -776,7 +776,7 @@ int __pm_runtime_suspend(struct device *dev, int rpmflags)
- EXPORT_SYMBOL_GPL(__pm_runtime_suspend);
-
- /**
-- * __pm_runtime_resume - Entry point for run-time resume operations.
-+ * __pm_runtime_resume - Entry point for runtime resume operations.
- * @dev: Device to resume.
- * @rpmflags: Flag bits.
- *
-@@ -802,11 +802,11 @@ int __pm_runtime_resume(struct device *dev, int rpmflags)
- EXPORT_SYMBOL_GPL(__pm_runtime_resume);
-
- /**
-- * __pm_runtime_set_status - Set run-time PM status of a device.
-+ * __pm_runtime_set_status - Set runtime PM status of a device.
- * @dev: Device to handle.
-- * @status: New run-time PM status of the device.
-+ * @status: New runtime PM status of the device.
- *
-- * If run-time PM of the device is disabled or its power.runtime_error field is
-+ * If runtime PM of the device is disabled or its power.runtime_error field is
- * different from zero, the status may be changed either to RPM_ACTIVE, or to
- * RPM_SUSPENDED, as long as that reflects the actual state of the device.
- * However, if the device has a parent and the parent is not active, and the
-@@ -852,7 +852,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
-
- /*
- * It is invalid to put an active child under a parent that is
-- * not active, has run-time PM enabled and the
-+ * not active, has runtime PM enabled and the
- * 'power.ignore_children' flag unset.
- */
- if (!parent->power.disable_depth
-@@ -886,7 +886,7 @@ EXPORT_SYMBOL_GPL(__pm_runtime_set_status);
- * @dev: Device to handle.
- *
- * Flush all pending requests for the device from pm_wq and wait for all
-- * run-time PM operations involving the device in progress to complete.
-+ * runtime PM operations involving the device in progress to complete.
- *
- * Should be called under dev->power.lock with interrupts disabled.
- */
-@@ -934,7 +934,7 @@ static void __pm_runtime_barrier(struct device *dev)
- * Prevent the device from being suspended by incrementing its usage counter and
- * if there's a pending resume request for the device, wake the device up.
- * Next, make sure that all pending requests for the device have been flushed
-- * from pm_wq and wait for all run-time PM operations involving the device in
-+ * from pm_wq and wait for all runtime PM operations involving the device in
- * progress to complete.
- *
- * Return value:
-@@ -964,18 +964,18 @@ int pm_runtime_barrier(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_runtime_barrier);
-
- /**
-- * __pm_runtime_disable - Disable run-time PM of a device.
-+ * __pm_runtime_disable - Disable runtime PM of a device.
- * @dev: Device to handle.
- * @check_resume: If set, check if there's a resume request for the device.
- *
- * Increment power.disable_depth for the device and if was zero previously,
-- * cancel all pending run-time PM requests for the device and wait for all
-+ * cancel all pending runtime PM requests for the device and wait for all
- * operations in progress to complete. The device can be either active or
-- * suspended after its run-time PM has been disabled.
-+ * suspended after its runtime PM has been disabled.
- *
- * If @check_resume is set and there's a resume request pending when
- * __pm_runtime_disable() is called and power.disable_depth is zero, the
-- * function will wake up the device before disabling its run-time PM.
-+ * function will wake up the device before disabling its runtime PM.
- */
- void __pm_runtime_disable(struct device *dev, bool check_resume)
- {
-@@ -988,7 +988,7 @@ void __pm_runtime_disable(struct device *dev, bool check_resume)
-
- /*
- * Wake up the device if there's a resume request pending, because that
-- * means there probably is some I/O to process and disabling run-time PM
-+ * means there probably is some I/O to process and disabling runtime PM
- * shouldn't prevent the device from processing the I/O.
- */
- if (check_resume && dev->power.request_pending
-@@ -1013,7 +1013,7 @@ void __pm_runtime_disable(struct device *dev, bool check_resume)
- EXPORT_SYMBOL_GPL(__pm_runtime_disable);
-
- /**
-- * pm_runtime_enable - Enable run-time PM of a device.
-+ * pm_runtime_enable - Enable runtime PM of a device.
- * @dev: Device to handle.
- */
- void pm_runtime_enable(struct device *dev)
-@@ -1032,7 +1032,7 @@ void pm_runtime_enable(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_runtime_enable);
-
- /**
-- * pm_runtime_forbid - Block run-time PM of a device.
-+ * pm_runtime_forbid - Block runtime PM of a device.
- * @dev: Device to handle.
- *
- * Increase the device's usage count and clear its power.runtime_auto flag,
-@@ -1055,7 +1055,7 @@ void pm_runtime_forbid(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_runtime_forbid);
-
- /**
-- * pm_runtime_allow - Unblock run-time PM of a device.
-+ * pm_runtime_allow - Unblock runtime PM of a device.
- * @dev: Device to handle.
- *
- * Decrease the device's usage count and set its power.runtime_auto flag.
-@@ -1076,12 +1076,12 @@ void pm_runtime_allow(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_runtime_allow);
-
- /**
-- * pm_runtime_no_callbacks - Ignore run-time PM callbacks for a device.
-+ * pm_runtime_no_callbacks - Ignore runtime PM callbacks for a device.
- * @dev: Device to handle.
- *
- * Set the power.no_callbacks flag, which tells the PM core that this
-- * device is power-managed through its parent and has no run-time PM
-- * callbacks of its own. The run-time sysfs attributes will be removed.
-+ * device is power-managed through its parent and has no runtime PM
-+ * callbacks of its own. The runtime sysfs attributes will be removed.
- */
- void pm_runtime_no_callbacks(struct device *dev)
- {
-@@ -1157,8 +1157,8 @@ static void update_autosuspend(struct device *dev, int old_delay, int old_use)
- * @delay: Value of the new delay in milliseconds.
- *
- * Set the device's power.autosuspend_delay value. If it changes to negative
-- * and the power.use_autosuspend flag is set, prevent run-time suspends. If it
-- * changes the other way, allow run-time suspends.
-+ * and the power.use_autosuspend flag is set, prevent runtime suspends. If it
-+ * changes the other way, allow runtime suspends.
- */
- void pm_runtime_set_autosuspend_delay(struct device *dev, int delay)
- {
-@@ -1178,7 +1178,7 @@ EXPORT_SYMBOL_GPL(pm_runtime_set_autosuspend_delay);
- * @dev: Device to handle.
- * @use: New value for use_autosuspend.
- *
-- * Set the device's power.use_autosuspend flag, and allow or prevent run-time
-+ * Set the device's power.use_autosuspend flag, and allow or prevent runtime
- * suspends as needed.
- */
- void __pm_runtime_use_autosuspend(struct device *dev, bool use)
-@@ -1195,7 +1195,7 @@ void __pm_runtime_use_autosuspend(struct device *dev, bool use)
- EXPORT_SYMBOL_GPL(__pm_runtime_use_autosuspend);
-
- /**
-- * pm_runtime_init - Initialize run-time PM fields in given device object.
-+ * pm_runtime_init - Initialize runtime PM fields in given device object.
- * @dev: Device object to initialize.
- */
- void pm_runtime_init(struct device *dev)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0016-PM-Runtime-Prevent-runtime_resume-from-racing-with-p.patch b/patches.runtime_pm/0016-PM-Runtime-Prevent-runtime_resume-from-racing-with-p.patch
deleted file mode 100644
index b70b4e5ae5e025..00000000000000
--- a/patches.runtime_pm/0016-PM-Runtime-Prevent-runtime_resume-from-racing-with-p.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 296795de8932876abe22dfe91d6689257a1a9731 Mon Sep 17 00:00:00 2001
-From: Alan Stern <stern@rowland.harvard.edu>
-Date: Wed, 6 Jul 2011 10:52:23 +0200
-Subject: PM / Runtime: Prevent runtime_resume from racing with probe
-
-This patch (as1475) adds device_lock() and device_unlock() calls to
-the store methods for the power/control and power/autosuspend_delay_ms
-sysfs attribute files. We don't want badly timed writes to these
-files to cause runtime_resume callbacks to occur while a driver is
-being probed for a device.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 69c843b45eb3b8f267019e6a05860c9c48337419)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/sysfs.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
-index a9f5b89..942d6a7 100644
---- a/drivers/base/power/sysfs.c
-+++ b/drivers/base/power/sysfs.c
-@@ -116,12 +116,14 @@ static ssize_t control_store(struct device * dev, struct device_attribute *attr,
- cp = memchr(buf, '\n', n);
- if (cp)
- len = cp - buf;
-+ device_lock(dev);
- if (len == sizeof ctrl_auto - 1 && strncmp(buf, ctrl_auto, len) == 0)
- pm_runtime_allow(dev);
- else if (len == sizeof ctrl_on - 1 && strncmp(buf, ctrl_on, len) == 0)
- pm_runtime_forbid(dev);
- else
-- return -EINVAL;
-+ n = -EINVAL;
-+ device_unlock(dev);
- return n;
- }
-
-@@ -205,7 +207,9 @@ static ssize_t autosuspend_delay_ms_store(struct device *dev,
- if (strict_strtol(buf, 10, &delay) != 0 || delay != (int) delay)
- return -EINVAL;
-
-+ device_lock(dev);
- pm_runtime_set_autosuspend_delay(dev, delay);
-+ device_unlock(dev);
- return n;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0017-PM-Runtime-Consistent-utilization-of-deferred_resume.patch b/patches.runtime_pm/0017-PM-Runtime-Consistent-utilization-of-deferred_resume.patch
deleted file mode 100644
index 25c8b14314b8b0..00000000000000
--- a/patches.runtime_pm/0017-PM-Runtime-Consistent-utilization-of-deferred_resume.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f7c12d8518c821f17f791e623ba45c9076cba674 Mon Sep 17 00:00:00 2001
-From: ShuoX Liu <shuox.liu@intel.com>
-Date: Fri, 8 Jul 2011 20:53:55 +0200
-Subject: PM / Runtime: Consistent utilization of deferred_resume
-
-dev->power.deferred_resume is used as a bool typically, so change
-one assignment to false from 0, like other places.
-
-Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
-(cherry picked from commit 2cffff1281a74714c9e035322077ec52ffb1f838)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index be7b982..8dc247c 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -389,7 +389,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- retval = rpm_callback(callback, dev);
- if (retval) {
- __update_runtime_status(dev, RPM_ACTIVE);
-- dev->power.deferred_resume = 0;
-+ dev->power.deferred_resume = false;
- if (retval == -EAGAIN || retval == -EBUSY)
- dev->power.runtime_error = 0;
- else
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0018-PM-Domains-Export-pm_genpd_poweron-in-header.patch b/patches.runtime_pm/0018-PM-Domains-Export-pm_genpd_poweron-in-header.patch
deleted file mode 100644
index 31d191ca7ce328..00000000000000
--- a/patches.runtime_pm/0018-PM-Domains-Export-pm_genpd_poweron-in-header.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 86d13a8eb669bac82af250084920075bc1238fd4 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Sun, 10 Jul 2011 10:39:14 +0200
-Subject: PM / Domains: Export pm_genpd_poweron() in header
-
-Allow SoC-specific code to call pm_genpd_poweron().
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 18b4f3f5d058b590e7189027eeb5d897742ade0a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 2 +-
- include/linux/pm_domain.h | 5 +++++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 1aed94c..1f1a7d8 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -37,7 +37,7 @@ static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- * Restore power to @genpd and all of its parents so that it is possible to
- * resume a device belonging to it.
- */
--static int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
- int ret = 0;
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 98491ee..14fb095 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -63,6 +63,7 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *target);
- extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
-+extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
- #else
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
-@@ -86,6 +87,10 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- }
- static inline void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off) {}
-+static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+{
-+ return -ENOSYS;
-+}
- #endif
-
- #endif /* _LINUX_PM_DOMAIN_H */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0019-doc-Konfig-Documentation-power-pm-apm-acpi-.txt.patch b/patches.runtime_pm/0019-doc-Konfig-Documentation-power-pm-apm-acpi-.txt.patch
deleted file mode 100644
index 3c5a4078d07dbd..00000000000000
--- a/patches.runtime_pm/0019-doc-Konfig-Documentation-power-pm-apm-acpi-.txt.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 01c53bc76768055e6ef19c0fc0a6e8ab27964d46 Mon Sep 17 00:00:00 2001
-From: Michael Witten <mfwitten@gmail.com>
-Date: Fri, 8 Jul 2011 21:11:16 +0000
-Subject: doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
-
-Signed-off-by: Michael Witten <mfwitten@gmail.com>
-Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-(cherry picked from commit 2dc98fd3206f8106520eced769781a21a20707ca)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/x86/Kconfig | 4 ++--
- kernel/power/Kconfig | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index 37357a5..baae844 100644
---- a/arch/x86/Kconfig
-+++ b/arch/x86/Kconfig
-@@ -1737,8 +1737,8 @@ menuconfig APM
- machines with more than one CPU.
-
- In order to use APM, you will need supporting software. For location
-- and more information, read <file:Documentation/power/pm.txt> and the
-- Battery Powered Linux mini-HOWTO, available from
-+ and more information, read <file:Documentation/power/apm-acpi.txt>
-+ and the Battery Powered Linux mini-HOWTO, available from
- <http://www.tldp.org/docs.html#howto>.
-
- This driver does not spin down disk drives (see the hdparm(8)
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 7b856b3..b1914cb9 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -193,8 +193,8 @@ config APM_EMULATION
- notification of APM "events" (e.g. battery status change).
-
- In order to use APM, you will need supporting software. For location
-- and more information, read <file:Documentation/power/pm.txt> and the
-- Battery Powered Linux mini-HOWTO, available from
-+ and more information, read <file:Documentation/power/apm-acpi.txt>
-+ and the Battery Powered Linux mini-HOWTO, available from
- <http://www.tldp.org/docs.html#howto>.
-
- This driver does not spin down disk drives (see the hdparm(8)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0020-PM-Domains-Set-device-state-to-active-during-system-.patch b/patches.runtime_pm/0020-PM-Domains-Set-device-state-to-active-during-system-.patch
deleted file mode 100644
index a8ee15c8d09851..00000000000000
--- a/patches.runtime_pm/0020-PM-Domains-Set-device-state-to-active-during-system-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 40a34966bff83f0ba043ea289407ca00e2e935a6 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:10 +0200
-Subject: PM / Domains: Set device state to "active" during system resume
-
-The runtime PM status of devices in a power domain that is not
-powered off in pm_genpd_complete() should be set to "active", because
-those devices are operational at this point. Some of them may not be
-in use, though, so make pm_genpd_complete() call pm_runtime_idle()
-in addition to pm_runtime_set_active() for each of them.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6f00ff78278fd5d6ac110b6903ee042af2d6af91)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 1f1a7d8..0e7e91b 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -786,7 +786,9 @@ static void pm_genpd_complete(struct device *dev)
-
- if (run_complete) {
- pm_generic_complete(dev);
-+ pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-+ pm_runtime_idle(dev);
- }
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0021-PM-Domains-Make-failing-pm_genpd_prepare-clean-up-pr.patch b/patches.runtime_pm/0021-PM-Domains-Make-failing-pm_genpd_prepare-clean-up-pr.patch
deleted file mode 100644
index f83b600092da84..00000000000000
--- a/patches.runtime_pm/0021-PM-Domains-Make-failing-pm_genpd_prepare-clean-up-pr.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 4b6c811b11eed8ee20d2593a074b1fa689de2650 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:21 +0200
-Subject: PM / Domains: Make failing pm_genpd_prepare() clean up properly
-
-If pm_generic_prepare() in pm_genpd_prepare() returns error code,
-the PM domains counter of "prepared" devices should be decremented
-and its suspend_power_off flag should be reset if this counter drops
-down to zero. Otherwise, the PM domain runtime PM code will not
-handle the domain correctly (it will permanently think that system
-suspend is in progress).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit b6c10c84665912985d0bf9b6ae8ce19fc4298d9f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 0e7e91b..9a20d93 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -367,6 +367,7 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- static int pm_genpd_prepare(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-+ int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -400,7 +401,16 @@ static int pm_genpd_prepare(struct device *dev)
-
- mutex_unlock(&genpd->lock);
-
-- return pm_generic_prepare(dev);
-+ ret = pm_generic_prepare(dev);
-+ if (ret) {
-+ mutex_lock(&genpd->lock);
-+
-+ if (--genpd->prepared_count == 0)
-+ genpd->suspend_power_off = false;
-+
-+ mutex_unlock(&genpd->lock);
-+ }
-+ return ret;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0022-PM-Domains-Do-not-execute-device-callbacks-under-loc.patch b/patches.runtime_pm/0022-PM-Domains-Do-not-execute-device-callbacks-under-loc.patch
deleted file mode 100644
index df43969dc2a9a6..00000000000000
--- a/patches.runtime_pm/0022-PM-Domains-Do-not-execute-device-callbacks-under-loc.patch
+++ /dev/null
@@ -1,604 +0,0 @@
-From 3584f0d5ebf424566f61039e5d023ba0a9c00b24 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:29 +0200
-Subject: PM / Domains: Do not execute device callbacks under locks
-
-Currently, the .start_device() and .stop_device() callbacks from
-struct generic_pm_domain() as well as the device drivers' runtime PM
-callbacks used by the generic PM domains code are executed under
-the generic PM domain lock. This, unfortunately, is prone to
-deadlocks, for example if a device and its parent are boths members
-of the same PM domain. For this reason, it would be better if the
-PM domains code didn't execute device callbacks under the lock.
-
-Rework the locking in the generic PM domains code so that the lock
-is dropped for the execution of device callbacks. To this end,
-introduce PM domains states reflecting the current status of a PM
-domain and such that the PM domain lock cannot be acquired if the
-status is GPD_STATE_BUSY. Make threads attempting to acquire a PM
-domain's lock wait until the status changes to either
-GPD_STATE_ACTIVE or GPD_STATE_POWER_OFF.
-
-This change by itself doesn't fix the deadlock problem mentioned
-above, but the mechanism introduced by it will be used for for this
-purpose by a subsequent patch.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 17b75eca7683d4942f4d8d00563fd15f37c39589)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 249 +++++++++++++++++++++++++++++++------------
- include/linux/pm_domain.h | 10 +-
- 2 files changed, 185 insertions(+), 74 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 9a20d93..d06f3bb 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -13,6 +13,8 @@
- #include <linux/pm_domain.h>
- #include <linux/slab.h>
- #include <linux/err.h>
-+#include <linux/sched.h>
-+#include <linux/suspend.h>
-
- #ifdef CONFIG_PM
-
-@@ -30,6 +32,34 @@ static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- genpd->sd_count--;
- }
-
-+static void genpd_acquire_lock(struct generic_pm_domain *genpd)
-+{
-+ DEFINE_WAIT(wait);
-+
-+ mutex_lock(&genpd->lock);
-+ /*
-+ * Wait for the domain to transition into either the active,
-+ * or the power off state.
-+ */
-+ for (;;) {
-+ prepare_to_wait(&genpd->status_wait_queue, &wait,
-+ TASK_UNINTERRUPTIBLE);
-+ if (genpd->status != GPD_STATE_BUSY)
-+ break;
-+ mutex_unlock(&genpd->lock);
-+
-+ schedule();
-+
-+ mutex_lock(&genpd->lock);
-+ }
-+ finish_wait(&genpd->status_wait_queue, &wait);
-+}
-+
-+static void genpd_release_lock(struct generic_pm_domain *genpd)
-+{
-+ mutex_unlock(&genpd->lock);
-+}
-+
- /**
- * pm_genpd_poweron - Restore power to a given PM domain and its parents.
- * @genpd: PM domain to power up.
-@@ -39,22 +69,50 @@ static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- */
- int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
-+ struct generic_pm_domain *parent = genpd->parent;
-+ DEFINE_WAIT(wait);
- int ret = 0;
-
- start:
-- if (genpd->parent)
-- mutex_lock(&genpd->parent->lock);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ if (parent) {
-+ mutex_lock(&parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ } else {
-+ mutex_lock(&genpd->lock);
-+ }
-+ /*
-+ * Wait for the domain to transition into either the active,
-+ * or the power off state.
-+ */
-+ for (;;) {
-+ prepare_to_wait(&genpd->status_wait_queue, &wait,
-+ TASK_UNINTERRUPTIBLE);
-+ if (genpd->status != GPD_STATE_BUSY)
-+ break;
-+ mutex_unlock(&genpd->lock);
-+ if (parent)
-+ mutex_unlock(&parent->lock);
-+
-+ schedule();
-
-- if (!genpd->power_is_off
-+ if (parent) {
-+ mutex_lock(&parent->lock);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ } else {
-+ mutex_lock(&genpd->lock);
-+ }
-+ }
-+ finish_wait(&genpd->status_wait_queue, &wait);
-+
-+ if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
- goto out;
-
-- if (genpd->parent && genpd->parent->power_is_off) {
-+ if (parent && parent->status != GPD_STATE_ACTIVE) {
- mutex_unlock(&genpd->lock);
-- mutex_unlock(&genpd->parent->lock);
-+ mutex_unlock(&parent->lock);
-
-- ret = pm_genpd_poweron(genpd->parent);
-+ ret = pm_genpd_poweron(parent);
- if (ret)
- return ret;
-
-@@ -67,14 +125,14 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- goto out;
- }
-
-- genpd->power_is_off = false;
-- if (genpd->parent)
-- genpd->parent->sd_count++;
-+ genpd->status = GPD_STATE_ACTIVE;
-+ if (parent)
-+ parent->sd_count++;
-
- out:
- mutex_unlock(&genpd->lock);
-- if (genpd->parent)
-- mutex_unlock(&genpd->parent->lock);
-+ if (parent)
-+ mutex_unlock(&parent->lock);
-
- return ret;
- }
-@@ -90,6 +148,7 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- */
- static int __pm_genpd_save_device(struct dev_list_entry *dle,
- struct generic_pm_domain *genpd)
-+ __releases(&genpd->lock) __acquires(&genpd->lock)
- {
- struct device *dev = dle->dev;
- struct device_driver *drv = dev->driver;
-@@ -98,6 +157,8 @@ static int __pm_genpd_save_device(struct dev_list_entry *dle,
- if (dle->need_restore)
- return 0;
-
-+ mutex_unlock(&genpd->lock);
-+
- if (drv && drv->pm && drv->pm->runtime_suspend) {
- if (genpd->start_device)
- genpd->start_device(dev);
-@@ -108,6 +169,8 @@ static int __pm_genpd_save_device(struct dev_list_entry *dle,
- genpd->stop_device(dev);
- }
-
-+ mutex_lock(&genpd->lock);
-+
- if (!ret)
- dle->need_restore = true;
-
-@@ -121,6 +184,7 @@ static int __pm_genpd_save_device(struct dev_list_entry *dle,
- */
- static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- struct generic_pm_domain *genpd)
-+ __releases(&genpd->lock) __acquires(&genpd->lock)
- {
- struct device *dev = dle->dev;
- struct device_driver *drv = dev->driver;
-@@ -128,6 +192,8 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- if (!dle->need_restore)
- return;
-
-+ mutex_unlock(&genpd->lock);
-+
- if (drv && drv->pm && drv->pm->runtime_resume) {
- if (genpd->start_device)
- genpd->start_device(dev);
-@@ -138,6 +204,8 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- genpd->stop_device(dev);
- }
-
-+ mutex_lock(&genpd->lock);
-+
- dle->need_restore = false;
- }
-
-@@ -150,13 +218,14 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- * the @genpd's devices' drivers and remove power from @genpd.
- */
- static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
-+ __releases(&genpd->lock) __acquires(&genpd->lock)
- {
- struct generic_pm_domain *parent;
- struct dev_list_entry *dle;
- unsigned int not_suspended;
- int ret;
-
-- if (genpd->power_is_off || genpd->prepared_count > 0)
-+ if (genpd->status == GPD_STATE_POWER_OFF || genpd->prepared_count > 0)
- return 0;
-
- if (genpd->sd_count > 0)
-@@ -175,22 +244,36 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- return -EAGAIN;
- }
-
-+ genpd->status = GPD_STATE_BUSY;
-+
- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
- ret = __pm_genpd_save_device(dle, genpd);
- if (ret)
- goto err_dev;
- }
-
-+ mutex_unlock(&genpd->lock);
-+
-+ parent = genpd->parent;
-+ if (parent) {
-+ genpd_acquire_lock(parent);
-+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ } else {
-+ mutex_lock(&genpd->lock);
-+ }
-+
- if (genpd->power_off)
- genpd->power_off(genpd);
-
-- genpd->power_is_off = true;
-+ genpd->status = GPD_STATE_POWER_OFF;
-+ wake_up_all(&genpd->status_wait_queue);
-
-- parent = genpd->parent;
- if (parent) {
- genpd_sd_counter_dec(parent);
- if (parent->sd_count == 0)
- queue_work(pm_wq, &parent->power_off_work);
-+
-+ genpd_release_lock(parent);
- }
-
- return 0;
-@@ -199,6 +282,9 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- list_for_each_entry_continue(dle, &genpd->dev_list, node)
- __pm_genpd_restore_device(dle, genpd);
-
-+ genpd->status = GPD_STATE_ACTIVE;
-+ wake_up_all(&genpd->status_wait_queue);
-+
- return ret;
- }
-
-@@ -212,13 +298,9 @@ static void genpd_power_off_work_fn(struct work_struct *work)
-
- genpd = container_of(work, struct generic_pm_domain, power_off_work);
-
-- if (genpd->parent)
-- mutex_lock(&genpd->parent->lock);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-+ genpd_acquire_lock(genpd);
- pm_genpd_poweroff(genpd);
-- mutex_unlock(&genpd->lock);
-- if (genpd->parent)
-- mutex_unlock(&genpd->parent->lock);
-+ genpd_release_lock(genpd);
- }
-
- /**
-@@ -239,23 +321,17 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->parent)
-- mutex_lock(&genpd->parent->lock);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
--
- if (genpd->stop_device) {
- int ret = genpd->stop_device(dev);
- if (ret)
-- goto out;
-+ return ret;
- }
-+
-+ genpd_acquire_lock(genpd);
- genpd->in_progress++;
- pm_genpd_poweroff(genpd);
- genpd->in_progress--;
--
-- out:
-- mutex_unlock(&genpd->lock);
-- if (genpd->parent)
-- mutex_unlock(&genpd->parent->lock);
-+ genpd_release_lock(genpd);
-
- return 0;
- }
-@@ -276,9 +352,6 @@ static void __pm_genpd_runtime_resume(struct device *dev,
- break;
- }
- }
--
-- if (genpd->start_device)
-- genpd->start_device(dev);
- }
-
- /**
-@@ -304,9 +377,15 @@ static int pm_genpd_runtime_resume(struct device *dev)
- if (ret)
- return ret;
-
-- mutex_lock(&genpd->lock);
-+ genpd_acquire_lock(genpd);
-+ genpd->status = GPD_STATE_BUSY;
- __pm_genpd_runtime_resume(dev, genpd);
-- mutex_unlock(&genpd->lock);
-+ genpd->status = GPD_STATE_ACTIVE;
-+ wake_up_all(&genpd->status_wait_queue);
-+ genpd_release_lock(genpd);
-+
-+ if (genpd->start_device)
-+ genpd->start_device(dev);
-
- return 0;
- }
-@@ -339,7 +418,7 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- {
- struct generic_pm_domain *parent = genpd->parent;
-
-- if (genpd->power_is_off)
-+ if (genpd->status == GPD_STATE_POWER_OFF)
- return;
-
- if (genpd->suspended_count != genpd->device_count || genpd->sd_count > 0)
-@@ -348,7 +427,7 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- if (genpd->power_off)
- genpd->power_off(genpd);
-
-- genpd->power_is_off = true;
-+ genpd->status = GPD_STATE_POWER_OFF;
- if (parent) {
- genpd_sd_counter_dec(parent);
- pm_genpd_sync_poweroff(parent);
-@@ -375,32 +454,41 @@ static int pm_genpd_prepare(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- mutex_lock(&genpd->lock);
-+ /*
-+ * If a wakeup request is pending for the device, it should be woken up
-+ * at this point and a system wakeup event should be reported if it's
-+ * set up to wake up the system from sleep states.
-+ */
-+ pm_runtime_get_noresume(dev);
-+ if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
-+ pm_wakeup_event(dev, 0);
-+
-+ if (pm_wakeup_pending()) {
-+ pm_runtime_put_sync(dev);
-+ return -EBUSY;
-+ }
-+
-+ genpd_acquire_lock(genpd);
-
- if (genpd->prepared_count++ == 0)
-- genpd->suspend_power_off = genpd->power_is_off;
-+ genpd->suspend_power_off = genpd->status == GPD_STATE_POWER_OFF;
-+
-+ genpd_release_lock(genpd);
-
- if (genpd->suspend_power_off) {
-- mutex_unlock(&genpd->lock);
-+ pm_runtime_put_noidle(dev);
- return 0;
- }
-
- /*
-- * If the device is in the (runtime) "suspended" state, call
-- * .start_device() for it, if defined.
-- */
-- if (pm_runtime_suspended(dev))
-- __pm_genpd_runtime_resume(dev, genpd);
--
-- /*
-- * Do not check if runtime resume is pending at this point, because it
-- * has been taken care of already and if pm_genpd_poweron() ran at this
-- * point as a result of the check, it would deadlock.
-+ * The PM domain must be in the GPD_STATE_ACTIVE state at this point,
-+ * so pm_genpd_poweron() will return immediately, but if the device
-+ * is suspended (e.g. it's been stopped by .stop_device()), we need
-+ * to make it operational.
- */
-+ pm_runtime_resume(dev);
- __pm_runtime_disable(dev, false);
-
-- mutex_unlock(&genpd->lock);
--
- ret = pm_generic_prepare(dev);
- if (ret) {
- mutex_lock(&genpd->lock);
-@@ -409,7 +497,10 @@ static int pm_genpd_prepare(struct device *dev)
- genpd->suspend_power_off = false;
-
- mutex_unlock(&genpd->lock);
-+ pm_runtime_enable(dev);
- }
-+
-+ pm_runtime_put_sync(dev);
- return ret;
- }
-
-@@ -726,7 +817,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
- * guaranteed that this function will never run twice in parallel for
- * the same PM domain, so it is not necessary to use locking here.
- */
-- genpd->power_is_off = true;
-+ genpd->status = GPD_STATE_POWER_OFF;
- if (genpd->suspend_power_off) {
- /*
- * The boot kernel might put the domain into the power on state,
-@@ -836,9 +927,9 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(dev))
- return -EINVAL;
-
-- mutex_lock(&genpd->lock);
-+ genpd_acquire_lock(genpd);
-
-- if (genpd->power_is_off) {
-+ if (genpd->status == GPD_STATE_POWER_OFF) {
- ret = -EINVAL;
- goto out;
- }
-@@ -870,7 +961,7 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- spin_unlock_irq(&dev->power.lock);
-
- out:
-- mutex_unlock(&genpd->lock);
-+ genpd_release_lock(genpd);
-
- return ret;
- }
-@@ -891,7 +982,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(dev))
- return -EINVAL;
-
-- mutex_lock(&genpd->lock);
-+ genpd_acquire_lock(genpd);
-
- if (genpd->prepared_count > 0) {
- ret = -EAGAIN;
-@@ -915,7 +1006,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- }
-
- out:
-- mutex_unlock(&genpd->lock);
-+ genpd_release_lock(genpd);
-
- return ret;
- }
-@@ -934,9 +1025,19 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(new_subdomain))
- return -EINVAL;
-
-- mutex_lock(&genpd->lock);
-+ start:
-+ genpd_acquire_lock(genpd);
-+ mutex_lock_nested(&new_subdomain->lock, SINGLE_DEPTH_NESTING);
-
-- if (genpd->power_is_off && !new_subdomain->power_is_off) {
-+ if (new_subdomain->status != GPD_STATE_POWER_OFF
-+ && new_subdomain->status != GPD_STATE_ACTIVE) {
-+ mutex_unlock(&new_subdomain->lock);
-+ genpd_release_lock(genpd);
-+ goto start;
-+ }
-+
-+ if (genpd->status == GPD_STATE_POWER_OFF
-+ && new_subdomain->status != GPD_STATE_POWER_OFF) {
- ret = -EINVAL;
- goto out;
- }
-@@ -948,17 +1049,14 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- }
- }
-
-- mutex_lock_nested(&new_subdomain->lock, SINGLE_DEPTH_NESTING);
--
- list_add_tail(&new_subdomain->sd_node, &genpd->sd_list);
- new_subdomain->parent = genpd;
-- if (!subdomain->power_is_off)
-+ if (subdomain->status != GPD_STATE_POWER_OFF)
- genpd->sd_count++;
-
-- mutex_unlock(&new_subdomain->lock);
--
- out:
-- mutex_unlock(&genpd->lock);
-+ mutex_unlock(&new_subdomain->lock);
-+ genpd_release_lock(genpd);
-
- return ret;
- }
-@@ -977,7 +1075,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(target))
- return -EINVAL;
-
-- mutex_lock(&genpd->lock);
-+ start:
-+ genpd_acquire_lock(genpd);
-
- list_for_each_entry(subdomain, &genpd->sd_list, sd_node) {
- if (subdomain != target)
-@@ -985,9 +1084,16 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-
- mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
-
-+ if (subdomain->status != GPD_STATE_POWER_OFF
-+ && subdomain->status != GPD_STATE_ACTIVE) {
-+ mutex_unlock(&subdomain->lock);
-+ genpd_release_lock(genpd);
-+ goto start;
-+ }
-+
- list_del(&subdomain->sd_node);
- subdomain->parent = NULL;
-- if (!subdomain->power_is_off)
-+ if (subdomain->status != GPD_STATE_POWER_OFF)
- genpd_sd_counter_dec(genpd);
-
- mutex_unlock(&subdomain->lock);
-@@ -996,7 +1102,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- break;
- }
-
-- mutex_unlock(&genpd->lock);
-+ genpd_release_lock(genpd);
-
- return ret;
- }
-@@ -1022,7 +1128,8 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
- genpd->in_progress = 0;
- genpd->sd_count = 0;
-- genpd->power_is_off = is_off;
-+ genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
-+ init_waitqueue_head(&genpd->status_wait_queue);
- genpd->device_count = 0;
- genpd->suspended_count = 0;
- genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 14fb095..c71457c 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -11,8 +11,11 @@
-
- #include <linux/device.h>
-
--#define GPD_IN_SUSPEND 1
--#define GPD_POWER_OFF 2
-+enum gpd_status {
-+ GPD_STATE_ACTIVE = 0, /* PM domain is active */
-+ GPD_STATE_BUSY, /* Something is happening to the PM domain */
-+ GPD_STATE_POWER_OFF, /* PM domain is off */
-+};
-
- struct dev_power_governor {
- bool (*power_down_ok)(struct dev_pm_domain *domain);
-@@ -29,7 +32,8 @@ struct generic_pm_domain {
- struct work_struct power_off_work;
- unsigned int in_progress; /* Number of devices being suspended now */
- unsigned int sd_count; /* Number of subdomains with power "on" */
-- bool power_is_off; /* Whether or not power has been removed */
-+ enum gpd_status status; /* Current state of the domain */
-+ wait_queue_head_t status_wait_queue;
- unsigned int device_count; /* Number of devices */
- unsigned int suspended_count; /* System suspend device counter */
- unsigned int prepared_count; /* Suspend counter of prepared devices */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0023-PM-Domains-Allow-callbacks-to-execute-all-runtime-PM.patch b/patches.runtime_pm/0023-PM-Domains-Allow-callbacks-to-execute-all-runtime-PM.patch
deleted file mode 100644
index 1df7f0ce4f6bbf..00000000000000
--- a/patches.runtime_pm/0023-PM-Domains-Allow-callbacks-to-execute-all-runtime-PM.patch
+++ /dev/null
@@ -1,383 +0,0 @@
-From 99ba4e79b8fde359d9c5fd24a699562cc6debade Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:36 +0200
-Subject: PM / Domains: Allow callbacks to execute all runtime PM helpers
-
-A deadlock may occur if one of the PM domains' .start_device() or
-.stop_device() callbacks or a device driver's .runtime_suspend() or
-.runtime_resume() callback executed by the core generic PM domain
-code uses a "wrong" runtime PM helper function. This happens, for
-example, if .runtime_resume() from one device's driver calls
-pm_runtime_resume() for another device in the same PM domain.
-A similar situation may take place if a device's parent is in the
-same PM domain, in which case the runtime PM framework may execute
-pm_genpd_runtime_resume() automatically for the parent (if it is
-suspended at the moment). This, of course, is undesirable, so
-the generic PM domains code should be modified to prevent it from
-happening.
-
-The runtime PM framework guarantees that pm_genpd_runtime_suspend()
-and pm_genpd_runtime_resume() won't be executed in parallel for
-the same device, so the generic PM domains code need not worry
-about those cases. Still, it needs to prevent the other possible
-race conditions between pm_genpd_runtime_suspend(),
-pm_genpd_runtime_resume(), pm_genpd_poweron() and pm_genpd_poweroff()
-from happening and it needs to avoid deadlocks at the same time.
-To this end, modify the generic PM domains code to relax
-synchronization rules so that:
-
-* pm_genpd_poweron() doesn't wait for the PM domain status to
- change from GPD_STATE_BUSY. If it finds that the status is
- not GPD_STATE_POWER_OFF, it returns without powering the domain on
- (it may modify the status depending on the circumstances).
-
-* pm_genpd_poweroff() returns as soon as it finds that the PM
- domain's status changed from GPD_STATE_BUSY after it's released
- the PM domain's lock.
-
-* pm_genpd_runtime_suspend() doesn't wait for the PM domain status
- to change from GPD_STATE_BUSY after executing the domain's
- .stop_device() callback and executes pm_genpd_poweroff() only
- if pm_genpd_runtime_resume() is not executed in parallel.
-
-* pm_genpd_runtime_resume() doesn't wait for the PM domain status
- to change from GPD_STATE_BUSY after executing pm_genpd_poweron()
- and sets the domain's status to GPD_STATE_BUSY and increments its
- counter of resuming devices (introduced by this change) immediately
- after acquiring the lock. The counter of resuming devices is then
- decremented after executing __pm_genpd_runtime_resume() for the
- device and the domain's status is reset to GPD_STATE_ACTIVE (unless
- there are more resuming devices in the domain, in which case the
- status remains GPD_STATE_BUSY).
-
-This way, for example, if a device driver's .runtime_resume()
-callback executes pm_runtime_resume() for another device in the same
-PM domain, pm_genpd_poweron() called by pm_genpd_runtime_resume()
-invoked by the runtime PM framework will not block and it will see
-that there's nothing to do for it. Next, the PM domain's lock will
-be acquired without waiting for its status to change from
-GPD_STATE_BUSY and the device driver's .runtime_resume() callback
-will be executed. In turn, if pm_runtime_suspend() is executed by
-one device driver's .runtime_resume() callback for another device in
-the same PM domain, pm_genpd_poweroff() executed by
-pm_genpd_runtime_suspend() invoked by the runtime PM framework as a
-result will notice that one of the devices in the domain is being
-resumed, so it will return immediately.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c6d22b37263607ba5aeeb2e11169fa65caa29bee)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 144 +++++++++++++++++++++++++++++--------------
- include/linux/pm_domain.h | 3 +
- 2 files changed, 102 insertions(+), 45 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index d06f3bb..7e6cc8a 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -44,7 +44,8 @@ static void genpd_acquire_lock(struct generic_pm_domain *genpd)
- for (;;) {
- prepare_to_wait(&genpd->status_wait_queue, &wait,
- TASK_UNINTERRUPTIBLE);
-- if (genpd->status != GPD_STATE_BUSY)
-+ if (genpd->status == GPD_STATE_ACTIVE
-+ || genpd->status == GPD_STATE_POWER_OFF)
- break;
- mutex_unlock(&genpd->lock);
-
-@@ -60,6 +61,12 @@ static void genpd_release_lock(struct generic_pm_domain *genpd)
- mutex_unlock(&genpd->lock);
- }
-
-+static void genpd_set_active(struct generic_pm_domain *genpd)
-+{
-+ if (genpd->resume_count == 0)
-+ genpd->status = GPD_STATE_ACTIVE;
-+}
-+
- /**
- * pm_genpd_poweron - Restore power to a given PM domain and its parents.
- * @genpd: PM domain to power up.
-@@ -75,42 +82,24 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
-
- start:
- if (parent) {
-- mutex_lock(&parent->lock);
-+ genpd_acquire_lock(parent);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
- } else {
- mutex_lock(&genpd->lock);
- }
-- /*
-- * Wait for the domain to transition into either the active,
-- * or the power off state.
-- */
-- for (;;) {
-- prepare_to_wait(&genpd->status_wait_queue, &wait,
-- TASK_UNINTERRUPTIBLE);
-- if (genpd->status != GPD_STATE_BUSY)
-- break;
-- mutex_unlock(&genpd->lock);
-- if (parent)
-- mutex_unlock(&parent->lock);
--
-- schedule();
--
-- if (parent) {
-- mutex_lock(&parent->lock);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-- } else {
-- mutex_lock(&genpd->lock);
-- }
-- }
-- finish_wait(&genpd->status_wait_queue, &wait);
-
- if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
- goto out;
-
-+ if (genpd->status != GPD_STATE_POWER_OFF) {
-+ genpd_set_active(genpd);
-+ goto out;
-+ }
-+
- if (parent && parent->status != GPD_STATE_ACTIVE) {
- mutex_unlock(&genpd->lock);
-- mutex_unlock(&parent->lock);
-+ genpd_release_lock(parent);
-
- ret = pm_genpd_poweron(parent);
- if (ret)
-@@ -125,14 +114,14 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- goto out;
- }
-
-- genpd->status = GPD_STATE_ACTIVE;
-+ genpd_set_active(genpd);
- if (parent)
- parent->sd_count++;
-
- out:
- mutex_unlock(&genpd->lock);
- if (parent)
-- mutex_unlock(&parent->lock);
-+ genpd_release_lock(parent);
-
- return ret;
- }
-@@ -210,6 +199,20 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- }
-
- /**
-+ * genpd_abort_poweroff - Check if a PM domain power off should be aborted.
-+ * @genpd: PM domain to check.
-+ *
-+ * Return true if a PM domain's status changed to GPD_STATE_ACTIVE during
-+ * a "power off" operation, which means that a "power on" has occured in the
-+ * meantime, or if its resume_count field is different from zero, which means
-+ * that one of its devices has been resumed in the meantime.
-+ */
-+static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
-+{
-+ return genpd->status == GPD_STATE_ACTIVE || genpd->resume_count > 0;
-+}
-+
-+/**
- * pm_genpd_poweroff - Remove power from a given PM domain.
- * @genpd: PM domain to power down.
- *
-@@ -223,9 +226,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- struct generic_pm_domain *parent;
- struct dev_list_entry *dle;
- unsigned int not_suspended;
-- int ret;
-+ int ret = 0;
-
-- if (genpd->status == GPD_STATE_POWER_OFF || genpd->prepared_count > 0)
-+ start:
-+ /*
-+ * Do not try to power off the domain in the following situations:
-+ * (1) The domain is already in the "power off" state.
-+ * (2) System suspend is in progress.
-+ * (3) One of the domain's devices is being resumed right now.
-+ */
-+ if (genpd->status == GPD_STATE_POWER_OFF || genpd->prepared_count > 0
-+ || genpd->resume_count > 0)
- return 0;
-
- if (genpd->sd_count > 0)
-@@ -239,34 +250,54 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- if (not_suspended > genpd->in_progress)
- return -EBUSY;
-
-+ if (genpd->poweroff_task) {
-+ /*
-+ * Another instance of pm_genpd_poweroff() is executing
-+ * callbacks, so tell it to start over and return.
-+ */
-+ genpd->status = GPD_STATE_REPEAT;
-+ return 0;
-+ }
-+
- if (genpd->gov && genpd->gov->power_down_ok) {
- if (!genpd->gov->power_down_ok(&genpd->domain))
- return -EAGAIN;
- }
-
- genpd->status = GPD_STATE_BUSY;
-+ genpd->poweroff_task = current;
-
- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
- ret = __pm_genpd_save_device(dle, genpd);
- if (ret)
- goto err_dev;
-- }
-
-- mutex_unlock(&genpd->lock);
-+ if (genpd_abort_poweroff(genpd))
-+ goto out;
-+
-+ if (genpd->status == GPD_STATE_REPEAT) {
-+ genpd->poweroff_task = NULL;
-+ goto start;
-+ }
-+ }
-
- parent = genpd->parent;
- if (parent) {
-+ mutex_unlock(&genpd->lock);
-+
- genpd_acquire_lock(parent);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-- } else {
-- mutex_lock(&genpd->lock);
-+
-+ if (genpd_abort_poweroff(genpd)) {
-+ genpd_release_lock(parent);
-+ goto out;
-+ }
- }
-
- if (genpd->power_off)
- genpd->power_off(genpd);
-
- genpd->status = GPD_STATE_POWER_OFF;
-- wake_up_all(&genpd->status_wait_queue);
-
- if (parent) {
- genpd_sd_counter_dec(parent);
-@@ -276,16 +307,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd_release_lock(parent);
- }
-
-- return 0;
-+ out:
-+ genpd->poweroff_task = NULL;
-+ wake_up_all(&genpd->status_wait_queue);
-+ return ret;
-
- err_dev:
- list_for_each_entry_continue(dle, &genpd->dev_list, node)
- __pm_genpd_restore_device(dle, genpd);
-
-- genpd->status = GPD_STATE_ACTIVE;
-- wake_up_all(&genpd->status_wait_queue);
--
-- return ret;
-+ genpd_set_active(genpd);
-+ goto out;
- }
-
- /**
-@@ -327,11 +359,11 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- return ret;
- }
-
-- genpd_acquire_lock(genpd);
-+ mutex_lock(&genpd->lock);
- genpd->in_progress++;
- pm_genpd_poweroff(genpd);
- genpd->in_progress--;
-- genpd_release_lock(genpd);
-+ mutex_unlock(&genpd->lock);
-
- return 0;
- }
-@@ -365,6 +397,7 @@ static void __pm_genpd_runtime_resume(struct device *dev,
- static int pm_genpd_runtime_resume(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-+ DEFINE_WAIT(wait);
- int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-@@ -377,12 +410,31 @@ static int pm_genpd_runtime_resume(struct device *dev)
- if (ret)
- return ret;
-
-- genpd_acquire_lock(genpd);
-+ mutex_lock(&genpd->lock);
- genpd->status = GPD_STATE_BUSY;
-+ genpd->resume_count++;
-+ for (;;) {
-+ prepare_to_wait(&genpd->status_wait_queue, &wait,
-+ TASK_UNINTERRUPTIBLE);
-+ /*
-+ * If current is the powering off task, we have been called
-+ * reentrantly from one of the device callbacks, so we should
-+ * not wait.
-+ */
-+ if (!genpd->poweroff_task || genpd->poweroff_task == current)
-+ break;
-+ mutex_unlock(&genpd->lock);
-+
-+ schedule();
-+
-+ mutex_lock(&genpd->lock);
-+ }
-+ finish_wait(&genpd->status_wait_queue, &wait);
- __pm_genpd_runtime_resume(dev, genpd);
-- genpd->status = GPD_STATE_ACTIVE;
-+ genpd->resume_count--;
-+ genpd_set_active(genpd);
- wake_up_all(&genpd->status_wait_queue);
-- genpd_release_lock(genpd);
-+ mutex_unlock(&genpd->lock);
-
- if (genpd->start_device)
- genpd->start_device(dev);
-@@ -1130,6 +1182,8 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->sd_count = 0;
- genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
- init_waitqueue_head(&genpd->status_wait_queue);
-+ genpd->poweroff_task = NULL;
-+ genpd->resume_count = 0;
- genpd->device_count = 0;
- genpd->suspended_count = 0;
- genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index c71457c..feb80af 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -14,6 +14,7 @@
- enum gpd_status {
- GPD_STATE_ACTIVE = 0, /* PM domain is active */
- GPD_STATE_BUSY, /* Something is happening to the PM domain */
-+ GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
- GPD_STATE_POWER_OFF, /* PM domain is off */
- };
-
-@@ -34,6 +35,8 @@ struct generic_pm_domain {
- unsigned int sd_count; /* Number of subdomains with power "on" */
- enum gpd_status status; /* Current state of the domain */
- wait_queue_head_t status_wait_queue;
-+ struct task_struct *poweroff_task; /* Powering off task */
-+ unsigned int resume_count; /* Number of devices being resumed */
- unsigned int device_count; /* Number of devices */
- unsigned int suspended_count; /* System suspend device counter */
- unsigned int prepared_count; /* Suspend counter of prepared devices */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0024-PM-Domains-Do-not-restore-all-devices-on-power-off-e.patch b/patches.runtime_pm/0024-PM-Domains-Do-not-restore-all-devices-on-power-off-e.patch
deleted file mode 100644
index 41818bad3a4b24..00000000000000
--- a/patches.runtime_pm/0024-PM-Domains-Do-not-restore-all-devices-on-power-off-e.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From f796cffbe45a4c0743426d0b68ae7c47d73779d9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:48 +0200
-Subject: PM / Domains: Do not restore all devices on power off error
-
-Since every device in a PM domain has its own need_restore
-flag, which is set by __pm_genpd_save_device(), there's no need to
-walk the domain's device list and restore all devices on an error
-from one of the drivers' .runtime_suspend() callbacks.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 697a7f3727b53c7d4c927948bbe1f6afc4fabfde)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 13 ++++---------
- 1 file changed, 4 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 7e6cc8a..7b20801 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -269,8 +269,10 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
-
- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
- ret = __pm_genpd_save_device(dle, genpd);
-- if (ret)
-- goto err_dev;
-+ if (ret) {
-+ genpd_set_active(genpd);
-+ goto out;
-+ }
-
- if (genpd_abort_poweroff(genpd))
- goto out;
-@@ -311,13 +313,6 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd->poweroff_task = NULL;
- wake_up_all(&genpd->status_wait_queue);
- return ret;
--
-- err_dev:
-- list_for_each_entry_continue(dle, &genpd->dev_list, node)
-- __pm_genpd_restore_device(dle, genpd);
--
-- genpd_set_active(genpd);
-- goto out;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0025-PM-Domains-Improve-handling-of-wakeup-devices-during.patch b/patches.runtime_pm/0025-PM-Domains-Improve-handling-of-wakeup-devices-during.patch
deleted file mode 100644
index 90ad20e35e8dd5..00000000000000
--- a/patches.runtime_pm/0025-PM-Domains-Improve-handling-of-wakeup-devices-during.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From cac6f0b0d91888b756691c97ac1bb4deca217f24 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:39:57 +0200
-Subject: PM / Domains: Improve handling of wakeup devices during system
- suspend
-
-Kevin points out that if there's a device that can wake up the system
-from sleep states, but it doesn't generate wakeup signals by itself
-(they are generated on its behalf by other parts of the system) and
-it currently is not enabled to wake up the system (that is,
-device_may_wakeup() returns "false" for it), we may need to change
-its wakeup settings during system suspend (for example, the device
-might have been configured to signal remote wakeup from the system's
-working state, as needed by runtime PM). Therefore the generic PM
-domains code should invoke the system suspend callbacks provided by
-the device's driver, which it doesn't do if the PM domain is powered
-off during the system suspend's "prepare" stage. This is a valid
-point. Moreover, this code also should make sure that system wakeup
-devices that are enabled to wake up the system from sleep states and
-have to remain active for this purpose are not suspended while the
-system is in a sleep state.
-
-To avoid the above issues, make the generic PM domains' .prepare()
-routine, pm_genpd_prepare(), force runtime resume of devices whose
-system wakeup settings may need to be changed during system suspend
-or that should remain active while the system is in a sleep state to
-be able to wake it up from that state.
-
-Reported-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4ecd6e651dd25ebbf0cc53c68162c0ab08641725)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 7b20801..b6e29ff 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -482,6 +482,33 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- }
-
- /**
-+ * resume_needed - Check whether to resume a device before system suspend.
-+ * @dev: Device to check.
-+ * @genpd: PM domain the device belongs to.
-+ *
-+ * There are two cases in which a device that can wake up the system from sleep
-+ * states should be resumed by pm_genpd_prepare(): (1) if the device is enabled
-+ * to wake up the system and it has to remain active for this purpose while the
-+ * system is in the sleep state and (2) if the device is not enabled to wake up
-+ * the system from sleep states and it generally doesn't generate wakeup signals
-+ * by itself (those signals are generated on its behalf by other parts of the
-+ * system). In the latter case it may be necessary to reconfigure the device's
-+ * wakeup settings during system suspend, because it may have been set up to
-+ * signal remote wakeup from the system's working state as needed by runtime PM.
-+ * Return 'true' in either of the above cases.
-+ */
-+static bool resume_needed(struct device *dev, struct generic_pm_domain *genpd)
-+{
-+ bool active_wakeup;
-+
-+ if (!device_can_wakeup(dev))
-+ return false;
-+
-+ active_wakeup = genpd->active_wakeup && genpd->active_wakeup(dev);
-+ return device_may_wakeup(dev) ? active_wakeup : !active_wakeup;
-+}
-+
-+/**
- * pm_genpd_prepare - Start power transition of a device in a PM domain.
- * @dev: Device to start the transition of.
- *
-@@ -515,6 +542,9 @@ static int pm_genpd_prepare(struct device *dev)
- return -EBUSY;
- }
-
-+ if (resume_needed(dev, genpd))
-+ pm_runtime_resume(dev);
-+
- genpd_acquire_lock(genpd);
-
- if (genpd->prepared_count++ == 0)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0026-PM-Domains-Queue-up-power-off-work-only-if-it-is-not.patch b/patches.runtime_pm/0026-PM-Domains-Queue-up-power-off-work-only-if-it-is-not.patch
deleted file mode 100644
index 62a24549633df9..00000000000000
--- a/patches.runtime_pm/0026-PM-Domains-Queue-up-power-off-work-only-if-it-is-not.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From ad6cdcbd34d790a790c55f44a04f36dd4bf01680 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 12 Jul 2011 00:40:03 +0200
-Subject: PM / Domains: Queue up power off work only if it is not pending
-
-In theory it is possible that pm_genpd_poweroff() for two different
-subdomains of the same parent domain will attempt to queue up the
-execution of pm_genpd_poweroff() for the parent twice in a row. This
-would lead to unpleasant consequences, so prevent it from happening
-by checking if genpd->power_off_work is pending before attempting to
-queue it up.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 56375fd420f851944960bd53dbb08d674f4d9406)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index b6e29ff..c3e4e29 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -213,6 +213,19 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
- }
-
- /**
-+ * genpd_queue_power_off_work - Queue up the execution of pm_genpd_poweroff().
-+ * @genpd: PM domait to power off.
-+ *
-+ * Queue up the execution of pm_genpd_poweroff() unless it's already been done
-+ * before.
-+ */
-+static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
-+{
-+ if (!work_pending(&genpd->power_off_work))
-+ queue_work(pm_wq, &genpd->power_off_work);
-+}
-+
-+/**
- * pm_genpd_poweroff - Remove power from a given PM domain.
- * @genpd: PM domain to power down.
- *
-@@ -304,7 +317,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- if (parent) {
- genpd_sd_counter_dec(parent);
- if (parent->sd_count == 0)
-- queue_work(pm_wq, &parent->power_off_work);
-+ genpd_queue_power_off_work(parent);
-
- genpd_release_lock(parent);
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0027-PM-Runtime-Add-new-helper-function-pm_runtime_status.patch b/patches.runtime_pm/0027-PM-Runtime-Add-new-helper-function-pm_runtime_status.patch
deleted file mode 100644
index f7685eb1dd846b..00000000000000
--- a/patches.runtime_pm/0027-PM-Runtime-Add-new-helper-function-pm_runtime_status.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 58b2b76de232e544666cbc47c97d86a5c5ad99cf Mon Sep 17 00:00:00 2001
-From: Kevin Hilman <khilman@ti.com>
-Date: Tue, 12 Jul 2011 11:17:09 +0200
-Subject: PM / Runtime: Add new helper function: pm_runtime_status_suspended()
-
-This boolean function simply returns whether or not the runtime status
-of the device is 'suspended'. Unlike pm_runtime_suspended(), this
-function returns the runtime status whether or not runtime PM for the
-device has been disabled or not.
-
-Also add entry to Documentation/power/runtime.txt
-
-Signed-off-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f3393b62f157cc87f8d78247e97b87778dc077b8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 3 +++
- include/linux/pm_runtime.h | 6 ++++++
- 2 files changed, 9 insertions(+)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 40e47c7..14dd3c6 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -412,6 +412,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
- - return true if the device's runtime PM status is 'suspended' and its
- 'power.disable_depth' field is equal to zero, or false otherwise
-
-+ bool pm_runtime_status_suspended(struct device *dev);
-+ - return true if the device's runtime PM status is 'suspended'
-+
- void pm_runtime_allow(struct device *dev);
- - set the power.runtime_auto flag for the device and decrease its usage
- counter (used by the /sys/devices/.../power/control interface to
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index dfb8539..daac05d 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
- && !dev->power.disable_depth;
- }
-
-+static inline bool pm_runtime_status_suspended(struct device *dev)
-+{
-+ return dev->power.runtime_status == RPM_SUSPENDED;
-+}
-+
- static inline bool pm_runtime_enabled(struct device *dev)
- {
- return !dev->power.disable_depth;
-@@ -130,6 +135,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
- static inline bool device_run_wake(struct device *dev) { return false; }
- static inline void device_set_run_wake(struct device *dev, bool enable) {}
- static inline bool pm_runtime_suspended(struct device *dev) { return false; }
-+static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
- static inline bool pm_runtime_enabled(struct device *dev) { return false; }
-
- static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0028-PM-Domains-Introduce-function-to-power-off-all-unuse.patch b/patches.runtime_pm/0028-PM-Domains-Introduce-function-to-power-off-all-unuse.patch
deleted file mode 100644
index db0921ae1109d2..00000000000000
--- a/patches.runtime_pm/0028-PM-Domains-Introduce-function-to-power-off-all-unuse.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 9bb7e07116765263503741136578ab4eb1dbd246 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 13 Jul 2011 12:31:52 +0200
-Subject: PM / Domains: Introduce function to power off all unused PM domains
-
-Add a new function pm_genpd_poweroff_unused() queuing up the
-execution of pm_genpd_poweroff() for every initialized generic PM
-domain. Calling it will cause every generic PM domain without
-devices in use to be powered off.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit 5125bbf3880755419eff68672623cde49c4f31e8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 21 +++++++++++++++++++++
- include/linux/pm_domain.h | 3 +++
- 2 files changed, 24 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index c3e4e29..c2c537d 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -16,6 +16,9 @@
- #include <linux/sched.h>
- #include <linux/suspend.h>
-
-+static LIST_HEAD(gpd_list);
-+static DEFINE_MUTEX(gpd_list_lock);
-+
- #ifdef CONFIG_PM
-
- static struct generic_pm_domain *dev_to_genpd(struct device *dev)
-@@ -1241,4 +1244,22 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
- genpd->domain.ops.restore = pm_genpd_restore;
- genpd->domain.ops.complete = pm_genpd_complete;
-+ mutex_lock(&gpd_list_lock);
-+ list_add(&genpd->gpd_list_node, &gpd_list);
-+ mutex_unlock(&gpd_list_lock);
-+}
-+
-+/**
-+ * pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
-+ */
-+void pm_genpd_poweroff_unused(void)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ mutex_lock(&gpd_list_lock);
-+
-+ list_for_each_entry(genpd, &gpd_list, gpd_list_node)
-+ genpd_queue_power_off_work(genpd);
-+
-+ mutex_unlock(&gpd_list_lock);
- }
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index feb80af..3e4f3d3 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -24,6 +24,7 @@ struct dev_power_governor {
-
- struct generic_pm_domain {
- struct dev_pm_domain domain; /* PM domain operations */
-+ struct list_head gpd_list_node; /* Node in the global PM domains list */
- struct list_head sd_node; /* Node in the parent's subdomain list */
- struct generic_pm_domain *parent; /* Parent PM domain */
- struct list_head sd_list; /* List of dubdomains */
-@@ -71,6 +72,7 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
- extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
-+extern void pm_genpd_poweroff_unused(void);
- #else
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
-@@ -98,6 +100,7 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
- return -ENOSYS;
- }
-+static inline void pm_genpd_poweroff_unused(void) {}
- #endif
-
- #endif /* _LINUX_PM_DOMAIN_H */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0029-ARM-shmobile-Use-genpd_queue_power_off_work.patch b/patches.runtime_pm/0029-ARM-shmobile-Use-genpd_queue_power_off_work.patch
deleted file mode 100644
index 41c2c0c80f3001..00000000000000
--- a/patches.runtime_pm/0029-ARM-shmobile-Use-genpd_queue_power_off_work.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From d68d1d65868aadd10c580d02b365a7c01ee01a3b Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 14 Jul 2011 20:59:07 +0200
-Subject: ARM / shmobile: Use genpd_queue_power_off_work()
-
-Make pd_power_down_a3rv() use genpd_queue_power_off_work() to queue
-up the powering off of the A4LC domain to avoid queuing it up when
-it is pending.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit 0bc5b2debb832191a42baea7ff59d2ca6ce9f7d5)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 2 +-
- include/linux/pm_domain.h | 2 ++
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index c2c537d..00ed4f3 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -222,7 +222,7 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
- * Queue up the execution of pm_genpd_poweroff() unless it's already been done
- * before.
- */
--static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
-+void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
- {
- if (!work_pending(&genpd->power_off_work))
- queue_work(pm_wq, &genpd->power_off_work);
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 3e4f3d3..21097cb 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -73,6 +73,7 @@ extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
- extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
- extern void pm_genpd_poweroff_unused(void);
-+extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
- #else
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
-@@ -101,6 +102,7 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
- return -ENOSYS;
- }
- static inline void pm_genpd_poweroff_unused(void) {}
-+static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
- #endif
-
- #endif /* _LINUX_PM_DOMAIN_H */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0030-PM-Domains-Take-.power_off-error-code-into-account.patch b/patches.runtime_pm/0030-PM-Domains-Take-.power_off-error-code-into-account.patch
deleted file mode 100644
index 21441cb951184f..00000000000000
--- a/patches.runtime_pm/0030-PM-Domains-Take-.power_off-error-code-into-account.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 13482707dcaba63735aff5a7479ae36fc9abf60f Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 14 Jul 2011 20:59:20 +0200
-Subject: PM / Domains: Take .power_off() error code into account
-
-Currently pm_genpd_poweroff() discards error codes returned by
-the PM domain's .power_off() callback, because it's safer to always
-regard the domain as inaccessible to drivers after a failing
-.power_off(). Still, there are situations in which the low-level
-code may want to indicate that it doesn't want to power off the
-domain, so allow it to do that by returning -EBUSY from .power_off().
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit d28054020f97c7c9f15327a53945f0f40ffc5d7a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 00ed4f3..be8714a 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -312,8 +312,16 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
- }
-
-- if (genpd->power_off)
-- genpd->power_off(genpd);
-+ if (genpd->power_off) {
-+ ret = genpd->power_off(genpd);
-+ if (ret == -EBUSY) {
-+ genpd_set_active(genpd);
-+ if (parent)
-+ genpd_release_lock(parent);
-+
-+ goto out;
-+ }
-+ }
-
- genpd->status = GPD_STATE_POWER_OFF;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0031-PM-OPP-Introduce-function-to-free-cpufreq-table.patch b/patches.runtime_pm/0031-PM-OPP-Introduce-function-to-free-cpufreq-table.patch
deleted file mode 100644
index 999c40f5402e3f..00000000000000
--- a/patches.runtime_pm/0031-PM-OPP-Introduce-function-to-free-cpufreq-table.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 978454db90df87db0d7389550fac6b7417cc28ec Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Fri, 10 Jun 2011 20:24:57 +0200
-Subject: PM / OPP: Introduce function to free cpufreq table
-
-cpufreq table allocated by opp_init_cpufreq_table is better
-freed by OPP layer itself. This allows future modifications to
-the table handling to be transparent to the users.
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
-Acked-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 99f381d3549432a250fe846a2a82d61a032804b0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/opp.txt | 2 ++
- drivers/base/power/opp.c | 17 +++++++++++++++++
- include/linux/opp.h | 8 ++++++++
- 3 files changed, 27 insertions(+)
-
-diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt
-index 5ae70a12..3035d00 100644
---- a/Documentation/power/opp.txt
-+++ b/Documentation/power/opp.txt
-@@ -321,6 +321,8 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with
- addition to CONFIG_PM as power management feature is required to
- dynamically scale voltage and frequency in a system.
-
-+opp_free_cpufreq_table - Free up the table allocated by opp_init_cpufreq_table
-+
- 7. Data Structures
- ==================
- Typically an SoC contains multiple voltage domains which are variable. Each
-diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
-index 56a6899..5cc1232 100644
---- a/drivers/base/power/opp.c
-+++ b/drivers/base/power/opp.c
-@@ -625,4 +625,21 @@ int opp_init_cpufreq_table(struct device *dev,
-
- return 0;
- }
-+
-+/**
-+ * opp_free_cpufreq_table() - free the cpufreq table
-+ * @dev: device for which we do this operation
-+ * @table: table to free
-+ *
-+ * Free up the table allocated by opp_init_cpufreq_table
-+ */
-+void opp_free_cpufreq_table(struct device *dev,
-+ struct cpufreq_frequency_table **table)
-+{
-+ if (!table)
-+ return;
-+
-+ kfree(*table);
-+ *table = NULL;
-+}
- #endif /* CONFIG_CPU_FREQ */
-diff --git a/include/linux/opp.h b/include/linux/opp.h
-index 5449945..7020e97 100644
---- a/include/linux/opp.h
-+++ b/include/linux/opp.h
-@@ -94,12 +94,20 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
- #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
- int opp_init_cpufreq_table(struct device *dev,
- struct cpufreq_frequency_table **table);
-+void opp_free_cpufreq_table(struct device *dev,
-+ struct cpufreq_frequency_table **table);
- #else
- static inline int opp_init_cpufreq_table(struct device *dev,
- struct cpufreq_frequency_table **table)
- {
- return -EINVAL;
- }
-+
-+static inline
-+void opp_free_cpufreq_table(struct device *dev,
-+ struct cpufreq_frequency_table **table)
-+{
-+}
- #endif /* CONFIG_CPU_FREQ */
-
- #endif /* __LINUX_OPP_H__ */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0032-PM-Suspend-Add-.suspend_again-callback-to-suspend_op.patch b/patches.runtime_pm/0032-PM-Suspend-Add-.suspend_again-callback-to-suspend_op.patch
deleted file mode 100644
index 09e0e1112eddb9..00000000000000
--- a/patches.runtime_pm/0032-PM-Suspend-Add-.suspend_again-callback-to-suspend_op.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 80726e611ac09d6a07c375471d96d69cf50e1cef Mon Sep 17 00:00:00 2001
-From: MyungJoo Ham <myungjoo.ham@samsung.com>
-Date: Sun, 12 Jun 2011 15:57:05 +0200
-Subject: PM / Suspend: Add .suspend_again() callback to suspend_ops
-
-A system or a device may need to control suspend/wakeup events. It may
-want to wakeup the system after a predefined amount of time or at a
-predefined event decided while entering suspend for polling or delayed
-work. Then, it may want to enter suspend again if its predefined wakeup
-condition is the only wakeup reason and there is no outstanding events;
-thus, it does not wakeup the userspace unnecessary or unnecessary
-devices and keeps suspended as long as possible (saving the power).
-
-Enabling a system to wakeup after a specified time can be easily
-achieved by using RTC. However, to enter suspend again immediately
-without invoking userland and unrelated devices, we need additional
-features in the suspend framework.
-
-Such need comes from:
-
- 1. Monitoring a critical device status without interrupts that can
-wakeup the system. (in-suspend polling)
- An example is ambient temperature monitoring that needs to shut down
-the system or a specific device function if it is too hot or cold. The
-temperature of a specific device may be needed to be monitored as well;
-e.g., a charger monitors battery temperature in order to stop charging
-if overheated.
-
- 2. Execute critical "delayed work" at suspend.
- A driver or a system/board may have a delayed work (or any similar
-things) that it wants to execute at the requested time.
- For example, some chargers want to check the battery voltage some
-time (e.g., 30 seconds) after the battery is fully charged and the
-charger has stopped. Then, the charger restarts charging if the voltage
-has dropped more than a threshold, which is smaller than "restart-charger"
-voltage, which is a threshold to restart charging regardless of the
-time passed.
-
-This patch allows to add "suspend_again" callback at struct
-platform_suspend_ops and let the "suspend_again" callback return true if
-the system is required to enter suspend again after the current instance
-of wakeup. Device-wise suspend_again implemented at dev_pm_ops or
-syscore is not done because: a) suspend_again feature is usually under
-platform-wise decision and controls the behavior of the whole platform
-and b) There are very limited devices related to the usage cases of
-suspend_again; chargers and temperature sensors are mentioned so far.
-
-With suspend_again callback registered at struct platform_suspend_ops
-suspend_ops in kernel/power/suspend.c with suspend_set_ops by the
-platform, the suspend framework tries to enter suspend again by
-looping suspend_enter() if suspend_again has returned true and there has
-been no errors in the suspending sequence or pending wakeups (by
-pm_wakeup_pending).
-
-Tested at Exynos4-NURI.
-
-[rjw: Fixed up kerneldoc comment for suspend_enter().]
-
-Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-Acked-by: Pavel Machek <pavel@ucw.cz>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 3b5fe85252326217cd96f24a7bda4460d8f71bee)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/suspend.h | 8 ++++++++
- kernel/power/suspend.c | 18 ++++++++++++------
- 2 files changed, 20 insertions(+), 6 deletions(-)
-
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index 083ffea..e1e3742 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t;
- * @enter() and @wake(), even if any of them fails. It is executed after
- * a failing @prepare.
- *
-+ * @suspend_again: Returns whether the system should suspend again (true) or
-+ * not (false). If the platform wants to poll sensors or execute some
-+ * code during suspended without invoking userspace and most of devices,
-+ * suspend_again callback is the place assuming that periodic-wakeup or
-+ * alarm-wakeup is already setup. This allows to execute some codes while
-+ * being kept suspended in the view of userland and devices.
-+ *
- * @end: Called by the PM core right after resuming devices, to indicate to
- * the platform that the system has returned to the working state or
- * the transition to the sleep state has been aborted.
-@@ -113,6 +120,7 @@ struct platform_suspend_ops {
- int (*enter)(suspend_state_t state);
- void (*wake)(void);
- void (*finish)(void);
-+ bool (*suspend_again)(void);
- void (*end)(void);
- void (*recover)(void);
- };
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 449ccc9..bb98404 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -126,12 +126,13 @@ void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
- }
-
- /**
-- * suspend_enter - enter the desired system sleep state.
-- * @state: state to enter
-+ * suspend_enter - enter the desired system sleep state.
-+ * @state: State to enter
-+ * @wakeup: Returns information that suspend should not be entered again.
- *
-- * This function should be called after devices have been suspended.
-+ * This function should be called after devices have been suspended.
- */
--static int suspend_enter(suspend_state_t state)
-+static int suspend_enter(suspend_state_t state, bool *wakeup)
- {
- int error;
-
-@@ -165,7 +166,8 @@ static int suspend_enter(suspend_state_t state)
-
- error = syscore_suspend();
- if (!error) {
-- if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) {
-+ *wakeup = pm_wakeup_pending();
-+ if (!(suspend_test(TEST_CORE) || *wakeup)) {
- error = suspend_ops->enter(state);
- events_check_enabled = false;
- }
-@@ -199,6 +201,7 @@ static int suspend_enter(suspend_state_t state)
- int suspend_devices_and_enter(suspend_state_t state)
- {
- int error;
-+ bool wakeup = false;
-
- if (!suspend_ops)
- return -ENOSYS;
-@@ -220,7 +223,10 @@ int suspend_devices_and_enter(suspend_state_t state)
- if (suspend_test(TEST_DEVICES))
- goto Recover_platform;
-
-- error = suspend_enter(state);
-+ do {
-+ error = suspend_enter(state, &wakeup);
-+ } while (!error && !wakeup
-+ && suspend_ops->suspend_again && suspend_ops->suspend_again());
-
- Resume_devices:
- suspend_test_start();
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0033-PM-Suspend-Export-suspend_set_ops-suspend_valid_only.patch b/patches.runtime_pm/0033-PM-Suspend-Export-suspend_set_ops-suspend_valid_only.patch
deleted file mode 100644
index 1a4938d08a7f1b..00000000000000
--- a/patches.runtime_pm/0033-PM-Suspend-Export-suspend_set_ops-suspend_valid_only.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From b12f64fa8677140c0b96d230c1166468ec7c9520 Mon Sep 17 00:00:00 2001
-From: Kevin Hilman <khilman@ti.com>
-Date: Mon, 27 Jun 2011 01:01:07 +0200
-Subject: PM / Suspend: Export suspend_set_ops, suspend_valid_only_mem
-
-Some platforms wish to implement their PM core suspend code as
-modules. To do so, these functions need to be exported to modules.
-
-[rjw: Replaced EXPORT_SYMBOL with EXPORT_SYMBOL_GPL]
-
-Reported-by: Jean Pihet <j-pihet@ti.com>
-Signed-off-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a5e4fd8783a2bec861ecf1138cdc042269ff59aa)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/suspend.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index bb98404..d3caa76 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
- suspend_ops = ops;
- mutex_unlock(&pm_mutex);
- }
-+EXPORT_SYMBOL_GPL(suspend_set_ops);
-
- bool valid_state(suspend_state_t state)
- {
-@@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state)
- {
- return state == PM_SUSPEND_MEM;
- }
-+EXPORT_SYMBOL_GPL(suspend_valid_only_mem);
-
- static int suspend_test(int level)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0034-PM-Add-RTC-to-PM-trace-time-stamps-to-avoid-confusio.patch b/patches.runtime_pm/0034-PM-Add-RTC-to-PM-trace-time-stamps-to-avoid-confusio.patch
deleted file mode 100644
index 9649379aadc31e..00000000000000
--- a/patches.runtime_pm/0034-PM-Add-RTC-to-PM-trace-time-stamps-to-avoid-confusio.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From f71046d97ad0c115952173bf02c87c2be6b1d40b Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 27 Jun 2011 01:01:16 +0200
-Subject: PM: Add "RTC" to PM trace time stamps to avoid confusion
-
-Some users are apparently confused by dmesg output from
-read_magic_time(), which looks like "real" time and date.
-Add the "RTC" string to time stamps printed by read_magic_time() to
-avoid that confusion.
-
-Reported-by: Justin P. Mattock <justinmattock@gmail.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 1d8047a6f7973470bb1de4606a6e00c0bbee3cc6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/trace.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
-index c80e138..af10abe 100644
---- a/drivers/base/power/trace.c
-+++ b/drivers/base/power/trace.c
-@@ -112,7 +112,7 @@ static unsigned int read_magic_time(void)
- unsigned int val;
-
- get_rtc_time(&time);
-- pr_info("Time: %2d:%02d:%02d Date: %02d/%02d/%02d\n",
-+ pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n",
- time.tm_hour, time.tm_min, time.tm_sec,
- time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
- val = time.tm_year; /* 100 years */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0035-PM-Improve-error-code-of-pm_notifier_call_chain.patch b/patches.runtime_pm/0035-PM-Improve-error-code-of-pm_notifier_call_chain.patch
deleted file mode 100644
index dc7cb698760a1d..00000000000000
--- a/patches.runtime_pm/0035-PM-Improve-error-code-of-pm_notifier_call_chain.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 40b4c11aefa0df4e8a47bb5cf4fa640a08c0f736 Mon Sep 17 00:00:00 2001
-From: Akinobu Mita <akinobu.mita@gmail.com>
-Date: Fri, 8 Jul 2011 20:53:36 +0200
-Subject: PM: Improve error code of pm_notifier_call_chain()
-
-This enables pm_notifier_call_chain() to get the actual error code
-in the callback rather than always assume -EINVAL by converting all
-PM notifier calls to return encapsulate error code with
-notifier_from_errno().
-
-Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f0c077a8b7f9dce590c760a7b2f3c417dffa52d1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/char/apm-emulation.c | 2 +-
- drivers/s390/char/vmwatchdog.c | 4 ++--
- drivers/s390/cio/css.c | 8 ++++----
- kernel/power/main.c | 5 +++--
- 4 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
-index 548708c..a7346ab 100644
---- a/drivers/char/apm-emulation.c
-+++ b/drivers/char/apm-emulation.c
-@@ -606,7 +606,7 @@ static int apm_suspend_notifier(struct notifier_block *nb,
- return NOTIFY_OK;
-
- /* interrupted by signal */
-- return NOTIFY_BAD;
-+ return notifier_from_errno(err);
-
- case PM_POST_SUSPEND:
- /*
-diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c
-index 12ef912..11312f4 100644
---- a/drivers/s390/char/vmwatchdog.c
-+++ b/drivers/s390/char/vmwatchdog.c
-@@ -258,13 +258,13 @@ static int vmwdt_suspend(void)
- if (test_and_set_bit(VMWDT_OPEN, &vmwdt_is_open)) {
- pr_err("The system cannot be suspended while the watchdog"
- " is in use\n");
-- return NOTIFY_BAD;
-+ return notifier_from_errno(-EBUSY);
- }
- if (test_bit(VMWDT_RUNNING, &vmwdt_is_open)) {
- clear_bit(VMWDT_OPEN, &vmwdt_is_open);
- pr_err("The system cannot be suspended while the watchdog"
- " is running\n");
-- return NOTIFY_BAD;
-+ return notifier_from_errno(-EBUSY);
- }
- return NOTIFY_DONE;
- }
-diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
-index c47b25f..92d7324 100644
---- a/drivers/s390/cio/css.c
-+++ b/drivers/s390/cio/css.c
-@@ -814,8 +814,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
- mutex_unlock(&css->mutex);
- continue;
- }
-- if (__chsc_do_secm(css, 0))
-- ret = NOTIFY_BAD;
-+ ret = __chsc_do_secm(css, 0);
-+ ret = notifier_from_errno(ret);
- mutex_unlock(&css->mutex);
- }
- break;
-@@ -831,8 +831,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
- mutex_unlock(&css->mutex);
- continue;
- }
-- if (__chsc_do_secm(css, 1))
-- ret = NOTIFY_BAD;
-+ ret = __chsc_do_secm(css, 1);
-+ ret = notifier_from_errno(ret);
- mutex_unlock(&css->mutex);
- }
- /* search for subchannels, which appeared during hibernation */
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 2981af4..6c601f8 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -37,8 +37,9 @@ EXPORT_SYMBOL_GPL(unregister_pm_notifier);
-
- int pm_notifier_call_chain(unsigned long val)
- {
-- return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
-- == NOTIFY_BAD) ? -EINVAL : 0;
-+ int ret = blocking_notifier_call_chain(&pm_chain_head, val, NULL);
-+
-+ return notifier_to_errno(ret);
- }
-
- /* If set, devices may be suspended and resumed asynchronously. */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0036-drivers-base-power-opp.c-fix-dev_opp-initial-value.patch b/patches.runtime_pm/0036-drivers-base-power-opp.c-fix-dev_opp-initial-value.patch
deleted file mode 100644
index 4674bb6de774e0..00000000000000
--- a/patches.runtime_pm/0036-drivers-base-power-opp.c-fix-dev_opp-initial-value.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 228f47a156a24f7d1b39930f0a677eb91fabb9da Mon Sep 17 00:00:00 2001
-From: Jonghwan Choi <jhbird.choi@samsung.com>
-Date: Tue, 26 Jul 2011 16:08:16 -0700
-Subject: drivers/base/power/opp.c: fix dev_opp initial value
-
-Dev_opp initial value shoule be ERR_PTR(), IS_ERR() is used to check
-error.
-
-Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
-Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
-Cc: Greg KH <greg@kroah.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit fc92805a8e25e5e2b0ba7c413cc15d9f05962ee8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/opp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
-index 5cc1232..b23de18 100644
---- a/drivers/base/power/opp.c
-+++ b/drivers/base/power/opp.c
-@@ -453,7 +453,7 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
- static int opp_set_availability(struct device *dev, unsigned long freq,
- bool availability_req)
- {
-- struct device_opp *tmp_dev_opp, *dev_opp = NULL;
-+ struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV);
- struct opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV);
- int r = 0;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0037-PM-Domains-Fix-pm_genpd_poweron.patch b/patches.runtime_pm/0037-PM-Domains-Fix-pm_genpd_poweron.patch
deleted file mode 100644
index 5dd4d1cb9e3990..00000000000000
--- a/patches.runtime_pm/0037-PM-Domains-Fix-pm_genpd_poweron.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 83396d4b1611eebbb93949b08fe0d4c36d5f4982 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 5 Aug 2011 21:45:11 +0200
-Subject: PM / Domains: Fix pm_genpd_poweron()
-
-The local variable ret is defined twice in pm_genpd_poweron(), which
-causes this function to always return 0, even if the PM domain's
-.power_on() callback fails, in which case an error code should be
-returned.
-
-Remove the wrong second definition of ret and additionally remove an
-unnecessary definition of wait from pm_genpd_poweron().
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit fe202fde50a986a8510c62a76dc8733c1a8fac86)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index be8714a..e18566a 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -80,7 +80,6 @@ static void genpd_set_active(struct generic_pm_domain *genpd)
- int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
- struct generic_pm_domain *parent = genpd->parent;
-- DEFINE_WAIT(wait);
- int ret = 0;
-
- start:
-@@ -112,7 +111,7 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- }
-
- if (genpd->power_on) {
-- int ret = genpd->power_on(genpd);
-+ ret = genpd->power_on(genpd);
- if (ret)
- goto out;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0038-PM-Runtime-Allow-_put_sync-from-interrupts-disabled-.patch b/patches.runtime_pm/0038-PM-Runtime-Allow-_put_sync-from-interrupts-disabled-.patch
deleted file mode 100644
index 6ad10839bc4b82..00000000000000
--- a/patches.runtime_pm/0038-PM-Runtime-Allow-_put_sync-from-interrupts-disabled-.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From fe65f70e3ddea03d11ba56bed454621f2aad9961 Mon Sep 17 00:00:00 2001
-From: Kevin Hilman <khilman@ti.com>
-Date: Fri, 5 Aug 2011 21:45:20 +0200
-Subject: PM / Runtime: Allow _put_sync() from interrupts-disabled context
-
-Currently the use of pm_runtime_put_sync() is not safe from
-interrupts-disabled context because rpm_idle() will release the
-spinlock and enable interrupts for the idle callbacks. This enables
-interrupts during a time where interrupts were expected to be
-disabled, and can have strange side effects on drivers that expected
-interrupts to be disabled.
-
-This is not a bug since the documentation clearly states that only
-_put_sync_suspend() is safe in IRQ-safe mode.
-
-However, pm_runtime_put_sync() could be made safe when in IRQ-safe
-mode by releasing the spinlock but not re-enabling interrupts, which
-is what this patch aims to do.
-
-Problem was found when using some buggy drivers that set
-pm_runtime_irq_safe() and used _put_sync() in interrupts-disabled
-context.
-
-Reported-by: Colin Cross <ccross@google.com>
-Tested-by: Nishanth Menon <nm@ti.com>
-Signed-off-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 02b26774afebb2d62695ba3230319d70d8c6cc2d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 10 +++++-----
- drivers/base/power/runtime.c | 10 ++++++++--
- 2 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 14dd3c6..4ce5450 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -54,11 +54,10 @@ referred to as subsystem-level callbacks in what follows.
- By default, the callbacks are always invoked in process context with interrupts
- enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
- to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
--callbacks should be invoked in atomic context with interrupts disabled
--(->runtime_idle() is still invoked the default way). This implies that these
--callback routines must not block or sleep, but it also means that the
--synchronous helper functions listed at the end of Section 4 can be used within
--an interrupt handler or in an atomic context.
-+callbacks should be invoked in atomic context with interrupts disabled.
-+This implies that these callback routines must not block or sleep, but it also
-+means that the synchronous helper functions listed at the end of Section 4 can
-+be used within an interrupt handler or in an atomic context.
-
- The subsystem-level suspend callback is _entirely_ _responsible_ for handling
- the suspend of the device as appropriate, which may, but need not include
-@@ -483,6 +482,7 @@ pm_runtime_suspend()
- pm_runtime_autosuspend()
- pm_runtime_resume()
- pm_runtime_get_sync()
-+pm_runtime_put_sync()
- pm_runtime_put_sync_suspend()
-
- 5. Runtime PM Initialization, Device Probing and Removal
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 8dc247c..acb3f83 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -226,11 +226,17 @@ static int rpm_idle(struct device *dev, int rpmflags)
- callback = NULL;
-
- if (callback) {
-- spin_unlock_irq(&dev->power.lock);
-+ if (dev->power.irq_safe)
-+ spin_unlock(&dev->power.lock);
-+ else
-+ spin_unlock_irq(&dev->power.lock);
-
- callback(dev);
-
-- spin_lock_irq(&dev->power.lock);
-+ if (dev->power.irq_safe)
-+ spin_lock(&dev->power.lock);
-+ else
-+ spin_lock_irq(&dev->power.lock);
- }
-
- dev->power.idle_notification = false;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0039-PM-Domains-Fix-build-for-CONFIG_PM_RUNTIME-unset.patch b/patches.runtime_pm/0039-PM-Domains-Fix-build-for-CONFIG_PM_RUNTIME-unset.patch
deleted file mode 100644
index 4e39b52d95b19b..00000000000000
--- a/patches.runtime_pm/0039-PM-Domains-Fix-build-for-CONFIG_PM_RUNTIME-unset.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From ac9b6c62b9958c273e8c6f5ceef418287846b5b7 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 14 Aug 2011 13:34:31 +0200
-Subject: PM / Domains: Fix build for CONFIG_PM_RUNTIME unset
-
-Function genpd_queue_power_off_work() is not defined for
-CONFIG_PM_RUNTIME, so pm_genpd_poweroff_unused() causes a build
-error to happen in that case. Fix the problem by making
-pm_genpd_poweroff_unused() depend on CONFIG_PM_RUNTIME too.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 17f2ae7f677f023997e02fd2ebabd90ea2a0390d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 30 +++++++++++++++---------------
- include/linux/pm_domain.h | 10 +++++++---
- kernel/power/Kconfig | 4 ++++
- 3 files changed, 26 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index e18566a..1c37457 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -460,6 +460,21 @@ static int pm_genpd_runtime_resume(struct device *dev)
- return 0;
- }
-
-+/**
-+ * pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
-+ */
-+void pm_genpd_poweroff_unused(void)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ mutex_lock(&gpd_list_lock);
-+
-+ list_for_each_entry(genpd, &gpd_list, gpd_list_node)
-+ genpd_queue_power_off_work(genpd);
-+
-+ mutex_unlock(&gpd_list_lock);
-+}
-+
- #else
-
- static inline void genpd_power_off_work_fn(struct work_struct *work) {}
-@@ -1255,18 +1270,3 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- list_add(&genpd->gpd_list_node, &gpd_list);
- mutex_unlock(&gpd_list_lock);
- }
--
--/**
-- * pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
-- */
--void pm_genpd_poweroff_unused(void)
--{
-- struct generic_pm_domain *genpd;
--
-- mutex_lock(&gpd_list_lock);
--
-- list_for_each_entry(genpd, &gpd_list, gpd_list_node)
-- genpd_queue_power_off_work(genpd);
--
-- mutex_unlock(&gpd_list_lock);
--}
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 21097cb..f9ec173 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -72,8 +72,6 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
- extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
--extern void pm_genpd_poweroff_unused(void);
--extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
- #else
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
-@@ -101,8 +99,14 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
- return -ENOSYS;
- }
--static inline void pm_genpd_poweroff_unused(void) {}
-+#endif
-+
-+#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
-+extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
-+extern void pm_genpd_poweroff_unused(void);
-+#else
- static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
-+static inline void pm_genpd_poweroff_unused(void) {}
- #endif
-
- #endif /* _LINUX_PM_DOMAIN_H */
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index b1914cb9..3744c59 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -231,3 +231,7 @@ config PM_CLK
- config PM_GENERIC_DOMAINS
- bool
- depends on PM
-+
-+config PM_GENERIC_DOMAINS_RUNTIME
-+ def_bool y
-+ depends on PM_RUNTIME && PM_GENERIC_DOMAINS
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0040-PM-Runtime-Add-might_sleep-to-runtime-PM-functions.patch b/patches.runtime_pm/0040-PM-Runtime-Add-might_sleep-to-runtime-PM-functions.patch
deleted file mode 100644
index a8ca41bb230f57..00000000000000
--- a/patches.runtime_pm/0040-PM-Runtime-Add-might_sleep-to-runtime-PM-functions.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 328eba5e3cefcd17ddcd4b700be7e92909e8320a Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Mon, 8 Aug 2011 23:39:36 +0200
-Subject: PM / Runtime: Add might_sleep() to runtime PM functions
-
-Some of the entry points to pm runtime are not safe to
-call in atomic context unless pm_runtime_irq_safe() has
-been called. Inspecting the code, it is not immediately
-obvious that the functions sleep at all, as they run
-inside a spin_lock_irqsave, but under some conditions
-they can drop the lock and turn on irqs.
-
-If a driver incorrectly calls the pm_runtime apis, it can
-cause sleeping and irq processing when it expects to stay
-in atomic context.
-
-Add might_sleep_if to the majority of the __pm_runtime_* entry points
-to enforce correct usage.
-
-Add pm_runtime_put_sync_autosuspend to the list of
-functions that can be called in atomic context.
-
-Signed-off-by: Colin Cross <ccross@android.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 311aab73d273eb22be976055f6cab224f7279d5e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 1 +
- drivers/base/power/runtime.c | 15 ++++++++++++---
- 2 files changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 4ce5450..62f37bc 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -484,6 +484,7 @@ pm_runtime_resume()
- pm_runtime_get_sync()
- pm_runtime_put_sync()
- pm_runtime_put_sync_suspend()
-+pm_runtime_put_sync_autosuspend()
-
- 5. Runtime PM Initialization, Device Probing and Removal
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index acb3f83..04e18ab 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -732,13 +732,16 @@ EXPORT_SYMBOL_GPL(pm_schedule_suspend);
- * return immediately if it is larger than zero. Then carry out an idle
- * notification, either synchronous or asynchronous.
- *
-- * This routine may be called in atomic context if the RPM_ASYNC flag is set.
-+ * This routine may be called in atomic context if the RPM_ASYNC flag is set,
-+ * or if pm_runtime_irq_safe() has been called.
- */
- int __pm_runtime_idle(struct device *dev, int rpmflags)
- {
- unsigned long flags;
- int retval;
-
-+ might_sleep_if(!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe);
-+
- if (rpmflags & RPM_GET_PUT) {
- if (!atomic_dec_and_test(&dev->power.usage_count))
- return 0;
-@@ -761,13 +764,16 @@ EXPORT_SYMBOL_GPL(__pm_runtime_idle);
- * return immediately if it is larger than zero. Then carry out a suspend,
- * either synchronous or asynchronous.
- *
-- * This routine may be called in atomic context if the RPM_ASYNC flag is set.
-+ * This routine may be called in atomic context if the RPM_ASYNC flag is set,
-+ * or if pm_runtime_irq_safe() has been called.
- */
- int __pm_runtime_suspend(struct device *dev, int rpmflags)
- {
- unsigned long flags;
- int retval;
-
-+ might_sleep_if(!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe);
-+
- if (rpmflags & RPM_GET_PUT) {
- if (!atomic_dec_and_test(&dev->power.usage_count))
- return 0;
-@@ -789,13 +795,16 @@ EXPORT_SYMBOL_GPL(__pm_runtime_suspend);
- * If the RPM_GET_PUT flag is set, increment the device's usage count. Then
- * carry out a resume, either synchronous or asynchronous.
- *
-- * This routine may be called in atomic context if the RPM_ASYNC flag is set.
-+ * This routine may be called in atomic context if the RPM_ASYNC flag is set,
-+ * or if pm_runtime_irq_safe() has been called.
- */
- int __pm_runtime_resume(struct device *dev, int rpmflags)
- {
- unsigned long flags;
- int retval;
-
-+ might_sleep_if(!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe);
-+
- if (rpmflags & RPM_GET_PUT)
- atomic_inc(&dev->power.usage_count);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0041-PM-Runtime-Add-macro-to-test-for-runtime-PM-events.patch b/patches.runtime_pm/0041-PM-Runtime-Add-macro-to-test-for-runtime-PM-events.patch
deleted file mode 100644
index f8f687e300f332..00000000000000
--- a/patches.runtime_pm/0041-PM-Runtime-Add-macro-to-test-for-runtime-PM-events.patch
+++ /dev/null
@@ -1,323 +0,0 @@
-From 8ddf7a667b20addc334227054a0147cf0b882938 Mon Sep 17 00:00:00 2001
-From: Alan Stern <stern@rowland.harvard.edu>
-Date: Fri, 19 Aug 2011 23:49:48 +0200
-Subject: PM / Runtime: Add macro to test for runtime PM events
-
-This patch (as1482) adds a macro for testing whether or not a
-pm_message value represents an autosuspend or autoresume (i.e., a
-runtime PM) event. Encapsulating this notion seems preferable to
-open-coding the test all over the place.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5b1b0b812a7b1a5b968c5d06d90d1cb88621b941)
-
-Conflicts:
-
- drivers/usb/class/cdc-wdm.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/usb/power-management.txt | 8 ++++----
- drivers/bluetooth/btusb.c | 2 +-
- drivers/hid/hid-picolcd.c | 2 +-
- drivers/hid/usbhid/hid-core.c | 7 +++----
- drivers/net/usb/usbnet.c | 2 +-
- drivers/net/wimax/i2400m/usb.c | 4 ++--
- drivers/usb/class/cdc-acm.c | 2 +-
- drivers/usb/class/cdc-wdm.c | 6 +++---
- drivers/usb/core/driver.c | 9 ++++-----
- drivers/usb/core/hcd.c | 4 ++--
- drivers/usb/core/hub.c | 10 +++++-----
- drivers/usb/serial/sierra.c | 2 +-
- drivers/usb/serial/usb_wwan.c | 2 +-
- include/linux/pm.h | 2 ++
- sound/usb/card.c | 2 +-
- 15 files changed, 32 insertions(+), 32 deletions(-)
-
---- a/Documentation/usb/power-management.txt
-+++ b/Documentation/usb/power-management.txt
-@@ -439,10 +439,10 @@ cause autosuspends to fail with -EBUSY i
- device.
-
- External suspend calls should never be allowed to fail in this way,
--only autosuspend calls. The driver can tell them apart by checking
--the PM_EVENT_AUTO bit in the message.event argument to the suspend
--method; this bit will be set for internal PM events (autosuspend) and
--clear for external PM events.
-+only autosuspend calls. The driver can tell them apart by applying
-+the PMSG_IS_AUTO() macro to the message argument to the suspend
-+method; it will return True for internal PM events (autosuspend) and
-+False for external PM events.
-
-
- Mutual exclusion
---- a/drivers/bluetooth/btusb.c
-+++ b/drivers/bluetooth/btusb.c
-@@ -1126,7 +1126,7 @@ static int btusb_suspend(struct usb_inte
- return 0;
-
- spin_lock_irq(&data->txlock);
-- if (!((message.event & PM_EVENT_AUTO) && data->tx_in_flight)) {
-+ if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) {
- set_bit(BTUSB_SUSPENDING, &data->flags);
- spin_unlock_irq(&data->txlock);
- } else {
---- a/drivers/hid/hid-picolcd.c
-+++ b/drivers/hid/hid-picolcd.c
-@@ -2409,7 +2409,7 @@ static int picolcd_raw_event(struct hid_
- #ifdef CONFIG_PM
- static int picolcd_suspend(struct hid_device *hdev, pm_message_t message)
- {
-- if (message.event & PM_EVENT_AUTO)
-+ if (PMSG_IS_AUTO(message))
- return 0;
-
- picolcd_suspend_backlight(hid_get_drvdata(hdev));
---- a/drivers/hid/usbhid/hid-core.c
-+++ b/drivers/hid/usbhid/hid-core.c
-@@ -1330,7 +1330,7 @@ static int hid_suspend(struct usb_interf
- struct usbhid_device *usbhid = hid->driver_data;
- int status;
-
-- if (message.event & PM_EVENT_AUTO) {
-+ if (PMSG_IS_AUTO(message)) {
- spin_lock_irq(&usbhid->lock); /* Sync with error handler */
- if (!test_bit(HID_RESET_PENDING, &usbhid->iofl)
- && !test_bit(HID_CLEAR_HALT, &usbhid->iofl)
-@@ -1365,7 +1365,7 @@ static int hid_suspend(struct usb_interf
- return -EIO;
- }
-
-- if (!ignoreled && (message.event & PM_EVENT_AUTO)) {
-+ if (!ignoreled && PMSG_IS_AUTO(message)) {
- spin_lock_irq(&usbhid->lock);
- if (test_bit(HID_LED_ON, &usbhid->iofl)) {
- spin_unlock_irq(&usbhid->lock);
-@@ -1378,8 +1378,7 @@ static int hid_suspend(struct usb_interf
- hid_cancel_delayed_stuff(usbhid);
- hid_cease_io(usbhid);
-
-- if ((message.event & PM_EVENT_AUTO) &&
-- test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) {
-+ if (PMSG_IS_AUTO(message) && test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) {
- /* lost race against keypresses */
- status = hid_start_in(hid);
- if (status < 0)
---- a/drivers/net/usb/usbnet.c
-+++ b/drivers/net/usb/usbnet.c
-@@ -1502,7 +1502,7 @@ int usbnet_suspend (struct usb_interface
- if (!dev->suspend_count++) {
- spin_lock_irq(&dev->txq.lock);
- /* don't autosuspend while transmitting */
-- if (dev->txq.qlen && (message.event & PM_EVENT_AUTO)) {
-+ if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
- spin_unlock_irq(&dev->txq.lock);
- return -EBUSY;
- } else {
---- a/drivers/net/wimax/i2400m/usb.c
-+++ b/drivers/net/wimax/i2400m/usb.c
-@@ -599,7 +599,7 @@ void i2400mu_disconnect(struct usb_inter
- *
- * As well, the device might refuse going to sleep for whichever
- * reason. In this case we just fail. For system suspend/hibernate,
-- * we *can't* fail. We check PM_EVENT_AUTO to see if the
-+ * we *can't* fail. We check PMSG_IS_AUTO to see if the
- * suspend call comes from the USB stack or from the system and act
- * in consequence.
- *
-@@ -615,7 +615,7 @@ int i2400mu_suspend(struct usb_interface
- struct i2400m *i2400m = &i2400mu->i2400m;
-
- #ifdef CONFIG_PM
-- if (pm_msg.event & PM_EVENT_AUTO)
-+ if (PMSG_IS_AUTO(pm_msg))
- is_autosuspend = 1;
- #endif
-
---- a/drivers/usb/class/cdc-acm.c
-+++ b/drivers/usb/class/cdc-acm.c
-@@ -1327,7 +1327,7 @@ static int acm_suspend(struct usb_interf
- struct acm *acm = usb_get_intfdata(intf);
- int cnt;
-
-- if (message.event & PM_EVENT_AUTO) {
-+ if (PMSG_IS_AUTO(message)) {
- int b;
-
- spin_lock_irq(&acm->write_lock);
---- a/drivers/usb/class/cdc-wdm.c
-+++ b/drivers/usb/class/cdc-wdm.c
-@@ -819,13 +819,13 @@ static int wdm_suspend(struct usb_interf
- dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor);
-
- /* if this is an autosuspend the caller does the locking */
-- if (!(message.event & PM_EVENT_AUTO)) {
-+ if (!PMSG_IS_AUTO(message)) {
- mutex_lock(&desc->rlock);
- mutex_lock(&desc->wlock);
- }
- spin_lock_irq(&desc->iuspin);
-
-- if ((message.event & PM_EVENT_AUTO) &&
-+ if (PMSG_IS_AUTO(message) &&
- (test_bit(WDM_IN_USE, &desc->flags)
- || test_bit(WDM_RESPONDING, &desc->flags))) {
- spin_unlock_irq(&desc->iuspin);
-@@ -838,7 +838,7 @@ static int wdm_suspend(struct usb_interf
- kill_urbs(desc);
- cancel_work_sync(&desc->rxwork);
- }
-- if (!(message.event & PM_EVENT_AUTO)) {
-+ if (!PMSG_IS_AUTO(message)) {
- mutex_unlock(&desc->wlock);
- mutex_unlock(&desc->rlock);
- }
---- a/drivers/usb/core/driver.c
-+++ b/drivers/usb/core/driver.c
-@@ -1046,8 +1046,7 @@ static int usb_resume_device(struct usb_
- /* Non-root devices on a full/low-speed bus must wait for their
- * companion high-speed root hub, in case a handoff is needed.
- */
-- if (!(msg.event & PM_EVENT_AUTO) && udev->parent &&
-- udev->bus->hs_companion)
-+ if (!PMSG_IS_AUTO(msg) && udev->parent && udev->bus->hs_companion)
- device_pm_wait_for_dev(&udev->dev,
- &udev->bus->hs_companion->root_hub->dev);
-
-@@ -1075,7 +1074,7 @@ static int usb_suspend_interface(struct
-
- if (driver->suspend) {
- status = driver->suspend(intf, msg);
-- if (status && !(msg.event & PM_EVENT_AUTO))
-+ if (status && !PMSG_IS_AUTO(msg))
- dev_err(&intf->dev, "%s error %d\n",
- "suspend", status);
- } else {
-@@ -1189,7 +1188,7 @@ static int usb_suspend_both(struct usb_d
- status = usb_suspend_interface(udev, intf, msg);
-
- /* Ignore errors during system sleep transitions */
-- if (!(msg.event & PM_EVENT_AUTO))
-+ if (!PMSG_IS_AUTO(msg))
- status = 0;
- if (status != 0)
- break;
-@@ -1199,7 +1198,7 @@ static int usb_suspend_both(struct usb_d
- status = usb_suspend_device(udev, msg);
-
- /* Again, ignore errors during system sleep transitions */
-- if (!(msg.event & PM_EVENT_AUTO))
-+ if (!PMSG_IS_AUTO(msg))
- status = 0;
- }
-
---- a/drivers/usb/core/hcd.c
-+++ b/drivers/usb/core/hcd.c
-@@ -1950,7 +1950,7 @@ int hcd_bus_suspend(struct usb_device *r
- int old_state = hcd->state;
-
- dev_dbg(&rhdev->dev, "bus %s%s\n",
-- (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "suspend");
-+ (PMSG_IS_AUTO(msg) ? "auto-" : ""), "suspend");
- if (HCD_DEAD(hcd)) {
- dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "suspend");
- return 0;
-@@ -1986,7 +1986,7 @@ int hcd_bus_resume(struct usb_device *rh
- int old_state = hcd->state;
-
- dev_dbg(&rhdev->dev, "usb %s%s\n",
-- (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "resume");
-+ (PMSG_IS_AUTO(msg) ? "auto-" : ""), "resume");
- if (HCD_DEAD(hcd)) {
- dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "resume");
- return 0;
---- a/drivers/usb/core/hub.c
-+++ b/drivers/usb/core/hub.c
-@@ -2349,7 +2349,7 @@ int usb_port_suspend(struct usb_device *
- dev_dbg(&udev->dev, "won't remote wakeup, status %d\n",
- status);
- /* bail if autosuspend is requested */
-- if (msg.event & PM_EVENT_AUTO)
-+ if (PMSG_IS_AUTO(msg))
- return status;
- }
- }
-@@ -2374,12 +2374,12 @@ int usb_port_suspend(struct usb_device *
- USB_CTRL_SET_TIMEOUT);
-
- /* System sleep transitions should never fail */
-- if (!(msg.event & PM_EVENT_AUTO))
-+ if (!PMSG_IS_AUTO(msg))
- status = 0;
- } else {
- /* device has up to 10 msec to fully suspend */
- dev_dbg(&udev->dev, "usb %ssuspend\n",
-- (msg.event & PM_EVENT_AUTO ? "auto-" : ""));
-+ (PMSG_IS_AUTO(msg) ? "auto-" : ""));
- usb_set_device_state(udev, USB_STATE_SUSPENDED);
- msleep(10);
- }
-@@ -2530,7 +2530,7 @@ int usb_port_resume(struct usb_device *u
- } else {
- /* drive resume for at least 20 msec */
- dev_dbg(&udev->dev, "usb %sresume\n",
-- (msg.event & PM_EVENT_AUTO ? "auto-" : ""));
-+ (PMSG_IS_AUTO(msg) ? "auto-" : ""));
- msleep(25);
-
- /* Virtual root hubs can trigger on GET_PORT_STATUS to
-@@ -2632,7 +2632,7 @@ static int hub_suspend(struct usb_interf
- udev = hdev->children [port1-1];
- if (udev && udev->can_submit) {
- dev_warn(&intf->dev, "port %d nyet suspended\n", port1);
-- if (msg.event & PM_EVENT_AUTO)
-+ if (PMSG_IS_AUTO(msg))
- return -EBUSY;
- }
- }
---- a/drivers/usb/serial/sierra.c
-+++ b/drivers/usb/serial/sierra.c
-@@ -1016,7 +1016,7 @@ static int sierra_suspend(struct usb_ser
- struct sierra_intf_private *intfdata;
- int b;
-
-- if (message.event & PM_EVENT_AUTO) {
-+ if (PMSG_IS_AUTO(message)) {
- intfdata = serial->private;
- spin_lock_irq(&intfdata->susp_lock);
- b = intfdata->in_flight;
---- a/drivers/usb/serial/usb_wwan.c
-+++ b/drivers/usb/serial/usb_wwan.c
-@@ -651,7 +651,7 @@ int usb_wwan_suspend(struct usb_serial *
-
- dbg("%s entered", __func__);
-
-- if (message.event & PM_EVENT_AUTO) {
-+ if (PMSG_IS_AUTO(message)) {
- spin_lock_irq(&intfdata->susp_lock);
- b = intfdata->in_flight;
- spin_unlock_irq(&intfdata->susp_lock);
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -366,6 +366,8 @@ extern struct dev_pm_ops generic_subsys_
- #define PMSG_AUTO_RESUME ((struct pm_message) \
- { .event = PM_EVENT_AUTO_RESUME, })
-
-+#define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0)
-+
- /**
- * Device run-time power management status.
- *
---- a/sound/usb/card.c
-+++ b/sound/usb/card.c
-@@ -631,7 +631,7 @@ static int usb_audio_suspend(struct usb_
- if (chip == (void *)-1L)
- return 0;
-
-- if (!(message.event & PM_EVENT_AUTO)) {
-+ if (!PMSG_IS_AUTO(message)) {
- snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot);
- if (!chip->num_suspended_intf++) {
- list_for_each(p, &chip->pcm_list) {
diff --git a/patches.runtime_pm/0042-PM-Use-spinlock-instead-of-mutex-in-clock-management.patch b/patches.runtime_pm/0042-PM-Use-spinlock-instead-of-mutex-in-clock-management.patch
deleted file mode 100644
index 59ba9e0d13b353..00000000000000
--- a/patches.runtime_pm/0042-PM-Use-spinlock-instead-of-mutex-in-clock-management.patch
+++ /dev/null
@@ -1,197 +0,0 @@
-From 778ffe3bbf743f14d2d43e28f38f8f38a3e0106f Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 24 Aug 2011 21:40:56 +0200
-Subject: PM: Use spinlock instead of mutex in clock management functions
-
-The lock member of struct pm_clk_data is of type struct mutex,
-which is a problem, because the suspend and resume routines
-defined in drivers/base/power/clock_ops.c cannot be executed
-with interrupts disabled for this reason. Modify
-struct pm_clk_data so that its lock member is a spinlock.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit b7ab83edba2d50583bc9520431618489379718b2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 40 ++++++++++++++++++++++------------------
- 1 file changed, 22 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index a846b2f..2c18d58 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -19,7 +19,7 @@
-
- struct pm_clk_data {
- struct list_head clock_list;
-- struct mutex lock;
-+ spinlock_t lock;
- };
-
- enum pce_status {
-@@ -73,9 +73,9 @@ int pm_clk_add(struct device *dev, const char *con_id)
- }
- }
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irq(&pcd->lock);
- list_add_tail(&ce->node, &pcd->clock_list);
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irq(&pcd->lock);
- return 0;
- }
-
-@@ -83,8 +83,8 @@ int pm_clk_add(struct device *dev, const char *con_id)
- * __pm_clk_remove - Destroy PM clock entry.
- * @ce: PM clock entry to destroy.
- *
-- * This routine must be called under the mutex protecting the PM list of clocks
-- * corresponding the the @ce's device.
-+ * This routine must be called under the spinlock protecting the PM list of
-+ * clocks corresponding the the @ce's device.
- */
- static void __pm_clk_remove(struct pm_clock_entry *ce)
- {
-@@ -123,7 +123,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
- if (!pcd)
- return;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irq(&pcd->lock);
-
- list_for_each_entry(ce, &pcd->clock_list, node) {
- if (!con_id && !ce->con_id) {
-@@ -137,7 +137,7 @@ void pm_clk_remove(struct device *dev, const char *con_id)
- }
- }
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irq(&pcd->lock);
- }
-
- /**
-@@ -158,7 +158,7 @@ int pm_clk_init(struct device *dev)
- }
-
- INIT_LIST_HEAD(&pcd->clock_list);
-- mutex_init(&pcd->lock);
-+ spin_lock_init(&pcd->lock);
- dev->power.subsys_data = pcd;
- return 0;
- }
-@@ -181,12 +181,12 @@ void pm_clk_destroy(struct device *dev)
-
- dev->power.subsys_data = NULL;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irq(&pcd->lock);
-
- list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node)
- __pm_clk_remove(ce);
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irq(&pcd->lock);
-
- kfree(pcd);
- }
-@@ -220,13 +220,14 @@ int pm_clk_suspend(struct device *dev)
- {
- struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-+ unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- if (!pcd)
- return 0;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irqsave(&pcd->lock, flags);
-
- list_for_each_entry_reverse(ce, &pcd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
-@@ -238,7 +239,7 @@ int pm_clk_suspend(struct device *dev)
- }
- }
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irqrestore(&pcd->lock, flags);
-
- return 0;
- }
-@@ -251,13 +252,14 @@ int pm_clk_resume(struct device *dev)
- {
- struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-+ unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- if (!pcd)
- return 0;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irqsave(&pcd->lock, flags);
-
- list_for_each_entry(ce, &pcd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
-@@ -269,7 +271,7 @@ int pm_clk_resume(struct device *dev)
- }
- }
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irqrestore(&pcd->lock, flags);
-
- return 0;
- }
-@@ -344,6 +346,7 @@ int pm_clk_suspend(struct device *dev)
- {
- struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-+ unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -351,12 +354,12 @@ int pm_clk_suspend(struct device *dev)
- if (!pcd || !dev->driver)
- return 0;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irqsave(&pcd->lock, flags);
-
- list_for_each_entry_reverse(ce, &pcd->clock_list, node)
- clk_disable(ce->clk);
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irqrestore(&pcd->lock, flags);
-
- return 0;
- }
-@@ -369,6 +372,7 @@ int pm_clk_resume(struct device *dev)
- {
- struct pm_clk_data *pcd = __to_pcd(dev);
- struct pm_clock_entry *ce;
-+ unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -376,12 +380,12 @@ int pm_clk_resume(struct device *dev)
- if (!pcd || !dev->driver)
- return 0;
-
-- mutex_lock(&pcd->lock);
-+ spin_lock_irqsave(&pcd->lock, flags);
-
- list_for_each_entry(ce, &pcd->clock_list, node)
- clk_enable(ce->clk);
-
-- mutex_unlock(&pcd->lock);
-+ spin_unlock_irqrestore(&pcd->lock, flags);
-
- return 0;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0043-PM-Runtime-Correct-documentation-of-pm_runtime_irq_s.patch b/patches.runtime_pm/0043-PM-Runtime-Correct-documentation-of-pm_runtime_irq_s.patch
deleted file mode 100644
index 83c9e89d37a040..00000000000000
--- a/patches.runtime_pm/0043-PM-Runtime-Correct-documentation-of-pm_runtime_irq_s.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 69f50eb4b26a6c7d2c267c14a73939399db3bfd3 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 25 Aug 2011 15:31:05 +0200
-Subject: PM / Runtime: Correct documentation of pm_runtime_irq_safe()
-
-The description of pm_runtime_irq_safe() has to be updated to follow
-the code after commit 02b2677 (PM / Runtime: Allow _put_sync() from
-interrupts-disabled context).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit 64584eb9cde5f3c5a07f24b2e7cd38f1157be181)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 62f37bc..08d70e4 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -431,8 +431,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
-
- void pm_runtime_irq_safe(struct device *dev);
- - set the power.irq_safe flag for the device, causing the runtime-PM
-- suspend and resume callbacks (but not the idle callback) to be invoked
-- with interrupts disabled
-+ callbacks to be invoked with interrupts off
-
- void pm_runtime_mark_last_busy(struct device *dev);
- - set the power.last_busy field to the current time
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0044-PM-Domains-Implement-subdomain-counters-as-atomic-fi.patch b/patches.runtime_pm/0044-PM-Domains-Implement-subdomain-counters-as-atomic-fi.patch
deleted file mode 100644
index 9bcb426daeece8..00000000000000
--- a/patches.runtime_pm/0044-PM-Domains-Implement-subdomain-counters-as-atomic-fi.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 1a657a8b091e233efe124c46878b85e760895442 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:04 +0200
-Subject: PM / Domains: Implement subdomain counters as atomic fields
-
-Currently, pm_genpd_poweron() and pm_genpd_poweroff() need to take
-the parent PM domain's lock in order to modify the parent's counter
-of active subdomains in a nonracy way. This causes the locking to be
-considerably complex and in fact is not necessary, because the
-subdomain counters may be implemented as atomic fields and they
-won't have to be modified under a lock.
-
-Replace the unsigned in sd_count field in struct generic_pm_domain
-by an atomic_t one and modify the code in drivers/base/power/domain.c
-to take this change into account.
-
-This patch doesn't change the locking yet, that is going to be done
-in a separate subsequent patch.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c4bb3160c8823d3a1e581d7e05fb8b343097e7c8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 30 ++++++++++++++++++++----------
- include/linux/pm_domain.h | 2 +-
- 2 files changed, 21 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 1c37457..20e2b52 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -29,10 +29,20 @@ static struct generic_pm_domain *dev_to_genpd(struct device *dev)
- return pd_to_genpd(dev->pm_domain);
- }
-
--static void genpd_sd_counter_dec(struct generic_pm_domain *genpd)
-+static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- {
-- if (!WARN_ON(genpd->sd_count == 0))
-- genpd->sd_count--;
-+ bool ret = false;
-+
-+ if (!WARN_ON(atomic_read(&genpd->sd_count) == 0))
-+ ret = !!atomic_dec_and_test(&genpd->sd_count);
-+
-+ return ret;
-+}
-+
-+static void genpd_sd_counter_inc(struct generic_pm_domain *genpd)
-+{
-+ atomic_inc(&genpd->sd_count);
-+ smp_mb__after_atomic_inc();
- }
-
- static void genpd_acquire_lock(struct generic_pm_domain *genpd)
-@@ -118,7 +128,7 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
-
- genpd_set_active(genpd);
- if (parent)
-- parent->sd_count++;
-+ genpd_sd_counter_inc(parent);
-
- out:
- mutex_unlock(&genpd->lock);
-@@ -254,7 +264,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- || genpd->resume_count > 0)
- return 0;
-
-- if (genpd->sd_count > 0)
-+ if (atomic_read(&genpd->sd_count) > 0)
- return -EBUSY;
-
- not_suspended = 0;
-@@ -325,8 +335,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd->status = GPD_STATE_POWER_OFF;
-
- if (parent) {
-- genpd_sd_counter_dec(parent);
-- if (parent->sd_count == 0)
-+ if (genpd_sd_counter_dec(parent))
- genpd_queue_power_off_work(parent);
-
- genpd_release_lock(parent);
-@@ -506,7 +515,8 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- if (genpd->status == GPD_STATE_POWER_OFF)
- return;
-
-- if (genpd->suspended_count != genpd->device_count || genpd->sd_count > 0)
-+ if (genpd->suspended_count != genpd->device_count
-+ || atomic_read(&genpd->sd_count) > 0)
- return;
-
- if (genpd->power_off)
-@@ -1167,7 +1177,7 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- list_add_tail(&new_subdomain->sd_node, &genpd->sd_list);
- new_subdomain->parent = genpd;
- if (subdomain->status != GPD_STATE_POWER_OFF)
-- genpd->sd_count++;
-+ genpd_sd_counter_inc(genpd);
-
- out:
- mutex_unlock(&new_subdomain->lock);
-@@ -1242,7 +1252,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->gov = gov;
- INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
- genpd->in_progress = 0;
-- genpd->sd_count = 0;
-+ atomic_set(&genpd->sd_count, 0);
- genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
- init_waitqueue_head(&genpd->status_wait_queue);
- genpd->poweroff_task = NULL;
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index f9ec173..81c5782 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -33,7 +33,7 @@ struct generic_pm_domain {
- struct dev_power_governor *gov;
- struct work_struct power_off_work;
- unsigned int in_progress; /* Number of devices being suspended now */
-- unsigned int sd_count; /* Number of subdomains with power "on" */
-+ atomic_t sd_count; /* Number of subdomains with power "on" */
- enum gpd_status status; /* Current state of the domain */
- wait_queue_head_t status_wait_queue;
- struct task_struct *poweroff_task; /* Powering off task */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0045-PM-Domains-Do-not-take-parent-locks-to-modify-subdom.patch b/patches.runtime_pm/0045-PM-Domains-Do-not-take-parent-locks-to-modify-subdom.patch
deleted file mode 100644
index 60e0b1e1d3260c..00000000000000
--- a/patches.runtime_pm/0045-PM-Domains-Do-not-take-parent-locks-to-modify-subdom.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From 66926d50341a303bfaa8135cda00ec2fe0fa68a9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:14 +0200
-Subject: PM / Domains: Do not take parent locks to modify subdomain counters
-
-After the subdomain counter in struct generic_pm_domain has been
-changed into an atomic_t field, it is possible to modify
-pm_genpd_poweron() and pm_genpd_poweroff() so that they don't take
-the parents locks. This requires pm_genpd_poweron() to increment
-the parent's subdomain counter before calling itself recursively
-for the parent and to decrement it if an error is to be returned.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 3c07cbc488bfd1ad1abf64d09cc692339b5f8a83)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 70 +++++++++++++++++++------------------------
- 1 file changed, 31 insertions(+), 39 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 20e2b52..ef25b6f 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -93,12 +93,7 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- int ret = 0;
-
- start:
-- if (parent) {
-- genpd_acquire_lock(parent);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
-- } else {
-- mutex_lock(&genpd->lock);
-- }
-+ mutex_lock(&genpd->lock);
-
- if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
-@@ -109,31 +104,33 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- goto out;
- }
-
-- if (parent && parent->status != GPD_STATE_ACTIVE) {
-+ if (parent) {
-+ genpd_sd_counter_inc(parent);
-+
- mutex_unlock(&genpd->lock);
-- genpd_release_lock(parent);
-
- ret = pm_genpd_poweron(parent);
-- if (ret)
-+ if (ret) {
-+ genpd_sd_counter_dec(parent);
- return ret;
-+ }
-
-+ parent = NULL;
- goto start;
- }
-
-- if (genpd->power_on) {
-+ if (genpd->power_on)
- ret = genpd->power_on(genpd);
-- if (ret)
-- goto out;
-- }
-
-- genpd_set_active(genpd);
-- if (parent)
-- genpd_sd_counter_inc(parent);
-+ if (ret) {
-+ if (genpd->parent)
-+ genpd_sd_counter_dec(genpd->parent);
-+ } else {
-+ genpd_set_active(genpd);
-+ }
-
- out:
- mutex_unlock(&genpd->lock);
-- if (parent)
-- genpd_release_lock(parent);
-
- return ret;
- }
-@@ -293,7 +290,8 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd->poweroff_task = current;
-
- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
-- ret = __pm_genpd_save_device(dle, genpd);
-+ ret = atomic_read(&genpd->sd_count) == 0 ?
-+ __pm_genpd_save_device(dle, genpd) : -EBUSY;
- if (ret) {
- genpd_set_active(genpd);
- goto out;
-@@ -308,38 +306,32 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
- }
-
-- parent = genpd->parent;
-- if (parent) {
-- mutex_unlock(&genpd->lock);
--
-- genpd_acquire_lock(parent);
-- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
--
-- if (genpd_abort_poweroff(genpd)) {
-- genpd_release_lock(parent);
-+ if (genpd->power_off) {
-+ if (atomic_read(&genpd->sd_count) > 0) {
-+ ret = -EBUSY;
- goto out;
- }
-- }
-
-- if (genpd->power_off) {
-+ /*
-+ * If sd_count > 0 at this point, one of the children hasn't
-+ * managed to call pm_genpd_poweron() for the parent yet after
-+ * incrementing it. In that case pm_genpd_poweron() will wait
-+ * for us to drop the lock, so we can call .power_off() and let
-+ * the pm_genpd_poweron() restore power for us (this shouldn't
-+ * happen very often).
-+ */
- ret = genpd->power_off(genpd);
- if (ret == -EBUSY) {
- genpd_set_active(genpd);
-- if (parent)
-- genpd_release_lock(parent);
--
- goto out;
- }
- }
-
- genpd->status = GPD_STATE_POWER_OFF;
-
-- if (parent) {
-- if (genpd_sd_counter_dec(parent))
-- genpd_queue_power_off_work(parent);
--
-- genpd_release_lock(parent);
-- }
-+ parent = genpd->parent;
-+ if (parent && genpd_sd_counter_dec(parent))
-+ genpd_queue_power_off_work(parent);
-
- out:
- genpd->poweroff_task = NULL;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0046-PM-Domains-Make-pm_genpd_poweron-always-survive-pare.patch b/patches.runtime_pm/0046-PM-Domains-Make-pm_genpd_poweron-always-survive-pare.patch
deleted file mode 100644
index 51d7d404bbbc2f..00000000000000
--- a/patches.runtime_pm/0046-PM-Domains-Make-pm_genpd_poweron-always-survive-pare.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From f334d73383ca5539e6401bb3b696b036533471bd Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:22 +0200
-Subject: PM / Domains: Make pm_genpd_poweron() always survive parent removal
-
-If pm_genpd_remove_subdomain() is called to remove a PM domain's
-subdomain and pm_genpd_poweron() is called for that subdomain at
-the same time, and the pm_genpd_poweron() called by it recursively
-for the parent returns an error, the first pm_genpd_poweron()'s
-error code path will attempt to decrement the subdomain counter of
-a PM domain that it's not a subdomain of any more.
-
-Rearrange the code in pm_genpd_poweron() to prevent this from
-happening.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9e08cf429697090d0fac57d493dc7b6de17a5eee)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 33 ++++++++++++++++++++-------------
- 1 file changed, 20 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index ef25b6f..dc423a9 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -89,12 +89,14 @@ static void genpd_set_active(struct generic_pm_domain *genpd)
- */
- int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
-- struct generic_pm_domain *parent = genpd->parent;
-+ struct generic_pm_domain *parent;
- int ret = 0;
-
-- start:
- mutex_lock(&genpd->lock);
-
-+ parent = genpd->parent;
-+
-+ start:
- if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
- goto out;
-@@ -110,29 +112,34 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
- mutex_unlock(&genpd->lock);
-
- ret = pm_genpd_poweron(parent);
-- if (ret) {
-- genpd_sd_counter_dec(parent);
-- return ret;
-- }
-+
-+ mutex_lock(&genpd->lock);
-+
-+ if (ret)
-+ goto err;
-
- parent = NULL;
- goto start;
- }
-
-- if (genpd->power_on)
-+ if (genpd->power_on) {
- ret = genpd->power_on(genpd);
--
-- if (ret) {
-- if (genpd->parent)
-- genpd_sd_counter_dec(genpd->parent);
-- } else {
-- genpd_set_active(genpd);
-+ if (ret)
-+ goto err;
- }
-
-+ genpd_set_active(genpd);
-+
- out:
- mutex_unlock(&genpd->lock);
-
- return ret;
-+
-+ err:
-+ if (genpd->parent)
-+ genpd_sd_counter_dec(genpd->parent);
-+
-+ goto out;
- }
-
- #endif /* CONFIG_PM */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0047-PM-Domains-Add-wait-for-parent-status-for-generic-PM.patch b/patches.runtime_pm/0047-PM-Domains-Add-wait-for-parent-status-for-generic-PM.patch
deleted file mode 100644
index e428a1861e814f..00000000000000
--- a/patches.runtime_pm/0047-PM-Domains-Add-wait-for-parent-status-for-generic-PM.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 1388315fb6ce95ee5229a8d2f5e7355415205ba7 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:29 +0200
-Subject: PM / Domains: Add "wait for parent" status for generic PM domains
-
-The next patch will make it possible for a generic PM domain to have
-multiple parents (i.e. multiple PM domains it depends on). To
-prepare for that change it is necessary to change pm_genpd_poweron()
-so that it doesn't jump to the start label after running itself
-recursively for the parent domain. For this purpose, introduce a new
-PM domain status value GPD_STATE_WAIT_PARENT that will be set by
-pm_genpd_poweron() before calling itself recursively for the parent
-domain and modify the code in drivers/base/power/domain.c so that
-the GPD_STATE_WAIT_PARENT status is guaranteed to be preserved during
-the execution of pm_genpd_poweron() for the parent.
-
-This change also causes pm_genpd_add_subdomain() and
-pm_genpd_remove_subdomain() to wait for started pm_genpd_poweron() to
-complete and allows pm_genpd_runtime_resume() to avoid dropping the
-lock after powering on the PM domain.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 3f241775c30365c33a0d2f6d40f4cf12470f48c6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 90 ++++++++++++++++++++++++++++---------------
- include/linux/pm_domain.h | 1 +
- 2 files changed, 61 insertions(+), 30 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index dc423a9..1f4b132 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -81,45 +81,59 @@ static void genpd_set_active(struct generic_pm_domain *genpd)
- }
-
- /**
-- * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * __pm_genpd_poweron - Restore power to a given PM domain and its parents.
- * @genpd: PM domain to power up.
- *
- * Restore power to @genpd and all of its parents so that it is possible to
- * resume a device belonging to it.
- */
--int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+int __pm_genpd_poweron(struct generic_pm_domain *genpd)
-+ __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-- struct generic_pm_domain *parent;
-+ DEFINE_WAIT(wait);
- int ret = 0;
-
-- mutex_lock(&genpd->lock);
-+ /* If the domain's parent is being waited for, we have to wait too. */
-+ for (;;) {
-+ prepare_to_wait(&genpd->status_wait_queue, &wait,
-+ TASK_UNINTERRUPTIBLE);
-+ if (genpd->status != GPD_STATE_WAIT_PARENT)
-+ break;
-+ mutex_unlock(&genpd->lock);
-
-- parent = genpd->parent;
-+ schedule();
-+
-+ mutex_lock(&genpd->lock);
-+ }
-+ finish_wait(&genpd->status_wait_queue, &wait);
-
-- start:
- if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
-- goto out;
-+ return 0;
-
- if (genpd->status != GPD_STATE_POWER_OFF) {
- genpd_set_active(genpd);
-- goto out;
-+ return 0;
- }
-
-- if (parent) {
-- genpd_sd_counter_inc(parent);
-+ if (genpd->parent) {
-+ genpd_sd_counter_inc(genpd->parent);
-+ genpd->status = GPD_STATE_WAIT_PARENT;
-
- mutex_unlock(&genpd->lock);
-
-- ret = pm_genpd_poweron(parent);
-+ ret = pm_genpd_poweron(genpd->parent);
-
- mutex_lock(&genpd->lock);
-
-+ /*
-+ * The "wait for parent" status is guaranteed not to change
-+ * while the parent is powering on.
-+ */
-+ genpd->status = GPD_STATE_POWER_OFF;
-+ wake_up_all(&genpd->status_wait_queue);
- if (ret)
- goto err;
--
-- parent = NULL;
-- goto start;
- }
-
- if (genpd->power_on) {
-@@ -130,16 +144,27 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
-
- genpd_set_active(genpd);
-
-- out:
-- mutex_unlock(&genpd->lock);
--
-- return ret;
-+ return 0;
-
- err:
- if (genpd->parent)
- genpd_sd_counter_dec(genpd->parent);
-
-- goto out;
-+ return ret;
-+}
-+
-+/**
-+ * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * @genpd: PM domain to power up.
-+ */
-+int pm_genpd_poweron(struct generic_pm_domain *genpd)
-+{
-+ int ret;
-+
-+ mutex_lock(&genpd->lock);
-+ ret = __pm_genpd_poweron(genpd);
-+ mutex_unlock(&genpd->lock);
-+ return ret;
- }
-
- #endif /* CONFIG_PM */
-@@ -225,7 +250,8 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- */
- static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
- {
-- return genpd->status == GPD_STATE_ACTIVE || genpd->resume_count > 0;
-+ return genpd->status == GPD_STATE_WAIT_PARENT
-+ || genpd->status == GPD_STATE_ACTIVE || genpd->resume_count > 0;
- }
-
- /**
-@@ -261,11 +287,13 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- /*
- * Do not try to power off the domain in the following situations:
- * (1) The domain is already in the "power off" state.
-- * (2) System suspend is in progress.
-+ * (2) The domain is waiting for its parent to power up.
- * (3) One of the domain's devices is being resumed right now.
-+ * (4) System suspend is in progress.
- */
-- if (genpd->status == GPD_STATE_POWER_OFF || genpd->prepared_count > 0
-- || genpd->resume_count > 0)
-+ if (genpd->status == GPD_STATE_POWER_OFF
-+ || genpd->status == GPD_STATE_WAIT_PARENT
-+ || genpd->resume_count > 0 || genpd->prepared_count > 0)
- return 0;
-
- if (atomic_read(&genpd->sd_count) > 0)
-@@ -299,14 +327,15 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
- ret = atomic_read(&genpd->sd_count) == 0 ?
- __pm_genpd_save_device(dle, genpd) : -EBUSY;
-+
-+ if (genpd_abort_poweroff(genpd))
-+ goto out;
-+
- if (ret) {
- genpd_set_active(genpd);
- goto out;
- }
-
-- if (genpd_abort_poweroff(genpd))
-- goto out;
--
- if (genpd->status == GPD_STATE_REPEAT) {
- genpd->poweroff_task = NULL;
- goto start;
-@@ -432,11 +461,12 @@ static int pm_genpd_runtime_resume(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- ret = pm_genpd_poweron(genpd);
-- if (ret)
-- return ret;
--
- mutex_lock(&genpd->lock);
-+ ret = __pm_genpd_poweron(genpd);
-+ if (ret) {
-+ mutex_unlock(&genpd->lock);
-+ return ret;
-+ }
- genpd->status = GPD_STATE_BUSY;
- genpd->resume_count++;
- for (;;) {
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 81c5782..97e3f8e 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -13,6 +13,7 @@
-
- enum gpd_status {
- GPD_STATE_ACTIVE = 0, /* PM domain is active */
-+ GPD_STATE_WAIT_PARENT, /* PM domain's parent is being waited for */
- GPD_STATE_BUSY, /* Something is happening to the PM domain */
- GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
- GPD_STATE_POWER_OFF, /* PM domain is off */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0048-PM-Domains-Allow-generic-PM-domains-to-have-multiple.patch b/patches.runtime_pm/0048-PM-Domains-Allow-generic-PM-domains-to-have-multiple.patch
deleted file mode 100644
index f1bd96482bb683..00000000000000
--- a/patches.runtime_pm/0048-PM-Domains-Allow-generic-PM-domains-to-have-multiple.patch
+++ /dev/null
@@ -1,329 +0,0 @@
-From 1645042457f83c61cdc0c08a6e2e493d2bdb9f0c Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:40 +0200
-Subject: PM / Domains: Allow generic PM domains to have multiple masters
-
-Currently, for a given generic PM domain there may be only one parent
-domain (i.e. a PM domain it depends on). However, there is at least
-one real-life case in which there should be two parents (masters) for
-one PM domain (the A3RV domain on SH7372 turns out to depend on the
-A4LC domain and it depends on the A4R domain and the same time). For
-this reason, allow a PM domain to have multiple parents (masters) by
-introducing objects representing links between PM domains.
-
-The (logical) links between PM domains represent relationships in
-which one domain is a master (i.e. it is depended on) and another
-domain is a slave (i.e. it depends on the master) with the rule that
-the slave cannot be powered on if the master is not powered on and
-the master cannot be powered off if the slave is not powered off.
-Each struct generic_pm_domain object representing a PM domain has
-two lists of links, a list of links in which it is a master and
-a list of links in which it is a slave. The first of these lists
-replaces the list of subdomains and the second one is used in place
-of the parent pointer.
-
-Each link is represented by struct gpd_link object containing
-pointers to the master and the slave and two struct list_head
-members allowing it to hook into two lists (the master's list
-of "master" links and the slave's list of "slave" links). This
-allows the code to get to the link from each side (either from
-the master or from the slave) and follow it in each direction.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5063ce1571b73865cbdcd92db002e85809750c97)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 99 +++++++++++++++++++++++++------------------
- include/linux/pm_domain.h | 12 ++++--
- 2 files changed, 67 insertions(+), 44 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 1f4b132..8fc538d 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -81,19 +81,20 @@ static void genpd_set_active(struct generic_pm_domain *genpd)
- }
-
- /**
-- * __pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * __pm_genpd_poweron - Restore power to a given PM domain and its masters.
- * @genpd: PM domain to power up.
- *
-- * Restore power to @genpd and all of its parents so that it is possible to
-+ * Restore power to @genpd and all of its masters so that it is possible to
- * resume a device belonging to it.
- */
- int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-+ struct gpd_link *link;
- DEFINE_WAIT(wait);
- int ret = 0;
-
-- /* If the domain's parent is being waited for, we have to wait too. */
-+ /* If the domain's master is being waited for, we have to wait too. */
- for (;;) {
- prepare_to_wait(&genpd->status_wait_queue, &wait,
- TASK_UNINTERRUPTIBLE);
-@@ -116,24 +117,31 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- return 0;
- }
-
-- if (genpd->parent) {
-- genpd_sd_counter_inc(genpd->parent);
-+ /*
-+ * The list is guaranteed not to change while the loop below is being
-+ * executed, unless one of the masters' .power_on() callbacks fiddles
-+ * with it.
-+ */
-+ list_for_each_entry(link, &genpd->slave_links, slave_node) {
-+ genpd_sd_counter_inc(link->master);
- genpd->status = GPD_STATE_WAIT_PARENT;
-
- mutex_unlock(&genpd->lock);
-
-- ret = pm_genpd_poweron(genpd->parent);
-+ ret = pm_genpd_poweron(link->master);
-
- mutex_lock(&genpd->lock);
-
- /*
- * The "wait for parent" status is guaranteed not to change
-- * while the parent is powering on.
-+ * while the master is powering on.
- */
- genpd->status = GPD_STATE_POWER_OFF;
- wake_up_all(&genpd->status_wait_queue);
-- if (ret)
-+ if (ret) {
-+ genpd_sd_counter_dec(link->master);
- goto err;
-+ }
- }
-
- if (genpd->power_on) {
-@@ -147,14 +155,14 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- return 0;
-
- err:
-- if (genpd->parent)
-- genpd_sd_counter_dec(genpd->parent);
-+ list_for_each_entry_continue_reverse(link, &genpd->slave_links, slave_node)
-+ genpd_sd_counter_dec(link->master);
-
- return ret;
- }
-
- /**
-- * pm_genpd_poweron - Restore power to a given PM domain and its parents.
-+ * pm_genpd_poweron - Restore power to a given PM domain and its masters.
- * @genpd: PM domain to power up.
- */
- int pm_genpd_poweron(struct generic_pm_domain *genpd)
-@@ -278,8 +286,8 @@ void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
- static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-- struct generic_pm_domain *parent;
- struct dev_list_entry *dle;
-+ struct gpd_link *link;
- unsigned int not_suspended;
- int ret = 0;
-
-@@ -287,7 +295,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- /*
- * Do not try to power off the domain in the following situations:
- * (1) The domain is already in the "power off" state.
-- * (2) The domain is waiting for its parent to power up.
-+ * (2) The domain is waiting for its master to power up.
- * (3) One of the domain's devices is being resumed right now.
- * (4) System suspend is in progress.
- */
-@@ -349,8 +357,8 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
-
- /*
-- * If sd_count > 0 at this point, one of the children hasn't
-- * managed to call pm_genpd_poweron() for the parent yet after
-+ * If sd_count > 0 at this point, one of the subdomains hasn't
-+ * managed to call pm_genpd_poweron() for the master yet after
- * incrementing it. In that case pm_genpd_poweron() will wait
- * for us to drop the lock, so we can call .power_off() and let
- * the pm_genpd_poweron() restore power for us (this shouldn't
-@@ -365,9 +373,10 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
-
- genpd->status = GPD_STATE_POWER_OFF;
-
-- parent = genpd->parent;
-- if (parent && genpd_sd_counter_dec(parent))
-- genpd_queue_power_off_work(parent);
-+ list_for_each_entry(link, &genpd->slave_links, slave_node) {
-+ genpd_sd_counter_dec(link->master);
-+ genpd_queue_power_off_work(link->master);
-+ }
-
- out:
- genpd->poweroff_task = NULL;
-@@ -527,11 +536,11 @@ static inline void __pm_genpd_runtime_resume(struct device *dev,
- #ifdef CONFIG_PM_SLEEP
-
- /**
-- * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its parents.
-+ * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
- * @genpd: PM domain to power off, if possible.
- *
- * Check if the given PM domain can be powered off (during system suspend or
-- * hibernation) and do that if so. Also, in that case propagate to its parent.
-+ * hibernation) and do that if so. Also, in that case propagate to its masters.
- *
- * This function is only called in "noirq" stages of system power transitions,
- * so it need not acquire locks (all of the "noirq" callbacks are executed
-@@ -539,7 +548,7 @@ static inline void __pm_genpd_runtime_resume(struct device *dev,
- */
- static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- {
-- struct generic_pm_domain *parent = genpd->parent;
-+ struct gpd_link *link;
-
- if (genpd->status == GPD_STATE_POWER_OFF)
- return;
-@@ -552,9 +561,10 @@ static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
- genpd->power_off(genpd);
-
- genpd->status = GPD_STATE_POWER_OFF;
-- if (parent) {
-- genpd_sd_counter_dec(parent);
-- pm_genpd_sync_poweroff(parent);
-+
-+ list_for_each_entry(link, &genpd->slave_links, slave_node) {
-+ genpd_sd_counter_dec(link->master);
-+ pm_genpd_sync_poweroff(link->master);
- }
- }
-
-@@ -1173,7 +1183,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *new_subdomain)
- {
-- struct generic_pm_domain *subdomain;
-+ struct gpd_link *link;
- int ret = 0;
-
- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(new_subdomain))
-@@ -1196,16 +1206,23 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- goto out;
- }
-
-- list_for_each_entry(subdomain, &genpd->sd_list, sd_node) {
-- if (subdomain == new_subdomain) {
-+ list_for_each_entry(link, &genpd->slave_links, slave_node) {
-+ if (link->slave == new_subdomain && link->master == genpd) {
- ret = -EINVAL;
- goto out;
- }
- }
-
-- list_add_tail(&new_subdomain->sd_node, &genpd->sd_list);
-- new_subdomain->parent = genpd;
-- if (subdomain->status != GPD_STATE_POWER_OFF)
-+ link = kzalloc(sizeof(*link), GFP_KERNEL);
-+ if (!link) {
-+ ret = -ENOMEM;
-+ goto out;
-+ }
-+ link->master = genpd;
-+ list_add_tail(&link->master_node, &genpd->master_links);
-+ link->slave = new_subdomain;
-+ list_add_tail(&link->slave_node, &new_subdomain->slave_links);
-+ if (new_subdomain->status != GPD_STATE_POWER_OFF)
- genpd_sd_counter_inc(genpd);
-
- out:
-@@ -1218,22 +1235,22 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- /**
- * pm_genpd_remove_subdomain - Remove a subdomain from an I/O PM domain.
- * @genpd: Master PM domain to remove the subdomain from.
-- * @target: Subdomain to be removed.
-+ * @subdomain: Subdomain to be removed.
- */
- int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-- struct generic_pm_domain *target)
-+ struct generic_pm_domain *subdomain)
- {
-- struct generic_pm_domain *subdomain;
-+ struct gpd_link *link;
- int ret = -EINVAL;
-
-- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(target))
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
- return -EINVAL;
-
- start:
- genpd_acquire_lock(genpd);
-
-- list_for_each_entry(subdomain, &genpd->sd_list, sd_node) {
-- if (subdomain != target)
-+ list_for_each_entry(link, &genpd->master_links, master_node) {
-+ if (link->slave != subdomain)
- continue;
-
- mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
-@@ -1245,8 +1262,9 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- goto start;
- }
-
-- list_del(&subdomain->sd_node);
-- subdomain->parent = NULL;
-+ list_del(&link->master_node);
-+ list_del(&link->slave_node);
-+ kfree(link);
- if (subdomain->status != GPD_STATE_POWER_OFF)
- genpd_sd_counter_dec(genpd);
-
-@@ -1273,10 +1291,9 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- if (IS_ERR_OR_NULL(genpd))
- return;
-
-- INIT_LIST_HEAD(&genpd->sd_node);
-- genpd->parent = NULL;
-+ INIT_LIST_HEAD(&genpd->master_links);
-+ INIT_LIST_HEAD(&genpd->slave_links);
- INIT_LIST_HEAD(&genpd->dev_list);
-- INIT_LIST_HEAD(&genpd->sd_list);
- mutex_init(&genpd->lock);
- genpd->gov = gov;
- INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 97e3f8e..5f5154d 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -26,9 +26,8 @@ struct dev_power_governor {
- struct generic_pm_domain {
- struct dev_pm_domain domain; /* PM domain operations */
- struct list_head gpd_list_node; /* Node in the global PM domains list */
-- struct list_head sd_node; /* Node in the parent's subdomain list */
-- struct generic_pm_domain *parent; /* Parent PM domain */
-- struct list_head sd_list; /* List of dubdomains */
-+ struct list_head master_links; /* Links with PM domain as a master */
-+ struct list_head slave_links; /* Links with PM domain as a slave */
- struct list_head dev_list; /* List of devices */
- struct mutex lock;
- struct dev_power_governor *gov;
-@@ -55,6 +54,13 @@ static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
- return container_of(pd, struct generic_pm_domain, domain);
- }
-
-+struct gpd_link {
-+ struct generic_pm_domain *master;
-+ struct list_head master_node;
-+ struct generic_pm_domain *slave;
-+ struct list_head slave_node;
-+};
-+
- struct dev_list_entry {
- struct list_head node;
- struct device *dev;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0049-PM-Domains-Rename-GPD_STATE_WAIT_PARENT-to-GPD_STATE.patch b/patches.runtime_pm/0049-PM-Domains-Rename-GPD_STATE_WAIT_PARENT-to-GPD_STATE.patch
deleted file mode 100644
index 4b6f86bb9ed9e2..00000000000000
--- a/patches.runtime_pm/0049-PM-Domains-Rename-GPD_STATE_WAIT_PARENT-to-GPD_STATE.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 3aec31f6bf2c28a8f9ace3173a02b18bbc76e75e Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:50 +0200
-Subject: PM / Domains: Rename GPD_STATE_WAIT_PARENT to GPD_STATE_WAIT_MASTER
-
-Since it is now possible for a PM domain to have multiple masters
-instead of one parent, rename the "wait for parent" status to reflect
-the new situation.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 17877eb5a900f32bb5827a7b2109b6c9adff5fc3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 8 ++++----
- include/linux/pm_domain.h | 2 +-
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 8fc538d..c06f8f8 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -98,7 +98,7 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- for (;;) {
- prepare_to_wait(&genpd->status_wait_queue, &wait,
- TASK_UNINTERRUPTIBLE);
-- if (genpd->status != GPD_STATE_WAIT_PARENT)
-+ if (genpd->status != GPD_STATE_WAIT_MASTER)
- break;
- mutex_unlock(&genpd->lock);
-
-@@ -124,7 +124,7 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- */
- list_for_each_entry(link, &genpd->slave_links, slave_node) {
- genpd_sd_counter_inc(link->master);
-- genpd->status = GPD_STATE_WAIT_PARENT;
-+ genpd->status = GPD_STATE_WAIT_MASTER;
-
- mutex_unlock(&genpd->lock);
-
-@@ -258,7 +258,7 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
- */
- static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
- {
-- return genpd->status == GPD_STATE_WAIT_PARENT
-+ return genpd->status == GPD_STATE_WAIT_MASTER
- || genpd->status == GPD_STATE_ACTIVE || genpd->resume_count > 0;
- }
-
-@@ -300,7 +300,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- * (4) System suspend is in progress.
- */
- if (genpd->status == GPD_STATE_POWER_OFF
-- || genpd->status == GPD_STATE_WAIT_PARENT
-+ || genpd->status == GPD_STATE_WAIT_MASTER
- || genpd->resume_count > 0 || genpd->prepared_count > 0)
- return 0;
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 5f5154d..bf679f5 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -13,7 +13,7 @@
-
- enum gpd_status {
- GPD_STATE_ACTIVE = 0, /* PM domain is active */
-- GPD_STATE_WAIT_PARENT, /* PM domain's parent is being waited for */
-+ GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */
- GPD_STATE_BUSY, /* Something is happening to the PM domain */
- GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
- GPD_STATE_POWER_OFF, /* PM domain is off */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0050-PM-Domains-Rename-argument-of-pm_genpd_add_subdomain.patch b/patches.runtime_pm/0050-PM-Domains-Rename-argument-of-pm_genpd_add_subdomain.patch
deleted file mode 100644
index 94129d96dffdf1..00000000000000
--- a/patches.runtime_pm/0050-PM-Domains-Rename-argument-of-pm_genpd_add_subdomain.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 7cd4fbe5c104115c16e8fdac190827e8eef704b1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 8 Aug 2011 23:43:59 +0200
-Subject: PM / Domains: Rename argument of pm_genpd_add_subdomain()
-
-Change the name of the second argument of pm_genpd_add_subdomain()
-so that it is (a) shorter and (b) in agreement with the name of
-the second argument of pm_genpd_add_subdomain().
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit bc0403ff16e5305c3a14c2b0826616ceaabbf058)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 26 +++++++++++++-------------
- 1 file changed, 13 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index c06f8f8..1fc6cc9 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -1178,36 +1178,36 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- /**
- * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
- * @genpd: Master PM domain to add the subdomain to.
-- * @new_subdomain: Subdomain to be added.
-+ * @subdomain: Subdomain to be added.
- */
- int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
-- struct generic_pm_domain *new_subdomain)
-+ struct generic_pm_domain *subdomain)
- {
- struct gpd_link *link;
- int ret = 0;
-
-- if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(new_subdomain))
-+ if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
- return -EINVAL;
-
- start:
- genpd_acquire_lock(genpd);
-- mutex_lock_nested(&new_subdomain->lock, SINGLE_DEPTH_NESTING);
-+ mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
-
-- if (new_subdomain->status != GPD_STATE_POWER_OFF
-- && new_subdomain->status != GPD_STATE_ACTIVE) {
-- mutex_unlock(&new_subdomain->lock);
-+ if (subdomain->status != GPD_STATE_POWER_OFF
-+ && subdomain->status != GPD_STATE_ACTIVE) {
-+ mutex_unlock(&subdomain->lock);
- genpd_release_lock(genpd);
- goto start;
- }
-
- if (genpd->status == GPD_STATE_POWER_OFF
-- && new_subdomain->status != GPD_STATE_POWER_OFF) {
-+ && subdomain->status != GPD_STATE_POWER_OFF) {
- ret = -EINVAL;
- goto out;
- }
-
- list_for_each_entry(link, &genpd->slave_links, slave_node) {
-- if (link->slave == new_subdomain && link->master == genpd) {
-+ if (link->slave == subdomain && link->master == genpd) {
- ret = -EINVAL;
- goto out;
- }
-@@ -1220,13 +1220,13 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- }
- link->master = genpd;
- list_add_tail(&link->master_node, &genpd->master_links);
-- link->slave = new_subdomain;
-- list_add_tail(&link->slave_node, &new_subdomain->slave_links);
-- if (new_subdomain->status != GPD_STATE_POWER_OFF)
-+ link->slave = subdomain;
-+ list_add_tail(&link->slave_node, &subdomain->slave_links);
-+ if (subdomain->status != GPD_STATE_POWER_OFF)
- genpd_sd_counter_inc(genpd);
-
- out:
-- mutex_unlock(&new_subdomain->lock);
-+ mutex_unlock(&subdomain->lock);
- genpd_release_lock(genpd);
-
- return ret;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0051-PM-Introduce-struct-pm_subsys_data.patch b/patches.runtime_pm/0051-PM-Introduce-struct-pm_subsys_data.patch
deleted file mode 100644
index c1ac2c9f6923fd..00000000000000
--- a/patches.runtime_pm/0051-PM-Introduce-struct-pm_subsys_data.patch
+++ /dev/null
@@ -1,391 +0,0 @@
-From 308693a5a7a06e1c48d67441c0fc0f9a9e8538c8 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 25 Aug 2011 15:33:50 +0200
-Subject: PM: Introduce struct pm_subsys_data
-
-Introduce struct pm_subsys_data that may be subclassed by subsystems
-to store subsystem-specific information related to the device. Move
-the clock management fields accessed through the power.subsys_data
-pointer in struct device to the new strucutre.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5c095a0e0d600d5a5a4207eaadabd18db46395ce)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 122 +++++++++++++++++++++-------------------
- include/linux/device.h | 5 ++
- include/linux/pm.h | 9 ++-
- include/linux/pm_runtime.h | 8 ++-
- 4 files changed, 83 insertions(+), 61 deletions(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index 2c18d58..b7f1db4 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -17,11 +17,6 @@
-
- #ifdef CONFIG_PM
-
--struct pm_clk_data {
-- struct list_head clock_list;
-- spinlock_t lock;
--};
--
- enum pce_status {
- PCE_STATUS_NONE = 0,
- PCE_STATUS_ACQUIRED,
-@@ -36,11 +31,6 @@ struct pm_clock_entry {
- enum pce_status status;
- };
-
--static struct pm_clk_data *__to_pcd(struct device *dev)
--{
-- return dev ? dev->power.subsys_data : NULL;
--}
--
- /**
- * pm_clk_add - Start using a device clock for power management.
- * @dev: Device whose clock is going to be used for power management.
-@@ -51,10 +41,10 @@ static struct pm_clk_data *__to_pcd(struct device *dev)
- */
- int pm_clk_add(struct device *dev, const char *con_id)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
-
-- if (!pcd)
-+ if (!psd)
- return -EINVAL;
-
- ce = kzalloc(sizeof(*ce), GFP_KERNEL);
-@@ -73,9 +63,9 @@ int pm_clk_add(struct device *dev, const char *con_id)
- }
- }
-
-- spin_lock_irq(&pcd->lock);
-- list_add_tail(&ce->node, &pcd->clock_list);
-- spin_unlock_irq(&pcd->lock);
-+ spin_lock_irq(&psd->lock);
-+ list_add_tail(&ce->node, &psd->clock_list);
-+ spin_unlock_irq(&psd->lock);
- return 0;
- }
-
-@@ -117,15 +107,15 @@ static void __pm_clk_remove(struct pm_clock_entry *ce)
- */
- void pm_clk_remove(struct device *dev, const char *con_id)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
-
-- if (!pcd)
-+ if (!psd)
- return;
-
-- spin_lock_irq(&pcd->lock);
-+ spin_lock_irq(&psd->lock);
-
-- list_for_each_entry(ce, &pcd->clock_list, node) {
-+ list_for_each_entry(ce, &psd->clock_list, node) {
- if (!con_id && !ce->con_id) {
- __pm_clk_remove(ce);
- break;
-@@ -137,29 +127,45 @@ void pm_clk_remove(struct device *dev, const char *con_id)
- }
- }
-
-- spin_unlock_irq(&pcd->lock);
-+ spin_unlock_irq(&psd->lock);
- }
-
- /**
- * pm_clk_init - Initialize a device's list of power management clocks.
- * @dev: Device to initialize the list of PM clocks for.
- *
-- * Allocate a struct pm_clk_data object, initialize its lock member and
-- * make the @dev's power.subsys_data field point to it.
-+ * Initialize the lock and clock_list members of the device's pm_subsys_data
-+ * object.
- */
--int pm_clk_init(struct device *dev)
-+void pm_clk_init(struct device *dev)
- {
-- struct pm_clk_data *pcd;
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
-+
-+ if (!psd)
-+ return;
-
-- pcd = kzalloc(sizeof(*pcd), GFP_KERNEL);
-- if (!pcd) {
-+ INIT_LIST_HEAD(&psd->clock_list);
-+ spin_lock_init(&psd->lock);
-+}
-+
-+/**
-+ * pm_clk_create - Create and initialize a device's list of PM clocks.
-+ * @dev: Device to create and initialize the list of PM clocks for.
-+ *
-+ * Allocate a struct pm_subsys_data object, initialize its lock and clock_list
-+ * members and make the @dev's power.subsys_data field point to it.
-+ */
-+int pm_clk_create(struct device *dev)
-+{
-+ struct pm_subsys_data *psd;
-+
-+ psd = kzalloc(sizeof(*psd), GFP_KERNEL);
-+ if (!psd) {
- dev_err(dev, "Not enough memory for PM clock data.\n");
- return -ENOMEM;
- }
--
-- INIT_LIST_HEAD(&pcd->clock_list);
-- spin_lock_init(&pcd->lock);
-- dev->power.subsys_data = pcd;
-+ dev->power.subsys_data = psd;
-+ pm_clk_init(dev);
- return 0;
- }
-
-@@ -168,27 +174,27 @@ int pm_clk_init(struct device *dev)
- * @dev: Device to destroy the list of PM clocks for.
- *
- * Clear the @dev's power.subsys_data field, remove the list of clock entries
-- * from the struct pm_clk_data object pointed to by it before and free
-+ * from the struct pm_subsys_data object pointed to by it before and free
- * that object.
- */
- void pm_clk_destroy(struct device *dev)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce, *c;
-
-- if (!pcd)
-+ if (!psd)
- return;
-
- dev->power.subsys_data = NULL;
-
-- spin_lock_irq(&pcd->lock);
-+ spin_lock_irq(&psd->lock);
-
-- list_for_each_entry_safe_reverse(ce, c, &pcd->clock_list, node)
-+ list_for_each_entry_safe_reverse(ce, c, &psd->clock_list, node)
- __pm_clk_remove(ce);
-
-- spin_unlock_irq(&pcd->lock);
-+ spin_unlock_irq(&psd->lock);
-
-- kfree(pcd);
-+ kfree(psd);
- }
-
- #endif /* CONFIG_PM */
-@@ -218,18 +224,18 @@ static void pm_clk_acquire(struct device *dev,
- */
- int pm_clk_suspend(struct device *dev)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
- unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (!pcd)
-+ if (!psd)
- return 0;
-
-- spin_lock_irqsave(&pcd->lock, flags);
-+ spin_lock_irqsave(&psd->lock, flags);
-
-- list_for_each_entry_reverse(ce, &pcd->clock_list, node) {
-+ list_for_each_entry_reverse(ce, &psd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
- pm_clk_acquire(dev, ce);
-
-@@ -239,7 +245,7 @@ int pm_clk_suspend(struct device *dev)
- }
- }
-
-- spin_unlock_irqrestore(&pcd->lock, flags);
-+ spin_unlock_irqrestore(&psd->lock, flags);
-
- return 0;
- }
-@@ -250,18 +256,18 @@ int pm_clk_suspend(struct device *dev)
- */
- int pm_clk_resume(struct device *dev)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
- unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-- if (!pcd)
-+ if (!psd)
- return 0;
-
-- spin_lock_irqsave(&pcd->lock, flags);
-+ spin_lock_irqsave(&psd->lock, flags);
-
-- list_for_each_entry(ce, &pcd->clock_list, node) {
-+ list_for_each_entry(ce, &psd->clock_list, node) {
- if (ce->status == PCE_STATUS_NONE)
- pm_clk_acquire(dev, ce);
-
-@@ -271,7 +277,7 @@ int pm_clk_resume(struct device *dev)
- }
- }
-
-- spin_unlock_irqrestore(&pcd->lock, flags);
-+ spin_unlock_irqrestore(&psd->lock, flags);
-
- return 0;
- }
-@@ -309,7 +315,7 @@ static int pm_clk_notify(struct notifier_block *nb,
- if (dev->pm_domain)
- break;
-
-- error = pm_clk_init(dev);
-+ error = pm_clk_create(dev);
- if (error)
- break;
-
-@@ -344,22 +350,22 @@ static int pm_clk_notify(struct notifier_block *nb,
- */
- int pm_clk_suspend(struct device *dev)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
- unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- /* If there is no driver, the clocks are already disabled. */
-- if (!pcd || !dev->driver)
-+ if (!psd || !dev->driver)
- return 0;
-
-- spin_lock_irqsave(&pcd->lock, flags);
-+ spin_lock_irqsave(&psd->lock, flags);
-
-- list_for_each_entry_reverse(ce, &pcd->clock_list, node)
-+ list_for_each_entry_reverse(ce, &psd->clock_list, node)
- clk_disable(ce->clk);
-
-- spin_unlock_irqrestore(&pcd->lock, flags);
-+ spin_unlock_irqrestore(&psd->lock, flags);
-
- return 0;
- }
-@@ -370,22 +376,22 @@ int pm_clk_suspend(struct device *dev)
- */
- int pm_clk_resume(struct device *dev)
- {
-- struct pm_clk_data *pcd = __to_pcd(dev);
-+ struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
- unsigned long flags;
-
- dev_dbg(dev, "%s()\n", __func__);
-
- /* If there is no driver, the clocks should remain disabled. */
-- if (!pcd || !dev->driver)
-+ if (!psd || !dev->driver)
- return 0;
-
-- spin_lock_irqsave(&pcd->lock, flags);
-+ spin_lock_irqsave(&psd->lock, flags);
-
-- list_for_each_entry(ce, &pcd->clock_list, node)
-+ list_for_each_entry(ce, &psd->clock_list, node)
- clk_enable(ce->clk);
-
-- spin_unlock_irqrestore(&pcd->lock, flags);
-+ spin_unlock_irqrestore(&psd->lock, flags);
-
- return 0;
- }
-diff --git a/include/linux/device.h b/include/linux/device.h
-index ad8ecfd..4980cc0 100644
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -706,6 +706,11 @@ static inline void set_dev_node(struct device *dev, int node)
- }
- #endif
-
-+static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
-+{
-+ return dev ? dev->power.subsys_data : NULL;
-+}
-+
- static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
- {
- return dev->kobj.uevent_suppress;
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 18de9f8..1137f99 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -423,6 +423,13 @@ enum rpm_request {
-
- struct wakeup_source;
-
-+struct pm_subsys_data {
-+ spinlock_t lock;
-+#ifdef CONFIG_PM_CLK
-+ struct list_head clock_list;
-+#endif
-+};
-+
- struct dev_pm_info {
- pm_message_t power_state;
- unsigned int can_wakeup:1;
-@@ -464,7 +471,7 @@ struct dev_pm_info {
- unsigned long suspended_jiffies;
- unsigned long accounting_timestamp;
- #endif
-- void *subsys_data; /* Owned by the subsystem. */
-+ struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
- };
-
- extern void update_pm_runtime_accounting(struct device *dev);
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index daac05d..6b90630e 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -258,14 +258,18 @@ struct pm_clk_notifier_block {
- };
-
- #ifdef CONFIG_PM_CLK
--extern int pm_clk_init(struct device *dev);
-+extern void pm_clk_init(struct device *dev);
-+extern int pm_clk_create(struct device *dev);
- extern void pm_clk_destroy(struct device *dev);
- extern int pm_clk_add(struct device *dev, const char *con_id);
- extern void pm_clk_remove(struct device *dev, const char *con_id);
- extern int pm_clk_suspend(struct device *dev);
- extern int pm_clk_resume(struct device *dev);
- #else
--static inline int pm_clk_init(struct device *dev)
-+static inline void pm_clk_init(struct device *dev)
-+{
-+}
-+static inline int pm_clk_create(struct device *dev)
- {
- return -EINVAL;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0052-PM-Reference-counting-of-power.subsys_data.patch b/patches.runtime_pm/0052-PM-Reference-counting-of-power.subsys_data.patch
deleted file mode 100644
index 9d9bd5818b1608..00000000000000
--- a/patches.runtime_pm/0052-PM-Reference-counting-of-power.subsys_data.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From c62f2b207cc15ead1512b09207525defda8191d1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 25 Aug 2011 15:34:01 +0200
-Subject: PM: Reference counting of power.subsys_data
-
-Since the power.subsys_data device field will be used by multiple
-filesystems, introduce a reference counting mechanism for it to avoid
-freeing it prematurely or changing its value at a wrong time.
-
-Make the PM clocks management code that currently is the only user of
-power.subsys_data use the new reference counting.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit ef27bed1870dbd5fd363ff5ec51eebd5a695e277)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/Makefile | 2 +-
- drivers/base/power/clock_ops.c | 24 +++--------
- drivers/base/power/common.c | 87 ++++++++++++++++++++++++++++++++++++++++
- include/linux/pm.h | 3 ++
- 4 files changed, 96 insertions(+), 20 deletions(-)
- create mode 100644 drivers/base/power/common.c
-
-diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
-index 2639ae7..6488ce1 100644
---- a/drivers/base/power/Makefile
-+++ b/drivers/base/power/Makefile
-@@ -1,4 +1,4 @@
--obj-$(CONFIG_PM) += sysfs.o generic_ops.o
-+obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o
- obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
- obj-$(CONFIG_PM_RUNTIME) += runtime.o
- obj-$(CONFIG_PM_TRACE_RTC) += trace.o
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index b7f1db4..8383e24 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -140,12 +140,8 @@ void pm_clk_remove(struct device *dev, const char *con_id)
- void pm_clk_init(struct device *dev)
- {
- struct pm_subsys_data *psd = dev_to_psd(dev);
--
-- if (!psd)
-- return;
--
-- INIT_LIST_HEAD(&psd->clock_list);
-- spin_lock_init(&psd->lock);
-+ if (psd)
-+ INIT_LIST_HEAD(&psd->clock_list);
- }
-
- /**
-@@ -157,16 +153,8 @@ void pm_clk_init(struct device *dev)
- */
- int pm_clk_create(struct device *dev)
- {
-- struct pm_subsys_data *psd;
--
-- psd = kzalloc(sizeof(*psd), GFP_KERNEL);
-- if (!psd) {
-- dev_err(dev, "Not enough memory for PM clock data.\n");
-- return -ENOMEM;
-- }
-- dev->power.subsys_data = psd;
-- pm_clk_init(dev);
-- return 0;
-+ int ret = dev_pm_get_subsys_data(dev);
-+ return ret < 0 ? ret : 0;
- }
-
- /**
-@@ -185,8 +173,6 @@ void pm_clk_destroy(struct device *dev)
- if (!psd)
- return;
-
-- dev->power.subsys_data = NULL;
--
- spin_lock_irq(&psd->lock);
-
- list_for_each_entry_safe_reverse(ce, c, &psd->clock_list, node)
-@@ -194,7 +180,7 @@ void pm_clk_destroy(struct device *dev)
-
- spin_unlock_irq(&psd->lock);
-
-- kfree(psd);
-+ dev_pm_put_subsys_data(dev);
- }
-
- #endif /* CONFIG_PM */
-diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
-new file mode 100644
-index 0000000..d398cf0
---- /dev/null
-+++ b/drivers/base/power/common.c
-@@ -0,0 +1,87 @@
-+/*
-+ * drivers/base/power/common.c - Common device power management code.
-+ *
-+ * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
-+ *
-+ * This file is released under the GPLv2.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/slab.h>
-+#include <linux/device.h>
-+#include <linux/pm_runtime.h>
-+
-+/**
-+ * dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
-+ * @dev: Device to handle.
-+ *
-+ * If power.subsys_data is NULL, point it to a new object, otherwise increment
-+ * its reference counter. Return 1 if a new object has been created, otherwise
-+ * return 0 or error code.
-+ */
-+int dev_pm_get_subsys_data(struct device *dev)
-+{
-+ struct pm_subsys_data *psd;
-+ int ret = 0;
-+
-+ psd = kzalloc(sizeof(*psd), GFP_KERNEL);
-+ if (!psd)
-+ return -ENOMEM;
-+
-+ spin_lock_irq(&dev->power.lock);
-+
-+ if (dev->power.subsys_data) {
-+ dev->power.subsys_data->refcount++;
-+ } else {
-+ spin_lock_init(&psd->lock);
-+ psd->refcount = 1;
-+ dev->power.subsys_data = psd;
-+ pm_clk_init(dev);
-+ psd = NULL;
-+ ret = 1;
-+ }
-+
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ /* kfree() verifies that its argument is nonzero. */
-+ kfree(psd);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
-+
-+/**
-+ * dev_pm_put_subsys_data - Drop reference to power.subsys_data.
-+ * @dev: Device to handle.
-+ *
-+ * If the reference counter of power.subsys_data is zero after dropping the
-+ * reference, power.subsys_data is removed. Return 1 if that happens or 0
-+ * otherwise.
-+ */
-+int dev_pm_put_subsys_data(struct device *dev)
-+{
-+ struct pm_subsys_data *psd;
-+ int ret = 0;
-+
-+ spin_lock_irq(&dev->power.lock);
-+
-+ psd = dev_to_psd(dev);
-+ if (!psd) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+
-+ if (--psd->refcount == 0) {
-+ dev->power.subsys_data = NULL;
-+ kfree(psd);
-+ ret = 1;
-+ }
-+
-+ out:
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 1137f99..5b9b36f 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -425,6 +425,7 @@ struct wakeup_source;
-
- struct pm_subsys_data {
- spinlock_t lock;
-+ unsigned int refcount;
- #ifdef CONFIG_PM_CLK
- struct list_head clock_list;
- #endif
-@@ -475,6 +476,8 @@ struct dev_pm_info {
- };
-
- extern void update_pm_runtime_accounting(struct device *dev);
-+extern int dev_pm_get_subsys_data(struct device *dev);
-+extern int dev_pm_put_subsys_data(struct device *dev);
-
- /*
- * Power domains provide callbacks that are executed during system suspend,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0053-PM-Domains-Use-power.sybsys_data-to-reduce-overhead.patch b/patches.runtime_pm/0053-PM-Domains-Use-power.sybsys_data-to-reduce-overhead.patch
deleted file mode 100644
index 5304cf976a568e..00000000000000
--- a/patches.runtime_pm/0053-PM-Domains-Use-power.sybsys_data-to-reduce-overhead.patch
+++ /dev/null
@@ -1,519 +0,0 @@
-From 7f53f19b45ca9ad725dac3799f7b79312e8a1936 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 25 Aug 2011 15:34:12 +0200
-Subject: PM / Domains: Use power.sybsys_data to reduce overhead
-
-Currently pm_genpd_runtime_resume() has to walk the list of devices
-from the device's PM domain to find the corresponding device list
-object containing the need_restore field to check if the driver's
-.runtime_resume() callback should be executed for the device.
-This is suboptimal and can be simplified by using power.sybsys_data
-to store device information used by the generic PM domains code.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4605ab653c1f9d7cc2dda8033de215c9cee325f4)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
- arch/arm/mach-shmobile/pm_runtime.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-omap1/pm_bus.c | 1 +
- arch/arm/mach-shmobile/board-ap4evb.c | 1 +
- arch/arm/mach-shmobile/board-mackerel.c | 2 +-
- arch/arm/mach-shmobile/pm-sh7372.c | 1 +
- arch/arm/mach-shmobile/pm_runtime.c | 1 +
- drivers/base/power/clock_ops.c | 2 +-
- drivers/base/power/common.c | 3 +-
- drivers/base/power/domain.c | 87 +++++++++++--------------------
- include/linux/pm.h | 9 ++++
- include/linux/pm_clock.h | 71 +++++++++++++++++++++++++
- include/linux/pm_domain.h | 6 ---
- include/linux/pm_runtime.h | 46 ----------------
- 12 files changed, 117 insertions(+), 113 deletions(-)
- create mode 100644 include/linux/pm_clock.h
-
-diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
-index 943072d..7868e75 100644
---- a/arch/arm/mach-omap1/pm_bus.c
-+++ b/arch/arm/mach-omap1/pm_bus.c
-@@ -13,6 +13,7 @@
- #include <linux/kernel.h>
- #include <linux/io.h>
- #include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
- #include <linux/platform_device.h>
- #include <linux/mutex.h>
- #include <linux/clk.h>
-diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
-index 629b0f4..3cbf5bf 100644
---- a/arch/arm/mach-shmobile/board-ap4evb.c
-+++ b/arch/arm/mach-shmobile/board-ap4evb.c
-@@ -42,6 +42,7 @@
- #include <linux/leds.h>
- #include <linux/input/sh_keysc.h>
- #include <linux/usb/r8a66597.h>
-+#include <linux/pm_clock.h>
-
- #include <media/sh_mobile_ceu.h>
- #include <media/sh_mobile_csi2.h>
-diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
-index 6d4bc29..70eca5a 100644
---- a/arch/arm/mach-shmobile/board-mackerel.c
-+++ b/arch/arm/mach-shmobile/board-mackerel.c
-@@ -39,7 +39,7 @@
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/physmap.h>
--#include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
- #include <linux/smsc911x.h>
- #include <linux/sh_intc.h>
- #include <linux/tca6416_keypad.h>
-diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
-index b516069..3019ce9 100644
---- a/arch/arm/mach-shmobile/pm-sh7372.c
-+++ b/arch/arm/mach-shmobile/pm-sh7372.c
-@@ -15,6 +15,7 @@
- #include <linux/list.h>
- #include <linux/err.h>
- #include <linux/slab.h>
-+#include <linux/pm_clock.h>
- #include <asm/system.h>
- #include <asm/io.h>
- #include <asm/tlbflush.h>
-diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
-index 2bcde1c..27ddf43 100644
---- a/arch/arm/mach-shmobile/pm_runtime.c
-+++ b/arch/arm/mach-shmobile/pm_runtime.c
-@@ -14,6 +14,7 @@
- #include <linux/kernel.h>
- #include <linux/io.h>
- #include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
- #include <linux/platform_device.h>
- #include <linux/clk.h>
- #include <linux/sh_clk.h>
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index 8383e24..cb44b58 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -10,7 +10,7 @@
- #include <linux/kernel.h>
- #include <linux/io.h>
- #include <linux/pm.h>
--#include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
- #include <linux/clk.h>
- #include <linux/slab.h>
- #include <linux/err.h>
-diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
-index d398cf0..29820c3 100644
---- a/drivers/base/power/common.c
-+++ b/drivers/base/power/common.c
-@@ -10,8 +10,7 @@
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/slab.h>
--#include <linux/device.h>
--#include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
-
- /**
- * dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 1fc6cc9..339eb2d 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -181,18 +181,18 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
-
- /**
- * __pm_genpd_save_device - Save the pre-suspend state of a device.
-- * @dle: Device list entry of the device to save the state of.
-+ * @pdd: Domain data of the device to save the state of.
- * @genpd: PM domain the device belongs to.
- */
--static int __pm_genpd_save_device(struct dev_list_entry *dle,
-+static int __pm_genpd_save_device(struct pm_domain_data *pdd,
- struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-- struct device *dev = dle->dev;
-+ struct device *dev = pdd->dev;
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
-- if (dle->need_restore)
-+ if (pdd->need_restore)
- return 0;
-
- mutex_unlock(&genpd->lock);
-@@ -210,24 +210,24 @@ static int __pm_genpd_save_device(struct dev_list_entry *dle,
- mutex_lock(&genpd->lock);
-
- if (!ret)
-- dle->need_restore = true;
-+ pdd->need_restore = true;
-
- return ret;
- }
-
- /**
- * __pm_genpd_restore_device - Restore the pre-suspend state of a device.
-- * @dle: Device list entry of the device to restore the state of.
-+ * @pdd: Domain data of the device to restore the state of.
- * @genpd: PM domain the device belongs to.
- */
--static void __pm_genpd_restore_device(struct dev_list_entry *dle,
-+static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
- struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-- struct device *dev = dle->dev;
-+ struct device *dev = pdd->dev;
- struct device_driver *drv = dev->driver;
-
-- if (!dle->need_restore)
-+ if (!pdd->need_restore)
- return;
-
- mutex_unlock(&genpd->lock);
-@@ -244,7 +244,7 @@ static void __pm_genpd_restore_device(struct dev_list_entry *dle,
-
- mutex_lock(&genpd->lock);
-
-- dle->need_restore = false;
-+ pdd->need_restore = false;
- }
-
- /**
-@@ -286,7 +286,7 @@ void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
- static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-- struct dev_list_entry *dle;
-+ struct pm_domain_data *pdd;
- struct gpd_link *link;
- unsigned int not_suspended;
- int ret = 0;
-@@ -308,8 +308,8 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- return -EBUSY;
-
- not_suspended = 0;
-- list_for_each_entry(dle, &genpd->dev_list, node)
-- if (dle->dev->driver && !pm_runtime_suspended(dle->dev))
-+ list_for_each_entry(pdd, &genpd->dev_list, list_node)
-+ if (pdd->dev->driver && !pm_runtime_suspended(pdd->dev))
- not_suspended++;
-
- if (not_suspended > genpd->in_progress)
-@@ -332,9 +332,9 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd->status = GPD_STATE_BUSY;
- genpd->poweroff_task = current;
-
-- list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
-+ list_for_each_entry_reverse(pdd, &genpd->dev_list, list_node) {
- ret = atomic_read(&genpd->sd_count) == 0 ?
-- __pm_genpd_save_device(dle, genpd) : -EBUSY;
-+ __pm_genpd_save_device(pdd, genpd) : -EBUSY;
-
- if (genpd_abort_poweroff(genpd))
- goto out;
-@@ -433,24 +433,6 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- }
-
- /**
-- * __pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
-- * @dev: Device to resume.
-- * @genpd: PM domain the device belongs to.
-- */
--static void __pm_genpd_runtime_resume(struct device *dev,
-- struct generic_pm_domain *genpd)
--{
-- struct dev_list_entry *dle;
--
-- list_for_each_entry(dle, &genpd->dev_list, node) {
-- if (dle->dev == dev) {
-- __pm_genpd_restore_device(dle, genpd);
-- break;
-- }
-- }
--}
--
--/**
- * pm_genpd_runtime_resume - Resume a device belonging to I/O PM domain.
- * @dev: Device to resume.
- *
-@@ -495,7 +477,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
- mutex_lock(&genpd->lock);
- }
- finish_wait(&genpd->status_wait_queue, &wait);
-- __pm_genpd_runtime_resume(dev, genpd);
-+ __pm_genpd_restore_device(&dev->power.subsys_data->domain_data, genpd);
- genpd->resume_count--;
- genpd_set_active(genpd);
- wake_up_all(&genpd->status_wait_queue);
-@@ -525,8 +507,6 @@ void pm_genpd_poweroff_unused(void)
- #else
-
- static inline void genpd_power_off_work_fn(struct work_struct *work) {}
--static inline void __pm_genpd_runtime_resume(struct device *dev,
-- struct generic_pm_domain *genpd) {}
-
- #define pm_genpd_runtime_suspend NULL
- #define pm_genpd_runtime_resume NULL
-@@ -1083,7 +1063,7 @@ static void pm_genpd_complete(struct device *dev)
- */
- int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- {
-- struct dev_list_entry *dle;
-+ struct pm_domain_data *pdd;
- int ret = 0;
-
- dev_dbg(dev, "%s()\n", __func__);
-@@ -1103,26 +1083,20 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- goto out;
- }
-
-- list_for_each_entry(dle, &genpd->dev_list, node)
-- if (dle->dev == dev) {
-+ list_for_each_entry(pdd, &genpd->dev_list, list_node)
-+ if (pdd->dev == dev) {
- ret = -EINVAL;
- goto out;
- }
-
-- dle = kzalloc(sizeof(*dle), GFP_KERNEL);
-- if (!dle) {
-- ret = -ENOMEM;
-- goto out;
-- }
--
-- dle->dev = dev;
-- dle->need_restore = false;
-- list_add_tail(&dle->node, &genpd->dev_list);
- genpd->device_count++;
-
-- spin_lock_irq(&dev->power.lock);
- dev->pm_domain = &genpd->domain;
-- spin_unlock_irq(&dev->power.lock);
-+ dev_pm_get_subsys_data(dev);
-+ pdd = &dev->power.subsys_data->domain_data;
-+ pdd->dev = dev;
-+ pdd->need_restore = false;
-+ list_add_tail(&pdd->list_node, &genpd->dev_list);
-
- out:
- genpd_release_lock(genpd);
-@@ -1138,7 +1112,7 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- struct device *dev)
- {
-- struct dev_list_entry *dle;
-+ struct pm_domain_data *pdd;
- int ret = -EINVAL;
-
- dev_dbg(dev, "%s()\n", __func__);
-@@ -1153,17 +1127,16 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- goto out;
- }
-
-- list_for_each_entry(dle, &genpd->dev_list, node) {
-- if (dle->dev != dev)
-+ list_for_each_entry(pdd, &genpd->dev_list, list_node) {
-+ if (pdd->dev != dev)
- continue;
-
-- spin_lock_irq(&dev->power.lock);
-+ list_del_init(&pdd->list_node);
-+ pdd->dev = NULL;
-+ dev_pm_put_subsys_data(dev);
- dev->pm_domain = NULL;
-- spin_unlock_irq(&dev->power.lock);
-
- genpd->device_count--;
-- list_del(&dle->node);
-- kfree(dle);
-
- ret = 0;
- break;
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 5b9b36f..b17b6aa 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -423,12 +423,21 @@ enum rpm_request {
-
- struct wakeup_source;
-
-+struct pm_domain_data {
-+ struct list_head list_node;
-+ struct device *dev;
-+ bool need_restore;
-+};
-+
- struct pm_subsys_data {
- spinlock_t lock;
- unsigned int refcount;
- #ifdef CONFIG_PM_CLK
- struct list_head clock_list;
- #endif
-+#ifdef CONFIG_PM_GENERIC_DOMAINS
-+ struct pm_domain_data domain_data;
-+#endif
- };
-
- struct dev_pm_info {
-diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
-new file mode 100644
-index 0000000..8348866
---- /dev/null
-+++ b/include/linux/pm_clock.h
-@@ -0,0 +1,71 @@
-+/*
-+ * pm_clock.h - Definitions and headers related to device clocks.
-+ *
-+ * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
-+ *
-+ * This file is released under the GPLv2.
-+ */
-+
-+#ifndef _LINUX_PM_CLOCK_H
-+#define _LINUX_PM_CLOCK_H
-+
-+#include <linux/device.h>
-+#include <linux/notifier.h>
-+
-+struct pm_clk_notifier_block {
-+ struct notifier_block nb;
-+ struct dev_pm_domain *pm_domain;
-+ char *con_ids[];
-+};
-+
-+#ifdef CONFIG_PM_CLK
-+static inline bool pm_clk_no_clocks(struct device *dev)
-+{
-+ return dev && dev->power.subsys_data
-+ && list_empty(&dev->power.subsys_data->clock_list);
-+}
-+
-+extern void pm_clk_init(struct device *dev);
-+extern int pm_clk_create(struct device *dev);
-+extern void pm_clk_destroy(struct device *dev);
-+extern int pm_clk_add(struct device *dev, const char *con_id);
-+extern void pm_clk_remove(struct device *dev, const char *con_id);
-+extern int pm_clk_suspend(struct device *dev);
-+extern int pm_clk_resume(struct device *dev);
-+#else
-+static inline bool pm_clk_no_clocks(struct device *dev)
-+{
-+ return true;
-+}
-+static inline void pm_clk_init(struct device *dev)
-+{
-+}
-+static inline int pm_clk_create(struct device *dev)
-+{
-+ return -EINVAL;
-+}
-+static inline void pm_clk_destroy(struct device *dev)
-+{
-+}
-+static inline int pm_clk_add(struct device *dev, const char *con_id)
-+{
-+ return -EINVAL;
-+}
-+static inline void pm_clk_remove(struct device *dev, const char *con_id)
-+{
-+}
-+#define pm_clk_suspend NULL
-+#define pm_clk_resume NULL
-+#endif
-+
-+#ifdef CONFIG_HAVE_CLK
-+extern void pm_clk_add_notifier(struct bus_type *bus,
-+ struct pm_clk_notifier_block *clknb);
-+#else
-+static inline void pm_clk_add_notifier(struct bus_type *bus,
-+ struct pm_clk_notifier_block *clknb)
-+{
-+}
-+#endif
-+
-+#endif
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index bf679f5..5cce46c 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -61,12 +61,6 @@ struct gpd_link {
- struct list_head slave_node;
- };
-
--struct dev_list_entry {
-- struct list_head node;
-- struct device *dev;
-- bool need_restore;
--};
--
- #ifdef CONFIG_PM_GENERIC_DOMAINS
- extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev);
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 6b90630e..70b2840 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -251,50 +251,4 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
- __pm_runtime_use_autosuspend(dev, false);
- }
-
--struct pm_clk_notifier_block {
-- struct notifier_block nb;
-- struct dev_pm_domain *pm_domain;
-- char *con_ids[];
--};
--
--#ifdef CONFIG_PM_CLK
--extern void pm_clk_init(struct device *dev);
--extern int pm_clk_create(struct device *dev);
--extern void pm_clk_destroy(struct device *dev);
--extern int pm_clk_add(struct device *dev, const char *con_id);
--extern void pm_clk_remove(struct device *dev, const char *con_id);
--extern int pm_clk_suspend(struct device *dev);
--extern int pm_clk_resume(struct device *dev);
--#else
--static inline void pm_clk_init(struct device *dev)
--{
--}
--static inline int pm_clk_create(struct device *dev)
--{
-- return -EINVAL;
--}
--static inline void pm_clk_destroy(struct device *dev)
--{
--}
--static inline int pm_clk_add(struct device *dev, const char *con_id)
--{
-- return -EINVAL;
--}
--static inline void pm_clk_remove(struct device *dev, const char *con_id)
--{
--}
--#define pm_clk_suspend NULL
--#define pm_clk_resume NULL
--#endif
--
--#ifdef CONFIG_HAVE_CLK
--extern void pm_clk_add_notifier(struct bus_type *bus,
-- struct pm_clk_notifier_block *clknb);
--#else
--static inline void pm_clk_add_notifier(struct bus_type *bus,
-- struct pm_clk_notifier_block *clknb)
--{
--}
--#endif
--
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0054-PM-QoS-Move-and-rename-the-implementation-files.patch b/patches.runtime_pm/0054-PM-QoS-Move-and-rename-the-implementation-files.patch
deleted file mode 100644
index f5ab8d7dae2722..00000000000000
--- a/patches.runtime_pm/0054-PM-QoS-Move-and-rename-the-implementation-files.patch
+++ /dev/null
@@ -1,326 +0,0 @@
-From b9626fca3ad6cba770dbb85333e71d92b802f321 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:03 +0200
-Subject: PM QoS: Move and rename the implementation files
-
-The PM QoS implementation files are better named
-kernel/power/qos.c and include/linux/pm_qos.h.
-
-The PM QoS support is compiled under the CONFIG_PM option.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Acked-by: markgross <markgross@thegnar.org>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e8db0be1245de16a6cc6365506abc392c3c212d4)
-
-Conflicts:
-
- kernel/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-msm/clock.c | 2 +-
- drivers/acpi/processor_idle.c | 2 +-
- drivers/cpuidle/cpuidle.c | 2 +-
- drivers/cpuidle/governors/ladder.c | 2 +-
- drivers/cpuidle/governors/menu.c | 2 +-
- drivers/media/video/via-camera.c | 2 +-
- drivers/net/e1000e/netdev.c | 2 +-
- drivers/net/wireless/ipw2x00/ipw2100.c | 2 +-
- include/linux/netdevice.h | 2 +-
- include/linux/{pm_qos_params.h => pm_qos.h} | 31 +++++++++++++++++++++++----
- include/sound/pcm.h | 2 +-
- kernel/Makefile | 2 +-
- kernel/power/Makefile | 2 +-
- kernel/{pm_qos_params.c => power/qos.c} | 2 +-
- net/mac80211/main.c | 2 +-
- net/mac80211/mlme.c | 2 +-
- net/mac80211/scan.c | 2 +-
- sound/core/pcm_native.c | 2 +-
- 18 files changed, 44 insertions(+), 21 deletions(-)
- rename include/linux/{pm_qos_params.h => pm_qos.h} (53%)
- rename kernel/{pm_qos_params.c => power/qos.c} (99%)
-
-diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
-index 22a5376..d9145df 100644
---- a/arch/arm/mach-msm/clock.c
-+++ b/arch/arm/mach-msm/clock.c
-@@ -18,7 +18,7 @@
- #include <linux/list.h>
- #include <linux/err.h>
- #include <linux/spinlock.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/mutex.h>
- #include <linux/clk.h>
- #include <linux/string.h>
-diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 431ab11..2e69e09 100644
---- a/drivers/acpi/processor_idle.c
-+++ b/drivers/acpi/processor_idle.c
-@@ -37,7 +37,7 @@
- #include <linux/dmi.h>
- #include <linux/moduleparam.h>
- #include <linux/sched.h> /* need_resched() */
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/clockchips.h>
- #include <linux/cpuidle.h>
- #include <linux/irqflags.h>
-diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index bf50924..eed4c47 100644
---- a/drivers/cpuidle/cpuidle.c
-+++ b/drivers/cpuidle/cpuidle.c
-@@ -12,7 +12,7 @@
- #include <linux/mutex.h>
- #include <linux/sched.h>
- #include <linux/notifier.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/cpu.h>
- #include <linux/cpuidle.h>
- #include <linux/ktime.h>
-diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
-index 12c9890..f62fde2 100644
---- a/drivers/cpuidle/governors/ladder.c
-+++ b/drivers/cpuidle/governors/ladder.c
-@@ -14,7 +14,7 @@
-
- #include <linux/kernel.h>
- #include <linux/cpuidle.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/moduleparam.h>
- #include <linux/jiffies.h>
-
-diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
-index c47f3d0..3600f19 100644
---- a/drivers/cpuidle/governors/menu.c
-+++ b/drivers/cpuidle/governors/menu.c
-@@ -12,7 +12,7 @@
-
- #include <linux/kernel.h>
- #include <linux/cpuidle.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/time.h>
- #include <linux/ktime.h>
- #include <linux/hrtimer.h>
-diff --git a/drivers/media/video/via-camera.c b/drivers/media/video/via-camera.c
-index 85d3048..b3ca389 100644
---- a/drivers/media/video/via-camera.c
-+++ b/drivers/media/video/via-camera.c
-@@ -21,7 +21,7 @@
- #include <media/videobuf-dma-sg.h>
- #include <linux/delay.h>
- #include <linux/dma-mapping.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/via-core.h>
- #include <linux/via-gpio.h>
- #include <linux/via_i2c.h>
-diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
-index 5430a9a..4e60214 100644
---- a/drivers/net/e1000e/netdev.c
-+++ b/drivers/net/e1000e/netdev.c
-@@ -46,7 +46,7 @@
- #include <linux/if_vlan.h>
- #include <linux/cpu.h>
- #include <linux/smp.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/pm_runtime.h>
- #include <linux/aer.h>
- #include <linux/prefetch.h>
-diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
-index 4430775..d9df575 100644
---- a/drivers/net/wireless/ipw2x00/ipw2100.c
-+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
-@@ -161,7 +161,7 @@ that only one external action is invoked at a time.
- #include <linux/firmware.h>
- #include <linux/acpi.h>
- #include <linux/ctype.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
-
- #include <net/lib80211.h>
-
-diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 33b5968..6155893 100644
---- a/include/linux/netdevice.h
-+++ b/include/linux/netdevice.h
-@@ -31,7 +31,7 @@
- #include <linux/if_link.h>
-
- #ifdef __KERNEL__
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/timer.h>
- #include <linux/delay.h>
- #include <linux/mm.h>
-diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos.h
-similarity index 53%
-rename from include/linux/pm_qos_params.h
-rename to include/linux/pm_qos.h
-index a7d87f9..7ba67541 100644
---- a/include/linux/pm_qos_params.h
-+++ b/include/linux/pm_qos.h
-@@ -1,5 +1,5 @@
--#ifndef _LINUX_PM_QOS_PARAMS_H
--#define _LINUX_PM_QOS_PARAMS_H
-+#ifndef _LINUX_PM_QOS_H
-+#define _LINUX_PM_QOS_H
- /* interface for the pm_qos_power infrastructure of the linux kernel.
- *
- * Mark Gross <mgross@linux.intel.com>
-@@ -25,14 +25,37 @@ struct pm_qos_request_list {
- int pm_qos_class;
- };
-
--void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
-+#ifdef CONFIG_PM
-+void pm_qos_add_request(struct pm_qos_request_list *l,
-+ int pm_qos_class, s32 value);
- void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
-- s32 new_value);
-+ s32 new_value);
- void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
-
- int pm_qos_request(int pm_qos_class);
- int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request_list *req);
-+#else
-+static inline void pm_qos_add_request(struct pm_qos_request_list *l,
-+ int pm_qos_class, s32 value)
-+ { return; }
-+static inline void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
-+ s32 new_value)
-+ { return; }
-+static inline void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req)
-+ { return; }
-+
-+static inline int pm_qos_request(int pm_qos_class)
-+ { return 0; }
-+static inline int pm_qos_add_notifier(int pm_qos_class,
-+ struct notifier_block *notifier)
-+ { return 0; }
-+static inline int pm_qos_remove_notifier(int pm_qos_class,
-+ struct notifier_block *notifier)
-+ { return 0; }
-+static inline int pm_qos_request_active(struct pm_qos_request_list *req)
-+ { return 0; }
-+#endif
-
- #endif
-diff --git a/include/sound/pcm.h b/include/sound/pcm.h
-index e1bad11..1204f17 100644
---- a/include/sound/pcm.h
-+++ b/include/sound/pcm.h
-@@ -29,7 +29,7 @@
- #include <linux/poll.h>
- #include <linux/mm.h>
- #include <linux/bitops.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
-
- #define snd_pcm_substream_chip(substream) ((substream)->private_data)
- #define snd_pcm_chip(pcm) ((pcm)->private_data)
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 2d64cfc..c4547c7 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -9,7 +9,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
- rcupdate.o extable.o params.o posix-timers.o \
- kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
- hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
-- notifier.o ksysfs.o pm_qos_params.o sched_clock.o cred.o \
-+ notifier.o ksysfs.o sched_clock.o cred.o \
- async.o range.o jump_label.o
- obj-y += groups.o
-
-diff --git a/kernel/power/Makefile b/kernel/power/Makefile
-index c5ebc6a..ad6bdd8 100644
---- a/kernel/power/Makefile
-+++ b/kernel/power/Makefile
-@@ -1,7 +1,7 @@
-
- ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG
-
--obj-$(CONFIG_PM) += main.o
-+obj-$(CONFIG_PM) += main.o qos.o
- obj-$(CONFIG_PM_SLEEP) += console.o
- obj-$(CONFIG_FREEZER) += process.o
- obj-$(CONFIG_SUSPEND) += suspend.o
-diff --git a/kernel/pm_qos_params.c b/kernel/power/qos.c
-similarity index 99%
-rename from kernel/pm_qos_params.c
-rename to kernel/power/qos.c
-index 6824ca7..3bf69f1 100644
---- a/kernel/pm_qos_params.c
-+++ b/kernel/power/qos.c
-@@ -29,7 +29,7 @@
-
- /*#define DEBUG*/
-
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/sched.h>
- #include <linux/spinlock.h>
- #include <linux/slab.h>
-diff --git a/net/mac80211/main.c b/net/mac80211/main.c
-index 1e36fb3..e9f776a 100644
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -19,7 +19,7 @@
- #include <linux/if_arp.h>
- #include <linux/rtnetlink.h>
- #include <linux/bitmap.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/inetdevice.h>
- #include <net/net_namespace.h>
- #include <net/cfg80211.h>
-diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 1563250..31e8694 100644
---- a/net/mac80211/mlme.c
-+++ b/net/mac80211/mlme.c
-@@ -17,7 +17,7 @@
- #include <linux/if_arp.h>
- #include <linux/etherdevice.h>
- #include <linux/rtnetlink.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/crc32.h>
- #include <linux/slab.h>
- #include <net/mac80211.h>
-diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
-index 669d2e3..37e6837 100644
---- a/net/mac80211/scan.c
-+++ b/net/mac80211/scan.c
-@@ -14,7 +14,7 @@
-
- #include <linux/if_arp.h>
- #include <linux/rtnetlink.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <net/sch_generic.h>
- #include <linux/slab.h>
- #include <net/mac80211.h>
-diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
-index 1c6be91..c74e228 100644
---- a/sound/core/pcm_native.c
-+++ b/sound/core/pcm_native.c
-@@ -23,7 +23,7 @@
- #include <linux/file.h>
- #include <linux/slab.h>
- #include <linux/time.h>
--#include <linux/pm_qos_params.h>
-+#include <linux/pm_qos.h>
- #include <linux/uio.h>
- #include <linux/dma-mapping.h>
- #include <sound/core.h>
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0055-plist-Remove-the-need-to-supply-locks-to-plist-heads.patch b/patches.runtime_pm/0055-plist-Remove-the-need-to-supply-locks-to-plist-heads.patch
deleted file mode 100644
index 8ea194ba5e30de..00000000000000
--- a/patches.runtime_pm/0055-plist-Remove-the-need-to-supply-locks-to-plist-heads.patch
+++ /dev/null
@@ -1,246 +0,0 @@
-From ba0bdfe2987f9ffda40f93706c10cb37b03e2688 Mon Sep 17 00:00:00 2001
-From: Dima Zavin <dima@android.com>
-Date: Thu, 7 Jul 2011 17:27:59 -0700
-Subject: plist: Remove the need to supply locks to plist heads
-
-This was legacy code brought over from the RT tree and
-is no longer necessary.
-
-Signed-off-by: Dima Zavin <dima@android.com>
-Acked-by: Thomas Gleixner <tglx@linutronix.de>
-Cc: Daniel Walker <dwalker@codeaurora.org>
-Cc: Steven Rostedt <rostedt@goodmis.org>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Andi Kleen <andi@firstfloor.org>
-Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
-Link: http://lkml.kernel.org/r/1310084879-10351-2-git-send-email-dima@android.com
-Signed-off-by: Ingo Molnar <mingo@elte.hu>
-(cherry picked from commit 732375c6a5a4cc825b676c922d547aba96b8ce15)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/plist.h | 55 ++----------------------------------------------
- include/linux/rtmutex.h | 4 +--
- kernel/fork.c | 2 -
- kernel/futex.c | 2 -
- kernel/power/qos.c | 6 ++---
- kernel/rtmutex.c | 2 -
- kernel/sched.c | 4 +--
- lib/plist.c | 7 ------
- 8 files changed, 14 insertions(+), 68 deletions(-)
-
---- a/include/linux/plist.h
-+++ b/include/linux/plist.h
-@@ -77,14 +77,9 @@
-
- #include <linux/kernel.h>
- #include <linux/list.h>
--#include <linux/spinlock_types.h>
-
- struct plist_head {
- struct list_head node_list;
--#ifdef CONFIG_DEBUG_PI_LIST
-- raw_spinlock_t *rawlock;
-- spinlock_t *spinlock;
--#endif
- };
-
- struct plist_node {
-@@ -93,37 +88,13 @@ struct plist_node {
- struct list_head node_list;
- };
-
--#ifdef CONFIG_DEBUG_PI_LIST
--# define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock
--# define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock
--#else
--# define PLIST_HEAD_LOCK_INIT(_lock)
--# define PLIST_HEAD_LOCK_INIT_RAW(_lock)
--#endif
--
--#define _PLIST_HEAD_INIT(head) \
-- .node_list = LIST_HEAD_INIT((head).node_list)
--
- /**
- * PLIST_HEAD_INIT - static struct plist_head initializer
- * @head: struct plist_head variable name
-- * @_lock: lock to initialize for this list
-- */
--#define PLIST_HEAD_INIT(head, _lock) \
--{ \
-- _PLIST_HEAD_INIT(head), \
-- PLIST_HEAD_LOCK_INIT(&(_lock)) \
--}
--
--/**
-- * PLIST_HEAD_INIT_RAW - static struct plist_head initializer
-- * @head: struct plist_head variable name
-- * @_lock: lock to initialize for this list
- */
--#define PLIST_HEAD_INIT_RAW(head, _lock) \
-+#define PLIST_HEAD_INIT(head) \
- { \
-- _PLIST_HEAD_INIT(head), \
-- PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \
-+ .node_list = LIST_HEAD_INIT((head).node_list) \
- }
-
- /**
-@@ -141,31 +112,11 @@ struct plist_node {
- /**
- * plist_head_init - dynamic struct plist_head initializer
- * @head: &struct plist_head pointer
-- * @lock: spinlock protecting the list (debugging)
-- */
--static inline void
--plist_head_init(struct plist_head *head, spinlock_t *lock)
--{
-- INIT_LIST_HEAD(&head->node_list);
--#ifdef CONFIG_DEBUG_PI_LIST
-- head->spinlock = lock;
-- head->rawlock = NULL;
--#endif
--}
--
--/**
-- * plist_head_init_raw - dynamic struct plist_head initializer
-- * @head: &struct plist_head pointer
-- * @lock: raw_spinlock protecting the list (debugging)
- */
- static inline void
--plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock)
-+plist_head_init(struct plist_head *head)
- {
- INIT_LIST_HEAD(&head->node_list);
--#ifdef CONFIG_DEBUG_PI_LIST
-- head->rawlock = lock;
-- head->spinlock = NULL;
--#endif
- }
-
- /**
---- a/include/linux/rtmutex.h
-+++ b/include/linux/rtmutex.h
-@@ -66,7 +66,7 @@ struct hrtimer_sleeper;
-
- #define __RT_MUTEX_INITIALIZER(mutexname) \
- { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
-- , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \
-+ , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \
- , .owner = NULL \
- __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
-
-@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mu
-
- #ifdef CONFIG_RT_MUTEXES
- # define INIT_RT_MUTEXES(tsk) \
-- .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \
-+ .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \
- INIT_RT_MUTEX_DEBUG(tsk)
- #else
- # define INIT_RT_MUTEXES(tsk)
---- a/kernel/fork.c
-+++ b/kernel/fork.c
-@@ -1017,7 +1017,7 @@ static void rt_mutex_init_task(struct ta
- {
- raw_spin_lock_init(&p->pi_lock);
- #ifdef CONFIG_RT_MUTEXES
-- plist_head_init_raw(&p->pi_waiters, &p->pi_lock);
-+ plist_head_init(&p->pi_waiters);
- p->pi_blocked_on = NULL;
- #endif
- }
---- a/kernel/futex.c
-+++ b/kernel/futex.c
-@@ -2736,7 +2736,7 @@ static int __init futex_init(void)
- futex_cmpxchg_enabled = 1;
-
- for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
-- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
-+ plist_head_init(&futex_queues[i].chain);
- spin_lock_init(&futex_queues[i].lock);
- }
-
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pm_qos_lock);
- static struct pm_qos_object null_pm_qos;
- static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
- static struct pm_qos_object cpu_dma_pm_qos = {
-- .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests, pm_qos_lock),
-+ .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests),
- .notifiers = &cpu_dma_lat_notifier,
- .name = "cpu_dma_latency",
- .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
-@@ -84,7 +84,7 @@ static struct pm_qos_object cpu_dma_pm_q
-
- static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
- static struct pm_qos_object network_lat_pm_qos = {
-- .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests, pm_qos_lock),
-+ .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests),
- .notifiers = &network_lat_notifier,
- .name = "network_latency",
- .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
-@@ -95,7 +95,7 @@ static struct pm_qos_object network_lat_
-
- static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
- static struct pm_qos_object network_throughput_pm_qos = {
-- .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests, pm_qos_lock),
-+ .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests),
- .notifiers = &network_throughput_notifier,
- .name = "network_throughput",
- .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
---- a/kernel/rtmutex.c
-+++ b/kernel/rtmutex.c
-@@ -890,7 +890,7 @@ void __rt_mutex_init(struct rt_mutex *lo
- {
- lock->owner = NULL;
- raw_spin_lock_init(&lock->wait_lock);
-- plist_head_init_raw(&lock->wait_list, &lock->wait_lock);
-+ plist_head_init(&lock->wait_list);
-
- debug_rt_mutex_init(lock, name);
- }
---- a/kernel/sched.c
-+++ b/kernel/sched.c
-@@ -7920,7 +7920,7 @@ static void init_rt_rq(struct rt_rq *rt_
- #ifdef CONFIG_SMP
- rt_rq->rt_nr_migratory = 0;
- rt_rq->overloaded = 0;
-- plist_head_init_raw(&rt_rq->pushable_tasks, &rq->lock);
-+ plist_head_init(&rt_rq->pushable_tasks);
- #endif
-
- rt_rq->rt_time = 0;
-@@ -8125,7 +8125,7 @@ void __init sched_init(void)
- #endif
-
- #ifdef CONFIG_RT_MUTEXES
-- plist_head_init_raw(&init_task.pi_waiters, &init_task.pi_lock);
-+ plist_head_init(&init_task.pi_waiters);
- #endif
-
- /*
---- a/lib/plist.c
-+++ b/lib/plist.c
-@@ -56,11 +56,6 @@ static void plist_check_list(struct list
-
- static void plist_check_head(struct plist_head *head)
- {
-- WARN_ON(head != &test_head && !head->rawlock && !head->spinlock);
-- if (head->rawlock)
-- WARN_ON_SMP(!raw_spin_is_locked(head->rawlock));
-- if (head->spinlock)
-- WARN_ON_SMP(!spin_is_locked(head->spinlock));
- if (!plist_head_empty(head))
- plist_check_list(&plist_first(head)->prio_list);
- plist_check_list(&head->node_list);
-@@ -180,7 +175,7 @@ static int __init plist_test(void)
- unsigned int r = local_clock();
-
- printk(KERN_INFO "start plist test\n");
-- plist_head_init(&test_head, NULL);
-+ plist_head_init(&test_head);
- for (i = 0; i < ARRAY_SIZE(test_node); i++)
- plist_node_init(test_node + i, 0);
-
diff --git a/patches.runtime_pm/0056-PM-QoS-Minor-clean-ups.patch b/patches.runtime_pm/0056-PM-QoS-Minor-clean-ups.patch
deleted file mode 100644
index 6944b2a74aa5a7..00000000000000
--- a/patches.runtime_pm/0056-PM-QoS-Minor-clean-ups.patch
+++ /dev/null
@@ -1,409 +0,0 @@
-From 2bb17e08a33ec95c04c0b4d6ce44bbe78c4afafb Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:12 +0200
-Subject: PM QoS: Minor clean-ups
-
- - Misc fixes to improve code readability:
- * rename struct pm_qos_request_list to struct pm_qos_request,
- * rename pm_qos_req parameter to req in internal code,
- consistenly use req in the API parameters,
- * update the in-kernel API callers to the new parameters names,
- * rename of fields names (requests, list, node, constraints)
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Acked-by: markgross <markgross@thegnar.org>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit cc74998618a66d34651c784dd02412614c3e81cc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/media/video/via-camera.c | 2 +-
- drivers/net/wireless/ipw2x00/ipw2100.c | 2 +-
- include/linux/netdevice.h | 2 +-
- include/linux/pm_qos.h | 22 ++++----
- include/sound/pcm.h | 2 +-
- kernel/power/qos.c | 88 ++++++++++++++++----------------
- 6 files changed, 59 insertions(+), 59 deletions(-)
-
-diff --git a/drivers/media/video/via-camera.c b/drivers/media/video/via-camera.c
-index b3ca389..fba6c64 100644
---- a/drivers/media/video/via-camera.c
-+++ b/drivers/media/video/via-camera.c
-@@ -69,7 +69,7 @@ struct via_camera {
- struct mutex lock;
- enum viacam_opstate opstate;
- unsigned long flags;
-- struct pm_qos_request_list qos_request;
-+ struct pm_qos_request qos_request;
- /*
- * GPIO info for power/reset management
- */
-diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
-index d9df575..f323ec0 100644
---- a/drivers/net/wireless/ipw2x00/ipw2100.c
-+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
-@@ -174,7 +174,7 @@ that only one external action is invoked at a time.
- #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
- #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
-
--static struct pm_qos_request_list ipw2100_pm_qos_req;
-+static struct pm_qos_request ipw2100_pm_qos_req;
-
- /* Debugging stuff */
- #ifdef CONFIG_IPW2100_DEBUG
-diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 6155893..2ee4623 100644
---- a/include/linux/netdevice.h
-+++ b/include/linux/netdevice.h
-@@ -999,7 +999,7 @@ struct net_device {
- */
- char name[IFNAMSIZ];
-
-- struct pm_qos_request_list pm_qos_req;
-+ struct pm_qos_request pm_qos_req;
-
- /* device name hash chain */
- struct hlist_node name_hlist;
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 7ba67541..6b0968f 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -20,30 +20,30 @@
- #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
- #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
-
--struct pm_qos_request_list {
-- struct plist_node list;
-+struct pm_qos_request {
-+ struct plist_node node;
- int pm_qos_class;
- };
-
- #ifdef CONFIG_PM
--void pm_qos_add_request(struct pm_qos_request_list *l,
-- int pm_qos_class, s32 value);
--void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
-+void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
-+ s32 value);
-+void pm_qos_update_request(struct pm_qos_request *req,
- s32 new_value);
--void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
-+void pm_qos_remove_request(struct pm_qos_request *req);
-
- int pm_qos_request(int pm_qos_class);
- int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
--int pm_qos_request_active(struct pm_qos_request_list *req);
-+int pm_qos_request_active(struct pm_qos_request *req);
- #else
--static inline void pm_qos_add_request(struct pm_qos_request_list *l,
-+static inline void pm_qos_add_request(struct pm_qos_request *req,
- int pm_qos_class, s32 value)
- { return; }
--static inline void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
-+static inline void pm_qos_update_request(struct pm_qos_request *req,
- s32 new_value)
- { return; }
--static inline void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req)
-+static inline void pm_qos_remove_request(struct pm_qos_request *req)
- { return; }
-
- static inline int pm_qos_request(int pm_qos_class)
-@@ -54,7 +54,7 @@ static inline int pm_qos_add_notifier(int pm_qos_class,
- static inline int pm_qos_remove_notifier(int pm_qos_class,
- struct notifier_block *notifier)
- { return 0; }
--static inline int pm_qos_request_active(struct pm_qos_request_list *req)
-+static inline int pm_qos_request_active(struct pm_qos_request *req)
- { return 0; }
- #endif
-
-diff --git a/include/sound/pcm.h b/include/sound/pcm.h
-index 1204f17..d3b068f 100644
---- a/include/sound/pcm.h
-+++ b/include/sound/pcm.h
-@@ -373,7 +373,7 @@ struct snd_pcm_substream {
- int number;
- char name[32]; /* substream name */
- int stream; /* stream (direction) */
-- struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */
-+ struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
- size_t buffer_bytes_max; /* limit ring buffer size */
- struct snd_dma_buffer dma_buffer;
- unsigned int dma_buf_id;
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 61b4738..aa52c44 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -45,7 +45,7 @@
- #include <linux/uaccess.h>
-
- /*
-- * locking rule: all changes to requests or notifiers lists
-+ * locking rule: all changes to constraints or notifiers lists
- * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
- * held, taken with _irqsave. One lock to rule them all
- */
-@@ -60,7 +60,7 @@ enum pm_qos_type {
- * types linux supports for 32 bit quantites
- */
- struct pm_qos_object {
-- struct plist_head requests;
-+ struct plist_head constraints;
- struct blocking_notifier_head *notifiers;
- struct miscdevice pm_qos_power_miscdev;
- char *name;
-@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pm_qos_lock);
- static struct pm_qos_object null_pm_qos;
- static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
- static struct pm_qos_object cpu_dma_pm_qos = {
-- .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests),
-+ .constraints = PLIST_HEAD_INIT(cpu_dma_pm_qos.constraints),
- .notifiers = &cpu_dma_lat_notifier,
- .name = "cpu_dma_latency",
- .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
-@@ -84,7 +84,7 @@ static struct pm_qos_object cpu_dma_pm_qos = {
-
- static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
- static struct pm_qos_object network_lat_pm_qos = {
-- .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests),
-+ .constraints = PLIST_HEAD_INIT(network_lat_pm_qos.constraints),
- .notifiers = &network_lat_notifier,
- .name = "network_latency",
- .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
-@@ -95,7 +95,7 @@ static struct pm_qos_object network_lat_pm_qos = {
-
- static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
- static struct pm_qos_object network_throughput_pm_qos = {
-- .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests),
-+ .constraints = PLIST_HEAD_INIT(network_throughput_pm_qos.constraints),
- .notifiers = &network_throughput_notifier,
- .name = "network_throughput",
- .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
-@@ -129,15 +129,15 @@ static const struct file_operations pm_qos_power_fops = {
- /* unlocked internal variant */
- static inline int pm_qos_get_value(struct pm_qos_object *o)
- {
-- if (plist_head_empty(&o->requests))
-+ if (plist_head_empty(&o->constraints))
- return o->default_value;
-
- switch (o->type) {
- case PM_QOS_MIN:
-- return plist_first(&o->requests)->prio;
-+ return plist_first(&o->constraints)->prio;
-
- case PM_QOS_MAX:
-- return plist_last(&o->requests)->prio;
-+ return plist_last(&o->constraints)->prio;
-
- default:
- /* runtime check for not using enum */
-@@ -170,13 +170,13 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
- * with new value and add, then see if the extremal
- * changed
- */
-- plist_del(node, &o->requests);
-+ plist_del(node, &o->constraints);
- plist_node_init(node, value);
-- plist_add(node, &o->requests);
-+ plist_add(node, &o->constraints);
- } else if (del) {
-- plist_del(node, &o->requests);
-+ plist_del(node, &o->constraints);
- } else {
-- plist_add(node, &o->requests);
-+ plist_add(node, &o->constraints);
- }
- curr_value = pm_qos_get_value(o);
- pm_qos_set_value(o, curr_value);
-@@ -222,7 +222,7 @@ int pm_qos_request(int pm_qos_class)
- }
- EXPORT_SYMBOL_GPL(pm_qos_request);
-
--int pm_qos_request_active(struct pm_qos_request_list *req)
-+int pm_qos_request_active(struct pm_qos_request *req)
- {
- return req->pm_qos_class != 0;
- }
-@@ -230,24 +230,24 @@ EXPORT_SYMBOL_GPL(pm_qos_request_active);
-
- /**
- * pm_qos_add_request - inserts new qos request into the list
-- * @dep: pointer to a preallocated handle
-+ * @req: pointer to a preallocated handle
- * @pm_qos_class: identifies which list of qos request to use
- * @value: defines the qos request
- *
- * This function inserts a new entry in the pm_qos_class list of requested qos
- * performance characteristics. It recomputes the aggregate QoS expectations
-- * for the pm_qos_class of parameters and initializes the pm_qos_request_list
-+ * for the pm_qos_class of parameters and initializes the pm_qos_request
- * handle. Caller needs to save this handle for later use in updates and
- * removal.
- */
-
--void pm_qos_add_request(struct pm_qos_request_list *dep,
-+void pm_qos_add_request(struct pm_qos_request *req,
- int pm_qos_class, s32 value)
- {
- struct pm_qos_object *o = pm_qos_array[pm_qos_class];
- int new_value;
-
-- if (pm_qos_request_active(dep)) {
-+ if (pm_qos_request_active(req)) {
- WARN(1, KERN_ERR "pm_qos_add_request() called for already added request\n");
- return;
- }
-@@ -255,15 +255,15 @@ void pm_qos_add_request(struct pm_qos_request_list *dep,
- new_value = o->default_value;
- else
- new_value = value;
-- plist_node_init(&dep->list, new_value);
-- dep->pm_qos_class = pm_qos_class;
-- update_target(o, &dep->list, 0, PM_QOS_DEFAULT_VALUE);
-+ plist_node_init(&req->node, new_value);
-+ req->pm_qos_class = pm_qos_class;
-+ update_target(o, &req->node, 0, PM_QOS_DEFAULT_VALUE);
- }
- EXPORT_SYMBOL_GPL(pm_qos_add_request);
-
- /**
- * pm_qos_update_request - modifies an existing qos request
-- * @pm_qos_req : handle to list element holding a pm_qos request to use
-+ * @req : handle to list element holding a pm_qos request to use
- * @value: defines the qos request
- *
- * Updates an existing qos request for the pm_qos_class of parameters along
-@@ -271,56 +271,56 @@ EXPORT_SYMBOL_GPL(pm_qos_add_request);
- *
- * Attempts are made to make this code callable on hot code paths.
- */
--void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
-+void pm_qos_update_request(struct pm_qos_request *req,
- s32 new_value)
- {
- s32 temp;
- struct pm_qos_object *o;
-
-- if (!pm_qos_req) /*guard against callers passing in null */
-+ if (!req) /*guard against callers passing in null */
- return;
-
-- if (!pm_qos_request_active(pm_qos_req)) {
-+ if (!pm_qos_request_active(req)) {
- WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n");
- return;
- }
-
-- o = pm_qos_array[pm_qos_req->pm_qos_class];
-+ o = pm_qos_array[req->pm_qos_class];
-
- if (new_value == PM_QOS_DEFAULT_VALUE)
- temp = o->default_value;
- else
- temp = new_value;
-
-- if (temp != pm_qos_req->list.prio)
-- update_target(o, &pm_qos_req->list, 0, temp);
-+ if (temp != req->node.prio)
-+ update_target(o, &req->node, 0, temp);
- }
- EXPORT_SYMBOL_GPL(pm_qos_update_request);
-
- /**
- * pm_qos_remove_request - modifies an existing qos request
-- * @pm_qos_req: handle to request list element
-+ * @req: handle to request list element
- *
-- * Will remove pm qos request from the list of requests and
-+ * Will remove pm qos request from the list of constraints and
- * recompute the current target value for the pm_qos_class. Call this
- * on slow code paths.
- */
--void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req)
-+void pm_qos_remove_request(struct pm_qos_request *req)
- {
- struct pm_qos_object *o;
-
-- if (pm_qos_req == NULL)
-+ if (req == NULL)
- return;
- /* silent return to keep pcm code cleaner */
-
-- if (!pm_qos_request_active(pm_qos_req)) {
-+ if (!pm_qos_request_active(req)) {
- WARN(1, KERN_ERR "pm_qos_remove_request() called for unknown object\n");
- return;
- }
-
-- o = pm_qos_array[pm_qos_req->pm_qos_class];
-- update_target(o, &pm_qos_req->list, 1, PM_QOS_DEFAULT_VALUE);
-- memset(pm_qos_req, 0, sizeof(*pm_qos_req));
-+ o = pm_qos_array[req->pm_qos_class];
-+ update_target(o, &req->node, 1, PM_QOS_DEFAULT_VALUE);
-+ memset(req, 0, sizeof(*req));
- }
- EXPORT_SYMBOL_GPL(pm_qos_remove_request);
-
-@@ -368,7 +368,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
-
- pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
- if (pm_qos_class >= 0) {
-- struct pm_qos_request_list *req = kzalloc(sizeof(*req), GFP_KERNEL);
-+ struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL);
- if (!req)
- return -ENOMEM;
-
-@@ -383,7 +383,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
-
- static int pm_qos_power_release(struct inode *inode, struct file *filp)
- {
-- struct pm_qos_request_list *req;
-+ struct pm_qos_request *req;
-
- req = filp->private_data;
- pm_qos_remove_request(req);
-@@ -399,14 +399,14 @@ static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
- s32 value;
- unsigned long flags;
- struct pm_qos_object *o;
-- struct pm_qos_request_list *pm_qos_req = filp->private_data;
-+ struct pm_qos_request *req = filp->private_data;
-
-- if (!pm_qos_req)
-+ if (!req)
- return -EINVAL;
-- if (!pm_qos_request_active(pm_qos_req))
-+ if (!pm_qos_request_active(req))
- return -EINVAL;
-
-- o = pm_qos_array[pm_qos_req->pm_qos_class];
-+ o = pm_qos_array[req->pm_qos_class];
- spin_lock_irqsave(&pm_qos_lock, flags);
- value = pm_qos_get_value(o);
- spin_unlock_irqrestore(&pm_qos_lock, flags);
-@@ -418,7 +418,7 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
- size_t count, loff_t *f_pos)
- {
- s32 value;
-- struct pm_qos_request_list *pm_qos_req;
-+ struct pm_qos_request *req;
-
- if (count == sizeof(s32)) {
- if (copy_from_user(&value, buf, sizeof(s32)))
-@@ -449,8 +449,8 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
- return -EINVAL;
- }
-
-- pm_qos_req = filp->private_data;
-- pm_qos_update_request(pm_qos_req, value);
-+ req = filp->private_data;
-+ pm_qos_update_request(req, value);
-
- return count;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0057-PM-QoS-Code-reorganization.patch b/patches.runtime_pm/0057-PM-QoS-Code-reorganization.patch
deleted file mode 100644
index be99e352739035..00000000000000
--- a/patches.runtime_pm/0057-PM-QoS-Code-reorganization.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From e578bf69019f6f236f041c77b8aa825b22deb887 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:20 +0200
-Subject: PM QoS: Code reorganization
-
-Move around the PM QoS misc devices management code
-for better readability.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Acked-by: markgross <markgross@thegnar.org>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4a31a33425a1eb92f6a0b9846f081842268361c8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/qos.c | 45 +++++++++++++++++++++++----------------------
- 1 file changed, 23 insertions(+), 22 deletions(-)
-
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index aa52c44..788c4cf 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -188,28 +188,6 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
- NULL);
- }
-
--static int register_pm_qos_misc(struct pm_qos_object *qos)
--{
-- qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
-- qos->pm_qos_power_miscdev.name = qos->name;
-- qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
--
-- return misc_register(&qos->pm_qos_power_miscdev);
--}
--
--static int find_pm_qos_object_by_minor(int minor)
--{
-- int pm_qos_class;
--
-- for (pm_qos_class = 0;
-- pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
-- if (minor ==
-- pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
-- return pm_qos_class;
-- }
-- return -1;
--}
--
- /**
- * pm_qos_request - returns current system wide qos expectation
- * @pm_qos_class: identification of which qos value is requested
-@@ -362,6 +340,29 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier)
- }
- EXPORT_SYMBOL_GPL(pm_qos_remove_notifier);
-
-+/* User space interface to PM QoS classes via misc devices */
-+static int register_pm_qos_misc(struct pm_qos_object *qos)
-+{
-+ qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
-+ qos->pm_qos_power_miscdev.name = qos->name;
-+ qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
-+
-+ return misc_register(&qos->pm_qos_power_miscdev);
-+}
-+
-+static int find_pm_qos_object_by_minor(int minor)
-+{
-+ int pm_qos_class;
-+
-+ for (pm_qos_class = 0;
-+ pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
-+ if (minor ==
-+ pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
-+ return pm_qos_class;
-+ }
-+ return -1;
-+}
-+
- static int pm_qos_power_open(struct inode *inode, struct file *filp)
- {
- long pm_qos_class;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0058-PM-QoS-Reorganize-data-structs.patch b/patches.runtime_pm/0058-PM-QoS-Reorganize-data-structs.patch
deleted file mode 100644
index 3f31646b3a6357..00000000000000
--- a/patches.runtime_pm/0058-PM-QoS-Reorganize-data-structs.patch
+++ /dev/null
@@ -1,243 +0,0 @@
-From 8fdac1918808653bdd2697dc040bb1153d8b94f3 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:27 +0200
-Subject: PM QoS: Reorganize data structs
-
-In preparation for the per-device constratins support, re-organize
-the data strctures:
- - add a struct pm_qos_constraints which contains the constraints
- related data
- - update struct pm_qos_object contents to the PM QoS internal object
- data. Add a pointer to struct pm_qos_constraints
- - update the internal code to use the new data structs.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4e1779baaa542c83b459b0a56585e0c1a04c7782)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 19 +++++++++++
- kernel/power/qos.c | 85 +++++++++++++++++++++++-------------------------
- 2 files changed, 60 insertions(+), 44 deletions(-)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 6b0968f..9772311 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -25,6 +25,25 @@ struct pm_qos_request {
- int pm_qos_class;
- };
-
-+enum pm_qos_type {
-+ PM_QOS_UNITIALIZED,
-+ PM_QOS_MAX, /* return the largest value */
-+ PM_QOS_MIN /* return the smallest value */
-+};
-+
-+/*
-+ * Note: The lockless read path depends on the CPU accessing
-+ * target_value atomically. Atomic access is only guaranteed on all CPU
-+ * types linux supports for 32 bit quantites
-+ */
-+struct pm_qos_constraints {
-+ struct plist_head list;
-+ s32 target_value; /* Do not change to 64 bit */
-+ s32 default_value;
-+ enum pm_qos_type type;
-+ struct blocking_notifier_head *notifiers;
-+};
-+
- #ifdef CONFIG_PM
- void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
- s32 value);
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 788c4cf..4a35fe5 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -49,58 +49,53 @@
- * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
- * held, taken with _irqsave. One lock to rule them all
- */
--enum pm_qos_type {
-- PM_QOS_MAX, /* return the largest value */
-- PM_QOS_MIN /* return the smallest value */
--};
--
--/*
-- * Note: The lockless read path depends on the CPU accessing
-- * target_value atomically. Atomic access is only guaranteed on all CPU
-- * types linux supports for 32 bit quantites
-- */
- struct pm_qos_object {
-- struct plist_head constraints;
-- struct blocking_notifier_head *notifiers;
-+ struct pm_qos_constraints *constraints;
- struct miscdevice pm_qos_power_miscdev;
- char *name;
-- s32 target_value; /* Do not change to 64 bit */
-- s32 default_value;
-- enum pm_qos_type type;
- };
-
- static DEFINE_SPINLOCK(pm_qos_lock);
-
- static struct pm_qos_object null_pm_qos;
-+
- static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
--static struct pm_qos_object cpu_dma_pm_qos = {
-- .constraints = PLIST_HEAD_INIT(cpu_dma_pm_qos.constraints),
-- .notifiers = &cpu_dma_lat_notifier,
-- .name = "cpu_dma_latency",
-+static struct pm_qos_constraints cpu_dma_constraints = {
-+ .list = PLIST_HEAD_INIT(cpu_dma_constraints.list),
- .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
- .default_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
- .type = PM_QOS_MIN,
-+ .notifiers = &cpu_dma_lat_notifier,
-+};
-+static struct pm_qos_object cpu_dma_pm_qos = {
-+ .constraints = &cpu_dma_constraints,
- };
-
- static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
--static struct pm_qos_object network_lat_pm_qos = {
-- .constraints = PLIST_HEAD_INIT(network_lat_pm_qos.constraints),
-- .notifiers = &network_lat_notifier,
-- .name = "network_latency",
-+static struct pm_qos_constraints network_lat_constraints = {
-+ .list = PLIST_HEAD_INIT(network_lat_constraints.list),
- .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
- .default_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
-- .type = PM_QOS_MIN
-+ .type = PM_QOS_MIN,
-+ .notifiers = &network_lat_notifier,
-+};
-+static struct pm_qos_object network_lat_pm_qos = {
-+ .constraints = &network_lat_constraints,
-+ .name = "network_latency",
- };
-
-
- static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
--static struct pm_qos_object network_throughput_pm_qos = {
-- .constraints = PLIST_HEAD_INIT(network_throughput_pm_qos.constraints),
-- .notifiers = &network_throughput_notifier,
-- .name = "network_throughput",
-+static struct pm_qos_constraints network_tput_constraints = {
-+ .list = PLIST_HEAD_INIT(network_tput_constraints.list),
- .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
- .default_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
- .type = PM_QOS_MAX,
-+ .notifiers = &network_throughput_notifier,
-+};
-+static struct pm_qos_object network_throughput_pm_qos = {
-+ .constraints = &network_tput_constraints,
-+ .name = "network_throughput",
- };
-
-
-@@ -129,15 +124,15 @@ static const struct file_operations pm_qos_power_fops = {
- /* unlocked internal variant */
- static inline int pm_qos_get_value(struct pm_qos_object *o)
- {
-- if (plist_head_empty(&o->constraints))
-- return o->default_value;
-+ if (plist_head_empty(&o->constraints->list))
-+ return o->constraints->default_value;
-
-- switch (o->type) {
-+ switch (o->constraints->type) {
- case PM_QOS_MIN:
-- return plist_first(&o->constraints)->prio;
-+ return plist_first(&o->constraints->list)->prio;
-
- case PM_QOS_MAX:
-- return plist_last(&o->constraints)->prio;
-+ return plist_last(&o->constraints->list)->prio;
-
- default:
- /* runtime check for not using enum */
-@@ -147,12 +142,12 @@ static inline int pm_qos_get_value(struct pm_qos_object *o)
-
- static inline s32 pm_qos_read_value(struct pm_qos_object *o)
- {
-- return o->target_value;
-+ return o->constraints->target_value;
- }
-
- static inline void pm_qos_set_value(struct pm_qos_object *o, s32 value)
- {
-- o->target_value = value;
-+ o->constraints->target_value = value;
- }
-
- static void update_target(struct pm_qos_object *o, struct plist_node *node,
-@@ -170,20 +165,20 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
- * with new value and add, then see if the extremal
- * changed
- */
-- plist_del(node, &o->constraints);
-+ plist_del(node, &o->constraints->list);
- plist_node_init(node, value);
-- plist_add(node, &o->constraints);
-+ plist_add(node, &o->constraints->list);
- } else if (del) {
-- plist_del(node, &o->constraints);
-+ plist_del(node, &o->constraints->list);
- } else {
-- plist_add(node, &o->constraints);
-+ plist_add(node, &o->constraints->list);
- }
- curr_value = pm_qos_get_value(o);
- pm_qos_set_value(o, curr_value);
- spin_unlock_irqrestore(&pm_qos_lock, flags);
-
- if (prev_value != curr_value)
-- blocking_notifier_call_chain(o->notifiers,
-+ blocking_notifier_call_chain(o->constraints->notifiers,
- (unsigned long)curr_value,
- NULL);
- }
-@@ -230,7 +225,7 @@ void pm_qos_add_request(struct pm_qos_request *req,
- return;
- }
- if (value == PM_QOS_DEFAULT_VALUE)
-- new_value = o->default_value;
-+ new_value = o->constraints->default_value;
- else
- new_value = value;
- plist_node_init(&req->node, new_value);
-@@ -266,7 +261,7 @@ void pm_qos_update_request(struct pm_qos_request *req,
- o = pm_qos_array[req->pm_qos_class];
-
- if (new_value == PM_QOS_DEFAULT_VALUE)
-- temp = o->default_value;
-+ temp = o->constraints->default_value;
- else
- temp = new_value;
-
-@@ -315,7 +310,8 @@ int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier)
- int retval;
-
- retval = blocking_notifier_chain_register(
-- pm_qos_array[pm_qos_class]->notifiers, notifier);
-+ pm_qos_array[pm_qos_class]->constraints->notifiers,
-+ notifier);
-
- return retval;
- }
-@@ -334,7 +330,8 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier)
- int retval;
-
- retval = blocking_notifier_chain_unregister(
-- pm_qos_array[pm_qos_class]->notifiers, notifier);
-+ pm_qos_array[pm_qos_class]->constraints->notifiers,
-+ notifier);
-
- return retval;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0059-PM-QoS-Generalize-and-export-constraints-management-.patch b/patches.runtime_pm/0059-PM-QoS-Generalize-and-export-constraints-management-.patch
deleted file mode 100644
index 12d56fb3aad7db..00000000000000
--- a/patches.runtime_pm/0059-PM-QoS-Generalize-and-export-constraints-management-.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-From 47215ada657966a1f3484a5cdbb480d4ba44c10e Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:34 +0200
-Subject: PM QoS: Generalize and export constraints management code
-
-In preparation for the per-device constratins support:
- - rename update_target to pm_qos_update_target
- - generalize and export pm_qos_update_target for usage by the upcoming
- per-device latency constraints framework:
- * operate on struct pm_qos_constraints for constraints management,
- * introduce an 'action' parameter for constraints add/update/remove,
- * the return value indicates if the aggregated constraint value has
- changed,
- - update the internal code to operate on struct pm_qos_constraints
- - add a NULL pointer check in the API functions
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit abe98ec2d86279fe821c9051003a0abc43444f15)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 14 ++++++
- kernel/power/qos.c | 123 ++++++++++++++++++++++++++----------------------
- 2 files changed, 81 insertions(+), 56 deletions(-)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 9772311..84aa150 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -44,7 +44,16 @@ struct pm_qos_constraints {
- struct blocking_notifier_head *notifiers;
- };
-
-+/* Action requested to pm_qos_update_target */
-+enum pm_qos_req_action {
-+ PM_QOS_ADD_REQ, /* Add a new request */
-+ PM_QOS_UPDATE_REQ, /* Update an existing request */
-+ PM_QOS_REMOVE_REQ /* Remove an existing request */
-+};
-+
- #ifdef CONFIG_PM
-+int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
-+ enum pm_qos_req_action action, int value);
- void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
- s32 value);
- void pm_qos_update_request(struct pm_qos_request *req,
-@@ -56,6 +65,11 @@ int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
- #else
-+static inline int pm_qos_update_target(struct pm_qos_constraints *c,
-+ struct plist_node *node,
-+ enum pm_qos_req_action action,
-+ int value)
-+ { return 0; }
- static inline void pm_qos_add_request(struct pm_qos_request *req,
- int pm_qos_class, s32 value)
- { return; }
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 4a35fe5..7c7cd18 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -122,17 +122,17 @@ static const struct file_operations pm_qos_power_fops = {
- };
-
- /* unlocked internal variant */
--static inline int pm_qos_get_value(struct pm_qos_object *o)
-+static inline int pm_qos_get_value(struct pm_qos_constraints *c)
- {
-- if (plist_head_empty(&o->constraints->list))
-- return o->constraints->default_value;
-+ if (plist_head_empty(&c->list))
-+ return c->default_value;
-
-- switch (o->constraints->type) {
-+ switch (c->type) {
- case PM_QOS_MIN:
-- return plist_first(&o->constraints->list)->prio;
-+ return plist_first(&c->list)->prio;
-
- case PM_QOS_MAX:
-- return plist_last(&o->constraints->list)->prio;
-+ return plist_last(&c->list)->prio;
-
- default:
- /* runtime check for not using enum */
-@@ -140,47 +140,73 @@ static inline int pm_qos_get_value(struct pm_qos_object *o)
- }
- }
-
--static inline s32 pm_qos_read_value(struct pm_qos_object *o)
-+static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
- {
-- return o->constraints->target_value;
-+ return c->target_value;
- }
-
--static inline void pm_qos_set_value(struct pm_qos_object *o, s32 value)
-+static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value)
- {
-- o->constraints->target_value = value;
-+ c->target_value = value;
- }
-
--static void update_target(struct pm_qos_object *o, struct plist_node *node,
-- int del, int value)
-+/**
-+ * pm_qos_update_target - manages the constraints list and calls the notifiers
-+ * if needed
-+ * @c: constraints data struct
-+ * @node: request to add to the list, to update or to remove
-+ * @action: action to take on the constraints list
-+ * @value: value of the request to add or update
-+ *
-+ * This function returns 1 if the aggregated constraint value has changed, 0
-+ * otherwise.
-+ */
-+int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
-+ enum pm_qos_req_action action, int value)
- {
- unsigned long flags;
-- int prev_value, curr_value;
-+ int prev_value, curr_value, new_value;
-
- spin_lock_irqsave(&pm_qos_lock, flags);
-- prev_value = pm_qos_get_value(o);
-- /* PM_QOS_DEFAULT_VALUE is a signal that the value is unchanged */
-- if (value != PM_QOS_DEFAULT_VALUE) {
-+ prev_value = pm_qos_get_value(c);
-+ if (value == PM_QOS_DEFAULT_VALUE)
-+ new_value = c->default_value;
-+ else
-+ new_value = value;
-+
-+ switch (action) {
-+ case PM_QOS_REMOVE_REQ:
-+ plist_del(node, &c->list);
-+ break;
-+ case PM_QOS_UPDATE_REQ:
- /*
- * to change the list, we atomically remove, reinit
- * with new value and add, then see if the extremal
- * changed
- */
-- plist_del(node, &o->constraints->list);
-- plist_node_init(node, value);
-- plist_add(node, &o->constraints->list);
-- } else if (del) {
-- plist_del(node, &o->constraints->list);
-- } else {
-- plist_add(node, &o->constraints->list);
-+ plist_del(node, &c->list);
-+ case PM_QOS_ADD_REQ:
-+ plist_node_init(node, new_value);
-+ plist_add(node, &c->list);
-+ break;
-+ default:
-+ /* no action */
-+ ;
- }
-- curr_value = pm_qos_get_value(o);
-- pm_qos_set_value(o, curr_value);
-+
-+ curr_value = pm_qos_get_value(c);
-+ pm_qos_set_value(c, curr_value);
-+
- spin_unlock_irqrestore(&pm_qos_lock, flags);
-
-- if (prev_value != curr_value)
-- blocking_notifier_call_chain(o->constraints->notifiers,
-+ if (prev_value != curr_value) {
-+ blocking_notifier_call_chain(c->notifiers,
- (unsigned long)curr_value,
- NULL);
-+ return 1;
-+ } else {
-+ return 0;
-+ }
- }
-
- /**
-@@ -191,7 +217,7 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
- */
- int pm_qos_request(int pm_qos_class)
- {
-- return pm_qos_read_value(pm_qos_array[pm_qos_class]);
-+ return pm_qos_read_value(pm_qos_array[pm_qos_class]->constraints);
- }
- EXPORT_SYMBOL_GPL(pm_qos_request);
-
-@@ -217,20 +243,16 @@ EXPORT_SYMBOL_GPL(pm_qos_request_active);
- void pm_qos_add_request(struct pm_qos_request *req,
- int pm_qos_class, s32 value)
- {
-- struct pm_qos_object *o = pm_qos_array[pm_qos_class];
-- int new_value;
-+ if (!req) /*guard against callers passing in null */
-+ return;
-
- if (pm_qos_request_active(req)) {
- WARN(1, KERN_ERR "pm_qos_add_request() called for already added request\n");
- return;
- }
-- if (value == PM_QOS_DEFAULT_VALUE)
-- new_value = o->constraints->default_value;
-- else
-- new_value = value;
-- plist_node_init(&req->node, new_value);
- req->pm_qos_class = pm_qos_class;
-- update_target(o, &req->node, 0, PM_QOS_DEFAULT_VALUE);
-+ pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints,
-+ &req->node, PM_QOS_ADD_REQ, value);
- }
- EXPORT_SYMBOL_GPL(pm_qos_add_request);
-
-@@ -247,9 +269,6 @@ EXPORT_SYMBOL_GPL(pm_qos_add_request);
- void pm_qos_update_request(struct pm_qos_request *req,
- s32 new_value)
- {
-- s32 temp;
-- struct pm_qos_object *o;
--
- if (!req) /*guard against callers passing in null */
- return;
-
-@@ -258,15 +277,10 @@ void pm_qos_update_request(struct pm_qos_request *req,
- return;
- }
-
-- o = pm_qos_array[req->pm_qos_class];
--
-- if (new_value == PM_QOS_DEFAULT_VALUE)
-- temp = o->constraints->default_value;
-- else
-- temp = new_value;
--
-- if (temp != req->node.prio)
-- update_target(o, &req->node, 0, temp);
-+ if (new_value != req->node.prio)
-+ pm_qos_update_target(
-+ pm_qos_array[req->pm_qos_class]->constraints,
-+ &req->node, PM_QOS_UPDATE_REQ, new_value);
- }
- EXPORT_SYMBOL_GPL(pm_qos_update_request);
-
-@@ -280,9 +294,7 @@ EXPORT_SYMBOL_GPL(pm_qos_update_request);
- */
- void pm_qos_remove_request(struct pm_qos_request *req)
- {
-- struct pm_qos_object *o;
--
-- if (req == NULL)
-+ if (!req) /*guard against callers passing in null */
- return;
- /* silent return to keep pcm code cleaner */
-
-@@ -291,8 +303,9 @@ void pm_qos_remove_request(struct pm_qos_request *req)
- return;
- }
-
-- o = pm_qos_array[req->pm_qos_class];
-- update_target(o, &req->node, 1, PM_QOS_DEFAULT_VALUE);
-+ pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints,
-+ &req->node, PM_QOS_REMOVE_REQ,
-+ PM_QOS_DEFAULT_VALUE);
- memset(req, 0, sizeof(*req));
- }
- EXPORT_SYMBOL_GPL(pm_qos_remove_request);
-@@ -396,7 +409,6 @@ static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
- {
- s32 value;
- unsigned long flags;
-- struct pm_qos_object *o;
- struct pm_qos_request *req = filp->private_data;
-
- if (!req)
-@@ -404,9 +416,8 @@ static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
- if (!pm_qos_request_active(req))
- return -EINVAL;
-
-- o = pm_qos_array[req->pm_qos_class];
- spin_lock_irqsave(&pm_qos_lock, flags);
-- value = pm_qos_get_value(o);
-+ value = pm_qos_get_value(pm_qos_array[req->pm_qos_class]->constraints);
- spin_unlock_irqrestore(&pm_qos_lock, flags);
-
- return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32));
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0060-PM-QoS-Implement-per-device-PM-QoS-constraints.patch b/patches.runtime_pm/0060-PM-QoS-Implement-per-device-PM-QoS-constraints.patch
deleted file mode 100644
index 1aded4a7140295..00000000000000
--- a/patches.runtime_pm/0060-PM-QoS-Implement-per-device-PM-QoS-constraints.patch
+++ /dev/null
@@ -1,535 +0,0 @@
-From 0b904050d49167289a67d5612940af6e50b19df1 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:41 +0200
-Subject: PM QoS: Implement per-device PM QoS constraints
-
-Implement the per-device PM QoS constraints by creating a device
-PM QoS API, which calls the PM QoS constraints management core code.
-
-The per-device latency constraints data strctures are stored
-in the device dev_pm_info struct.
-
-The device PM code calls the init and destroy of the per-device constraints
-data struct in order to support the dynamic insertion and removal of the
-devices in the system.
-
-To minimize the data usage by the per-device constraints, the data struct
-is only allocated at the first call to dev_pm_qos_add_request.
-The data is later free'd when the device is removed from the system.
-A global mutex protects the constraints users from the data being
-allocated and free'd.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 91ff4cb803df6de9114351b9f2f0f39f397ee03e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/Makefile | 4 +-
- drivers/base/power/main.c | 3 +
- drivers/base/power/qos.c | 338 +++++++++++++++++++++++++++++++++++++++++++
- include/linux/pm.h | 9 ++
- include/linux/pm_qos.h | 42 ++++++
- 5 files changed, 394 insertions(+), 2 deletions(-)
- create mode 100644 drivers/base/power/qos.c
-
-diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
-index 6488ce1..81676dd 100644
---- a/drivers/base/power/Makefile
-+++ b/drivers/base/power/Makefile
-@@ -1,4 +1,4 @@
--obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o
-+obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o qos.o
- obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
- obj-$(CONFIG_PM_RUNTIME) += runtime.o
- obj-$(CONFIG_PM_TRACE_RTC) += trace.o
-@@ -6,4 +6,4 @@ obj-$(CONFIG_PM_OPP) += opp.o
- obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o
- obj-$(CONFIG_HAVE_CLK) += clock_ops.o
-
--ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
-\ No newline at end of file
-+ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index a854591..956443f 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -22,6 +22,7 @@
- #include <linux/mutex.h>
- #include <linux/pm.h>
- #include <linux/pm_runtime.h>
-+#include <linux/pm_qos.h>
- #include <linux/resume-trace.h>
- #include <linux/interrupt.h>
- #include <linux/sched.h>
-@@ -97,6 +98,7 @@ void device_pm_add(struct device *dev)
- dev_name(dev->parent));
- list_add_tail(&dev->power.entry, &dpm_list);
- mutex_unlock(&dpm_list_mtx);
-+ dev_pm_qos_constraints_init(dev);
- }
-
- /**
-@@ -107,6 +109,7 @@ void device_pm_remove(struct device *dev)
- {
- pr_debug("PM: Removing info for %s:%s\n",
- dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
-+ dev_pm_qos_constraints_destroy(dev);
- complete_all(&dev->power.completion);
- mutex_lock(&dpm_list_mtx);
- list_del_init(&dev->power.entry);
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-new file mode 100644
-index 0000000..cc4c541
---- /dev/null
-+++ b/drivers/base/power/qos.c
-@@ -0,0 +1,338 @@
-+/*
-+ * Devices PM QoS constraints management
-+ *
-+ * Copyright (C) 2011 Texas Instruments, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ *
-+ *
-+ * This module exposes the interface to kernel space for specifying
-+ * per-device PM QoS dependencies. It provides infrastructure for registration
-+ * of:
-+ *
-+ * Dependents on a QoS value : register requests
-+ * Watchers of QoS value : get notified when target QoS value changes
-+ *
-+ * This QoS design is best effort based. Dependents register their QoS needs.
-+ * Watchers register to keep track of the current QoS needs of the system.
-+ *
-+ * Note about the per-device constraint data struct allocation:
-+ * . The per-device constraints data struct ptr is tored into the device
-+ * dev_pm_info.
-+ * . To minimize the data usage by the per-device constraints, the data struct
-+ * is only allocated at the first call to dev_pm_qos_add_request.
-+ * . The data is later free'd when the device is removed from the system.
-+ * . The constraints_state variable from dev_pm_info tracks the data struct
-+ * allocation state:
-+ * DEV_PM_QOS_NO_DEVICE: No device present or device removed, no data
-+ * allocated,
-+ * DEV_PM_QOS_DEVICE_PRESENT: Device present, data not allocated and will be
-+ * allocated at the first call to dev_pm_qos_add_request,
-+ * DEV_PM_QOS_ALLOCATED: Device present, data allocated. The per-device
-+ * PM QoS constraints framework is operational and constraints can be
-+ * added, updated or removed using the dev_pm_qos_* API.
-+ * . A global mutex protects the constraints users from the data being
-+ * allocated and free'd.
-+ */
-+
-+#include <linux/pm_qos.h>
-+#include <linux/spinlock.h>
-+#include <linux/slab.h>
-+#include <linux/device.h>
-+#include <linux/mutex.h>
-+
-+
-+static DEFINE_MUTEX(dev_pm_qos_mtx);
-+
-+/*
-+ * dev_pm_qos_constraints_allocate
-+ * @dev: device to allocate data for
-+ *
-+ * Called at the first call to add_request, for constraint data allocation
-+ * Must be called with the dev_pm_qos_mtx mutex held
-+ */
-+static int dev_pm_qos_constraints_allocate(struct device *dev)
-+{
-+ struct pm_qos_constraints *c;
-+ struct blocking_notifier_head *n;
-+
-+ c = kzalloc(sizeof(*c), GFP_KERNEL);
-+ if (!c)
-+ return -ENOMEM;
-+
-+ n = kzalloc(sizeof(*n), GFP_KERNEL);
-+ if (!n) {
-+ kfree(c);
-+ return -ENOMEM;
-+ }
-+ BLOCKING_INIT_NOTIFIER_HEAD(n);
-+
-+ dev->power.constraints = c;
-+ plist_head_init(&dev->power.constraints->list);
-+ dev->power.constraints->target_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-+ dev->power.constraints->default_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-+ dev->power.constraints->type = PM_QOS_MIN;
-+ dev->power.constraints->notifiers = n;
-+ dev->power.constraints_state = DEV_PM_QOS_ALLOCATED;
-+
-+ return 0;
-+}
-+
-+/**
-+ * dev_pm_qos_constraints_init
-+ * @dev: target device
-+ *
-+ * Called from the device PM subsystem at device insertion
-+ */
-+void dev_pm_qos_constraints_init(struct device *dev)
-+{
-+ mutex_lock(&dev_pm_qos_mtx);
-+ dev->power.constraints_state = DEV_PM_QOS_DEVICE_PRESENT;
-+ mutex_unlock(&dev_pm_qos_mtx);
-+}
-+
-+/**
-+ * dev_pm_qos_constraints_destroy
-+ * @dev: target device
-+ *
-+ * Called from the device PM subsystem at device removal
-+ */
-+void dev_pm_qos_constraints_destroy(struct device *dev)
-+{
-+ struct dev_pm_qos_request *req, *tmp;
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+
-+ if (dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-+ /* Flush the constraints list for the device */
-+ plist_for_each_entry_safe(req, tmp,
-+ &dev->power.constraints->list,
-+ node) {
-+ /*
-+ * Update constraints list and call the per-device
-+ * callbacks if needed
-+ */
-+ pm_qos_update_target(req->dev->power.constraints,
-+ &req->node, PM_QOS_REMOVE_REQ,
-+ PM_QOS_DEFAULT_VALUE);
-+ memset(req, 0, sizeof(*req));
-+ }
-+
-+ kfree(dev->power.constraints->notifiers);
-+ kfree(dev->power.constraints);
-+ dev->power.constraints = NULL;
-+ }
-+ dev->power.constraints_state = DEV_PM_QOS_NO_DEVICE;
-+
-+ mutex_unlock(&dev_pm_qos_mtx);
-+}
-+
-+/**
-+ * dev_pm_qos_add_request - inserts new qos request into the list
-+ * @dev: target device for the constraint
-+ * @req: pointer to a preallocated handle
-+ * @value: defines the qos request
-+ *
-+ * This function inserts a new entry in the device constraints list of
-+ * requested qos performance characteristics. It recomputes the aggregate
-+ * QoS expectations of parameters and initializes the dev_pm_qos_request
-+ * handle. Caller needs to save this handle for later use in updates and
-+ * removal.
-+ *
-+ * Returns 1 if the aggregated constraint value has changed,
-+ * 0 if the aggregated constraint value has not changed,
-+ * -EINVAL in case of wrong parameters, -ENODEV if the device has been
-+ * removed from the system
-+ */
-+int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
-+ s32 value)
-+{
-+ int ret = 0;
-+
-+ if (!dev || !req) /*guard against callers passing in null */
-+ return -EINVAL;
-+
-+ if (dev_pm_qos_request_active(req)) {
-+ WARN(1, KERN_ERR "dev_pm_qos_add_request() called for already "
-+ "added request\n");
-+ return -EINVAL;
-+ }
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+ req->dev = dev;
-+
-+ /* Return if the device has been removed */
-+ if (req->dev->power.constraints_state == DEV_PM_QOS_NO_DEVICE) {
-+ ret = -ENODEV;
-+ goto out;
-+ }
-+
-+ /*
-+ * Allocate the constraints data on the first call to add_request,
-+ * i.e. only if the data is not already allocated and if the device has
-+ * not been removed
-+ */
-+ if (dev->power.constraints_state == DEV_PM_QOS_DEVICE_PRESENT)
-+ ret = dev_pm_qos_constraints_allocate(dev);
-+
-+ if (!ret)
-+ ret = pm_qos_update_target(dev->power.constraints, &req->node,
-+ PM_QOS_ADD_REQ, value);
-+
-+out:
-+ mutex_unlock(&dev_pm_qos_mtx);
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_add_request);
-+
-+/**
-+ * dev_pm_qos_update_request - modifies an existing qos request
-+ * @req : handle to list element holding a dev_pm_qos request to use
-+ * @new_value: defines the qos request
-+ *
-+ * Updates an existing dev PM qos request along with updating the
-+ * target value.
-+ *
-+ * Attempts are made to make this code callable on hot code paths.
-+ *
-+ * Returns 1 if the aggregated constraint value has changed,
-+ * 0 if the aggregated constraint value has not changed,
-+ * -EINVAL in case of wrong parameters, -ENODEV if the device has been
-+ * removed from the system
-+ */
-+int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
-+ s32 new_value)
-+{
-+ int ret = 0;
-+
-+ if (!req) /*guard against callers passing in null */
-+ return -EINVAL;
-+
-+ if (!dev_pm_qos_request_active(req)) {
-+ WARN(1, KERN_ERR "dev_pm_qos_update_request() called for "
-+ "unknown object\n");
-+ return -EINVAL;
-+ }
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+
-+ if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-+ if (new_value != req->node.prio)
-+ ret = pm_qos_update_target(req->dev->power.constraints,
-+ &req->node,
-+ PM_QOS_UPDATE_REQ,
-+ new_value);
-+ } else {
-+ /* Return if the device has been removed */
-+ ret = -ENODEV;
-+ }
-+
-+ mutex_unlock(&dev_pm_qos_mtx);
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_update_request);
-+
-+/**
-+ * dev_pm_qos_remove_request - modifies an existing qos request
-+ * @req: handle to request list element
-+ *
-+ * Will remove pm qos request from the list of constraints and
-+ * recompute the current target value. Call this on slow code paths.
-+ *
-+ * Returns 1 if the aggregated constraint value has changed,
-+ * 0 if the aggregated constraint value has not changed,
-+ * -EINVAL in case of wrong parameters, -ENODEV if the device has been
-+ * removed from the system
-+ */
-+int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
-+{
-+ int ret = 0;
-+
-+ if (!req) /*guard against callers passing in null */
-+ return -EINVAL;
-+
-+ if (!dev_pm_qos_request_active(req)) {
-+ WARN(1, KERN_ERR "dev_pm_qos_remove_request() called for "
-+ "unknown object\n");
-+ return -EINVAL;
-+ }
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+
-+ if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-+ ret = pm_qos_update_target(req->dev->power.constraints,
-+ &req->node, PM_QOS_REMOVE_REQ,
-+ PM_QOS_DEFAULT_VALUE);
-+ memset(req, 0, sizeof(*req));
-+ } else {
-+ /* Return if the device has been removed */
-+ ret = -ENODEV;
-+ }
-+
-+ mutex_unlock(&dev_pm_qos_mtx);
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_remove_request);
-+
-+/**
-+ * dev_pm_qos_add_notifier - sets notification entry for changes to target value
-+ * of per-device PM QoS constraints
-+ *
-+ * @dev: target device for the constraint
-+ * @notifier: notifier block managed by caller.
-+ *
-+ * Will register the notifier into a notification chain that gets called
-+ * upon changes to the target value for the device.
-+ */
-+int dev_pm_qos_add_notifier(struct device *dev, struct notifier_block *notifier)
-+{
-+ int retval = 0;
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+
-+ /* Silently return if the device has been removed */
-+ if (dev->power.constraints_state != DEV_PM_QOS_ALLOCATED)
-+ goto out;
-+
-+ retval = blocking_notifier_chain_register(
-+ dev->power.constraints->notifiers,
-+ notifier);
-+
-+out:
-+ mutex_unlock(&dev_pm_qos_mtx);
-+ return retval;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_add_notifier);
-+
-+/**
-+ * dev_pm_qos_remove_notifier - deletes notification for changes to target value
-+ * of per-device PM QoS constraints
-+ *
-+ * @dev: target device for the constraint
-+ * @notifier: notifier block to be removed.
-+ *
-+ * Will remove the notifier from the notification chain that gets called
-+ * upon changes to the target value.
-+ */
-+int dev_pm_qos_remove_notifier(struct device *dev,
-+ struct notifier_block *notifier)
-+{
-+ int retval = 0;
-+
-+ mutex_lock(&dev_pm_qos_mtx);
-+
-+ /* Silently return if the device has been removed */
-+ if (dev->power.constraints_state != DEV_PM_QOS_ALLOCATED)
-+ goto out;
-+
-+ retval = blocking_notifier_chain_unregister(
-+ dev->power.constraints->notifiers,
-+ notifier);
-+
-+out:
-+ mutex_unlock(&dev_pm_qos_mtx);
-+ return retval;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index b17b6aa..c0fc859 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -421,6 +421,13 @@ enum rpm_request {
- RPM_REQ_RESUME,
- };
-
-+/* Per-device PM QoS constraints data struct state */
-+enum dev_pm_qos_state {
-+ DEV_PM_QOS_NO_DEVICE, /* No device present */
-+ DEV_PM_QOS_DEVICE_PRESENT, /* Device present, data not allocated */
-+ DEV_PM_QOS_ALLOCATED, /* Device present, data allocated */
-+};
-+
- struct wakeup_source;
-
- struct pm_domain_data {
-@@ -482,6 +489,8 @@ struct dev_pm_info {
- unsigned long accounting_timestamp;
- #endif
- struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
-+ struct pm_qos_constraints *constraints;
-+ enum dev_pm_qos_state constraints_state;
- };
-
- extern void update_pm_runtime_accounting(struct device *dev);
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 84aa150..f75f74d 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -19,12 +19,18 @@
- #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
- #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
- #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
-+#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0
-
- struct pm_qos_request {
- struct plist_node node;
- int pm_qos_class;
- };
-
-+struct dev_pm_qos_request {
-+ struct plist_node node;
-+ struct device *dev;
-+};
-+
- enum pm_qos_type {
- PM_QOS_UNITIALIZED,
- PM_QOS_MAX, /* return the largest value */
-@@ -51,6 +57,11 @@ enum pm_qos_req_action {
- PM_QOS_REMOVE_REQ /* Remove an existing request */
- };
-
-+static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
-+{
-+ return req->dev != 0;
-+}
-+
- #ifdef CONFIG_PM
- int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
- enum pm_qos_req_action action, int value);
-@@ -64,6 +75,17 @@ int pm_qos_request(int pm_qos_class);
- int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
-+
-+int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
-+ s32 value);
-+int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
-+int dev_pm_qos_remove_request(struct dev_pm_qos_request *req);
-+int dev_pm_qos_add_notifier(struct device *dev,
-+ struct notifier_block *notifier);
-+int dev_pm_qos_remove_notifier(struct device *dev,
-+ struct notifier_block *notifier);
-+void dev_pm_qos_constraints_init(struct device *dev);
-+void dev_pm_qos_constraints_destroy(struct device *dev);
- #else
- static inline int pm_qos_update_target(struct pm_qos_constraints *c,
- struct plist_node *node,
-@@ -89,6 +111,26 @@ static inline int pm_qos_remove_notifier(int pm_qos_class,
- { return 0; }
- static inline int pm_qos_request_active(struct pm_qos_request *req)
- { return 0; }
-+
-+static inline int dev_pm_qos_add_request(struct device *dev,
-+ struct dev_pm_qos_request *req,
-+ s32 value)
-+ { return 0; }
-+static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
-+ s32 new_value)
-+ { return 0; }
-+static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
-+ { return 0; }
-+static inline int dev_pm_qos_add_notifier(struct device *dev,
-+ struct notifier_block *notifier)
-+ { return 0; }
-+static inline int dev_pm_qos_remove_notifier(struct device *dev,
-+ struct notifier_block *notifier)
-+ { return 0; }
-+static inline void dev_pm_qos_constraints_init(struct device *dev)
-+ { return; }
-+static inline void dev_pm_qos_constraints_destroy(struct device *dev)
-+ { return; }
- #endif
-
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0061-PM-QoS-Add-global-notification-mechanism-for-device-.patch b/patches.runtime_pm/0061-PM-QoS-Add-global-notification-mechanism-for-device-.patch
deleted file mode 100644
index 73d9b208764b73..00000000000000
--- a/patches.runtime_pm/0061-PM-QoS-Add-global-notification-mechanism-for-device-.patch
+++ /dev/null
@@ -1,230 +0,0 @@
-From 19789f2ea81c2739287ed68c195a31a89696e912 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Thu, 25 Aug 2011 15:35:47 +0200
-Subject: PM QoS: Add global notification mechanism for device constraints
-
-Add a global notification chain that gets called upon changes to the
-aggregated constraint value for any device.
-The notification callbacks are passing the full constraint request data
-in order for the callees to have access to it. The current use is for the
-platform low-level code to access the target device of the constraint.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit b66213cdb002b08b29603d488c451dfe25e2ca20)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/qos.c | 89 ++++++++++++++++++++++++++++++++++++++--------
- include/linux/pm_qos.h | 11 ++++++
- kernel/power/qos.c | 2 +-
- 3 files changed, 87 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index cc4c541..8d0b811 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -17,6 +17,12 @@
- *
- * This QoS design is best effort based. Dependents register their QoS needs.
- * Watchers register to keep track of the current QoS needs of the system.
-+ * Watchers can register different types of notification callbacks:
-+ * . a per-device notification callback using the dev_pm_qos_*_notifier API.
-+ * The notification chain data is stored in the per-device constraint
-+ * data struct.
-+ * . a system-wide notification callback using the dev_pm_qos_*_global_notifier
-+ * API. The notification chain data is stored in a static variable.
- *
- * Note about the per-device constraint data struct allocation:
- * . The per-device constraints data struct ptr is tored into the device
-@@ -45,6 +51,36 @@
-
-
- static DEFINE_MUTEX(dev_pm_qos_mtx);
-+static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
-+
-+/*
-+ * apply_constraint
-+ * @req: constraint request to apply
-+ * @action: action to perform add/update/remove, of type enum pm_qos_req_action
-+ * @value: defines the qos request
-+ *
-+ * Internal function to update the constraints list using the PM QoS core
-+ * code and if needed call the per-device and the global notification
-+ * callbacks
-+ */
-+static int apply_constraint(struct dev_pm_qos_request *req,
-+ enum pm_qos_req_action action, int value)
-+{
-+ int ret, curr_value;
-+
-+ ret = pm_qos_update_target(req->dev->power.constraints,
-+ &req->node, action, value);
-+
-+ if (ret) {
-+ /* Call the global callbacks if needed */
-+ curr_value = pm_qos_read_value(req->dev->power.constraints);
-+ blocking_notifier_call_chain(&dev_pm_notifiers,
-+ (unsigned long)curr_value,
-+ req);
-+ }
-+
-+ return ret;
-+}
-
- /*
- * dev_pm_qos_constraints_allocate
-@@ -111,12 +147,11 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
- &dev->power.constraints->list,
- node) {
- /*
-- * Update constraints list and call the per-device
-+ * Update constraints list and call the notification
- * callbacks if needed
- */
-- pm_qos_update_target(req->dev->power.constraints,
-- &req->node, PM_QOS_REMOVE_REQ,
-- PM_QOS_DEFAULT_VALUE);
-+ apply_constraint(req, PM_QOS_REMOVE_REQ,
-+ PM_QOS_DEFAULT_VALUE);
- memset(req, 0, sizeof(*req));
- }
-
-@@ -147,7 +182,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
- * removed from the system
- */
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
-- s32 value)
-+ s32 value)
- {
- int ret = 0;
-
-@@ -178,8 +213,7 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- ret = dev_pm_qos_constraints_allocate(dev);
-
- if (!ret)
-- ret = pm_qos_update_target(dev->power.constraints, &req->node,
-- PM_QOS_ADD_REQ, value);
-+ ret = apply_constraint(req, PM_QOS_ADD_REQ, value);
-
- out:
- mutex_unlock(&dev_pm_qos_mtx);
-@@ -220,10 +254,8 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
-
- if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
- if (new_value != req->node.prio)
-- ret = pm_qos_update_target(req->dev->power.constraints,
-- &req->node,
-- PM_QOS_UPDATE_REQ,
-- new_value);
-+ ret = apply_constraint(req, PM_QOS_UPDATE_REQ,
-+ new_value);
- } else {
- /* Return if the device has been removed */
- ret = -ENODEV;
-@@ -262,9 +294,8 @@ int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
- mutex_lock(&dev_pm_qos_mtx);
-
- if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-- ret = pm_qos_update_target(req->dev->power.constraints,
-- &req->node, PM_QOS_REMOVE_REQ,
-- PM_QOS_DEFAULT_VALUE);
-+ ret = apply_constraint(req, PM_QOS_REMOVE_REQ,
-+ PM_QOS_DEFAULT_VALUE);
- memset(req, 0, sizeof(*req));
- } else {
- /* Return if the device has been removed */
-@@ -336,3 +367,33 @@ out:
- return retval;
- }
- EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
-+
-+/**
-+ * dev_pm_qos_add_global_notifier - sets notification entry for changes to
-+ * target value of the PM QoS constraints for any device
-+ *
-+ * @notifier: notifier block managed by caller.
-+ *
-+ * Will register the notifier into a notification chain that gets called
-+ * upon changes to the target value for any device.
-+ */
-+int dev_pm_qos_add_global_notifier(struct notifier_block *notifier)
-+{
-+ return blocking_notifier_chain_register(&dev_pm_notifiers, notifier);
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_add_global_notifier);
-+
-+/**
-+ * dev_pm_qos_remove_global_notifier - deletes notification for changes to
-+ * target value of PM QoS constraints for any device
-+ *
-+ * @notifier: notifier block to be removed.
-+ *
-+ * Will remove the notifier from the notification chain that gets called
-+ * upon changes to the target value for any device.
-+ */
-+int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
-+{
-+ return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index f75f74d..ca7bd3f 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -75,6 +75,7 @@ int pm_qos_request(int pm_qos_class);
- int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
-+s32 pm_qos_read_value(struct pm_qos_constraints *c);
-
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- s32 value);
-@@ -84,6 +85,8 @@ int dev_pm_qos_add_notifier(struct device *dev,
- struct notifier_block *notifier);
- int dev_pm_qos_remove_notifier(struct device *dev,
- struct notifier_block *notifier);
-+int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
-+int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
- void dev_pm_qos_constraints_init(struct device *dev);
- void dev_pm_qos_constraints_destroy(struct device *dev);
- #else
-@@ -111,6 +114,8 @@ static inline int pm_qos_remove_notifier(int pm_qos_class,
- { return 0; }
- static inline int pm_qos_request_active(struct pm_qos_request *req)
- { return 0; }
-+static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
-+ { return 0; }
-
- static inline int dev_pm_qos_add_request(struct device *dev,
- struct dev_pm_qos_request *req,
-@@ -127,6 +132,12 @@ static inline int dev_pm_qos_add_notifier(struct device *dev,
- static inline int dev_pm_qos_remove_notifier(struct device *dev,
- struct notifier_block *notifier)
- { return 0; }
-+static inline int dev_pm_qos_add_global_notifier(
-+ struct notifier_block *notifier)
-+ { return 0; }
-+static inline int dev_pm_qos_remove_global_notifier(
-+ struct notifier_block *notifier)
-+ { return 0; }
- static inline void dev_pm_qos_constraints_init(struct device *dev)
- { return; }
- static inline void dev_pm_qos_constraints_destroy(struct device *dev)
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 7c7cd18..1c1797d 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -140,7 +140,7 @@ static inline int pm_qos_get_value(struct pm_qos_constraints *c)
- }
- }
-
--static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
-+s32 pm_qos_read_value(struct pm_qos_constraints *c)
- {
- return c->target_value;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0062-PM-Domains-Preliminary-support-for-devices-with-powe.patch b/patches.runtime_pm/0062-PM-Domains-Preliminary-support-for-devices-with-powe.patch
deleted file mode 100644
index ffa6493304adb4..00000000000000
--- a/patches.runtime_pm/0062-PM-Domains-Preliminary-support-for-devices-with-powe.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From f5cf18d0d692aaf9fc087e491a08f8eb8be35d66 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 25 Aug 2011 15:37:04 +0200
-Subject: PM / Domains: Preliminary support for devices with power.irq_safe
- set
-
-The generic PM domains framework currently doesn't work with devices
-whose power.irq_safe flag is set, because runtime PM callbacks for
-such devices are run with interrupts disabled and the callbacks
-provided by the generic PM domains framework use domain mutexes
-and may sleep. However, such devices very well may belong to
-power domains on some systems, so the generic PM domains framework
-should take them into account.
-
-For this reason, modify the generic PM domains framework so that the
-domain .power_off() and .power_on() callbacks are never executed for
-a domain containing devices with power.irq_safe set, although the
-.stop_device() and .start_device() callbacks are still run for them.
-
-Additionally, introduce a flag allowing the creator of a
-struct generic_pm_domain object to indicate that its .stop_device()
-and .start_device() callbacks may be run in interrupt context
-(might_sleep_if() triggers if that flag is not set and one of those
-callbacks is run in interrupt context).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0aa2a221696cc8ea20a4cdca01315d3b6b4ecc4d)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 19 ++++++++++++++++++-
- include/linux/pm_domain.h | 1 +
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 339eb2d..c2468a7 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -309,7 +309,8 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
-
- not_suspended = 0;
- list_for_each_entry(pdd, &genpd->dev_list, list_node)
-- if (pdd->dev->driver && !pm_runtime_suspended(pdd->dev))
-+ if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev)
-+ || pdd->dev->power.irq_safe))
- not_suspended++;
-
- if (not_suspended > genpd->in_progress)
-@@ -417,12 +418,21 @@ static int pm_genpd_runtime_suspend(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-+ might_sleep_if(!genpd->dev_irq_safe);
-+
- if (genpd->stop_device) {
- int ret = genpd->stop_device(dev);
- if (ret)
- return ret;
- }
-
-+ /*
-+ * If power.irq_safe is set, this routine will be run with interrupts
-+ * off, so it can't use mutexes.
-+ */
-+ if (dev->power.irq_safe)
-+ return 0;
-+
- mutex_lock(&genpd->lock);
- genpd->in_progress++;
- pm_genpd_poweroff(genpd);
-@@ -452,6 +462,12 @@ static int pm_genpd_runtime_resume(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-+ might_sleep_if(!genpd->dev_irq_safe);
-+
-+ /* If power.irq_safe, the PM domain is never powered off. */
-+ if (dev->power.irq_safe)
-+ goto out;
-+
- mutex_lock(&genpd->lock);
- ret = __pm_genpd_poweron(genpd);
- if (ret) {
-@@ -483,6 +499,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
- wake_up_all(&genpd->status_wait_queue);
- mutex_unlock(&genpd->lock);
-
-+ out:
- if (genpd->start_device)
- genpd->start_device(dev);
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 5cce46c..2538d90 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -42,6 +42,7 @@ struct generic_pm_domain {
- unsigned int suspended_count; /* System suspend device counter */
- unsigned int prepared_count; /* Suspend counter of prepared devices */
- bool suspend_power_off; /* Power status before system suspend */
-+ bool dev_irq_safe; /* Device callbacks are IRQ-safe */
- int (*power_off)(struct generic_pm_domain *domain);
- int (*power_on)(struct generic_pm_domain *domain);
- int (*start_device)(struct device *dev);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0063-PM-Runtime-pm_runtime_idle-can-be-called-in-atomic-c.patch b/patches.runtime_pm/0063-PM-Runtime-pm_runtime_idle-can-be-called-in-atomic-c.patch
deleted file mode 100644
index 14e2e5db849390..00000000000000
--- a/patches.runtime_pm/0063-PM-Runtime-pm_runtime_idle-can-be-called-in-atomic-c.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 0204fb7b94314c8d49cec3a707aedfcca93b7386 Mon Sep 17 00:00:00 2001
-From: Ming Lei <tom.leiming@gmail.com>
-Date: Wed, 21 Sep 2011 22:31:33 +0200
-Subject: PM / Runtime: pm_runtime_idle() can be called in atomic context
-
-Add to pm_runtime_idle the list of functions that can be called
-in atomic context if pm_runtime_irq_safe() has been called for the
-device.
-
-Signed-off-by: Ming Lei <tom.leiming@gmail.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2e6ba515f50ef7ddf35b2703d014d3216c9b8b24)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 08d70e4..1f05404 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -477,6 +477,7 @@ pm_runtime_autosuspend_expiration()
- If pm_runtime_irq_safe() has been called for a device then the following helper
- functions may also be used in interrupt context:
-
-+pm_runtime_idle()
- pm_runtime_suspend()
- pm_runtime_autosuspend()
- pm_runtime_resume()
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0064-cpu_pm-Add-cpu-power-management-notifiers.patch b/patches.runtime_pm/0064-cpu_pm-Add-cpu-power-management-notifiers.patch
deleted file mode 100644
index 767d8295aa98cf..00000000000000
--- a/patches.runtime_pm/0064-cpu_pm-Add-cpu-power-management-notifiers.patch
+++ /dev/null
@@ -1,382 +0,0 @@
-From b34e87d056193445b747806d64095928cd10af57 Mon Sep 17 00:00:00 2001
-From: Colin Cross <ccross@android.com>
-Date: Thu, 10 Feb 2011 02:04:45 -0800
-Subject: cpu_pm: Add cpu power management notifiers
-
-During some CPU power modes entered during idle, hotplug and
-suspend, peripherals located in the CPU power domain, such as
-the GIC, localtimers, and VFP, may be powered down. Add a
-notifier chain that allows drivers for those peripherals to
-be notified before and after they may be reset.
-
-Notified drivers can include VFP co-processor, interrupt controller
-and it's PM extensions, local CPU timers context save/restore which
-shouldn't be interrupted. Hence CPU PM event APIs must be called
-with interrupts disabled.
-
-Signed-off-by: Colin Cross <ccross@android.com>
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Tested-and-Acked-by: Shawn Guo <shawn.guo@linaro.org>
-Tested-by: Kevin Hilman <khilman@ti.com>
-Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
-(cherry picked from commit ab10023e0088d5075354afc7cb9e72304757dddd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/cpu_pm.h | 109 ++++++++++++++++++++++++++
- kernel/Makefile | 1 +
- kernel/cpu_pm.c | 200 ++++++++++++++++++++++++++++++++++++++++++++++++
- kernel/power/Kconfig | 4 +
- 4 files changed, 314 insertions(+)
- create mode 100644 include/linux/cpu_pm.h
- create mode 100644 kernel/cpu_pm.c
-
-diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h
-new file mode 100644
-index 0000000..455b233
---- /dev/null
-+++ b/include/linux/cpu_pm.h
-@@ -0,0 +1,109 @@
-+/*
-+ * Copyright (C) 2011 Google, Inc.
-+ *
-+ * Author:
-+ * Colin Cross <ccross@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#ifndef _LINUX_CPU_PM_H
-+#define _LINUX_CPU_PM_H
-+
-+#include <linux/kernel.h>
-+#include <linux/notifier.h>
-+
-+/*
-+ * When a CPU goes to a low power state that turns off power to the CPU's
-+ * power domain, the contents of some blocks (floating point coprocessors,
-+ * interrupt controllers, caches, timers) in the same power domain can
-+ * be lost. The cpm_pm notifiers provide a method for platform idle, suspend,
-+ * and hotplug implementations to notify the drivers for these blocks that
-+ * they may be reset.
-+ *
-+ * All cpu_pm notifications must be called with interrupts disabled.
-+ *
-+ * The notifications are split into two classes: CPU notifications and CPU
-+ * cluster notifications.
-+ *
-+ * CPU notifications apply to a single CPU and must be called on the affected
-+ * CPU. They are used to save per-cpu context for affected blocks.
-+ *
-+ * CPU cluster notifications apply to all CPUs in a single power domain. They
-+ * are used to save any global context for affected blocks, and must be called
-+ * after all the CPUs in the power domain have been notified of the low power
-+ * state.
-+ */
-+
-+/*
-+ * Event codes passed as unsigned long val to notifier calls
-+ */
-+enum cpu_pm_event {
-+ /* A single cpu is entering a low power state */
-+ CPU_PM_ENTER,
-+
-+ /* A single cpu failed to enter a low power state */
-+ CPU_PM_ENTER_FAILED,
-+
-+ /* A single cpu is exiting a low power state */
-+ CPU_PM_EXIT,
-+
-+ /* A cpu power domain is entering a low power state */
-+ CPU_CLUSTER_PM_ENTER,
-+
-+ /* A cpu power domain failed to enter a low power state */
-+ CPU_CLUSTER_PM_ENTER_FAILED,
-+
-+ /* A cpu power domain is exiting a low power state */
-+ CPU_CLUSTER_PM_EXIT,
-+};
-+
-+#ifdef CONFIG_CPU_PM
-+int cpu_pm_register_notifier(struct notifier_block *nb);
-+int cpu_pm_unregister_notifier(struct notifier_block *nb);
-+int cpu_pm_enter(void);
-+int cpu_pm_exit(void);
-+int cpu_cluster_pm_enter(void);
-+int cpu_cluster_pm_exit(void);
-+
-+#else
-+
-+static inline int cpu_pm_register_notifier(struct notifier_block *nb)
-+{
-+ return 0;
-+}
-+
-+static inline int cpu_pm_unregister_notifier(struct notifier_block *nb)
-+{
-+ return 0;
-+}
-+
-+static inline int cpu_pm_enter(void)
-+{
-+ return 0;
-+}
-+
-+static inline int cpu_pm_exit(void)
-+{
-+ return 0;
-+}
-+
-+static inline int cpu_cluster_pm_enter(void)
-+{
-+ return 0;
-+}
-+
-+static inline int cpu_cluster_pm_exit(void)
-+{
-+ return 0;
-+}
-+#endif
-+#endif
-diff --git a/kernel/Makefile b/kernel/Makefile
-index c4547c7..de5198f 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -101,6 +101,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/
- obj-$(CONFIG_TRACEPOINTS) += trace/
- obj-$(CONFIG_SMP) += sched_cpupri.o
- obj-$(CONFIG_IRQ_WORK) += irq_work.o
-+obj-$(CONFIG_CPU_PM) += cpu_pm.o
-
- obj-$(CONFIG_PERF_EVENTS) += events/
-
-diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c
-new file mode 100644
-index 0000000..4d1ff4a
---- /dev/null
-+++ b/kernel/cpu_pm.c
-@@ -0,0 +1,200 @@
-+/*
-+ * Copyright (C) 2011 Google, Inc.
-+ *
-+ * Author:
-+ * Colin Cross <ccross@android.com>
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/cpu_pm.h>
-+#include <linux/module.h>
-+#include <linux/notifier.h>
-+#include <linux/spinlock.h>
-+
-+static DEFINE_RWLOCK(cpu_pm_notifier_lock);
-+static RAW_NOTIFIER_HEAD(cpu_pm_notifier_chain);
-+
-+static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
-+{
-+ int ret;
-+
-+ ret = __raw_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
-+ nr_to_call, nr_calls);
-+
-+ return notifier_to_errno(ret);
-+}
-+
-+/**
-+ * cpu_pm_register_notifier - register a driver with cpu_pm
-+ * @nb: notifier block to register
-+ *
-+ * Add a driver to a list of drivers that are notified about
-+ * CPU and CPU cluster low power entry and exit.
-+ *
-+ * This function may sleep, and has the same return conditions as
-+ * raw_notifier_chain_register.
-+ */
-+int cpu_pm_register_notifier(struct notifier_block *nb)
-+{
-+ unsigned long flags;
-+ int ret;
-+
-+ write_lock_irqsave(&cpu_pm_notifier_lock, flags);
-+ ret = raw_notifier_chain_register(&cpu_pm_notifier_chain, nb);
-+ write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_pm_register_notifier);
-+
-+/**
-+ * cpu_pm_unregister_notifier - unregister a driver with cpu_pm
-+ * @nb: notifier block to be unregistered
-+ *
-+ * Remove a driver from the CPU PM notifier list.
-+ *
-+ * This function may sleep, and has the same return conditions as
-+ * raw_notifier_chain_unregister.
-+ */
-+int cpu_pm_unregister_notifier(struct notifier_block *nb)
-+{
-+ unsigned long flags;
-+ int ret;
-+
-+ write_lock_irqsave(&cpu_pm_notifier_lock, flags);
-+ ret = raw_notifier_chain_unregister(&cpu_pm_notifier_chain, nb);
-+ write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_pm_unregister_notifier);
-+
-+/**
-+ * cpm_pm_enter - CPU low power entry notifier
-+ *
-+ * Notifies listeners that a single CPU is entering a low power state that may
-+ * cause some blocks in the same power domain as the cpu to reset.
-+ *
-+ * Must be called on the affected CPU with interrupts disabled. Platform is
-+ * responsible for ensuring that cpu_pm_enter is not called twice on the same
-+ * CPU before cpu_pm_exit is called. Notified drivers can include VFP
-+ * co-processor, interrupt controller and it's PM extensions, local CPU
-+ * timers context save/restore which shouldn't be interrupted. Hence it
-+ * must be called with interrupts disabled.
-+ *
-+ * Return conditions are same as __raw_notifier_call_chain.
-+ */
-+int cpu_pm_enter(void)
-+{
-+ int nr_calls;
-+ int ret = 0;
-+
-+ read_lock(&cpu_pm_notifier_lock);
-+ ret = cpu_pm_notify(CPU_PM_ENTER, -1, &nr_calls);
-+ if (ret)
-+ /*
-+ * Inform listeners (nr_calls - 1) about failure of CPU PM
-+ * PM entry who are notified earlier to prepare for it.
-+ */
-+ cpu_pm_notify(CPU_PM_ENTER_FAILED, nr_calls - 1, NULL);
-+ read_unlock(&cpu_pm_notifier_lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_pm_enter);
-+
-+/**
-+ * cpm_pm_exit - CPU low power exit notifier
-+ *
-+ * Notifies listeners that a single CPU is exiting a low power state that may
-+ * have caused some blocks in the same power domain as the cpu to reset.
-+ *
-+ * Notified drivers can include VFP co-processor, interrupt controller
-+ * and it's PM extensions, local CPU timers context save/restore which
-+ * shouldn't be interrupted. Hence it must be called with interrupts disabled.
-+ *
-+ * Return conditions are same as __raw_notifier_call_chain.
-+ */
-+int cpu_pm_exit(void)
-+{
-+ int ret;
-+
-+ read_lock(&cpu_pm_notifier_lock);
-+ ret = cpu_pm_notify(CPU_PM_EXIT, -1, NULL);
-+ read_unlock(&cpu_pm_notifier_lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_pm_exit);
-+
-+/**
-+ * cpm_cluster_pm_enter - CPU cluster low power entry notifier
-+ *
-+ * Notifies listeners that all cpus in a power domain are entering a low power
-+ * state that may cause some blocks in the same power domain to reset.
-+ *
-+ * Must be called after cpu_pm_enter has been called on all cpus in the power
-+ * domain, and before cpu_pm_exit has been called on any cpu in the power
-+ * domain. Notified drivers can include VFP co-processor, interrupt controller
-+ * and it's PM extensions, local CPU timers context save/restore which
-+ * shouldn't be interrupted. Hence it must be called with interrupts disabled.
-+ *
-+ * Must be called with interrupts disabled.
-+ *
-+ * Return conditions are same as __raw_notifier_call_chain.
-+ */
-+int cpu_cluster_pm_enter(void)
-+{
-+ int nr_calls;
-+ int ret = 0;
-+
-+ read_lock(&cpu_pm_notifier_lock);
-+ ret = cpu_pm_notify(CPU_CLUSTER_PM_ENTER, -1, &nr_calls);
-+ if (ret)
-+ /*
-+ * Inform listeners (nr_calls - 1) about failure of CPU cluster
-+ * PM entry who are notified earlier to prepare for it.
-+ */
-+ cpu_pm_notify(CPU_CLUSTER_PM_ENTER_FAILED, nr_calls - 1, NULL);
-+ read_unlock(&cpu_pm_notifier_lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_cluster_pm_enter);
-+
-+/**
-+ * cpm_cluster_pm_exit - CPU cluster low power exit notifier
-+ *
-+ * Notifies listeners that all cpus in a power domain are exiting form a
-+ * low power state that may have caused some blocks in the same power domain
-+ * to reset.
-+ *
-+ * Must be called after cpu_pm_exit has been called on all cpus in the power
-+ * domain, and before cpu_pm_exit has been called on any cpu in the power
-+ * domain. Notified drivers can include VFP co-processor, interrupt controller
-+ * and it's PM extensions, local CPU timers context save/restore which
-+ * shouldn't be interrupted. Hence it must be called with interrupts disabled.
-+ *
-+ * Return conditions are same as __raw_notifier_call_chain.
-+ */
-+int cpu_cluster_pm_exit(void)
-+{
-+ int ret;
-+
-+ read_lock(&cpu_pm_notifier_lock);
-+ ret = cpu_pm_notify(CPU_CLUSTER_PM_EXIT, -1, NULL);
-+ read_unlock(&cpu_pm_notifier_lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit);
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 3744c59..80a8597 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -235,3 +235,7 @@ config PM_GENERIC_DOMAINS
- config PM_GENERIC_DOMAINS_RUNTIME
- def_bool y
- depends on PM_RUNTIME && PM_GENERIC_DOMAINS
-+
-+config CPU_PM
-+ bool
-+ depends on SUSPEND || CPU_IDLE
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0065-PM-Clocks-Do-not-acquire-a-mutex-under-a-spinlock.patch b/patches.runtime_pm/0065-PM-Clocks-Do-not-acquire-a-mutex-under-a-spinlock.patch
deleted file mode 100644
index 58de9b0d7ee6b9..00000000000000
--- a/patches.runtime_pm/0065-PM-Clocks-Do-not-acquire-a-mutex-under-a-spinlock.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-From f7518aaf30e679acdf93726d54504bf127135fa9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 26 Sep 2011 19:40:23 +0200
-Subject: PM / Clocks: Do not acquire a mutex under a spinlock
-
-Commit b7ab83e (PM: Use spinlock instead of mutex in clock
-management functions) introduced a regression causing clocks_mutex
-to be acquired under a spinlock. This happens because
-pm_clk_suspend() and pm_clk_resume() call pm_clk_acquire() under
-pcd->lock, but pm_clk_acquire() executes clk_get() which causes
-clocks_mutex to be acquired. Similarly, __pm_clk_remove(),
-executed under pcd->lock, calls clk_put(), which also causes
-clocks_mutex to be acquired.
-
-To fix those problems make pm_clk_add() call pm_clk_acquire(), so
-that pm_clk_suspend() and pm_clk_resume() don't have to do that.
-Change pm_clk_remove() and pm_clk_destroy() to separate
-modifications of the pcd->clock_list list from the actual removal of
-PM clock entry objects done by __pm_clk_remove().
-
-Reported-and-tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
-(cherry picked from commit e8b364b88cc4001b21c28c1ecf1e1e3ffbe162e6)
-
-Conflicts:
-
- drivers/base/power/clock_ops.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 76 +++++++++++++++++++++-------------------
- 1 file changed, 39 insertions(+), 37 deletions(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index cb44b58..b876e60 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -32,6 +32,22 @@ struct pm_clock_entry {
- };
-
- /**
-+ * pm_clk_acquire - Acquire a device clock.
-+ * @dev: Device whose clock is to be acquired.
-+ * @ce: PM clock entry corresponding to the clock.
-+ */
-+static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
-+{
-+ ce->clk = clk_get(dev, ce->con_id);
-+ if (IS_ERR(ce->clk)) {
-+ ce->status = PCE_STATUS_ERROR;
-+ } else {
-+ ce->status = PCE_STATUS_ACQUIRED;
-+ dev_dbg(dev, "Clock %s managed by runtime PM.\n", ce->con_id);
-+ }
-+}
-+
-+/**
- * pm_clk_add - Start using a device clock for power management.
- * @dev: Device whose clock is going to be used for power management.
- * @con_id: Connection ID of the clock.
-@@ -63,6 +79,8 @@ int pm_clk_add(struct device *dev, const char *con_id)
- }
- }
-
-+ pm_clk_acquire(dev, ce);
-+
- spin_lock_irq(&psd->lock);
- list_add_tail(&ce->node, &psd->clock_list);
- spin_unlock_irq(&psd->lock);
-@@ -72,17 +90,12 @@ int pm_clk_add(struct device *dev, const char *con_id)
- /**
- * __pm_clk_remove - Destroy PM clock entry.
- * @ce: PM clock entry to destroy.
-- *
-- * This routine must be called under the spinlock protecting the PM list of
-- * clocks corresponding the the @ce's device.
- */
- static void __pm_clk_remove(struct pm_clock_entry *ce)
- {
- if (!ce)
- return;
-
-- list_del(&ce->node);
--
- if (ce->status < PCE_STATUS_ERROR) {
- if (ce->status == PCE_STATUS_ENABLED)
- clk_disable(ce->clk);
-@@ -116,18 +129,22 @@ void pm_clk_remove(struct device *dev, const char *con_id)
- spin_lock_irq(&psd->lock);
-
- list_for_each_entry(ce, &psd->clock_list, node) {
-- if (!con_id && !ce->con_id) {
-- __pm_clk_remove(ce);
-- break;
-- } else if (!con_id || !ce->con_id) {
-+ if (!con_id && !ce->con_id)
-+ goto remove;
-+ else if (!con_id || !ce->con_id)
- continue;
-- } else if (!strcmp(con_id, ce->con_id)) {
-- __pm_clk_remove(ce);
-- break;
-- }
-+ else if (!strcmp(con_id, ce->con_id))
-+ goto remove;
- }
-
- spin_unlock_irq(&psd->lock);
-+ return;
-+
-+ remove:
-+ list_del(&ce->node);
-+ spin_unlock_irq(&psd->lock);
-+
-+ __pm_clk_remove(ce);
- }
-
- /**
-@@ -169,18 +186,26 @@ void pm_clk_destroy(struct device *dev)
- {
- struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce, *c;
-+ struct list_head list;
-
- if (!psd)
- return;
-
-+ INIT_LIST_HEAD(&list);
-+
- spin_lock_irq(&psd->lock);
-
- list_for_each_entry_safe_reverse(ce, c, &psd->clock_list, node)
-- __pm_clk_remove(ce);
-+ list_move(&ce->node, &list);
-
- spin_unlock_irq(&psd->lock);
-
- dev_pm_put_subsys_data(dev);
-+
-+ list_for_each_entry_safe_reverse(ce, c, &list, node) {
-+ list_del(&ce->node);
-+ __pm_clk_remove(ce);
-+ }
- }
-
- #endif /* CONFIG_PM */
-@@ -188,23 +213,6 @@ void pm_clk_destroy(struct device *dev)
- #ifdef CONFIG_PM_RUNTIME
-
- /**
-- * pm_clk_acquire - Acquire a device clock.
-- * @dev: Device whose clock is to be acquired.
-- * @con_id: Connection ID of the clock.
-- */
--static void pm_clk_acquire(struct device *dev,
-- struct pm_clock_entry *ce)
--{
-- ce->clk = clk_get(dev, ce->con_id);
-- if (IS_ERR(ce->clk)) {
-- ce->status = PCE_STATUS_ERROR;
-- } else {
-- ce->status = PCE_STATUS_ACQUIRED;
-- dev_dbg(dev, "Clock %s managed by runtime PM.\n", ce->con_id);
-- }
--}
--
--/**
- * pm_clk_suspend - Disable clocks in a device's PM clock list.
- * @dev: Device to disable the clocks for.
- */
-@@ -222,9 +230,6 @@ int pm_clk_suspend(struct device *dev)
- spin_lock_irqsave(&psd->lock, flags);
-
- list_for_each_entry_reverse(ce, &psd->clock_list, node) {
-- if (ce->status == PCE_STATUS_NONE)
-- pm_clk_acquire(dev, ce);
--
- if (ce->status < PCE_STATUS_ERROR) {
- clk_disable(ce->clk);
- ce->status = PCE_STATUS_ACQUIRED;
-@@ -254,9 +259,6 @@ int pm_clk_resume(struct device *dev)
- spin_lock_irqsave(&psd->lock, flags);
-
- list_for_each_entry(ce, &psd->clock_list, node) {
-- if (ce->status == PCE_STATUS_NONE)
-- pm_clk_acquire(dev, ce);
--
- if (ce->status < PCE_STATUS_ERROR) {
- clk_enable(ce->clk);
- ce->status = PCE_STATUS_ENABLED;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0066-PM-Domains-Split-device-PM-domain-data-into-base-and.patch b/patches.runtime_pm/0066-PM-Domains-Split-device-PM-domain-data-into-base-and.patch
deleted file mode 100644
index 0640cc23c86c79..00000000000000
--- a/patches.runtime_pm/0066-PM-Domains-Split-device-PM-domain-data-into-base-and.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From e62d564194eff6032d2447d26059ee9e3ebab253 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 26 Sep 2011 20:22:02 +0200
-Subject: PM / Domains: Split device PM domain data into base and need_restore
-
-The struct pm_domain_data data type is defined in such a way that
-adding new fields specific to the generic PM domains code will
-require include/linux/pm.h to be modified. As a result, data types
-used only by the generic PM domains code will be defined in two
-headers, although they all should be defined in pm_domain.h and
-pm.h will need to include more headers, which won't be very nice.
-
-For this reason change the definition of struct pm_subsys_data
-so that its domain_data member is a pointer, which will allow
-struct pm_domain_data to be subclassed by various PM domains
-implementations. Remove the need_restore member from
-struct pm_domain_data and make the generic PM domains code
-subclass it by adding the need_restore member to the new data type.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit cd0ea672f58d5cfdea271c45cec0c897f2b792aa)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 28 +++++++++++++++++++---------
- include/linux/pm.h | 3 +--
- include/linux/pm_domain.h | 10 ++++++++++
- 3 files changed, 30 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index c2468a7..22fe029 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -188,11 +188,12 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
- struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-+ struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
- struct device *dev = pdd->dev;
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
-- if (pdd->need_restore)
-+ if (gpd_data->need_restore)
- return 0;
-
- mutex_unlock(&genpd->lock);
-@@ -210,7 +211,7 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
- mutex_lock(&genpd->lock);
-
- if (!ret)
-- pdd->need_restore = true;
-+ gpd_data->need_restore = true;
-
- return ret;
- }
-@@ -224,10 +225,11 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
- struct generic_pm_domain *genpd)
- __releases(&genpd->lock) __acquires(&genpd->lock)
- {
-+ struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
- struct device *dev = pdd->dev;
- struct device_driver *drv = dev->driver;
-
-- if (!pdd->need_restore)
-+ if (!gpd_data->need_restore)
- return;
-
- mutex_unlock(&genpd->lock);
-@@ -244,7 +246,7 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
-
- mutex_lock(&genpd->lock);
-
-- pdd->need_restore = false;
-+ gpd_data->need_restore = false;
- }
-
- /**
-@@ -493,7 +495,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
- mutex_lock(&genpd->lock);
- }
- finish_wait(&genpd->status_wait_queue, &wait);
-- __pm_genpd_restore_device(&dev->power.subsys_data->domain_data, genpd);
-+ __pm_genpd_restore_device(dev->power.subsys_data->domain_data, genpd);
- genpd->resume_count--;
- genpd_set_active(genpd);
- wake_up_all(&genpd->status_wait_queue);
-@@ -1080,6 +1082,7 @@ static void pm_genpd_complete(struct device *dev)
- */
- int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- {
-+ struct generic_pm_domain_data *gpd_data;
- struct pm_domain_data *pdd;
- int ret = 0;
-
-@@ -1106,14 +1109,20 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- goto out;
- }
-
-+ gpd_data = kzalloc(sizeof(*gpd_data), GFP_KERNEL);
-+ if (!gpd_data) {
-+ ret = -ENOMEM;
-+ goto out;
-+ }
-+
- genpd->device_count++;
-
- dev->pm_domain = &genpd->domain;
- dev_pm_get_subsys_data(dev);
-- pdd = &dev->power.subsys_data->domain_data;
-- pdd->dev = dev;
-- pdd->need_restore = false;
-- list_add_tail(&pdd->list_node, &genpd->dev_list);
-+ dev->power.subsys_data->domain_data = &gpd_data->base;
-+ gpd_data->base.dev = dev;
-+ gpd_data->need_restore = false;
-+ list_add_tail(&gpd_data->base.list_node, &genpd->dev_list);
-
- out:
- genpd_release_lock(genpd);
-@@ -1152,6 +1161,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- pdd->dev = NULL;
- dev_pm_put_subsys_data(dev);
- dev->pm_domain = NULL;
-+ kfree(to_gpd_data(pdd));
-
- genpd->device_count--;
-
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index c0fc859..70b79e7 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -433,7 +433,6 @@ struct wakeup_source;
- struct pm_domain_data {
- struct list_head list_node;
- struct device *dev;
-- bool need_restore;
- };
-
- struct pm_subsys_data {
-@@ -443,7 +442,7 @@ struct pm_subsys_data {
- struct list_head clock_list;
- #endif
- #ifdef CONFIG_PM_GENERIC_DOMAINS
-- struct pm_domain_data domain_data;
-+ struct pm_domain_data *domain_data;
- #endif
- };
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 2538d90..65633e5 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -62,6 +62,16 @@ struct gpd_link {
- struct list_head slave_node;
- };
-
-+struct generic_pm_domain_data {
-+ struct pm_domain_data base;
-+ bool need_restore;
-+};
-+
-+static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd)
-+{
-+ return container_of(pdd, struct generic_pm_domain_data, base);
-+}
-+
- #ifdef CONFIG_PM_GENERIC_DOMAINS
- extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0067-doc-fix-broken-references.patch b/patches.runtime_pm/0067-doc-fix-broken-references.patch
deleted file mode 100644
index cd1df8208a8403..00000000000000
--- a/patches.runtime_pm/0067-doc-fix-broken-references.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 0eaad2d7475d41b9bb7afcecbe99aaafcc8a2761 Mon Sep 17 00:00:00 2001
-From: Paul Bolle <pebolle@tiscali.nl>
-Date: Mon, 15 Aug 2011 02:02:26 +0200
-Subject: doc: fix broken references
-
-There are numerous broken references to Documentation files (in other
-Documentation files, in comments, etc.). These broken references are
-caused by typo's in the references, and by renames or removals of the
-Documentation files. Some broken references are simply odd.
-
-Fix these broken references, sometimes by dropping the irrelevant text
-they were part of.
-
-Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
-Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-(cherry picked from commit 395cf9691d72173d8cdaa613c5f0255f993af94b)
-
-Conflicts:
-
- Documentation/PCI/pci.txt
- Documentation/blackfin/bfin-gpio-notes.txt
- Documentation/block/biodoc.txt
- Documentation/bus-virt-phys-mapping.txt
- Documentation/cdrom/packet-writing.txt
- Documentation/development-process/4.Coding
- Documentation/devicetree/bindings/gpio/led.txt
- Documentation/filesystems/caching/object.txt
- Documentation/filesystems/locks.txt
- Documentation/filesystems/nfs/idmapper.txt
- Documentation/filesystems/pohmelfs/design_notes.txt
- Documentation/filesystems/proc.txt
- Documentation/filesystems/vfs.txt
- Documentation/frv/booting.txt
- Documentation/input/input.txt
- Documentation/kernel-docs.txt
- Documentation/kernel-parameters.txt
- Documentation/laptops/thinkpad-acpi.txt
- Documentation/media-framework.txt
- Documentation/memory-barriers.txt
- Documentation/networking/scaling.txt
- Documentation/power/userland-swsusp.txt
- Documentation/rfkill.txt
- Documentation/scsi/aic7xxx_old.txt
- Documentation/scsi/scsi_mid_low_api.txt
- Documentation/security/keys-trusted-encrypted.txt
- Documentation/sound/oss/PAS16
- Documentation/spi/pxa2xx
- Documentation/timers/highres.txt
- Documentation/usb/dma.txt
- Documentation/virtual/lguest/lguest.c
- Documentation/vm/numa
- Documentation/vm/slub.txt
- arch/alpha/kernel/srm_env.c
- arch/arm/Kconfig
- arch/arm/include/asm/io.h
- arch/arm/mach-pxa/xcep.c
- arch/ia64/hp/common/sba_iommu.c
- arch/m68k/q40/README
- arch/microblaze/include/asm/dma-mapping.h
- arch/mips/include/asm/lasat/lasat.h
- arch/mn10300/Kconfig
- arch/mn10300/kernel/irq.c
- arch/openrisc/Kconfig
- arch/openrisc/include/asm/dma-mapping.h
- arch/parisc/include/asm/dma-mapping.h
- arch/parisc/kernel/pci-dma.c
- arch/powerpc/include/asm/qe.h
- arch/powerpc/sysdev/qe_lib/qe.c
- arch/unicore32/include/asm/io.h
- arch/x86/Kconfig
- arch/x86/Kconfig.debug
- arch/x86/boot/header.S
- arch/x86/include/asm/dma-mapping.h
- arch/x86/kernel/amd_gart_64.c
- arch/x86/kernel/apm_32.c
- arch/x86/kernel/pci-dma.c
- drivers/char/apm-emulation.c
- drivers/input/misc/rotary_encoder.c
- drivers/leds/Kconfig
- drivers/media/dvb/dvb-usb/af9005-remote.c
- drivers/media/dvb/dvb-usb/af9005.c
- drivers/media/dvb/frontends/dib3000.h
- drivers/media/dvb/frontends/dib3000mb.c
- drivers/mtd/Kconfig
- drivers/net/Kconfig
- drivers/net/can/sja1000/sja1000_of_platform.c
- drivers/net/tulip/21142.c
- drivers/net/tulip/eeprom.c
- drivers/net/tulip/interrupt.c
- drivers/net/tulip/media.c
- drivers/net/tulip/pnic.c
- drivers/net/tulip/pnic2.c
- drivers/net/tulip/timer.c
- drivers/net/tulip/tulip.h
- drivers/net/tulip/tulip_core.c
- drivers/parisc/sba_iommu.c
- drivers/platform/x86/Kconfig
- drivers/scsi/megaraid/megaraid_mbox.c
- drivers/staging/cxt1e1/Kconfig
- drivers/usb/serial/digi_acceleport.c
- drivers/video/igafb.c
- drivers/watchdog/smsc37b787_wdt.c
- fs/configfs/inode.c
- fs/configfs/item.c
- fs/locks.c
- fs/squashfs/Kconfig
- include/linux/io-mapping.h
- include/linux/isdn.h
- include/linux/platform_data/ntc_thermistor.h
- include/media/videobuf-dma-sg.h
- include/target/configfs_macros.h
- net/netfilter/Kconfig
- sound/oss/Kconfig
- tools/perf/util/config.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/basic-pm-debugging.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt
-index ddd7817..05a7fe7 100644
---- a/Documentation/power/basic-pm-debugging.txt
-+++ b/Documentation/power/basic-pm-debugging.txt
-@@ -173,7 +173,7 @@ kernel messages using the serial console. This may provide you with some
- information about the reasons of the suspend (resume) failure. Alternatively,
- it may be possible to use a FireWire port for debugging with firescope
- (ftp://ftp.firstfloor.org/pub/ak/firescope/). On x86 it is also possible to
--use the PM_TRACE mechanism documented in Documentation/s2ram.txt .
-+use the PM_TRACE mechanism documented in Documentation/power/s2ram.txt .
-
- 2. Testing suspend to RAM (STR)
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0068-PM-Runtime-Don-t-run-callbacks-under-lock-for-power..patch b/patches.runtime_pm/0068-PM-Runtime-Don-t-run-callbacks-under-lock-for-power..patch
deleted file mode 100644
index 7cb9e858fc0467..00000000000000
--- a/patches.runtime_pm/0068-PM-Runtime-Don-t-run-callbacks-under-lock-for-power..patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From ef6791f347cd72ae5354a827004f57bdb4b6bbd7 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 27 Sep 2011 21:54:52 +0200
-Subject: PM / Runtime: Don't run callbacks under lock for power.irq_safe set
-
-The rpm_suspend() and rpm_resume() routines execute subsystem or PM
-domain callbacks under power.lock if power.irq_safe is set for the
-given device. This is inconsistent with that rpm_idle() does after
-commit 02b2677 (PM / Runtime: Allow _put_sync() from
-interrupts-disabled context) and is problematic for subsystems and PM
-domains wanting to use power.lock for synchronization in their
-runtime PM callbacks.
-
-This change requires the code checking if the device's runtime PM
-status is RPM_SUSPENDING or RPM_RESUMING to be modified too, to take
-the power.irq_safe set case into account (that code wasn't reachable
-before with power.irq_safe set, because it's executed with the
-device's power.lock held).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Ming Lei <tom.leiming@gmail.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit ad3c36a534bc7b945d7bffdda1c62e13bf93489a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 68 ++++++++++++++++++++++++++++--------------
- 1 file changed, 46 insertions(+), 22 deletions(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 04e18ab..aecb2a8 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -155,6 +155,31 @@ static int rpm_check_suspend_allowed(struct device *dev)
- }
-
- /**
-+ * __rpm_callback - Run a given runtime PM callback for a given device.
-+ * @cb: Runtime PM callback to run.
-+ * @dev: Device to run the callback for.
-+ */
-+static int __rpm_callback(int (*cb)(struct device *), struct device *dev)
-+ __releases(&dev->power.lock) __acquires(&dev->power.lock)
-+{
-+ int retval;
-+
-+ if (dev->power.irq_safe)
-+ spin_unlock(&dev->power.lock);
-+ else
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ retval = cb(dev);
-+
-+ if (dev->power.irq_safe)
-+ spin_lock(&dev->power.lock);
-+ else
-+ spin_lock_irq(&dev->power.lock);
-+
-+ return retval;
-+}
-+
-+/**
- * rpm_idle - Notify device bus type if the device can be suspended.
- * @dev: Device to notify the bus type about.
- * @rpmflags: Flag bits.
-@@ -225,19 +250,8 @@ static int rpm_idle(struct device *dev, int rpmflags)
- else
- callback = NULL;
-
-- if (callback) {
-- if (dev->power.irq_safe)
-- spin_unlock(&dev->power.lock);
-- else
-- spin_unlock_irq(&dev->power.lock);
--
-- callback(dev);
--
-- if (dev->power.irq_safe)
-- spin_lock(&dev->power.lock);
-- else
-- spin_lock_irq(&dev->power.lock);
-- }
-+ if (callback)
-+ __rpm_callback(callback, dev);
-
- dev->power.idle_notification = false;
- wake_up_all(&dev->power.wait_queue);
-@@ -252,22 +266,14 @@ static int rpm_idle(struct device *dev, int rpmflags)
- * @dev: Device to run the callback for.
- */
- static int rpm_callback(int (*cb)(struct device *), struct device *dev)
-- __releases(&dev->power.lock) __acquires(&dev->power.lock)
- {
- int retval;
-
- if (!cb)
- return -ENOSYS;
-
-- if (dev->power.irq_safe) {
-- retval = cb(dev);
-- } else {
-- spin_unlock_irq(&dev->power.lock);
--
-- retval = cb(dev);
-+ retval = __rpm_callback(cb, dev);
-
-- spin_lock_irq(&dev->power.lock);
-- }
- dev->power.runtime_error = retval;
- return retval != -EACCES ? retval : -EIO;
- }
-@@ -347,6 +353,15 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- goto out;
- }
-
-+ if (dev->power.irq_safe) {
-+ spin_unlock(&dev->power.lock);
-+
-+ cpu_relax();
-+
-+ spin_lock(&dev->power.lock);
-+ goto repeat;
-+ }
-+
- /* Wait for the other suspend running in parallel with us. */
- for (;;) {
- prepare_to_wait(&dev->power.wait_queue, &wait,
-@@ -496,6 +511,15 @@ static int rpm_resume(struct device *dev, int rpmflags)
- goto out;
- }
-
-+ if (dev->power.irq_safe) {
-+ spin_unlock(&dev->power.lock);
-+
-+ cpu_relax();
-+
-+ spin_lock(&dev->power.lock);
-+ goto repeat;
-+ }
-+
- /* Wait for the operation carried out in parallel with us. */
- for (;;) {
- prepare_to_wait(&dev->power.wait_queue, &wait,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0069-PM-Runtime-Introduce-trace-points-for-tracing-rpm_-f.patch b/patches.runtime_pm/0069-PM-Runtime-Introduce-trace-points-for-tracing-rpm_-f.patch
deleted file mode 100644
index d561ad838c442f..00000000000000
--- a/patches.runtime_pm/0069-PM-Runtime-Introduce-trace-points-for-tracing-rpm_-f.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From ac521a3ac1cd25c44c786a5ef4099b389eb2fc07 Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Tue, 27 Sep 2011 22:53:27 +0200
-Subject: PM / Runtime: Introduce trace points for tracing rpm_* functions
-
-This patch introduces 3 trace points to prepare for tracing
-rpm_idle/rpm_suspend/rpm_resume functions, so we can use these
-trace points to replace the current dev_dbg().
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Acked-by: Steven Rostedt <rostedt@goodmis.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 53b615ccca567ada1931eb04ad0614ac150c14a3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/trace/events/rpm.h | 99 ++++++++++++++++++++++++++++++++++++++++++++
- kernel/trace/Makefile | 1 +
- kernel/trace/rpm-traces.c | 20 +++++++++
- 3 files changed, 120 insertions(+)
- create mode 100644 include/trace/events/rpm.h
- create mode 100644 kernel/trace/rpm-traces.c
-
-diff --git a/include/trace/events/rpm.h b/include/trace/events/rpm.h
-new file mode 100644
-index 0000000..d62c558
---- /dev/null
-+++ b/include/trace/events/rpm.h
-@@ -0,0 +1,99 @@
-+
-+#undef TRACE_SYSTEM
-+#define TRACE_SYSTEM rpm
-+
-+#if !defined(_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
-+#define _TRACE_RUNTIME_POWER_H
-+
-+#include <linux/ktime.h>
-+#include <linux/tracepoint.h>
-+#include <linux/device.h>
-+
-+/*
-+ * The rpm_internal events are used for tracing some important
-+ * runtime pm internal functions.
-+ */
-+DECLARE_EVENT_CLASS(rpm_internal,
-+
-+ TP_PROTO(struct device *dev, int flags),
-+
-+ TP_ARGS(dev, flags),
-+
-+ TP_STRUCT__entry(
-+ __string( name, dev_name(dev) )
-+ __field( int, flags )
-+ __field( int , usage_count )
-+ __field( int , disable_depth )
-+ __field( int , runtime_auto )
-+ __field( int , request_pending )
-+ __field( int , irq_safe )
-+ __field( int , child_count )
-+ ),
-+
-+ TP_fast_assign(
-+ __assign_str(name, dev_name(dev));
-+ __entry->flags = flags;
-+ __entry->usage_count = atomic_read(
-+ &dev->power.usage_count);
-+ __entry->disable_depth = dev->power.disable_depth;
-+ __entry->runtime_auto = dev->power.runtime_auto;
-+ __entry->request_pending = dev->power.request_pending;
-+ __entry->irq_safe = dev->power.irq_safe;
-+ __entry->child_count = atomic_read(
-+ &dev->power.child_count);
-+ ),
-+
-+ TP_printk("%s flags-%x cnt-%-2d dep-%-2d auto-%-1d p-%-1d"
-+ " irq-%-1d child-%d",
-+ __get_str(name), __entry->flags,
-+ __entry->usage_count,
-+ __entry->disable_depth,
-+ __entry->runtime_auto,
-+ __entry->request_pending,
-+ __entry->irq_safe,
-+ __entry->child_count
-+ )
-+);
-+DEFINE_EVENT(rpm_internal, rpm_suspend,
-+
-+ TP_PROTO(struct device *dev, int flags),
-+
-+ TP_ARGS(dev, flags)
-+);
-+DEFINE_EVENT(rpm_internal, rpm_resume,
-+
-+ TP_PROTO(struct device *dev, int flags),
-+
-+ TP_ARGS(dev, flags)
-+);
-+DEFINE_EVENT(rpm_internal, rpm_idle,
-+
-+ TP_PROTO(struct device *dev, int flags),
-+
-+ TP_ARGS(dev, flags)
-+);
-+
-+TRACE_EVENT(rpm_return_int,
-+ TP_PROTO(struct device *dev, unsigned long ip, int ret),
-+ TP_ARGS(dev, ip, ret),
-+
-+ TP_STRUCT__entry(
-+ __string( name, dev_name(dev))
-+ __field( unsigned long, ip )
-+ __field( int, ret )
-+ ),
-+
-+ TP_fast_assign(
-+ __assign_str(name, dev_name(dev));
-+ __entry->ip = ip;
-+ __entry->ret = ret;
-+ ),
-+
-+ TP_printk("%pS:%s ret=%d", (void *)__entry->ip, __get_str(name),
-+ __entry->ret)
-+);
-+
-+#endif /* _TRACE_RUNTIME_POWER_H */
-+
-+/* This part must be outside protection */
-+#include <trace/define_trace.h>
-diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
-index 761c510..56bdab5 100644
---- a/kernel/trace/Makefile
-+++ b/kernel/trace/Makefile
-@@ -53,6 +53,7 @@ endif
- obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
- obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
- obj-$(CONFIG_TRACEPOINTS) += power-traces.o
-+obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o
- ifeq ($(CONFIG_TRACING),y)
- obj-$(CONFIG_KGDB_KDB) += trace_kdb.o
- endif
-diff --git a/kernel/trace/rpm-traces.c b/kernel/trace/rpm-traces.c
-new file mode 100644
-index 0000000..4b3b5ea
---- /dev/null
-+++ b/kernel/trace/rpm-traces.c
-@@ -0,0 +1,20 @@
-+/*
-+ * Power trace points
-+ *
-+ * Copyright (C) 2009 Ming Lei <ming.lei@canonical.com>
-+ */
-+
-+#include <linux/string.h>
-+#include <linux/types.h>
-+#include <linux/workqueue.h>
-+#include <linux/sched.h>
-+#include <linux/module.h>
-+#include <linux/usb.h>
-+
-+#define CREATE_TRACE_POINTS
-+#include <trace/events/rpm.h>
-+
-+EXPORT_TRACEPOINT_SYMBOL_GPL(rpm_return_int);
-+EXPORT_TRACEPOINT_SYMBOL_GPL(rpm_idle);
-+EXPORT_TRACEPOINT_SYMBOL_GPL(rpm_suspend);
-+EXPORT_TRACEPOINT_SYMBOL_GPL(rpm_resume);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0070-PM-Tracing-build-rpm-traces.c-only-if-CONFIG_PM_RUNT.patch b/patches.runtime_pm/0070-PM-Tracing-build-rpm-traces.c-only-if-CONFIG_PM_RUNT.patch
deleted file mode 100644
index 7ca34c11f67603..00000000000000
--- a/patches.runtime_pm/0070-PM-Tracing-build-rpm-traces.c-only-if-CONFIG_PM_RUNT.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 959fd5b540ba24def2cdd4fcf044c9c816bf64d8 Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Thu, 29 Sep 2011 22:07:23 +0200
-Subject: PM / Tracing: build rpm-traces.c only if CONFIG_PM_RUNTIME is set
-
-Do not build kernel/trace/rpm-traces.c if CONFIG_PM_RUNTIME is not
-set, which avoids a build failure.
-
-[rjw: Added the changelog and modified the subject slightly.]
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2a5306cc5f383b0e7414c75e458111afd4a563a4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/trace/Makefile | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
-index 56bdab5..f49405f 100644
---- a/kernel/trace/Makefile
-+++ b/kernel/trace/Makefile
-@@ -53,7 +53,9 @@ endif
- obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
- obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
- obj-$(CONFIG_TRACEPOINTS) += power-traces.o
-+ifeq ($(CONFIG_PM_RUNTIME),y)
- obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o
-+endif
- ifeq ($(CONFIG_TRACING),y)
- obj-$(CONFIG_KGDB_KDB) += trace_kdb.o
- endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0071-PM-Runtime-Replace-dev_dbg-with-trace_rpm_.patch b/patches.runtime_pm/0071-PM-Runtime-Replace-dev_dbg-with-trace_rpm_.patch
deleted file mode 100644
index 352b2d88f13e92..00000000000000
--- a/patches.runtime_pm/0071-PM-Runtime-Replace-dev_dbg-with-trace_rpm_.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From bd308f6cc9e3a2a842de0c1e953dcb5e4a5c352a Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Tue, 27 Sep 2011 22:54:41 +0200
-Subject: PM / Runtime: Replace dev_dbg() with trace_rpm_*()
-
-This patch replaces dev_dbg with trace_rpm_* inside
-the three important functions:
-
- rpm_idle
- rpm_suspend
- rpm_resume
-
-Trace points have the below advantages compared with dev_dbg:
-
- - trace points include much runtime information(such as
- running cpu, current task, ...)
-
- - most of linux distributions may disable "verbose debug"
- driver debug compile switch, so it is very difficult to
- report/debug runtime pm related problems from distribution
- users without this kind of debug information.
-
- - for upstream kernel users, enableing the debug switch will
- produce many useless "rpm_resume" output, and it is very noise.
-
- - dev_dbg inside rpm_suspend/rpm_resume may have some effects
- on runtime pm behaviour of console devicer
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Acked-by: Steven Rostedt <rostedt@goodmis.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c3dc2f14622a06488f11452b6efd1e02c5a8548b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index aecb2a8..7a6fb5e 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -9,6 +9,7 @@
-
- #include <linux/sched.h>
- #include <linux/pm_runtime.h>
-+#include <trace/events/rpm.h>
- #include "power.h"
-
- static int rpm_resume(struct device *dev, int rpmflags);
-@@ -196,6 +197,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
- int (*callback)(struct device *);
- int retval;
-
-+ trace_rpm_idle(dev, rpmflags);
- retval = rpm_check_suspend_allowed(dev);
- if (retval < 0)
- ; /* Conditions are wrong. */
-@@ -257,6 +259,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
- wake_up_all(&dev->power.wait_queue);
-
- out:
-+ trace_rpm_return_int(dev, _THIS_IP_, retval);
- return retval;
- }
-
-@@ -301,7 +304,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- struct device *parent = NULL;
- int retval;
-
-- dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags);
-+ trace_rpm_suspend(dev, rpmflags);
-
- repeat:
- retval = rpm_check_suspend_allowed(dev);
-@@ -445,7 +448,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- }
-
- out:
-- dev_dbg(dev, "%s returns %d\n", __func__, retval);
-+ trace_rpm_return_int(dev, _THIS_IP_, retval);
-
- return retval;
- }
-@@ -474,7 +477,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
- struct device *parent = NULL;
- int retval = 0;
-
-- dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags);
-+ trace_rpm_resume(dev, rpmflags);
-
- repeat:
- if (dev->power.runtime_error)
-@@ -639,7 +642,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
- spin_lock_irq(&dev->power.lock);
- }
-
-- dev_dbg(dev, "%s returns %d\n", __func__, retval);
-+ trace_rpm_return_int(dev, _THIS_IP_, retval);
-
- return retval;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0072-PM-OPP-Add-OPP-availability-change-notifier.patch b/patches.runtime_pm/0072-PM-OPP-Add-OPP-availability-change-notifier.patch
deleted file mode 100644
index 3d0432e552ae1a..00000000000000
--- a/patches.runtime_pm/0072-PM-OPP-Add-OPP-availability-change-notifier.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From f467404a23d35af4631fd0472c6e7d7416210bfe Mon Sep 17 00:00:00 2001
-From: MyungJoo Ham <myungjoo.ham@samsung.com>
-Date: Fri, 30 Sep 2011 22:35:12 +0200
-Subject: PM / OPP: Add OPP availability change notifier.
-
-The patch enables to register notifier_block for an OPP-device in order
-to get notified for any changes in the availability of OPPs of the
-device. For example, if a new OPP is inserted or enable/disable status
-of an OPP is changed, the notifier is executed.
-
-This enables the usage of opp_add, opp_enable, and opp_disable to
-directly take effect with any connected entities such as cpufreq or
-devfreq.
-
-Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-Reviewed-by: Mike Turquette <mturquette@ti.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 03ca370fbf7b76d6d002380dbdc2cdc2319f9c80)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/opp.c | 30 ++++++++++++++++++++++++++++++
- include/linux/opp.h | 12 ++++++++++++
- 2 files changed, 42 insertions(+)
-
-diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
-index b23de18..434a6c0 100644
---- a/drivers/base/power/opp.c
-+++ b/drivers/base/power/opp.c
-@@ -73,6 +73,7 @@ struct opp {
- * RCU usage: nodes are not modified in the list of device_opp,
- * however addition is possible and is secured by dev_opp_list_lock
- * @dev: device pointer
-+ * @head: notifier head to notify the OPP availability changes.
- * @opp_list: list of opps
- *
- * This is an internal data structure maintaining the link to opps attached to
-@@ -83,6 +84,7 @@ struct device_opp {
- struct list_head node;
-
- struct device *dev;
-+ struct srcu_notifier_head head;
- struct list_head opp_list;
- };
-
-@@ -404,6 +406,7 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
- }
-
- dev_opp->dev = dev;
-+ srcu_init_notifier_head(&dev_opp->head);
- INIT_LIST_HEAD(&dev_opp->opp_list);
-
- /* Secure the device list modification */
-@@ -428,6 +431,11 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
- list_add_rcu(&new_opp->node, head);
- mutex_unlock(&dev_opp_list_lock);
-
-+ /*
-+ * Notify the changes in the availability of the operable
-+ * frequency/voltage list.
-+ */
-+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp);
- return 0;
- }
-
-@@ -504,6 +512,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
- mutex_unlock(&dev_opp_list_lock);
- synchronize_rcu();
-
-+ /* Notify the change of the OPP availability */
-+ if (availability_req)
-+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ENABLE,
-+ new_opp);
-+ else
-+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE,
-+ new_opp);
-+
- /* clean up old opp */
- new_opp = opp;
- goto out;
-@@ -643,3 +659,17 @@ void opp_free_cpufreq_table(struct device *dev,
- *table = NULL;
- }
- #endif /* CONFIG_CPU_FREQ */
-+
-+/**
-+ * opp_get_notifier() - find notifier_head of the device with opp
-+ * @dev: device pointer used to lookup device OPPs.
-+ */
-+struct srcu_notifier_head *opp_get_notifier(struct device *dev)
-+{
-+ struct device_opp *dev_opp = find_device_opp(dev);
-+
-+ if (IS_ERR(dev_opp))
-+ return ERR_PTR(PTR_ERR(dev_opp)); /* matching type */
-+
-+ return &dev_opp->head;
-+}
-diff --git a/include/linux/opp.h b/include/linux/opp.h
-index 7020e97..87a9208 100644
---- a/include/linux/opp.h
-+++ b/include/linux/opp.h
-@@ -16,9 +16,14 @@
-
- #include <linux/err.h>
- #include <linux/cpufreq.h>
-+#include <linux/notifier.h>
-
- struct opp;
-
-+enum opp_event {
-+ OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
-+};
-+
- #if defined(CONFIG_PM_OPP)
-
- unsigned long opp_get_voltage(struct opp *opp);
-@@ -40,6 +45,8 @@ int opp_enable(struct device *dev, unsigned long freq);
-
- int opp_disable(struct device *dev, unsigned long freq);
-
-+struct srcu_notifier_head *opp_get_notifier(struct device *dev);
-+
- #else
- static inline unsigned long opp_get_voltage(struct opp *opp)
- {
-@@ -89,6 +96,11 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
- {
- return 0;
- }
-+
-+struct srcu_notifier_head *opp_get_notifier(struct device *dev)
-+{
-+ return ERR_PTR(-EINVAL);
-+}
- #endif /* CONFIG_PM */
-
- #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0073-PM-OPP-Fix-build-when-CONFIG_PM_OPP-is-not-set.patch b/patches.runtime_pm/0073-PM-OPP-Fix-build-when-CONFIG_PM_OPP-is-not-set.patch
deleted file mode 100644
index 787b3f145affd9..00000000000000
--- a/patches.runtime_pm/0073-PM-OPP-Fix-build-when-CONFIG_PM_OPP-is-not-set.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From c744edfd846b87b4d6e9862546553ff9c2094674 Mon Sep 17 00:00:00 2001
-From: Tony Lindgren <tony@atomide.com>
-Date: Thu, 3 Nov 2011 10:12:27 +0100
-Subject: PM / OPP: Fix build when CONFIG_PM_OPP is not set
-
-Commit 03ca370fbf7b76d6d002380dbdc2cdc2319f9c80 (PM / OPP: Add
-OPP availability change notifier) does not compile if CONFIG_PM_OPP
-is not set:
-
-arch/arm/plat-omap/omap-pm-noop.o: In function `opp_get_notifier':
-include/linux/opp.h:103: multiple definition of `opp_get_notifier'
-include/linux/opp.h:103: first defined here
-
-Also fix incorrect comment.
-
-Signed-off-by: Tony Lindgren <tony@atomide.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a96d69d1b02c4a526bd8c07e0cb10c129025c88c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/opp.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/linux/opp.h b/include/linux/opp.h
-index 87a9208..ee94b33 100644
---- a/include/linux/opp.h
-+++ b/include/linux/opp.h
-@@ -97,11 +97,11 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
- return 0;
- }
-
--struct srcu_notifier_head *opp_get_notifier(struct device *dev)
-+static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev)
- {
- return ERR_PTR(-EINVAL);
- }
--#endif /* CONFIG_PM */
-+#endif /* CONFIG_PM_OPP */
-
- #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
- int opp_init_cpufreq_table(struct device *dev,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0074-PM-QoS-Add-function-dev_pm_qos_read_value-v3.patch b/patches.runtime_pm/0074-PM-QoS-Add-function-dev_pm_qos_read_value-v3.patch
deleted file mode 100644
index a22e7eb2c72195..00000000000000
--- a/patches.runtime_pm/0074-PM-QoS-Add-function-dev_pm_qos_read_value-v3.patch
+++ /dev/null
@@ -1,463 +0,0 @@
-From c64acaafb72c31d2afed02554cca37317f9599c2 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 29 Sep 2011 22:29:44 +0200
-Subject: PM / QoS: Add function dev_pm_qos_read_value() (v3)
-
-To read the current PM QoS value for a given device we need to
-make sure that the device's power.constraints object won't be
-removed while we're doing that. For this reason, put the
-operation under dev->power.lock and acquire the lock
-around the initialization and removal of power.constraints.
-
-Moreover, since we're using the value of power.constraints to
-determine whether or not the object is present, the
-power.constraints_state field isn't necessary any more and may be
-removed. However, dev_pm_qos_add_request() needs to check if the
-device is being removed from the system before allocating a new
-PM QoS constraints object for it, so make it use the
-power.power_state field of struct device for this purpose.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 1a9a91525d806f2b3bd8b57b963755a96fd36ce2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 6 +-
- drivers/base/power/power.h | 10 ++-
- drivers/base/power/qos.c | 160 +++++++++++++++++++++++++-------------------
- include/linux/pm.h | 10 +--
- include/linux/pm_qos.h | 12 +++-
- 5 files changed, 114 insertions(+), 84 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 956443f..c6291ab 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -22,7 +22,6 @@
- #include <linux/mutex.h>
- #include <linux/pm.h>
- #include <linux/pm_runtime.h>
--#include <linux/pm_qos.h>
- #include <linux/resume-trace.h>
- #include <linux/interrupt.h>
- #include <linux/sched.h>
-@@ -66,6 +65,7 @@ void device_pm_init(struct device *dev)
- spin_lock_init(&dev->power.lock);
- pm_runtime_init(dev);
- INIT_LIST_HEAD(&dev->power.entry);
-+ dev->power.power_state = PMSG_INVALID;
- }
-
- /**
-@@ -97,8 +97,8 @@ void device_pm_add(struct device *dev)
- dev_warn(dev, "parent %s should not be sleeping\n",
- dev_name(dev->parent));
- list_add_tail(&dev->power.entry, &dpm_list);
-- mutex_unlock(&dpm_list_mtx);
- dev_pm_qos_constraints_init(dev);
-+ mutex_unlock(&dpm_list_mtx);
- }
-
- /**
-@@ -109,9 +109,9 @@ void device_pm_remove(struct device *dev)
- {
- pr_debug("PM: Removing info for %s:%s\n",
- dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
-- dev_pm_qos_constraints_destroy(dev);
- complete_all(&dev->power.completion);
- mutex_lock(&dpm_list_mtx);
-+ dev_pm_qos_constraints_destroy(dev);
- list_del_init(&dev->power.entry);
- mutex_unlock(&dpm_list_mtx);
- device_wakeup_disable(dev);
-diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
-index f2a25f1..9bf6232 100644
---- a/drivers/base/power/power.h
-+++ b/drivers/base/power/power.h
-@@ -1,3 +1,5 @@
-+#include <linux/pm_qos.h>
-+
- #ifdef CONFIG_PM_RUNTIME
-
- extern void pm_runtime_init(struct device *dev);
-@@ -35,15 +37,21 @@ extern void device_pm_move_last(struct device *);
- static inline void device_pm_init(struct device *dev)
- {
- spin_lock_init(&dev->power.lock);
-+ dev->power.power_state = PMSG_INVALID;
- pm_runtime_init(dev);
- }
-
-+static inline void device_pm_add(struct device *dev)
-+{
-+ dev_pm_qos_constraints_init(dev);
-+}
-+
- static inline void device_pm_remove(struct device *dev)
- {
-+ dev_pm_qos_constraints_destroy(dev);
- pm_runtime_remove(dev);
- }
-
--static inline void device_pm_add(struct device *dev) {}
- static inline void device_pm_move_before(struct device *deva,
- struct device *devb) {}
- static inline void device_pm_move_after(struct device *deva,
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index 8d0b811..91e0614 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -30,15 +30,6 @@
- * . To minimize the data usage by the per-device constraints, the data struct
- * is only allocated at the first call to dev_pm_qos_add_request.
- * . The data is later free'd when the device is removed from the system.
-- * . The constraints_state variable from dev_pm_info tracks the data struct
-- * allocation state:
-- * DEV_PM_QOS_NO_DEVICE: No device present or device removed, no data
-- * allocated,
-- * DEV_PM_QOS_DEVICE_PRESENT: Device present, data not allocated and will be
-- * allocated at the first call to dev_pm_qos_add_request,
-- * DEV_PM_QOS_ALLOCATED: Device present, data allocated. The per-device
-- * PM QoS constraints framework is operational and constraints can be
-- * added, updated or removed using the dev_pm_qos_* API.
- * . A global mutex protects the constraints users from the data being
- * allocated and free'd.
- */
-@@ -51,8 +42,30 @@
-
-
- static DEFINE_MUTEX(dev_pm_qos_mtx);
-+
- static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
-
-+/**
-+ * dev_pm_qos_read_value - Get PM QoS constraint for a given device.
-+ * @dev: Device to get the PM QoS constraint value for.
-+ */
-+s32 dev_pm_qos_read_value(struct device *dev)
-+{
-+ struct pm_qos_constraints *c;
-+ unsigned long flags;
-+ s32 ret = 0;
-+
-+ spin_lock_irqsave(&dev->power.lock, flags);
-+
-+ c = dev->power.constraints;
-+ if (c)
-+ ret = pm_qos_read_value(c);
-+
-+ spin_unlock_irqrestore(&dev->power.lock, flags);
-+
-+ return ret;
-+}
-+
- /*
- * apply_constraint
- * @req: constraint request to apply
-@@ -105,27 +118,31 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
- }
- BLOCKING_INIT_NOTIFIER_HEAD(n);
-
-+ plist_head_init(&c->list);
-+ c->target_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-+ c->default_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-+ c->type = PM_QOS_MIN;
-+ c->notifiers = n;
-+
-+ spin_lock_irq(&dev->power.lock);
- dev->power.constraints = c;
-- plist_head_init(&dev->power.constraints->list);
-- dev->power.constraints->target_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-- dev->power.constraints->default_value = PM_QOS_DEV_LAT_DEFAULT_VALUE;
-- dev->power.constraints->type = PM_QOS_MIN;
-- dev->power.constraints->notifiers = n;
-- dev->power.constraints_state = DEV_PM_QOS_ALLOCATED;
-+ spin_unlock_irq(&dev->power.lock);
-
- return 0;
- }
-
- /**
-- * dev_pm_qos_constraints_init
-+ * dev_pm_qos_constraints_init - Initalize device's PM QoS constraints pointer.
- * @dev: target device
- *
-- * Called from the device PM subsystem at device insertion
-+ * Called from the device PM subsystem during device insertion under
-+ * device_pm_lock().
- */
- void dev_pm_qos_constraints_init(struct device *dev)
- {
- mutex_lock(&dev_pm_qos_mtx);
-- dev->power.constraints_state = DEV_PM_QOS_DEVICE_PRESENT;
-+ dev->power.constraints = NULL;
-+ dev->power.power_state = PMSG_ON;
- mutex_unlock(&dev_pm_qos_mtx);
- }
-
-@@ -133,34 +150,38 @@ void dev_pm_qos_constraints_init(struct device *dev)
- * dev_pm_qos_constraints_destroy
- * @dev: target device
- *
-- * Called from the device PM subsystem at device removal
-+ * Called from the device PM subsystem on device removal under device_pm_lock().
- */
- void dev_pm_qos_constraints_destroy(struct device *dev)
- {
- struct dev_pm_qos_request *req, *tmp;
-+ struct pm_qos_constraints *c;
-
- mutex_lock(&dev_pm_qos_mtx);
-
-- if (dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-- /* Flush the constraints list for the device */
-- plist_for_each_entry_safe(req, tmp,
-- &dev->power.constraints->list,
-- node) {
-- /*
-- * Update constraints list and call the notification
-- * callbacks if needed
-- */
-- apply_constraint(req, PM_QOS_REMOVE_REQ,
-- PM_QOS_DEFAULT_VALUE);
-- memset(req, 0, sizeof(*req));
-- }
-+ dev->power.power_state = PMSG_INVALID;
-+ c = dev->power.constraints;
-+ if (!c)
-+ goto out;
-
-- kfree(dev->power.constraints->notifiers);
-- kfree(dev->power.constraints);
-- dev->power.constraints = NULL;
-+ /* Flush the constraints list for the device */
-+ plist_for_each_entry_safe(req, tmp, &c->list, node) {
-+ /*
-+ * Update constraints list and call the notification
-+ * callbacks if needed
-+ */
-+ apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
-+ memset(req, 0, sizeof(*req));
- }
-- dev->power.constraints_state = DEV_PM_QOS_NO_DEVICE;
-
-+ spin_lock_irq(&dev->power.lock);
-+ dev->power.constraints = NULL;
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ kfree(c->notifiers);
-+ kfree(c);
-+
-+ out:
- mutex_unlock(&dev_pm_qos_mtx);
- }
-
-@@ -178,8 +199,9 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
- *
- * Returns 1 if the aggregated constraint value has changed,
- * 0 if the aggregated constraint value has not changed,
-- * -EINVAL in case of wrong parameters, -ENODEV if the device has been
-- * removed from the system
-+ * -EINVAL in case of wrong parameters, -ENOMEM if there's not enough memory
-+ * to allocate for data structures, -ENODEV if the device has just been removed
-+ * from the system.
- */
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- s32 value)
-@@ -195,28 +217,32 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- return -EINVAL;
- }
-
-- mutex_lock(&dev_pm_qos_mtx);
- req->dev = dev;
-
-- /* Return if the device has been removed */
-- if (req->dev->power.constraints_state == DEV_PM_QOS_NO_DEVICE) {
-- ret = -ENODEV;
-- goto out;
-- }
-+ mutex_lock(&dev_pm_qos_mtx);
-
-- /*
-- * Allocate the constraints data on the first call to add_request,
-- * i.e. only if the data is not already allocated and if the device has
-- * not been removed
-- */
-- if (dev->power.constraints_state == DEV_PM_QOS_DEVICE_PRESENT)
-- ret = dev_pm_qos_constraints_allocate(dev);
-+ if (!dev->power.constraints) {
-+ if (dev->power.power_state.event == PM_EVENT_INVALID) {
-+ /* The device has been removed from the system. */
-+ req->dev = NULL;
-+ ret = -ENODEV;
-+ goto out;
-+ } else {
-+ /*
-+ * Allocate the constraints data on the first call to
-+ * add_request, i.e. only if the data is not already
-+ * allocated and if the device has not been removed.
-+ */
-+ ret = dev_pm_qos_constraints_allocate(dev);
-+ }
-+ }
-
- if (!ret)
- ret = apply_constraint(req, PM_QOS_ADD_REQ, value);
-
--out:
-+ out:
- mutex_unlock(&dev_pm_qos_mtx);
-+
- return ret;
- }
- EXPORT_SYMBOL_GPL(dev_pm_qos_add_request);
-@@ -252,7 +278,7 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
-
- mutex_lock(&dev_pm_qos_mtx);
-
-- if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-+ if (req->dev->power.constraints) {
- if (new_value != req->node.prio)
- ret = apply_constraint(req, PM_QOS_UPDATE_REQ,
- new_value);
-@@ -293,7 +319,7 @@ int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
-
- mutex_lock(&dev_pm_qos_mtx);
-
-- if (req->dev->power.constraints_state == DEV_PM_QOS_ALLOCATED) {
-+ if (req->dev->power.constraints) {
- ret = apply_constraint(req, PM_QOS_REMOVE_REQ,
- PM_QOS_DEFAULT_VALUE);
- memset(req, 0, sizeof(*req));
-@@ -323,15 +349,12 @@ int dev_pm_qos_add_notifier(struct device *dev, struct notifier_block *notifier)
-
- mutex_lock(&dev_pm_qos_mtx);
-
-- /* Silently return if the device has been removed */
-- if (dev->power.constraints_state != DEV_PM_QOS_ALLOCATED)
-- goto out;
--
-- retval = blocking_notifier_chain_register(
-- dev->power.constraints->notifiers,
-- notifier);
-+ /* Silently return if the constraints object is not present. */
-+ if (dev->power.constraints)
-+ retval = blocking_notifier_chain_register(
-+ dev->power.constraints->notifiers,
-+ notifier);
-
--out:
- mutex_unlock(&dev_pm_qos_mtx);
- return retval;
- }
-@@ -354,15 +377,12 @@ int dev_pm_qos_remove_notifier(struct device *dev,
-
- mutex_lock(&dev_pm_qos_mtx);
-
-- /* Silently return if the device has been removed */
-- if (dev->power.constraints_state != DEV_PM_QOS_ALLOCATED)
-- goto out;
--
-- retval = blocking_notifier_chain_unregister(
-- dev->power.constraints->notifiers,
-- notifier);
-+ /* Silently return if the constraints object is not present. */
-+ if (dev->power.constraints)
-+ retval = blocking_notifier_chain_unregister(
-+ dev->power.constraints->notifiers,
-+ notifier);
-
--out:
- mutex_unlock(&dev_pm_qos_mtx);
- return retval;
- }
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 70b79e7..91f248b 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -326,6 +326,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
- * requested by a driver.
- */
-
-+#define PM_EVENT_INVALID (-1)
- #define PM_EVENT_ON 0x0000
- #define PM_EVENT_FREEZE 0x0001
- #define PM_EVENT_SUSPEND 0x0002
-@@ -346,6 +347,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
- #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND)
- #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME)
-
-+#define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, })
- #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
- #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
- #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, })
-@@ -421,13 +423,6 @@ enum rpm_request {
- RPM_REQ_RESUME,
- };
-
--/* Per-device PM QoS constraints data struct state */
--enum dev_pm_qos_state {
-- DEV_PM_QOS_NO_DEVICE, /* No device present */
-- DEV_PM_QOS_DEVICE_PRESENT, /* Device present, data not allocated */
-- DEV_PM_QOS_ALLOCATED, /* Device present, data allocated */
--};
--
- struct wakeup_source;
-
- struct pm_domain_data {
-@@ -489,7 +484,6 @@ struct dev_pm_info {
- #endif
- struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
- struct pm_qos_constraints *constraints;
-- enum dev_pm_qos_state constraints_state;
- };
-
- extern void update_pm_runtime_accounting(struct device *dev);
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index ca7bd3f..83b0ea3 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -7,6 +7,7 @@
- #include <linux/plist.h>
- #include <linux/notifier.h>
- #include <linux/miscdevice.h>
-+#include <linux/device.h>
-
- #define PM_QOS_RESERVED 0
- #define PM_QOS_CPU_DMA_LATENCY 1
-@@ -77,6 +78,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
- s32 pm_qos_read_value(struct pm_qos_constraints *c);
-
-+s32 dev_pm_qos_read_value(struct device *dev);
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- s32 value);
- int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
-@@ -117,6 +119,8 @@ static inline int pm_qos_request_active(struct pm_qos_request *req)
- static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
- { return 0; }
-
-+static inline s32 dev_pm_qos_read_value(struct device *dev)
-+ { return 0; }
- static inline int dev_pm_qos_add_request(struct device *dev,
- struct dev_pm_qos_request *req,
- s32 value)
-@@ -139,9 +143,13 @@ static inline int dev_pm_qos_remove_global_notifier(
- struct notifier_block *notifier)
- { return 0; }
- static inline void dev_pm_qos_constraints_init(struct device *dev)
-- { return; }
-+{
-+ dev->power.power_state = PMSG_ON;
-+}
- static inline void dev_pm_qos_constraints_destroy(struct device *dev)
-- { return; }
-+{
-+ dev->power.power_state = PMSG_INVALID;
-+}
- #endif
-
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0075-PM-QoS-Update-Documentation-for-the-pm_qos-and-dev_p.patch b/patches.runtime_pm/0075-PM-QoS-Update-Documentation-for-the-pm_qos-and-dev_p.patch
deleted file mode 100644
index 2356da24b394b4..00000000000000
--- a/patches.runtime_pm/0075-PM-QoS-Update-Documentation-for-the-pm_qos-and-dev_p.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 1b43e3f5a9129a6a94f426c70feb7af110710cd3 Mon Sep 17 00:00:00 2001
-From: Jean Pihet <j-pihet@ti.com>
-Date: Tue, 4 Oct 2011 21:54:45 +0200
-Subject: PM / QoS: Update Documentation for the pm_qos and dev_pm_qos
- frameworks
-
-Update the documentation for the recently updated pm_qos API, kernel
-and user space. Add documentation for the per-device PM QoS
-(dev_pm_qos) framework API.
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e3cba3243eb853a052613c804dea033bc4c9cf2d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/pm_qos_interface.txt | 92 ++++++++++++++++++++++++++++--
- 1 file changed, 87 insertions(+), 5 deletions(-)
-
-diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
-index bfed898..17e130a 100644
---- a/Documentation/power/pm_qos_interface.txt
-+++ b/Documentation/power/pm_qos_interface.txt
-@@ -4,14 +4,19 @@ This interface provides a kernel and user mode interface for registering
- performance expectations by drivers, subsystems and user space applications on
- one of the parameters.
-
--Currently we have {cpu_dma_latency, network_latency, network_throughput} as the
--initial set of pm_qos parameters.
-+Two different PM QoS frameworks are available:
-+1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput.
-+2. the per-device PM QoS framework provides the API to manage the per-device latency
-+constraints.
-
- Each parameters have defined units:
- * latency: usec
- * timeout: usec
- * throughput: kbs (kilo bit / sec)
-
-+
-+1. PM QoS framework
-+
- The infrastructure exposes multiple misc device nodes one per implemented
- parameter. The set of parameters implement is defined by pm_qos_power_init()
- and pm_qos_params.h. This is done because having the available parameters
-@@ -23,14 +28,18 @@ an aggregated target value. The aggregated target value is updated with
- changes to the request list or elements of the list. Typically the
- aggregated target value is simply the max or min of the request values held
- in the parameter list elements.
-+Note: the aggregated target value is implemented as an atomic variable so that
-+reading the aggregated value does not require any locking mechanism.
-+
-
- From kernel mode the use of this interface is simple:
-
--handle = pm_qos_add_request(param_class, target_value):
--Will insert an element into the list for that identified PM_QOS class with the
-+void pm_qos_add_request(handle, param_class, target_value):
-+Will insert an element into the list for that identified PM QoS class with the
- target value. Upon change to this list the new target is recomputed and any
- registered notifiers are called only if the target value is now different.
--Clients of pm_qos need to save the returned handle.
-+Clients of pm_qos need to save the returned handle for future use in other
-+pm_qos API functions.
-
- void pm_qos_update_request(handle, new_target_value):
- Will update the list element pointed to by the handle with the new target value
-@@ -42,6 +51,20 @@ Will remove the element. After removal it will update the aggregate target and
- call the notification tree if the target was changed as a result of removing
- the request.
-
-+int pm_qos_request(param_class):
-+Returns the aggregated value for a given PM QoS class.
-+
-+int pm_qos_request_active(handle):
-+Returns if the request is still active, i.e. it has not been removed from a
-+PM QoS class constraints list.
-+
-+int pm_qos_add_notifier(param_class, notifier):
-+Adds a notification callback function to the PM QoS class. The callback is
-+called when the aggregated value for the PM QoS class is changed.
-+
-+int pm_qos_remove_notifier(int param_class, notifier):
-+Removes the notification callback function for the PM QoS class.
-+
-
- From user mode:
- Only processes can register a pm_qos request. To provide for automatic
-@@ -63,4 +86,63 @@ To remove the user mode request for a target value simply close the device
- node.
-
-
-+2. PM QoS per-device latency framework
-+
-+For each device a list of performance requests is maintained along with
-+an aggregated target value. The aggregated target value is updated with
-+changes to the request list or elements of the list. Typically the
-+aggregated target value is simply the max or min of the request values held
-+in the parameter list elements.
-+Note: the aggregated target value is implemented as an atomic variable so that
-+reading the aggregated value does not require any locking mechanism.
-+
-+
-+From kernel mode the use of this interface is the following:
-+
-+int dev_pm_qos_add_request(device, handle, value):
-+Will insert an element into the list for that identified device with the
-+target value. Upon change to this list the new target is recomputed and any
-+registered notifiers are called only if the target value is now different.
-+Clients of dev_pm_qos need to save the handle for future use in other
-+dev_pm_qos API functions.
-+
-+int dev_pm_qos_update_request(handle, new_value):
-+Will update the list element pointed to by the handle with the new target value
-+and recompute the new aggregated target, calling the notification trees if the
-+target is changed.
-+
-+int dev_pm_qos_remove_request(handle):
-+Will remove the element. After removal it will update the aggregate target and
-+call the notification trees if the target was changed as a result of removing
-+the request.
-+
-+s32 dev_pm_qos_read_value(device):
-+Returns the aggregated value for a given device's constraints list.
-+
-+
-+Notification mechanisms:
-+The per-device PM QoS framework has 2 different and distinct notification trees:
-+a per-device notification tree and a global notification tree.
-+
-+int dev_pm_qos_add_notifier(device, notifier):
-+Adds a notification callback function for the device.
-+The callback is called when the aggregated value of the device constraints list
-+is changed.
-+
-+int dev_pm_qos_remove_notifier(device, notifier):
-+Removes the notification callback function for the device.
-+
-+int dev_pm_qos_add_global_notifier(notifier):
-+Adds a notification callback function in the global notification tree of the
-+framework.
-+The callback is called when the aggregated value for any device is changed.
-+
-+int dev_pm_qos_remove_global_notifier(notifier):
-+Removes the notification callback function from the global notification tree
-+of the framework.
-+
-+
-+From user mode:
-+No API for user space access to the per-device latency constraints is provided
-+yet - still under discussion.
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0076-regulator-Fix-some-bitrot-in-the-machine-driver-docu.patch b/patches.runtime_pm/0076-regulator-Fix-some-bitrot-in-the-machine-driver-docu.patch
deleted file mode 100644
index 55d13f689053f0..00000000000000
--- a/patches.runtime_pm/0076-regulator-Fix-some-bitrot-in-the-machine-driver-docu.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From cb3658082b9edebeb0a05f977b1098b1d96e8208 Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Thu, 8 Sep 2011 10:37:31 -0700
-Subject: regulator: Fix some bitrot in the machine driver documentation
-
-The documentation for the machine driver was rather badly bitrotted,
-using pointers to struct device rather than dev_name() to hook up the
-consumers. Update to use dev_name().
-
-Reported-by: Philip Rakity <prakity@marvell.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 2c1ba398ac9da3305815f6ae8e95ae2b9fd3b5ff)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/regulator/machine.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
-index b42419b..311c61f 100644
---- a/Documentation/power/regulator/machine.txt
-+++ b/Documentation/power/regulator/machine.txt
-@@ -16,7 +16,7 @@ initialisation code by creating a struct regulator_consumer_supply for
- each regulator.
-
- struct regulator_consumer_supply {
-- struct device *dev; /* consumer */
-+ const char *dev_name; /* consumer dev_name() */
- const char *supply; /* consumer supply - e.g. "vcc" */
- };
-
-@@ -24,13 +24,13 @@ e.g. for the machine above
-
- static struct regulator_consumer_supply regulator1_consumers[] = {
- {
-- .dev = &platform_consumerB_device.dev,
-- .supply = "Vcc",
-+ .dev_name = "dev_name(consumer B)",
-+ .supply = "Vcc",
- },};
-
- static struct regulator_consumer_supply regulator2_consumers[] = {
- {
-- .dev = &platform_consumerA_device.dev,
-+ .dev = "dev_name(consumer A"),
- .supply = "Vcc",
- },};
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0077-regulator-Clarify-documentation-for-regulator-regula.patch b/patches.runtime_pm/0077-regulator-Clarify-documentation-for-regulator-regula.patch
deleted file mode 100644
index 9d5c1d84a631ac..00000000000000
--- a/patches.runtime_pm/0077-regulator-Clarify-documentation-for-regulator-regula.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From eeac24a0edf936c15f1a4c344c98206ac442e74b Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Thu, 8 Sep 2011 10:38:59 -0700
-Subject: regulator: Clarify documentation for regulator-regulator supplies
-
-The mechanism used for connecting regulators together when one regulator
-supplies another wasn't clear as the names being used weren't really tied
-together well.
-
-Reported-by: Philip Rakity <prakity@marvell.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit c3035a232e87f42b81d8ece1980abd0a2f26d792)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/regulator/machine.txt | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
-index 311c61f..ce63af0 100644
---- a/Documentation/power/regulator/machine.txt
-+++ b/Documentation/power/regulator/machine.txt
-@@ -43,6 +43,7 @@ to their supply regulator :-
-
- static struct regulator_init_data regulator1_data = {
- .constraints = {
-+ .name = "Regulator-1",
- .min_uV = 3300000,
- .max_uV = 3300000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL,
-@@ -51,13 +52,19 @@ static struct regulator_init_data regulator1_data = {
- .consumer_supplies = regulator1_consumers,
- };
-
-+The name field should be set to something that is usefully descriptive
-+for the board for configuration of supplies for other regulators and
-+for use in logging and other diagnostic output. Normally the name
-+used for the supply rail in the schematic is a good choice. If no
-+name is provided then the subsystem will choose one.
-+
- Regulator-1 supplies power to Regulator-2. This relationship must be registered
- with the core so that Regulator-1 is also enabled when Consumer A enables its
- supply (Regulator-2). The supply regulator is set by the supply_regulator
--field below:-
-+field below and co:-
-
- static struct regulator_init_data regulator2_data = {
-- .supply_regulator = "regulator_name",
-+ .supply_regulator = "Regulator-1",
- .constraints = {
- .min_uV = 1800000,
- .max_uV = 2000000,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0078-PM-Runtime-Update-document-about-callbacks.patch b/patches.runtime_pm/0078-PM-Runtime-Update-document-about-callbacks.patch
deleted file mode 100644
index d0e079cfb8a2e2..00000000000000
--- a/patches.runtime_pm/0078-PM-Runtime-Update-document-about-callbacks.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From d373f46b94d651111175a233540950c8b43175b5 Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Sun, 9 Oct 2011 11:40:25 +0800
-Subject: PM / Runtime: Update document about callbacks
-
-Support for device power domains has been introduced in
-commit 9659cc0678b954f187290c6e8b247a673c5d37e1 (PM: Make
-system-wide PM and runtime PM treat subsystems consistently),
-also power domain callbacks will take precedence over subsystem ones
-from commit 4d27e9dcff00a6425d779b065ec8892e4f391661(PM: Make
-power domain callbacks take precedence over subsystem ones).
-
-So update part of "Device Runtime PM Callbacks" in
-Documentation/power/runtime_pm.txt.
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2fb242adcaab5defa2f208775ac4f181ac998fdd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 19 ++++++++++++-------
- 1 file changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 1f05404..0e85608 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -43,13 +43,18 @@ struct dev_pm_ops {
- ...
- };
-
--The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are
--executed by the PM core for either the device type, or the class (if the device
--type's struct dev_pm_ops object does not exist), or the bus type (if the
--device type's and class' struct dev_pm_ops objects do not exist) of the given
--device (this allows device types to override callbacks provided by bus types or
--classes if necessary). The bus type, device type and class callbacks are
--referred to as subsystem-level callbacks in what follows.
-+The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks
-+are executed by the PM core for either the power domain, or the device type
-+(if the device power domain's struct dev_pm_ops does not exist), or the class
-+(if the device power domain's and type's struct dev_pm_ops object does not
-+exist), or the bus type (if the device power domain's, type's and class'
-+struct dev_pm_ops objects do not exist) of the given device, so the priority
-+order of callbacks from high to low is that power domain callbacks, device
-+type callbacks, class callbacks and bus type callbacks, and the high priority
-+one will take precedence over low priority one. The bus type, device type and
-+class callbacks are referred to as subsystem-level callbacks in what follows,
-+and generally speaking, the power domain callbacks are used for representing
-+power domains within a SoC.
-
- By default, the callbacks are always invoked in process context with interrupts
- enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0079-PM-Runtime-Fix-kerneldoc-comment-for-rpm_suspend.patch b/patches.runtime_pm/0079-PM-Runtime-Fix-kerneldoc-comment-for-rpm_suspend.patch
deleted file mode 100644
index 6801c0187fa90d..00000000000000
--- a/patches.runtime_pm/0079-PM-Runtime-Fix-kerneldoc-comment-for-rpm_suspend.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 5fd4a40128aef39588491371e45508501db6c3d6 Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Wed, 12 Oct 2011 11:53:32 +0800
-Subject: PM / Runtime: Fix kerneldoc comment for rpm_suspend()
-
-This patch fix kerneldoc comments for rpm_suspend():
-
- - 'Cancel a pending idle notification' should be put before, also
- should be changed to 'Cancel a pending idle notification,
- autosuspend or suspend'.
-
- - idle notification for the device after succeeding suspend has
- been removed, so update the comment accordingly.
-
-[rjw: Modified the subject and changelog slightly.]
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 47d8f0bac0fda4c15a030f92cd6da6c6bed87459)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 18 ++++++++++--------
- 1 file changed, 10 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 7a6fb5e..aa23a64 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -286,14 +286,16 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- * @dev: Device to suspend.
- * @rpmflags: Flag bits.
- *
-- * Check if the device's runtime PM status allows it to be suspended. If
-- * another suspend has been started earlier, either return immediately or wait
-- * for it to finish, depending on the RPM_NOWAIT and RPM_ASYNC flags. Cancel a
-- * pending idle notification. If the RPM_ASYNC flag is set then queue a
-- * suspend request; otherwise run the ->runtime_suspend() callback directly.
-- * If a deferred resume was requested while the callback was running then carry
-- * it out; otherwise send an idle notification for the device (if the suspend
-- * failed) or for its parent (if the suspend succeeded).
-+ * Check if the device's runtime PM status allows it to be suspended.
-+ * Cancel a pending idle notification, autosuspend or suspend. If
-+ * another suspend has been started earlier, either return immediately
-+ * or wait for it to finish, depending on the RPM_NOWAIT and RPM_ASYNC
-+ * flags. If the RPM_ASYNC flag is set then queue a suspend request;
-+ * otherwise run the ->runtime_suspend() callback directly. If a deferred
-+ * resume was requested while the callback was running then carry it out;
-+ * otherwise send an idle notification for its parent (if the suspend
-+ * succeeded and both ignore_children of parent->power and irq_safe of
-+ * dev->power are not set).
- *
- * This function must be called under dev->power.lock with interrupts disabled.
- */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0080-PM-Runtime-Handle-.runtime_suspend-failure-correctly.patch b/patches.runtime_pm/0080-PM-Runtime-Handle-.runtime_suspend-failure-correctly.patch
deleted file mode 100644
index 4bd0569bc17fe7..00000000000000
--- a/patches.runtime_pm/0080-PM-Runtime-Handle-.runtime_suspend-failure-correctly.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 62690b36f3600b1838068b1fad62fd97d2323c4f Mon Sep 17 00:00:00 2001
-From: Ming Lei <ming.lei@canonical.com>
-Date: Wed, 12 Oct 2011 22:59:33 +0200
-Subject: PM / Runtime: Handle .runtime_suspend() failure correctly
-
-If .runtime_suspend() returns -EAGAIN or -EBUSY, the device should
-still be in ACTIVE state, so it is not necessary to send an idle
-notification to its parent. If .runtime_suspend() returns other
-fatal failure, it doesn't make sense to send idle notification to
-its parent.
-
-Skip parent idle notification when failure is returned from
-.runtime_suspend() and update comments in rpm_suspend() to reflect
-that change.
-
-[rjw: Modified the subject and changelog slightly.]
-
-Signed-off-by: Ming Lei <ming.lei@canonical.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 857b36c7b038ac56a882ee914df93e5985443074)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 25 +++++++++++++------------
- 1 file changed, 13 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index aa23a64..6bb3aaf 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -291,11 +291,11 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- * another suspend has been started earlier, either return immediately
- * or wait for it to finish, depending on the RPM_NOWAIT and RPM_ASYNC
- * flags. If the RPM_ASYNC flag is set then queue a suspend request;
-- * otherwise run the ->runtime_suspend() callback directly. If a deferred
-- * resume was requested while the callback was running then carry it out;
-- * otherwise send an idle notification for its parent (if the suspend
-- * succeeded and both ignore_children of parent->power and irq_safe of
-- * dev->power are not set).
-+ * otherwise run the ->runtime_suspend() callback directly. When
-+ * ->runtime_suspend succeeded, if a deferred resume was requested while
-+ * the callback was running then carry it out, otherwise send an idle
-+ * notification for its parent (if the suspend succeeded and both
-+ * ignore_children of parent->power and irq_safe of dev->power are not set).
- *
- * This function must be called under dev->power.lock with interrupts disabled.
- */
-@@ -420,15 +420,16 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- dev->power.runtime_error = 0;
- else
- pm_runtime_cancel_pending(dev);
-- } else {
-+ wake_up_all(&dev->power.wait_queue);
-+ goto out;
-+ }
- no_callback:
-- __update_runtime_status(dev, RPM_SUSPENDED);
-- pm_runtime_deactivate_timer(dev);
-+ __update_runtime_status(dev, RPM_SUSPENDED);
-+ pm_runtime_deactivate_timer(dev);
-
-- if (dev->parent) {
-- parent = dev->parent;
-- atomic_add_unless(&parent->power.child_count, -1, 0);
-- }
-+ if (dev->parent) {
-+ parent = dev->parent;
-+ atomic_add_unless(&parent->power.child_count, -1, 0);
- }
- wake_up_all(&dev->power.wait_queue);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0081-PM-Suspend-Add-statistics-debugfs-file-for-suspend-t.patch b/patches.runtime_pm/0081-PM-Suspend-Add-statistics-debugfs-file-for-suspend-t.patch
deleted file mode 100644
index 2451cab4fe8916..00000000000000
--- a/patches.runtime_pm/0081-PM-Suspend-Add-statistics-debugfs-file-for-suspend-t.patch
+++ /dev/null
@@ -1,409 +0,0 @@
-From 43e6e6a4986089766acd4da2030dba32f921f075 Mon Sep 17 00:00:00 2001
-From: ShuoX Liu <shuox.liu@intel.com>
-Date: Wed, 10 Aug 2011 23:01:26 +0200
-Subject: PM / Suspend: Add statistics debugfs file for suspend to RAM
-
-Record S3 failure time about each reason and the latest two failed
-devices' names in S3 progress.
-We can check it through 'suspend_stats' entry in debugfs.
-
-The motivation of the patch:
-
-We are enabling power features on Medfield. Comparing with PC/notebook,
-a mobile enters/exits suspend-2-ram (we call it s3 on Medfield) far
-more frequently. If it can't enter suspend-2-ram in time, the power
-might be used up soon.
-
-We often find sometimes, a device suspend fails. Then, system retries
-s3 over and over again. As display is off, testers and developers
-don't know what happens.
-
-Some testers and developers complain they don't know if system
-tries suspend-2-ram, and what device fails to suspend. They need
-such info for a quick check. The patch adds suspend_stats under
-debugfs for users to check suspend to RAM statistics quickly.
-
-If not using this patch, we have other methods to get info about
-what device fails. One is to turn on CONFIG_PM_DEBUG, but users
-would get too much info and testers need recompile the system.
-
-In addition, dynamic debug is another good tool to dump debug info.
-But it still doesn't match our utilization scenario closely.
-1) user need write a user space parser to process the syslog output;
-2) Our testing scenario is we leave the mobile for at least hours.
- Then, check its status. No serial console available during the
- testing. One is because console would be suspended, and the other
- is serial console connecting with spi or HSU devices would consume
- power. These devices are powered off at suspend-2-ram.
-
-Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2a77c46de1e3dace73745015635ebbc648eca69c)
-
-Conflicts:
-
- kernel/power/suspend.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/basic-pm-debugging.txt | 24 +++++++
- drivers/base/power/main.c | 31 +++++++--
- include/linux/suspend.h | 52 ++++++++++++++
- kernel/power/main.c | 102 ++++++++++++++++++++++++++++
- kernel/power/suspend.c | 17 ++++-
- 5 files changed, 218 insertions(+), 8 deletions(-)
-
-diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt
-index 05a7fe7..40a4c65 100644
---- a/Documentation/power/basic-pm-debugging.txt
-+++ b/Documentation/power/basic-pm-debugging.txt
-@@ -201,3 +201,27 @@ case, you may be able to search for failing drivers by following the procedure
- analogous to the one described in section 1. If you find some failing drivers,
- you will have to unload them every time before an STR transition (ie. before
- you run s2ram), and please report the problems with them.
-+
-+There is a debugfs entry which shows the suspend to RAM statistics. Here is an
-+example of its output.
-+ # mount -t debugfs none /sys/kernel/debug
-+ # cat /sys/kernel/debug/suspend_stats
-+ success: 20
-+ fail: 5
-+ failed_freeze: 0
-+ failed_prepare: 0
-+ failed_suspend: 5
-+ failed_suspend_noirq: 0
-+ failed_resume: 0
-+ failed_resume_noirq: 0
-+ failures:
-+ last_failed_dev: alarm
-+ adc
-+ last_failed_errno: -16
-+ -16
-+ last_failed_step: suspend
-+ suspend
-+Field success means the success number of suspend to RAM, and field fail means
-+the failure number. Others are the failure number of different steps of suspend
-+to RAM. suspend_stats just lists the last 2 failed devices, error number and
-+failed step of suspend.
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index c6291ab..b1b5826 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -46,6 +46,7 @@ LIST_HEAD(dpm_prepared_list);
- LIST_HEAD(dpm_suspended_list);
- LIST_HEAD(dpm_noirq_list);
-
-+struct suspend_stats suspend_stats;
- static DEFINE_MUTEX(dpm_list_mtx);
- static pm_message_t pm_transition;
-
-@@ -467,8 +468,12 @@ void dpm_resume_noirq(pm_message_t state)
- mutex_unlock(&dpm_list_mtx);
-
- error = device_resume_noirq(dev, state);
-- if (error)
-+ if (error) {
-+ suspend_stats.failed_resume_noirq++;
-+ dpm_save_failed_step(SUSPEND_RESUME_NOIRQ);
-+ dpm_save_failed_dev(dev_name(dev));
- pm_dev_err(dev, state, " early", error);
-+ }
-
- mutex_lock(&dpm_list_mtx);
- put_device(dev);
-@@ -629,8 +634,12 @@ void dpm_resume(pm_message_t state)
- mutex_unlock(&dpm_list_mtx);
-
- error = device_resume(dev, state, false);
-- if (error)
-+ if (error) {
-+ suspend_stats.failed_resume++;
-+ dpm_save_failed_step(SUSPEND_RESUME);
-+ dpm_save_failed_dev(dev_name(dev));
- pm_dev_err(dev, state, "", error);
-+ }
-
- mutex_lock(&dpm_list_mtx);
- }
-@@ -805,6 +814,9 @@ int dpm_suspend_noirq(pm_message_t state)
- mutex_lock(&dpm_list_mtx);
- if (error) {
- pm_dev_err(dev, state, " late", error);
-+ suspend_stats.failed_suspend_noirq++;
-+ dpm_save_failed_step(SUSPEND_SUSPEND_NOIRQ);
-+ dpm_save_failed_dev(dev_name(dev));
- put_device(dev);
- break;
- }
-@@ -926,8 +938,10 @@ static void async_suspend(void *data, async_cookie_t cookie)
- int error;
-
- error = __device_suspend(dev, pm_transition, true);
-- if (error)
-+ if (error) {
-+ dpm_save_failed_dev(dev_name(dev));
- pm_dev_err(dev, pm_transition, " async", error);
-+ }
-
- put_device(dev);
- }
-@@ -970,6 +984,7 @@ int dpm_suspend(pm_message_t state)
- mutex_lock(&dpm_list_mtx);
- if (error) {
- pm_dev_err(dev, state, "", error);
-+ dpm_save_failed_dev(dev_name(dev));
- put_device(dev);
- break;
- }
-@@ -983,7 +998,10 @@ int dpm_suspend(pm_message_t state)
- async_synchronize_full();
- if (!error)
- error = async_error;
-- if (!error)
-+ if (error) {
-+ suspend_stats.failed_suspend++;
-+ dpm_save_failed_step(SUSPEND_SUSPEND);
-+ } else
- dpm_show_time(starttime, state, NULL);
- return error;
- }
-@@ -1091,7 +1109,10 @@ int dpm_suspend_start(pm_message_t state)
- int error;
-
- error = dpm_prepare(state);
-- if (!error)
-+ if (error) {
-+ suspend_stats.failed_prepare++;
-+ dpm_save_failed_step(SUSPEND_PREPARE);
-+ } else
- error = dpm_suspend(state);
- return error;
- }
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index e1e3742..94eb364 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -34,6 +34,58 @@ typedef int __bitwise suspend_state_t;
- #define PM_SUSPEND_MEM ((__force suspend_state_t) 3)
- #define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
-
-+enum suspend_stat_step {
-+ SUSPEND_FREEZE = 1,
-+ SUSPEND_PREPARE,
-+ SUSPEND_SUSPEND,
-+ SUSPEND_SUSPEND_NOIRQ,
-+ SUSPEND_RESUME_NOIRQ,
-+ SUSPEND_RESUME
-+};
-+
-+struct suspend_stats {
-+ int success;
-+ int fail;
-+ int failed_freeze;
-+ int failed_prepare;
-+ int failed_suspend;
-+ int failed_suspend_noirq;
-+ int failed_resume;
-+ int failed_resume_noirq;
-+#define REC_FAILED_NUM 2
-+ int last_failed_dev;
-+ char failed_devs[REC_FAILED_NUM][40];
-+ int last_failed_errno;
-+ int errno[REC_FAILED_NUM];
-+ int last_failed_step;
-+ enum suspend_stat_step failed_steps[REC_FAILED_NUM];
-+};
-+
-+extern struct suspend_stats suspend_stats;
-+
-+static inline void dpm_save_failed_dev(const char *name)
-+{
-+ strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev],
-+ name,
-+ sizeof(suspend_stats.failed_devs[0]));
-+ suspend_stats.last_failed_dev++;
-+ suspend_stats.last_failed_dev %= REC_FAILED_NUM;
-+}
-+
-+static inline void dpm_save_failed_errno(int err)
-+{
-+ suspend_stats.errno[suspend_stats.last_failed_errno] = err;
-+ suspend_stats.last_failed_errno++;
-+ suspend_stats.last_failed_errno %= REC_FAILED_NUM;
-+}
-+
-+static inline void dpm_save_failed_step(enum suspend_stat_step step)
-+{
-+ suspend_stats.failed_steps[suspend_stats.last_failed_step] = step;
-+ suspend_stats.last_failed_step++;
-+ suspend_stats.last_failed_step %= REC_FAILED_NUM;
-+}
-+
- /**
- * struct platform_suspend_ops - Callbacks for managing platform dependent
- * system sleep states.
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 6c601f8..2757acb 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -12,6 +12,8 @@
- #include <linux/string.h>
- #include <linux/resume-trace.h>
- #include <linux/workqueue.h>
-+#include <linux/debugfs.h>
-+#include <linux/seq_file.h>
-
- #include "power.h"
-
-@@ -133,6 +135,101 @@ power_attr(pm_test);
-
- #endif /* CONFIG_PM_SLEEP */
-
-+#ifdef CONFIG_DEBUG_FS
-+static char *suspend_step_name(enum suspend_stat_step step)
-+{
-+ switch (step) {
-+ case SUSPEND_FREEZE:
-+ return "freeze";
-+ case SUSPEND_PREPARE:
-+ return "prepare";
-+ case SUSPEND_SUSPEND:
-+ return "suspend";
-+ case SUSPEND_SUSPEND_NOIRQ:
-+ return "suspend_noirq";
-+ case SUSPEND_RESUME_NOIRQ:
-+ return "resume_noirq";
-+ case SUSPEND_RESUME:
-+ return "resume";
-+ default:
-+ return "";
-+ }
-+}
-+
-+static int suspend_stats_show(struct seq_file *s, void *unused)
-+{
-+ int i, index, last_dev, last_errno, last_step;
-+
-+ last_dev = suspend_stats.last_failed_dev + REC_FAILED_NUM - 1;
-+ last_dev %= REC_FAILED_NUM;
-+ last_errno = suspend_stats.last_failed_errno + REC_FAILED_NUM - 1;
-+ last_errno %= REC_FAILED_NUM;
-+ last_step = suspend_stats.last_failed_step + REC_FAILED_NUM - 1;
-+ last_step %= REC_FAILED_NUM;
-+ seq_printf(s, "%s: %d\n%s: %d\n%s: %d\n%s: %d\n"
-+ "%s: %d\n%s: %d\n%s: %d\n%s: %d\n",
-+ "success", suspend_stats.success,
-+ "fail", suspend_stats.fail,
-+ "failed_freeze", suspend_stats.failed_freeze,
-+ "failed_prepare", suspend_stats.failed_prepare,
-+ "failed_suspend", suspend_stats.failed_suspend,
-+ "failed_suspend_noirq",
-+ suspend_stats.failed_suspend_noirq,
-+ "failed_resume", suspend_stats.failed_resume,
-+ "failed_resume_noirq",
-+ suspend_stats.failed_resume_noirq);
-+ seq_printf(s, "failures:\n last_failed_dev:\t%-s\n",
-+ suspend_stats.failed_devs[last_dev]);
-+ for (i = 1; i < REC_FAILED_NUM; i++) {
-+ index = last_dev + REC_FAILED_NUM - i;
-+ index %= REC_FAILED_NUM;
-+ seq_printf(s, "\t\t\t%-s\n",
-+ suspend_stats.failed_devs[index]);
-+ }
-+ seq_printf(s, " last_failed_errno:\t%-d\n",
-+ suspend_stats.errno[last_errno]);
-+ for (i = 1; i < REC_FAILED_NUM; i++) {
-+ index = last_errno + REC_FAILED_NUM - i;
-+ index %= REC_FAILED_NUM;
-+ seq_printf(s, "\t\t\t%-d\n",
-+ suspend_stats.errno[index]);
-+ }
-+ seq_printf(s, " last_failed_step:\t%-s\n",
-+ suspend_step_name(
-+ suspend_stats.failed_steps[last_step]));
-+ for (i = 1; i < REC_FAILED_NUM; i++) {
-+ index = last_step + REC_FAILED_NUM - i;
-+ index %= REC_FAILED_NUM;
-+ seq_printf(s, "\t\t\t%-s\n",
-+ suspend_step_name(
-+ suspend_stats.failed_steps[index]));
-+ }
-+
-+ return 0;
-+}
-+
-+static int suspend_stats_open(struct inode *inode, struct file *file)
-+{
-+ return single_open(file, suspend_stats_show, NULL);
-+}
-+
-+static const struct file_operations suspend_stats_operations = {
-+ .open = suspend_stats_open,
-+ .read = seq_read,
-+ .llseek = seq_lseek,
-+ .release = single_release,
-+};
-+
-+static int __init pm_debugfs_init(void)
-+{
-+ debugfs_create_file("suspend_stats", S_IFREG | S_IRUGO,
-+ NULL, NULL, &suspend_stats_operations);
-+ return 0;
-+}
-+
-+late_initcall(pm_debugfs_init);
-+#endif /* CONFIG_DEBUG_FS */
-+
- struct kobject *power_kobj;
-
- /**
-@@ -194,6 +291,11 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
- }
- if (state < PM_SUSPEND_MAX && *s)
- error = enter_state(state);
-+ if (error) {
-+ suspend_stats.fail++;
-+ dpm_save_failed_errno(error);
-+ } else
-+ suspend_stats.success++;
- #endif
-
- Exit:
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index d3caa76..fdd4263 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -104,7 +104,10 @@ static int suspend_prepare(void)
- goto Finish;
-
- error = suspend_freeze_processes();
-- if (!error)
-+ if (error) {
-+ suspend_stats.failed_freeze++;
-+ dpm_save_failed_step(SUSPEND_FREEZE);
-+ } else
- return 0;
-
- suspend_thaw_processes();
-@@ -315,8 +318,16 @@ int enter_state(suspend_state_t state)
- */
- int pm_suspend(suspend_state_t state)
- {
-- if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX)
-- return enter_state(state);
-+ int ret;
-+ if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) {
-+ ret = enter_state(state);
-+ if (ret) {
-+ suspend_stats.fail++;
-+ dpm_save_failed_errno(ret);
-+ } else
-+ suspend_stats.success++;
-+ return ret;
-+ }
- return -EINVAL;
- }
- EXPORT_SYMBOL(pm_suspend);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0082-PM-Fix-build-issue-in-main.c-for-CONFIG_PM_SLEEP-uns.patch b/patches.runtime_pm/0082-PM-Fix-build-issue-in-main.c-for-CONFIG_PM_SLEEP-uns.patch
deleted file mode 100644
index 0990b532318e83..00000000000000
--- a/patches.runtime_pm/0082-PM-Fix-build-issue-in-main.c-for-CONFIG_PM_SLEEP-uns.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 270cf1054540fd12aaa6fbe9cbc4b9f6cc7f9698 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 11 Aug 2011 22:38:12 +0200
-Subject: PM: Fix build issue in main.c for CONFIG_PM_SLEEP unset
-
-Suspend statistics should depend on CONFIG_PM_SLEEP, so make that
-happen.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit ca123102f69fb260221502ade9bbc069290fae84)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/main.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 2757acb..a52e884 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -133,8 +133,6 @@ static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr,
- power_attr(pm_test);
- #endif /* CONFIG_PM_DEBUG */
-
--#endif /* CONFIG_PM_SLEEP */
--
- #ifdef CONFIG_DEBUG_FS
- static char *suspend_step_name(enum suspend_stat_step step)
- {
-@@ -230,6 +228,8 @@ static int __init pm_debugfs_init(void)
- late_initcall(pm_debugfs_init);
- #endif /* CONFIG_DEBUG_FS */
-
-+#endif /* CONFIG_PM_SLEEP */
-+
- struct kobject *power_kobj;
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0083-PM-Hibernate-Include-storage-keys-in-hibernation-ima.patch b/patches.runtime_pm/0083-PM-Hibernate-Include-storage-keys-in-hibernation-ima.patch
deleted file mode 100644
index 2444b83a05f22a..00000000000000
--- a/patches.runtime_pm/0083-PM-Hibernate-Include-storage-keys-in-hibernation-ima.patch
+++ /dev/null
@@ -1,302 +0,0 @@
-From e17f661192c2c472eef4e73b76206f3afc129f16 Mon Sep 17 00:00:00 2001
-From: Martin Schwidefsky <schwidefsky@de.ibm.com>
-Date: Wed, 17 Aug 2011 20:42:24 +0200
-Subject: PM / Hibernate: Include storage keys in hibernation image on s390
-
-For s390 there is one additional byte associated with each page,
-the storage key. This byte contains the referenced and changed
-bits and needs to be included into the hibernation image.
-If the storage keys are not restored to their previous state all
-original pages would appear to be dirty. This can cause
-inconsistencies e.g. with read-only filesystems.
-
-Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 85055dd805f0822f13f736bee2a521e222c38293)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/s390/Kconfig | 1
- arch/s390/kernel/suspend.c | 118 ++++++++++++++++++++++++++++++++++++++++
- arch/s390/kernel/swsusp_asm64.S | 3 +
- include/linux/suspend.h | 34 +++++++++++
- kernel/power/Kconfig | 3 +
- kernel/power/snapshot.c | 18 ++++++
- 6 files changed, 177 insertions(+)
-
---- a/arch/s390/Kconfig
-+++ b/arch/s390/Kconfig
-@@ -89,6 +89,7 @@ config S390
- select HAVE_GET_USER_PAGES_FAST
- select HAVE_ARCH_MUTEX_CPU_RELAX
- select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
-+ select ARCH_SAVE_PAGE_KEYS if HIBERNATION
- select ARCH_INLINE_SPIN_TRYLOCK
- select ARCH_INLINE_SPIN_TRYLOCK_BH
- select ARCH_INLINE_SPIN_LOCK
---- a/arch/s390/kernel/suspend.c
-+++ b/arch/s390/kernel/suspend.c
-@@ -7,6 +7,7 @@
- */
-
- #include <linux/pfn.h>
-+#include <linux/mm.h>
- #include <asm/system.h>
-
- /*
-@@ -14,6 +15,123 @@
- */
- extern const void __nosave_begin, __nosave_end;
-
-+/*
-+ * The restore of the saved pages in an hibernation image will set
-+ * the change and referenced bits in the storage key for each page.
-+ * Overindication of the referenced bits after an hibernation cycle
-+ * does not cause any harm but the overindication of the change bits
-+ * would cause trouble.
-+ * Use the ARCH_SAVE_PAGE_KEYS hooks to save the storage key of each
-+ * page to the most significant byte of the associated page frame
-+ * number in the hibernation image.
-+ */
-+
-+/*
-+ * Key storage is allocated as a linked list of pages.
-+ * The size of the keys array is (PAGE_SIZE - sizeof(long))
-+ */
-+struct page_key_data {
-+ struct page_key_data *next;
-+ unsigned char data[];
-+};
-+
-+#define PAGE_KEY_DATA_SIZE (PAGE_SIZE - sizeof(struct page_key_data *))
-+
-+static struct page_key_data *page_key_data;
-+static struct page_key_data *page_key_rp, *page_key_wp;
-+static unsigned long page_key_rx, page_key_wx;
-+
-+/*
-+ * For each page in the hibernation image one additional byte is
-+ * stored in the most significant byte of the page frame number.
-+ * On suspend no additional memory is required but on resume the
-+ * keys need to be memorized until the page data has been restored.
-+ * Only then can the storage keys be set to their old state.
-+ */
-+unsigned long page_key_additional_pages(unsigned long pages)
-+{
-+ return DIV_ROUND_UP(pages, PAGE_KEY_DATA_SIZE);
-+}
-+
-+/*
-+ * Free page_key_data list of arrays.
-+ */
-+void page_key_free(void)
-+{
-+ struct page_key_data *pkd;
-+
-+ while (page_key_data) {
-+ pkd = page_key_data;
-+ page_key_data = pkd->next;
-+ free_page((unsigned long) pkd);
-+ }
-+}
-+
-+/*
-+ * Allocate page_key_data list of arrays with enough room to store
-+ * one byte for each page in the hibernation image.
-+ */
-+int page_key_alloc(unsigned long pages)
-+{
-+ struct page_key_data *pk;
-+ unsigned long size;
-+
-+ size = DIV_ROUND_UP(pages, PAGE_KEY_DATA_SIZE);
-+ while (size--) {
-+ pk = (struct page_key_data *) get_zeroed_page(GFP_KERNEL);
-+ if (!pk) {
-+ page_key_free();
-+ return -ENOMEM;
-+ }
-+ pk->next = page_key_data;
-+ page_key_data = pk;
-+ }
-+ page_key_rp = page_key_wp = page_key_data;
-+ page_key_rx = page_key_wx = 0;
-+ return 0;
-+}
-+
-+/*
-+ * Save the storage key into the upper 8 bits of the page frame number.
-+ */
-+void page_key_read(unsigned long *pfn)
-+{
-+ unsigned long addr;
-+
-+ addr = (unsigned long) page_address(pfn_to_page(*pfn));
-+ *(unsigned char *) pfn = (unsigned char) page_get_storage_key(addr);
-+}
-+
-+/*
-+ * Extract the storage key from the upper 8 bits of the page frame number
-+ * and store it in the page_key_data list of arrays.
-+ */
-+void page_key_memorize(unsigned long *pfn)
-+{
-+ page_key_wp->data[page_key_wx] = *(unsigned char *) pfn;
-+ *(unsigned char *) pfn = 0;
-+ if (++page_key_wx < PAGE_KEY_DATA_SIZE)
-+ return;
-+ page_key_wp = page_key_wp->next;
-+ page_key_wx = 0;
-+}
-+
-+/*
-+ * Get the next key from the page_key_data list of arrays and set the
-+ * storage key of the page referred by @address. If @address refers to
-+ * a "safe" page the swsusp_arch_resume code will transfer the storage
-+ * key from the buffer page to the original page.
-+ */
-+void page_key_write(void *address)
-+{
-+ page_set_storage_key((unsigned long) address,
-+ page_key_rp->data[page_key_rx], 0);
-+ if (++page_key_rx >= PAGE_KEY_DATA_SIZE)
-+ return;
-+ page_key_rp = page_key_rp->next;
-+ page_key_rx = 0;
-+}
-+
- int pfn_is_nosave(unsigned long pfn)
- {
- unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
---- a/arch/s390/kernel/swsusp_asm64.S
-+++ b/arch/s390/kernel/swsusp_asm64.S
-@@ -138,11 +138,14 @@ swsusp_arch_resume:
- 0:
- lg %r2,8(%r1)
- lg %r4,0(%r1)
-+ iske %r0,%r4
- lghi %r3,PAGE_SIZE
- lghi %r5,PAGE_SIZE
- 1:
- mvcle %r2,%r4,0
- jo 1b
-+ lg %r2,8(%r1)
-+ sske %r0,%r2
- lg %r1,16(%r1)
- ltgr %r1,%r1
- jnz 0b
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -378,4 +378,38 @@ static inline void unlock_system_sleep(v
- }
- #endif
-
-+#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS
-+/*
-+ * The ARCH_SAVE_PAGE_KEYS functions can be used by an architecture
-+ * to save/restore additional information to/from the array of page
-+ * frame numbers in the hibernation image. For s390 this is used to
-+ * save and restore the storage key for each page that is included
-+ * in the hibernation image.
-+ */
-+unsigned long page_key_additional_pages(unsigned long pages);
-+int page_key_alloc(unsigned long pages);
-+void page_key_free(void);
-+void page_key_read(unsigned long *pfn);
-+void page_key_memorize(unsigned long *pfn);
-+void page_key_write(void *address);
-+
-+#else /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
-+
-+static inline unsigned long page_key_additional_pages(unsigned long pages)
-+{
-+ return 0;
-+}
-+
-+static inline int page_key_alloc(unsigned long pages)
-+{
-+ return 0;
-+}
-+
-+static inline void page_key_free(void) {}
-+static inline void page_key_read(unsigned long *pfn) {}
-+static inline void page_key_memorize(unsigned long *pfn) {}
-+static inline void page_key_write(void *address) {}
-+
-+#endif /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
-+
- #endif /* _LINUX_SUSPEND_H */
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -65,6 +65,9 @@ config HIBERNATION
-
- For more information take a look at <file:Documentation/power/swsusp.txt>.
-
-+config ARCH_SAVE_PAGE_KEYS
-+ bool
-+
- config PM_STD_PARTITION
- string "Default resume partition"
- depends on HIBERNATION
---- a/kernel/power/snapshot.c
-+++ b/kernel/power/snapshot.c
-@@ -1339,6 +1339,9 @@ int hibernate_preallocate_memory(void)
- count += highmem;
- count -= totalreserve_pages;
-
-+ /* Add number of pages required for page keys (s390 only). */
-+ size += page_key_additional_pages(saveable);
-+
- /* Compute the maximum number of saveable pages to leave in memory. */
- max_size = (count - (size + PAGES_FOR_IO)) / 2
- - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE);
-@@ -1662,6 +1665,8 @@ pack_pfns(unsigned long *buf, struct mem
- buf[j] = memory_bm_next_pfn(bm);
- if (unlikely(buf[j] == BM_END_OF_MAP))
- break;
-+ /* Save page key for data page (s390 only). */
-+ page_key_read(buf + j);
- }
- }
-
-@@ -1821,6 +1826,9 @@ static int unpack_orig_pfns(unsigned lon
- if (unlikely(buf[j] == BM_END_OF_MAP))
- break;
-
-+ /* Extract and buffer page key for data page (s390 only). */
-+ page_key_memorize(buf + j);
-+
- if (memory_bm_pfn_present(bm, buf[j]))
- memory_bm_set_bit(bm, buf[j]);
- else
-@@ -2223,6 +2231,11 @@ int snapshot_write_next(struct snapshot_
- if (error)
- return error;
-
-+ /* Allocate buffer for page keys. */
-+ error = page_key_alloc(nr_copy_pages);
-+ if (error)
-+ return error;
-+
- } else if (handle->cur <= nr_meta_pages + 1) {
- error = unpack_orig_pfns(buffer, &copy_bm);
- if (error)
-@@ -2243,6 +2256,8 @@ int snapshot_write_next(struct snapshot_
- }
- } else {
- copy_last_highmem_page();
-+ /* Restore page key for data page (s390 only). */
-+ page_key_write(handle->buffer);
- handle->buffer = get_buffer(&orig_bm, &ca);
- if (IS_ERR(handle->buffer))
- return PTR_ERR(handle->buffer);
-@@ -2264,6 +2279,9 @@ int snapshot_write_next(struct snapshot_
- void snapshot_write_finalize(struct snapshot_handle *handle)
- {
- copy_last_highmem_page();
-+ /* Restore page key for data page (s390 only). */
-+ page_key_write(handle->buffer);
-+ page_key_free();
- /* Free only if we have loaded the image entirely */
- if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages) {
- memory_bm_free(&orig_bm, PG_UNSAFE_CLEAR);
diff --git a/patches.runtime_pm/0084-PM-VT-Cleanup-if-defined-uglyness-and-fix-compile-er.patch b/patches.runtime_pm/0084-PM-VT-Cleanup-if-defined-uglyness-and-fix-compile-er.patch
deleted file mode 100644
index 7d1b193f2afe01..00000000000000
--- a/patches.runtime_pm/0084-PM-VT-Cleanup-if-defined-uglyness-and-fix-compile-er.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 0cc855c7df3330e33ea47b560bd707c4808a98b0 Mon Sep 17 00:00:00 2001
-From: H Hartley Sweeten <hartleys@visionengravers.com>
-Date: Wed, 21 Sep 2011 22:47:55 +0200
-Subject: PM / VT: Cleanup #if defined uglyness and fix compile error
-
-Introduce the config option CONFIG_VT_CONSOLE_SLEEP in order to cleanup
-the #if defined ugliness for the vt suspend support functions. Note that
-CONFIG_VT_CONSOLE is already dependant on CONFIG_VT.
-
-The function pm_set_vt_switch is actually dependant on CONFIG_VT and not
-CONFIG_PM_SLEEP. This fixes a compile error when CONFIG_PM_SLEEP is
-not set:
-
-drivers/tty/vt/vt_ioctl.c:1794: error: redefinition of 'pm_set_vt_switch'
-include/linux/suspend.h:17: error: previous definition of 'pm_set_vt_switch' was here
-
-Also, remove the incorrect path from the comment in console.c.
-
-[rjw: Replaced #if defined() with #ifdef in suspend.h.]
-
-Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 37cce26b32142f09a8967f6d238178af654b20de)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/tty/Kconfig | 4 ++++
- include/linux/suspend.h | 9 ++++++---
- kernel/power/Makefile | 2 +-
- kernel/power/console.c | 4 +---
- 4 files changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
-index bd7cc05..a7188a0 100644
---- a/drivers/tty/Kconfig
-+++ b/drivers/tty/Kconfig
-@@ -60,6 +60,10 @@ config VT_CONSOLE
-
- If unsure, say Y.
-
-+config VT_CONSOLE_SLEEP
-+ def_bool y
-+ depends on VT_CONSOLE && PM_SLEEP
-+
- config HW_CONSOLE
- bool
- depends on VT && !S390 && !UML
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index 720a465..c08069d 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -8,15 +8,18 @@
- #include <linux/mm.h>
- #include <asm/errno.h>
-
--#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
-+#ifdef CONFIG_VT
- extern void pm_set_vt_switch(int);
--extern int pm_prepare_console(void);
--extern void pm_restore_console(void);
- #else
- static inline void pm_set_vt_switch(int do_switch)
- {
- }
-+#endif
-
-+#ifdef CONFIG_VT_CONSOLE_SLEEP
-+extern int pm_prepare_console(void);
-+extern void pm_restore_console(void);
-+#else
- static inline int pm_prepare_console(void)
- {
- return 0;
-diff --git a/kernel/power/Makefile b/kernel/power/Makefile
-index ad6bdd8..07e0e28 100644
---- a/kernel/power/Makefile
-+++ b/kernel/power/Makefile
-@@ -2,7 +2,7 @@
- ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG
-
- obj-$(CONFIG_PM) += main.o qos.o
--obj-$(CONFIG_PM_SLEEP) += console.o
-+obj-$(CONFIG_VT_CONSOLE_SLEEP) += console.o
- obj-$(CONFIG_FREEZER) += process.o
- obj-$(CONFIG_SUSPEND) += suspend.o
- obj-$(CONFIG_PM_TEST_SUSPEND) += suspend_test.o
-diff --git a/kernel/power/console.c b/kernel/power/console.c
-index 218e5af..b1dc456 100644
---- a/kernel/power/console.c
-+++ b/kernel/power/console.c
-@@ -1,5 +1,5 @@
- /*
-- * drivers/power/process.c - Functions for saving/restoring console.
-+ * Functions for saving/restoring console.
- *
- * Originally from swsusp.
- */
-@@ -10,7 +10,6 @@
- #include <linux/module.h>
- #include "power.h"
-
--#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
- #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
-
- static int orig_fgconsole, orig_kmsg;
-@@ -32,4 +31,3 @@ void pm_restore_console(void)
- vt_kmsg_redirect(orig_kmsg);
- }
- }
--#endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0085-PM-Update-the-policy-on-default-wakeup-settings.patch b/patches.runtime_pm/0085-PM-Update-the-policy-on-default-wakeup-settings.patch
deleted file mode 100644
index ef49491bd5cde4..00000000000000
--- a/patches.runtime_pm/0085-PM-Update-the-policy-on-default-wakeup-settings.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 6d18c014d73dbd7c10590cea93e587bf8adeef2b Mon Sep 17 00:00:00 2001
-From: Alan Stern <stern@rowland.harvard.edu>
-Date: Mon, 26 Sep 2011 17:38:50 +0200
-Subject: PM: Update the policy on default wakeup settings
-
-This patch (as1485) documents a change to the kernel's default wakeup
-policy. Devices that forward wakeup requests between buses should be
-enabled for wakeup by default.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 8f88893c05f2f677f18f2ce5591b4bed5d4a7535)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 4 +++-
- drivers/base/power/wakeup.c | 4 +++-
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 3384d59..29b7a98 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -152,7 +152,9 @@ try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag;
- for the most part drivers should not change its value. The initial value of
- should_wakeup is supposed to be false for the majority of devices; the major
- exceptions are power buttons, keyboards, and Ethernet adapters whose WoL
--(wake-on-LAN) feature has been set up with ethtool.
-+(wake-on-LAN) feature has been set up with ethtool. It should also default
-+to true for devices that don't generate wakeup requests on their own but merely
-+forward wakeup requests from one bus to another (like PCI bridges).
-
- Whether or not a device is capable of issuing wakeup events is a hardware
- matter, and the kernel is responsible for keeping track of it. By contrast,
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index 84f7c7d..14ee07e 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -276,7 +276,9 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable);
- *
- * By default, most devices should leave wakeup disabled. The exceptions are
- * devices that everyone expects to be wakeup sources: keyboards, power buttons,
-- * possibly network interfaces, etc.
-+ * possibly network interfaces, etc. Also, devices that don't generate their
-+ * own wakeup requests but merely forward requests from one bus to another
-+ * (like PCI bridges) should have wakeup enabled by default.
- */
- int device_init_wakeup(struct device *dev, bool enable)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0086-PM-Hibernate-Freeze-kernel-threads-after-preallocati.patch b/patches.runtime_pm/0086-PM-Hibernate-Freeze-kernel-threads-after-preallocati.patch
deleted file mode 100644
index 1993d3afc3a380..00000000000000
--- a/patches.runtime_pm/0086-PM-Hibernate-Freeze-kernel-threads-after-preallocati.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From c187bba1e356ed875f2433fb19e40ef1989f2ac9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 26 Sep 2011 20:32:27 +0200
-Subject: PM / Hibernate: Freeze kernel threads after preallocating memory
-
-There is a problem with the current ordering of hibernate code which
-leads to deadlocks in some filesystems' memory shrinkers. Namely,
-some filesystems use freezable kernel threads that are inactive when
-the hibernate memory preallocation is carried out. Those same
-filesystems use memory shrinkers that may be triggered by the
-hibernate memory preallocation. If those memory shrinkers wait for
-the frozen kernel threads, the hibernate process deadlocks (this
-happens with XFS, for one example).
-
-Apparently, it is not technically viable to redesign the filesystems
-in question to avoid the situation described above, so the only
-possible solution of this issue is to defer the freezing of kernel
-threads until the hibernate memory preallocation is done, which is
-implemented by this change.
-
-Unfortunately, this requires the memory preallocation to be done
-before the "prepare" stage of device freeze, so after this change the
-only way drivers can allocate additional memory for their freeze
-routines in a clean way is to use PM notifiers.
-
-Reported-by: Christoph <cr2005@u-club.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 2aede851ddf08666f68ffc17be446420e9d2a056)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 4 ----
- include/linux/freezer.h | 4 +++-
- kernel/power/hibernate.c | 12 ++++++++----
- kernel/power/power.h | 3 ++-
- kernel/power/process.c | 30 ++++++++++++++++++++----------
- 5 files changed, 33 insertions(+), 20 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 29b7a98..646a89e 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -281,10 +281,6 @@ When the system goes into the standby or memory sleep state, the phases are:
- time.) Unlike the other suspend-related phases, during the prepare
- phase the device tree is traversed top-down.
-
-- In addition to that, if device drivers need to allocate additional
-- memory to be able to hadle device suspend correctly, that should be
-- done in the prepare phase.
--
- After the prepare callback method returns, no new children may be
- registered below the device. The method may also prepare the device or
- driver in some way for the upcoming system power transition (for
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index 1effc8b..aa56cf3 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -49,6 +49,7 @@ extern int thaw_process(struct task_struct *p);
-
- extern void refrigerator(void);
- extern int freeze_processes(void);
-+extern int freeze_kernel_threads(void);
- extern void thaw_processes(void);
-
- static inline int try_to_freeze(void)
-@@ -171,7 +172,8 @@ static inline void clear_freeze_flag(struct task_struct *p) {}
- static inline int thaw_process(struct task_struct *p) { return 1; }
-
- static inline void refrigerator(void) {}
--static inline int freeze_processes(void) { BUG(); return 0; }
-+static inline int freeze_processes(void) { return -ENOSYS; }
-+static inline int freeze_kernel_threads(void) { return -ENOSYS; }
- static inline void thaw_processes(void) {}
-
- static inline int try_to_freeze(void) { return 0; }
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 8884c27..878218e 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -334,13 +334,17 @@ int hibernation_snapshot(int platform_mode)
- if (error)
- goto Close;
-
-- error = dpm_prepare(PMSG_FREEZE);
-- if (error)
-- goto Complete_devices;
--
- /* Preallocate image memory before shutting down devices. */
- error = hibernate_preallocate_memory();
- if (error)
-+ goto Close;
-+
-+ error = freeze_kernel_threads();
-+ if (error)
-+ goto Close;
-+
-+ error = dpm_prepare(PMSG_FREEZE);
-+ if (error)
- goto Complete_devices;
-
- suspend_console();
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 9a00a0a..e620639 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -228,7 +228,8 @@ extern int pm_test_level;
- #ifdef CONFIG_SUSPEND_FREEZER
- static inline int suspend_freeze_processes(void)
- {
-- return freeze_processes();
-+ int error = freeze_processes();
-+ return error ? : freeze_kernel_threads();
- }
-
- static inline void suspend_thaw_processes(void)
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 0cf3a27..addbbe5 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -135,7 +135,7 @@ static int try_to_freeze_tasks(bool sig_only)
- }
-
- /**
-- * freeze_processes - tell processes to enter the refrigerator
-+ * freeze_processes - Signal user space processes to enter the refrigerator.
- */
- int freeze_processes(void)
- {
-@@ -143,20 +143,30 @@ int freeze_processes(void)
-
- printk("Freezing user space processes ... ");
- error = try_to_freeze_tasks(true);
-- if (error)
-- goto Exit;
-- printk("done.\n");
-+ if (!error) {
-+ printk("done.");
-+ oom_killer_disable();
-+ }
-+ printk("\n");
-+ BUG_ON(in_atomic());
-+
-+ return error;
-+}
-+
-+/**
-+ * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
-+ */
-+int freeze_kernel_threads(void)
-+{
-+ int error;
-
- printk("Freezing remaining freezable tasks ... ");
- error = try_to_freeze_tasks(false);
-- if (error)
-- goto Exit;
-- printk("done.");
-+ if (!error)
-+ printk("done.");
-
-- oom_killer_disable();
-- Exit:
-- BUG_ON(in_atomic());
- printk("\n");
-+ BUG_ON(in_atomic());
-
- return error;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0087-PM-Hibernate-Fix-typo-in-a-kerneldoc-comment.patch b/patches.runtime_pm/0087-PM-Hibernate-Fix-typo-in-a-kerneldoc-comment.patch
deleted file mode 100644
index b85e4b2a03577e..00000000000000
--- a/patches.runtime_pm/0087-PM-Hibernate-Fix-typo-in-a-kerneldoc-comment.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From faa4d9443e70182fb222a45a878f209de0d974a3 Mon Sep 17 00:00:00 2001
-From: Barry Song <Baohua.Song@csr.com>
-Date: Tue, 27 Sep 2011 22:05:44 +0200
-Subject: PM / Hibernate: Fix typo in a kerneldoc comment
-
-Fix a typo in a function name in the kerneldoc comment next to
-resume_target_kernel().
-
-[rjw: Changed the subject slightly, added the changelog.]
-
-Signed-off-by: Barry Song <Baohua.Song@csr.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 21e82808fc465b66fedaac0f4e885cafb304e843)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 878218e..089ab9c 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -467,7 +467,7 @@ static int resume_target_kernel(bool platform_mode)
- * @platform_mode: If set, use platform driver to prepare for the transition.
- *
- * This routine must be called with pm_mutex held. If it is successful, control
-- * reappears in the restored target kernel in hibernation_snaphot().
-+ * reappears in the restored target kernel in hibernation_snapshot().
- */
- int hibernation_restore(int platform_mode)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0088-PM-Hibernate-Add-resumewait-param-to-support-MMC-lik.patch b/patches.runtime_pm/0088-PM-Hibernate-Add-resumewait-param-to-support-MMC-lik.patch
deleted file mode 100644
index f550b8b6f8e913..00000000000000
--- a/patches.runtime_pm/0088-PM-Hibernate-Add-resumewait-param-to-support-MMC-lik.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 954a3028e5ffd52c14190a8cbb06948b0d6cbb83 Mon Sep 17 00:00:00 2001
-From: Barry Song <baohua.song@csr.com>
-Date: Thu, 6 Oct 2011 20:34:46 +0200
-Subject: PM / Hibernate: Add resumewait param to support MMC-like devices as
- resume file
-
-Some devices like MMC are async detected very slow. For example,
-drivers/mmc/host/sdhci.c launches a 200ms delayed work to detect
-MMC partitions then add disk.
-
-We have wait_for_device_probe() and scsi_complete_async_scans()
-before calling swsusp_check(), but it is not enough to wait for MMC.
-
-This patch adds resumewait kernel param just like rootwait so
-that we have enough time to wait until MMC is ready. The difference is
-that we wait for resume partition whereas rootwait waits for rootfs
-partition (which may be on a different device).
-
-This patch will make hibernation support many embedded products
-without SCSI devices, but with devices like MMC.
-
-[rjw: Modified the changelog slightly.]
-
-Signed-off-by: Barry Song <Baohua.Song@csr.com>
-Reviewed-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6f8d7022a842809aeb24db1d15669198ef02c131)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/kernel-parameters.txt | 4 ++++
- kernel/power/hibernate.c | 16 ++++++++++++++++
- 2 files changed, 20 insertions(+)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index aa47be7..5841804 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -2220,6 +2220,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- in <PAGE_SIZE> units (needed only for swap files).
- See Documentation/power/swsusp-and-swap-files.txt
-
-+ resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
-+ Useful for devices that are detected asynchronously
-+ (e.g. USB and MMC devices).
-+
- hibernate= [HIBERNATION]
- noresume Don't check if there's a hibernation image
- present during boot.
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 089ab9c..fe4a742 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -14,6 +14,7 @@
- #include <linux/reboot.h>
- #include <linux/string.h>
- #include <linux/device.h>
-+#include <linux/async.h>
- #include <linux/kmod.h>
- #include <linux/delay.h>
- #include <linux/fs.h>
-@@ -31,6 +32,7 @@
-
- static int nocompress = 0;
- static int noresume = 0;
-+static int resume_wait = 0;
- static char resume_file[256] = CONFIG_PM_STD_PARTITION;
- dev_t swsusp_resume_device;
- sector_t swsusp_resume_block;
-@@ -737,6 +739,13 @@ static int software_resume(void)
- * to wait for this to finish.
- */
- wait_for_device_probe();
-+
-+ if (resume_wait) {
-+ while ((swsusp_resume_device = name_to_dev_t(resume_file)) == 0)
-+ msleep(10);
-+ async_synchronize_full();
-+ }
-+
- /*
- * We can't depend on SCSI devices being available after loading
- * one of their modules until scsi_complete_async_scans() is
-@@ -1065,7 +1074,14 @@ static int __init noresume_setup(char *str)
- return 1;
- }
-
-+static int __init resumewait_setup(char *str)
-+{
-+ resume_wait = 1;
-+ return 1;
-+}
-+
- __setup("noresume", noresume_setup);
- __setup("resume_offset=", resume_offset_setup);
- __setup("resume=", resume_setup);
- __setup("hibernate=", hibernate_setup);
-+__setup("resumewait", resumewait_setup);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0089-PM-Hibernate-Add-resumedelay-kernel-param-in-additio.patch b/patches.runtime_pm/0089-PM-Hibernate-Add-resumedelay-kernel-param-in-additio.patch
deleted file mode 100644
index 8835e5abb9d7dd..00000000000000
--- a/patches.runtime_pm/0089-PM-Hibernate-Add-resumedelay-kernel-param-in-additio.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 82e30713de5b155a0665f08dbe84b04deb4c6b75 Mon Sep 17 00:00:00 2001
-From: Barry Song <baohua.song@csr.com>
-Date: Mon, 10 Oct 2011 23:38:41 +0200
-Subject: PM / Hibernate: Add resumedelay kernel param in addition to
- resumewait
-
-Patch "PM / Hibernate: Add resumewait param to support MMC-like
-devices as resume file" added the resumewait kernel command line
-option. The present patch adds resumedelay so that
-resumewait/delay were analogous to rootwait/delay.
-
-[rjw: Modified the subject and changelog slightly.]
-
-Signed-off-by: Barry Song <baohua.song@csr.com>
-Acked-by: Pavel Machek <pavel@ucw.cz>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f126f7334f72e2fd1b7a62bba20c488b86e6e7c4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/kernel-parameters.txt | 3 +++
- kernel/power/hibernate.c | 14 ++++++++++++++
- 2 files changed, 17 insertions(+)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 5841804..09a5f8a 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -2220,6 +2220,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- in <PAGE_SIZE> units (needed only for swap files).
- See Documentation/power/swsusp-and-swap-files.txt
-
-+ resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
-+ read the resume files
-+
- resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
- Useful for devices that are detected asynchronously
- (e.g. USB and MMC devices).
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index fe4a742..96477fc 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -33,6 +33,7 @@
- static int nocompress = 0;
- static int noresume = 0;
- static int resume_wait = 0;
-+static int resume_delay = 0;
- static char resume_file[256] = CONFIG_PM_STD_PARTITION;
- dev_t swsusp_resume_device;
- sector_t swsusp_resume_block;
-@@ -731,6 +732,12 @@ static int software_resume(void)
-
- pr_debug("PM: Checking hibernation image partition %s\n", resume_file);
-
-+ if (resume_delay) {
-+ printk(KERN_INFO "Waiting %dsec before reading resume device...\n",
-+ resume_delay);
-+ ssleep(resume_delay);
-+ }
-+
- /* Check if the device is there */
- swsusp_resume_device = name_to_dev_t(resume_file);
- if (!swsusp_resume_device) {
-@@ -1080,8 +1087,15 @@ static int __init resumewait_setup(char *str)
- return 1;
- }
-
-+static int __init resumedelay_setup(char *str)
-+{
-+ resume_delay = simple_strtoul(str, NULL, 0);
-+ return 1;
-+}
-+
- __setup("noresume", noresume_setup);
- __setup("resume_offset=", resume_offset_setup);
- __setup("resume=", resume_setup);
- __setup("hibernate=", hibernate_setup);
- __setup("resumewait", resumewait_setup);
-+__setup("resumedelay=", resumedelay_setup);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0090-PM-Hibernate-Do-not-initialize-static-and-extern-var.patch b/patches.runtime_pm/0090-PM-Hibernate-Do-not-initialize-static-and-extern-var.patch
deleted file mode 100644
index 03e090091041be..00000000000000
--- a/patches.runtime_pm/0090-PM-Hibernate-Do-not-initialize-static-and-extern-var.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 997dece6e233d0eb8fba1405d18ee4d14d8b1234 Mon Sep 17 00:00:00 2001
-From: Barry Song <Baohua.Song@csr.com>
-Date: Tue, 11 Oct 2011 23:29:18 -0700
-Subject: PM / Hibernate: Do not initialize static and extern variables to 0
-
-Static and extern variables in kernel/power/hibernate.c need not be
-initialized to 0 explicitly, so remove those initializations.
-
-[rjw: Modified subject, added changelog.]
-
-Signed-off-by: Barry Song <Baohua.Song@csr.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d231ff1af70a2df43d809173cf8c94e9c3beb853)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 96477fc..148564d 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -30,14 +30,14 @@
- #include "power.h"
-
-
--static int nocompress = 0;
--static int noresume = 0;
--static int resume_wait = 0;
--static int resume_delay = 0;
-+static int nocompress;
-+static int noresume;
-+static int resume_wait;
-+static int resume_delay;
- static char resume_file[256] = CONFIG_PM_STD_PARTITION;
- dev_t swsusp_resume_device;
- sector_t swsusp_resume_block;
--int in_suspend __nosavedata = 0;
-+int in_suspend __nosavedata;
-
- enum {
- HIBERNATION_INVALID,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0091-PM-Hibernate-Improve-performance-of-LZO-plain-hibern.patch b/patches.runtime_pm/0091-PM-Hibernate-Improve-performance-of-LZO-plain-hibern.patch
deleted file mode 100644
index a3fd97a4559bfc..00000000000000
--- a/patches.runtime_pm/0091-PM-Hibernate-Improve-performance-of-LZO-plain-hibern.patch
+++ /dev/null
@@ -1,1160 +0,0 @@
-From bfbfea61bd966d91d4193a3ee63cc6e055cbe936 Mon Sep 17 00:00:00 2001
-From: Bojan Smojver <bojan@rexursive.com>
-Date: Thu, 13 Oct 2011 23:58:07 +0200
-Subject: PM / Hibernate: Improve performance of LZO/plain hibernation,
- checksum image
-
-Use threads for LZO compression/decompression on hibernate/thaw.
-Improve buffering on hibernate/thaw.
-Calculate/verify CRC32 of the image pages on hibernate/thaw.
-
-In my testing, this improved write/read speed by a factor of about two.
-
-Signed-off-by: Bojan Smojver <bojan@rexursive.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 081a9d043c983f161b78fdc4671324d1342b86bc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/Kconfig | 1 +
- kernel/power/hibernate.c | 3 +
- kernel/power/power.h | 1 +
- kernel/power/swap.c | 818 ++++++++++++++++++++++++++++++++++++----------
- 4 files changed, 645 insertions(+), 178 deletions(-)
-
-diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 2943e3b..deb5461 100644
---- a/kernel/power/Kconfig
-+++ b/kernel/power/Kconfig
-@@ -27,6 +27,7 @@ config HIBERNATION
- select HIBERNATE_CALLBACKS
- select LZO_COMPRESS
- select LZO_DECOMPRESS
-+ select CRC32
- ---help---
- Enable the suspend to disk (STD) functionality, which is usually
- called "hibernation" in user interfaces. STD checkpoints the
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 148564d..bb170c2 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -657,6 +657,9 @@ int hibernate(void)
- flags |= SF_PLATFORM_MODE;
- if (nocompress)
- flags |= SF_NOCOMPRESS_MODE;
-+ else
-+ flags |= SF_CRC32_MODE;
-+
- pr_debug("PM: writing image.\n");
- error = swsusp_write(flags);
- swsusp_free();
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index e620639..23a2db1 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -146,6 +146,7 @@ extern int swsusp_swap_in_use(void);
- */
- #define SF_PLATFORM_MODE 1
- #define SF_NOCOMPRESS_MODE 2
-+#define SF_CRC32_MODE 4
-
- /* kernel/power/hibernate.c */
- extern int swsusp_check(void);
-diff --git a/kernel/power/swap.c b/kernel/power/swap.c
-index 7c97c3a..11a594c 100644
---- a/kernel/power/swap.c
-+++ b/kernel/power/swap.c
-@@ -27,6 +27,10 @@
- #include <linux/slab.h>
- #include <linux/lzo.h>
- #include <linux/vmalloc.h>
-+#include <linux/cpumask.h>
-+#include <linux/atomic.h>
-+#include <linux/kthread.h>
-+#include <linux/crc32.h>
-
- #include "power.h"
-
-@@ -43,8 +47,7 @@
- * allocated and populated one at a time, so we only need one memory
- * page to set up the entire structure.
- *
-- * During resume we also only need to use one swap_map_page structure
-- * at a time.
-+ * During resume we pick up all swap_map_page structures into a list.
- */
-
- #define MAP_PAGE_ENTRIES (PAGE_SIZE / sizeof(sector_t) - 1)
-@@ -54,6 +57,11 @@ struct swap_map_page {
- sector_t next_swap;
- };
-
-+struct swap_map_page_list {
-+ struct swap_map_page *map;
-+ struct swap_map_page_list *next;
-+};
-+
- /**
- * The swap_map_handle structure is used for handling swap in
- * a file-alike way
-@@ -61,13 +69,18 @@ struct swap_map_page {
-
- struct swap_map_handle {
- struct swap_map_page *cur;
-+ struct swap_map_page_list *maps;
- sector_t cur_swap;
- sector_t first_sector;
- unsigned int k;
-+ unsigned long nr_free_pages, written;
-+ u32 crc32;
- };
-
- struct swsusp_header {
-- char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int)];
-+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) -
-+ sizeof(u32)];
-+ u32 crc32;
- sector_t image;
- unsigned int flags; /* Flags to pass to the "boot" kernel */
- char orig_sig[10];
-@@ -199,6 +212,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
- memcpy(swsusp_header->sig, HIBERNATE_SIG, 10);
- swsusp_header->image = handle->first_sector;
- swsusp_header->flags = flags;
-+ if (flags & SF_CRC32_MODE)
-+ swsusp_header->crc32 = handle->crc32;
- error = hib_bio_write_page(swsusp_resume_block,
- swsusp_header, NULL);
- } else {
-@@ -245,6 +260,7 @@ static int swsusp_swap_check(void)
- static int write_page(void *buf, sector_t offset, struct bio **bio_chain)
- {
- void *src;
-+ int ret;
-
- if (!offset)
- return -ENOSPC;
-@@ -254,9 +270,17 @@ static int write_page(void *buf, sector_t offset, struct bio **bio_chain)
- if (src) {
- copy_page(src, buf);
- } else {
-- WARN_ON_ONCE(1);
-- bio_chain = NULL; /* Go synchronous */
-- src = buf;
-+ ret = hib_wait_on_bio_chain(bio_chain); /* Free pages */
-+ if (ret)
-+ return ret;
-+ src = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH);
-+ if (src) {
-+ copy_page(src, buf);
-+ } else {
-+ WARN_ON_ONCE(1);
-+ bio_chain = NULL; /* Go synchronous */
-+ src = buf;
-+ }
- }
- } else {
- src = buf;
-@@ -293,6 +317,8 @@ static int get_swap_writer(struct swap_map_handle *handle)
- goto err_rel;
- }
- handle->k = 0;
-+ handle->nr_free_pages = nr_free_pages() >> 1;
-+ handle->written = 0;
- handle->first_sector = handle->cur_swap;
- return 0;
- err_rel:
-@@ -316,20 +342,23 @@ static int swap_write_page(struct swap_map_handle *handle, void *buf,
- return error;
- handle->cur->entries[handle->k++] = offset;
- if (handle->k >= MAP_PAGE_ENTRIES) {
-- error = hib_wait_on_bio_chain(bio_chain);
-- if (error)
-- goto out;
- offset = alloc_swapdev_block(root_swap);
- if (!offset)
- return -ENOSPC;
- handle->cur->next_swap = offset;
-- error = write_page(handle->cur, handle->cur_swap, NULL);
-+ error = write_page(handle->cur, handle->cur_swap, bio_chain);
- if (error)
- goto out;
- clear_page(handle->cur);
- handle->cur_swap = offset;
- handle->k = 0;
- }
-+ if (bio_chain && ++handle->written > handle->nr_free_pages) {
-+ error = hib_wait_on_bio_chain(bio_chain);
-+ if (error)
-+ goto out;
-+ handle->written = 0;
-+ }
- out:
- return error;
- }
-@@ -372,6 +401,13 @@ static int swap_writer_finish(struct swap_map_handle *handle,
- LZO_HEADER, PAGE_SIZE)
- #define LZO_CMP_SIZE (LZO_CMP_PAGES * PAGE_SIZE)
-
-+/* Maximum number of threads for compression/decompression. */
-+#define LZO_THREADS 3
-+
-+/* Maximum number of pages for read buffering. */
-+#define LZO_READ_PAGES (MAP_PAGE_ENTRIES * 8)
-+
-+
- /**
- * save_image - save the suspend image data
- */
-@@ -419,6 +455,92 @@ static int save_image(struct swap_map_handle *handle,
- return ret;
- }
-
-+/**
-+ * Structure used for CRC32.
-+ */
-+struct crc_data {
-+ struct task_struct *thr; /* thread */
-+ atomic_t ready; /* ready to start flag */
-+ atomic_t stop; /* ready to stop flag */
-+ unsigned run_threads; /* nr current threads */
-+ wait_queue_head_t go; /* start crc update */
-+ wait_queue_head_t done; /* crc update done */
-+ u32 *crc32; /* points to handle's crc32 */
-+ size_t *unc_len[LZO_THREADS]; /* uncompressed lengths */
-+ unsigned char *unc[LZO_THREADS]; /* uncompressed data */
-+};
-+
-+/**
-+ * CRC32 update function that runs in its own thread.
-+ */
-+static int crc32_threadfn(void *data)
-+{
-+ struct crc_data *d = data;
-+ unsigned i;
-+
-+ while (1) {
-+ wait_event(d->go, atomic_read(&d->ready) ||
-+ kthread_should_stop());
-+ if (kthread_should_stop()) {
-+ d->thr = NULL;
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ break;
-+ }
-+ atomic_set(&d->ready, 0);
-+
-+ for (i = 0; i < d->run_threads; i++)
-+ *d->crc32 = crc32_le(*d->crc32,
-+ d->unc[i], *d->unc_len[i]);
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ }
-+ return 0;
-+}
-+/**
-+ * Structure used for LZO data compression.
-+ */
-+struct cmp_data {
-+ struct task_struct *thr; /* thread */
-+ atomic_t ready; /* ready to start flag */
-+ atomic_t stop; /* ready to stop flag */
-+ int ret; /* return code */
-+ wait_queue_head_t go; /* start compression */
-+ wait_queue_head_t done; /* compression done */
-+ size_t unc_len; /* uncompressed length */
-+ size_t cmp_len; /* compressed length */
-+ unsigned char unc[LZO_UNC_SIZE]; /* uncompressed buffer */
-+ unsigned char cmp[LZO_CMP_SIZE]; /* compressed buffer */
-+ unsigned char wrk[LZO1X_1_MEM_COMPRESS]; /* compression workspace */
-+};
-+
-+/**
-+ * Compression function that runs in its own thread.
-+ */
-+static int lzo_compress_threadfn(void *data)
-+{
-+ struct cmp_data *d = data;
-+
-+ while (1) {
-+ wait_event(d->go, atomic_read(&d->ready) ||
-+ kthread_should_stop());
-+ if (kthread_should_stop()) {
-+ d->thr = NULL;
-+ d->ret = -1;
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ break;
-+ }
-+ atomic_set(&d->ready, 0);
-+
-+ d->ret = lzo1x_1_compress(d->unc, d->unc_len,
-+ d->cmp + LZO_HEADER, &d->cmp_len,
-+ d->wrk);
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ }
-+ return 0;
-+}
-
- /**
- * save_image_lzo - Save the suspend image data compressed with LZO.
-@@ -437,42 +559,93 @@ static int save_image_lzo(struct swap_map_handle *handle,
- struct bio *bio;
- struct timeval start;
- struct timeval stop;
-- size_t off, unc_len, cmp_len;
-- unsigned char *unc, *cmp, *wrk, *page;
-+ size_t off;
-+ unsigned thr, run_threads, nr_threads;
-+ unsigned char *page = NULL;
-+ struct cmp_data *data = NULL;
-+ struct crc_data *crc = NULL;
-+
-+ /*
-+ * We'll limit the number of threads for compression to limit memory
-+ * footprint.
-+ */
-+ nr_threads = num_online_cpus() - 1;
-+ nr_threads = clamp_val(nr_threads, 1, LZO_THREADS);
-
- page = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH);
- if (!page) {
- printk(KERN_ERR "PM: Failed to allocate LZO page\n");
-- return -ENOMEM;
-+ ret = -ENOMEM;
-+ goto out_clean;
- }
-
-- wrk = vmalloc(LZO1X_1_MEM_COMPRESS);
-- if (!wrk) {
-- printk(KERN_ERR "PM: Failed to allocate LZO workspace\n");
-- free_page((unsigned long)page);
-- return -ENOMEM;
-+ data = vmalloc(sizeof(*data) * nr_threads);
-+ if (!data) {
-+ printk(KERN_ERR "PM: Failed to allocate LZO data\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
- }
-+ for (thr = 0; thr < nr_threads; thr++)
-+ memset(&data[thr], 0, offsetof(struct cmp_data, go));
-
-- unc = vmalloc(LZO_UNC_SIZE);
-- if (!unc) {
-- printk(KERN_ERR "PM: Failed to allocate LZO uncompressed\n");
-- vfree(wrk);
-- free_page((unsigned long)page);
-- return -ENOMEM;
-+ crc = kmalloc(sizeof(*crc), GFP_KERNEL);
-+ if (!crc) {
-+ printk(KERN_ERR "PM: Failed to allocate crc\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
-+ memset(crc, 0, offsetof(struct crc_data, go));
-+
-+ /*
-+ * Start the compression threads.
-+ */
-+ for (thr = 0; thr < nr_threads; thr++) {
-+ init_waitqueue_head(&data[thr].go);
-+ init_waitqueue_head(&data[thr].done);
-+
-+ data[thr].thr = kthread_run(lzo_compress_threadfn,
-+ &data[thr],
-+ "image_compress/%u", thr);
-+ if (IS_ERR(data[thr].thr)) {
-+ data[thr].thr = NULL;
-+ printk(KERN_ERR
-+ "PM: Cannot start compression threads\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
- }
-
-- cmp = vmalloc(LZO_CMP_SIZE);
-- if (!cmp) {
-- printk(KERN_ERR "PM: Failed to allocate LZO compressed\n");
-- vfree(unc);
-- vfree(wrk);
-- free_page((unsigned long)page);
-- return -ENOMEM;
-+ /*
-+ * Adjust number of free pages after all allocations have been done.
-+ * We don't want to run out of pages when writing.
-+ */
-+ handle->nr_free_pages = nr_free_pages() >> 1;
-+
-+ /*
-+ * Start the CRC32 thread.
-+ */
-+ init_waitqueue_head(&crc->go);
-+ init_waitqueue_head(&crc->done);
-+
-+ handle->crc32 = 0;
-+ crc->crc32 = &handle->crc32;
-+ for (thr = 0; thr < nr_threads; thr++) {
-+ crc->unc[thr] = data[thr].unc;
-+ crc->unc_len[thr] = &data[thr].unc_len;
-+ }
-+
-+ crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32");
-+ if (IS_ERR(crc->thr)) {
-+ crc->thr = NULL;
-+ printk(KERN_ERR "PM: Cannot start CRC32 thread\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
- }
-
- printk(KERN_INFO
-+ "PM: Using %u thread(s) for compression.\n"
- "PM: Compressing and saving image data (%u pages) ... ",
-- nr_to_write);
-+ nr_threads, nr_to_write);
- m = nr_to_write / 100;
- if (!m)
- m = 1;
-@@ -480,55 +653,83 @@ static int save_image_lzo(struct swap_map_handle *handle,
- bio = NULL;
- do_gettimeofday(&start);
- for (;;) {
-- for (off = 0; off < LZO_UNC_SIZE; off += PAGE_SIZE) {
-- ret = snapshot_read_next(snapshot);
-- if (ret < 0)
-- goto out_finish;
--
-- if (!ret)
-+ for (thr = 0; thr < nr_threads; thr++) {
-+ for (off = 0; off < LZO_UNC_SIZE; off += PAGE_SIZE) {
-+ ret = snapshot_read_next(snapshot);
-+ if (ret < 0)
-+ goto out_finish;
-+
-+ if (!ret)
-+ break;
-+
-+ memcpy(data[thr].unc + off,
-+ data_of(*snapshot), PAGE_SIZE);
-+
-+ if (!(nr_pages % m))
-+ printk(KERN_CONT "\b\b\b\b%3d%%",
-+ nr_pages / m);
-+ nr_pages++;
-+ }
-+ if (!off)
- break;
-
-- memcpy(unc + off, data_of(*snapshot), PAGE_SIZE);
-+ data[thr].unc_len = off;
-
-- if (!(nr_pages % m))
-- printk(KERN_CONT "\b\b\b\b%3d%%", nr_pages / m);
-- nr_pages++;
-+ atomic_set(&data[thr].ready, 1);
-+ wake_up(&data[thr].go);
- }
-
-- if (!off)
-+ if (!thr)
- break;
-
-- unc_len = off;
-- ret = lzo1x_1_compress(unc, unc_len,
-- cmp + LZO_HEADER, &cmp_len, wrk);
-- if (ret < 0) {
-- printk(KERN_ERR "PM: LZO compression failed\n");
-- break;
-- }
-+ crc->run_threads = thr;
-+ atomic_set(&crc->ready, 1);
-+ wake_up(&crc->go);
-
-- if (unlikely(!cmp_len ||
-- cmp_len > lzo1x_worst_compress(unc_len))) {
-- printk(KERN_ERR "PM: Invalid LZO compressed length\n");
-- ret = -1;
-- break;
-- }
-+ for (run_threads = thr, thr = 0; thr < run_threads; thr++) {
-+ wait_event(data[thr].done,
-+ atomic_read(&data[thr].stop));
-+ atomic_set(&data[thr].stop, 0);
-
-- *(size_t *)cmp = cmp_len;
-+ ret = data[thr].ret;
-
-- /*
-- * Given we are writing one page at a time to disk, we copy
-- * that much from the buffer, although the last bit will likely
-- * be smaller than full page. This is OK - we saved the length
-- * of the compressed data, so any garbage at the end will be
-- * discarded when we read it.
-- */
-- for (off = 0; off < LZO_HEADER + cmp_len; off += PAGE_SIZE) {
-- memcpy(page, cmp + off, PAGE_SIZE);
-+ if (ret < 0) {
-+ printk(KERN_ERR "PM: LZO compression failed\n");
-+ goto out_finish;
-+ }
-
-- ret = swap_write_page(handle, page, &bio);
-- if (ret)
-+ if (unlikely(!data[thr].cmp_len ||
-+ data[thr].cmp_len >
-+ lzo1x_worst_compress(data[thr].unc_len))) {
-+ printk(KERN_ERR
-+ "PM: Invalid LZO compressed length\n");
-+ ret = -1;
- goto out_finish;
-+ }
-+
-+ *(size_t *)data[thr].cmp = data[thr].cmp_len;
-+
-+ /*
-+ * Given we are writing one page at a time to disk, we
-+ * copy that much from the buffer, although the last
-+ * bit will likely be smaller than full page. This is
-+ * OK - we saved the length of the compressed data, so
-+ * any garbage at the end will be discarded when we
-+ * read it.
-+ */
-+ for (off = 0;
-+ off < LZO_HEADER + data[thr].cmp_len;
-+ off += PAGE_SIZE) {
-+ memcpy(page, data[thr].cmp + off, PAGE_SIZE);
-+
-+ ret = swap_write_page(handle, page, &bio);
-+ if (ret)
-+ goto out_finish;
-+ }
- }
-+
-+ wait_event(crc->done, atomic_read(&crc->stop));
-+ atomic_set(&crc->stop, 0);
- }
-
- out_finish:
-@@ -536,16 +737,25 @@ out_finish:
- do_gettimeofday(&stop);
- if (!ret)
- ret = err2;
-- if (!ret)
-+ if (!ret) {
- printk(KERN_CONT "\b\b\b\bdone\n");
-- else
-+ } else {
- printk(KERN_CONT "\n");
-+ }
- swsusp_show_speed(&start, &stop, nr_to_write, "Wrote");
--
-- vfree(cmp);
-- vfree(unc);
-- vfree(wrk);
-- free_page((unsigned long)page);
-+out_clean:
-+ if (crc) {
-+ if (crc->thr)
-+ kthread_stop(crc->thr);
-+ kfree(crc);
-+ }
-+ if (data) {
-+ for (thr = 0; thr < nr_threads; thr++)
-+ if (data[thr].thr)
-+ kthread_stop(data[thr].thr);
-+ vfree(data);
-+ }
-+ if (page) free_page((unsigned long)page);
-
- return ret;
- }
-@@ -625,8 +835,15 @@ out_finish:
-
- static void release_swap_reader(struct swap_map_handle *handle)
- {
-- if (handle->cur)
-- free_page((unsigned long)handle->cur);
-+ struct swap_map_page_list *tmp;
-+
-+ while (handle->maps) {
-+ if (handle->maps->map)
-+ free_page((unsigned long)handle->maps->map);
-+ tmp = handle->maps;
-+ handle->maps = handle->maps->next;
-+ kfree(tmp);
-+ }
- handle->cur = NULL;
- }
-
-@@ -634,22 +851,46 @@ static int get_swap_reader(struct swap_map_handle *handle,
- unsigned int *flags_p)
- {
- int error;
-+ struct swap_map_page_list *tmp, *last;
-+ sector_t offset;
-
- *flags_p = swsusp_header->flags;
-
- if (!swsusp_header->image) /* how can this happen? */
- return -EINVAL;
-
-- handle->cur = (struct swap_map_page *)get_zeroed_page(__GFP_WAIT | __GFP_HIGH);
-- if (!handle->cur)
-- return -ENOMEM;
-+ handle->cur = NULL;
-+ last = handle->maps = NULL;
-+ offset = swsusp_header->image;
-+ while (offset) {
-+ tmp = kmalloc(sizeof(*handle->maps), GFP_KERNEL);
-+ if (!tmp) {
-+ release_swap_reader(handle);
-+ return -ENOMEM;
-+ }
-+ memset(tmp, 0, sizeof(*tmp));
-+ if (!handle->maps)
-+ handle->maps = tmp;
-+ if (last)
-+ last->next = tmp;
-+ last = tmp;
-+
-+ tmp->map = (struct swap_map_page *)
-+ __get_free_page(__GFP_WAIT | __GFP_HIGH);
-+ if (!tmp->map) {
-+ release_swap_reader(handle);
-+ return -ENOMEM;
-+ }
-
-- error = hib_bio_read_page(swsusp_header->image, handle->cur, NULL);
-- if (error) {
-- release_swap_reader(handle);
-- return error;
-+ error = hib_bio_read_page(offset, tmp->map, NULL);
-+ if (error) {
-+ release_swap_reader(handle);
-+ return error;
-+ }
-+ offset = tmp->map->next_swap;
- }
- handle->k = 0;
-+ handle->cur = handle->maps->map;
- return 0;
- }
-
-@@ -658,6 +899,7 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf,
- {
- sector_t offset;
- int error;
-+ struct swap_map_page_list *tmp;
-
- if (!handle->cur)
- return -EINVAL;
-@@ -668,13 +910,15 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf,
- if (error)
- return error;
- if (++handle->k >= MAP_PAGE_ENTRIES) {
-- error = hib_wait_on_bio_chain(bio_chain);
- handle->k = 0;
-- offset = handle->cur->next_swap;
-- if (!offset)
-+ free_page((unsigned long)handle->maps->map);
-+ tmp = handle->maps;
-+ handle->maps = handle->maps->next;
-+ kfree(tmp);
-+ if (!handle->maps)
- release_swap_reader(handle);
-- else if (!error)
-- error = hib_bio_read_page(offset, handle->cur, NULL);
-+ else
-+ handle->cur = handle->maps->map;
- }
- return error;
- }
-@@ -697,7 +941,7 @@ static int load_image(struct swap_map_handle *handle,
- unsigned int nr_to_read)
- {
- unsigned int m;
-- int error = 0;
-+ int ret = 0;
- struct timeval start;
- struct timeval stop;
- struct bio *bio;
-@@ -713,15 +957,15 @@ static int load_image(struct swap_map_handle *handle,
- bio = NULL;
- do_gettimeofday(&start);
- for ( ; ; ) {
-- error = snapshot_write_next(snapshot);
-- if (error <= 0)
-+ ret = snapshot_write_next(snapshot);
-+ if (ret <= 0)
- break;
-- error = swap_read_page(handle, data_of(*snapshot), &bio);
-- if (error)
-+ ret = swap_read_page(handle, data_of(*snapshot), &bio);
-+ if (ret)
- break;
- if (snapshot->sync_read)
-- error = hib_wait_on_bio_chain(&bio);
-- if (error)
-+ ret = hib_wait_on_bio_chain(&bio);
-+ if (ret)
- break;
- if (!(nr_pages % m))
- printk("\b\b\b\b%3d%%", nr_pages / m);
-@@ -729,17 +973,61 @@ static int load_image(struct swap_map_handle *handle,
- }
- err2 = hib_wait_on_bio_chain(&bio);
- do_gettimeofday(&stop);
-- if (!error)
-- error = err2;
-- if (!error) {
-+ if (!ret)
-+ ret = err2;
-+ if (!ret) {
- printk("\b\b\b\bdone\n");
- snapshot_write_finalize(snapshot);
- if (!snapshot_image_loaded(snapshot))
-- error = -ENODATA;
-+ ret = -ENODATA;
- } else
- printk("\n");
- swsusp_show_speed(&start, &stop, nr_to_read, "Read");
-- return error;
-+ return ret;
-+}
-+
-+/**
-+ * Structure used for LZO data decompression.
-+ */
-+struct dec_data {
-+ struct task_struct *thr; /* thread */
-+ atomic_t ready; /* ready to start flag */
-+ atomic_t stop; /* ready to stop flag */
-+ int ret; /* return code */
-+ wait_queue_head_t go; /* start decompression */
-+ wait_queue_head_t done; /* decompression done */
-+ size_t unc_len; /* uncompressed length */
-+ size_t cmp_len; /* compressed length */
-+ unsigned char unc[LZO_UNC_SIZE]; /* uncompressed buffer */
-+ unsigned char cmp[LZO_CMP_SIZE]; /* compressed buffer */
-+};
-+
-+/**
-+ * Deompression function that runs in its own thread.
-+ */
-+static int lzo_decompress_threadfn(void *data)
-+{
-+ struct dec_data *d = data;
-+
-+ while (1) {
-+ wait_event(d->go, atomic_read(&d->ready) ||
-+ kthread_should_stop());
-+ if (kthread_should_stop()) {
-+ d->thr = NULL;
-+ d->ret = -1;
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ break;
-+ }
-+ atomic_set(&d->ready, 0);
-+
-+ d->unc_len = LZO_UNC_SIZE;
-+ d->ret = lzo1x_decompress_safe(d->cmp + LZO_HEADER, d->cmp_len,
-+ d->unc, &d->unc_len);
-+ atomic_set(&d->stop, 1);
-+ wake_up(&d->done);
-+ }
-+ return 0;
- }
-
- /**
-@@ -753,50 +1041,120 @@ static int load_image_lzo(struct swap_map_handle *handle,
- unsigned int nr_to_read)
- {
- unsigned int m;
-- int error = 0;
-+ int ret = 0;
-+ int eof = 0;
- struct bio *bio;
- struct timeval start;
- struct timeval stop;
- unsigned nr_pages;
-- size_t i, off, unc_len, cmp_len;
-- unsigned char *unc, *cmp, *page[LZO_CMP_PAGES];
--
-- for (i = 0; i < LZO_CMP_PAGES; i++) {
-- page[i] = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH);
-- if (!page[i]) {
-- printk(KERN_ERR "PM: Failed to allocate LZO page\n");
-+ size_t off;
-+ unsigned i, thr, run_threads, nr_threads;
-+ unsigned ring = 0, pg = 0, ring_size = 0,
-+ have = 0, want, need, asked = 0;
-+ unsigned long read_pages;
-+ unsigned char **page = NULL;
-+ struct dec_data *data = NULL;
-+ struct crc_data *crc = NULL;
-+
-+ /*
-+ * We'll limit the number of threads for decompression to limit memory
-+ * footprint.
-+ */
-+ nr_threads = num_online_cpus() - 1;
-+ nr_threads = clamp_val(nr_threads, 1, LZO_THREADS);
-+
-+ page = vmalloc(sizeof(*page) * LZO_READ_PAGES);
-+ if (!page) {
-+ printk(KERN_ERR "PM: Failed to allocate LZO page\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
-
-- while (i)
-- free_page((unsigned long)page[--i]);
-+ data = vmalloc(sizeof(*data) * nr_threads);
-+ if (!data) {
-+ printk(KERN_ERR "PM: Failed to allocate LZO data\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
-+ for (thr = 0; thr < nr_threads; thr++)
-+ memset(&data[thr], 0, offsetof(struct dec_data, go));
-
-- return -ENOMEM;
-+ crc = kmalloc(sizeof(*crc), GFP_KERNEL);
-+ if (!crc) {
-+ printk(KERN_ERR "PM: Failed to allocate crc\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
-+ memset(crc, 0, offsetof(struct crc_data, go));
-+
-+ /*
-+ * Start the decompression threads.
-+ */
-+ for (thr = 0; thr < nr_threads; thr++) {
-+ init_waitqueue_head(&data[thr].go);
-+ init_waitqueue_head(&data[thr].done);
-+
-+ data[thr].thr = kthread_run(lzo_decompress_threadfn,
-+ &data[thr],
-+ "image_decompress/%u", thr);
-+ if (IS_ERR(data[thr].thr)) {
-+ data[thr].thr = NULL;
-+ printk(KERN_ERR
-+ "PM: Cannot start decompression threads\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
- }
- }
-
-- unc = vmalloc(LZO_UNC_SIZE);
-- if (!unc) {
-- printk(KERN_ERR "PM: Failed to allocate LZO uncompressed\n");
--
-- for (i = 0; i < LZO_CMP_PAGES; i++)
-- free_page((unsigned long)page[i]);
--
-- return -ENOMEM;
-+ /*
-+ * Start the CRC32 thread.
-+ */
-+ init_waitqueue_head(&crc->go);
-+ init_waitqueue_head(&crc->done);
-+
-+ handle->crc32 = 0;
-+ crc->crc32 = &handle->crc32;
-+ for (thr = 0; thr < nr_threads; thr++) {
-+ crc->unc[thr] = data[thr].unc;
-+ crc->unc_len[thr] = &data[thr].unc_len;
- }
-
-- cmp = vmalloc(LZO_CMP_SIZE);
-- if (!cmp) {
-- printk(KERN_ERR "PM: Failed to allocate LZO compressed\n");
-+ crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32");
-+ if (IS_ERR(crc->thr)) {
-+ crc->thr = NULL;
-+ printk(KERN_ERR "PM: Cannot start CRC32 thread\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ }
-
-- vfree(unc);
-- for (i = 0; i < LZO_CMP_PAGES; i++)
-- free_page((unsigned long)page[i]);
-+ /*
-+ * Adjust number of pages for read buffering, in case we are short.
-+ */
-+ read_pages = (nr_free_pages() - snapshot_get_image_size()) >> 1;
-+ read_pages = clamp_val(read_pages, LZO_CMP_PAGES, LZO_READ_PAGES);
-
-- return -ENOMEM;
-+ for (i = 0; i < read_pages; i++) {
-+ page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ?
-+ __GFP_WAIT | __GFP_HIGH :
-+ __GFP_WAIT);
-+ if (!page[i]) {
-+ if (i < LZO_CMP_PAGES) {
-+ ring_size = i;
-+ printk(KERN_ERR
-+ "PM: Failed to allocate LZO pages\n");
-+ ret = -ENOMEM;
-+ goto out_clean;
-+ } else {
-+ break;
-+ }
-+ }
- }
-+ want = ring_size = i;
-
- printk(KERN_INFO
-+ "PM: Using %u thread(s) for decompression.\n"
- "PM: Loading and decompressing image data (%u pages) ... ",
-- nr_to_read);
-+ nr_threads, nr_to_read);
- m = nr_to_read / 100;
- if (!m)
- m = 1;
-@@ -804,85 +1162,189 @@ static int load_image_lzo(struct swap_map_handle *handle,
- bio = NULL;
- do_gettimeofday(&start);
-
-- error = snapshot_write_next(snapshot);
-- if (error <= 0)
-+ ret = snapshot_write_next(snapshot);
-+ if (ret <= 0)
- goto out_finish;
-
-- for (;;) {
-- error = swap_read_page(handle, page[0], NULL); /* sync */
-- if (error)
-- break;
--
-- cmp_len = *(size_t *)page[0];
-- if (unlikely(!cmp_len ||
-- cmp_len > lzo1x_worst_compress(LZO_UNC_SIZE))) {
-- printk(KERN_ERR "PM: Invalid LZO compressed length\n");
-- error = -1;
-- break;
-+ for(;;) {
-+ for (i = 0; !eof && i < want; i++) {
-+ ret = swap_read_page(handle, page[ring], &bio);
-+ if (ret) {
-+ /*
-+ * On real read error, finish. On end of data,
-+ * set EOF flag and just exit the read loop.
-+ */
-+ if (handle->cur &&
-+ handle->cur->entries[handle->k]) {
-+ goto out_finish;
-+ } else {
-+ eof = 1;
-+ break;
-+ }
-+ }
-+ if (++ring >= ring_size)
-+ ring = 0;
- }
-+ asked += i;
-+ want -= i;
-
-- for (off = PAGE_SIZE, i = 1;
-- off < LZO_HEADER + cmp_len; off += PAGE_SIZE, i++) {
-- error = swap_read_page(handle, page[i], &bio);
-- if (error)
-+ /*
-+ * We are out of data, wait for some more.
-+ */
-+ if (!have) {
-+ if (!asked)
-+ break;
-+
-+ ret = hib_wait_on_bio_chain(&bio);
-+ if (ret)
- goto out_finish;
-+ have += asked;
-+ asked = 0;
-+ if (eof)
-+ eof = 2;
- }
-
-- error = hib_wait_on_bio_chain(&bio); /* need all data now */
-- if (error)
-- goto out_finish;
--
-- for (off = 0, i = 0;
-- off < LZO_HEADER + cmp_len; off += PAGE_SIZE, i++) {
-- memcpy(cmp + off, page[i], PAGE_SIZE);
-+ if (crc->run_threads) {
-+ wait_event(crc->done, atomic_read(&crc->stop));
-+ atomic_set(&crc->stop, 0);
-+ crc->run_threads = 0;
- }
-
-- unc_len = LZO_UNC_SIZE;
-- error = lzo1x_decompress_safe(cmp + LZO_HEADER, cmp_len,
-- unc, &unc_len);
-- if (error < 0) {
-- printk(KERN_ERR "PM: LZO decompression failed\n");
-- break;
-+ for (thr = 0; have && thr < nr_threads; thr++) {
-+ data[thr].cmp_len = *(size_t *)page[pg];
-+ if (unlikely(!data[thr].cmp_len ||
-+ data[thr].cmp_len >
-+ lzo1x_worst_compress(LZO_UNC_SIZE))) {
-+ printk(KERN_ERR
-+ "PM: Invalid LZO compressed length\n");
-+ ret = -1;
-+ goto out_finish;
-+ }
-+
-+ need = DIV_ROUND_UP(data[thr].cmp_len + LZO_HEADER,
-+ PAGE_SIZE);
-+ if (need > have) {
-+ if (eof > 1) {
-+ ret = -1;
-+ goto out_finish;
-+ }
-+ break;
-+ }
-+
-+ for (off = 0;
-+ off < LZO_HEADER + data[thr].cmp_len;
-+ off += PAGE_SIZE) {
-+ memcpy(data[thr].cmp + off,
-+ page[pg], PAGE_SIZE);
-+ have--;
-+ want++;
-+ if (++pg >= ring_size)
-+ pg = 0;
-+ }
-+
-+ atomic_set(&data[thr].ready, 1);
-+ wake_up(&data[thr].go);
- }
-
-- if (unlikely(!unc_len ||
-- unc_len > LZO_UNC_SIZE ||
-- unc_len & (PAGE_SIZE - 1))) {
-- printk(KERN_ERR "PM: Invalid LZO uncompressed length\n");
-- error = -1;
-- break;
-+ /*
-+ * Wait for more data while we are decompressing.
-+ */
-+ if (have < LZO_CMP_PAGES && asked) {
-+ ret = hib_wait_on_bio_chain(&bio);
-+ if (ret)
-+ goto out_finish;
-+ have += asked;
-+ asked = 0;
-+ if (eof)
-+ eof = 2;
- }
-
-- for (off = 0; off < unc_len; off += PAGE_SIZE) {
-- memcpy(data_of(*snapshot), unc + off, PAGE_SIZE);
-+ for (run_threads = thr, thr = 0; thr < run_threads; thr++) {
-+ wait_event(data[thr].done,
-+ atomic_read(&data[thr].stop));
-+ atomic_set(&data[thr].stop, 0);
-+
-+ ret = data[thr].ret;
-
-- if (!(nr_pages % m))
-- printk("\b\b\b\b%3d%%", nr_pages / m);
-- nr_pages++;
-+ if (ret < 0) {
-+ printk(KERN_ERR
-+ "PM: LZO decompression failed\n");
-+ goto out_finish;
-+ }
-
-- error = snapshot_write_next(snapshot);
-- if (error <= 0)
-+ if (unlikely(!data[thr].unc_len ||
-+ data[thr].unc_len > LZO_UNC_SIZE ||
-+ data[thr].unc_len & (PAGE_SIZE - 1))) {
-+ printk(KERN_ERR
-+ "PM: Invalid LZO uncompressed length\n");
-+ ret = -1;
- goto out_finish;
-+ }
-+
-+ for (off = 0;
-+ off < data[thr].unc_len; off += PAGE_SIZE) {
-+ memcpy(data_of(*snapshot),
-+ data[thr].unc + off, PAGE_SIZE);
-+
-+ if (!(nr_pages % m))
-+ printk("\b\b\b\b%3d%%", nr_pages / m);
-+ nr_pages++;
-+
-+ ret = snapshot_write_next(snapshot);
-+ if (ret <= 0) {
-+ crc->run_threads = thr + 1;
-+ atomic_set(&crc->ready, 1);
-+ wake_up(&crc->go);
-+ goto out_finish;
-+ }
-+ }
- }
-+
-+ crc->run_threads = thr;
-+ atomic_set(&crc->ready, 1);
-+ wake_up(&crc->go);
- }
-
- out_finish:
-+ if (crc->run_threads) {
-+ wait_event(crc->done, atomic_read(&crc->stop));
-+ atomic_set(&crc->stop, 0);
-+ }
- do_gettimeofday(&stop);
-- if (!error) {
-+ if (!ret) {
- printk("\b\b\b\bdone\n");
- snapshot_write_finalize(snapshot);
- if (!snapshot_image_loaded(snapshot))
-- error = -ENODATA;
-+ ret = -ENODATA;
-+ if (!ret) {
-+ if (swsusp_header->flags & SF_CRC32_MODE) {
-+ if(handle->crc32 != swsusp_header->crc32) {
-+ printk(KERN_ERR
-+ "PM: Invalid image CRC32!\n");
-+ ret = -ENODATA;
-+ }
-+ }
-+ }
- } else
- printk("\n");
- swsusp_show_speed(&start, &stop, nr_to_read, "Read");
--
-- vfree(cmp);
-- vfree(unc);
-- for (i = 0; i < LZO_CMP_PAGES; i++)
-+out_clean:
-+ for (i = 0; i < ring_size; i++)
- free_page((unsigned long)page[i]);
-+ if (crc) {
-+ if (crc->thr)
-+ kthread_stop(crc->thr);
-+ kfree(crc);
-+ }
-+ if (data) {
-+ for (thr = 0; thr < nr_threads; thr++)
-+ if (data[thr].thr)
-+ kthread_stop(data[thr].thr);
-+ vfree(data);
-+ }
-+ if (page) vfree(page);
-
-- return error;
-+ return ret;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0092-PM-Sleep-Mark-devices-involved-in-wakeup-signaling-d.patch b/patches.runtime_pm/0092-PM-Sleep-Mark-devices-involved-in-wakeup-signaling-d.patch
deleted file mode 100644
index 645a80d87abf33..00000000000000
--- a/patches.runtime_pm/0092-PM-Sleep-Mark-devices-involved-in-wakeup-signaling-d.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 435d910aeaf727d5b6c73cc242c9c3a59f7b8917 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 16 Oct 2011 23:34:36 +0200
-Subject: PM / Sleep: Mark devices involved in wakeup signaling during suspend
-
-The generic PM domains code in drivers/base/power/domain.c has
-to avoid powering off domains that provide power to wakeup devices
-during system suspend. Currently, however, this only works for
-wakeup devices directly belonging to the given domain and not for
-their children (or the children of their children and so on).
-Thus, if there's a wakeup device whose parent belongs to a power
-domain handled by the generic PM domains code, the domain will be
-powered off during system suspend preventing the device from
-signaling wakeup.
-
-To address this problem introduce a device flag, power.wakeup_path,
-that will be set during system suspend for all wakeup devices,
-their parents, the parents of their parents and so on. This way,
-all wakeup paths in the device hierarchy will be marked and the
-generic PM domains code will only need to avoid powering off
-domains containing devices whose power.wakeup_path is set.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 4 ++--
- drivers/base/power/main.c | 8 +++++++-
- include/linux/pm.h | 1 +
- 3 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 22fe029..6790cf7 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -714,7 +714,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (ret)
- return ret;
-
-- if (device_may_wakeup(dev)
-+ if (dev->power.wakeup_path
- && genpd->active_wakeup && genpd->active_wakeup(dev))
- return 0;
-
-@@ -938,7 +938,7 @@ static int pm_genpd_dev_poweroff_noirq(struct device *dev)
- if (ret)
- return ret;
-
-- if (device_may_wakeup(dev)
-+ if (dev->power.wakeup_path
- && genpd->active_wakeup && genpd->active_wakeup(dev))
- return 0;
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index b1b5826..59f8ab2 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -917,7 +917,11 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- }
-
- End:
-- dev->power.is_suspended = !error;
-+ if (!error) {
-+ dev->power.is_suspended = true;
-+ if (dev->power.wakeup_path && dev->parent)
-+ dev->parent->power.wakeup_path = true;
-+ }
-
- device_unlock(dev);
- complete_all(&dev->power.completion);
-@@ -1020,6 +1024,8 @@ static int device_prepare(struct device *dev, pm_message_t state)
-
- device_lock(dev);
-
-+ dev->power.wakeup_path = device_may_wakeup(dev);
-+
- if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "preparing power domain ");
- if (dev->pm_domain->ops.prepare)
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 91f248b..f15acb6 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -452,6 +452,7 @@ struct dev_pm_info {
- struct list_head entry;
- struct completion completion;
- struct wakeup_source *wakeup;
-+ bool wakeup_path:1;
- #else
- unsigned int should_wakeup:1;
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0093-PM-Documentation-Update-docs-about-suspend-and-CPU-h.patch b/patches.runtime_pm/0093-PM-Documentation-Update-docs-about-suspend-and-CPU-h.patch
deleted file mode 100644
index 87005be6a42777..00000000000000
--- a/patches.runtime_pm/0093-PM-Documentation-Update-docs-about-suspend-and-CPU-h.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-From a371c0a97e239d4243cbfd2c463f2f211d591538 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Wed, 19 Oct 2011 23:59:05 +0200
-Subject: PM / Documentation: Update docs about suspend and CPU hotplug
-
-Update the documentation about the interaction between the suspend (S3) call
-path and the CPU hotplug infrastructure.
-This patch focusses only on the activities of the freezer, cpu hotplug and
-the notifications involved. It outlines how regular CPU hotplug differs from
-the way it is invoked during suspend and also tries to explain the locking
-involved. In addition to that, it discusses the issue of microcode update
-during CPU hotplug operations.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 7fef9fc83fbd7293ea9fe665d14046422ebf4219)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/00-INDEX | 2 +
- Documentation/power/suspend-and-cpuhotplug.txt | 275 ++++++++++++++++++++++++
- 2 files changed, 277 insertions(+)
- create mode 100644 Documentation/power/suspend-and-cpuhotplug.txt
-
-diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX
-index 45e9d4a..a4d682f 100644
---- a/Documentation/power/00-INDEX
-+++ b/Documentation/power/00-INDEX
-@@ -26,6 +26,8 @@ s2ram.txt
- - How to get suspend to ram working (and debug it when it isn't)
- states.txt
- - System power management states
-+suspend-and-cpuhotplug.txt
-+ - Explains the interaction between Suspend-to-RAM (S3) and CPU hotplug
- swsusp-and-swap-files.txt
- - Using swap files with software suspend (to disk)
- swsusp-dmcrypt.txt
-diff --git a/Documentation/power/suspend-and-cpuhotplug.txt b/Documentation/power/suspend-and-cpuhotplug.txt
-new file mode 100644
-index 0000000..f28f9a6
---- /dev/null
-+++ b/Documentation/power/suspend-and-cpuhotplug.txt
-@@ -0,0 +1,275 @@
-+Interaction of Suspend code (S3) with the CPU hotplug infrastructure
-+
-+ (C) 2011 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-+
-+
-+I. How does the regular CPU hotplug code differ from how the Suspend-to-RAM
-+ infrastructure uses it internally? And where do they share common code?
-+
-+Well, a picture is worth a thousand words... So ASCII art follows :-)
-+
-+[This depicts the current design in the kernel, and focusses only on the
-+interactions involving the freezer and CPU hotplug and also tries to explain
-+the locking involved. It outlines the notifications involved as well.
-+But please note that here, only the call paths are illustrated, with the aim
-+of describing where they take different paths and where they share code.
-+What happens when regular CPU hotplug and Suspend-to-RAM race with each other
-+is not depicted here.]
-+
-+On a high level, the suspend-resume cycle goes like this:
-+
-+|Freeze| -> |Disable nonboot| -> |Do suspend| -> |Enable nonboot| -> |Thaw |
-+|tasks | | cpus | | | | cpus | |tasks|
-+
-+
-+More details follow:
-+
-+ Suspend call path
-+ -----------------
-+
-+ Write 'mem' to
-+ /sys/power/state
-+ syfs file
-+ |
-+ v
-+ Acquire pm_mutex lock
-+ |
-+ v
-+ Send PM_SUSPEND_PREPARE
-+ notifications
-+ |
-+ v
-+ Freeze tasks
-+ |
-+ |
-+ v
-+ disable_nonboot_cpus()
-+ /* start */
-+ |
-+ v
-+ Acquire cpu_add_remove_lock
-+ |
-+ v
-+ Iterate over CURRENTLY
-+ online CPUs
-+ |
-+ |
-+ | ----------
-+ v | L
-+ ======> _cpu_down() |
-+ | [This takes cpuhotplug.lock |
-+ Common | before taking down the CPU |
-+ code | and releases it when done] | O
-+ | While it is at it, notifications |
-+ | are sent when notable events occur, |
-+ ======> by running all registered callbacks. |
-+ | | O
-+ | |
-+ | |
-+ v |
-+ Note down these cpus in | P
-+ frozen_cpus mask ----------
-+ |
-+ v
-+ Disable regular cpu hotplug
-+ by setting cpu_hotplug_disabled=1
-+ |
-+ v
-+ Release cpu_add_remove_lock
-+ |
-+ v
-+ /* disable_nonboot_cpus() complete */
-+ |
-+ v
-+ Do suspend
-+
-+
-+
-+Resuming back is likewise, with the counterparts being (in the order of
-+execution during resume):
-+* enable_nonboot_cpus() which involves:
-+ | Acquire cpu_add_remove_lock
-+ | Reset cpu_hotplug_disabled to 0, thereby enabling regular cpu hotplug
-+ | Call _cpu_up() [for all those cpus in the frozen_cpus mask, in a loop]
-+ | Release cpu_add_remove_lock
-+ v
-+
-+* thaw tasks
-+* send PM_POST_SUSPEND notifications
-+* Release pm_mutex lock.
-+
-+
-+It is to be noted here that the pm_mutex lock is acquired at the very
-+beginning, when we are just starting out to suspend, and then released only
-+after the entire cycle is complete (i.e., suspend + resume).
-+
-+
-+
-+ Regular CPU hotplug call path
-+ -----------------------------
-+
-+ Write 0 (or 1) to
-+ /sys/devices/system/cpu/cpu*/online
-+ sysfs file
-+ |
-+ |
-+ v
-+ cpu_down()
-+ |
-+ v
-+ Acquire cpu_add_remove_lock
-+ |
-+ v
-+ If cpu_hotplug_disabled is 1
-+ return gracefully
-+ |
-+ |
-+ v
-+ ======> _cpu_down()
-+ | [This takes cpuhotplug.lock
-+ Common | before taking down the CPU
-+ code | and releases it when done]
-+ | While it is at it, notifications
-+ | are sent when notable events occur,
-+ ======> by running all registered callbacks.
-+ |
-+ |
-+ v
-+ Release cpu_add_remove_lock
-+ [That's it!, for
-+ regular CPU hotplug]
-+
-+
-+
-+So, as can be seen from the two diagrams (the parts marked as "Common code"),
-+regular CPU hotplug and the suspend code path converge at the _cpu_down() and
-+_cpu_up() functions. They differ in the arguments passed to these functions,
-+in that during regular CPU hotplug, 0 is passed for the 'tasks_frozen'
-+argument. But during suspend, since the tasks are already frozen by the time
-+the non-boot CPUs are offlined or onlined, the _cpu_*() functions are called
-+with the 'tasks_frozen' argument set to 1.
-+[See below for some known issues regarding this.]
-+
-+
-+Important files and functions/entry points:
-+------------------------------------------
-+
-+kernel/power/process.c : freeze_processes(), thaw_processes()
-+kernel/power/suspend.c : suspend_prepare(), suspend_enter(), suspend_finish()
-+kernel/cpu.c: cpu_[up|down](), _cpu_[up|down](), [disable|enable]_nonboot_cpus()
-+
-+
-+
-+II. What are the issues involved in CPU hotplug?
-+ -------------------------------------------
-+
-+There are some interesting situations involving CPU hotplug and microcode
-+update on the CPUs, as discussed below:
-+
-+[Please bear in mind that the kernel requests the microcode images from
-+userspace, using the request_firmware() function defined in
-+drivers/base/firmware_class.c]
-+
-+
-+a. When all the CPUs are identical:
-+
-+ This is the most common situation and it is quite straightforward: we want
-+ to apply the same microcode revision to each of the CPUs.
-+ To give an example of x86, the collect_cpu_info() function defined in
-+ arch/x86/kernel/microcode_core.c helps in discovering the type of the CPU
-+ and thereby in applying the correct microcode revision to it.
-+ But note that the kernel does not maintain a common microcode image for the
-+ all CPUs, in order to handle case 'b' described below.
-+
-+
-+b. When some of the CPUs are different than the rest:
-+
-+ In this case since we probably need to apply different microcode revisions
-+ to different CPUs, the kernel maintains a copy of the correct microcode
-+ image for each CPU (after appropriate CPU type/model discovery using
-+ functions such as collect_cpu_info()).
-+
-+
-+c. When a CPU is physically hot-unplugged and a new (and possibly different
-+ type of) CPU is hot-plugged into the system:
-+
-+ In the current design of the kernel, whenever a CPU is taken offline during
-+ a regular CPU hotplug operation, upon receiving the CPU_DEAD notification
-+ (which is sent by the CPU hotplug code), the microcode update driver's
-+ callback for that event reacts by freeing the kernel's copy of the
-+ microcode image for that CPU.
-+
-+ Hence, when a new CPU is brought online, since the kernel finds that it
-+ doesn't have the microcode image, it does the CPU type/model discovery
-+ afresh and then requests the userspace for the appropriate microcode image
-+ for that CPU, which is subsequently applied.
-+
-+ For example, in x86, the mc_cpu_callback() function (which is the microcode
-+ update driver's callback registered for CPU hotplug events) calls
-+ microcode_update_cpu() which would call microcode_init_cpu() in this case,
-+ instead of microcode_resume_cpu() when it finds that the kernel doesn't
-+ have a valid microcode image. This ensures that the CPU type/model
-+ discovery is performed and the right microcode is applied to the CPU after
-+ getting it from userspace.
-+
-+
-+d. Handling microcode update during suspend/hibernate:
-+
-+ Strictly speaking, during a CPU hotplug operation which does not involve
-+ physically removing or inserting CPUs, the CPUs are not actually powered
-+ off during a CPU offline. They are just put to the lowest C-states possible.
-+ Hence, in such a case, it is not really necessary to re-apply microcode
-+ when the CPUs are brought back online, since they wouldn't have lost the
-+ image during the CPU offline operation.
-+
-+ This is the usual scenario encountered during a resume after a suspend.
-+ However, in the case of hibernation, since all the CPUs are completely
-+ powered off, during restore it becomes necessary to apply the microcode
-+ images to all the CPUs.
-+
-+ [Note that we don't expect someone to physically pull out nodes and insert
-+ nodes with a different type of CPUs in-between a suspend-resume or a
-+ hibernate/restore cycle.]
-+
-+ In the current design of the kernel however, during a CPU offline operation
-+ as part of the suspend/hibernate cycle (the CPU_DEAD_FROZEN notification),
-+ the existing copy of microcode image in the kernel is not freed up.
-+ And during the CPU online operations (during resume/restore), since the
-+ kernel finds that it already has copies of the microcode images for all the
-+ CPUs, it just applies them to the CPUs, avoiding any re-discovery of CPU
-+ type/model and the need for validating whether the microcode revisions are
-+ right for the CPUs or not (due to the above assumption that physical CPU
-+ hotplug will not be done in-between suspend/resume or hibernate/restore
-+ cycles).
-+
-+
-+III. Are there any known problems when regular CPU hotplug and suspend race
-+ with each other?
-+
-+Yes, they are listed below:
-+
-+1. When invoking regular CPU hotplug, the 'tasks_frozen' argument passed to
-+ the _cpu_down() and _cpu_up() functions is *always* 0.
-+ This might not reflect the true current state of the system, since the
-+ tasks could have been frozen by an out-of-band event such as a suspend
-+ operation in progress. Hence, it will lead to wrong notifications being
-+ sent during the cpu online/offline events (eg, CPU_ONLINE notification
-+ instead of CPU_ONLINE_FROZEN) which in turn will lead to execution of
-+ inappropriate code by the callbacks registered for such CPU hotplug events.
-+
-+2. If a regular CPU hotplug stress test happens to race with the freezer due
-+ to a suspend operation in progress at the same time, then we could hit the
-+ situation described below:
-+
-+ * A regular cpu online operation continues its journey from userspace
-+ into the kernel, since the freezing has not yet begun.
-+ * Then freezer gets to work and freezes userspace.
-+ * If cpu online has not yet completed the microcode update stuff by now,
-+ it will now start waiting on the frozen userspace in the
-+ TASK_UNINTERRUPTIBLE state, in order to get the microcode image.
-+ * Now the freezer continues and tries to freeze the remaining tasks. But
-+ due to this wait mentioned above, the freezer won't be able to freeze
-+ the cpu online hotplug task and hence freezing of tasks fails.
-+
-+ As a result of this task freezing failure, the suspend operation gets
-+ aborted.
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0094-PM-Clocks-Remove-redundant-NULL-checks-before-kfree.patch b/patches.runtime_pm/0094-PM-Clocks-Remove-redundant-NULL-checks-before-kfree.patch
deleted file mode 100644
index ad1735b9bbdbc3..00000000000000
--- a/patches.runtime_pm/0094-PM-Clocks-Remove-redundant-NULL-checks-before-kfree.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 7f71d2623cd1d37e5ffd6a2c55fb5d4d2a990eb3 Mon Sep 17 00:00:00 2001
-From: Jonghwan Choi <jhbird.choi@samsung.com>
-Date: Sat, 22 Oct 2011 00:22:54 +0200
-Subject: PM / Clocks: Remove redundant NULL checks before kfree()
-
-Since kfree() checks it its argument is not NULL, it is not necessary
-to duplicate this check in __pm_clk_remove().
-
-[rjw: Added the changelog.]
-
-Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0ab1e79b825a5cd8aeb3b34d89c9a89dea900056)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index b876e60..5f0f85d 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -104,9 +104,7 @@ static void __pm_clk_remove(struct pm_clock_entry *ce)
- clk_put(ce->clk);
- }
-
-- if (ce->con_id)
-- kfree(ce->con_id);
--
-+ kfree(ce->con_id);
- kfree(ce);
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0095-kernel-fix-several-implicit-usasges-of-kmod.h.patch b/patches.runtime_pm/0095-kernel-fix-several-implicit-usasges-of-kmod.h.patch
deleted file mode 100644
index 62b4f767f0a240..00000000000000
--- a/patches.runtime_pm/0095-kernel-fix-several-implicit-usasges-of-kmod.h.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 8d843989de8dc924a683d14534fb2a44cc4eb3bf Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 26 May 2011 12:48:41 -0400
-Subject: kernel: fix several implicit usasges of kmod.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-These files were implicitly relying on <linux/kmod.h> coming in via
-module.h, as without it we get things like:
-
-kernel/power/suspend.c:100: error: implicit declaration of function ‘usermodehelper_disable’
-kernel/power/suspend.c:109: error: implicit declaration of function ‘usermodehelper_enable’
-kernel/power/user.c:254: error: implicit declaration of function ‘usermodehelper_disable’
-kernel/power/user.c:261: error: implicit declaration of function ‘usermodehelper_enable’
-
-kernel/sys.c:317: error: implicit declaration of function ‘usermodehelper_disable’
-kernel/sys.c:1816: error: implicit declaration of function ‘call_usermodehelper_setup’
-kernel/sys.c:1822: error: implicit declaration of function ‘call_usermodehelper_setfns’
-kernel/sys.c:1824: error: implicit declaration of function ‘call_usermodehelper_exec’
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 74da1ff71350f3638c51613085f89c0865d7fe08)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/suspend.c | 1 +
- kernel/power/user.c | 1 +
- kernel/sys.c | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index fdd4263..31aae32 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -12,6 +12,7 @@
- #include <linux/delay.h>
- #include <linux/errno.h>
- #include <linux/init.h>
-+#include <linux/kmod.h>
- #include <linux/console.h>
- #include <linux/cpu.h>
- #include <linux/syscalls.h>
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 42ddbc6..6d8f535 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -12,6 +12,7 @@
- #include <linux/suspend.h>
- #include <linux/syscalls.h>
- #include <linux/reboot.h>
-+#include <linux/kmod.h>
- #include <linux/string.h>
- #include <linux/device.h>
- #include <linux/miscdevice.h>
-diff --git a/kernel/sys.c b/kernel/sys.c
-index f88dadc..f861492 100644
---- a/kernel/sys.c
-+++ b/kernel/sys.c
-@@ -13,6 +13,7 @@
- #include <linux/prctl.h>
- #include <linux/highuid.h>
- #include <linux/fs.h>
-+#include <linux/kmod.h>
- #include <linux/perf_event.h>
- #include <linux/resource.h>
- #include <linux/kernel.h>
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0096-kernel-Fix-files-explicitly-needing-EXPORT_SYMBOL-in.patch b/patches.runtime_pm/0096-kernel-Fix-files-explicitly-needing-EXPORT_SYMBOL-in.patch
deleted file mode 100644
index cb91694e4e5745..00000000000000
--- a/patches.runtime_pm/0096-kernel-Fix-files-explicitly-needing-EXPORT_SYMBOL-in.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 71a73f729b3d470a8680d70b87cb0a504ab27b64 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Thu, 26 May 2011 16:00:52 -0400
-Subject: kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure
-
-These files were getting <linux/module.h> via an implicit non-obvious
-path, but we want to crush those out of existence since they cost
-time during compiles of processing thousands of lines of headers
-for no reason. Give them the lightweight header that just contains
-the EXPORT_SYMBOL infrastructure.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 6e5fdeedca610df600aabc393c4b1f44b128fe49)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/compat.c | 1 +
- kernel/debug/kdb/kdb_debugger.c | 1 +
- kernel/events/core.c | 1 +
- kernel/irq/generic-chip.c | 1 +
- kernel/power/hibernate.c | 1 +
- kernel/power/main.c | 1 +
- kernel/power/qos.c | 1 +
- kernel/power/suspend.c | 1 +
- kernel/time/posix-clock.c | 1 +
- kernel/trace/blktrace.c | 1 +
- 10 files changed, 10 insertions(+)
-
-diff --git a/kernel/compat.c b/kernel/compat.c
-index fc9eb093..caf13a2 100644
---- a/kernel/compat.c
-+++ b/kernel/compat.c
-@@ -21,6 +21,7 @@
- #include <linux/unistd.h>
- #include <linux/security.h>
- #include <linux/timex.h>
-+#include <linux/export.h>
- #include <linux/migrate.h>
- #include <linux/posix-timers.h>
- #include <linux/times.h>
-diff --git a/kernel/debug/kdb/kdb_debugger.c b/kernel/debug/kdb/kdb_debugger.c
-index dd0b1b7..8427a79 100644
---- a/kernel/debug/kdb/kdb_debugger.c
-+++ b/kernel/debug/kdb/kdb_debugger.c
-@@ -11,6 +11,7 @@
- #include <linux/kgdb.h>
- #include <linux/kdb.h>
- #include <linux/kdebug.h>
-+#include <linux/export.h>
- #include "kdb_private.h"
- #include "../debug_core.h"
-
-diff --git a/kernel/events/core.c b/kernel/events/core.c
-index 32a6151..1ebf968 100644
---- a/kernel/events/core.c
-+++ b/kernel/events/core.c
-@@ -25,6 +25,7 @@
- #include <linux/reboot.h>
- #include <linux/vmstat.h>
- #include <linux/device.h>
-+#include <linux/export.h>
- #include <linux/vmalloc.h>
- #include <linux/hardirq.h>
- #include <linux/rculist.h>
-diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
-index e38544d..c84b470 100644
---- a/kernel/irq/generic-chip.c
-+++ b/kernel/irq/generic-chip.c
-@@ -6,6 +6,7 @@
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/slab.h>
-+#include <linux/export.h>
- #include <linux/interrupt.h>
- #include <linux/kernel_stat.h>
- #include <linux/syscore_ops.h>
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index bb170c2..3987d43 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -9,6 +9,7 @@
- * This file is released under the GPLv2.
- */
-
-+#include <linux/export.h>
- #include <linux/suspend.h>
- #include <linux/syscalls.h>
- #include <linux/reboot.h>
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index a52e884..71f49fe 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -8,6 +8,7 @@
- *
- */
-
-+#include <linux/export.h>
- #include <linux/kobject.h>
- #include <linux/string.h>
- #include <linux/resume-trace.h>
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 1c1797d..2c0a65e 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -43,6 +43,7 @@
- #include <linux/kernel.h>
-
- #include <linux/uaccess.h>
-+#include <linux/export.h>
-
- /*
- * locking rule: all changes to constraints or notifiers lists
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 31aae32..4953dc0 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -22,6 +22,7 @@
- #include <linux/list.h>
- #include <linux/mm.h>
- #include <linux/slab.h>
-+#include <linux/export.h>
- #include <linux/suspend.h>
- #include <linux/syscore_ops.h>
- #include <trace/events/power.h>
-diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
-index c340ca6..ce033c7 100644
---- a/kernel/time/posix-clock.c
-+++ b/kernel/time/posix-clock.c
-@@ -18,6 +18,7 @@
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- #include <linux/device.h>
-+#include <linux/export.h>
- #include <linux/file.h>
- #include <linux/posix-clock.h>
- #include <linux/slab.h>
-diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
-index 6957aa2..c1ff082 100644
---- a/kernel/trace/blktrace.c
-+++ b/kernel/trace/blktrace.c
-@@ -23,6 +23,7 @@
- #include <linux/mutex.h>
- #include <linux/slab.h>
- #include <linux/debugfs.h>
-+#include <linux/export.h>
- #include <linux/time.h>
- #include <linux/uaccess.h>
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0097-drivers-base-Add-export.h-for-EXPORT_SYMBOL-THIS_MOD.patch b/patches.runtime_pm/0097-drivers-base-Add-export.h-for-EXPORT_SYMBOL-THIS_MOD.patch
deleted file mode 100644
index 9187fed6a13f2a..00000000000000
--- a/patches.runtime_pm/0097-drivers-base-Add-export.h-for-EXPORT_SYMBOL-THIS_MOD.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 96dd806a2e016cb1e861cfc1bbee8477584726a7 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Fri, 27 May 2011 07:12:15 -0400
-Subject: drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as
- required.
-
-Most of these files were implicitly getting EXPORT_SYMBOL via
-device.h which was including module.h, but that path will be broken
-soon.
-
-[ with input from Stephen Rothwell <sfr@canb.auug.org.au> ]
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 1b6bc32f0a7380102499deb6aa99a59e789efb33)
-
-Conflicts:
-
- drivers/base/regmap/regcache.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/dma-mapping.c | 1 +
- drivers/base/hypervisor.c | 1 +
- drivers/base/power/generic_ops.c | 1 +
- drivers/base/power/main.c | 1 +
- drivers/base/power/qos.c | 1 +
- drivers/base/power/runtime.c | 1 +
- drivers/base/power/sysfs.c | 1 +
- drivers/base/power/trace.c | 1 +
- drivers/base/power/wakeup.c | 1 +
- 9 files changed, 9 insertions(+)
-
-diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c
-index 763d59c..6f3676f 100644
---- a/drivers/base/dma-mapping.c
-+++ b/drivers/base/dma-mapping.c
-@@ -8,6 +8,7 @@
- */
-
- #include <linux/dma-mapping.h>
-+#include <linux/export.h>
- #include <linux/gfp.h>
-
- /*
-diff --git a/drivers/base/hypervisor.c b/drivers/base/hypervisor.c
-index 6428cba..4f8b741 100644
---- a/drivers/base/hypervisor.c
-+++ b/drivers/base/hypervisor.c
-@@ -10,6 +10,7 @@
-
- #include <linux/kobject.h>
- #include <linux/device.h>
-+#include <linux/export.h>
- #include "base.h"
-
- struct kobject *hypervisor_kobj;
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index 9508df7..265a0ee 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -8,6 +8,7 @@
-
- #include <linux/pm.h>
- #include <linux/pm_runtime.h>
-+#include <linux/export.h>
-
- #ifdef CONFIG_PM_RUNTIME
- /**
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 59f8ab2..7fa0984 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -19,6 +19,7 @@
-
- #include <linux/device.h>
- #include <linux/kallsyms.h>
-+#include <linux/export.h>
- #include <linux/mutex.h>
- #include <linux/pm.h>
- #include <linux/pm_runtime.h>
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index 91e0614..30a94ea 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -39,6 +39,7 @@
- #include <linux/slab.h>
- #include <linux/device.h>
- #include <linux/mutex.h>
-+#include <linux/export.h>
-
-
- static DEFINE_MUTEX(dev_pm_qos_mtx);
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 6bb3aaf..1079e03 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -8,6 +8,7 @@
- */
-
- #include <linux/sched.h>
-+#include <linux/export.h>
- #include <linux/pm_runtime.h>
- #include <trace/events/rpm.h>
- #include "power.h"
-diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
-index 942d6a7..ac63d48 100644
---- a/drivers/base/power/sysfs.c
-+++ b/drivers/base/power/sysfs.c
-@@ -4,6 +4,7 @@
-
- #include <linux/device.h>
- #include <linux/string.h>
-+#include <linux/export.h>
- #include <linux/pm_runtime.h>
- #include <asm/atomic.h>
- #include <linux/jiffies.h>
-diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
-index af10abe..d94a1f5 100644
---- a/drivers/base/power/trace.c
-+++ b/drivers/base/power/trace.c
-@@ -8,6 +8,7 @@
- */
-
- #include <linux/resume-trace.h>
-+#include <linux/export.h>
- #include <linux/rtc.h>
-
- #include <asm/rtc.h>
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index 14ee07e..caf995f 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -10,6 +10,7 @@
- #include <linux/slab.h>
- #include <linux/sched.h>
- #include <linux/capability.h>
-+#include <linux/export.h>
- #include <linux/suspend.h>
- #include <linux/seq_file.h>
- #include <linux/debugfs.h>
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0098-drivers-base-change-module.h-export.h-in-power-commo.patch b/patches.runtime_pm/0098-drivers-base-change-module.h-export.h-in-power-commo.patch
deleted file mode 100644
index 48e9ec72c2c747..00000000000000
--- a/patches.runtime_pm/0098-drivers-base-change-module.h-export.h-in-power-commo.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From c904f21e7e8971f1326781657a9659e8c4cfbe0b Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Wed, 28 Sep 2011 18:23:03 -0400
-Subject: drivers/base: change module.h -> export.h in power/common.c
-
-This file isn't using full modular functionality, and hence
-can be "downgraded" to just using export.h
-
-Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit aaf195444be47aa3d3776825b3b384a61f40dca4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/common.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
-index 29820c3..4af7c1c 100644
---- a/drivers/base/power/common.c
-+++ b/drivers/base/power/common.c
-@@ -8,7 +8,7 @@
-
- #include <linux/init.h>
- #include <linux/kernel.h>
--#include <linux/module.h>
-+#include <linux/export.h>
- #include <linux/slab.h>
- #include <linux/pm_clock.h>
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0099-pm_runtime.h-explicitly-requires-notifier.h.patch b/patches.runtime_pm/0099-pm_runtime.h-explicitly-requires-notifier.h.patch
deleted file mode 100644
index 345e1b5b3c3a74..00000000000000
--- a/patches.runtime_pm/0099-pm_runtime.h-explicitly-requires-notifier.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 9c210763508ed5490bbdc7aa7d2d2a205a60658d Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Fri, 27 May 2011 07:08:41 -0400
-Subject: pm_runtime.h: explicitly requires notifier.h
-
-This file was getting notifier.h via device.h --> module.h but
-the module.h inclusion is going away, so add notifier.h directly.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-(cherry picked from commit 246359d37985000b8403487e46867c4eb610af72)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_runtime.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 70b2840..d8d9036 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -10,6 +10,7 @@
- #define _LINUX_PM_RUNTIME_H
-
- #include <linux/device.h>
-+#include <linux/notifier.h>
- #include <linux/pm.h>
-
- #include <linux/jiffies.h>
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0100-PM-Sleep-Update-freezer-documentation.patch b/patches.runtime_pm/0100-PM-Sleep-Update-freezer-documentation.patch
deleted file mode 100644
index db129a18f44af1..00000000000000
--- a/patches.runtime_pm/0100-PM-Sleep-Update-freezer-documentation.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7512e660364856ac3fa294de3e062b64f78fcfc8 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Thu, 3 Nov 2011 00:59:52 +0100
-Subject: PM / Sleep: Update freezer documentation
-
-This patch:
- * Substitutes some obsolete references to kernel/power/process.c by
- kernel/freezer.c.
- * Mentions kernel/freezer.c as being part of the "freezer" code along
- with the rest of the files.
- * Fixes a trivial typo.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e9db50b839c592fcd22952d7f1dccbd0a56da57d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
-index 38b5724..316c2ba 100644
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -22,12 +22,12 @@ try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and
- either wakes them up, if they are kernel threads, or sends fake signals to them,
- if they are user space processes. A task that has TIF_FREEZE set, should react
- to it by calling the function called refrigerator() (defined in
--kernel/power/process.c), which sets the task's PF_FROZEN flag, changes its state
-+kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state
- to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it.
- Then, we say that the task is 'frozen' and therefore the set of functions
- handling this mechanism is referred to as 'the freezer' (these functions are
--defined in kernel/power/process.c and include/linux/freezer.h). User space
--processes are generally frozen before kernel threads.
-+defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h).
-+User space processes are generally frozen before kernel threads.
-
- It is not recommended to call refrigerator() directly. Instead, it is
- recommended to use the try_to_freeze() function (defined in
-@@ -95,7 +95,7 @@ after the memory for the image has been freed, we don't want tasks to allocate
- additional memory and we prevent them from doing that by freezing them earlier.
- [Of course, this also means that device drivers should not allocate substantial
- amounts of memory from their .suspend() callbacks before hibernation, but this
--is e separate issue.]
-+is a separate issue.]
-
- 3. The third reason is to prevent user space processes and some kernel threads
- from interfering with the suspending and resuming of devices. A user space
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0101-PM-Runtime-Fix-runtime-accounting-calculation-error.patch b/patches.runtime_pm/0101-PM-Runtime-Fix-runtime-accounting-calculation-error.patch
deleted file mode 100644
index 01582ac13020ce..00000000000000
--- a/patches.runtime_pm/0101-PM-Runtime-Fix-runtime-accounting-calculation-error.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From ab1561ee359a4a722934b737767c1c6bbc8facff Mon Sep 17 00:00:00 2001
-From: venu byravarasu <vbyravarasu@nvidia.com>
-Date: Thu, 3 Nov 2011 10:12:14 +0100
-Subject: PM / Runtime: Fix runtime accounting calculation error
-
-With delta type being int, its value is made zero
-for all values of now > 0x80000000.
-Hence fixing it.
-
-Signed-off-by: venu byravarasu <vbyravarasu@nvidia.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit def0c0a37d02820497fcd5a74b6cc93dbce5dc06)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 1079e03..e8a5172 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);
- void update_pm_runtime_accounting(struct device *dev)
- {
- unsigned long now = jiffies;
-- int delta;
-+ unsigned long delta;
-
- delta = now - dev->power.accounting_timestamp;
-
-- if (delta < 0)
-- delta = 0;
--
- dev->power.accounting_timestamp = now;
-
- if (dev->power.disable_depth > 0)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0102-PM-QoS-Remove-redundant-check.patch b/patches.runtime_pm/0102-PM-QoS-Remove-redundant-check.patch
deleted file mode 100644
index 494e836a27ccae..00000000000000
--- a/patches.runtime_pm/0102-PM-QoS-Remove-redundant-check.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 96abfc67c5384082c9f292be29c7ad088f0c63eb Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 3 Nov 2011 10:12:36 +0100
-Subject: PM / QoS: Remove redundant check
-
-Remove an "if" check, that repeats an equivalent one 6 lines above.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6513fd6972f725291ee8ce62c7a39fb8a6c7391e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/qos.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 2c0a65e..56db751 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -387,8 +387,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
- pm_qos_add_request(req, pm_qos_class, PM_QOS_DEFAULT_VALUE);
- filp->private_data = req;
-
-- if (filp->private_data)
-- return 0;
-+ return 0;
- }
- return -EPERM;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0103-PM-Runtime-Automatically-retry-failed-autosuspends.patch b/patches.runtime_pm/0103-PM-Runtime-Automatically-retry-failed-autosuspends.patch
deleted file mode 100644
index 6b5e7fd55aa7c9..00000000000000
--- a/patches.runtime_pm/0103-PM-Runtime-Automatically-retry-failed-autosuspends.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 81fce908edabcefa6c4197b6d5e02e566bfaabcc Mon Sep 17 00:00:00 2001
-From: Alan Stern <stern@rowland.harvard.edu>
-Date: Thu, 3 Nov 2011 23:39:18 +0100
-Subject: PM / Runtime: Automatically retry failed autosuspends
-
-Originally, the runtime PM core would send an idle notification
-whenever a suspend attempt failed. The idle callback routine could
-then schedule a delayed suspend for some time later.
-
-However this behavior was changed by commit
-f71648d73c1650b8b4aceb3856bebbde6daa3b86 (PM / Runtime: Remove idle
-notification after failing suspend). No notifications were sent, and
-there was no clear mechanism to retry failed suspends.
-
-This caused problems for the usbhid driver, because it fails
-autosuspend attempts as long as a key is being held down. Therefore
-this patch (as1492) adds a mechanism for retrying failed
-autosuspends. If the callback routine updates the last_busy field so
-that the next autosuspend expiration time is in the future, the
-autosuspend will automatically be rescheduled.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Tested-by: Henrik Rydberg <rydberg@euromail.se>
-Cc: <stable@kernel.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 886486b792e4f6f96d4fbe8ec5bf20811cab7d6a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 10 ++++++++++
- drivers/base/power/runtime.c | 18 ++++++++++++++++--
- 2 files changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 0e85608..5336149 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -789,6 +789,16 @@ will behave normally, not taking the autosuspend delay into account.
- Similarly, if the power.use_autosuspend field isn't set then the autosuspend
- helper functions will behave just like the non-autosuspend counterparts.
-
-+Under some circumstances a driver or subsystem may want to prevent a device
-+from autosuspending immediately, even though the usage counter is zero and the
-+autosuspend delay time has expired. If the ->runtime_suspend() callback
-+returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is
-+in the future (as it normally would be if the callback invoked
-+pm_runtime_mark_last_busy()), the PM core will automatically reschedule the
-+autosuspend. The ->runtime_suspend() callback can't do this rescheduling
-+itself because no suspend requests of any kind are accepted while the device is
-+suspending (i.e., while the callback is running).
-+
- The implementation is well suited for asynchronous use in interrupt contexts.
- However such use inevitably involves races, because the PM core can't
- synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index e8a5172..8c78443 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -294,6 +294,9 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- * the callback was running then carry it out, otherwise send an idle
- * notification for its parent (if the suspend succeeded and both
- * ignore_children of parent->power and irq_safe of dev->power are not set).
-+ * If ->runtime_suspend failed with -EAGAIN or -EBUSY, and if the RPM_AUTO
-+ * flag is set and the next autosuspend-delay expiration time is in the
-+ * future, schedule another autosuspend attempt.
- *
- * This function must be called under dev->power.lock with interrupts disabled.
- */
-@@ -414,10 +417,21 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- if (retval) {
- __update_runtime_status(dev, RPM_ACTIVE);
- dev->power.deferred_resume = false;
-- if (retval == -EAGAIN || retval == -EBUSY)
-+ if (retval == -EAGAIN || retval == -EBUSY) {
- dev->power.runtime_error = 0;
-- else
-+
-+ /*
-+ * If the callback routine failed an autosuspend, and
-+ * if the last_busy time has been updated so that there
-+ * is a new autosuspend expiration time, automatically
-+ * reschedule another autosuspend.
-+ */
-+ if ((rpmflags & RPM_AUTO) &&
-+ pm_runtime_autosuspend_expiration(dev) != 0)
-+ goto repeat;
-+ } else {
- pm_runtime_cancel_pending(dev);
-+ }
- wake_up_all(&dev->power.wait_queue);
- goto out;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0104-PM-QoS-Set-cpu_dma_pm_qos-name.patch b/patches.runtime_pm/0104-PM-QoS-Set-cpu_dma_pm_qos-name.patch
deleted file mode 100644
index 5d51c5e279b30e..00000000000000
--- a/patches.runtime_pm/0104-PM-QoS-Set-cpu_dma_pm_qos-name.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 01ee19f4a4b983cc9694e6faec1a3a97bc53d8dc Mon Sep 17 00:00:00 2001
-From: Dominik Brodowski <linux@dominikbrodowski.net>
-Date: Sun, 6 Nov 2011 21:54:12 +0100
-Subject: PM / QoS: Set cpu_dma_pm_qos->name
-
-Since commit 4a31a334, the name of this misc device is not initialized,
-which leads to a funny device named /dev/(null) being created and
-/proc/misc containing an entry with just a number but no name. The latter
-leads to complaints by cryptsetup, which caused me to investigate this
-matter.
-
-Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a6f05b97d1ba87326bd96f3da9fef994830d6994)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/qos.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 56db751..995e3bd 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -70,6 +70,7 @@ static struct pm_qos_constraints cpu_dma_constraints = {
- };
- static struct pm_qos_object cpu_dma_pm_qos = {
- .constraints = &cpu_dma_constraints,
-+ .name = "cpu_dma_latency",
- };
-
- static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0105-PM-OPP-Use-ERR_CAST-instead-of-ERR_PTR-PTR_ERR.patch b/patches.runtime_pm/0105-PM-OPP-Use-ERR_CAST-instead-of-ERR_PTR-PTR_ERR.patch
deleted file mode 100644
index 3b1adf1d275a83..00000000000000
--- a/patches.runtime_pm/0105-PM-OPP-Use-ERR_CAST-instead-of-ERR_PTR-PTR_ERR.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b12440733cbf622189c4366b4f1d568fddc6b797 Mon Sep 17 00:00:00 2001
-From: Thomas Meyer <thomas@m3y3r.de>
-Date: Tue, 8 Nov 2011 22:34:00 +0100
-Subject: PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
-
-Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
-
-[The semantic patch that makes this change is available
- in scripts/coccinelle/api/err_cast.cocci.
-
- More information about semantic patching is available at
- http://coccinelle.lip6.fr/]
-
-Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 156acb166ea9a43d7fcdf9b8051694ce4e91dbfc)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/opp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
-index 434a6c0..95706fa 100644
---- a/drivers/base/power/opp.c
-+++ b/drivers/base/power/opp.c
-@@ -669,7 +669,7 @@ struct srcu_notifier_head *opp_get_notifier(struct device *dev)
- struct device_opp *dev_opp = find_device_opp(dev);
-
- if (IS_ERR(dev_opp))
-- return ERR_PTR(PTR_ERR(dev_opp)); /* matching type */
-+ return ERR_CAST(dev_opp); /* matching type */
-
- return &dev_opp->head;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0106-PM-Clocks-Only-disable-enabled-clocks-in-pm_clk_susp.patch b/patches.runtime_pm/0106-PM-Clocks-Only-disable-enabled-clocks-in-pm_clk_susp.patch
deleted file mode 100644
index 85d2f5462548c9..00000000000000
--- a/patches.runtime_pm/0106-PM-Clocks-Only-disable-enabled-clocks-in-pm_clk_susp.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 181672b515b7c74537c40aba503d6aeff154471c Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Thu, 10 Nov 2011 00:44:10 +0100
-Subject: PM / Clocks: Only disable enabled clocks in pm_clk_suspend()
-
-Refrain from running clk_disable() on clocks that
-have not been enabled. A typical case when this can
-happen is during Suspend-to-RAM for devices that have
-no driver associated with them. In such case the clock
-may be in default ACQUIRED state.
-
-Without this patch the sh7372 Mackerel board crashes
-in __clk_disable() during Suspend-to-RAM with:
-"Trying to disable clock 0xdeadbeef with 0 usecount"
-This happens for the CEU device which is added during
-boot. The test case has no CEU driver included in the
-kernel configuration. Needed for v3.2-rc1.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 24050956e029a9ecff096e1992869ada4492963c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/clock_ops.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
-index 5f0f85d..428e55e 100644
---- a/drivers/base/power/clock_ops.c
-+++ b/drivers/base/power/clock_ops.c
-@@ -229,7 +229,8 @@ int pm_clk_suspend(struct device *dev)
-
- list_for_each_entry_reverse(ce, &psd->clock_list, node) {
- if (ce->status < PCE_STATUS_ERROR) {
-- clk_disable(ce->clk);
-+ if (ce->status == PCE_STATUS_ENABLED)
-+ clk_disable(ce->clk);
- ce->status = PCE_STATUS_ACQUIRED;
- }
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0107-PM-QoS-Properly-use-the-WARN-macro-in-dev_pm_qos_add.patch b/patches.runtime_pm/0107-PM-QoS-Properly-use-the-WARN-macro-in-dev_pm_qos_add.patch
deleted file mode 100644
index 2b3853ef18cc95..00000000000000
--- a/patches.runtime_pm/0107-PM-QoS-Properly-use-the-WARN-macro-in-dev_pm_qos_add.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 7c68936add8d8da87bbbc2f2574c38a273e7f1c3 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 10 Nov 2011 00:44:18 +0100
-Subject: PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()
-
-Make dev_pm_qos_add_request() use WARN() in a better way and do not hardcode
-the function's name into the message (use __func__ instead).
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit af4c720efc0507e01b89774fed936087baac4107)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/qos.c | 18 ++++++------------
- 1 file changed, 6 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index 30a94ea..86de6c5 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -212,11 +212,9 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- if (!dev || !req) /*guard against callers passing in null */
- return -EINVAL;
-
-- if (dev_pm_qos_request_active(req)) {
-- WARN(1, KERN_ERR "dev_pm_qos_add_request() called for already "
-- "added request\n");
-+ if (WARN(dev_pm_qos_request_active(req),
-+ "%s() called for already added request\n", __func__))
- return -EINVAL;
-- }
-
- req->dev = dev;
-
-@@ -271,11 +269,9 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
- if (!req) /*guard against callers passing in null */
- return -EINVAL;
-
-- if (!dev_pm_qos_request_active(req)) {
-- WARN(1, KERN_ERR "dev_pm_qos_update_request() called for "
-- "unknown object\n");
-+ if (WARN(!dev_pm_qos_request_active(req),
-+ "%s() called for unknown object\n", __func__))
- return -EINVAL;
-- }
-
- mutex_lock(&dev_pm_qos_mtx);
-
-@@ -312,11 +308,9 @@ int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
- if (!req) /*guard against callers passing in null */
- return -EINVAL;
-
-- if (!dev_pm_qos_request_active(req)) {
-- WARN(1, KERN_ERR "dev_pm_qos_remove_request() called for "
-- "unknown object\n");
-+ if (WARN(!dev_pm_qos_request_active(req),
-+ "%s() called for unknown object\n", __func__))
- return -EINVAL;
-- }
-
- mutex_lock(&dev_pm_qos_mtx);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0108-PM-Sleep-Do-not-extend-wakeup-paths-to-devices-with-.patch b/patches.runtime_pm/0108-PM-Sleep-Do-not-extend-wakeup-paths-to-devices-with-.patch
deleted file mode 100644
index 217c62d44b45ea..00000000000000
--- a/patches.runtime_pm/0108-PM-Sleep-Do-not-extend-wakeup-paths-to-devices-with-.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 5e0e8b7ed287d81ca9e16b607a3440ba160cf871 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 17 Nov 2011 21:39:33 +0100
-Subject: PM Sleep: Do not extend wakeup paths to devices with ignore_children
- set
-
-Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
-devices involved in wakeup signaling during suspend) introduced
-the power.wakeup_path field in struct dev_pm_info to mark devices
-whose children are enabled to wake up the system from sleep states,
-so that power domains containing the parents that provide their
-children with wakeup power and/or relay their wakeup signals are not
-turned off. Unfortunately, that introduced a PM regression on SH7372
-whose power consumption in the system "memory sleep" state increased
-as a result of it, because it prevented the power domain containing
-the I2C controller from being turned off when some children of that
-controller were enabled to wake up the system, although the
-controller was not necessary for them to signal wakeup.
-
-To fix this issue use the observation that devices whose
-power.ignore_children flag is set for runtime PM should be treated
-analogously during system suspend. Namely, they shouldn't be
-included in wakeup paths going through their children. Since the
-SH7372 I2C controller's power.ignore_children flag is set, doing so
-will restore the previous behavior of that SOC.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 8b258cc8ac229aa7d5dcb7cc34cb35d9124498ac)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 3 ++-
- include/linux/device.h | 5 +++++
- include/linux/pm.h | 2 +-
- include/linux/pm_runtime.h | 6 ------
- 4 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 7fa0984..c3d2dfc 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -920,7 +920,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- End:
- if (!error) {
- dev->power.is_suspended = true;
-- if (dev->power.wakeup_path && dev->parent)
-+ if (dev->power.wakeup_path
-+ && dev->parent && !dev->parent->power.ignore_children)
- dev->parent->power.wakeup_path = true;
- }
-
-diff --git a/include/linux/device.h b/include/linux/device.h
-index 4980cc0..e483598 100644
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -743,6 +743,11 @@ static inline bool device_async_suspend_enabled(struct device *dev)
- return !!dev->power.async_suspend;
- }
-
-+static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
-+{
-+ dev->power.ignore_children = enable;
-+}
-+
- static inline void device_lock(struct device *dev)
- {
- mutex_lock(&dev->mutex);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index f15acb6..5c4c8b1 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -447,6 +447,7 @@ struct dev_pm_info {
- unsigned int async_suspend:1;
- bool is_prepared:1; /* Owned by the PM core */
- bool is_suspended:1; /* Ditto */
-+ bool ignore_children:1;
- spinlock_t lock;
- #ifdef CONFIG_PM_SLEEP
- struct list_head entry;
-@@ -464,7 +465,6 @@ struct dev_pm_info {
- atomic_t usage_count;
- atomic_t child_count;
- unsigned int disable_depth:3;
-- unsigned int ignore_children:1;
- unsigned int idle_notification:1;
- unsigned int request_pending:1;
- unsigned int deferred_resume:1;
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index d8d9036..d3085e7 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -52,11 +52,6 @@ static inline bool pm_children_suspended(struct device *dev)
- || !atomic_read(&dev->power.child_count);
- }
-
--static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
--{
-- dev->power.ignore_children = enable;
--}
--
- static inline void pm_runtime_get_noresume(struct device *dev)
- {
- atomic_inc(&dev->power.usage_count);
-@@ -130,7 +125,6 @@ static inline void pm_runtime_allow(struct device *dev) {}
- static inline void pm_runtime_forbid(struct device *dev) {}
-
- static inline bool pm_children_suspended(struct device *dev) { return false; }
--static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
- static inline void pm_runtime_get_noresume(struct device *dev) {}
- static inline void pm_runtime_put_noidle(struct device *dev) {}
- static inline bool device_run_wake(struct device *dev) { return false; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0109-PM-Hibernate-Fix-the-early-termination-of-test-modes.patch b/patches.runtime_pm/0109-PM-Hibernate-Fix-the-early-termination-of-test-modes.patch
deleted file mode 100644
index f3616b7dcdb548..00000000000000
--- a/patches.runtime_pm/0109-PM-Hibernate-Fix-the-early-termination-of-test-modes.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From 9bb67d0418b0358569732bce9ac4778975194b4d Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Fri, 18 Nov 2011 23:02:42 +0100
-Subject: PM / Hibernate: Fix the early termination of test modes
-
-Commit 2aede851ddf08666f68ffc17be446420e9d2a056
-(PM / Hibernate: Freeze kernel threads after preallocating memory)
-postponed the freezing of kernel threads to after preallocating memory
-for hibernation. But while doing that, the hibernation test TEST_FREEZER
-and the test mode HIBERNATION_TESTPROC were not moved accordingly.
-
-As a result, when using these test modes, it only goes upto the freezing of
-userspace and exits, when in fact it should go till the complete end of task
-freezing stage, namely the freezing of kernel threads as well.
-
-So, move these points of exit to appropriate places so that freezing of
-kernel threads is also tested while using these test harnesses.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit aa9a7b11821e883a7b93ecce190881e0ea48648b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 23 +++++++++++++++++------
- 1 file changed, 17 insertions(+), 6 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 3987d43..62c887e 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -55,6 +55,8 @@ enum {
-
- static int hibernation_mode = HIBERNATION_SHUTDOWN;
-
-+static bool freezer_test_done;
-+
- static const struct platform_hibernation_ops *hibernation_ops;
-
- /**
-@@ -347,6 +349,17 @@ int hibernation_snapshot(int platform_mode)
- if (error)
- goto Close;
-
-+ if (hibernation_test(TEST_FREEZER) ||
-+ hibernation_testmode(HIBERNATION_TESTPROC)) {
-+
-+ /*
-+ * Indicate to the caller that we are returning due to a
-+ * successful freezer test.
-+ */
-+ freezer_test_done = true;
-+ goto Close;
-+ }
-+
- error = dpm_prepare(PMSG_FREEZE);
- if (error)
- goto Complete_devices;
-@@ -641,15 +654,13 @@ int hibernate(void)
- if (error)
- goto Free_bitmaps;
-
-- if (hibernation_test(TEST_FREEZER))
-- goto Thaw;
--
-- if (hibernation_testmode(HIBERNATION_TESTPROC))
-- goto Thaw;
--
- error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
- if (error)
- goto Thaw;
-+ if (freezer_test_done) {
-+ freezer_test_done = false;
-+ goto Thaw;
-+ }
-
- if (in_suspend) {
- unsigned int flags = 0;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0110-PM-Suspend-Fix-bug-in-suspend-statistics-update.patch b/patches.runtime_pm/0110-PM-Suspend-Fix-bug-in-suspend-statistics-update.patch
deleted file mode 100644
index 0ea8969162afb9..00000000000000
--- a/patches.runtime_pm/0110-PM-Suspend-Fix-bug-in-suspend-statistics-update.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 9457d19470ed5fa150914c65e231262337224726 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 19 Nov 2011 14:37:57 +0100
-Subject: PM / Suspend: Fix bug in suspend statistics update
-
-After commit 2a77c46de1e3dace73745015635ebbc648eca69c
-(PM / Suspend: Add statistics debugfs file for suspend to RAM)
-a missing pair of braces inside the state_store() function causes even
-invalid arguments to suspend to be wrongly treated as failed suspend
-attempts. Fix this.
-
-[rjw: Put the hash/subject of the buggy commit into the changelog.]
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 501a708f18ef911328ffd39f39738b8a7862aa8e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/main.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 71f49fe..36e0f09 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -290,13 +290,14 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
- if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
- break;
- }
-- if (state < PM_SUSPEND_MAX && *s)
-+ if (state < PM_SUSPEND_MAX && *s) {
- error = enter_state(state);
- if (error) {
- suspend_stats.fail++;
- dpm_save_failed_errno(error);
- } else
- suspend_stats.success++;
-+ }
- #endif
-
- Exit:
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0111-freezer-don-t-unnecessarily-set-PF_NOFREEZE-explicit.patch b/patches.runtime_pm/0111-freezer-don-t-unnecessarily-set-PF_NOFREEZE-explicit.patch
deleted file mode 100644
index ccc28372e07219..00000000000000
--- a/patches.runtime_pm/0111-freezer-don-t-unnecessarily-set-PF_NOFREEZE-explicit.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 401b933116a892dc8fe3e39ae7c1aec7ea94b628 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:22 -0800
-Subject: freezer: don't unnecessarily set PF_NOFREEZE explicitly
-
-Some drivers set PF_NOFREEZE in their kthread functions which is
-completely unnecessary and racy - some part of freezer code doesn't
-consider cases where PF_NOFREEZE is set asynchronous to freezer
-operations.
-
-In general, there's no reason to allow setting PF_NOFREEZE explicitly.
-Remove them and change the documentation to note that setting
-PF_NOFREEZE directly isn't allowed.
-
--v2: Dropped change to twl4030-irq.c as it no longer uses PF_NOFREEZE.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: "Gustavo F. Padovan" <padovan@profusion.mobi>
-Acked-by: Samuel Ortiz <sameo@linux.intel.com>
-Cc: Marcel Holtmann <marcel@holtmann.org>
-Cc: wwang <wei_wang@realsil.com.cn>
-(cherry picked from commit 3a7cbd50f74907580eb47a8d08e1f29741b81abf)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 2 +-
- drivers/bluetooth/btmrvl_main.c | 2 --
- drivers/mfd/twl6030-irq.c | 2 --
- drivers/staging/rts_pstor/rtsx.c | 2 --
- 4 files changed, 1 insertion(+), 7 deletions(-)
-
-diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
-index 316c2ba..587e082 100644
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -67,7 +67,7 @@ III. Which kernel threads are freezable?
-
- Kernel threads are not freezable by default. However, a kernel thread may clear
- PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE
--directly is strongly discouraged). From this point it is regarded as freezable
-+directly is not allowed). From this point it is regarded as freezable
- and must call try_to_freeze() in a suitable place.
-
- IV. Why do we do that?
-diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
-index 548d1d9..57312d4 100644
---- a/drivers/bluetooth/btmrvl_main.c
-+++ b/drivers/bluetooth/btmrvl_main.c
-@@ -473,8 +473,6 @@ static int btmrvl_service_main_thread(void *data)
-
- init_waitqueue_entry(&wait, current);
-
-- current->flags |= PF_NOFREEZE;
--
- for (;;) {
- add_wait_queue(&thread->wait_q, &wait);
-
-diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
-index b0563b6..71990f9 100644
---- a/drivers/mfd/twl6030-irq.c
-+++ b/drivers/mfd/twl6030-irq.c
-@@ -96,8 +96,6 @@ static int twl6030_irq_thread(void *data)
- static const unsigned max_i2c_errors = 100;
- int ret;
-
-- current->flags |= PF_NOFREEZE;
--
- while (!kthread_should_stop()) {
- int i;
- union {
-diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
-index 5ff59f2..2f35832 100644
---- a/drivers/staging/rts_pstor/rtsx.c
-+++ b/drivers/staging/rts_pstor/rtsx.c
-@@ -472,8 +472,6 @@ static int rtsx_control_thread(void *__dev)
- struct rtsx_chip *chip = dev->chip;
- struct Scsi_Host *host = rtsx_to_host(dev);
-
-- current->flags |= PF_NOFREEZE;
--
- for (;;) {
- if (down_interruptible(&dev->sema))
- break;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0112-freezer-fix-current-state-restoration-race-in-refrig.patch b/patches.runtime_pm/0112-freezer-fix-current-state-restoration-race-in-refrig.patch
deleted file mode 100644
index cf53d4ca3144c3..00000000000000
--- a/patches.runtime_pm/0112-freezer-fix-current-state-restoration-race-in-refrig.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 080f92ef995d70e0acc2c5cfa99d52a705b811c3 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:22 -0800
-Subject: freezer: fix current->state restoration race in refrigerator()
-
-refrigerator() saves current->state before entering frozen state and
-restores it before returning using __set_current_state(); however,
-this is racy, for example, please consider the following sequence.
-
- set_current_state(TASK_INTERRUPTIBLE);
- try_to_freeze();
- if (kthread_should_stop())
- break;
- schedule();
-
-If kthread_stop() races with ->state restoration, the restoration can
-restore ->state to TASK_INTERRUPTIBLE after kthread_stop() sets it to
-TASK_RUNNING but kthread_should_stop() may still see zero
-->should_stop because there's no memory barrier between restoring
-TASK_INTERRUPTIBLE and kthread_should_stop() test.
-
-This isn't restricted to kthread_should_stop(). current->state is
-often used in memory barrier based synchronization and silently
-restoring it w/o mb breaks them.
-
-Use set_current_state() instead.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-(cherry picked from commit 50fb4f7fc907efff65eadb0b74387a9ffed6e849)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/freezer.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 7b01de9..575f863 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -58,7 +58,13 @@ void refrigerator(void)
- current->flags &= ~PF_FREEZING;
-
- pr_debug("%s left refrigerator\n", current->comm);
-- __set_current_state(save);
-+
-+ /*
-+ * Restore saved task state before returning. The mb'd version
-+ * needs to be used; otherwise, it might silently break
-+ * synchronization which depends on ordered task state change.
-+ */
-+ set_current_state(save);
- }
- EXPORT_SYMBOL(refrigerator);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0113-freezer-unexport-refrigerator-and-update-try_to_free.patch b/patches.runtime_pm/0113-freezer-unexport-refrigerator-and-update-try_to_free.patch
deleted file mode 100644
index 994ec4090bf961..00000000000000
--- a/patches.runtime_pm/0113-freezer-unexport-refrigerator-and-update-try_to_free.patch
+++ /dev/null
@@ -1,336 +0,0 @@
-From b94764b22361f331890c56fe2f0f278d82f0eff1 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:22 -0800
-Subject: freezer: unexport refrigerator() and update try_to_freeze() slightly
-
-There is no reason to export two functions for entering the
-refrigerator. Calling refrigerator() instead of try_to_freeze()
-doesn't save anything noticeable or removes any race condition.
-
-* Rename refrigerator() to __refrigerator() and make it return bool
- indicating whether it scheduled out for freezing.
-
-* Update try_to_freeze() to return bool and relay the return value of
- __refrigerator() if freezing().
-
-* Convert all refrigerator() users to try_to_freeze().
-
-* Update documentation accordingly.
-
-* While at it, add might_sleep() to try_to_freeze().
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Cc: Samuel Ortiz <samuel@sortiz.org>
-Cc: Chris Mason <chris.mason@oracle.com>
-Cc: "Theodore Ts'o" <tytso@mit.edu>
-Cc: Steven Whitehouse <swhiteho@redhat.com>
-Cc: Andrew Morton <akpm@linux-foundation.org>
-Cc: Jan Kara <jack@suse.cz>
-Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
-Cc: Christoph Hellwig <hch@infradead.org>
-(cherry picked from commit a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6)
-
-Conflicts:
-
- fs/xfs/xfs_buf.c
- fs/xfs/linux-2.6/xfs_buf.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 12 ++++++------
- drivers/net/irda/stir4200.c | 2 +-
- fs/btrfs/async-thread.c | 2 +-
- fs/btrfs/disk-io.c | 8 ++------
- fs/ext4/super.c | 3 +--
- fs/gfs2/log.c | 4 ++--
- fs/gfs2/quota.c | 4 ++--
- fs/jbd/journal.c | 2 +-
- fs/jbd2/journal.c | 2 +-
- fs/jfs/jfs_logmgr.c | 2 +-
- fs/jfs/jfs_txnmgr.c | 4 ++--
- fs/nilfs2/segment.c | 2 +-
- fs/xfs/linux-2.6/xfs_buf.c | 2 +-
- include/linux/freezer.h | 17 ++++++++---------
- kernel/freezer.c | 10 +++++++---
- 15 files changed, 37 insertions(+), 39 deletions(-)
-
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -21,7 +21,7 @@ freeze_processes() (defined in kernel/po
- try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and
- either wakes them up, if they are kernel threads, or sends fake signals to them,
- if they are user space processes. A task that has TIF_FREEZE set, should react
--to it by calling the function called refrigerator() (defined in
-+to it by calling the function called __refrigerator() (defined in
- kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state
- to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it.
- Then, we say that the task is 'frozen' and therefore the set of functions
-@@ -29,10 +29,10 @@ handling this mechanism is referred to a
- defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h).
- User space processes are generally frozen before kernel threads.
-
--It is not recommended to call refrigerator() directly. Instead, it is
--recommended to use the try_to_freeze() function (defined in
--include/linux/freezer.h), that checks the task's TIF_FREEZE flag and makes the
--task enter refrigerator() if the flag is set.
-+__refrigerator() must not be called directly. Instead, use the
-+try_to_freeze() function (defined in include/linux/freezer.h), that checks
-+the task's TIF_FREEZE flag and makes the task enter __refrigerator() if the
-+flag is set.
-
- For user space processes try_to_freeze() is called automatically from the
- signal-handling code, but the freezable kernel threads need to call it
-@@ -61,7 +61,7 @@ wait_event_freezable() and wait_event_fr
- After the system memory state has been restored from a hibernation image and
- devices have been reinitialized, the function thaw_processes() is called in
- order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that
--have been frozen leave refrigerator() and continue running.
-+have been frozen leave __refrigerator() and continue running.
-
- III. Which kernel threads are freezable?
-
---- a/drivers/net/irda/stir4200.c
-+++ b/drivers/net/irda/stir4200.c
-@@ -750,7 +750,7 @@ static int stir_transmit_thread(void *ar
-
- write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD);
-
-- refrigerator();
-+ try_to_freeze();
-
- if (change_speed(stir, stir->speed))
- break;
---- a/fs/btrfs/async-thread.c
-+++ b/fs/btrfs/async-thread.c
-@@ -340,7 +340,7 @@ again:
- if (freezing(current)) {
- worker->working = 0;
- spin_unlock_irq(&worker->lock);
-- refrigerator();
-+ try_to_freeze();
- } else {
- spin_unlock_irq(&worker->lock);
- if (!kthread_should_stop()) {
---- a/fs/btrfs/disk-io.c
-+++ b/fs/btrfs/disk-io.c
-@@ -1479,9 +1479,7 @@ static int cleaner_kthread(void *arg)
- btrfs_run_defrag_inodes(root->fs_info);
- }
-
-- if (freezing(current)) {
-- refrigerator();
-- } else {
-+ if (!try_to_freeze()) {
- set_current_state(TASK_INTERRUPTIBLE);
- if (!kthread_should_stop())
- schedule();
-@@ -1535,9 +1533,7 @@ sleep:
- wake_up_process(root->fs_info->cleaner_kthread);
- mutex_unlock(&root->fs_info->transaction_kthread_mutex);
-
-- if (freezing(current)) {
-- refrigerator();
-- } else {
-+ if (!try_to_freeze()) {
- set_current_state(TASK_INTERRUPTIBLE);
- if (!kthread_should_stop() &&
- !btrfs_transaction_blocked(root->fs_info))
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -2821,8 +2821,7 @@ cont_thread:
- }
- mutex_unlock(&eli->li_list_mtx);
-
-- if (freezing(current))
-- refrigerator();
-+ try_to_freeze();
-
- cur = jiffies;
- if ((time_after_eq(cur, next_wakeup)) ||
---- a/fs/gfs2/log.c
-+++ b/fs/gfs2/log.c
-@@ -951,8 +951,8 @@ int gfs2_logd(void *data)
- wake_up(&sdp->sd_log_waitq);
-
- t = gfs2_tune_get(sdp, gt_logd_secs) * HZ;
-- if (freezing(current))
-- refrigerator();
-+
-+ try_to_freeze();
-
- do {
- prepare_to_wait(&sdp->sd_logd_waitq, &wait,
---- a/fs/gfs2/quota.c
-+++ b/fs/gfs2/quota.c
-@@ -1431,8 +1431,8 @@ int gfs2_quotad(void *data)
- /* Check for & recover partially truncated inodes */
- quotad_check_trunc_list(sdp);
-
-- if (freezing(current))
-- refrigerator();
-+ try_to_freeze();
-+
- t = min(quotad_timeo, statfs_timeo);
-
- prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE);
---- a/fs/jbd/journal.c
-+++ b/fs/jbd/journal.c
-@@ -163,7 +163,7 @@ loop:
- */
- jbd_debug(1, "Now suspending kjournald\n");
- spin_unlock(&journal->j_state_lock);
-- refrigerator();
-+ try_to_freeze();
- spin_lock(&journal->j_state_lock);
- } else {
- /*
---- a/fs/jbd2/journal.c
-+++ b/fs/jbd2/journal.c
-@@ -173,7 +173,7 @@ loop:
- */
- jbd_debug(1, "Now suspending kjournald2\n");
- write_unlock(&journal->j_state_lock);
-- refrigerator();
-+ try_to_freeze();
- write_lock(&journal->j_state_lock);
- } else {
- /*
---- a/fs/jfs/jfs_logmgr.c
-+++ b/fs/jfs/jfs_logmgr.c
-@@ -2348,7 +2348,7 @@ int jfsIOWait(void *arg)
-
- if (freezing(current)) {
- spin_unlock_irq(&log_redrive_lock);
-- refrigerator();
-+ try_to_freeze();
- } else {
- set_current_state(TASK_INTERRUPTIBLE);
- spin_unlock_irq(&log_redrive_lock);
---- a/fs/jfs/jfs_txnmgr.c
-+++ b/fs/jfs/jfs_txnmgr.c
-@@ -2801,7 +2801,7 @@ int jfs_lazycommit(void *arg)
-
- if (freezing(current)) {
- LAZY_UNLOCK(flags);
-- refrigerator();
-+ try_to_freeze();
- } else {
- DECLARE_WAITQUEUE(wq, current);
-
-@@ -2996,7 +2996,7 @@ int jfs_sync(void *arg)
-
- if (freezing(current)) {
- TXN_UNLOCK();
-- refrigerator();
-+ try_to_freeze();
- } else {
- set_current_state(TASK_INTERRUPTIBLE);
- TXN_UNLOCK();
---- a/fs/nilfs2/segment.c
-+++ b/fs/nilfs2/segment.c
-@@ -2472,7 +2472,7 @@ static int nilfs_segctor_thread(void *ar
-
- if (freezing(current)) {
- spin_unlock(&sci->sc_state_lock);
-- refrigerator();
-+ try_to_freeze();
- spin_lock(&sci->sc_state_lock);
- } else {
- DEFINE_WAIT(wait);
---- a/fs/xfs/linux-2.6/xfs_buf.c
-+++ b/fs/xfs/linux-2.6/xfs_buf.c
-@@ -1764,7 +1764,7 @@ xfsbufd(
-
- if (unlikely(freezing(current))) {
- set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
-- refrigerator();
-+ try_to_freeze();
- } else {
- clear_bit(XBT_FORCE_SLEEP, &target->bt_flags);
- }
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -47,18 +47,17 @@ static inline bool should_send_signal(st
- /* Takes and releases task alloc lock using task_lock() */
- extern int thaw_process(struct task_struct *p);
-
--extern void refrigerator(void);
-+extern bool __refrigerator(void);
- extern int freeze_processes(void);
- extern int freeze_kernel_threads(void);
- extern void thaw_processes(void);
-
--static inline int try_to_freeze(void)
-+static inline bool try_to_freeze(void)
- {
-- if (freezing(current)) {
-- refrigerator();
-- return 1;
-- } else
-- return 0;
-+ might_sleep();
-+ if (likely(!freezing(current)))
-+ return false;
-+ return __refrigerator();
- }
-
- extern bool freeze_task(struct task_struct *p, bool sig_only);
-@@ -171,12 +170,12 @@ static inline void set_freeze_flag(struc
- static inline void clear_freeze_flag(struct task_struct *p) {}
- static inline int thaw_process(struct task_struct *p) { return 1; }
-
--static inline void refrigerator(void) {}
-+static inline bool __refrigerator(void) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
- static inline int freeze_kernel_threads(void) { return -ENOSYS; }
- static inline void thaw_processes(void) {}
-
--static inline int try_to_freeze(void) { return 0; }
-+static inline bool try_to_freeze(void) { return false; }
-
- static inline void freezer_do_not_count(void) {}
- static inline void freezer_count(void) {}
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -23,10 +23,11 @@ static inline void frozen_process(void)
- }
-
- /* Refrigerator is place where frozen processes are stored :-). */
--void refrigerator(void)
-+bool __refrigerator(void)
- {
- /* Hmm, should we be allowed to suspend when there are realtime
- processes around? */
-+ bool was_frozen = false;
- long save;
-
- task_lock(current);
-@@ -35,7 +36,7 @@ void refrigerator(void)
- task_unlock(current);
- } else {
- task_unlock(current);
-- return;
-+ return was_frozen;
- }
- save = current->state;
- pr_debug("%s entered refrigerator\n", current->comm);
-@@ -51,6 +52,7 @@ void refrigerator(void)
- set_current_state(TASK_UNINTERRUPTIBLE);
- if (!frozen(current))
- break;
-+ was_frozen = true;
- schedule();
- }
-
-@@ -65,8 +67,10 @@ void refrigerator(void)
- * synchronization which depends on ordered task state change.
- */
- set_current_state(save);
-+
-+ return was_frozen;
- }
--EXPORT_SYMBOL(refrigerator);
-+EXPORT_SYMBOL(__refrigerator);
-
- static void fake_signal_wake_up(struct task_struct *p)
- {
diff --git a/patches.runtime_pm/0114-oom-thaw-threads-if-oom-killed-thread-is-frozen-befo.patch b/patches.runtime_pm/0114-oom-thaw-threads-if-oom-killed-thread-is-frozen-befo.patch
deleted file mode 100644
index 2e17b60d55fffd..00000000000000
--- a/patches.runtime_pm/0114-oom-thaw-threads-if-oom-killed-thread-is-frozen-befo.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From f792e47c3aef0e6346cffbf2c578e4cc9a3e9490 Mon Sep 17 00:00:00 2001
-From: David Rientjes <rientjes@google.com>
-Date: Mon, 31 Oct 2011 17:07:07 -0700
-Subject: oom: thaw threads if oom killed thread is frozen before deferring
-
-If a thread has been oom killed and is frozen, thaw it before returning to
-the page allocator. Otherwise, it can stay frozen indefinitely and no
-memory will be freed.
-
-Signed-off-by: David Rientjes <rientjes@google.com>
-Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
-Cc: Oleg Nesterov <oleg@redhat.com>
-Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
-Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
-Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
-Acked-by: Michal Hocko <mhocko@suse.cz>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit f660daac474c6f7c2d710100e29b3276a6f4db0a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- mm/oom_kill.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/mm/oom_kill.c b/mm/oom_kill.c
-index 7c72487..d00e922 100644
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -32,6 +32,7 @@
- #include <linux/mempolicy.h>
- #include <linux/security.h>
- #include <linux/ptrace.h>
-+#include <linux/freezer.h>
-
- int sysctl_panic_on_oom;
- int sysctl_oom_kill_allocating_task;
-@@ -317,8 +318,11 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
- * blocked waiting for another task which itself is waiting
- * for memory. Is there a better alternative?
- */
-- if (test_tsk_thread_flag(p, TIF_MEMDIE))
-+ if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
-+ if (unlikely(frozen(p)))
-+ thaw_process(p);
- return ERR_PTR(-1UL);
-+ }
- if (!p->mm)
- continue;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0115-freezer-implement-and-use-kthread_freezable_should_s.patch b/patches.runtime_pm/0115-freezer-implement-and-use-kthread_freezable_should_s.patch
deleted file mode 100644
index bbf7e9914173e7..00000000000000
--- a/patches.runtime_pm/0115-freezer-implement-and-use-kthread_freezable_should_s.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-From 0f56da2ccf95afff53f0fe299bad8101f817eee4 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:23 -0800
-Subject: freezer: implement and use kthread_freezable_should_stop()
-
-Writeback and thinkpad_acpi have been using thaw_process() to prevent
-deadlock between the freezer and kthread_stop(); unfortunately, this
-is inherently racy - nothing prevents freezing from happening between
-thaw_process() and kthread_stop().
-
-This patch implements kthread_freezable_should_stop() which enters
-refrigerator if necessary but is guaranteed to return if
-kthread_stop() is invoked. Both thaw_process() users are converted to
-use the new function.
-
-Note that this deadlock condition exists for many of freezable
-kthreads. They need to be converted to use the new should_stop or
-freezable workqueue.
-
-Tested with synthetic test case.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
-Cc: Jens Axboe <axboe@kernel.dk>
-Cc: Oleg Nesterov <oleg@redhat.com>
-(cherry picked from commit 8a32c441c1609f80e55df75422324a1151208f40)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/platform/x86/thinkpad_acpi.c | 15 ++++++---------
- fs/fs-writeback.c | 4 +---
- include/linux/freezer.h | 6 +++---
- include/linux/kthread.h | 1 +
- kernel/freezer.c | 6 ++++--
- kernel/kthread.c | 25 +++++++++++++++++++++++++
- mm/backing-dev.c | 8 ++------
- 7 files changed, 42 insertions(+), 23 deletions(-)
-
-diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
-index 26c5b11..b7dddbb 100644
---- a/drivers/platform/x86/thinkpad_acpi.c
-+++ b/drivers/platform/x86/thinkpad_acpi.c
-@@ -2456,8 +2456,9 @@ static int hotkey_kthread(void *data)
- u32 poll_mask, event_mask;
- unsigned int si, so;
- unsigned long t;
-- unsigned int change_detector, must_reset;
-+ unsigned int change_detector;
- unsigned int poll_freq;
-+ bool was_frozen;
-
- mutex_lock(&hotkey_thread_mutex);
-
-@@ -2488,14 +2489,14 @@ static int hotkey_kthread(void *data)
- t = 100; /* should never happen... */
- }
- t = msleep_interruptible(t);
-- if (unlikely(kthread_should_stop()))
-+ if (unlikely(kthread_freezable_should_stop(&was_frozen)))
- break;
-- must_reset = try_to_freeze();
-- if (t > 0 && !must_reset)
-+
-+ if (t > 0 && !was_frozen)
- continue;
-
- mutex_lock(&hotkey_thread_data_mutex);
-- if (must_reset || hotkey_config_change != change_detector) {
-+ if (was_frozen || hotkey_config_change != change_detector) {
- /* forget old state on thaw or config change */
- si = so;
- t = 0;
-@@ -2528,10 +2529,6 @@ exit:
- static void hotkey_poll_stop_sync(void)
- {
- if (tpacpi_hotkey_task) {
-- if (frozen(tpacpi_hotkey_task) ||
-- freezing(tpacpi_hotkey_task))
-- thaw_process(tpacpi_hotkey_task);
--
- kthread_stop(tpacpi_hotkey_task);
- tpacpi_hotkey_task = NULL;
- mutex_lock(&hotkey_thread_mutex);
-diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
-index fe190a8..4e69320 100644
---- a/fs/fs-writeback.c
-+++ b/fs/fs-writeback.c
-@@ -912,7 +912,7 @@ int bdi_writeback_thread(void *data)
-
- trace_writeback_thread_start(bdi);
-
-- while (!kthread_should_stop()) {
-+ while (!kthread_freezable_should_stop(NULL)) {
- /*
- * Remove own delayed wake-up timer, since we are already awake
- * and we'll take care of the preriodic write-back.
-@@ -942,8 +942,6 @@ int bdi_writeback_thread(void *data)
- */
- schedule();
- }
--
-- try_to_freeze();
- }
-
- /* Flush any work that raced with us exiting */
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index eb9c977..91d19c4 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -47,7 +47,7 @@ static inline bool should_send_signal(struct task_struct *p)
- /* Takes and releases task alloc lock using task_lock() */
- extern int thaw_process(struct task_struct *p);
-
--extern bool __refrigerator(void);
-+extern bool __refrigerator(bool check_kthr_stop);
- extern int freeze_processes(void);
- extern int freeze_kernel_threads(void);
- extern void thaw_processes(void);
-@@ -57,7 +57,7 @@ static inline bool try_to_freeze(void)
- might_sleep();
- if (likely(!freezing(current)))
- return false;
-- return __refrigerator();
-+ return __refrigerator(false);
- }
-
- extern bool freeze_task(struct task_struct *p, bool sig_only);
-@@ -170,7 +170,7 @@ static inline void set_freeze_flag(struct task_struct *p) {}
- static inline void clear_freeze_flag(struct task_struct *p) {}
- static inline int thaw_process(struct task_struct *p) { return 1; }
-
--static inline bool __refrigerator(void) { return false; }
-+static inline bool __refrigerator(bool check_kthr_stop) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
- static inline int freeze_kernel_threads(void) { return -ENOSYS; }
- static inline void thaw_processes(void) {}
-diff --git a/include/linux/kthread.h b/include/linux/kthread.h
-index 1e923e5..6c1903d 100644
---- a/include/linux/kthread.h
-+++ b/include/linux/kthread.h
-@@ -35,6 +35,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
- void kthread_bind(struct task_struct *k, unsigned int cpu);
- int kthread_stop(struct task_struct *k);
- int kthread_should_stop(void);
-+bool kthread_freezable_should_stop(bool *was_frozen);
- void *kthread_data(struct task_struct *k);
-
- int kthreadd(void *unused);
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 4d59904..656492c 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -9,6 +9,7 @@
- #include <linux/module.h>
- #include <linux/syscalls.h>
- #include <linux/freezer.h>
-+#include <linux/kthread.h>
-
- /*
- * freezing is complete, mark current process as frozen
-@@ -23,7 +24,7 @@ static inline void frozen_process(void)
- }
-
- /* Refrigerator is place where frozen processes are stored :-). */
--bool __refrigerator(void)
-+bool __refrigerator(bool check_kthr_stop)
- {
- /* Hmm, should we be allowed to suspend when there are realtime
- processes around? */
-@@ -50,7 +51,8 @@ bool __refrigerator(void)
-
- for (;;) {
- set_current_state(TASK_UNINTERRUPTIBLE);
-- if (!frozen(current))
-+ if (!frozen(current) ||
-+ (check_kthr_stop && kthread_should_stop()))
- break;
- was_frozen = true;
- schedule();
-diff --git a/kernel/kthread.c b/kernel/kthread.c
-index 4ba7ccc..a6cbeea 100644
---- a/kernel/kthread.c
-+++ b/kernel/kthread.c
-@@ -59,6 +59,31 @@ int kthread_should_stop(void)
- EXPORT_SYMBOL(kthread_should_stop);
-
- /**
-+ * kthread_freezable_should_stop - should this freezable kthread return now?
-+ * @was_frozen: optional out parameter, indicates whether %current was frozen
-+ *
-+ * kthread_should_stop() for freezable kthreads, which will enter
-+ * refrigerator if necessary. This function is safe from kthread_stop() /
-+ * freezer deadlock and freezable kthreads should use this function instead
-+ * of calling try_to_freeze() directly.
-+ */
-+bool kthread_freezable_should_stop(bool *was_frozen)
-+{
-+ bool frozen = false;
-+
-+ might_sleep();
-+
-+ if (unlikely(freezing(current)))
-+ frozen = __refrigerator(true);
-+
-+ if (was_frozen)
-+ *was_frozen = frozen;
-+
-+ return kthread_should_stop();
-+}
-+EXPORT_SYMBOL_GPL(kthread_freezable_should_stop);
-+
-+/**
- * kthread_data - return data value specified on kthread creation
- * @task: kthread task in question
- *
-diff --git a/mm/backing-dev.c b/mm/backing-dev.c
-index b3b122f..c0ee0ff 100644
---- a/mm/backing-dev.c
-+++ b/mm/backing-dev.c
-@@ -578,14 +578,10 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)
-
- /*
- * Finally, kill the kernel thread. We don't need to be RCU
-- * safe anymore, since the bdi is gone from visibility. Force
-- * unfreeze of the thread before calling kthread_stop(), otherwise
-- * it would never exet if it is currently stuck in the refrigerator.
-+ * safe anymore, since the bdi is gone from visibility.
- */
-- if (bdi->wb.task) {
-- thaw_process(bdi->wb.task);
-+ if (bdi->wb.task)
- kthread_stop(bdi->wb.task);
-- }
- }
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0116-freezer-rename-thaw_process-to-__thaw_task-and-simpl.patch b/patches.runtime_pm/0116-freezer-rename-thaw_process-to-__thaw_task-and-simpl.patch
deleted file mode 100644
index 2b9ac968123a5b..00000000000000
--- a/patches.runtime_pm/0116-freezer-rename-thaw_process-to-__thaw_task-and-simpl.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 1982fa9532742d5d986ce6fa9c8253e32de89b16 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:23 -0800
-Subject: freezer: rename thaw_process() to __thaw_task() and simplify the
- implementation
-
-thaw_process() now has only internal users - system and cgroup
-freezers. Remove the unnecessary return value, rename, unexport and
-collapse __thaw_process() into it. This will help further updates to
-the freezer code.
-
--v3: oom_kill grew a use of thaw_process() while this patch was
- pending. Convert it to use __thaw_task() for now. In the longer
- term, this should be handled by allowing tasks to die if killed
- even if it's frozen.
-
--v2: minor style update as suggested by Matt.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Cc: Paul Menage <menage@google.com>
-Cc: Matt Helsley <matthltc@us.ibm.com>
-(cherry picked from commit a5be2d0d1a8746e7be5210e3d6b904455000443c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 3 +--
- kernel/cgroup_freezer.c | 7 +++----
- kernel/freezer.c | 31 ++++++++++++-------------------
- kernel/power/process.c | 2 +-
- mm/oom_kill.c | 2 +-
- 5 files changed, 18 insertions(+), 27 deletions(-)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index 91d19c4..0d161c5 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -45,7 +45,7 @@ static inline bool should_send_signal(struct task_struct *p)
- }
-
- /* Takes and releases task alloc lock using task_lock() */
--extern int thaw_process(struct task_struct *p);
-+extern void __thaw_task(struct task_struct *t);
-
- extern bool __refrigerator(bool check_kthr_stop);
- extern int freeze_processes(void);
-@@ -168,7 +168,6 @@ static inline int frozen(struct task_struct *p) { return 0; }
- static inline int freezing(struct task_struct *p) { return 0; }
- static inline void set_freeze_flag(struct task_struct *p) {}
- static inline void clear_freeze_flag(struct task_struct *p) {}
--static inline int thaw_process(struct task_struct *p) { return 1; }
-
- static inline bool __refrigerator(bool check_kthr_stop) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
-diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
-index a3f638a..bd03e22 100644
---- a/kernel/cgroup_freezer.c
-+++ b/kernel/cgroup_freezer.c
-@@ -130,7 +130,7 @@ struct cgroup_subsys freezer_subsys;
- * write_lock css_set_lock (cgroup iterator start)
- * task->alloc_lock
- * read_lock css_set_lock (cgroup iterator start)
-- * task->alloc_lock (inside thaw_process(), prevents race with refrigerator())
-+ * task->alloc_lock (inside __thaw_task(), prevents race with refrigerator())
- * sighand->siglock
- */
- static struct cgroup_subsys_state *freezer_create(struct cgroup_subsys *ss,
-@@ -307,9 +307,8 @@ static void unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
- struct task_struct *task;
-
- cgroup_iter_start(cgroup, &it);
-- while ((task = cgroup_iter_next(cgroup, &it))) {
-- thaw_process(task);
-- }
-+ while ((task = cgroup_iter_next(cgroup, &it)))
-+ __thaw_task(task);
- cgroup_iter_end(cgroup, &it);
-
- freezer->state = CGROUP_THAWED;
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 656492c..8b88d04 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -145,18 +145,8 @@ void cancel_freezing(struct task_struct *p)
- }
- }
-
--static int __thaw_process(struct task_struct *p)
--{
-- if (frozen(p)) {
-- p->flags &= ~PF_FROZEN;
-- return 1;
-- }
-- clear_freeze_flag(p);
-- return 0;
--}
--
- /*
-- * Wake up a frozen process
-+ * Wake up a frozen task
- *
- * task_lock() is needed to prevent the race with refrigerator() which may
- * occur if the freezing of tasks fails. Namely, without the lock, if the
-@@ -164,15 +154,18 @@ static int __thaw_process(struct task_struct *p)
- * refrigerator() could call frozen_process(), in which case the task would be
- * frozen and no one would thaw it.
- */
--int thaw_process(struct task_struct *p)
-+void __thaw_task(struct task_struct *p)
- {
-+ bool was_frozen;
-+
- task_lock(p);
-- if (__thaw_process(p) == 1) {
-- task_unlock(p);
-- wake_up_process(p);
-- return 1;
-- }
-+ was_frozen = frozen(p);
-+ if (was_frozen)
-+ p->flags &= ~PF_FROZEN;
-+ else
-+ clear_freeze_flag(p);
- task_unlock(p);
-- return 0;
-+
-+ if (was_frozen)
-+ wake_up_process(p);
- }
--EXPORT_SYMBOL(thaw_process);
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index addbbe5..fe27872 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -186,7 +186,7 @@ static void thaw_tasks(bool nosig_only)
- if (cgroup_freezing_or_frozen(p))
- continue;
-
-- thaw_process(p);
-+ __thaw_task(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
- }
-diff --git a/mm/oom_kill.c b/mm/oom_kill.c
-index d00e922..6b5688f 100644
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -320,7 +320,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
- */
- if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
- if (unlikely(frozen(p)))
-- thaw_process(p);
-+ __thaw_task(p);
- return ERR_PTR(-1UL);
- }
- if (!p->mm)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0117-freezer-remove-racy-clear_freeze_flag-and-set-PF_NOF.patch b/patches.runtime_pm/0117-freezer-remove-racy-clear_freeze_flag-and-set-PF_NOF.patch
deleted file mode 100644
index 8c459dd5a4f901..00000000000000
--- a/patches.runtime_pm/0117-freezer-remove-racy-clear_freeze_flag-and-set-PF_NOF.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 24ddb5b0de8926d6836136d57c54e54f1e791072 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:23 -0800
-Subject: freezer: remove racy clear_freeze_flag() and set PF_NOFREEZE on dead
- tasks
-
-clear_freeze_flag() in exit_mm() is racy. Freezing can start
-afterwards. Remove it. Skipping freezer for exiting task will be
-properly implemented later.
-
-Also, freezable() was testing exit_state directly to make system
-freezer ignore dead tasks. Let the exiting task set PF_NOFREEZE after
-entering TASK_DEAD instead.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Cc: Oleg Nesterov <oleg@redhat.com>
-(cherry picked from commit a585042f7b933539a0b6bc63650c2d49ffb2e55d)
-
-Conflicts:
-
- kernel/exit.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/exit.c | 3 +--
- kernel/power/process.c | 3 +--
- 2 files changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/kernel/exit.c b/kernel/exit.c
-index 303bed2..437d0cf 100644
---- a/kernel/exit.c
-+++ b/kernel/exit.c
-@@ -693,8 +693,6 @@ static void exit_mm(struct task_struct * tsk)
- tsk->mm = NULL;
- up_read(&mm->mmap_sem);
- enter_lazy_tlb(mm, current);
-- /* We don't want this task to be frozen prematurely */
-- clear_freeze_flag(tsk);
- if (tsk->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
- atomic_dec(&mm->oom_disable_count);
- task_unlock(tsk);
-@@ -1051,6 +1049,7 @@ NORET_TYPE void do_exit(long code)
- exit_rcu();
- /* causes final put_task_struct in finish_task_switch(). */
- tsk->state = TASK_DEAD;
-+ tsk->flags |= PF_NOFREEZE; /* tell freezer to ignore us */
- schedule();
- BUG();
- /* Avoid "noreturn function does return". */
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index fe27872..23822dc 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -25,8 +25,7 @@
- static inline int freezable(struct task_struct * p)
- {
- if ((p == current) ||
-- (p->flags & PF_NOFREEZE) ||
-- (p->exit_state != 0))
-+ (p->flags & PF_NOFREEZE))
- return 0;
- return 1;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0118-freezer-don-t-distinguish-nosig-tasks-on-thaw.patch b/patches.runtime_pm/0118-freezer-don-t-distinguish-nosig-tasks-on-thaw.patch
deleted file mode 100644
index 56c84fb3f56422..00000000000000
--- a/patches.runtime_pm/0118-freezer-don-t-distinguish-nosig-tasks-on-thaw.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From c5c4b7c42e328228085d8f904bf411dcd58d6012 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:23 -0800
-Subject: freezer: don't distinguish nosig tasks on thaw
-
-There's no point in thawing nosig tasks before others. There's no
-ordering requirement between the two groups on thaw, which the staged
-thawing can't guarantee anyway. Simplify thaw_processes() by removing
-the distinction and collapsing thaw_tasks() into thaw_processes().
-This will help further updates to freezer.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-(cherry picked from commit 6cd8dedcdd8e8de01391a7cf25f0b2afeb24f8f4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/process.c | 20 +++++++-------------
- 1 file changed, 7 insertions(+), 13 deletions(-)
-
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 23822dc..9db048f 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -170,34 +170,28 @@ int freeze_kernel_threads(void)
- return error;
- }
-
--static void thaw_tasks(bool nosig_only)
-+void thaw_processes(void)
- {
- struct task_struct *g, *p;
-
-+ oom_killer_enable();
-+
-+ printk("Restarting tasks ... ");
-+
-+ thaw_workqueues();
-+
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
- if (!freezable(p))
- continue;
-
-- if (nosig_only && should_send_signal(p))
-- continue;
--
- if (cgroup_freezing_or_frozen(p))
- continue;
-
- __thaw_task(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
--}
--
--void thaw_processes(void)
--{
-- oom_killer_enable();
-
-- printk("Restarting tasks ... ");
-- thaw_workqueues();
-- thaw_tasks(true);
-- thaw_tasks(false);
- schedule();
- printk("done.\n");
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0119-freezer-use-dedicated-lock-instead-of-task_lock-memo.patch b/patches.runtime_pm/0119-freezer-use-dedicated-lock-instead-of-task_lock-memo.patch
deleted file mode 100644
index 96191c342d51eb..00000000000000
--- a/patches.runtime_pm/0119-freezer-use-dedicated-lock-instead-of-task_lock-memo.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-From 80d85d79b1307412028941cfaaa24a34fe7a3e4e Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:24 -0800
-Subject: freezer: use dedicated lock instead of task_lock() + memory barrier
-
-Freezer synchronization is needlessly complicated - it's by no means a
-hot path and the priority is staying unintrusive and safe. This patch
-makes it simply use a dedicated lock instead of piggy-backing on
-task_lock() and playing with memory barriers.
-
-On the failure path of try_to_freeze_tasks(), locking is moved from it
-to cancel_freezing(). This makes the frozen() test racy but the race
-here is a non-issue as the warning is printed for tasks which failed
-to enter frozen for 20 seconds and race on PF_FROZEN at the last
-moment doesn't change anything.
-
-This simplifies freezer implementation and eases further changes
-including some race fixes.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-(cherry picked from commit 0c9af09262864a2744091ee94c98c4a8fd60c98b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/freezer.c | 84 +++++++++++++++++++++---------------------------
- kernel/power/process.c | 2 --
- 2 files changed, 37 insertions(+), 49 deletions(-)
-
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 8b88d04..4150835 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -11,17 +11,8 @@
- #include <linux/freezer.h>
- #include <linux/kthread.h>
-
--/*
-- * freezing is complete, mark current process as frozen
-- */
--static inline void frozen_process(void)
--{
-- if (!unlikely(current->flags & PF_NOFREEZE)) {
-- current->flags |= PF_FROZEN;
-- smp_wmb();
-- }
-- clear_freeze_flag(current);
--}
-+/* protects freezing and frozen transitions */
-+static DEFINE_SPINLOCK(freezer_lock);
-
- /* Refrigerator is place where frozen processes are stored :-). */
- bool __refrigerator(bool check_kthr_stop)
-@@ -31,14 +22,16 @@ bool __refrigerator(bool check_kthr_stop)
- bool was_frozen = false;
- long save;
-
-- task_lock(current);
-- if (freezing(current)) {
-- frozen_process();
-- task_unlock(current);
-- } else {
-- task_unlock(current);
-+ spin_lock_irq(&freezer_lock);
-+ if (!freezing(current)) {
-+ spin_unlock_irq(&freezer_lock);
- return was_frozen;
- }
-+ if (!(current->flags & PF_NOFREEZE))
-+ current->flags |= PF_FROZEN;
-+ clear_freeze_flag(current);
-+ spin_unlock_irq(&freezer_lock);
-+
- save = current->state;
- pr_debug("%s entered refrigerator\n", current->comm);
-
-@@ -99,21 +92,18 @@ static void fake_signal_wake_up(struct task_struct *p)
- */
- bool freeze_task(struct task_struct *p, bool sig_only)
- {
-- /*
-- * We first check if the task is freezing and next if it has already
-- * been frozen to avoid the race with frozen_process() which first marks
-- * the task as frozen and next clears its TIF_FREEZE.
-- */
-- if (!freezing(p)) {
-- smp_rmb();
-- if (frozen(p))
-- return false;
--
-- if (!sig_only || should_send_signal(p))
-- set_freeze_flag(p);
-- else
-- return false;
-- }
-+ unsigned long flags;
-+ bool ret = false;
-+
-+ spin_lock_irqsave(&freezer_lock, flags);
-+
-+ if (sig_only && !should_send_signal(p))
-+ goto out_unlock;
-+
-+ if (frozen(p))
-+ goto out_unlock;
-+
-+ set_freeze_flag(p);
-
- if (should_send_signal(p)) {
- fake_signal_wake_up(p);
-@@ -123,26 +113,28 @@ bool freeze_task(struct task_struct *p, bool sig_only)
- * TASK_RUNNING transition can't race with task state
- * testing in try_to_freeze_tasks().
- */
-- } else if (sig_only) {
-- return false;
- } else {
- wake_up_state(p, TASK_INTERRUPTIBLE);
- }
--
-- return true;
-+ ret = true;
-+out_unlock:
-+ spin_unlock_irqrestore(&freezer_lock, flags);
-+ return ret;
- }
-
- void cancel_freezing(struct task_struct *p)
- {
- unsigned long flags;
-
-+ spin_lock_irqsave(&freezer_lock, flags);
- if (freezing(p)) {
- pr_debug(" clean up: %s\n", p->comm);
- clear_freeze_flag(p);
-- spin_lock_irqsave(&p->sighand->siglock, flags);
-+ spin_lock(&p->sighand->siglock);
- recalc_sigpending_and_wake(p);
-- spin_unlock_irqrestore(&p->sighand->siglock, flags);
-+ spin_unlock(&p->sighand->siglock);
- }
-+ spin_unlock_irqrestore(&freezer_lock, flags);
- }
-
- /*
-@@ -156,16 +148,14 @@ void cancel_freezing(struct task_struct *p)
- */
- void __thaw_task(struct task_struct *p)
- {
-- bool was_frozen;
-+ unsigned long flags;
-
-- task_lock(p);
-- was_frozen = frozen(p);
-- if (was_frozen)
-+ spin_lock_irqsave(&freezer_lock, flags);
-+ if (frozen(p)) {
- p->flags &= ~PF_FROZEN;
-- else
-- clear_freeze_flag(p);
-- task_unlock(p);
--
-- if (was_frozen)
- wake_up_process(p);
-+ } else {
-+ clear_freeze_flag(p);
-+ }
-+ spin_unlock_irqrestore(&freezer_lock, flags);
- }
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 9db048f..bd420ca 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -118,11 +118,9 @@ static int try_to_freeze_tasks(bool sig_only)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- task_lock(p);
- if (!wakeup && freezing(p) && !freezer_should_skip(p))
- sched_show_task(p);
- cancel_freezing(p);
-- task_unlock(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
- } else {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0120-freezer-make-freezing-indicate-freeze-condition-in-e.patch b/patches.runtime_pm/0120-freezer-make-freezing-indicate-freeze-condition-in-e.patch
deleted file mode 100644
index a83342f7e58dc0..00000000000000
--- a/patches.runtime_pm/0120-freezer-make-freezing-indicate-freeze-condition-in-e.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 3e983de3cc2c39c65f268cf3aedb76b591f50646 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:24 -0800
-Subject: freezer: make freezing indicate freeze condition in effect
-
-Currently freezing (TIF_FREEZE) and frozen (PF_FROZEN) states are
-interlocked - freezing is set to request freeze and when the task
-actually freezes, it clears freezing and sets frozen.
-
-This interlocking makes things more complex than necessary - freezing
-doesn't mean there's freezing condition in effect and frozen doesn't
-match the task actually entering and leaving frozen state (it's
-cleared by the thawing task).
-
-This patch makes freezing indicate that freeze condition is in effect.
-A task enters and stays frozen if freezing. This makes PF_FROZEN
-manipulation done only by the task itself and prevents wakeup from
-__thaw_task() leaking outside of refrigerator.
-
-The only place which needs to tell freezing && !frozen is
-try_to_freeze_task() to whine about tasks which don't enter frozen.
-It's updated to test the condition explicitly.
-
-With the change, frozen() state my linger after __thaw_task() until
-the task wakes up and exits fridge. This can trigger BUG_ON() in
-update_if_frozen(). Work it around by testing freezing() && frozen()
-instead of frozen().
-
--v2: Oleg pointed out missing re-check of freezing() when trying to
- clear FROZEN and possible spurious BUG_ON() trigger in
- update_if_frozen(). Both fixed.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Cc: Oleg Nesterov <oleg@redhat.com>
-Cc: Paul Menage <paul@paulmenage.org>
-(cherry picked from commit 6907483b4e803a20f0b48cc9afa3817420ce61c5)
-
-Conflicts:
-
- kernel/cgroup_freezer.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/cgroup_freezer.c | 2 +-
- kernel/freezer.c | 42 ++++++++++++++++++++++++------------------
- kernel/power/process.c | 3 ++-
- 3 files changed, 27 insertions(+), 20 deletions(-)
-
-diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
-index bd03e22..d8f5e61 100644
---- a/kernel/cgroup_freezer.c
-+++ b/kernel/cgroup_freezer.c
-@@ -238,7 +238,7 @@ static void update_if_frozen(struct cgroup *cgroup,
- cgroup_iter_start(cgroup, &it);
- while ((task = cgroup_iter_next(cgroup, &it))) {
- ntotal++;
-- if (is_task_frozen_enough(task))
-+ if (freezing(task) && is_task_frozen_enough(task))
- nfrozen++;
- }
-
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 4150835..e87f5d9 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -22,14 +22,19 @@ bool __refrigerator(bool check_kthr_stop)
- bool was_frozen = false;
- long save;
-
-+ /*
-+ * Enter FROZEN. If NOFREEZE, schedule immediate thawing by
-+ * clearing freezing.
-+ */
- spin_lock_irq(&freezer_lock);
-+repeat:
- if (!freezing(current)) {
- spin_unlock_irq(&freezer_lock);
- return was_frozen;
- }
-- if (!(current->flags & PF_NOFREEZE))
-- current->flags |= PF_FROZEN;
-- clear_freeze_flag(current);
-+ if (current->flags & PF_NOFREEZE)
-+ clear_freeze_flag(current);
-+ current->flags |= PF_FROZEN;
- spin_unlock_irq(&freezer_lock);
-
- save = current->state;
-@@ -44,7 +49,7 @@ bool __refrigerator(bool check_kthr_stop)
-
- for (;;) {
- set_current_state(TASK_UNINTERRUPTIBLE);
-- if (!frozen(current) ||
-+ if (!freezing(current) ||
- (check_kthr_stop && kthread_should_stop()))
- break;
- was_frozen = true;
-@@ -54,6 +59,13 @@ bool __refrigerator(bool check_kthr_stop)
- /* Remove the accounting blocker */
- current->flags &= ~PF_FREEZING;
-
-+ /* leave FROZEN */
-+ spin_lock_irq(&freezer_lock);
-+ if (freezing(current))
-+ goto repeat;
-+ current->flags &= ~PF_FROZEN;
-+ spin_unlock_irq(&freezer_lock);
-+
- pr_debug("%s left refrigerator\n", current->comm);
-
- /*
-@@ -137,25 +149,19 @@ void cancel_freezing(struct task_struct *p)
- spin_unlock_irqrestore(&freezer_lock, flags);
- }
-
--/*
-- * Wake up a frozen task
-- *
-- * task_lock() is needed to prevent the race with refrigerator() which may
-- * occur if the freezing of tasks fails. Namely, without the lock, if the
-- * freezing of tasks failed, thaw_tasks() might have run before a task in
-- * refrigerator() could call frozen_process(), in which case the task would be
-- * frozen and no one would thaw it.
-- */
- void __thaw_task(struct task_struct *p)
- {
- unsigned long flags;
-
-+ /*
-+ * Clear freezing and kick @p if FROZEN. Clearing is guaranteed to
-+ * be visible to @p as waking up implies wmb. Waking up inside
-+ * freezer_lock also prevents wakeups from leaking outside
-+ * refrigerator.
-+ */
- spin_lock_irqsave(&freezer_lock, flags);
-- if (frozen(p)) {
-- p->flags &= ~PF_FROZEN;
-+ clear_freeze_flag(p);
-+ if (frozen(p))
- wake_up_process(p);
-- } else {
-- clear_freeze_flag(p);
-- }
- spin_unlock_irqrestore(&freezer_lock, flags);
- }
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index bd420ca..e6e2739 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -118,7 +118,8 @@ static int try_to_freeze_tasks(bool sig_only)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (!wakeup && freezing(p) && !freezer_should_skip(p))
-+ if (!wakeup && !freezer_should_skip(p) &&
-+ freezing(p) && !frozen(p))
- sched_show_task(p);
- cancel_freezing(p);
- } while_each_thread(g, p);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0121-freezer-test-freezable-conditions-while-holding-free.patch b/patches.runtime_pm/0121-freezer-test-freezable-conditions-while-holding-free.patch
deleted file mode 100644
index e845ceb036263f..00000000000000
--- a/patches.runtime_pm/0121-freezer-test-freezable-conditions-while-holding-free.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From f43f0c2b296e94d5a3f6690f4799d3a83008a6c0 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:24 -0800
-Subject: freezer: test freezable conditions while holding freezer_lock
-
-try_to_freeze_tasks() and thaw_processes() use freezable() and
-frozen() as preliminary tests before initiating operations on a task.
-These are done without any synchronization and hinder with
-synchronization cleanup without any real performance benefits.
-
-In try_to_freeze_tasks(), open code self test and move PF_NOFREEZE and
-frozen() tests inside freezer_lock in freeze_task().
-
-thaw_processes() can simply drop freezable() test as frozen() test in
-__thaw_task() is enough.
-
-Note: This used to be a part of larger patch to fix set_freezable()
- race. Separated out to satisfy ordering among dependent fixes.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Cc: Oleg Nesterov <oleg@redhat.com>
-(cherry picked from commit 85f1d476653f52c97ca75466b2494e67c1cbd25d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/freezer.c | 3 ++-
- kernel/power/process.c | 16 +---------------
- 2 files changed, 3 insertions(+), 16 deletions(-)
-
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index e87f5d9..a26f0d2 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -109,7 +109,8 @@ bool freeze_task(struct task_struct *p, bool sig_only)
-
- spin_lock_irqsave(&freezer_lock, flags);
-
-- if (sig_only && !should_send_signal(p))
-+ if ((p->flags & PF_NOFREEZE) ||
-+ (sig_only && !should_send_signal(p)))
- goto out_unlock;
-
- if (frozen(p))
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index e6e2739..e59676f 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -22,14 +22,6 @@
- */
- #define TIMEOUT (20 * HZ)
-
--static inline int freezable(struct task_struct * p)
--{
-- if ((p == current) ||
-- (p->flags & PF_NOFREEZE))
-- return 0;
-- return 1;
--}
--
- static int try_to_freeze_tasks(bool sig_only)
- {
- struct task_struct *g, *p;
-@@ -52,10 +44,7 @@ static int try_to_freeze_tasks(bool sig_only)
- todo = 0;
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (frozen(p) || !freezable(p))
-- continue;
--
-- if (!freeze_task(p, sig_only))
-+ if (p == current || !freeze_task(p, sig_only))
- continue;
-
- /*
-@@ -181,9 +170,6 @@ void thaw_processes(void)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (!freezable(p))
-- continue;
--
- if (cgroup_freezing_or_frozen(p))
- continue;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0122-freezer-clean-up-freeze_processes-failure-path.patch b/patches.runtime_pm/0122-freezer-clean-up-freeze_processes-failure-path.patch
deleted file mode 100644
index b3935806061bd8..00000000000000
--- a/patches.runtime_pm/0122-freezer-clean-up-freeze_processes-failure-path.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-From 72b77c1e8484860b85fb8add50bbd9ddfceb5174 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:24 -0800
-Subject: freezer: clean up freeze_processes() failure path
-
-freeze_processes() failure path is rather messy. Freezing is canceled
-for workqueues and tasks which aren't frozen yet but frozen tasks are
-left alone and should be thawed by the caller and of course some
-callers (xen and kexec) didn't do it.
-
-This patch updates __thaw_task() to handle cancelation correctly and
-makes freeze_processes() and freeze_kernel_threads() call
-thaw_processes() on failure instead so that the system is fully thawed
-on failure. Unnecessary [suspend_]thaw_processes() calls are removed
-from kernel/power/hibernate.c, suspend.c and user.c.
-
-While at it, restructure error checking if clause in suspend_prepare()
-to be less weird.
-
--v2: Srivatsa spotted missing removal of suspend_thaw_processes() in
- suspend_prepare() and error in commit message. Updated.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit 03afed8bc296fa70186ba832c1126228bb992465)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 1 -
- kernel/freezer.c | 25 +++++++++----------------
- kernel/power/hibernate.c | 15 ++-------------
- kernel/power/process.c | 16 ++++++++--------
- kernel/power/suspend.c | 8 +++-----
- kernel/power/user.c | 4 +---
- 6 files changed, 23 insertions(+), 46 deletions(-)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index 0d161c5..22f1257 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -61,7 +61,6 @@ static inline bool try_to_freeze(void)
- }
-
- extern bool freeze_task(struct task_struct *p, bool sig_only);
--extern void cancel_freezing(struct task_struct *p);
-
- #ifdef CONFIG_CGROUP_FREEZER
- extern int cgroup_freezing_or_frozen(struct task_struct *task);
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index a26f0d2..96f9667 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -135,21 +135,6 @@ out_unlock:
- return ret;
- }
-
--void cancel_freezing(struct task_struct *p)
--{
-- unsigned long flags;
--
-- spin_lock_irqsave(&freezer_lock, flags);
-- if (freezing(p)) {
-- pr_debug(" clean up: %s\n", p->comm);
-- clear_freeze_flag(p);
-- spin_lock(&p->sighand->siglock);
-- recalc_sigpending_and_wake(p);
-- spin_unlock(&p->sighand->siglock);
-- }
-- spin_unlock_irqrestore(&freezer_lock, flags);
--}
--
- void __thaw_task(struct task_struct *p)
- {
- unsigned long flags;
-@@ -159,10 +144,18 @@ void __thaw_task(struct task_struct *p)
- * be visible to @p as waking up implies wmb. Waking up inside
- * freezer_lock also prevents wakeups from leaking outside
- * refrigerator.
-+ *
-+ * If !FROZEN, @p hasn't reached refrigerator, recalc sigpending to
-+ * avoid leaving dangling TIF_SIGPENDING behind.
- */
- spin_lock_irqsave(&freezer_lock, flags);
- clear_freeze_flag(p);
-- if (frozen(p))
-+ if (frozen(p)) {
- wake_up_process(p);
-+ } else {
-+ spin_lock(&p->sighand->siglock);
-+ recalc_sigpending_and_wake(p);
-+ spin_unlock(&p->sighand->siglock);
-+ }
- spin_unlock_irqrestore(&freezer_lock, flags);
- }
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 62c887e..4d8f280 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -607,17 +607,6 @@ static void power_down(void)
- while(1);
- }
-
--static int prepare_processes(void)
--{
-- int error = 0;
--
-- if (freeze_processes()) {
-- error = -EBUSY;
-- thaw_processes();
-- }
-- return error;
--}
--
- /**
- * hibernate - Carry out system hibernation, including saving the image.
- */
-@@ -650,7 +639,7 @@ int hibernate(void)
- sys_sync();
- printk("done.\n");
-
-- error = prepare_processes();
-+ error = freeze_processes();
- if (error)
- goto Free_bitmaps;
-
-@@ -812,7 +801,7 @@ static int software_resume(void)
- goto close_finish;
-
- pr_debug("PM: Preparing processes for restore.\n");
-- error = prepare_processes();
-+ error = freeze_processes();
- if (error) {
- swsusp_close(FMODE_READ);
- goto Done;
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index e59676f..ce64383 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -91,11 +91,6 @@ static int try_to_freeze_tasks(bool sig_only)
- elapsed_csecs = elapsed_csecs64;
-
- if (todo) {
-- /* This does not unfreeze processes that are already frozen
-- * (we have slightly ugly calling convention in that respect,
-- * and caller must call thaw_processes() if something fails),
-- * but it cleans up leftover PF_FREEZE requests.
-- */
- printk("\n");
- printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
- "(%d tasks refusing to freeze, wq_busy=%d):\n",
-@@ -103,14 +98,11 @@ static int try_to_freeze_tasks(bool sig_only)
- elapsed_csecs / 100, elapsed_csecs % 100,
- todo - wq_busy, wq_busy);
-
-- thaw_workqueues();
--
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
- if (!wakeup && !freezer_should_skip(p) &&
- freezing(p) && !frozen(p))
- sched_show_task(p);
-- cancel_freezing(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
- } else {
-@@ -123,6 +115,8 @@ static int try_to_freeze_tasks(bool sig_only)
-
- /**
- * freeze_processes - Signal user space processes to enter the refrigerator.
-+ *
-+ * On success, returns 0. On failure, -errno and system is fully thawed.
- */
- int freeze_processes(void)
- {
-@@ -137,11 +131,15 @@ int freeze_processes(void)
- printk("\n");
- BUG_ON(in_atomic());
-
-+ if (error)
-+ thaw_processes();
- return error;
- }
-
- /**
- * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
-+ *
-+ * On success, returns 0. On failure, -errno and system is fully thawed.
- */
- int freeze_kernel_threads(void)
- {
-@@ -155,6 +153,8 @@ int freeze_kernel_threads(void)
- printk("\n");
- BUG_ON(in_atomic());
-
-+ if (error)
-+ thaw_processes();
- return error;
- }
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 4953dc0..d336b27 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -106,13 +106,11 @@ static int suspend_prepare(void)
- goto Finish;
-
- error = suspend_freeze_processes();
-- if (error) {
-- suspend_stats.failed_freeze++;
-- dpm_save_failed_step(SUSPEND_FREEZE);
-- } else
-+ if (!error)
- return 0;
-
-- suspend_thaw_processes();
-+ suspend_stats.failed_freeze++;
-+ dpm_save_failed_step(SUSPEND_FREEZE);
- usermodehelper_enable();
- Finish:
- pm_notifier_call_chain(PM_POST_SUSPEND);
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 6d8f535..7cc3f5b 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -257,10 +257,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- break;
-
- error = freeze_processes();
-- if (error) {
-- thaw_processes();
-+ if (error)
- usermodehelper_enable();
-- }
- if (!error)
- data->frozen = 1;
- break;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0123-cgroup_freezer-prepare-for-removal-of-TIF_FREEZE.patch b/patches.runtime_pm/0123-cgroup_freezer-prepare-for-removal-of-TIF_FREEZE.patch
deleted file mode 100644
index f0092e7ebe28b2..00000000000000
--- a/patches.runtime_pm/0123-cgroup_freezer-prepare-for-removal-of-TIF_FREEZE.patch
+++ /dev/null
@@ -1,178 +0,0 @@
-From ea4b5557ce542c3d132b0dda4180477b7e1ad204 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:25 -0800
-Subject: cgroup_freezer: prepare for removal of TIF_FREEZE
-
-TIF_FREEZE will be removed soon and freezing() will directly test
-whether any freezing condition is in effect. Make the following
-changes in preparation.
-
-* Rename cgroup_freezing_or_frozen() to cgroup_freezing() and make it
- return bool.
-
-* Make cgroup_freezing() access task_freezer() under rcu read lock
- instead of task_lock(). This makes the state dereferencing racy
- against task moving to another cgroup; however, it was already racy
- without this change as ->state dereference wasn't synchronized.
- This will be later dealt with using attach hooks.
-
-* freezer->state is now set before trying to push tasks into the
- target state.
-
--v2: Oleg pointed out that freeze_change_state() was setting
- freeze->state incorrectly to CGROUP_FROZEN instead of
- CGROUP_FREEZING. Fixed.
-
--v3: Matt pointed out that setting CGROUP_FROZEN used to always invoke
- try_to_freeze_cgroup() regardless of the current state. Patch
- updated such that the actual freeze/thaw operations are always
- performed on invocation. This shouldn't make any difference
- unless something is broken.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: Paul Menage <paul@paulmenage.org>
-Cc: Li Zefan <lizf@cn.fujitsu.com>
-Cc: Oleg Nesterov <oleg@redhat.com>
-(cherry picked from commit 22b4e111fa01a1147aa562ceaf18a752a928ef4e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 6 +++---
- kernel/cgroup_freezer.c | 40 +++++++++++++---------------------------
- kernel/power/process.c | 2 +-
- 3 files changed, 17 insertions(+), 31 deletions(-)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index 22f1257..08a63a7 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -63,11 +63,11 @@ static inline bool try_to_freeze(void)
- extern bool freeze_task(struct task_struct *p, bool sig_only);
-
- #ifdef CONFIG_CGROUP_FREEZER
--extern int cgroup_freezing_or_frozen(struct task_struct *task);
-+extern bool cgroup_freezing(struct task_struct *task);
- #else /* !CONFIG_CGROUP_FREEZER */
--static inline int cgroup_freezing_or_frozen(struct task_struct *task)
-+static inline bool cgroup_freezing(struct task_struct *task)
- {
-- return 0;
-+ return false;
- }
- #endif /* !CONFIG_CGROUP_FREEZER */
-
-diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
-index d8f5e61..61ef5b5 100644
---- a/kernel/cgroup_freezer.c
-+++ b/kernel/cgroup_freezer.c
-@@ -48,19 +48,17 @@ static inline struct freezer *task_freezer(struct task_struct *task)
- struct freezer, css);
- }
-
--static inline int __cgroup_freezing_or_frozen(struct task_struct *task)
-+bool cgroup_freezing(struct task_struct *task)
- {
-- enum freezer_state state = task_freezer(task)->state;
-- return (state == CGROUP_FREEZING) || (state == CGROUP_FROZEN);
--}
-+ enum freezer_state state;
-+ bool ret;
-
--int cgroup_freezing_or_frozen(struct task_struct *task)
--{
-- int result;
-- task_lock(task);
-- result = __cgroup_freezing_or_frozen(task);
-- task_unlock(task);
-- return result;
-+ rcu_read_lock();
-+ state = task_freezer(task)->state;
-+ ret = state == CGROUP_FREEZING || state == CGROUP_FROZEN;
-+ rcu_read_unlock();
-+
-+ return ret;
- }
-
- /*
-@@ -102,9 +100,6 @@ struct cgroup_subsys freezer_subsys;
- * freezer_can_attach():
- * cgroup_mutex (held by caller of can_attach)
- *
-- * cgroup_freezing_or_frozen():
-- * task->alloc_lock (to get task's cgroup)
-- *
- * freezer_fork() (preserving fork() performance means can't take cgroup_mutex):
- * freezer->lock
- * sighand->siglock (if the cgroup is freezing)
-@@ -184,13 +179,7 @@ static int freezer_can_attach(struct cgroup_subsys *ss,
-
- static int freezer_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
- {
-- rcu_read_lock();
-- if (__cgroup_freezing_or_frozen(tsk)) {
-- rcu_read_unlock();
-- return -EBUSY;
-- }
-- rcu_read_unlock();
-- return 0;
-+ return cgroup_freezing(tsk) ? -EBUSY : 0;
- }
-
- static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
-@@ -286,7 +275,6 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
- struct task_struct *task;
- unsigned int num_cant_freeze_now = 0;
-
-- freezer->state = CGROUP_FREEZING;
- cgroup_iter_start(cgroup, &it);
- while ((task = cgroup_iter_next(cgroup, &it))) {
- if (!freeze_task(task, true))
-@@ -310,8 +298,6 @@ static void unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
- while ((task = cgroup_iter_next(cgroup, &it)))
- __thaw_task(task);
- cgroup_iter_end(cgroup, &it);
--
-- freezer->state = CGROUP_THAWED;
- }
-
- static int freezer_change_state(struct cgroup *cgroup,
-@@ -325,20 +311,20 @@ static int freezer_change_state(struct cgroup *cgroup,
- spin_lock_irq(&freezer->lock);
-
- update_if_frozen(cgroup, freezer);
-- if (goal_state == freezer->state)
-- goto out;
-
- switch (goal_state) {
- case CGROUP_THAWED:
-+ freezer->state = CGROUP_THAWED;
- unfreeze_cgroup(cgroup, freezer);
- break;
- case CGROUP_FROZEN:
-+ freezer->state = CGROUP_FREEZING;
- retval = try_to_freeze_cgroup(cgroup, freezer);
- break;
- default:
- BUG();
- }
--out:
-+
- spin_unlock_irq(&freezer->lock);
-
- return retval;
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index ce64383..9f6f5c7 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -170,7 +170,7 @@ void thaw_processes(void)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (cgroup_freezing_or_frozen(p))
-+ if (cgroup_freezing(p))
- continue;
-
- __thaw_task(p);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0124-freezer-make-freezing-test-freeze-conditions-in-effe.patch b/patches.runtime_pm/0124-freezer-make-freezing-test-freeze-conditions-in-effe.patch
deleted file mode 100644
index 851545fe6d32ab..00000000000000
--- a/patches.runtime_pm/0124-freezer-make-freezing-test-freeze-conditions-in-effe.patch
+++ /dev/null
@@ -1,316 +0,0 @@
-From eb9b27f500cf1bc56a4f10a7d7d3112635305dc7 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:25 -0800
-Subject: freezer: make freezing() test freeze conditions in effect instead of
- TIF_FREEZE
-
-Using TIF_FREEZE for freezing worked when there was only single
-freezing condition (the PM one); however, now there is also the
-cgroup_freezer and single bit flag is getting clumsy.
-thaw_processes() is already testing whether cgroup freezing in in
-effect to avoid thawing tasks which were frozen by both PM and cgroup
-freezers.
-
-This is racy (nothing prevents race against cgroup freezing) and
-fragile. A much simpler way is to test actual freeze conditions from
-freezing() - ie. directly test whether PM or cgroup freezing is in
-effect.
-
-This patch adds variables to indicate whether and what type of
-freezing conditions are in effect and reimplements freezing() such
-that it directly tests whether any of the two freezing conditions is
-active and the task should freeze. On fast path, freezing() is still
-very cheap - it only tests system_freezing_cnt.
-
-This makes the clumsy dancing aroung TIF_FREEZE unnecessary and
-freeze/thaw operations more usual - updating state variables for the
-new state and nudging target tasks so that they notice the new state
-and comply. As long as the nudging happens after state update, it's
-race-free.
-
-* This allows use of freezing() in freeze_task(). Replace the open
- coded tests with freezing().
-
-* p != current test is added to warning printing conditions in
- try_to_freeze_tasks() failure path. This is necessary as freezing()
- is now true for the task which initiated freezing too.
-
--v2: Oleg pointed out that re-freezing FROZEN cgroup could increment
- system_freezing_cnt. Fixed.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: Paul Menage <paul@paulmenage.org> (for the cgroup portions)
-(cherry picked from commit a3201227f803ad7fd43180c5195dbe5a2bf998aa)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 33 +++++++++----------------
- kernel/cgroup_freezer.c | 10 ++++++-
- kernel/fork.c | 1
- kernel/freezer.c | 62 ++++++++++++++++++++++++++++++------------------
- kernel/power/process.c | 15 ++++++++---
- 5 files changed, 72 insertions(+), 49 deletions(-)
-
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -5,8 +5,13 @@
-
- #include <linux/sched.h>
- #include <linux/wait.h>
-+#include <linux/atomic.h>
-
- #ifdef CONFIG_FREEZER
-+extern atomic_t system_freezing_cnt; /* nr of freezing conds in effect */
-+extern bool pm_freezing; /* PM freezing in effect */
-+extern bool pm_nosig_freezing; /* PM nosig freezing in effect */
-+
- /*
- * Check if a process has been frozen
- */
-@@ -15,28 +20,16 @@ static inline int frozen(struct task_str
- return p->flags & PF_FROZEN;
- }
-
--/*
-- * Check if there is a request to freeze a process
-- */
--static inline int freezing(struct task_struct *p)
--{
-- return test_tsk_thread_flag(p, TIF_FREEZE);
--}
-+extern bool freezing_slow_path(struct task_struct *p);
-
- /*
-- * Request that a process be frozen
-- */
--static inline void set_freeze_flag(struct task_struct *p)
--{
-- set_tsk_thread_flag(p, TIF_FREEZE);
--}
--
--/*
-- * Sometimes we may need to cancel the previous 'freeze' request
-+ * Check if there is a request to freeze a process
- */
--static inline void clear_freeze_flag(struct task_struct *p)
-+static inline bool freezing(struct task_struct *p)
- {
-- clear_tsk_thread_flag(p, TIF_FREEZE);
-+ if (likely(!atomic_read(&system_freezing_cnt)))
-+ return false;
-+ return freezing_slow_path(p);
- }
-
- static inline bool should_send_signal(struct task_struct *p)
-@@ -164,9 +157,7 @@ static inline void set_freezable_with_si
- })
- #else /* !CONFIG_FREEZER */
- static inline int frozen(struct task_struct *p) { return 0; }
--static inline int freezing(struct task_struct *p) { return 0; }
--static inline void set_freeze_flag(struct task_struct *p) {}
--static inline void clear_freeze_flag(struct task_struct *p) {}
-+static inline bool freezing(struct task_struct *p) { return false; }
-
- static inline bool __refrigerator(bool check_kthr_stop) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
---- a/kernel/cgroup_freezer.c
-+++ b/kernel/cgroup_freezer.c
-@@ -145,7 +145,11 @@ static struct cgroup_subsys_state *freez
- static void freezer_destroy(struct cgroup_subsys *ss,
- struct cgroup *cgroup)
- {
-- kfree(cgroup_freezer(cgroup));
-+ struct freezer *freezer = cgroup_freezer(cgroup);
-+
-+ if (freezer->state != CGROUP_THAWED)
-+ atomic_dec(&system_freezing_cnt);
-+ kfree(freezer);
- }
-
- /* task is frozen or will freeze immediately when next it gets woken */
-@@ -314,10 +318,14 @@ static int freezer_change_state(struct c
-
- switch (goal_state) {
- case CGROUP_THAWED:
-+ if (freezer->state != CGROUP_THAWED)
-+ atomic_dec(&system_freezing_cnt);
- freezer->state = CGROUP_THAWED;
- unfreeze_cgroup(cgroup, freezer);
- break;
- case CGROUP_FROZEN:
-+ if (freezer->state == CGROUP_THAWED)
-+ atomic_inc(&system_freezing_cnt);
- freezer->state = CGROUP_FREEZING;
- retval = try_to_freeze_cgroup(cgroup, freezer);
- break;
---- a/kernel/fork.c
-+++ b/kernel/fork.c
-@@ -1003,7 +1003,6 @@ static void copy_flags(unsigned long clo
- new_flags |= PF_FORKNOEXEC;
- new_flags |= PF_STARTING;
- p->flags = new_flags;
-- clear_freeze_flag(p);
- }
-
- SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -11,9 +11,41 @@
- #include <linux/freezer.h>
- #include <linux/kthread.h>
-
-+/* total number of freezing conditions in effect */
-+atomic_t system_freezing_cnt = ATOMIC_INIT(0);
-+EXPORT_SYMBOL(system_freezing_cnt);
-+
-+/* indicate whether PM freezing is in effect, protected by pm_mutex */
-+bool pm_freezing;
-+bool pm_nosig_freezing;
-+
- /* protects freezing and frozen transitions */
- static DEFINE_SPINLOCK(freezer_lock);
-
-+/**
-+ * freezing_slow_path - slow path for testing whether a task needs to be frozen
-+ * @p: task to be tested
-+ *
-+ * This function is called by freezing() if system_freezing_cnt isn't zero
-+ * and tests whether @p needs to enter and stay in frozen state. Can be
-+ * called under any context. The freezers are responsible for ensuring the
-+ * target tasks see the updated state.
-+ */
-+bool freezing_slow_path(struct task_struct *p)
-+{
-+ if (p->flags & PF_NOFREEZE)
-+ return false;
-+
-+ if (pm_nosig_freezing || cgroup_freezing(p))
-+ return true;
-+
-+ if (pm_freezing && !(p->flags & PF_FREEZER_NOSIG))
-+ return true;
-+
-+ return false;
-+}
-+EXPORT_SYMBOL(freezing_slow_path);
-+
- /* Refrigerator is place where frozen processes are stored :-). */
- bool __refrigerator(bool check_kthr_stop)
- {
-@@ -23,17 +55,11 @@ bool __refrigerator(bool check_kthr_stop
- long save;
-
- /*
-- * Enter FROZEN. If NOFREEZE, schedule immediate thawing by
-- * clearing freezing.
-+ * No point in checking freezing() again - the caller already did.
-+ * Proceed to enter FROZEN.
- */
- spin_lock_irq(&freezer_lock);
- repeat:
-- if (!freezing(current)) {
-- spin_unlock_irq(&freezer_lock);
-- return was_frozen;
-- }
-- if (current->flags & PF_NOFREEZE)
-- clear_freeze_flag(current);
- current->flags |= PF_FROZEN;
- spin_unlock_irq(&freezer_lock);
-
-@@ -105,18 +131,12 @@ static void fake_signal_wake_up(struct t
- bool freeze_task(struct task_struct *p, bool sig_only)
- {
- unsigned long flags;
-- bool ret = false;
-
- spin_lock_irqsave(&freezer_lock, flags);
--
-- if ((p->flags & PF_NOFREEZE) ||
-- (sig_only && !should_send_signal(p)))
-- goto out_unlock;
--
-- if (frozen(p))
-- goto out_unlock;
--
-- set_freeze_flag(p);
-+ if (!freezing(p) || frozen(p)) {
-+ spin_unlock_irqrestore(&freezer_lock, flags);
-+ return false;
-+ }
-
- if (should_send_signal(p)) {
- fake_signal_wake_up(p);
-@@ -129,10 +149,9 @@ bool freeze_task(struct task_struct *p,
- } else {
- wake_up_state(p, TASK_INTERRUPTIBLE);
- }
-- ret = true;
--out_unlock:
-+
- spin_unlock_irqrestore(&freezer_lock, flags);
-- return ret;
-+ return true;
- }
-
- void __thaw_task(struct task_struct *p)
-@@ -149,7 +168,6 @@ void __thaw_task(struct task_struct *p)
- * avoid leaving dangling TIF_SIGPENDING behind.
- */
- spin_lock_irqsave(&freezer_lock, flags);
-- clear_freeze_flag(p);
- if (frozen(p)) {
- wake_up_process(p);
- } else {
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -101,7 +101,7 @@ static int try_to_freeze_tasks(bool sig_
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
- if (!wakeup && !freezer_should_skip(p) &&
-- freezing(p) && !frozen(p))
-+ p != current && freezing(p) && !frozen(p))
- sched_show_task(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
-@@ -122,7 +122,11 @@ int freeze_processes(void)
- {
- int error;
-
-+ if (!pm_freezing)
-+ atomic_inc(&system_freezing_cnt);
-+
- printk("Freezing user space processes ... ");
-+ pm_freezing = true;
- error = try_to_freeze_tasks(true);
- if (!error) {
- printk("done.");
-@@ -146,6 +150,7 @@ int freeze_kernel_threads(void)
- int error;
-
- printk("Freezing remaining freezable tasks ... ");
-+ pm_nosig_freezing = true;
- error = try_to_freeze_tasks(false);
- if (!error)
- printk("done.");
-@@ -162,6 +167,11 @@ void thaw_processes(void)
- {
- struct task_struct *g, *p;
-
-+ if (pm_freezing)
-+ atomic_dec(&system_freezing_cnt);
-+ pm_freezing = false;
-+ pm_nosig_freezing = false;
-+
- oom_killer_enable();
-
- printk("Restarting tasks ... ");
-@@ -170,9 +180,6 @@ void thaw_processes(void)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (cgroup_freezing(p))
-- continue;
--
- __thaw_task(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
diff --git a/patches.runtime_pm/0125-Freezer-fix-more-fallout-from-the-thaw_process-renam.patch b/patches.runtime_pm/0125-Freezer-fix-more-fallout-from-the-thaw_process-renam.patch
deleted file mode 100644
index db0fcb55ce11cc..00000000000000
--- a/patches.runtime_pm/0125-Freezer-fix-more-fallout-from-the-thaw_process-renam.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From d55bc830eecb234dfbf881ea1735b43f0950e91f Mon Sep 17 00:00:00 2001
-From: Stephen Rothwell <sfr@canb.auug.org.au>
-Date: Fri, 25 Nov 2011 00:44:55 +0100
-Subject: Freezer: fix more fallout from the thaw_process rename
-
-Commit 944e192db53c "freezer: rename thaw_process() to __thaw_task()
-and simplify the implementation" did not create a !CONFIG_FREEZER version
-of __thaw_task().
-
-Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
----
- include/linux/freezer.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index e01df77..083ffef 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -158,6 +158,7 @@ static inline void set_freezable_with_signal(void)
- #else /* !CONFIG_FREEZER */
- static inline int frozen(struct task_struct *p) { return 0; }
- static inline bool freezing(struct task_struct *p) { return false; }
-+static inline void __thaw_task(struct task_struct *t) {}
-
- static inline bool __refrigerator(bool check_kthr_stop) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0126-freezer-remove-unused-sig_only-from-freeze_task.patch b/patches.runtime_pm/0126-freezer-remove-unused-sig_only-from-freeze_task.patch
deleted file mode 100644
index 57e3c54735be9c..00000000000000
--- a/patches.runtime_pm/0126-freezer-remove-unused-sig_only-from-freeze_task.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From ee111bd31cf0e177f3ff57858cfa38fa5434ba6a Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj@kernel.org>
-Date: Mon, 21 Nov 2011 12:32:26 -0800
-Subject: freezer: remove unused @sig_only from freeze_task()
-
-After "freezer: make freezing() test freeze conditions in effect
-instead of TIF_FREEZE", freezing() returns authoritative answer on
-whether the current task should freeze or not and freeze_task()
-doesn't need or use @sig_only. Remove it.
-
-While at it, rewrite function comment for freeze_task() and rename
-@sig_only to @user_only in try_to_freeze_tasks().
-
-This patch doesn't cause any functional change.
-
-Signed-off-by: Tejun Heo <tj@kernel.org>
-Acked-by: Oleg Nesterov <oleg@redhat.com>
-(cherry picked from commit 839e3407d90a810318d17c17ceb3d5928a910704)
-
-Conflicts:
-
- include/linux/freezer.h
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 2 +-
- kernel/cgroup_freezer.c | 4 ++--
- kernel/freezer.c | 21 +++++++++------------
- kernel/power/process.c | 8 ++++----
- 4 files changed, 16 insertions(+), 19 deletions(-)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index 083ffef..b79db3d 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -53,7 +53,7 @@ static inline bool try_to_freeze(void)
- return __refrigerator(false);
- }
-
--extern bool freeze_task(struct task_struct *p, bool sig_only);
-+extern bool freeze_task(struct task_struct *p);
-
- #ifdef CONFIG_CGROUP_FREEZER
- extern bool cgroup_freezing(struct task_struct *task);
-diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
-index ab79783..6d85d96 100644
---- a/kernel/cgroup_freezer.c
-+++ b/kernel/cgroup_freezer.c
-@@ -213,7 +213,7 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
-
- /* Locking avoids race with FREEZING -> THAWED transitions. */
- if (freezer->state == CGROUP_FREEZING)
-- freeze_task(task, true);
-+ freeze_task(task);
- spin_unlock_irq(&freezer->lock);
- }
-
-@@ -281,7 +281,7 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
-
- cgroup_iter_start(cgroup, &it);
- while ((task = cgroup_iter_next(cgroup, &it))) {
-- if (!freeze_task(task, true))
-+ if (!freeze_task(task))
- continue;
- if (is_task_frozen_enough(task))
- continue;
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 8bf25f4..9adeebe 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -115,20 +115,17 @@ static void fake_signal_wake_up(struct task_struct *p)
- }
-
- /**
-- * freeze_task - send a freeze request to given task
-- * @p: task to send the request to
-- * @sig_only: if set, the request will only be sent if the task has the
-- * PF_FREEZER_NOSIG flag unset
-- * Return value: 'false', if @sig_only is set and the task has
-- * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise
-+ * freeze_task - send a freeze request to given task
-+ * @p: task to send the request to
- *
-- * The freeze request is sent by setting the tasks's TIF_FREEZE flag and
-- * either sending a fake signal to it or waking it up, depending on whether
-- * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task
-- * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its
-- * TIF_FREEZE flag will not be set.
-+ * If @p is freezing, the freeze request is sent by setting %TIF_FREEZE
-+ * flag and either sending a fake signal to it or waking it up, depending
-+ * on whether it has %PF_FREEZER_NOSIG set.
-+ *
-+ * RETURNS:
-+ * %false, if @p is not freezing or already frozen; %true, otherwise
- */
--bool freeze_task(struct task_struct *p, bool sig_only)
-+bool freeze_task(struct task_struct *p)
- {
- unsigned long flags;
-
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 0beb51e..77274c9 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -22,7 +22,7 @@
- */
- #define TIMEOUT (20 * HZ)
-
--static int try_to_freeze_tasks(bool sig_only)
-+static int try_to_freeze_tasks(bool user_only)
- {
- struct task_struct *g, *p;
- unsigned long end_time;
-@@ -37,14 +37,14 @@ static int try_to_freeze_tasks(bool sig_only)
-
- end_time = jiffies + TIMEOUT;
-
-- if (!sig_only)
-+ if (!user_only)
- freeze_workqueues_begin();
-
- while (true) {
- todo = 0;
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-- if (p == current || !freeze_task(p, sig_only))
-+ if (p == current || !freeze_task(p))
- continue;
-
- /*
-@@ -65,7 +65,7 @@ static int try_to_freeze_tasks(bool sig_only)
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
-
-- if (!sig_only) {
-+ if (!user_only) {
- wq_busy = freeze_workqueues_busy();
- todo += wq_busy;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0127-PM-Hibernate-Do-not-leak-memory-in-error-test-code-p.patch b/patches.runtime_pm/0127-PM-Hibernate-Do-not-leak-memory-in-error-test-code-p.patch
deleted file mode 100644
index f17e087af11742..00000000000000
--- a/patches.runtime_pm/0127-PM-Hibernate-Do-not-leak-memory-in-error-test-code-p.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 8236c20dc38b0234a640c9898f313723dd867f30 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 22 Nov 2011 23:08:10 +0100
-Subject: PM / Hibernate: Do not leak memory in error/test code paths
-
-The hibernation core code forgets to release memory preallocated
-for hibernation if there's an error in its early stages or if test
-modes causing hibernation_snapshot() to return early are used. This
-causes the system to be hardly usable, because the amount of
-preallocated memory is usually huge. Fix this problem.
-
-Reported-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit bb58dd5d1ffad6c2d21c69698ba766dad4ae54e6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 4d8f280..863c14d 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -347,7 +347,7 @@ int hibernation_snapshot(int platform_mode)
-
- error = freeze_kernel_threads();
- if (error)
-- goto Close;
-+ goto Cleanup;
-
- if (hibernation_test(TEST_FREEZER) ||
- hibernation_testmode(HIBERNATION_TESTPROC)) {
-@@ -357,12 +357,14 @@ int hibernation_snapshot(int platform_mode)
- * successful freezer test.
- */
- freezer_test_done = true;
-- goto Close;
-+ goto Cleanup;
- }
-
- error = dpm_prepare(PMSG_FREEZE);
-- if (error)
-- goto Complete_devices;
-+ if (error) {
-+ dpm_complete(msg);
-+ goto Cleanup;
-+ }
-
- suspend_console();
- pm_restrict_gfp_mask();
-@@ -391,8 +393,6 @@ int hibernation_snapshot(int platform_mode)
- pm_restore_gfp_mask();
-
- resume_console();
--
-- Complete_devices:
- dpm_complete(msg);
-
- Close:
-@@ -402,6 +402,10 @@ int hibernation_snapshot(int platform_mode)
- Recover_platform:
- platform_recover(platform_mode);
- goto Resume_devices;
-+
-+ Cleanup:
-+ swsusp_free();
-+ goto Close;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0128-PM-Fix-indentation-and-remove-extraneous-whitespaces.patch b/patches.runtime_pm/0128-PM-Fix-indentation-and-remove-extraneous-whitespaces.patch
deleted file mode 100644
index e8ea3f1cc79974..00000000000000
--- a/patches.runtime_pm/0128-PM-Fix-indentation-and-remove-extraneous-whitespaces.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 0c9520d1359898b2836cc4360d320ac59b462ce3 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 19 Nov 2011 14:39:01 +0100
-Subject: PM: Fix indentation and remove extraneous whitespaces in
- kernel/power/main.c
-
-Lack of proper indentation of the goto statement decreases the readability
-of code significantly. In fact, this made me look twice at the code to check
-whether it really does what it should be doing. Fix this.
-
-And in the same file, there are some extra whitespaces. Get rid of them too.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 341d4166175e9b7911444f5a33b1c9efb8f15c85)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/main.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 36e0f09..7d36fb3 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -3,7 +3,7 @@
- *
- * Copyright (c) 2003 Patrick Mochel
- * Copyright (c) 2003 Open Source Development Lab
-- *
-+ *
- * This file is released under the GPLv2
- *
- */
-@@ -240,7 +240,7 @@ struct kobject *power_kobj;
- * 'standby' (Power-On Suspend), 'mem' (Suspend-to-RAM), and
- * 'disk' (Suspend-to-Disk).
- *
-- * store() accepts one of those strings, translates it into the
-+ * store() accepts one of those strings, translates it into the
- * proper enumerated value, and initiates a suspend transition.
- */
- static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr,
-@@ -282,7 +282,7 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
- /* First, check if we are requested to hibernate */
- if (len == 4 && !strncmp(buf, "disk", len)) {
- error = hibernate();
-- goto Exit;
-+ goto Exit;
- }
-
- #ifdef CONFIG_SUSPEND
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0129-PM-Sleep-Remove-unnecessary-label-and-jumps-to-it-fo.patch b/patches.runtime_pm/0129-PM-Sleep-Remove-unnecessary-label-and-jumps-to-it-fo.patch
deleted file mode 100644
index 759b468d4ff0c0..00000000000000
--- a/patches.runtime_pm/0129-PM-Sleep-Remove-unnecessary-label-and-jumps-to-it-fo.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0312512b537f69de8a744eb82fa888c44c04e6c1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 21 Nov 2011 23:33:28 +0100
-Subject: PM / Sleep: Remove unnecessary label and jumps to it form PM core
- code
-
-The "End" label in device_prepare() in drivers/base/power/main.c is
-not necessary and the jumps to it have no real effect, so remove them
-all.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit d74e278aaf3b0fe4b02af67055aa71babcc0cebe)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 7 -------
- 1 file changed, 7 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index c3d2dfc..1172aea 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -1033,22 +1033,16 @@ static int device_prepare(struct device *dev, pm_message_t state)
- if (dev->pm_domain->ops.prepare)
- error = dev->pm_domain->ops.prepare(dev);
- suspend_report_result(dev->pm_domain->ops.prepare, error);
-- if (error)
-- goto End;
- } else if (dev->type && dev->type->pm) {
- pm_dev_dbg(dev, state, "preparing type ");
- if (dev->type->pm->prepare)
- error = dev->type->pm->prepare(dev);
- suspend_report_result(dev->type->pm->prepare, error);
-- if (error)
-- goto End;
- } else if (dev->class && dev->class->pm) {
- pm_dev_dbg(dev, state, "preparing class ");
- if (dev->class->pm->prepare)
- error = dev->class->pm->prepare(dev);
- suspend_report_result(dev->class->pm->prepare, error);
-- if (error)
-- goto End;
- } else if (dev->bus && dev->bus->pm) {
- pm_dev_dbg(dev, state, "preparing ");
- if (dev->bus->pm->prepare)
-@@ -1056,7 +1050,6 @@ static int device_prepare(struct device *dev, pm_message_t state)
- suspend_report_result(dev->bus->pm->prepare, error);
- }
-
-- End:
- device_unlock(dev);
-
- return error;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0130-PM-Sleep-Simplify-device_suspend_noirq.patch b/patches.runtime_pm/0130-PM-Sleep-Simplify-device_suspend_noirq.patch
deleted file mode 100644
index 5771ea05caa558..00000000000000
--- a/patches.runtime_pm/0130-PM-Sleep-Simplify-device_suspend_noirq.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 9d07decc482d8e2e0b15f789e8b4846756ae4a45 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 21 Nov 2011 23:33:55 +0100
-Subject: PM / Sleep: Simplify device_suspend_noirq()
-
-Remove a few if () and return statements in device_suspend_noirq()
-that aren't really necessary.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit 64e94aafb6a5c4f419e9b8f93950914b5ac162a9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 12 ++----------
- 1 file changed, 2 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 1172aea..406f82c 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -763,31 +763,23 @@ static pm_message_t resume_event(pm_message_t sleep_state)
- */
- static int device_suspend_noirq(struct device *dev, pm_message_t state)
- {
-- int error;
-+ int error = 0;
-
- if (dev->pm_domain) {
- pm_dev_dbg(dev, state, "LATE power domain ");
- error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
-- if (error)
-- return error;
- } else if (dev->type && dev->type->pm) {
- pm_dev_dbg(dev, state, "LATE type ");
- error = pm_noirq_op(dev, dev->type->pm, state);
-- if (error)
-- return error;
- } else if (dev->class && dev->class->pm) {
- pm_dev_dbg(dev, state, "LATE class ");
- error = pm_noirq_op(dev, dev->class->pm, state);
-- if (error)
-- return error;
- } else if (dev->bus && dev->bus->pm) {
- pm_dev_dbg(dev, state, "LATE ");
- error = pm_noirq_op(dev, dev->bus->pm, state);
-- if (error)
-- return error;
- }
-
-- return 0;
-+ return error;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0131-PM-Hibernate-Refactor-and-simplify-hibernation_snaps.patch b/patches.runtime_pm/0131-PM-Hibernate-Refactor-and-simplify-hibernation_snaps.patch
deleted file mode 100644
index 424d6ffdf9a0fc..00000000000000
--- a/patches.runtime_pm/0131-PM-Hibernate-Refactor-and-simplify-hibernation_snaps.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 33ccf9b8390f1510d56a21cb9070a679ea26c4fe Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Tue, 22 Nov 2011 23:20:31 +0100
-Subject: PM / Hibernate: Refactor and simplify hibernation_snapshot() code
-
-The goto statements in hibernation_snapshot() are a bit complex.
-Refactor the code to remove some of them, thereby simplifying the
-implementation.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 953a206393b1533ceb0e7d725cc5a8c8d7ed97dd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 22 +++++++++-------------
- 1 file changed, 9 insertions(+), 13 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 863c14d..6495e6a 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -333,7 +333,7 @@ static int create_image(int platform_mode)
- */
- int hibernation_snapshot(int platform_mode)
- {
-- pm_message_t msg = PMSG_RECOVER;
-+ pm_message_t msg;
- int error;
-
- error = platform_begin(platform_mode);
-@@ -362,26 +362,26 @@ int hibernation_snapshot(int platform_mode)
-
- error = dpm_prepare(PMSG_FREEZE);
- if (error) {
-- dpm_complete(msg);
-+ dpm_complete(PMSG_RECOVER);
- goto Cleanup;
- }
-
- suspend_console();
- pm_restrict_gfp_mask();
-+
- error = dpm_suspend(PMSG_FREEZE);
-- if (error)
-- goto Recover_platform;
-
-- if (hibernation_test(TEST_DEVICES))
-- goto Recover_platform;
-+ if (error || hibernation_test(TEST_DEVICES))
-+ platform_recover(platform_mode);
-+ else
-+ error = create_image(platform_mode);
-
-- error = create_image(platform_mode);
- /*
-- * Control returns here (1) after the image has been created or the
-+ * In the case that we call create_image() above, the control
-+ * returns here (1) after the image has been created or the
- * image creation has failed and (2) after a successful restore.
- */
-
-- Resume_devices:
- /* We may need to release the preallocated image pages here. */
- if (error || !in_suspend)
- swsusp_free();
-@@ -399,10 +399,6 @@ int hibernation_snapshot(int platform_mode)
- platform_end(platform_mode);
- return error;
-
-- Recover_platform:
-- platform_recover(platform_mode);
-- goto Resume_devices;
--
- Cleanup:
- swsusp_free();
- goto Close;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0132-PM-Domains-Document-how-PM-domains-are-used-by-the-P.patch b/patches.runtime_pm/0132-PM-Domains-Document-how-PM-domains-are-used-by-the-P.patch
deleted file mode 100644
index 011729d6c13405..00000000000000
--- a/patches.runtime_pm/0132-PM-Domains-Document-how-PM-domains-are-used-by-the-P.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From a3f7a2775d5a10dcdb30cc3dac113a06a0ad8242 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 23 Nov 2011 21:18:39 +0100
-Subject: PM / Domains: Document how PM domains are used by the PM core
-
-The current power management documentation in Documentation/power/
-either doesn't cover PM domains at all, or gives inaccurate
-information about them, so update the relevant files in there to
-follow the code.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5841eb6402707a387b216373e65c9c28e8136663)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 42 +++++++++++++++++++++++-------------
- Documentation/power/runtime_pm.txt | 29 +++++++++++++++----------
- 2 files changed, 45 insertions(+), 26 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 646a89e..4342acb 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -123,9 +123,10 @@ please refer directly to the source code for more information about it.
- Subsystem-Level Methods
- -----------------------
- The core methods to suspend and resume devices reside in struct dev_pm_ops
--pointed to by the pm member of struct bus_type, struct device_type and
--struct class. They are mostly of interest to the people writing infrastructure
--for buses, like PCI or USB, or device type and device class drivers.
-+pointed to by the ops member of struct dev_pm_domain, or by the pm member of
-+struct bus_type, struct device_type and struct class. They are mostly of
-+interest to the people writing infrastructure for platforms and buses, like PCI
-+or USB, or device type and device class drivers.
-
- Bus drivers implement these methods as appropriate for the hardware and the
- drivers using it; PCI works differently from USB, and so on. Not many people
-@@ -251,18 +252,29 @@ various phases always run after tasks have been frozen and before they are
- unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
- been disabled (except for those marked with the IRQ_WAKEUP flag).
-
--All phases use bus, type, or class callbacks (that is, methods defined in
--dev->bus->pm, dev->type->pm, or dev->class->pm). These callbacks are mutually
--exclusive, so if the device type provides a struct dev_pm_ops object pointed to
--by its pm field (i.e. both dev->type and dev->type->pm are defined), the
--callbacks included in that object (i.e. dev->type->pm) will be used. Otherwise,
--if the class provides a struct dev_pm_ops object pointed to by its pm field
--(i.e. both dev->class and dev->class->pm are defined), the PM core will use the
--callbacks from that object (i.e. dev->class->pm). Finally, if the pm fields of
--both the device type and class objects are NULL (or those objects do not exist),
--the callbacks provided by the bus (that is, the callbacks from dev->bus->pm)
--will be used (this allows device types to override callbacks provided by bus
--types or classes if necessary).
-+All phases use PM domain, bus, type, or class callbacks (that is, methods
-+defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, or dev->class->pm).
-+These callbacks are regarded by the PM core as mutually exclusive. Moreover,
-+PM domain callbacks always take precedence over bus, type and class callbacks,
-+while type callbacks take precedence over bus and class callbacks, and class
-+callbacks take precedence over bus callbacks. To be precise, the following
-+rules are used to determine which callback to execute in the given phase:
-+
-+ 1. If dev->pm_domain is present, the PM core will attempt to execute the
-+ callback included in dev->pm_domain->ops. If that callback is not
-+ present, no action will be carried out for the given device.
-+
-+ 2. Otherwise, if both dev->type and dev->type->pm are present, the callback
-+ included in dev->type->pm will be executed.
-+
-+ 3. Otherwise, if both dev->class and dev->class->pm are present, the
-+ callback included in dev->class->pm will be executed.
-+
-+ 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback
-+ included in dev->bus->pm will be executed.
-+
-+This allows PM domains and device types to override callbacks provided by bus
-+types or device classes if necessary.
-
- These callbacks may in turn invoke device- or driver-specific methods stored in
- dev->driver->pm, but they don't have to.
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 5336149..79b10a0 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -44,17 +44,24 @@ struct dev_pm_ops {
- };
-
- The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks
--are executed by the PM core for either the power domain, or the device type
--(if the device power domain's struct dev_pm_ops does not exist), or the class
--(if the device power domain's and type's struct dev_pm_ops object does not
--exist), or the bus type (if the device power domain's, type's and class'
--struct dev_pm_ops objects do not exist) of the given device, so the priority
--order of callbacks from high to low is that power domain callbacks, device
--type callbacks, class callbacks and bus type callbacks, and the high priority
--one will take precedence over low priority one. The bus type, device type and
--class callbacks are referred to as subsystem-level callbacks in what follows,
--and generally speaking, the power domain callbacks are used for representing
--power domains within a SoC.
-+are executed by the PM core for the device's subsystem that may be either of
-+the following:
-+
-+ 1. PM domain of the device, if the device's PM domain object, dev->pm_domain,
-+ is present.
-+
-+ 2. Device type of the device, if both dev->type and dev->type->pm are present.
-+
-+ 3. Device class of the device, if both dev->class and dev->class->pm are
-+ present.
-+
-+ 4. Bus type of the device, if both dev->bus and dev->bus->pm are present.
-+
-+The PM core always checks which callback to use in the order given above, so the
-+priority order of callbacks from high to low is: PM domain, device type, class
-+and bus type. Moreover, the high-priority one will always take precedence over
-+a low-priority one. The PM domain, bus type, device type and class callbacks
-+are referred to as subsystem-level callbacks in what follows.
-
- By default, the callbacks are always invoked in process context with interrupts
- enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0133-PM-Sleep-Correct-inaccurate-information-in-devices.t.patch b/patches.runtime_pm/0133-PM-Sleep-Correct-inaccurate-information-in-devices.t.patch
deleted file mode 100644
index e06cdd0b5f60cc..00000000000000
--- a/patches.runtime_pm/0133-PM-Sleep-Correct-inaccurate-information-in-devices.t.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 83931ca2a6a92333544568e4cd6d8b5a19f0e4a5 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 23 Nov 2011 21:19:57 +0100
-Subject: PM / Sleep: Correct inaccurate information in devices.txt
-
-The documentation file Documentation/power/devices.txt contains some
-information that isn't correct any more due to code modifications
-made after that file had been created (or updated last time). Fix
-this.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit fa8ce723936460fcf7e49f508fd5dbd5125e39c4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 4342acb..ed32288 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -250,7 +250,7 @@ for every device before the next phase begins. Not all busses or classes
- support all these callbacks and not all drivers use all the callbacks. The
- various phases always run after tasks have been frozen and before they are
- unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
--been disabled (except for those marked with the IRQ_WAKEUP flag).
-+been disabled (except for those marked with the IRQF_NO_SUSPEND flag).
-
- All phases use PM domain, bus, type, or class callbacks (that is, methods
- defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, or dev->class->pm).
-@@ -295,9 +295,8 @@ When the system goes into the standby or memory sleep state, the phases are:
-
- After the prepare callback method returns, no new children may be
- registered below the device. The method may also prepare the device or
-- driver in some way for the upcoming system power transition (for
-- example, by allocating additional memory required for this purpose), but
-- it should not put the device into a low-power state.
-+ driver in some way for the upcoming system power transition, but it
-+ should not put the device into a low-power state.
-
- 2. The suspend methods should quiesce the device to stop it from performing
- I/O. They also may save the device registers and put it into the
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0134-PM-Runtime-Make-documentation-follow-the-new-behavio.patch b/patches.runtime_pm/0134-PM-Runtime-Make-documentation-follow-the-new-behavio.patch
deleted file mode 100644
index 2a0dcc9d0fb729..00000000000000
--- a/patches.runtime_pm/0134-PM-Runtime-Make-documentation-follow-the-new-behavio.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 953625cd38cfd676b68c0cc687c2da11683861fd Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 23 Nov 2011 21:20:07 +0100
-Subject: PM / Runtime: Make documentation follow the new behavior of irq_safe
-
-The runtime PM core code behavior related to the power.irq_safe
-device flag has changed recently and the documentation should be
-modified to reflect it.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 907565921966260921e4c4581ed8985ef4cf9a67)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/runtime_pm.txt | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index 79b10a0..c2ae8bf 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -65,11 +65,12 @@ are referred to as subsystem-level callbacks in what follows.
-
- By default, the callbacks are always invoked in process context with interrupts
- enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
--to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
--callbacks should be invoked in atomic context with interrupts disabled.
--This implies that these callback routines must not block or sleep, but it also
--means that the synchronous helper functions listed at the end of Section 4 can
--be used within an interrupt handler or in an atomic context.
-+to tell the PM core that their ->runtime_suspend(), ->runtime_resume() and
-+->runtime_idle() callbacks may be invoked in atomic context with interrupts
-+disabled for a given device. This implies that the callback routines in
-+question must not block or sleep, but it also means that the synchronous helper
-+functions listed at the end of Section 4 may be used for that device within an
-+interrupt handler or generally in an atomic context.
-
- The subsystem-level suspend callback is _entirely_ _responsible_ for handling
- the suspend of the device as appropriate, which may, but need not include
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0135-PM-Sleep-Update-documentation-related-to-system-wake.patch b/patches.runtime_pm/0135-PM-Sleep-Update-documentation-related-to-system-wake.patch
deleted file mode 100644
index a27ef7e449d28b..00000000000000
--- a/patches.runtime_pm/0135-PM-Sleep-Update-documentation-related-to-system-wake.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 8ac6cfa81a4f4fa3995a706409d8768b1bbe4472 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 23 Nov 2011 21:20:15 +0100
-Subject: PM / Sleep: Update documentation related to system wakeup
-
-The system wakeup section of Documentation/power/devices.txt is
-outdated, so make it agree with the current code.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit fafba48d4dd6fcbb1fd7ac4ab0ba22ef45b9796c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 60 +++++++++++++++++++++++++--------------
- 1 file changed, 38 insertions(+), 22 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index ed32288..3139fb5 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -140,41 +140,57 @@ sequencing in the driver model tree.
-
- /sys/devices/.../power/wakeup files
- -----------------------------------
--All devices in the driver model have two flags to control handling of wakeup
--events (hardware signals that can force the device and/or system out of a low
--power state). These flags are initialized by bus or device driver code using
-+All device objects in the driver model contain fields that control the handling
-+of system wakeup events (hardware signals that can force the system out of a
-+sleep state). These fields are initialized by bus or device driver code using
- device_set_wakeup_capable() and device_set_wakeup_enable(), defined in
- include/linux/pm_wakeup.h.
-
--The "can_wakeup" flag just records whether the device (and its driver) can
-+The "power.can_wakeup" flag just records whether the device (and its driver) can
- physically support wakeup events. The device_set_wakeup_capable() routine
--affects this flag. The "should_wakeup" flag controls whether the device should
--try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag;
--for the most part drivers should not change its value. The initial value of
--should_wakeup is supposed to be false for the majority of devices; the major
--exceptions are power buttons, keyboards, and Ethernet adapters whose WoL
--(wake-on-LAN) feature has been set up with ethtool. It should also default
--to true for devices that don't generate wakeup requests on their own but merely
--forward wakeup requests from one bus to another (like PCI bridges).
-+affects this flag. The "power.wakeup" field is a pointer to an object of type
-+struct wakeup_source used for controlling whether or not the device should use
-+its system wakeup mechanism and for notifying the PM core of system wakeup
-+events signaled by the device. This object is only present for wakeup-capable
-+devices (i.e. devices whose "can_wakeup" flags are set) and is created (or
-+removed) by device_set_wakeup_capable().
-
- Whether or not a device is capable of issuing wakeup events is a hardware
- matter, and the kernel is responsible for keeping track of it. By contrast,
- whether or not a wakeup-capable device should issue wakeup events is a policy
- decision, and it is managed by user space through a sysfs attribute: the
--power/wakeup file. User space can write the strings "enabled" or "disabled" to
--set or clear the "should_wakeup" flag, respectively. This file is only present
--for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set)
--and is created (or removed) by device_set_wakeup_capable(). Reads from the
--file will return the corresponding string.
--
--The device_may_wakeup() routine returns true only if both flags are set.
-+"power/wakeup" file. User space can write the strings "enabled" or "disabled"
-+to it to indicate whether or not, respectively, the device is supposed to signal
-+system wakeup. This file is only present if the "power.wakeup" object exists
-+for the given device and is created (or removed) along with that object, by
-+device_set_wakeup_capable(). Reads from the file will return the corresponding
-+string.
-+
-+The "power/wakeup" file is supposed to contain the "disabled" string initially
-+for the majority of devices; the major exceptions are power buttons, keyboards,
-+and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with
-+ethtool. It should also default to "enabled" for devices that don't generate
-+wakeup requests on their own but merely forward wakeup requests from one bus to
-+another (like PCI Express ports).
-+
-+The device_may_wakeup() routine returns true only if the "power.wakeup" object
-+exists and the corresponding "power/wakeup" file contains the string "enabled".
- This information is used by subsystems, like the PCI bus type code, to see
- whether or not to enable the devices' wakeup mechanisms. If device wakeup
- mechanisms are enabled or disabled directly by drivers, they also should use
- device_may_wakeup() to decide what to do during a system sleep transition.
--However for runtime power management, wakeup events should be enabled whenever
--the device and driver both support them, regardless of the should_wakeup flag.
--
-+Device drivers, however, are not supposed to call device_set_wakeup_enable()
-+directly in any case.
-+
-+It ought to be noted that system wakeup is conceptually different from "remote
-+wakeup" used by runtime power management, although it may be supported by the
-+same physical mechanism. Remote wakeup is a feature allowing devices in
-+low-power states to trigger specific interrupts to signal conditions in which
-+they should be put into the full-power state. Those interrupts may or may not
-+be used to signal system wakeup events, depending on the hardware design. On
-+some systems it is impossible to trigger them from system sleep states. In any
-+case, remote wakeup should always be enabled for runtime power management for
-+all devices and drivers that support it.
-
- /sys/devices/.../power/control files
- ------------------------------------
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0136-PM-Update-comments-describing-device-power-managemen.patch b/patches.runtime_pm/0136-PM-Update-comments-describing-device-power-managemen.patch
deleted file mode 100644
index 73cf2e740f605e..00000000000000
--- a/patches.runtime_pm/0136-PM-Update-comments-describing-device-power-managemen.patch
+++ /dev/null
@@ -1,309 +0,0 @@
-From 33f88463457fc9f37691c1425c34a9481c61dc85 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 23 Nov 2011 21:20:32 +0100
-Subject: PM: Update comments describing device power management callbacks
-
-The comments describing device power management callbacks in
-include/pm.h are outdated and somewhat confusing, so make them
-reflect the reality more accurately.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f7bc83d87d242917ca0ee041ed509f57f361dd56)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm.h | 229 ++++++++++++++++++++++++++++++----------------------
- 1 file changed, 134 insertions(+), 95 deletions(-)
-
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 5c4c8b1..3f3ed83 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -54,118 +54,145 @@ typedef struct pm_message {
- /**
- * struct dev_pm_ops - device PM callbacks
- *
-- * Several driver power state transitions are externally visible, affecting
-+ * Several device power state transitions are externally visible, affecting
- * the state of pending I/O queues and (for drivers that touch hardware)
- * interrupts, wakeups, DMA, and other hardware state. There may also be
-- * internal transitions to various low power modes, which are transparent
-+ * internal transitions to various low-power modes which are transparent
- * to the rest of the driver stack (such as a driver that's ON gating off
- * clocks which are not in active use).
- *
-- * The externally visible transitions are handled with the help of the following
-- * callbacks included in this structure:
-- *
-- * @prepare: Prepare the device for the upcoming transition, but do NOT change
-- * its hardware state. Prevent new children of the device from being
-- * registered after @prepare() returns (the driver's subsystem and
-- * generally the rest of the kernel is supposed to prevent new calls to the
-- * probe method from being made too once @prepare() has succeeded). If
-- * @prepare() detects a situation it cannot handle (e.g. registration of a
-- * child already in progress), it may return -EAGAIN, so that the PM core
-- * can execute it once again (e.g. after the new child has been registered)
-- * to recover from the race condition. This method is executed for all
-- * kinds of suspend transitions and is followed by one of the suspend
-- * callbacks: @suspend(), @freeze(), or @poweroff().
-- * The PM core executes @prepare() for all devices before starting to
-- * execute suspend callbacks for any of them, so drivers may assume all of
-- * the other devices to be present and functional while @prepare() is being
-- * executed. In particular, it is safe to make GFP_KERNEL memory
-- * allocations from within @prepare(). However, drivers may NOT assume
-- * anything about the availability of the user space at that time and it
-- * is not correct to request firmware from within @prepare() (it's too
-- * late to do that). [To work around this limitation, drivers may
-- * register suspend and hibernation notifiers that are executed before the
-- * freezing of tasks.]
-+ * The externally visible transitions are handled with the help of callbacks
-+ * included in this structure in such a way that two levels of callbacks are
-+ * involved. First, the PM core executes callbacks provided by PM domains,
-+ * device types, classes and bus types. They are the subsystem-level callbacks
-+ * supposed to execute callbacks provided by device drivers, although they may
-+ * choose not to do that. If the driver callbacks are executed, they have to
-+ * collaborate with the subsystem-level callbacks to achieve the goals
-+ * appropriate for the given system transition, given transition phase and the
-+ * subsystem the device belongs to.
-+ *
-+ * @prepare: The principal role of this callback is to prevent new children of
-+ * the device from being registered after it has returned (the driver's
-+ * subsystem and generally the rest of the kernel is supposed to prevent
-+ * new calls to the probe method from being made too once @prepare() has
-+ * succeeded). If @prepare() detects a situation it cannot handle (e.g.
-+ * registration of a child already in progress), it may return -EAGAIN, so
-+ * that the PM core can execute it once again (e.g. after a new child has
-+ * been registered) to recover from the race condition.
-+ * This method is executed for all kinds of suspend transitions and is
-+ * followed by one of the suspend callbacks: @suspend(), @freeze(), or
-+ * @poweroff(). The PM core executes subsystem-level @prepare() for all
-+ * devices before starting to invoke suspend callbacks for any of them, so
-+ * generally devices may be assumed to be functional or to respond to
-+ * runtime resume requests while @prepare() is being executed. However,
-+ * device drivers may NOT assume anything about the availability of user
-+ * space at that time and it is NOT valid to request firmware from within
-+ * @prepare() (it's too late to do that). It also is NOT valid to allocate
-+ * substantial amounts of memory from @prepare() in the GFP_KERNEL mode.
-+ * [To work around these limitations, drivers may register suspend and
-+ * hibernation notifiers to be executed before the freezing of tasks.]
- *
- * @complete: Undo the changes made by @prepare(). This method is executed for
- * all kinds of resume transitions, following one of the resume callbacks:
- * @resume(), @thaw(), @restore(). Also called if the state transition
-- * fails before the driver's suspend callback (@suspend(), @freeze(),
-- * @poweroff()) can be executed (e.g. if the suspend callback fails for one
-+ * fails before the driver's suspend callback: @suspend(), @freeze() or
-+ * @poweroff(), can be executed (e.g. if the suspend callback fails for one
- * of the other devices that the PM core has unsuccessfully attempted to
- * suspend earlier).
-- * The PM core executes @complete() after it has executed the appropriate
-- * resume callback for all devices.
-+ * The PM core executes subsystem-level @complete() after it has executed
-+ * the appropriate resume callbacks for all devices.
- *
- * @suspend: Executed before putting the system into a sleep state in which the
-- * contents of main memory are preserved. Quiesce the device, put it into
-- * a low power state appropriate for the upcoming system state (such as
-- * PCI_D3hot), and enable wakeup events as appropriate.
-+ * contents of main memory are preserved. The exact action to perform
-+ * depends on the device's subsystem (PM domain, device type, class or bus
-+ * type), but generally the device must be quiescent after subsystem-level
-+ * @suspend() has returned, so that it doesn't do any I/O or DMA.
-+ * Subsystem-level @suspend() is executed for all devices after invoking
-+ * subsystem-level @prepare() for all of them.
- *
- * @resume: Executed after waking the system up from a sleep state in which the
-- * contents of main memory were preserved. Put the device into the
-- * appropriate state, according to the information saved in memory by the
-- * preceding @suspend(). The driver starts working again, responding to
-- * hardware events and software requests. The hardware may have gone
-- * through a power-off reset, or it may have maintained state from the
-- * previous suspend() which the driver may rely on while resuming. On most
-- * platforms, there are no restrictions on availability of resources like
-- * clocks during @resume().
-+ * contents of main memory were preserved. The exact action to perform
-+ * depends on the device's subsystem, but generally the driver is expected
-+ * to start working again, responding to hardware events and software
-+ * requests (the device itself may be left in a low-power state, waiting
-+ * for a runtime resume to occur). The state of the device at the time its
-+ * driver's @resume() callback is run depends on the platform and subsystem
-+ * the device belongs to. On most platforms, there are no restrictions on
-+ * availability of resources like clocks during @resume().
-+ * Subsystem-level @resume() is executed for all devices after invoking
-+ * subsystem-level @resume_noirq() for all of them.
- *
- * @freeze: Hibernation-specific, executed before creating a hibernation image.
-- * Quiesce operations so that a consistent image can be created, but do NOT
-- * otherwise put the device into a low power device state and do NOT emit
-- * system wakeup events. Save in main memory the device settings to be
-- * used by @restore() during the subsequent resume from hibernation or by
-- * the subsequent @thaw(), if the creation of the image or the restoration
-- * of main memory contents from it fails.
-+ * Analogous to @suspend(), but it should not enable the device to signal
-+ * wakeup events or change its power state. The majority of subsystems
-+ * (with the notable exception of the PCI bus type) expect the driver-level
-+ * @freeze() to save the device settings in memory to be used by @restore()
-+ * during the subsequent resume from hibernation.
-+ * Subsystem-level @freeze() is executed for all devices after invoking
-+ * subsystem-level @prepare() for all of them.
- *
- * @thaw: Hibernation-specific, executed after creating a hibernation image OR
-- * if the creation of the image fails. Also executed after a failing
-+ * if the creation of an image has failed. Also executed after a failing
- * attempt to restore the contents of main memory from such an image.
- * Undo the changes made by the preceding @freeze(), so the device can be
- * operated in the same way as immediately before the call to @freeze().
-+ * Subsystem-level @thaw() is executed for all devices after invoking
-+ * subsystem-level @thaw_noirq() for all of them. It also may be executed
-+ * directly after @freeze() in case of a transition error.
- *
- * @poweroff: Hibernation-specific, executed after saving a hibernation image.
-- * Quiesce the device, put it into a low power state appropriate for the
-- * upcoming system state (such as PCI_D3hot), and enable wakeup events as
-- * appropriate.
-+ * Analogous to @suspend(), but it need not save the device's settings in
-+ * memory.
-+ * Subsystem-level @poweroff() is executed for all devices after invoking
-+ * subsystem-level @prepare() for all of them.
- *
- * @restore: Hibernation-specific, executed after restoring the contents of main
-- * memory from a hibernation image. Driver starts working again,
-- * responding to hardware events and software requests. Drivers may NOT
-- * make ANY assumptions about the hardware state right prior to @restore().
-- * On most platforms, there are no restrictions on availability of
-- * resources like clocks during @restore().
-- *
-- * @suspend_noirq: Complete the operations of ->suspend() by carrying out any
-- * actions required for suspending the device that need interrupts to be
-- * disabled
-- *
-- * @resume_noirq: Prepare for the execution of ->resume() by carrying out any
-- * actions required for resuming the device that need interrupts to be
-- * disabled
-- *
-- * @freeze_noirq: Complete the operations of ->freeze() by carrying out any
-- * actions required for freezing the device that need interrupts to be
-- * disabled
-- *
-- * @thaw_noirq: Prepare for the execution of ->thaw() by carrying out any
-- * actions required for thawing the device that need interrupts to be
-- * disabled
-- *
-- * @poweroff_noirq: Complete the operations of ->poweroff() by carrying out any
-- * actions required for handling the device that need interrupts to be
-- * disabled
-- *
-- * @restore_noirq: Prepare for the execution of ->restore() by carrying out any
-- * actions required for restoring the operations of the device that need
-- * interrupts to be disabled
-+ * memory from a hibernation image, analogous to @resume().
-+ *
-+ * @suspend_noirq: Complete the actions started by @suspend(). Carry out any
-+ * additional operations required for suspending the device that might be
-+ * racing with its driver's interrupt handler, which is guaranteed not to
-+ * run while @suspend_noirq() is being executed.
-+ * It generally is expected that the device will be in a low-power state
-+ * (appropriate for the target system sleep state) after subsystem-level
-+ * @suspend_noirq() has returned successfully. If the device can generate
-+ * system wakeup signals and is enabled to wake up the system, it should be
-+ * configured to do so at that time. However, depending on the platform
-+ * and device's subsystem, @suspend() may be allowed to put the device into
-+ * the low-power state and configure it to generate wakeup signals, in
-+ * which case it generally is not necessary to define @suspend_noirq().
-+ *
-+ * @resume_noirq: Prepare for the execution of @resume() by carrying out any
-+ * operations required for resuming the device that might be racing with
-+ * its driver's interrupt handler, which is guaranteed not to run while
-+ * @resume_noirq() is being executed.
-+ *
-+ * @freeze_noirq: Complete the actions started by @freeze(). Carry out any
-+ * additional operations required for freezing the device that might be
-+ * racing with its driver's interrupt handler, which is guaranteed not to
-+ * run while @freeze_noirq() is being executed.
-+ * The power state of the device should not be changed by either @freeze()
-+ * or @freeze_noirq() and it should not be configured to signal system
-+ * wakeup by any of these callbacks.
-+ *
-+ * @thaw_noirq: Prepare for the execution of @thaw() by carrying out any
-+ * operations required for thawing the device that might be racing with its
-+ * driver's interrupt handler, which is guaranteed not to run while
-+ * @thaw_noirq() is being executed.
-+ *
-+ * @poweroff_noirq: Complete the actions started by @poweroff(). Analogous to
-+ * @suspend_noirq(), but it need not save the device's settings in memory.
-+ *
-+ * @restore_noirq: Prepare for the execution of @restore() by carrying out any
-+ * operations required for thawing the device that might be racing with its
-+ * driver's interrupt handler, which is guaranteed not to run while
-+ * @restore_noirq() is being executed. Analogous to @resume_noirq().
- *
- * All of the above callbacks, except for @complete(), return error codes.
- * However, the error codes returned by the resume operations, @resume(),
-- * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq() do
-+ * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq(), do
- * not cause the PM core to abort the resume transition during which they are
-- * returned. The error codes returned in that cases are only printed by the PM
-+ * returned. The error codes returned in those cases are only printed by the PM
- * core to the system logs for debugging purposes. Still, it is recommended
- * that drivers only return error codes from their resume methods in case of an
- * unrecoverable failure (i.e. when the device being handled refuses to resume
-@@ -174,31 +201,43 @@ typedef struct pm_message {
- * their children.
- *
- * It is allowed to unregister devices while the above callbacks are being
-- * executed. However, it is not allowed to unregister a device from within any
-- * of its own callbacks.
-+ * executed. However, a callback routine must NOT try to unregister the device
-+ * it was called for, although it may unregister children of that device (for
-+ * example, if it detects that a child was unplugged while the system was
-+ * asleep).
-+ *
-+ * Refer to Documentation/power/devices.txt for more information about the role
-+ * of the above callbacks in the system suspend process.
- *
-- * There also are the following callbacks related to run-time power management
-- * of devices:
-+ * There also are callbacks related to runtime power management of devices.
-+ * Again, these callbacks are executed by the PM core only for subsystems
-+ * (PM domains, device types, classes and bus types) and the subsystem-level
-+ * callbacks are supposed to invoke the driver callbacks. Moreover, the exact
-+ * actions to be performed by a device driver's callbacks generally depend on
-+ * the platform and subsystem the device belongs to.
- *
- * @runtime_suspend: Prepare the device for a condition in which it won't be
- * able to communicate with the CPU(s) and RAM due to power management.
-- * This need not mean that the device should be put into a low power state.
-+ * This need not mean that the device should be put into a low-power state.
- * For example, if the device is behind a link which is about to be turned
- * off, the device may remain at full power. If the device does go to low
-- * power and is capable of generating run-time wake-up events, remote
-- * wake-up (i.e., a hardware mechanism allowing the device to request a
-- * change of its power state via a wake-up event, such as PCI PME) should
-- * be enabled for it.
-+ * power and is capable of generating runtime wakeup events, remote wakeup
-+ * (i.e., a hardware mechanism allowing the device to request a change of
-+ * its power state via an interrupt) should be enabled for it.
- *
- * @runtime_resume: Put the device into the fully active state in response to a
-- * wake-up event generated by hardware or at the request of software. If
-- * necessary, put the device into the full power state and restore its
-+ * wakeup event generated by hardware or at the request of software. If
-+ * necessary, put the device into the full-power state and restore its
- * registers, so that it is fully operational.
- *
-- * @runtime_idle: Device appears to be inactive and it might be put into a low
-- * power state if all of the necessary conditions are satisfied. Check
-+ * @runtime_idle: Device appears to be inactive and it might be put into a
-+ * low-power state if all of the necessary conditions are satisfied. Check
- * these conditions and handle the device as appropriate, possibly queueing
- * a suspend request for it. The return value is ignored by the PM core.
-+ *
-+ * Refer to Documentation/power/runtime_pm.txt for more information about the
-+ * role of the above callbacks in device runtime power management.
-+ *
- */
-
- struct dev_pm_ops {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0137-PM-Runtime-Use-device-PM-QoS-constraints-v2.patch b/patches.runtime_pm/0137-PM-Runtime-Use-device-PM-QoS-constraints-v2.patch
deleted file mode 100644
index 7eed598e5a8a03..00000000000000
--- a/patches.runtime_pm/0137-PM-Runtime-Use-device-PM-QoS-constraints-v2.patch
+++ /dev/null
@@ -1,353 +0,0 @@
-From ad08f99f086365289d67e35570f7a078ccbc96c9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 1 Dec 2011 00:01:31 +0100
-Subject: PM / Runtime: Use device PM QoS constraints (v2)
-
-Make the runtime PM core use device PM QoS constraints to check if
-it is allowed to suspend a given device, so that an error code is
-returned if the device's own PM QoS constraint is negative or one of
-its children has already been suspended for too long. If this is
-not the case, the maximum estimated time the device is allowed to be
-suspended, computed as the minimum of the device's PM QoS constraint
-and the PM QoS constraints of its children (reduced by the difference
-between the current time and their suspend times) is stored in a new
-device's PM field power.max_time_suspended_ns that can be used by
-the device's subsystem or PM domain to decide whether or not to put
-the device into lower-power (and presumably higher-latency) states
-later (if the constraint is 0, which means "no constraint", the
-power.max_time_suspended_ns is set to -1).
-
-Additionally, the time of execution of the subsystem-level
-.runtime_suspend() callback for the device is recorded in the new
-power.suspend_time field for later use by the device's subsystem or
-PM domain along with power.max_time_suspended_ns (it also is used
-by the core code when the device's parent is suspended).
-
-Introduce a new helper function,
-pm_runtime_update_max_time_suspended(), allowing subsystems and PM
-domains (or device drivers) to update the power.max_time_suspended_ns
-field, for example after changing the power state of a suspended
-device.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 00dc9ad18d707f36b2fb4af98fd2cf0548d2b258)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/qos.c | 24 ++++---
- drivers/base/power/runtime.c | 148 ++++++++++++++++++++++++++++++++++++------
- include/linux/pm.h | 2 +
- include/linux/pm_qos.h | 3 +
- include/linux/pm_runtime.h | 5 ++
- 5 files changed, 154 insertions(+), 28 deletions(-)
-
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index 86de6c5..03f4bd0 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -47,21 +47,29 @@ static DEFINE_MUTEX(dev_pm_qos_mtx);
- static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
-
- /**
-- * dev_pm_qos_read_value - Get PM QoS constraint for a given device.
-+ * __dev_pm_qos_read_value - Get PM QoS constraint for a given device.
-+ * @dev: Device to get the PM QoS constraint value for.
-+ *
-+ * This routine must be called with dev->power.lock held.
-+ */
-+s32 __dev_pm_qos_read_value(struct device *dev)
-+{
-+ struct pm_qos_constraints *c = dev->power.constraints;
-+
-+ return c ? pm_qos_read_value(c) : 0;
-+}
-+
-+/**
-+ * dev_pm_qos_read_value - Get PM QoS constraint for a given device (locked).
- * @dev: Device to get the PM QoS constraint value for.
- */
- s32 dev_pm_qos_read_value(struct device *dev)
- {
-- struct pm_qos_constraints *c;
- unsigned long flags;
-- s32 ret = 0;
-+ s32 ret;
-
- spin_lock_irqsave(&dev->power.lock, flags);
--
-- c = dev->power.constraints;
-- if (c)
-- ret = pm_qos_read_value(c);
--
-+ ret = __dev_pm_qos_read_value(dev);
- spin_unlock_irqrestore(&dev->power.lock, flags);
-
- return ret;
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 8c78443..068f7ed 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -279,6 +279,47 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
- return retval != -EACCES ? retval : -EIO;
- }
-
-+struct rpm_qos_data {
-+ ktime_t time_now;
-+ s64 constraint_ns;
-+};
-+
-+/**
-+ * rpm_update_qos_constraint - Update a given PM QoS constraint data.
-+ * @dev: Device whose timing data to use.
-+ * @data: PM QoS constraint data to update.
-+ *
-+ * Use the suspend timing data of @dev to update PM QoS constraint data pointed
-+ * to by @data.
-+ */
-+static int rpm_update_qos_constraint(struct device *dev, void *data)
-+{
-+ struct rpm_qos_data *qos = data;
-+ unsigned long flags;
-+ s64 delta_ns;
-+ int ret = 0;
-+
-+ spin_lock_irqsave(&dev->power.lock, flags);
-+
-+ if (dev->power.max_time_suspended_ns < 0)
-+ goto out;
-+
-+ delta_ns = dev->power.max_time_suspended_ns -
-+ ktime_to_ns(ktime_sub(qos->time_now, dev->power.suspend_time));
-+ if (delta_ns <= 0) {
-+ ret = -EBUSY;
-+ goto out;
-+ }
-+
-+ if (qos->constraint_ns > delta_ns || qos->constraint_ns == 0)
-+ qos->constraint_ns = delta_ns;
-+
-+ out:
-+ spin_unlock_irqrestore(&dev->power.lock, flags);
-+
-+ return ret;
-+}
-+
- /**
- * rpm_suspend - Carry out runtime suspend of given device.
- * @dev: Device to suspend.
-@@ -305,6 +346,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- {
- int (*callback)(struct device *);
- struct device *parent = NULL;
-+ struct rpm_qos_data qos;
- int retval;
-
- trace_rpm_suspend(dev, rpmflags);
-@@ -400,8 +442,38 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- goto out;
- }
-
-+ qos.constraint_ns = __dev_pm_qos_read_value(dev);
-+ if (qos.constraint_ns < 0) {
-+ /* Negative constraint means "never suspend". */
-+ retval = -EPERM;
-+ goto out;
-+ }
-+ qos.constraint_ns *= NSEC_PER_USEC;
-+ qos.time_now = ktime_get();
-+
- __update_runtime_status(dev, RPM_SUSPENDING);
-
-+ if (!dev->power.ignore_children) {
-+ if (dev->power.irq_safe)
-+ spin_unlock(&dev->power.lock);
-+ else
-+ spin_unlock_irq(&dev->power.lock);
-+
-+ retval = device_for_each_child(dev, &qos,
-+ rpm_update_qos_constraint);
-+
-+ if (dev->power.irq_safe)
-+ spin_lock(&dev->power.lock);
-+ else
-+ spin_lock_irq(&dev->power.lock);
-+
-+ if (retval)
-+ goto fail;
-+ }
-+
-+ dev->power.suspend_time = qos.time_now;
-+ dev->power.max_time_suspended_ns = qos.constraint_ns ? : -1;
-+
- if (dev->pm_domain)
- callback = dev->pm_domain->ops.runtime_suspend;
- else if (dev->type && dev->type->pm)
-@@ -414,27 +486,9 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- callback = NULL;
-
- retval = rpm_callback(callback, dev);
-- if (retval) {
-- __update_runtime_status(dev, RPM_ACTIVE);
-- dev->power.deferred_resume = false;
-- if (retval == -EAGAIN || retval == -EBUSY) {
-- dev->power.runtime_error = 0;
-+ if (retval)
-+ goto fail;
-
-- /*
-- * If the callback routine failed an autosuspend, and
-- * if the last_busy time has been updated so that there
-- * is a new autosuspend expiration time, automatically
-- * reschedule another autosuspend.
-- */
-- if ((rpmflags & RPM_AUTO) &&
-- pm_runtime_autosuspend_expiration(dev) != 0)
-- goto repeat;
-- } else {
-- pm_runtime_cancel_pending(dev);
-- }
-- wake_up_all(&dev->power.wait_queue);
-- goto out;
-- }
- no_callback:
- __update_runtime_status(dev, RPM_SUSPENDED);
- pm_runtime_deactivate_timer(dev);
-@@ -466,6 +520,29 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- trace_rpm_return_int(dev, _THIS_IP_, retval);
-
- return retval;
-+
-+ fail:
-+ __update_runtime_status(dev, RPM_ACTIVE);
-+ dev->power.suspend_time = ktime_set(0, 0);
-+ dev->power.max_time_suspended_ns = -1;
-+ dev->power.deferred_resume = false;
-+ if (retval == -EAGAIN || retval == -EBUSY) {
-+ dev->power.runtime_error = 0;
-+
-+ /*
-+ * If the callback routine failed an autosuspend, and
-+ * if the last_busy time has been updated so that there
-+ * is a new autosuspend expiration time, automatically
-+ * reschedule another autosuspend.
-+ */
-+ if ((rpmflags & RPM_AUTO) &&
-+ pm_runtime_autosuspend_expiration(dev) != 0)
-+ goto repeat;
-+ } else {
-+ pm_runtime_cancel_pending(dev);
-+ }
-+ wake_up_all(&dev->power.wait_queue);
-+ goto out;
- }
-
- /**
-@@ -620,6 +697,9 @@ static int rpm_resume(struct device *dev, int rpmflags)
- if (dev->power.no_callbacks)
- goto no_callback; /* Assume success. */
-
-+ dev->power.suspend_time = ktime_set(0, 0);
-+ dev->power.max_time_suspended_ns = -1;
-+
- __update_runtime_status(dev, RPM_RESUMING);
-
- if (dev->pm_domain)
-@@ -1279,6 +1359,9 @@ void pm_runtime_init(struct device *dev)
- setup_timer(&dev->power.suspend_timer, pm_suspend_timer_fn,
- (unsigned long)dev);
-
-+ dev->power.suspend_time = ktime_set(0, 0);
-+ dev->power.max_time_suspended_ns = -1;
-+
- init_waitqueue_head(&dev->power.wait_queue);
- }
-
-@@ -1296,3 +1379,28 @@ void pm_runtime_remove(struct device *dev)
- if (dev->power.irq_safe && dev->parent)
- pm_runtime_put_sync(dev->parent);
- }
-+
-+/**
-+ * pm_runtime_update_max_time_suspended - Update device's suspend time data.
-+ * @dev: Device to handle.
-+ * @delta_ns: Value to subtract from the device's max_time_suspended_ns field.
-+ *
-+ * Update the device's power.max_time_suspended_ns field by subtracting
-+ * @delta_ns from it. The resulting value of power.max_time_suspended_ns is
-+ * never negative.
-+ */
-+void pm_runtime_update_max_time_suspended(struct device *dev, s64 delta_ns)
-+{
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&dev->power.lock, flags);
-+
-+ if (delta_ns > 0 && dev->power.max_time_suspended_ns > 0) {
-+ if (dev->power.max_time_suspended_ns > delta_ns)
-+ dev->power.max_time_suspended_ns -= delta_ns;
-+ else
-+ dev->power.max_time_suspended_ns = 0;
-+ }
-+
-+ spin_unlock_irqrestore(&dev->power.lock, flags);
-+}
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 3f3ed83..a7676ef 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -521,6 +521,8 @@ struct dev_pm_info {
- unsigned long active_jiffies;
- unsigned long suspended_jiffies;
- unsigned long accounting_timestamp;
-+ ktime_t suspend_time;
-+ s64 max_time_suspended_ns;
- #endif
- struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
- struct pm_qos_constraints *constraints;
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 83b0ea3..775a323 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -78,6 +78,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
- s32 pm_qos_read_value(struct pm_qos_constraints *c);
-
-+s32 __dev_pm_qos_read_value(struct device *dev);
- s32 dev_pm_qos_read_value(struct device *dev);
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
- s32 value);
-@@ -119,6 +120,8 @@ static inline int pm_qos_request_active(struct pm_qos_request *req)
- static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
- { return 0; }
-
-+static inline s32 __dev_pm_qos_read_value(struct device *dev)
-+ { return 0; }
- static inline s32 dev_pm_qos_read_value(struct device *dev)
- { return 0; }
- static inline int dev_pm_qos_add_request(struct device *dev,
-diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index d3085e7..609daae 100644
---- a/include/linux/pm_runtime.h
-+++ b/include/linux/pm_runtime.h
-@@ -45,6 +45,8 @@ extern void pm_runtime_irq_safe(struct device *dev);
- extern void __pm_runtime_use_autosuspend(struct device *dev, bool use);
- extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
- extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
-+extern void pm_runtime_update_max_time_suspended(struct device *dev,
-+ s64 delta_ns);
-
- static inline bool pm_children_suspended(struct device *dev)
- {
-@@ -148,6 +150,9 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
- static inline unsigned long pm_runtime_autosuspend_expiration(
- struct device *dev) { return 0; }
-
-+static inline void pm_runtime_update_max_time_suspended(struct device *dev,
-+ s64 delta_ns) {}
-+
- #endif /* !CONFIG_PM_RUNTIME */
-
- static inline int pm_runtime_idle(struct device *dev)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0138-PM-Domains-Make-it-possible-to-use-per-device-domain.patch b/patches.runtime_pm/0138-PM-Domains-Make-it-possible-to-use-per-device-domain.patch
deleted file mode 100644
index b69e647754819d..00000000000000
--- a/patches.runtime_pm/0138-PM-Domains-Make-it-possible-to-use-per-device-domain.patch
+++ /dev/null
@@ -1,390 +0,0 @@
-From 522b7f7f33abce468e7f6395bed696d60f0b830b Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 27 Nov 2011 13:11:36 +0100
-Subject: PM / Domains: Make it possible to use per-device domain callbacks
-
-The current generic PM domains code requires that the same .stop(),
-.start() and .active_wakeup() device callback routines be used for
-all devices in the given domain, which is inflexible and may not
-cover some specific use cases. For this reason, make it possible to
-use device specific .start()/.stop() and .active_wakeup() callback
-routines by adding corresponding callback pointers to struct
-generic_pm_domain_data. Add a new helper routine,
-pm_genpd_register_callbacks(), that can be used to populate
-the new per-device callback pointers.
-
-Modify the shmobile's power domains code to allow drivers to add
-their own code to be run during the device stop and start operations
-with the help of the new callback pointers.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit d5e4cbfe2049fca375cb19c4bc0cf676e8b4a88a)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 152 ++++++++++++++++++++++++++++++++-----------
- include/linux/pm_domain.h | 27 +++++++-
- 2 files changed, 139 insertions(+), 40 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 6790cf7..94afaa2 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -15,6 +15,23 @@
- #include <linux/err.h>
- #include <linux/sched.h>
- #include <linux/suspend.h>
-+#include <linux/export.h>
-+
-+#define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \
-+({ \
-+ type (*__routine)(struct device *__d); \
-+ type __ret = (type)0; \
-+ \
-+ __routine = genpd->dev_ops.callback; \
-+ if (__routine) { \
-+ __ret = __routine(dev); \
-+ } else { \
-+ __routine = dev_gpd_data(dev)->ops.callback; \
-+ if (__routine) \
-+ __ret = __routine(dev); \
-+ } \
-+ __ret; \
-+})
-
- static LIST_HEAD(gpd_list);
- static DEFINE_MUTEX(gpd_list_lock);
-@@ -29,6 +46,16 @@ static struct generic_pm_domain *dev_to_genpd(struct device *dev)
- return pd_to_genpd(dev->pm_domain);
- }
-
-+static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, stop, dev);
-+}
-+
-+static int genpd_start_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, start, dev);
-+}
-+
- static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- {
- bool ret = false;
-@@ -199,13 +226,9 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
- mutex_unlock(&genpd->lock);
-
- if (drv && drv->pm && drv->pm->runtime_suspend) {
-- if (genpd->start_device)
-- genpd->start_device(dev);
--
-+ genpd_start_dev(genpd, dev);
- ret = drv->pm->runtime_suspend(dev);
--
-- if (genpd->stop_device)
-- genpd->stop_device(dev);
-+ genpd_stop_dev(genpd, dev);
- }
-
- mutex_lock(&genpd->lock);
-@@ -235,13 +258,9 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
- mutex_unlock(&genpd->lock);
-
- if (drv && drv->pm && drv->pm->runtime_resume) {
-- if (genpd->start_device)
-- genpd->start_device(dev);
--
-+ genpd_start_dev(genpd, dev);
- drv->pm->runtime_resume(dev);
--
-- if (genpd->stop_device)
-- genpd->stop_device(dev);
-+ genpd_stop_dev(genpd, dev);
- }
-
- mutex_lock(&genpd->lock);
-@@ -413,6 +432,7 @@ static void genpd_power_off_work_fn(struct work_struct *work)
- static int pm_genpd_runtime_suspend(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-+ int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -422,11 +442,9 @@ static int pm_genpd_runtime_suspend(struct device *dev)
-
- might_sleep_if(!genpd->dev_irq_safe);
-
-- if (genpd->stop_device) {
-- int ret = genpd->stop_device(dev);
-- if (ret)
-- return ret;
-- }
-+ ret = genpd_stop_dev(genpd, dev);
-+ if (ret)
-+ return ret;
-
- /*
- * If power.irq_safe is set, this routine will be run with interrupts
-@@ -502,8 +520,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
- mutex_unlock(&genpd->lock);
-
- out:
-- if (genpd->start_device)
-- genpd->start_device(dev);
-+ genpd_start_dev(genpd, dev);
-
- return 0;
- }
-@@ -534,6 +551,12 @@ static inline void genpd_power_off_work_fn(struct work_struct *work) {}
-
- #ifdef CONFIG_PM_SLEEP
-
-+static bool genpd_dev_active_wakeup(struct generic_pm_domain *genpd,
-+ struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev);
-+}
-+
- /**
- * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
- * @genpd: PM domain to power off, if possible.
-@@ -590,7 +613,7 @@ static bool resume_needed(struct device *dev, struct generic_pm_domain *genpd)
- if (!device_can_wakeup(dev))
- return false;
-
-- active_wakeup = genpd->active_wakeup && genpd->active_wakeup(dev);
-+ active_wakeup = genpd_dev_active_wakeup(genpd, dev);
- return device_may_wakeup(dev) ? active_wakeup : !active_wakeup;
- }
-
-@@ -646,7 +669,7 @@ static int pm_genpd_prepare(struct device *dev)
- /*
- * The PM domain must be in the GPD_STATE_ACTIVE state at this point,
- * so pm_genpd_poweron() will return immediately, but if the device
-- * is suspended (e.g. it's been stopped by .stop_device()), we need
-+ * is suspended (e.g. it's been stopped by genpd_stop_dev()), we need
- * to make it operational.
- */
- pm_runtime_resume(dev);
-@@ -714,12 +737,10 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (ret)
- return ret;
-
-- if (dev->power.wakeup_path
-- && genpd->active_wakeup && genpd->active_wakeup(dev))
-+ if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
- return 0;
-
-- if (genpd->stop_device)
-- genpd->stop_device(dev);
-+ genpd_stop_dev(genpd, dev);
-
- /*
- * Since all of the "noirq" callbacks are executed sequentially, it is
-@@ -761,8 +782,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
- */
- pm_genpd_poweron(genpd);
- genpd->suspended_count--;
-- if (genpd->start_device)
-- genpd->start_device(dev);
-+ genpd_start_dev(genpd, dev);
-
- return pm_generic_resume_noirq(dev);
- }
-@@ -836,8 +856,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
- if (ret)
- return ret;
-
-- if (genpd->stop_device)
-- genpd->stop_device(dev);
-+ genpd_stop_dev(genpd, dev);
-
- return 0;
- }
-@@ -864,8 +883,7 @@ static int pm_genpd_thaw_noirq(struct device *dev)
- if (genpd->suspend_power_off)
- return 0;
-
-- if (genpd->start_device)
-- genpd->start_device(dev);
-+ genpd_start_dev(genpd, dev);
-
- return pm_generic_thaw_noirq(dev);
- }
-@@ -938,12 +956,10 @@ static int pm_genpd_dev_poweroff_noirq(struct device *dev)
- if (ret)
- return ret;
-
-- if (dev->power.wakeup_path
-- && genpd->active_wakeup && genpd->active_wakeup(dev))
-+ if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
- return 0;
-
-- if (genpd->stop_device)
-- genpd->stop_device(dev);
-+ genpd_stop_dev(genpd, dev);
-
- /*
- * Since all of the "noirq" callbacks are executed sequentially, it is
-@@ -993,8 +1009,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
-
- pm_genpd_poweron(genpd);
- genpd->suspended_count--;
-- if (genpd->start_device)
-- genpd->start_device(dev);
-+ genpd_start_dev(genpd, dev);
-
- return pm_generic_restore_noirq(dev);
- }
-@@ -1280,6 +1295,69 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- }
-
- /**
-+ * pm_genpd_add_callbacks - Add PM domain callbacks to a given device.
-+ * @dev: Device to add the callbacks to.
-+ * @ops: Set of callbacks to add.
-+ */
-+int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops)
-+{
-+ struct pm_domain_data *pdd;
-+ int ret = 0;
-+
-+ if (!(dev && dev->power.subsys_data && ops))
-+ return -EINVAL;
-+
-+ pm_runtime_disable(dev);
-+ device_pm_lock();
-+
-+ pdd = dev->power.subsys_data->domain_data;
-+ if (pdd) {
-+ struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
-+
-+ gpd_data->ops = *ops;
-+ } else {
-+ ret = -EINVAL;
-+ }
-+
-+ device_pm_unlock();
-+ pm_runtime_enable(dev);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks);
-+
-+/**
-+ * pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
-+ * @dev: Device to remove the callbacks from.
-+ */
-+int pm_genpd_remove_callbacks(struct device *dev)
-+{
-+ struct pm_domain_data *pdd;
-+ int ret = 0;
-+
-+ if (!(dev && dev->power.subsys_data))
-+ return -EINVAL;
-+
-+ pm_runtime_disable(dev);
-+ device_pm_lock();
-+
-+ pdd = dev->power.subsys_data->domain_data;
-+ if (pdd) {
-+ struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
-+
-+ gpd_data->ops = (struct gpd_dev_ops){ 0 };
-+ } else {
-+ ret = -EINVAL;
-+ }
-+
-+ device_pm_unlock();
-+ pm_runtime_enable(dev);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(pm_genpd_remove_callbacks);
-+
-+/**
- * pm_genpd_init - Initialize a generic I/O PM domain object.
- * @genpd: PM domain object to initialize.
- * @gov: PM domain governor to associate with the domain (may be NULL).
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 65633e5..8949d2d 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -23,6 +23,12 @@ struct dev_power_governor {
- bool (*power_down_ok)(struct dev_pm_domain *domain);
- };
-
-+struct gpd_dev_ops {
-+ int (*start)(struct device *dev);
-+ int (*stop)(struct device *dev);
-+ bool (*active_wakeup)(struct device *dev);
-+};
-+
- struct generic_pm_domain {
- struct dev_pm_domain domain; /* PM domain operations */
- struct list_head gpd_list_node; /* Node in the global PM domains list */
-@@ -45,9 +51,7 @@ struct generic_pm_domain {
- bool dev_irq_safe; /* Device callbacks are IRQ-safe */
- int (*power_off)(struct generic_pm_domain *domain);
- int (*power_on)(struct generic_pm_domain *domain);
-- int (*start_device)(struct device *dev);
-- int (*stop_device)(struct device *dev);
-- bool (*active_wakeup)(struct device *dev);
-+ struct gpd_dev_ops dev_ops;
- };
-
- static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
-@@ -64,6 +68,7 @@ struct gpd_link {
-
- struct generic_pm_domain_data {
- struct pm_domain_data base;
-+ struct gpd_dev_ops ops;
- bool need_restore;
- };
-
-@@ -73,6 +78,11 @@ static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *
- }
-
- #ifdef CONFIG_PM_GENERIC_DOMAINS
-+static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
-+{
-+ return to_gpd_data(dev->power.subsys_data->domain_data);
-+}
-+
- extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev);
- extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
-@@ -81,6 +91,8 @@ extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *new_subdomain);
- extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *target);
-+extern int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops);
-+extern int pm_genpd_remove_callbacks(struct device *dev);
- extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
- extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
-@@ -105,6 +117,15 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- {
- return -ENOSYS;
- }
-+static inline int pm_genpd_add_callbacks(struct device *dev,
-+ struct gpd_dev_ops *ops)
-+{
-+ return -ENOSYS;
-+}
-+static inline int pm_genpd_remove_callbacks(struct device *dev)
-+{
-+ return -ENOSYS;
-+}
- static inline void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off) {}
- static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0139-PM-Domains-Introduce-save-restore-state-device-callb.patch b/patches.runtime_pm/0139-PM-Domains-Introduce-save-restore-state-device-callb.patch
deleted file mode 100644
index 2a67b0d2e5e17d..00000000000000
--- a/patches.runtime_pm/0139-PM-Domains-Introduce-save-restore-state-device-callb.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From 6dd0250b29345e51368d082c6bd993f917410029 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 27 Nov 2011 13:11:44 +0100
-Subject: PM / Domains: Introduce "save/restore state" device callbacks
-
-The current PM domains code uses device drivers' .runtime_suspend()
-and .runtime_resume() callbacks as the "save device state" and
-"restore device state" operations, which may not be appropriate in
-general, because it forces drivers to assume that they always will
-be used with generic PM domains. However, in theory, the same
-hardware may be used in devices that don't belong to any PM
-domain, in which case it would be necessary to add "fake" PM
-domains to satisfy the above assumption. It also may be located in
-a PM domain that's not handled with the help of the generic code.
-
-To allow device drivers that may be used along with the generic PM
-domains code of more flexibility, introduce new device callbacks,
-.save_state() and .restore_state(), that can be supplied by the
-drivers in addition to their "standard" runtime PM callbacks. This
-will allow the drivers to be designed to work with generic PM domains
-as well as without them.
-
-For backwards compatibility, introduce default .save_state() and
-.restore_state() callback routines for PM domains that will execute
-a device driver's .runtime_suspend() and .runtime_resume() callbacks,
-respectively, for the given device if the driver doesn't provide its
-own implementations of .save_state() and .restore_state().
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit ecf00475f229fcf06362412ad2d15a3267e354a1)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 68 +++++++++++++++++++++++++++++++++++--------
- include/linux/pm_domain.h | 2 ++
- 2 files changed, 58 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 94afaa2..3c9451b 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -56,6 +56,16 @@ static int genpd_start_dev(struct generic_pm_domain *genpd, struct device *dev)
- return GENPD_DEV_CALLBACK(genpd, int, start, dev);
- }
-
-+static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, save_state, dev);
-+}
-+
-+static int genpd_restore_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, restore_state, dev);
-+}
-+
- static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
- {
- bool ret = false;
-@@ -217,7 +227,6 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
- {
- struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
- struct device *dev = pdd->dev;
-- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (gpd_data->need_restore)
-@@ -225,11 +234,9 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
-
- mutex_unlock(&genpd->lock);
-
-- if (drv && drv->pm && drv->pm->runtime_suspend) {
-- genpd_start_dev(genpd, dev);
-- ret = drv->pm->runtime_suspend(dev);
-- genpd_stop_dev(genpd, dev);
-- }
-+ genpd_start_dev(genpd, dev);
-+ ret = genpd_save_dev(genpd, dev);
-+ genpd_stop_dev(genpd, dev);
-
- mutex_lock(&genpd->lock);
-
-@@ -250,18 +257,15 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
- {
- struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
- struct device *dev = pdd->dev;
-- struct device_driver *drv = dev->driver;
-
- if (!gpd_data->need_restore)
- return;
-
- mutex_unlock(&genpd->lock);
-
-- if (drv && drv->pm && drv->pm->runtime_resume) {
-- genpd_start_dev(genpd, dev);
-- drv->pm->runtime_resume(dev);
-- genpd_stop_dev(genpd, dev);
-- }
-+ genpd_start_dev(genpd, dev);
-+ genpd_restore_dev(genpd, dev);
-+ genpd_stop_dev(genpd, dev);
-
- mutex_lock(&genpd->lock);
-
-@@ -1358,6 +1362,44 @@ int pm_genpd_remove_callbacks(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_genpd_remove_callbacks);
-
- /**
-+ * pm_genpd_default_save_state - Default "save device state" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_save_state(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev);
-+ struct device_driver *drv = dev->driver;
-+
-+ cb = dev_gpd_data(dev)->ops.save_state;
-+ if (cb)
-+ return cb(dev);
-+
-+ if (drv && drv->pm && drv->pm->runtime_suspend)
-+ return drv->pm->runtime_suspend(dev);
-+
-+ return 0;
-+}
-+
-+/**
-+ * pm_genpd_default_restore_state - Default PM domians "restore device state".
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_restore_state(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev);
-+ struct device_driver *drv = dev->driver;
-+
-+ cb = dev_gpd_data(dev)->ops.restore_state;
-+ if (cb)
-+ return cb(dev);
-+
-+ if (drv && drv->pm && drv->pm->runtime_resume)
-+ return drv->pm->runtime_resume(dev);
-+
-+ return 0;
-+}
-+
-+/**
- * pm_genpd_init - Initialize a generic I/O PM domain object.
- * @genpd: PM domain object to initialize.
- * @gov: PM domain governor to associate with the domain (may be NULL).
-@@ -1400,6 +1442,8 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
- genpd->domain.ops.restore = pm_genpd_restore;
- genpd->domain.ops.complete = pm_genpd_complete;
-+ genpd->dev_ops.save_state = pm_genpd_default_save_state;
-+ genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
- mutex_lock(&gpd_list_lock);
- list_add(&genpd->gpd_list_node, &gpd_list);
- mutex_unlock(&gpd_list_lock);
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 8949d2d..731080d 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -26,6 +26,8 @@ struct dev_power_governor {
- struct gpd_dev_ops {
- int (*start)(struct device *dev);
- int (*stop)(struct device *dev);
-+ int (*save_state)(struct device *dev);
-+ int (*restore_state)(struct device *dev);
- bool (*active_wakeup)(struct device *dev);
- };
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0140-PM-Domains-Rework-system-suspend-callback-routines-v.patch b/patches.runtime_pm/0140-PM-Domains-Rework-system-suspend-callback-routines-v.patch
deleted file mode 100644
index 8c69d7f6ba12fe..00000000000000
--- a/patches.runtime_pm/0140-PM-Domains-Rework-system-suspend-callback-routines-v.patch
+++ /dev/null
@@ -1,420 +0,0 @@
-From b0d643b7f97319158c0dfd2f5e43b33a4d5f0bfc Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 27 Nov 2011 13:11:51 +0100
-Subject: PM / Domains: Rework system suspend callback routines (v2)
-
-The current generic PM domains code attempts to use the generic
-system suspend operations along with the domains' device stop/start
-routines, which requires device drivers to assume that their
-system suspend/resume (and hibernation/restore) callbacks will always
-be used with generic PM domains. However, in theory, the same
-hardware may be used in devices that don't belong to any PM domain,
-in which case it would be necessary to add "fake" PM domains to
-satisfy the above assumption. Also, the domain the hardware belongs
-to may not be handled with the help of the generic code.
-
-To allow device drivers that may be used along with the generic PM
-domains code of more flexibility, add new device callbacks,
-.suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(),
-.freeze_late(), .thaw_early(), and .thaw(), that can be supplied by
-the drivers in addition to their "standard" system suspend and
-hibernation callbacks. These new callbacks, if defined, will be used
-by the generic PM domains code for the handling of system suspend and
-hibernation instead of the "standard" ones. This will allow drivers
-to be designed to work with generic PM domains as well as without
-them.
-
-For backwards compatibility, introduce default implementations of the
-new callbacks for PM domains that will execute pm_generic_suspend(),
-pm_generic_suspend_noirq(), pm_generic_resume_noirq(),
-pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(),
-pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the
-given device if its driver doesn't define those callbacks.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d23b9b00cdde5c93b914a172cecd57d5625fcd04)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 249 ++++++++++++++++++++++++++-----------------
- include/linux/pm_domain.h | 8 ++
- 2 files changed, 158 insertions(+), 99 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 3c9451b..9a77080 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -561,6 +561,46 @@ static bool genpd_dev_active_wakeup(struct generic_pm_domain *genpd,
- return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev);
- }
-
-+static int genpd_suspend_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, suspend, dev);
-+}
-+
-+static int genpd_suspend_late(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, suspend_late, dev);
-+}
-+
-+static int genpd_resume_early(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, resume_early, dev);
-+}
-+
-+static int genpd_resume_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, resume, dev);
-+}
-+
-+static int genpd_freeze_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, freeze, dev);
-+}
-+
-+static int genpd_freeze_late(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, freeze_late, dev);
-+}
-+
-+static int genpd_thaw_early(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, thaw_early, dev);
-+}
-+
-+static int genpd_thaw_dev(struct generic_pm_domain *genpd, struct device *dev)
-+{
-+ return GENPD_DEV_CALLBACK(genpd, int, thaw, dev);
-+}
-+
- /**
- * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
- * @genpd: PM domain to power off, if possible.
-@@ -712,7 +752,7 @@ static int pm_genpd_suspend(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : pm_generic_suspend(dev);
-+ return genpd->suspend_power_off ? 0 : genpd_suspend_dev(genpd, dev);
- }
-
- /**
-@@ -737,7 +777,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (genpd->suspend_power_off)
- return 0;
-
-- ret = pm_generic_suspend_noirq(dev);
-+ ret = genpd_suspend_late(genpd, dev);
- if (ret)
- return ret;
-
-@@ -788,7 +828,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
- genpd->suspended_count--;
- genpd_start_dev(genpd, dev);
-
-- return pm_generic_resume_noirq(dev);
-+ return genpd_resume_early(genpd, dev);
- }
-
- /**
-@@ -809,7 +849,7 @@ static int pm_genpd_resume(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : pm_generic_resume(dev);
-+ return genpd->suspend_power_off ? 0 : genpd_resume_dev(genpd, dev);
- }
-
- /**
-@@ -830,7 +870,7 @@ static int pm_genpd_freeze(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : pm_generic_freeze(dev);
-+ return genpd->suspend_power_off ? 0 : genpd_freeze_dev(genpd, dev);
- }
-
- /**
-@@ -856,7 +896,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
- if (genpd->suspend_power_off)
- return 0;
-
-- ret = pm_generic_freeze_noirq(dev);
-+ ret = genpd_freeze_late(genpd, dev);
- if (ret)
- return ret;
-
-@@ -889,7 +929,7 @@ static int pm_genpd_thaw_noirq(struct device *dev)
-
- genpd_start_dev(genpd, dev);
-
-- return pm_generic_thaw_noirq(dev);
-+ return genpd_thaw_early(genpd, dev);
- }
-
- /**
-@@ -910,70 +950,7 @@ static int pm_genpd_thaw(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : pm_generic_thaw(dev);
--}
--
--/**
-- * pm_genpd_dev_poweroff - Power off a device belonging to an I/O PM domain.
-- * @dev: Device to suspend.
-- *
-- * Power off a device under the assumption that its pm_domain field points to
-- * the domain member of an object of type struct generic_pm_domain representing
-- * a PM domain consisting of I/O devices.
-- */
--static int pm_genpd_dev_poweroff(struct device *dev)
--{
-- struct generic_pm_domain *genpd;
--
-- dev_dbg(dev, "%s()\n", __func__);
--
-- genpd = dev_to_genpd(dev);
-- if (IS_ERR(genpd))
-- return -EINVAL;
--
-- return genpd->suspend_power_off ? 0 : pm_generic_poweroff(dev);
--}
--
--/**
-- * pm_genpd_dev_poweroff_noirq - Late power off of a device from a PM domain.
-- * @dev: Device to suspend.
-- *
-- * Carry out a late powering off of a device under the assumption that its
-- * pm_domain field points to the domain member of an object of type
-- * struct generic_pm_domain representing a PM domain consisting of I/O devices.
-- */
--static int pm_genpd_dev_poweroff_noirq(struct device *dev)
--{
-- struct generic_pm_domain *genpd;
-- int ret;
--
-- dev_dbg(dev, "%s()\n", __func__);
--
-- genpd = dev_to_genpd(dev);
-- if (IS_ERR(genpd))
-- return -EINVAL;
--
-- if (genpd->suspend_power_off)
-- return 0;
--
-- ret = pm_generic_poweroff_noirq(dev);
-- if (ret)
-- return ret;
--
-- if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
-- return 0;
--
-- genpd_stop_dev(genpd, dev);
--
-- /*
-- * Since all of the "noirq" callbacks are executed sequentially, it is
-- * guaranteed that this function will never run twice in parallel for
-- * the same PM domain, so it is not necessary to use locking here.
-- */
-- genpd->suspended_count++;
-- pm_genpd_sync_poweroff(genpd);
--
-- return 0;
-+ return genpd->suspend_power_off ? 0 : genpd_thaw_dev(genpd, dev);
- }
-
- /**
-@@ -1015,28 +992,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
- genpd->suspended_count--;
- genpd_start_dev(genpd, dev);
-
-- return pm_generic_restore_noirq(dev);
--}
--
--/**
-- * pm_genpd_restore - Restore a device belonging to an I/O power domain.
-- * @dev: Device to resume.
-- *
-- * Restore a device under the assumption that its pm_domain field points to the
-- * domain member of an object of type struct generic_pm_domain representing
-- * a power domain consisting of I/O devices.
-- */
--static int pm_genpd_restore(struct device *dev)
--{
-- struct generic_pm_domain *genpd;
--
-- dev_dbg(dev, "%s()\n", __func__);
--
-- genpd = dev_to_genpd(dev);
-- if (IS_ERR(genpd))
-- return -EINVAL;
--
-- return genpd->suspend_power_off ? 0 : pm_generic_restore(dev);
-+ return genpd_resume_early(genpd, dev);
- }
-
- /**
-@@ -1086,10 +1042,7 @@ static void pm_genpd_complete(struct device *dev)
- #define pm_genpd_freeze_noirq NULL
- #define pm_genpd_thaw_noirq NULL
- #define pm_genpd_thaw NULL
--#define pm_genpd_dev_poweroff_noirq NULL
--#define pm_genpd_dev_poweroff NULL
- #define pm_genpd_restore_noirq NULL
--#define pm_genpd_restore NULL
- #define pm_genpd_complete NULL
-
- #endif /* CONFIG_PM_SLEEP */
-@@ -1361,6 +1314,8 @@ int pm_genpd_remove_callbacks(struct device *dev)
- }
- EXPORT_SYMBOL_GPL(pm_genpd_remove_callbacks);
-
-+/* Default device callbacks for generic PM domains. */
-+
- /**
- * pm_genpd_default_save_state - Default "save device state" for PM domians.
- * @dev: Device to handle.
-@@ -1400,6 +1355,94 @@ static int pm_genpd_default_restore_state(struct device *dev)
- }
-
- /**
-+ * pm_genpd_default_suspend - Default "device suspend" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_suspend(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze;
-+
-+ return cb ? cb(dev) : pm_generic_suspend(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_suspend_late - Default "late device suspend" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_suspend_late(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-+
-+ return cb ? cb(dev) : pm_generic_suspend_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_resume_early - Default "early device resume" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_resume_early(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-+
-+ return cb ? cb(dev) : pm_generic_resume_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_resume - Default "device resume" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_resume(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw;
-+
-+ return cb ? cb(dev) : pm_generic_resume(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_freeze - Default "device freeze" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_freeze(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze;
-+
-+ return cb ? cb(dev) : pm_generic_freeze(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_freeze_late - Default "late device freeze" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_freeze_late(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-+
-+ return cb ? cb(dev) : pm_generic_freeze_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_thaw_early - Default "early device thaw" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_thaw_early(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-+
-+ return cb ? cb(dev) : pm_generic_thaw_noirq(dev);
-+}
-+
-+/**
-+ * pm_genpd_default_thaw - Default "device thaw" for PM domians.
-+ * @dev: Device to handle.
-+ */
-+static int pm_genpd_default_thaw(struct device *dev)
-+{
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw;
-+
-+ return cb ? cb(dev) : pm_generic_thaw(dev);
-+}
-+
-+/**
- * pm_genpd_init - Initialize a generic I/O PM domain object.
- * @genpd: PM domain object to initialize.
- * @gov: PM domain governor to associate with the domain (may be NULL).
-@@ -1437,13 +1480,21 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->domain.ops.freeze_noirq = pm_genpd_freeze_noirq;
- genpd->domain.ops.thaw_noirq = pm_genpd_thaw_noirq;
- genpd->domain.ops.thaw = pm_genpd_thaw;
-- genpd->domain.ops.poweroff = pm_genpd_dev_poweroff;
-- genpd->domain.ops.poweroff_noirq = pm_genpd_dev_poweroff_noirq;
-+ genpd->domain.ops.poweroff = pm_genpd_suspend;
-+ genpd->domain.ops.poweroff_noirq = pm_genpd_suspend_noirq;
- genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
-- genpd->domain.ops.restore = pm_genpd_restore;
-+ genpd->domain.ops.restore = pm_genpd_resume;
- genpd->domain.ops.complete = pm_genpd_complete;
- genpd->dev_ops.save_state = pm_genpd_default_save_state;
- genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-+ genpd->dev_ops.freeze = pm_genpd_default_suspend;
-+ genpd->dev_ops.freeze_late = pm_genpd_default_suspend_late;
-+ genpd->dev_ops.thaw_early = pm_genpd_default_resume_early;
-+ genpd->dev_ops.thaw = pm_genpd_default_resume;
-+ genpd->dev_ops.freeze = pm_genpd_default_freeze;
-+ genpd->dev_ops.freeze_late = pm_genpd_default_freeze_late;
-+ genpd->dev_ops.thaw_early = pm_genpd_default_thaw_early;
-+ genpd->dev_ops.thaw = pm_genpd_default_thaw;
- mutex_lock(&gpd_list_lock);
- list_add(&genpd->gpd_list_node, &gpd_list);
- mutex_unlock(&gpd_list_lock);
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 731080d..10a197d 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -28,6 +28,14 @@ struct gpd_dev_ops {
- int (*stop)(struct device *dev);
- int (*save_state)(struct device *dev);
- int (*restore_state)(struct device *dev);
-+ int (*suspend)(struct device *dev);
-+ int (*suspend_late)(struct device *dev);
-+ int (*resume_early)(struct device *dev);
-+ int (*resume)(struct device *dev);
-+ int (*freeze)(struct device *dev);
-+ int (*freeze_late)(struct device *dev);
-+ int (*thaw_early)(struct device *dev);
-+ int (*thaw)(struct device *dev);
- bool (*active_wakeup)(struct device *dev);
- };
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0141-PM-Domains-Add-device-stop-governor-function-v4.patch b/patches.runtime_pm/0141-PM-Domains-Add-device-stop-governor-function-v4.patch
deleted file mode 100644
index fb57af7e68e531..00000000000000
--- a/patches.runtime_pm/0141-PM-Domains-Add-device-stop-governor-function-v4.patch
+++ /dev/null
@@ -1,319 +0,0 @@
-From 28645793f33678ebc0c743228dc2b4a7c609aee8 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 1 Dec 2011 00:02:05 +0100
-Subject: PM / Domains: Add device stop governor function (v4)
-
-Add a function deciding whether or not devices should be stopped in
-pm_genpd_runtime_suspend() depending on their PM QoS constraints
-and stop/start timing values. Make it possible to add information
-used by this function to device objects.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit b02c999ac325e977585abeb4caf6e0a2ee21e30b)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/Makefile | 2 +-
- drivers/base/power/domain.c | 33 ++++++++++++++----
- drivers/base/power/domain_governor.c | 33 ++++++++++++++++++
- include/linux/pm_domain.h | 63 +++++++++++++++++++++++++++++-----
- 4 files changed, 115 insertions(+), 16 deletions(-)
- create mode 100644 drivers/base/power/domain_governor.c
-
-diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
-index 81676dd..2e58ebb 100644
---- a/drivers/base/power/Makefile
-+++ b/drivers/base/power/Makefile
-@@ -3,7 +3,7 @@ obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
- obj-$(CONFIG_PM_RUNTIME) += runtime.o
- obj-$(CONFIG_PM_TRACE_RTC) += trace.o
- obj-$(CONFIG_PM_OPP) += opp.o
--obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o
-+obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o
- obj-$(CONFIG_HAVE_CLK) += clock_ops.o
-
- ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 9a77080..3af9f5a 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -38,7 +38,7 @@ static DEFINE_MUTEX(gpd_list_lock);
-
- #ifdef CONFIG_PM
-
--static struct generic_pm_domain *dev_to_genpd(struct device *dev)
-+struct generic_pm_domain *dev_to_genpd(struct device *dev)
- {
- if (IS_ERR_OR_NULL(dev->pm_domain))
- return ERR_PTR(-EINVAL);
-@@ -436,6 +436,7 @@ static void genpd_power_off_work_fn(struct work_struct *work)
- static int pm_genpd_runtime_suspend(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-+ bool (*stop_ok)(struct device *__dev);
- int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-@@ -446,10 +447,17 @@ static int pm_genpd_runtime_suspend(struct device *dev)
-
- might_sleep_if(!genpd->dev_irq_safe);
-
-+ stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
-+ if (stop_ok && !stop_ok(dev))
-+ return -EBUSY;
-+
- ret = genpd_stop_dev(genpd, dev);
- if (ret)
- return ret;
-
-+ pm_runtime_update_max_time_suspended(dev,
-+ dev_gpd_data(dev)->td.start_latency_ns);
-+
- /*
- * If power.irq_safe is set, this routine will be run with interrupts
- * off, so it can't use mutexes.
-@@ -1048,11 +1056,13 @@ static void pm_genpd_complete(struct device *dev)
- #endif /* CONFIG_PM_SLEEP */
-
- /**
-- * pm_genpd_add_device - Add a device to an I/O PM domain.
-+ * __pm_genpd_add_device - Add a device to an I/O PM domain.
- * @genpd: PM domain to add the device to.
- * @dev: Device to be added.
-+ * @td: Set of PM QoS timing parameters to attach to the device.
- */
--int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
-+int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
-+ struct gpd_timing_data *td)
- {
- struct generic_pm_domain_data *gpd_data;
- struct pm_domain_data *pdd;
-@@ -1095,6 +1105,8 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
- gpd_data->base.dev = dev;
- gpd_data->need_restore = false;
- list_add_tail(&gpd_data->base.list_node, &genpd->dev_list);
-+ if (td)
-+ gpd_data->td = *td;
-
- out:
- genpd_release_lock(genpd);
-@@ -1255,8 +1267,10 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- * pm_genpd_add_callbacks - Add PM domain callbacks to a given device.
- * @dev: Device to add the callbacks to.
- * @ops: Set of callbacks to add.
-+ * @td: Timing data to add to the device along with the callbacks (optional).
- */
--int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops)
-+int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops,
-+ struct gpd_timing_data *td)
- {
- struct pm_domain_data *pdd;
- int ret = 0;
-@@ -1272,6 +1286,8 @@ int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops)
- struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
-
- gpd_data->ops = *ops;
-+ if (td)
-+ gpd_data->td = *td;
- } else {
- ret = -EINVAL;
- }
-@@ -1284,10 +1300,11 @@ int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops)
- EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks);
-
- /**
-- * pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
-+ * __pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
- * @dev: Device to remove the callbacks from.
-+ * @clear_td: If set, clear the device's timing data too.
- */
--int pm_genpd_remove_callbacks(struct device *dev)
-+int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
- {
- struct pm_domain_data *pdd;
- int ret = 0;
-@@ -1303,6 +1320,8 @@ int pm_genpd_remove_callbacks(struct device *dev)
- struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd);
-
- gpd_data->ops = (struct gpd_dev_ops){ 0 };
-+ if (clear_td)
-+ gpd_data->td = (struct gpd_timing_data){ 0 };
- } else {
- ret = -EINVAL;
- }
-@@ -1312,7 +1331,7 @@ int pm_genpd_remove_callbacks(struct device *dev)
-
- return ret;
- }
--EXPORT_SYMBOL_GPL(pm_genpd_remove_callbacks);
-+EXPORT_SYMBOL_GPL(__pm_genpd_remove_callbacks);
-
- /* Default device callbacks for generic PM domains. */
-
-diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
-new file mode 100644
-index 0000000..97b21c1
---- /dev/null
-+++ b/drivers/base/power/domain_governor.c
-@@ -0,0 +1,33 @@
-+/*
-+ * drivers/base/power/domain_governor.c - Governors for device PM domains.
-+ *
-+ * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
-+ *
-+ * This file is released under the GPLv2.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/pm_domain.h>
-+#include <linux/pm_qos.h>
-+
-+/**
-+ * default_stop_ok - Default PM domain governor routine for stopping devices.
-+ * @dev: Device to check.
-+ */
-+bool default_stop_ok(struct device *dev)
-+{
-+ struct gpd_timing_data *td = &dev_gpd_data(dev)->td;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (dev->power.max_time_suspended_ns < 0 || td->break_even_ns == 0)
-+ return true;
-+
-+ return td->stop_latency_ns + td->start_latency_ns < td->break_even_ns
-+ && td->break_even_ns < dev->power.max_time_suspended_ns;
-+}
-+
-+struct dev_power_governor simple_qos_governor = {
-+ .stop_ok = default_stop_ok,
-+};
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 10a197d..f6745c2 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -21,6 +21,7 @@ enum gpd_status {
-
- struct dev_power_governor {
- bool (*power_down_ok)(struct dev_pm_domain *domain);
-+ bool (*stop_ok)(struct device *dev);
- };
-
- struct gpd_dev_ops {
-@@ -76,9 +77,16 @@ struct gpd_link {
- struct list_head slave_node;
- };
-
-+struct gpd_timing_data {
-+ s64 stop_latency_ns;
-+ s64 start_latency_ns;
-+ s64 break_even_ns;
-+};
-+
- struct generic_pm_domain_data {
- struct pm_domain_data base;
- struct gpd_dev_ops ops;
-+ struct gpd_timing_data td;
- bool need_restore;
- };
-
-@@ -93,20 +101,48 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
- return to_gpd_data(dev->power.subsys_data->domain_data);
- }
-
--extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
-- struct device *dev);
-+extern struct dev_power_governor simple_qos_governor;
-+
-+extern struct generic_pm_domain *dev_to_genpd(struct device *dev);
-+extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
-+ struct device *dev,
-+ struct gpd_timing_data *td);
-+
-+static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
-+ struct device *dev)
-+{
-+ return __pm_genpd_add_device(genpd, dev, NULL);
-+}
-+
- extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- struct device *dev);
- extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *new_subdomain);
- extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *target);
--extern int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops);
--extern int pm_genpd_remove_callbacks(struct device *dev);
-+extern int pm_genpd_add_callbacks(struct device *dev,
-+ struct gpd_dev_ops *ops,
-+ struct gpd_timing_data *td);
-+extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
- extern void pm_genpd_init(struct generic_pm_domain *genpd,
- struct dev_power_governor *gov, bool is_off);
-+
- extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
-+
-+extern bool default_stop_ok(struct device *dev);
-+
- #else
-+
-+static inline struct generic_pm_domain *dev_to_genpd(struct device *dev)
-+{
-+ return ERR_PTR(-ENOSYS);
-+}
-+static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
-+ struct device *dev,
-+ struct gpd_timing_data *td)
-+{
-+ return -ENOSYS;
-+}
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
- {
-@@ -128,22 +164,33 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
- return -ENOSYS;
- }
- static inline int pm_genpd_add_callbacks(struct device *dev,
-- struct gpd_dev_ops *ops)
-+ struct gpd_dev_ops *ops,
-+ struct gpd_timing_data *td)
- {
- return -ENOSYS;
- }
--static inline int pm_genpd_remove_callbacks(struct device *dev)
-+static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
- {
- return -ENOSYS;
- }
--static inline void pm_genpd_init(struct generic_pm_domain *genpd,
-- struct dev_power_governor *gov, bool is_off) {}
-+static inline void pm_genpd_init(struct generic_pm_domain *genpd, bool is_off)
-+{
-+}
- static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
- {
- return -ENOSYS;
- }
-+static inline bool default_stop_ok(struct device *dev)
-+{
-+ return false;
-+}
- #endif
-
-+static inline int pm_genpd_remove_callbacks(struct device *dev)
-+{
-+ return __pm_genpd_remove_callbacks(dev, true);
-+}
-+
- #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
- extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
- extern void pm_genpd_poweroff_unused(void);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0142-PM-Domains-Add-default-power-off-governor-function-v.patch b/patches.runtime_pm/0142-PM-Domains-Add-default-power-off-governor-function-v.patch
deleted file mode 100644
index 849215251827e2..00000000000000
--- a/patches.runtime_pm/0142-PM-Domains-Add-default-power-off-governor-function-v.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From 6748d6293797c1159618df2970e5249843449111 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 1 Dec 2011 00:02:10 +0100
-Subject: PM / Domains: Add default power off governor function (v4)
-
-Add a function deciding whether or not a given PM domain should
-be powered off on the basis of the PM QoS constraints of devices
-belonging to it and their PM QoS timing data.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 221e9b58380abdd6c05e11b4538597e2586ee141)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 12 ++++
- drivers/base/power/domain_governor.c | 110 ++++++++++++++++++++++++++++++++++
- include/linux/pm_domain.h | 7 +++
- 3 files changed, 129 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 3af9f5a..9189619 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -398,6 +398,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
-
- genpd->status = GPD_STATE_POWER_OFF;
-+ genpd->power_off_time = ktime_get();
-+
-+ /* Update PM QoS information for devices in the domain. */
-+ list_for_each_entry_reverse(pdd, &genpd->dev_list, list_node) {
-+ struct gpd_timing_data *td = &to_gpd_data(pdd)->td;
-+
-+ pm_runtime_update_max_time_suspended(pdd->dev,
-+ td->start_latency_ns +
-+ td->restore_state_latency_ns +
-+ genpd->power_on_latency_ns);
-+ }
-
- list_for_each_entry(link, &genpd->slave_links, slave_node) {
- genpd_sd_counter_dec(link->master);
-@@ -1487,6 +1498,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->resume_count = 0;
- genpd->device_count = 0;
- genpd->suspended_count = 0;
-+ genpd->max_off_time_ns = -1;
- genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
- genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume;
- genpd->domain.ops.runtime_idle = pm_generic_runtime_idle;
-diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
-index 97b21c1..da78540 100644
---- a/drivers/base/power/domain_governor.c
-+++ b/drivers/base/power/domain_governor.c
-@@ -10,6 +10,7 @@
- #include <linux/kernel.h>
- #include <linux/pm_domain.h>
- #include <linux/pm_qos.h>
-+#include <linux/hrtimer.h>
-
- /**
- * default_stop_ok - Default PM domain governor routine for stopping devices.
-@@ -28,6 +29,115 @@ bool default_stop_ok(struct device *dev)
- && td->break_even_ns < dev->power.max_time_suspended_ns;
- }
-
-+/**
-+ * default_power_down_ok - Default generic PM domain power off governor routine.
-+ * @pd: PM domain to check.
-+ *
-+ * This routine must be executed under the PM domain's lock.
-+ */
-+static bool default_power_down_ok(struct dev_pm_domain *pd)
-+{
-+ struct generic_pm_domain *genpd = pd_to_genpd(pd);
-+ struct gpd_link *link;
-+ struct pm_domain_data *pdd;
-+ s64 min_dev_off_time_ns;
-+ s64 off_on_time_ns;
-+ ktime_t time_now = ktime_get();
-+
-+ off_on_time_ns = genpd->power_off_latency_ns +
-+ genpd->power_on_latency_ns;
-+ /*
-+ * It doesn't make sense to remove power from the domain if saving
-+ * the state of all devices in it and the power off/power on operations
-+ * take too much time.
-+ *
-+ * All devices in this domain have been stopped already at this point.
-+ */
-+ list_for_each_entry(pdd, &genpd->dev_list, list_node) {
-+ if (pdd->dev->driver)
-+ off_on_time_ns +=
-+ to_gpd_data(pdd)->td.save_state_latency_ns;
-+ }
-+
-+ /*
-+ * Check if subdomains can be off for enough time.
-+ *
-+ * All subdomains have been powered off already at this point.
-+ */
-+ list_for_each_entry(link, &genpd->master_links, master_node) {
-+ struct generic_pm_domain *sd = link->slave;
-+ s64 sd_max_off_ns = sd->max_off_time_ns;
-+
-+ if (sd_max_off_ns < 0)
-+ continue;
-+
-+ sd_max_off_ns -= ktime_to_ns(ktime_sub(time_now,
-+ sd->power_off_time));
-+ /*
-+ * Check if the subdomain is allowed to be off long enough for
-+ * the current domain to turn off and on (that's how much time
-+ * it will have to wait worst case).
-+ */
-+ if (sd_max_off_ns <= off_on_time_ns)
-+ return false;
-+ }
-+
-+ /*
-+ * Check if the devices in the domain can be off enough time.
-+ */
-+ min_dev_off_time_ns = -1;
-+ list_for_each_entry(pdd, &genpd->dev_list, list_node) {
-+ struct gpd_timing_data *td;
-+ struct device *dev = pdd->dev;
-+ s64 dev_off_time_ns;
-+
-+ if (!dev->driver || dev->power.max_time_suspended_ns < 0)
-+ continue;
-+
-+ td = &to_gpd_data(pdd)->td;
-+ dev_off_time_ns = dev->power.max_time_suspended_ns -
-+ (td->start_latency_ns + td->restore_state_latency_ns +
-+ ktime_to_ns(ktime_sub(time_now,
-+ dev->power.suspend_time)));
-+ if (dev_off_time_ns <= off_on_time_ns)
-+ return false;
-+
-+ if (min_dev_off_time_ns > dev_off_time_ns
-+ || min_dev_off_time_ns < 0)
-+ min_dev_off_time_ns = dev_off_time_ns;
-+ }
-+
-+ if (min_dev_off_time_ns < 0) {
-+ /*
-+ * There are no latency constraints, so the domain can spend
-+ * arbitrary time in the "off" state.
-+ */
-+ genpd->max_off_time_ns = -1;
-+ return true;
-+ }
-+
-+ /*
-+ * The difference between the computed minimum delta and the time needed
-+ * to turn the domain on is the maximum theoretical time this domain can
-+ * spend in the "off" state.
-+ */
-+ min_dev_off_time_ns -= genpd->power_on_latency_ns;
-+
-+ /*
-+ * If the difference between the computed minimum delta and the time
-+ * needed to turn the domain off and back on on is smaller than the
-+ * domain's power break even time, removing power from the domain is not
-+ * worth it.
-+ */
-+ if (genpd->break_even_ns >
-+ min_dev_off_time_ns - genpd->power_off_latency_ns)
-+ return false;
-+
-+ genpd->max_off_time_ns = min_dev_off_time_ns;
-+ return true;
-+}
-+
- struct dev_power_governor simple_qos_governor = {
- .stop_ok = default_stop_ok,
-+ .power_down_ok = default_power_down_ok,
- };
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index f6745c2..cc1a245 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -61,8 +61,13 @@ struct generic_pm_domain {
- bool suspend_power_off; /* Power status before system suspend */
- bool dev_irq_safe; /* Device callbacks are IRQ-safe */
- int (*power_off)(struct generic_pm_domain *domain);
-+ s64 power_off_latency_ns;
- int (*power_on)(struct generic_pm_domain *domain);
-+ s64 power_on_latency_ns;
- struct gpd_dev_ops dev_ops;
-+ s64 break_even_ns; /* Power break even for the entire domain. */
-+ s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
-+ ktime_t power_off_time;
- };
-
- static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
-@@ -80,6 +85,8 @@ struct gpd_link {
- struct gpd_timing_data {
- s64 stop_latency_ns;
- s64 start_latency_ns;
-+ s64 save_state_latency_ns;
-+ s64 restore_state_latency_ns;
- s64 break_even_ns;
- };
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0143-PM-Domains-Automatically-update-overoptimistic-laten.patch b/patches.runtime_pm/0143-PM-Domains-Automatically-update-overoptimistic-laten.patch
deleted file mode 100644
index 72cd3fb638e85c..00000000000000
--- a/patches.runtime_pm/0143-PM-Domains-Automatically-update-overoptimistic-laten.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 17a958115eaf26f242853d26d79463f9978397d3 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 1 Dec 2011 00:02:17 +0100
-Subject: PM / Domains: Automatically update overoptimistic latency
- information
-
-Measure the time of execution of the .stop(), .start(), .save_state()
-and .restore_state() PM domain device callbacks and if the result
-is greater than the corresponding latency value stored in the
-device's struct generic_pm_domain_data object, replace the inaccurate
-value with the measured time.
-
-Do analogously for the PM domains' .power_off() and .power_off()
-callbacks.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0140d8bd47f798d55c3720f7fcade9e50929a5e5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 43 +++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 39 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 9189619..5a8d67d 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -33,6 +33,20 @@
- __ret; \
- })
-
-+#define GENPD_DEV_TIMED_CALLBACK(genpd, type, callback, dev, field, name) \
-+({ \
-+ ktime_t __start = ktime_get(); \
-+ type __retval = GENPD_DEV_CALLBACK(genpd, type, callback, dev); \
-+ s64 __elapsed = ktime_to_ns(ktime_sub(ktime_get(), __start)); \
-+ struct generic_pm_domain_data *__gpd_data = dev_gpd_data(dev); \
-+ if (__elapsed > __gpd_data->td.field) { \
-+ __gpd_data->td.field = __elapsed; \
-+ dev_warn(dev, name " latency exceeded, new value %lld ns\n", \
-+ __elapsed); \
-+ } \
-+ __retval; \
-+})
-+
- static LIST_HEAD(gpd_list);
- static DEFINE_MUTEX(gpd_list_lock);
-
-@@ -48,22 +62,27 @@ struct generic_pm_domain *dev_to_genpd(struct device *dev)
-
- static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev)
- {
-- return GENPD_DEV_CALLBACK(genpd, int, stop, dev);
-+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, stop, dev,
-+ stop_latency_ns, "stop");
- }
-
- static int genpd_start_dev(struct generic_pm_domain *genpd, struct device *dev)
- {
-- return GENPD_DEV_CALLBACK(genpd, int, start, dev);
-+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, start, dev,
-+ start_latency_ns, "start");
- }
-
- static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
- {
-- return GENPD_DEV_CALLBACK(genpd, int, save_state, dev);
-+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, save_state, dev,
-+ save_state_latency_ns, "state save");
- }
-
- static int genpd_restore_dev(struct generic_pm_domain *genpd, struct device *dev)
- {
-- return GENPD_DEV_CALLBACK(genpd, int, restore_state, dev);
-+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, restore_state, dev,
-+ restore_state_latency_ns,
-+ "state restore");
- }
-
- static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
-@@ -182,9 +201,16 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- }
-
- if (genpd->power_on) {
-+ ktime_t time_start = ktime_get();
-+ s64 elapsed_ns;
-+
- ret = genpd->power_on(genpd);
- if (ret)
- goto err;
-+
-+ elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
-+ if (elapsed_ns > genpd->power_on_latency_ns)
-+ genpd->power_on_latency_ns = elapsed_ns;
- }
-
- genpd_set_active(genpd);
-@@ -377,11 +403,16 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
-
- if (genpd->power_off) {
-+ ktime_t time_start;
-+ s64 elapsed_ns;
-+
- if (atomic_read(&genpd->sd_count) > 0) {
- ret = -EBUSY;
- goto out;
- }
-
-+ time_start = ktime_get();
-+
- /*
- * If sd_count > 0 at this point, one of the subdomains hasn't
- * managed to call pm_genpd_poweron() for the master yet after
-@@ -395,6 +426,10 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- genpd_set_active(genpd);
- goto out;
- }
-+
-+ elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
-+ if (elapsed_ns > genpd->power_off_latency_ns)
-+ genpd->power_off_latency_ns = elapsed_ns;
- }
-
- genpd->status = GPD_STATE_POWER_OFF;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0144-PM-Domains-fix-compilation-failure-for-CONFIG_PM_GEN.patch b/patches.runtime_pm/0144-PM-Domains-fix-compilation-failure-for-CONFIG_PM_GEN.patch
deleted file mode 100644
index 12b49e0dc01d33..00000000000000
--- a/patches.runtime_pm/0144-PM-Domains-fix-compilation-failure-for-CONFIG_PM_GEN.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 4118e8ccd6bc292ac3ea0222ab334e62f54d8600 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Thu, 1 Dec 2011 00:05:31 +0100
-Subject: PM / Domains: fix compilation failure for CONFIG_PM_GENERIC_DOMAINS
- unset
-
-Fix the following compalitaion breakage:
-
-In file included from linux/drivers/sh/pm_runtime.c:15:
-linux/include/linux/pm_domain.h: In function 'dev_to_genpd':
-linux/include/linux/pm_domain.h:142: error: implicit declaration of function 'ERR_PTR'
-linux/include/linux/pm_domain.h:142: warning: return makes pointer from integer without a cast
-In file included from linux/include/linux/sh_clk.h:10,
- from linux/drivers/sh/pm_runtime.c:19:
-linux/include/linux/err.h: At top level:
-linux/include/linux/err.h:22: error: conflicting types for 'ERR_PTR'
-linux/include/linux/pm_domain.h:142: note: previous implicit declaration of 'ERR_PTR' was here
-make[3]: *** [drivers/sh/pm_runtime.o] Error 1
-
-Reported-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 4f042cdad40e1566a53b7ae85e72b6945a4b0fde)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_domain.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index cc1a245..fbb81bc 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -10,6 +10,7 @@
- #define _LINUX_PM_DOMAIN_H
-
- #include <linux/device.h>
-+#include <linux/err.h>
-
- enum gpd_status {
- GPD_STATE_ACTIVE = 0, /* PM domain is active */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0145-regulator-Fix-regulator_register-API-signature-in-Do.patch b/patches.runtime_pm/0145-regulator-Fix-regulator_register-API-signature-in-Do.patch
deleted file mode 100644
index ea6002002d463e..00000000000000
--- a/patches.runtime_pm/0145-regulator-Fix-regulator_register-API-signature-in-Do.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 296366bad77047982adf3d08f0b33d7882712fb1 Mon Sep 17 00:00:00 2001
-From: Rajendra Nayak <rnayak@ti.com>
-Date: Mon, 5 Dec 2011 12:47:42 +0530
-Subject: regulator: Fix regulator_register() API signature in Documentation
-
-The commit 2c043bcbf287 ("regulator: pass additional of_node to
-regulator_register()") added an additional parameter to the
-regulator_register() API.
-Update the Documentation accordingly to reflect the change
-in the function signature.
-
-Reported-by: Thomas Abraham <thomas.abraham@linaro.org>
-Signed-off-by: Rajendra Nayak <rnayak@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-(cherry picked from commit 068df0f34e81bc06c5eb5012ec2eda25624e87aa)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/regulator/regulator.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt
-index 3f8b528..e272d99 100644
---- a/Documentation/power/regulator/regulator.txt
-+++ b/Documentation/power/regulator/regulator.txt
-@@ -12,7 +12,7 @@ Drivers can register a regulator by calling :-
-
- struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
- struct device *dev, struct regulator_init_data *init_data,
-- void *driver_data);
-+ void *driver_data, struct device_node *of_node);
-
- This will register the regulators capabilities and operations to the regulator
- core.
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0146-PM-Hibernate-Enable-usermodehelpers-in-software_resu.patch b/patches.runtime_pm/0146-PM-Hibernate-Enable-usermodehelpers-in-software_resu.patch
deleted file mode 100644
index 4b96acbdaee56b..00000000000000
--- a/patches.runtime_pm/0146-PM-Hibernate-Enable-usermodehelpers-in-software_resu.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 5e8dc14ce6dff581023321c949c682d1baa263bb Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Thu, 1 Dec 2011 22:32:43 +0100
-Subject: PM / Hibernate: Enable usermodehelpers in software_resume() error
- path
-
-In the software_resume() function defined in kernel/power/hibernate.c,
-if the call to create_basic_memory_bitmaps() fails, the usermodehelpers
-are not enabled (which had been disabled in the previous step). Fix it.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0118521cc7acb3ccbc1a01d6144ac32be9d56a4c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 6495e6a..4f2ebf4 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -797,8 +797,10 @@ static int software_resume(void)
- goto close_finish;
-
- error = create_basic_memory_bitmaps();
-- if (error)
-+ if (error) {
-+ usermodehelper_enable();
- goto close_finish;
-+ }
-
- pr_debug("PM: Preparing processes for restore.\n");
- error = freeze_processes();
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0147-PM-Hibernate-Thaw-processes-in-SNAPSHOT_CREATE_IMAGE.patch b/patches.runtime_pm/0147-PM-Hibernate-Thaw-processes-in-SNAPSHOT_CREATE_IMAGE.patch
deleted file mode 100644
index 72e1aa186d9a5e..00000000000000
--- a/patches.runtime_pm/0147-PM-Hibernate-Thaw-processes-in-SNAPSHOT_CREATE_IMAGE.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From bd07f032506fb16af54aadcce89fd89d1378526e Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Thu, 1 Dec 2011 22:33:10 +0100
-Subject: PM / Hibernate: Thaw processes in SNAPSHOT_CREATE_IMAGE ioctl test
- path
-
-Commit 2aede851ddf08666f68ffc17be446420e9d2a056 (PM / Hibernate: Freeze
-kernel threads after preallocating memory) moved the freezing of kernel
-threads to hibernation_snapshot() function.
-
-So now, if the call to hibernation_snapshot() returns early due to a
-successful hibernation test, the caller has to thaw processes to ensure
-that the system gets back to its original state.
-
-But in SNAPSHOT_CREATE_IMAGE hibernation ioctl, the caller does not thaw
-processes in case hibernation_snapshot() returned due to a successful
-freezer test. Fix this issue. But note we still send the value of 'in_suspend'
-(which is now 0) to userspace, because we are not in an error path per-se,
-and moreover, the value of in_suspend correctly depicts the situation here.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 97819a26224f019e73d88bb2fd4eb5a614860461)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 2 +-
- kernel/power/power.h | 2 ++
- kernel/power/user.c | 11 ++++++++---
- 3 files changed, 11 insertions(+), 4 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 4f2ebf4..19500b5 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -55,7 +55,7 @@ enum {
-
- static int hibernation_mode = HIBERNATION_SHUTDOWN;
-
--static bool freezer_test_done;
-+bool freezer_test_done;
-
- static const struct platform_hibernation_ops *hibernation_ops;
-
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 23a2db1..0c4defe 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -50,6 +50,8 @@ static inline char *check_image_kernel(struct swsusp_info *info)
- #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT)
-
- /* kernel/power/hibernate.c */
-+extern bool freezer_test_done;
-+
- extern int hibernation_snapshot(int platform_mode);
- extern int hibernation_restore(int platform_mode);
- extern int hibernation_platform_enter(void);
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 7cc3f5b..c202e2e 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -281,10 +281,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- }
- pm_restore_gfp_mask();
- error = hibernation_snapshot(data->platform_support);
-- if (!error)
-+ if (!error) {
- error = put_user(in_suspend, (int __user *)arg);
-- if (!error)
-- data->ready = 1;
-+ if (!error && !freezer_test_done)
-+ data->ready = 1;
-+ if (freezer_test_done) {
-+ freezer_test_done = false;
-+ thaw_processes();
-+ }
-+ }
- break;
-
- case SNAPSHOT_ATOMIC_RESTORE:
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0148-PM-Hibernate-Remove-deprecated-hibernation-test-mode.patch b/patches.runtime_pm/0148-PM-Hibernate-Remove-deprecated-hibernation-test-mode.patch
deleted file mode 100644
index 131c5129d4a7f1..00000000000000
--- a/patches.runtime_pm/0148-PM-Hibernate-Remove-deprecated-hibernation-test-mode.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From 5c1e41ce179c516e509d8c2b6cc6ba90bf8c4a57 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Thu, 1 Dec 2011 22:33:20 +0100
-Subject: PM / Hibernate: Remove deprecated hibernation test modes
-
-The hibernation test modes 'test' and 'testproc' are deprecated, because
-the 'pm_test' framework offers much more fine-grained control for debugging
-suspend and hibernation related problems.
-
-So, remove the deprecated 'test' and 'testproc' hibernation test modes.
-
-Suggested-by: Rafael J. Wysocki <rjw@sisk.pl>
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 48580ab8729865c81e148d59159fbe2aa7865511)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 33 ++++-----------------------------
- 1 file changed, 4 insertions(+), 29 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 19500b5..111947e 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -43,8 +43,6 @@ int in_suspend __nosavedata;
- enum {
- HIBERNATION_INVALID,
- HIBERNATION_PLATFORM,
-- HIBERNATION_TEST,
-- HIBERNATION_TESTPROC,
- HIBERNATION_SHUTDOWN,
- HIBERNATION_REBOOT,
- /* keep last */
-@@ -96,15 +94,6 @@ static void hibernation_debug_sleep(void)
- mdelay(5000);
- }
-
--static int hibernation_testmode(int mode)
--{
-- if (hibernation_mode == mode) {
-- hibernation_debug_sleep();
-- return 1;
-- }
-- return 0;
--}
--
- static int hibernation_test(int level)
- {
- if (pm_test_level == level) {
-@@ -114,7 +103,6 @@ static int hibernation_test(int level)
- return 0;
- }
- #else /* !CONFIG_PM_DEBUG */
--static int hibernation_testmode(int mode) { return 0; }
- static int hibernation_test(int level) { return 0; }
- #endif /* !CONFIG_PM_DEBUG */
-
-@@ -278,8 +266,7 @@ static int create_image(int platform_mode)
- goto Platform_finish;
-
- error = disable_nonboot_cpus();
-- if (error || hibernation_test(TEST_CPUS)
-- || hibernation_testmode(HIBERNATION_TEST))
-+ if (error || hibernation_test(TEST_CPUS))
- goto Enable_cpus;
-
- local_irq_disable();
-@@ -349,8 +336,7 @@ int hibernation_snapshot(int platform_mode)
- if (error)
- goto Cleanup;
-
-- if (hibernation_test(TEST_FREEZER) ||
-- hibernation_testmode(HIBERNATION_TESTPROC)) {
-+ if (hibernation_test(TEST_FREEZER)) {
-
- /*
- * Indicate to the caller that we are returning due to a
-@@ -586,9 +572,6 @@ int hibernation_platform_enter(void)
- static void power_down(void)
- {
- switch (hibernation_mode) {
-- case HIBERNATION_TEST:
-- case HIBERNATION_TESTPROC:
-- break;
- case HIBERNATION_REBOOT:
- kernel_restart(NULL);
- break;
-@@ -843,8 +826,6 @@ static const char * const hibernation_modes[] = {
- [HIBERNATION_PLATFORM] = "platform",
- [HIBERNATION_SHUTDOWN] = "shutdown",
- [HIBERNATION_REBOOT] = "reboot",
-- [HIBERNATION_TEST] = "test",
-- [HIBERNATION_TESTPROC] = "testproc",
- };
-
- /*
-@@ -853,17 +834,15 @@ static const char * const hibernation_modes[] = {
- * Hibernation can be handled in several ways. There are a few different ways
- * to put the system into the sleep state: using the platform driver (e.g. ACPI
- * or other hibernation_ops), powering it off or rebooting it (for testing
-- * mostly), or using one of the two available test modes.
-+ * mostly).
- *
- * The sysfs file /sys/power/disk provides an interface for selecting the
- * hibernation mode to use. Reading from this file causes the available modes
-- * to be printed. There are 5 modes that can be supported:
-+ * to be printed. There are 3 modes that can be supported:
- *
- * 'platform'
- * 'shutdown'
- * 'reboot'
-- * 'test'
-- * 'testproc'
- *
- * If a platform hibernation driver is in use, 'platform' will be supported
- * and will be used by default. Otherwise, 'shutdown' will be used by default.
-@@ -887,8 +866,6 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
- switch (i) {
- case HIBERNATION_SHUTDOWN:
- case HIBERNATION_REBOOT:
-- case HIBERNATION_TEST:
-- case HIBERNATION_TESTPROC:
- break;
- case HIBERNATION_PLATFORM:
- if (hibernation_ops)
-@@ -929,8 +906,6 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
- switch (mode) {
- case HIBERNATION_SHUTDOWN:
- case HIBERNATION_REBOOT:
-- case HIBERNATION_TEST:
-- case HIBERNATION_TESTPROC:
- hibernation_mode = mode;
- break;
- case HIBERNATION_PLATFORM:
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0149-PM-Sleep-Unify-diagnostic-messages-from-device-suspe.patch b/patches.runtime_pm/0149-PM-Sleep-Unify-diagnostic-messages-from-device-suspe.patch
deleted file mode 100644
index e1942602e8725e..00000000000000
--- a/patches.runtime_pm/0149-PM-Sleep-Unify-diagnostic-messages-from-device-suspe.patch
+++ /dev/null
@@ -1,251 +0,0 @@
-From 7bd8f160a2aa98a9818403722f52e46f7cd5220f Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 3 Dec 2011 00:23:43 +0100
-Subject: PM / Sleep: Unify diagnostic messages from device suspend/resume
-
-Make pm_op() and pm_noirq_op() use the same helper function for
-running callbacks, which will cause them to use the same format of
-diagnostic messages. This also reduces the complexity and size of
-the code quite a bit.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-(cherry picked from commit 0c6aebe31861c470c8cfbfdfdfd72d1369a6440b)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 128 +++++++++++++--------------------------------
- 1 file changed, 35 insertions(+), 93 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 406f82c..b570189 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -164,8 +164,9 @@ static ktime_t initcall_debug_start(struct device *dev)
- ktime_t calltime = ktime_set(0, 0);
-
- if (initcall_debug) {
-- pr_info("calling %s+ @ %i\n",
-- dev_name(dev), task_pid_nr(current));
-+ pr_info("calling %s+ @ %i, parent: %s\n",
-+ dev_name(dev), task_pid_nr(current),
-+ dev->parent ? dev_name(dev->parent) : "none");
- calltime = ktime_get();
- }
-
-@@ -210,6 +211,24 @@ static void dpm_wait_for_children(struct device *dev, bool async)
- device_for_each_child(dev, &async, dpm_wait_fn);
- }
-
-+static int dpm_run_callback(struct device *dev, int (*cb)(struct device *))
-+{
-+ ktime_t calltime;
-+ int error;
-+
-+ if (!cb)
-+ return 0;
-+
-+ calltime = initcall_debug_start(dev);
-+
-+ error = cb(dev);
-+ suspend_report_result(cb, error);
-+
-+ initcall_debug_report(dev, calltime, error);
-+
-+ return error;
-+}
-+
- /**
- * pm_op - Execute the PM operation appropriate for given PM event.
- * @dev: Device to handle.
-@@ -221,59 +240,36 @@ static int pm_op(struct device *dev,
- pm_message_t state)
- {
- int error = 0;
-- ktime_t calltime;
--
-- calltime = initcall_debug_start(dev);
-
- switch (state.event) {
- #ifdef CONFIG_SUSPEND
- case PM_EVENT_SUSPEND:
-- if (ops->suspend) {
-- error = ops->suspend(dev);
-- suspend_report_result(ops->suspend, error);
-- }
-+ error = dpm_run_callback(dev, ops->suspend);
- break;
- case PM_EVENT_RESUME:
-- if (ops->resume) {
-- error = ops->resume(dev);
-- suspend_report_result(ops->resume, error);
-- }
-+ error = dpm_run_callback(dev, ops->resume);
- break;
- #endif /* CONFIG_SUSPEND */
- #ifdef CONFIG_HIBERNATE_CALLBACKS
- case PM_EVENT_FREEZE:
- case PM_EVENT_QUIESCE:
-- if (ops->freeze) {
-- error = ops->freeze(dev);
-- suspend_report_result(ops->freeze, error);
-- }
-+ error = dpm_run_callback(dev, ops->freeze);
- break;
- case PM_EVENT_HIBERNATE:
-- if (ops->poweroff) {
-- error = ops->poweroff(dev);
-- suspend_report_result(ops->poweroff, error);
-- }
-+ error = dpm_run_callback(dev, ops->poweroff);
- break;
- case PM_EVENT_THAW:
- case PM_EVENT_RECOVER:
-- if (ops->thaw) {
-- error = ops->thaw(dev);
-- suspend_report_result(ops->thaw, error);
-- }
-+ error = dpm_run_callback(dev, ops->thaw);
- break;
- case PM_EVENT_RESTORE:
-- if (ops->restore) {
-- error = ops->restore(dev);
-- suspend_report_result(ops->restore, error);
-- }
-+ error = dpm_run_callback(dev, ops->restore);
- break;
- #endif /* CONFIG_HIBERNATE_CALLBACKS */
- default:
- error = -EINVAL;
- }
-
-- initcall_debug_report(dev, calltime, error);
--
- return error;
- }
-
-@@ -291,70 +287,36 @@ static int pm_noirq_op(struct device *dev,
- pm_message_t state)
- {
- int error = 0;
-- ktime_t calltime = ktime_set(0, 0), delta, rettime;
--
-- if (initcall_debug) {
-- pr_info("calling %s+ @ %i, parent: %s\n",
-- dev_name(dev), task_pid_nr(current),
-- dev->parent ? dev_name(dev->parent) : "none");
-- calltime = ktime_get();
-- }
-
- switch (state.event) {
- #ifdef CONFIG_SUSPEND
- case PM_EVENT_SUSPEND:
-- if (ops->suspend_noirq) {
-- error = ops->suspend_noirq(dev);
-- suspend_report_result(ops->suspend_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->suspend_noirq);
- break;
- case PM_EVENT_RESUME:
-- if (ops->resume_noirq) {
-- error = ops->resume_noirq(dev);
-- suspend_report_result(ops->resume_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->resume_noirq);
- break;
- #endif /* CONFIG_SUSPEND */
- #ifdef CONFIG_HIBERNATE_CALLBACKS
- case PM_EVENT_FREEZE:
- case PM_EVENT_QUIESCE:
-- if (ops->freeze_noirq) {
-- error = ops->freeze_noirq(dev);
-- suspend_report_result(ops->freeze_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->freeze_noirq);
- break;
- case PM_EVENT_HIBERNATE:
-- if (ops->poweroff_noirq) {
-- error = ops->poweroff_noirq(dev);
-- suspend_report_result(ops->poweroff_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->poweroff_noirq);
- break;
- case PM_EVENT_THAW:
- case PM_EVENT_RECOVER:
-- if (ops->thaw_noirq) {
-- error = ops->thaw_noirq(dev);
-- suspend_report_result(ops->thaw_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->thaw_noirq);
- break;
- case PM_EVENT_RESTORE:
-- if (ops->restore_noirq) {
-- error = ops->restore_noirq(dev);
-- suspend_report_result(ops->restore_noirq, error);
-- }
-+ error = dpm_run_callback(dev, ops->restore_noirq);
- break;
- #endif /* CONFIG_HIBERNATE_CALLBACKS */
- default:
- error = -EINVAL;
- }
-
-- if (initcall_debug) {
-- rettime = ktime_get();
-- delta = ktime_sub(rettime, calltime);
-- printk("initcall %s_i+ returned %d after %Ld usecs\n",
-- dev_name(dev), error,
-- (unsigned long long)ktime_to_ns(delta) >> 10);
-- }
--
- return error;
- }
-
-@@ -486,26 +448,6 @@ void dpm_resume_noirq(pm_message_t state)
- EXPORT_SYMBOL_GPL(dpm_resume_noirq);
-
- /**
-- * legacy_resume - Execute a legacy (bus or class) resume callback for device.
-- * @dev: Device to resume.
-- * @cb: Resume callback to execute.
-- */
--static int legacy_resume(struct device *dev, int (*cb)(struct device *dev))
--{
-- int error;
-- ktime_t calltime;
--
-- calltime = initcall_debug_start(dev);
--
-- error = cb(dev);
-- suspend_report_result(cb, error);
--
-- initcall_debug_report(dev, calltime, error);
--
-- return error;
--}
--
--/**
- * device_resume - Execute "resume" callbacks for given device.
- * @dev: Device to handle.
- * @state: PM transition of the system being carried out.
-@@ -553,7 +495,7 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- goto End;
- } else if (dev->class->resume) {
- pm_dev_dbg(dev, state, "legacy class ");
-- error = legacy_resume(dev, dev->class->resume);
-+ error = dpm_run_callback(dev, dev->class->resume);
- goto End;
- }
- }
-@@ -564,7 +506,7 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- error = pm_op(dev, dev->bus->pm, state);
- } else if (dev->bus->resume) {
- pm_dev_dbg(dev, state, "legacy ");
-- error = legacy_resume(dev, dev->bus->resume);
-+ error = dpm_run_callback(dev, dev->bus->resume);
- }
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0150-PM-Hibernate-Replace-unintuitive-if-condition-in-ker.patch b/patches.runtime_pm/0150-PM-Hibernate-Replace-unintuitive-if-condition-in-ker.patch
deleted file mode 100644
index 5c7fad09a0d95f..00000000000000
--- a/patches.runtime_pm/0150-PM-Hibernate-Replace-unintuitive-if-condition-in-ker.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 9f7c65e5f6da87311f7c565d534de0c2050b7342 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 3 Dec 2011 00:20:30 +0100
-Subject: PM / Hibernate: Replace unintuitive 'if' condition in
- kernel/power/user.c with 'else'
-
-In the snapshot_ioctl() function, under SNAPSHOT_FREEZE, the code below
-freeze_processes() is a bit unintuitive. Improve it by replacing the
-second 'if' condition with an 'else' clause.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e5b16746f0f2d6883c226af52d90904ce0f7eee8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/user.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index c202e2e..06ea33d 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -259,7 +259,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- error = freeze_processes();
- if (error)
- usermodehelper_enable();
-- if (!error)
-+ else
- data->frozen = 1;
- break;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0151-PM-Domains-Make-it-possible-to-assign-names-to-gener.patch b/patches.runtime_pm/0151-PM-Domains-Make-it-possible-to-assign-names-to-gener.patch
deleted file mode 100644
index 7b1305b4f877ec..00000000000000
--- a/patches.runtime_pm/0151-PM-Domains-Make-it-possible-to-assign-names-to-gener.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From d3b904f78564a800dcc6f0ed4c1dc5dcfe937ea2 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 6 Dec 2011 22:19:54 +0100
-Subject: PM / Domains: Make it possible to assign names to generic PM domains
-
-Add a name member pointer to struct generic_pm_domain and use it in
-diagnostic messages regarding the domain power-off and power-on
-latencies. Update the ARM shmobile SH7372 code to assign names to
-the PM domains used by it.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Magnus Damm <damm@opensource.se>
-(cherry picked from commit e84b2c202771bbd538866207efcb1f7dbab8045b)
-
-Conflicts:
-
- arch/arm/mach-shmobile/pm-sh7372.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 14 ++++++++++++--
- include/linux/pm_domain.h | 1 +
- 2 files changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 5a8d67d..ad6ba2e 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -209,8 +209,13 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
- goto err;
-
- elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
-- if (elapsed_ns > genpd->power_on_latency_ns)
-+ if (elapsed_ns > genpd->power_on_latency_ns) {
- genpd->power_on_latency_ns = elapsed_ns;
-+ if (genpd->name)
-+ pr_warning("%s: Power-on latency exceeded, "
-+ "new value %lld ns\n", genpd->name,
-+ elapsed_ns);
-+ }
- }
-
- genpd_set_active(genpd);
-@@ -428,8 +433,13 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- }
-
- elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
-- if (elapsed_ns > genpd->power_off_latency_ns)
-+ if (elapsed_ns > genpd->power_off_latency_ns) {
- genpd->power_off_latency_ns = elapsed_ns;
-+ if (genpd->name)
-+ pr_warning("%s: Power-off latency exceeded, "
-+ "new value %lld ns\n", genpd->name,
-+ elapsed_ns);
-+ }
- }
-
- genpd->status = GPD_STATE_POWER_OFF;
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index fbb81bc..fb809b9 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -50,6 +50,7 @@ struct generic_pm_domain {
- struct mutex lock;
- struct dev_power_governor *gov;
- struct work_struct power_off_work;
-+ char *name;
- unsigned int in_progress; /* Number of devices being suspended now */
- atomic_t sd_count; /* Number of subdomains with power "on" */
- enum gpd_status status; /* Current state of the domain */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0152-PM-Domains-Fix-default-system-suspend-resume-operati.patch b/patches.runtime_pm/0152-PM-Domains-Fix-default-system-suspend-resume-operati.patch
deleted file mode 100644
index b63ee1dc96cfeb..00000000000000
--- a/patches.runtime_pm/0152-PM-Domains-Fix-default-system-suspend-resume-operati.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 29bbccf78749e9b6f807fa5f442119838c06946a Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 6 Dec 2011 23:16:47 +0100
-Subject: PM / Domains: Fix default system suspend/resume operations
-
-Commit d23b9b00cdde5c93b914a172cecd57d5625fcd04 (PM / Domains: Rework
-system suspend callback routines (v2)) broke the system suspend and
-resume handling by devices belonging to generic PM domains, because
-it used freeze/thaw callbacks instead of suspend/resume ones and
-didn't initialize device callbacks for system suspend/resume
-properly at all. Fix those problems.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c9914854b4ca339e511d052ce3a1a441ef15b928)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index ad6ba2e..92e6a90 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -1435,7 +1435,7 @@ static int pm_genpd_default_restore_state(struct device *dev)
- */
- static int pm_genpd_default_suspend(struct device *dev)
- {
-- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze;
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend;
-
- return cb ? cb(dev) : pm_generic_suspend(dev);
- }
-@@ -1446,7 +1446,7 @@ static int pm_genpd_default_suspend(struct device *dev)
- */
- static int pm_genpd_default_suspend_late(struct device *dev)
- {
-- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend_late;
-
- return cb ? cb(dev) : pm_generic_suspend_noirq(dev);
- }
-@@ -1457,7 +1457,7 @@ static int pm_genpd_default_suspend_late(struct device *dev)
- */
- static int pm_genpd_default_resume_early(struct device *dev)
- {
-- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume_early;
-
- return cb ? cb(dev) : pm_generic_resume_noirq(dev);
- }
-@@ -1468,7 +1468,7 @@ static int pm_genpd_default_resume_early(struct device *dev)
- */
- static int pm_genpd_default_resume(struct device *dev)
- {
-- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw;
-+ int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume;
-
- return cb ? cb(dev) : pm_generic_resume(dev);
- }
-@@ -1563,10 +1563,10 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->domain.ops.complete = pm_genpd_complete;
- genpd->dev_ops.save_state = pm_genpd_default_save_state;
- genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-- genpd->dev_ops.freeze = pm_genpd_default_suspend;
-- genpd->dev_ops.freeze_late = pm_genpd_default_suspend_late;
-- genpd->dev_ops.thaw_early = pm_genpd_default_resume_early;
-- genpd->dev_ops.thaw = pm_genpd_default_resume;
-+ genpd->dev_ops.suspend = pm_genpd_default_suspend;
-+ genpd->dev_ops.suspend_late = pm_genpd_default_suspend_late;
-+ genpd->dev_ops.resume_early = pm_genpd_default_resume_early;
-+ genpd->dev_ops.resume = pm_genpd_default_resume;
- genpd->dev_ops.freeze = pm_genpd_default_freeze;
- genpd->dev_ops.freeze_late = pm_genpd_default_freeze_late;
- genpd->dev_ops.thaw_early = pm_genpd_default_thaw_early;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0153-PM-Sleep-Replace-mutex_-un-lock-pm_mutex-with-un-loc.patch b/patches.runtime_pm/0153-PM-Sleep-Replace-mutex_-un-lock-pm_mutex-with-un-loc.patch
deleted file mode 100644
index d3cc68f73ea631..00000000000000
--- a/patches.runtime_pm/0153-PM-Sleep-Replace-mutex_-un-lock-pm_mutex-with-un-loc.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-From aadb0e1259b7652dc77405af543c4b5a12fd6510 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Wed, 7 Dec 2011 22:29:54 +0100
-Subject: PM / Sleep: Replace mutex_[un]lock(&pm_mutex) with
- [un]lock_system_sleep()
-
-Using [un]lock_system_sleep() is safer than directly using mutex_[un]lock()
-on 'pm_mutex', since the latter could lead to freezing failures. Hence convert
-all the present users of mutex_[un]lock(&pm_mutex) to use these safe APIs
-instead.
-
-Suggested-by: Tejun Heo <tj@kernel.org>
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Reviewed-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit bcda53faf5814c0c6025a0bd47108adfcbe9f199)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/kexec.c | 4 ++--
- kernel/power/hibernate.c | 16 ++++++++--------
- kernel/power/main.c | 4 ++--
- kernel/power/suspend.c | 4 ++--
- kernel/power/user.c | 16 ++++++++--------
- 5 files changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/kernel/kexec.c b/kernel/kexec.c
-index 8d814cb..581b553 100644
---- a/kernel/kexec.c
-+++ b/kernel/kexec.c
-@@ -1506,7 +1506,7 @@ int kernel_kexec(void)
-
- #ifdef CONFIG_KEXEC_JUMP
- if (kexec_image->preserve_context) {
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- pm_prepare_console();
- error = freeze_processes();
- if (error) {
-@@ -1559,7 +1559,7 @@ int kernel_kexec(void)
- thaw_processes();
- Restore_console:
- pm_restore_console();
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- }
- #endif
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 111947e..7bef755 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -69,14 +69,14 @@ void hibernation_set_ops(const struct platform_hibernation_ops *ops)
- WARN_ON(1);
- return;
- }
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- hibernation_ops = ops;
- if (ops)
- hibernation_mode = HIBERNATION_PLATFORM;
- else if (hibernation_mode == HIBERNATION_PLATFORM)
- hibernation_mode = HIBERNATION_SHUTDOWN;
-
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- }
-
- static bool entering_platform_hibernation;
-@@ -597,7 +597,7 @@ int hibernate(void)
- {
- int error;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- /* The snapshot device should not be opened while we're running */
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
- error = -EBUSY;
-@@ -666,7 +666,7 @@ int hibernate(void)
- pm_restore_console();
- atomic_inc(&snapshot_device_available);
- Unlock:
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- return error;
- }
-
-@@ -894,7 +894,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
- p = memchr(buf, '\n', n);
- len = p ? p - buf : n;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) {
- if (len == strlen(hibernation_modes[i])
- && !strncmp(buf, hibernation_modes[i], len)) {
-@@ -920,7 +920,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
- if (!error)
- pr_debug("PM: Hibernation mode set to '%s'\n",
- hibernation_modes[mode]);
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- return error ? error : n;
- }
-
-@@ -947,9 +947,9 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
- if (maj != MAJOR(res) || min != MINOR(res))
- goto out;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- swsusp_resume_device = res;
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- printk(KERN_INFO "PM: Starting manual resume from disk\n");
- noresume = 0;
- software_resume();
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 7d36fb3..9824b41e 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -116,7 +116,7 @@ static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr,
- p = memchr(buf, '\n', n);
- len = p ? p - buf : n;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
-
- level = TEST_FIRST;
- for (s = &pm_tests[level]; level <= TEST_MAX; s++, level++)
-@@ -126,7 +126,7 @@ static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr,
- break;
- }
-
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
-
- return error ? error : n;
- }
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index d336b27..4fd51be 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -42,9 +42,9 @@ static const struct platform_suspend_ops *suspend_ops;
- */
- void suspend_set_ops(const struct platform_suspend_ops *ops)
- {
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
- suspend_ops = ops;
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
- }
- EXPORT_SYMBOL_GPL(suspend_set_ops);
-
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 06ea33d..98ade21 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -71,7 +71,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
- struct snapshot_data *data;
- int error;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
-
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
- error = -EBUSY;
-@@ -123,7 +123,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
- data->platform_support = 0;
-
- Unlock:
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
-
- return error;
- }
-@@ -132,7 +132,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
- {
- struct snapshot_data *data;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
-
- swsusp_free();
- free_basic_memory_bitmaps();
-@@ -146,7 +146,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
- PM_POST_HIBERNATION : PM_POST_RESTORE);
- atomic_inc(&snapshot_device_available);
-
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
-
- return 0;
- }
-@@ -158,7 +158,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
- ssize_t res;
- loff_t pg_offp = *offp & ~PAGE_MASK;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
-
- data = filp->private_data;
- if (!data->ready) {
-@@ -179,7 +179,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
- *offp += res;
-
- Unlock:
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
-
- return res;
- }
-@@ -191,7 +191,7 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
- ssize_t res;
- loff_t pg_offp = *offp & ~PAGE_MASK;
-
-- mutex_lock(&pm_mutex);
-+ lock_system_sleep();
-
- data = filp->private_data;
-
-@@ -208,7 +208,7 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
- if (res > 0)
- *offp += res;
- unlock:
-- mutex_unlock(&pm_mutex);
-+ unlock_system_sleep();
-
- return res;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0154-PM-Sleep-Recommend-un-lock_system_sleep-over-using-p.patch b/patches.runtime_pm/0154-PM-Sleep-Recommend-un-lock_system_sleep-over-using-p.patch
deleted file mode 100644
index 529c7447819f4a..00000000000000
--- a/patches.runtime_pm/0154-PM-Sleep-Recommend-un-lock_system_sleep-over-using-p.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 48b23f3e7721987e92b83b9b3be3a3c9746ea8db Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Wed, 7 Dec 2011 22:30:09 +0100
-Subject: PM / Sleep: Recommend [un]lock_system_sleep() over using pm_mutex
- directly
-
-Update the documentation to explain the perils of directly using
-mutex_[un]lock(&pm_mutex) and recommend the usage of the safe
-APIs [un]lock_system_sleep() instead.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit cba3176e88fa134ece3ae1cf7e35dab9972d7853)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
-diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
-index 3ab9fbd..6ccb68f 100644
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -176,3 +176,28 @@ tasks, since it generally exists anyway.
- A driver must have all firmwares it may need in RAM before suspend() is called.
- If keeping them is not practical, for example due to their size, they must be
- requested early enough using the suspend notifier API described in notifiers.txt.
-+
-+VI. Are there any precautions to be taken to prevent freezing failures?
-+
-+Yes, there are.
-+
-+First of all, grabbing the 'pm_mutex' lock to mutually exclude a piece of code
-+from system-wide sleep such as suspend/hibernation is not encouraged.
-+If possible, that piece of code must instead hook onto the suspend/hibernation
-+notifiers to achieve mutual exclusion. Look at the CPU-Hotplug code
-+(kernel/cpu.c) for an example.
-+
-+However, if that is not feasible, and grabbing 'pm_mutex' is deemed necessary,
-+it is strongly discouraged to directly call mutex_[un]lock(&pm_mutex) since
-+that could lead to freezing failures, because if the suspend/hibernate code
-+successfully acquired the 'pm_mutex' lock, and hence that other entity failed
-+to acquire the lock, then that task would get blocked in TASK_UNINTERRUPTIBLE
-+state. As a consequence, the freezer would not be able to freeze that task,
-+leading to freezing failure.
-+
-+However, the [un]lock_system_sleep() APIs are safe to use in this scenario,
-+since they ask the freezer to skip freezing this task, since it is anyway
-+"frozen enough" as it is blocked on 'pm_mutex', which will be released
-+only after the entire suspend/hibernation sequence is complete.
-+So, to summarize, use [un]lock_system_sleep() instead of directly using
-+mutex_[un]lock(&pm_mutex). That would prevent freezing failures.
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0155-PM-Domains-Provide-an-always-on-power-domain-governo.patch b/patches.runtime_pm/0155-PM-Domains-Provide-an-always-on-power-domain-governo.patch
deleted file mode 100644
index b5cf444be95ece..00000000000000
--- a/patches.runtime_pm/0155-PM-Domains-Provide-an-always-on-power-domain-governo.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 4fe58a1e5cb487f882266b410d34b2c5041eea7c Mon Sep 17 00:00:00 2001
-From: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Date: Thu, 8 Dec 2011 23:27:28 +0100
-Subject: PM / Domains: Provide an always on power domain governor
-
-Since systems are likely to have power domains that can't be turned off
-for various reasons at least temporarily while implementing power domain
-support provide a default governor which will always refuse to power off
-the domain, saving platforms having to implement their own.
-
-Since the code is so tiny don't bother with a Kconfig symbol for it.
-
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 925b44a273aa8c4c23c006c1228aacd538eead09)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain_governor.c | 13 +++++++++++++
- include/linux/pm_domain.h | 2 ++
- 2 files changed, 15 insertions(+)
-
-diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
-index da78540..51527ee 100644
---- a/drivers/base/power/domain_governor.c
-+++ b/drivers/base/power/domain_governor.c
-@@ -141,3 +141,16 @@ struct dev_power_governor simple_qos_governor = {
- .stop_ok = default_stop_ok,
- .power_down_ok = default_power_down_ok,
- };
-+
-+static bool always_on_power_down_ok(struct dev_pm_domain *domain)
-+{
-+ return false;
-+}
-+
-+/**
-+ * pm_genpd_gov_always_on - A governor implementing an always-on policy
-+ */
-+struct dev_power_governor pm_domain_always_on_gov = {
-+ .power_down_ok = always_on_power_down_ok,
-+ .stop_ok = default_stop_ok,
-+};
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index fb809b9..a03a0ad 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -140,6 +140,7 @@ extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
-
- extern bool default_stop_ok(struct device *dev);
-
-+extern struct dev_power_governor pm_domain_always_on_gov;
- #else
-
- static inline struct generic_pm_domain *dev_to_genpd(struct device *dev)
-@@ -193,6 +194,7 @@ static inline bool default_stop_ok(struct device *dev)
- {
- return false;
- }
-+#define pm_domain_always_on_gov NULL
- #endif
-
- static inline int pm_genpd_remove_callbacks(struct device *dev)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0156-PM-Hibernate-Remove-deprecated-hibernation-snapshot-.patch b/patches.runtime_pm/0156-PM-Hibernate-Remove-deprecated-hibernation-snapshot-.patch
deleted file mode 100644
index 29ddbe368705be..00000000000000
--- a/patches.runtime_pm/0156-PM-Hibernate-Remove-deprecated-hibernation-snapshot-.patch
+++ /dev/null
@@ -1,190 +0,0 @@
-From ee1ef28d12bfe55da8da63631e8ea1b35c345977 Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Thu, 8 Dec 2011 23:42:53 +0100
-Subject: PM / Hibernate: Remove deprecated hibernation snapshot ioctls
-
-Several snapshot ioctls were marked for removal quite some time ago,
-since they were deprecated. Remove them.
-
-Suggested-by: Rafael J. Wysocki <rjw@sisk.pl>
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit cf007e3526a785a95a738d5a8fba44f1f4fe33e0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/feature-removal-schedule.txt | 11 ----
- kernel/power/user.c | 87 ----------------------------
- 2 files changed, 98 deletions(-)
-
-diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
-index b1c921c..7bb7798 100644
---- a/Documentation/feature-removal-schedule.txt
-+++ b/Documentation/feature-removal-schedule.txt
-@@ -85,17 +85,6 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com>
-
- ---------------------------
-
--What: Deprecated snapshot ioctls
--When: 2.6.36
--
--Why: The ioctls in kernel/power/user.c were marked as deprecated long time
-- ago. Now they notify users about that so that they need to replace
-- their userspace. After some more time, remove them completely.
--
--Who: Jiri Slaby <jirislaby@gmail.com>
--
-----------------------------
--
- What: The ieee80211_regdom module parameter
- When: March 2010 / desktop catchup
-
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 98ade21..78bdb44 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -30,28 +30,6 @@
-
- #include "power.h"
-
--/*
-- * NOTE: The SNAPSHOT_SET_SWAP_FILE and SNAPSHOT_PMOPS ioctls are obsolete and
-- * will be removed in the future. They are only preserved here for
-- * compatibility with existing userland utilities.
-- */
--#define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
--#define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int)
--
--#define PMOPS_PREPARE 1
--#define PMOPS_ENTER 2
--#define PMOPS_FINISH 3
--
--/*
-- * NOTE: The following ioctl definitions are wrong and have been replaced with
-- * correct ones. They are only preserved here for compatibility with existing
-- * userland utilities and will be removed in the future.
-- */
--#define SNAPSHOT_ATOMIC_SNAPSHOT _IOW(SNAPSHOT_IOC_MAGIC, 3, void *)
--#define SNAPSHOT_SET_IMAGE_SIZE _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long)
--#define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *)
--#define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *)
--
-
- #define SNAPSHOT_MINOR 231
-
-@@ -213,15 +191,6 @@ unlock:
- return res;
- }
-
--static void snapshot_deprecated_ioctl(unsigned int cmd)
--{
-- if (printk_ratelimit())
-- printk(KERN_NOTICE "%pf: ioctl '%.8x' is deprecated and will "
-- "be removed soon, update your suspend-to-disk "
-- "utilities\n",
-- __builtin_return_address(0), cmd);
--}
--
- static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- unsigned long arg)
- {
-@@ -272,8 +241,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- data->frozen = 0;
- break;
-
-- case SNAPSHOT_ATOMIC_SNAPSHOT:
-- snapshot_deprecated_ioctl(cmd);
- case SNAPSHOT_CREATE_IMAGE:
- if (data->mode != O_RDONLY || !data->frozen || data->ready) {
- error = -EPERM;
-@@ -308,8 +275,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- data->ready = 0;
- break;
-
-- case SNAPSHOT_SET_IMAGE_SIZE:
-- snapshot_deprecated_ioctl(cmd);
- case SNAPSHOT_PREF_IMAGE_SIZE:
- image_size = arg;
- break;
-@@ -324,16 +289,12 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- error = put_user(size, (loff_t __user *)arg);
- break;
-
-- case SNAPSHOT_AVAIL_SWAP:
-- snapshot_deprecated_ioctl(cmd);
- case SNAPSHOT_AVAIL_SWAP_SIZE:
- size = count_swap_pages(data->swap, 1);
- size <<= PAGE_SHIFT;
- error = put_user(size, (loff_t __user *)arg);
- break;
-
-- case SNAPSHOT_GET_SWAP_PAGE:
-- snapshot_deprecated_ioctl(cmd);
- case SNAPSHOT_ALLOC_SWAP_PAGE:
- if (data->swap < 0 || data->swap >= MAX_SWAPFILES) {
- error = -ENODEV;
-@@ -356,27 +317,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- free_all_swap_pages(data->swap);
- break;
-
-- case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */
-- snapshot_deprecated_ioctl(cmd);
-- if (!swsusp_swap_in_use()) {
-- /*
-- * User space encodes device types as two-byte values,
-- * so we need to recode them
-- */
-- if (old_decode_dev(arg)) {
-- data->swap = swap_type_of(old_decode_dev(arg),
-- 0, NULL);
-- if (data->swap < 0)
-- error = -ENODEV;
-- } else {
-- data->swap = -1;
-- error = -EINVAL;
-- }
-- } else {
-- error = -EPERM;
-- }
-- break;
--
- case SNAPSHOT_S2RAM:
- if (!data->frozen) {
- error = -EPERM;
-@@ -399,33 +339,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- error = hibernation_platform_enter();
- break;
-
-- case SNAPSHOT_PMOPS: /* This ioctl is deprecated */
-- snapshot_deprecated_ioctl(cmd);
-- error = -EINVAL;
--
-- switch (arg) {
--
-- case PMOPS_PREPARE:
-- data->platform_support = 1;
-- error = 0;
-- break;
--
-- case PMOPS_ENTER:
-- if (data->platform_support)
-- error = hibernation_platform_enter();
-- break;
--
-- case PMOPS_FINISH:
-- if (data->platform_support)
-- error = 0;
-- break;
--
-- default:
-- printk(KERN_ERR "SNAPSHOT_PMOPS: invalid argument %ld\n", arg);
--
-- }
-- break;
--
- case SNAPSHOT_SET_SWAP_AREA:
- if (swsusp_swap_in_use()) {
- error = -EPERM;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0157-PM-Sleep-Simplify-generic-system-suspend-callbacks.patch b/patches.runtime_pm/0157-PM-Sleep-Simplify-generic-system-suspend-callbacks.patch
deleted file mode 100644
index 376d72f61bbc06..00000000000000
--- a/patches.runtime_pm/0157-PM-Sleep-Simplify-generic-system-suspend-callbacks.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 40e96ab9923917457fdee1fb41be5a62248e4358 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 15 Dec 2011 20:59:23 +0100
-Subject: PM / Sleep: Simplify generic system suspend callbacks
-
-The pm_runtime_suspended() check in __pm_generic_call() doesn't
-really help and may cause problems to happen, because in some cases
-the system suspend callbacks need to be called even if the given
-device has been suspended by runtime PM. For example, if the device
-generally supports remote wakeup and is not enabled to wake up
-the system from sleep, it should be prevented from generating wakeup
-signals during system suspend and that has to be done by the
-suspend callbacks that the pm_runtime_suspended() check prevents from
-being executed.
-
-Similarly, it may not be a good idea to unconditionally change
-the runtime PM status of the device to 'active' in
-__pm_generic_resume(), because the driver may want to leave the
-device in the 'suspended' state, depending on what happened to it
-before the system suspend and whether or not it is enabled to
-wake up the system.
-
-For the above reasons, remove the pm_runtime_suspended()
-check from __pm_generic_call() and remove the code changing the
-device's runtime PM status from __pm_generic_resume().
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 8ca6d9bcc8d33c592c0855b4b1481bc723ac7e85)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/generic_ops.c | 24 ++++++------------------
- 1 file changed, 6 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index 265a0ee..1b878b955 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -97,16 +97,16 @@ int pm_generic_prepare(struct device *dev)
- * @event: PM transition of the system under way.
- * @bool: Whether or not this is the "noirq" stage.
- *
-- * If the device has not been suspended at run time, execute the
-- * suspend/freeze/poweroff/thaw callback provided by its driver, if defined, and
-- * return its error code. Otherwise, return zero.
-+ * Execute the suspend/freeze/poweroff/thaw callback provided by the driver of
-+ * @dev, if defined, and return its error code. Return 0 if the callback is
-+ * not present.
- */
- static int __pm_generic_call(struct device *dev, int event, bool noirq)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- int (*callback)(struct device *);
-
-- if (!pm || pm_runtime_suspended(dev))
-+ if (!pm)
- return 0;
-
- switch (event) {
-@@ -217,14 +217,12 @@ EXPORT_SYMBOL_GPL(pm_generic_thaw);
- * @bool: Whether or not this is the "noirq" stage.
- *
- * Execute the resume/resotre callback provided by the @dev's driver, if
-- * defined. If it returns 0, change the device's runtime PM status to 'active'.
-- * Return the callback's error code.
-+ * defined, and return its error code. Return 0 if the callback is not present.
- */
- static int __pm_generic_resume(struct device *dev, int event, bool noirq)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- int (*callback)(struct device *);
-- int ret;
-
- if (!pm)
- return 0;
-@@ -241,17 +239,7 @@ static int __pm_generic_resume(struct device *dev, int event, bool noirq)
- break;
- }
-
-- if (!callback)
-- return 0;
--
-- ret = callback(dev);
-- if (!ret && !noirq && pm_runtime_enabled(dev)) {
-- pm_runtime_disable(dev);
-- pm_runtime_set_active(dev);
-- pm_runtime_enable(dev);
-- }
--
-- return ret;
-+ return callback ? callback(dev) : 0;
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0158-PM-Sleep-Merge-internal-functions-in-generic_ops.c.patch b/patches.runtime_pm/0158-PM-Sleep-Merge-internal-functions-in-generic_ops.c.patch
deleted file mode 100644
index ccb9d80b58e70a..00000000000000
--- a/patches.runtime_pm/0158-PM-Sleep-Merge-internal-functions-in-generic_ops.c.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From e34db5ebf8c9e55fddb85498247ea9ceedd7c744 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Thu, 15 Dec 2011 20:59:30 +0100
-Subject: PM / Sleep: Merge internal functions in generic_ops.c
-
-After the change that removed the code related to runtime PM
-from __pm_generic_call() and __pm_generic_resume() these two
-functions need not be separate any more, so merge them.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 1eac8111e0763853266a171ce11214da3a347a0a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/generic_ops.c | 48 +++++++++-----------------------------
- 1 file changed, 11 insertions(+), 37 deletions(-)
-
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index 1b878b955..5a5b154 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -97,7 +97,7 @@ int pm_generic_prepare(struct device *dev)
- * @event: PM transition of the system under way.
- * @bool: Whether or not this is the "noirq" stage.
- *
-- * Execute the suspend/freeze/poweroff/thaw callback provided by the driver of
-+ * Execute the PM callback corresponding to @event provided by the driver of
- * @dev, if defined, and return its error code. Return 0 if the callback is
- * not present.
- */
-@@ -119,9 +119,15 @@ static int __pm_generic_call(struct device *dev, int event, bool noirq)
- case PM_EVENT_HIBERNATE:
- callback = noirq ? pm->poweroff_noirq : pm->poweroff;
- break;
-+ case PM_EVENT_RESUME:
-+ callback = noirq ? pm->resume_noirq : pm->resume;
-+ break;
- case PM_EVENT_THAW:
- callback = noirq ? pm->thaw_noirq : pm->thaw;
- break;
-+ case PM_EVENT_RESTORE:
-+ callback = noirq ? pm->restore_noirq : pm->restore;
-+ break;
- default:
- callback = NULL;
- break;
-@@ -211,44 +217,12 @@ int pm_generic_thaw(struct device *dev)
- EXPORT_SYMBOL_GPL(pm_generic_thaw);
-
- /**
-- * __pm_generic_resume - Generic resume/restore callback for subsystems.
-- * @dev: Device to handle.
-- * @event: PM transition of the system under way.
-- * @bool: Whether or not this is the "noirq" stage.
-- *
-- * Execute the resume/resotre callback provided by the @dev's driver, if
-- * defined, and return its error code. Return 0 if the callback is not present.
-- */
--static int __pm_generic_resume(struct device *dev, int event, bool noirq)
--{
-- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-- int (*callback)(struct device *);
--
-- if (!pm)
-- return 0;
--
-- switch (event) {
-- case PM_EVENT_RESUME:
-- callback = noirq ? pm->resume_noirq : pm->resume;
-- break;
-- case PM_EVENT_RESTORE:
-- callback = noirq ? pm->restore_noirq : pm->restore;
-- break;
-- default:
-- callback = NULL;
-- break;
-- }
--
-- return callback ? callback(dev) : 0;
--}
--
--/**
- * pm_generic_resume_noirq - Generic resume_noirq callback for subsystems.
- * @dev: Device to resume.
- */
- int pm_generic_resume_noirq(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESUME, true);
-+ return __pm_generic_call(dev, PM_EVENT_RESUME, true);
- }
- EXPORT_SYMBOL_GPL(pm_generic_resume_noirq);
-
-@@ -258,7 +232,7 @@ EXPORT_SYMBOL_GPL(pm_generic_resume_noirq);
- */
- int pm_generic_resume(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESUME, false);
-+ return __pm_generic_call(dev, PM_EVENT_RESUME, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_resume);
-
-@@ -268,7 +242,7 @@ EXPORT_SYMBOL_GPL(pm_generic_resume);
- */
- int pm_generic_restore_noirq(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESTORE, true);
-+ return __pm_generic_call(dev, PM_EVENT_RESTORE, true);
- }
- EXPORT_SYMBOL_GPL(pm_generic_restore_noirq);
-
-@@ -278,7 +252,7 @@ EXPORT_SYMBOL_GPL(pm_generic_restore_noirq);
- */
- int pm_generic_restore(struct device *dev)
- {
-- return __pm_generic_resume(dev, PM_EVENT_RESTORE, false);
-+ return __pm_generic_call(dev, PM_EVENT_RESTORE, false);
- }
- EXPORT_SYMBOL_GPL(pm_generic_restore);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0159-PM-Sleep-Make-pm_op-and-pm_noirq_op-return-callback-.patch b/patches.runtime_pm/0159-PM-Sleep-Make-pm_op-and-pm_noirq_op-return-callback-.patch
deleted file mode 100644
index b7922234c58f98..00000000000000
--- a/patches.runtime_pm/0159-PM-Sleep-Make-pm_op-and-pm_noirq_op-return-callback-.patch
+++ /dev/null
@@ -1,394 +0,0 @@
-From e67ec224d27ba800a297dfc34310a2a873581b2e Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 18 Dec 2011 00:34:01 +0100
-Subject: PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
-
-Make the pm_op() and pm_noirq_op() functions return pointers to
-appropriate callbacks instead of executing those callbacks and
-returning their results.
-
-This change is required for a subsequent modification that will
-execute the corresponding driver callback if the subsystem
-callback returned by either pm_op(), or pm_noirq_op() is NULL.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9cf519d1c15fa05a538c2b3963c5f3903daf765a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/main.c | 197 ++++++++++++++++++++++-----------------------
- 1 file changed, 95 insertions(+), 102 deletions(-)
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index b570189..b5cef7e 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -32,6 +32,8 @@
- #include "../base.h"
- #include "power.h"
-
-+typedef int (*pm_callback_t)(struct device *);
-+
- /*
- * The entries in the dpm_list list are in a depth first order, simply
- * because children are guaranteed to be discovered after parents, and
-@@ -211,113 +213,70 @@ static void dpm_wait_for_children(struct device *dev, bool async)
- device_for_each_child(dev, &async, dpm_wait_fn);
- }
-
--static int dpm_run_callback(struct device *dev, int (*cb)(struct device *))
--{
-- ktime_t calltime;
-- int error;
--
-- if (!cb)
-- return 0;
--
-- calltime = initcall_debug_start(dev);
--
-- error = cb(dev);
-- suspend_report_result(cb, error);
--
-- initcall_debug_report(dev, calltime, error);
--
-- return error;
--}
--
- /**
-- * pm_op - Execute the PM operation appropriate for given PM event.
-- * @dev: Device to handle.
-+ * pm_op - Return the PM operation appropriate for given PM event.
- * @ops: PM operations to choose from.
- * @state: PM transition of the system being carried out.
- */
--static int pm_op(struct device *dev,
-- const struct dev_pm_ops *ops,
-- pm_message_t state)
-+static pm_callback_t pm_op(const struct dev_pm_ops *ops, pm_message_t state)
- {
-- int error = 0;
--
- switch (state.event) {
- #ifdef CONFIG_SUSPEND
- case PM_EVENT_SUSPEND:
-- error = dpm_run_callback(dev, ops->suspend);
-- break;
-+ return ops->suspend;
- case PM_EVENT_RESUME:
-- error = dpm_run_callback(dev, ops->resume);
-- break;
-+ return ops->resume;
- #endif /* CONFIG_SUSPEND */
- #ifdef CONFIG_HIBERNATE_CALLBACKS
- case PM_EVENT_FREEZE:
- case PM_EVENT_QUIESCE:
-- error = dpm_run_callback(dev, ops->freeze);
-- break;
-+ return ops->freeze;
- case PM_EVENT_HIBERNATE:
-- error = dpm_run_callback(dev, ops->poweroff);
-- break;
-+ return ops->poweroff;
- case PM_EVENT_THAW:
- case PM_EVENT_RECOVER:
-- error = dpm_run_callback(dev, ops->thaw);
-+ return ops->thaw;
- break;
- case PM_EVENT_RESTORE:
-- error = dpm_run_callback(dev, ops->restore);
-- break;
-+ return ops->restore;
- #endif /* CONFIG_HIBERNATE_CALLBACKS */
-- default:
-- error = -EINVAL;
- }
-
-- return error;
-+ return NULL;
- }
-
- /**
-- * pm_noirq_op - Execute the PM operation appropriate for given PM event.
-- * @dev: Device to handle.
-+ * pm_noirq_op - Return the PM operation appropriate for given PM event.
- * @ops: PM operations to choose from.
- * @state: PM transition of the system being carried out.
- *
- * The driver of @dev will not receive interrupts while this function is being
- * executed.
- */
--static int pm_noirq_op(struct device *dev,
-- const struct dev_pm_ops *ops,
-- pm_message_t state)
-+static pm_callback_t pm_noirq_op(const struct dev_pm_ops *ops, pm_message_t state)
- {
-- int error = 0;
--
- switch (state.event) {
- #ifdef CONFIG_SUSPEND
- case PM_EVENT_SUSPEND:
-- error = dpm_run_callback(dev, ops->suspend_noirq);
-- break;
-+ return ops->suspend_noirq;
- case PM_EVENT_RESUME:
-- error = dpm_run_callback(dev, ops->resume_noirq);
-- break;
-+ return ops->resume_noirq;
- #endif /* CONFIG_SUSPEND */
- #ifdef CONFIG_HIBERNATE_CALLBACKS
- case PM_EVENT_FREEZE:
- case PM_EVENT_QUIESCE:
-- error = dpm_run_callback(dev, ops->freeze_noirq);
-- break;
-+ return ops->freeze_noirq;
- case PM_EVENT_HIBERNATE:
-- error = dpm_run_callback(dev, ops->poweroff_noirq);
-- break;
-+ return ops->poweroff_noirq;
- case PM_EVENT_THAW:
- case PM_EVENT_RECOVER:
-- error = dpm_run_callback(dev, ops->thaw_noirq);
-- break;
-+ return ops->thaw_noirq;
- case PM_EVENT_RESTORE:
-- error = dpm_run_callback(dev, ops->restore_noirq);
-- break;
-+ return ops->restore_noirq;
- #endif /* CONFIG_HIBERNATE_CALLBACKS */
-- default:
-- error = -EINVAL;
- }
-
-- return error;
-+ return NULL;
- }
-
- static char *pm_verb(int event)
-@@ -375,6 +334,26 @@ static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
- usecs / USEC_PER_MSEC, usecs % USEC_PER_MSEC);
- }
-
-+static int dpm_run_callback(pm_callback_t cb, struct device *dev,
-+ pm_message_t state, char *info)
-+{
-+ ktime_t calltime;
-+ int error;
-+
-+ if (!cb)
-+ return 0;
-+
-+ calltime = initcall_debug_start(dev);
-+
-+ pm_dev_dbg(dev, state, info);
-+ error = cb(dev);
-+ suspend_report_result(cb, error);
-+
-+ initcall_debug_report(dev, calltime, error);
-+
-+ return error;
-+}
-+
- /*------------------------- Resume routines -------------------------*/
-
- /**
-@@ -387,25 +366,29 @@ static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
- */
- static int device_resume_noirq(struct device *dev, pm_message_t state)
- {
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
- int error = 0;
-
- TRACE_DEVICE(dev);
- TRACE_RESUME(0);
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "EARLY power domain ");
-- error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
-+ info = "EARLY power domain ";
-+ callback = pm_noirq_op(&dev->pm_domain->ops, state);
- } else if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "EARLY type ");
-- error = pm_noirq_op(dev, dev->type->pm, state);
-+ info = "EARLY type ";
-+ callback = pm_noirq_op(dev->type->pm, state);
- } else if (dev->class && dev->class->pm) {
-- pm_dev_dbg(dev, state, "EARLY class ");
-- error = pm_noirq_op(dev, dev->class->pm, state);
-+ info = "EARLY class ";
-+ callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- pm_dev_dbg(dev, state, "EARLY ");
-- error = pm_noirq_op(dev, dev->bus->pm, state);
-+ info = "EARLY ";
-+ callback = pm_noirq_op(dev->bus->pm, state);
- }
-
-+ error = dpm_run_callback(callback, dev, state, info);
-+
- TRACE_RESUME(error);
- return error;
- }
-@@ -455,6 +438,8 @@ EXPORT_SYMBOL_GPL(dpm_resume_noirq);
- */
- static int device_resume(struct device *dev, pm_message_t state, bool async)
- {
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
- int error = 0;
- bool put = false;
-
-@@ -477,40 +462,41 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- put = true;
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "power domain ");
-- error = pm_op(dev, &dev->pm_domain->ops, state);
-+ info = "power domain ";
-+ callback = pm_op(&dev->pm_domain->ops, state);
- goto End;
- }
-
- if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "type ");
-- error = pm_op(dev, dev->type->pm, state);
-+ info = "type ";
-+ callback = pm_op(dev->type->pm, state);
- goto End;
- }
-
- if (dev->class) {
- if (dev->class->pm) {
-- pm_dev_dbg(dev, state, "class ");
-- error = pm_op(dev, dev->class->pm, state);
-+ info = "class ";
-+ callback = pm_op(dev->class->pm, state);
- goto End;
- } else if (dev->class->resume) {
-- pm_dev_dbg(dev, state, "legacy class ");
-- error = dpm_run_callback(dev, dev->class->resume);
-+ info = "legacy class ";
-+ callback = dev->class->resume;
- goto End;
- }
- }
-
- if (dev->bus) {
- if (dev->bus->pm) {
-- pm_dev_dbg(dev, state, "");
-- error = pm_op(dev, dev->bus->pm, state);
-+ info = "";
-+ callback = pm_op(dev->bus->pm, state);
- } else if (dev->bus->resume) {
-- pm_dev_dbg(dev, state, "legacy ");
-- error = dpm_run_callback(dev, dev->bus->resume);
-+ info = "legacy ";
-+ callback = dev->bus->resume;
- }
- }
-
- End:
-+ error = dpm_run_callback(callback, dev, state, info);
- dev->power.is_suspended = false;
-
- Unlock:
-@@ -705,23 +691,24 @@ static pm_message_t resume_event(pm_message_t sleep_state)
- */
- static int device_suspend_noirq(struct device *dev, pm_message_t state)
- {
-- int error = 0;
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "LATE power domain ");
-- error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
-+ info = "LATE power domain ";
-+ callback = pm_noirq_op(&dev->pm_domain->ops, state);
- } else if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "LATE type ");
-- error = pm_noirq_op(dev, dev->type->pm, state);
-+ info = "LATE type ";
-+ callback = pm_noirq_op(dev->type->pm, state);
- } else if (dev->class && dev->class->pm) {
-- pm_dev_dbg(dev, state, "LATE class ");
-- error = pm_noirq_op(dev, dev->class->pm, state);
-+ info = "LATE class ";
-+ callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- pm_dev_dbg(dev, state, "LATE ");
-- error = pm_noirq_op(dev, dev->bus->pm, state);
-+ info = "LATE ";
-+ callback = pm_noirq_op(dev->bus->pm, state);
- }
-
-- return error;
-+ return dpm_run_callback(callback, dev, state, info);
- }
-
- /**
-@@ -798,6 +785,8 @@ static int legacy_suspend(struct device *dev, pm_message_t state,
- */
- static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- {
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
- int error = 0;
-
- dpm_wait_for_children(dev, async);
-@@ -818,22 +807,22 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
- device_lock(dev);
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "power domain ");
-- error = pm_op(dev, &dev->pm_domain->ops, state);
-- goto End;
-+ info = "power domain ";
-+ callback = pm_op(&dev->pm_domain->ops, state);
-+ goto Run;
- }
-
- if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "type ");
-- error = pm_op(dev, dev->type->pm, state);
-- goto End;
-+ info = "type ";
-+ callback = pm_op(dev->type->pm, state);
-+ goto Run;
- }
-
- if (dev->class) {
- if (dev->class->pm) {
-- pm_dev_dbg(dev, state, "class ");
-- error = pm_op(dev, dev->class->pm, state);
-- goto End;
-+ info = "class ";
-+ callback = pm_op(dev->class->pm, state);
-+ goto Run;
- } else if (dev->class->suspend) {
- pm_dev_dbg(dev, state, "legacy class ");
- error = legacy_suspend(dev, state, dev->class->suspend);
-@@ -843,14 +832,18 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
-
- if (dev->bus) {
- if (dev->bus->pm) {
-- pm_dev_dbg(dev, state, "");
-- error = pm_op(dev, dev->bus->pm, state);
-+ info = "";
-+ callback = pm_op(dev->bus->pm, state);
- } else if (dev->bus->suspend) {
- pm_dev_dbg(dev, state, "legacy ");
- error = legacy_suspend(dev, state, dev->bus->suspend);
-+ goto End;
- }
- }
-
-+ Run:
-+ error = dpm_run_callback(callback, dev, state, info);
-+
- End:
- if (!error) {
- dev->power.is_suspended = true;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0160-PM-Run-the-driver-callback-directly-if-the-subsystem.patch b/patches.runtime_pm/0160-PM-Run-the-driver-callback-directly-if-the-subsystem.patch
deleted file mode 100644
index af0ba797821156..00000000000000
--- a/patches.runtime_pm/0160-PM-Run-the-driver-callback-directly-if-the-subsystem.patch
+++ /dev/null
@@ -1,512 +0,0 @@
-From 489af6027ddbe97a7922473881a74a3e2b7e59bf Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 18 Dec 2011 00:34:13 +0100
-Subject: PM: Run the driver callback directly if the subsystem one is not
- there
-
-Make the PM core execute driver PM callbacks directly if the
-corresponding subsystem callbacks are not present.
-
-There are three reasons for doing that. First, it reflects the
-behavior of drivers/base/dd.c:really_probe() that runs the driver's
-.probe() callback directly if the bus type's one is not defined, so
-this change will remove one arbitrary difference between the PM core
-and the remaining parts of the driver core. Second, it will allow
-some subsystems, whose PM callbacks don't do anything except for
-executing driver callbacks, to be simplified quite a bit by removing
-those "forward-only" callbacks. Finally, it will allow us to remove
-one level of indirection in the system suspend and resume code paths
-where it is not necessary, which is going to lead to less debug noise
-with initcall_debug passed in the kernel command line (messages won't
-be printed for driverless devices whose subsystems don't provide
-PM callbacks among other things).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 35cd133c6130c1eb52806808abee9d62e6854a27)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 37 +++++-----
- Documentation/power/runtime_pm.txt | 130 +++++++++++++++++++-----------------
- drivers/base/power/main.c | 109 ++++++++++++++++++++----------
- drivers/base/power/runtime.c | 9 +++
- 4 files changed, 170 insertions(+), 115 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 3139fb5..20af7de 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -126,7 +126,9 @@ The core methods to suspend and resume devices reside in struct dev_pm_ops
- pointed to by the ops member of struct dev_pm_domain, or by the pm member of
- struct bus_type, struct device_type and struct class. They are mostly of
- interest to the people writing infrastructure for platforms and buses, like PCI
--or USB, or device type and device class drivers.
-+or USB, or device type and device class drivers. They also are relevant to the
-+writers of device drivers whose subsystems (PM domains, device types, device
-+classes and bus types) don't provide all power management methods.
-
- Bus drivers implement these methods as appropriate for the hardware and the
- drivers using it; PCI works differently from USB, and so on. Not many people
-@@ -268,32 +270,35 @@ various phases always run after tasks have been frozen and before they are
- unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
- been disabled (except for those marked with the IRQF_NO_SUSPEND flag).
-
--All phases use PM domain, bus, type, or class callbacks (that is, methods
--defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, or dev->class->pm).
--These callbacks are regarded by the PM core as mutually exclusive. Moreover,
--PM domain callbacks always take precedence over bus, type and class callbacks,
--while type callbacks take precedence over bus and class callbacks, and class
--callbacks take precedence over bus callbacks. To be precise, the following
--rules are used to determine which callback to execute in the given phase:
-+All phases use PM domain, bus, type, class or driver callbacks (that is, methods
-+defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, dev->class->pm or
-+dev->driver->pm). These callbacks are regarded by the PM core as mutually
-+exclusive. Moreover, PM domain callbacks always take precedence over all of the
-+other callbacks and, for example, type callbacks take precedence over bus, class
-+and driver callbacks. To be precise, the following rules are used to determine
-+which callback to execute in the given phase:
-
-- 1. If dev->pm_domain is present, the PM core will attempt to execute the
-- callback included in dev->pm_domain->ops. If that callback is not
-- present, no action will be carried out for the given device.
-+ 1. If dev->pm_domain is present, the PM core will choose the callback
-+ included in dev->pm_domain->ops for execution
-
- 2. Otherwise, if both dev->type and dev->type->pm are present, the callback
-- included in dev->type->pm will be executed.
-+ included in dev->type->pm will be chosen for execution.
-
- 3. Otherwise, if both dev->class and dev->class->pm are present, the
-- callback included in dev->class->pm will be executed.
-+ callback included in dev->class->pm will be chosen for execution.
-
- 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback
-- included in dev->bus->pm will be executed.
-+ included in dev->bus->pm will be chosen for execution.
-
- This allows PM domains and device types to override callbacks provided by bus
- types or device classes if necessary.
-
--These callbacks may in turn invoke device- or driver-specific methods stored in
--dev->driver->pm, but they don't have to.
-+The PM domain, type, class and bus callbacks may in turn invoke device- or
-+driver-specific methods stored in dev->driver->pm, but they don't have to do
-+that.
-+
-+If the subsystem callback chosen for execution is not present, the PM core will
-+execute the corresponding method from dev->driver->pm instead if there is one.
-
-
- Entering System Suspend
-diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
-index c2ae8bf..4abe83e 100644
---- a/Documentation/power/runtime_pm.txt
-+++ b/Documentation/power/runtime_pm.txt
-@@ -57,6 +57,10 @@ the following:
-
- 4. Bus type of the device, if both dev->bus and dev->bus->pm are present.
-
-+If the subsystem chosen by applying the above rules doesn't provide the relevant
-+callback, the PM core will invoke the corresponding driver callback stored in
-+dev->driver->pm directly (if present).
-+
- The PM core always checks which callback to use in the order given above, so the
- priority order of callbacks from high to low is: PM domain, device type, class
- and bus type. Moreover, the high-priority one will always take precedence over
-@@ -64,86 +68,88 @@ a low-priority one. The PM domain, bus type, device type and class callbacks
- are referred to as subsystem-level callbacks in what follows.
-
- By default, the callbacks are always invoked in process context with interrupts
--enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
--to tell the PM core that their ->runtime_suspend(), ->runtime_resume() and
--->runtime_idle() callbacks may be invoked in atomic context with interrupts
--disabled for a given device. This implies that the callback routines in
--question must not block or sleep, but it also means that the synchronous helper
--functions listed at the end of Section 4 may be used for that device within an
--interrupt handler or generally in an atomic context.
--
--The subsystem-level suspend callback is _entirely_ _responsible_ for handling
--the suspend of the device as appropriate, which may, but need not include
--executing the device driver's own ->runtime_suspend() callback (from the
-+enabled. However, the pm_runtime_irq_safe() helper function can be used to tell
-+the PM core that it is safe to run the ->runtime_suspend(), ->runtime_resume()
-+and ->runtime_idle() callbacks for the given device in atomic context with
-+interrupts disabled. This implies that the callback routines in question must
-+not block or sleep, but it also means that the synchronous helper functions
-+listed at the end of Section 4 may be used for that device within an interrupt
-+handler or generally in an atomic context.
-+
-+The subsystem-level suspend callback, if present, is _entirely_ _responsible_
-+for handling the suspend of the device as appropriate, which may, but need not
-+include executing the device driver's own ->runtime_suspend() callback (from the
- PM core's point of view it is not necessary to implement a ->runtime_suspend()
- callback in a device driver as long as the subsystem-level suspend callback
- knows what to do to handle the device).
-
-- * Once the subsystem-level suspend callback has completed successfully
-- for given device, the PM core regards the device as suspended, which need
-- not mean that the device has been put into a low power state. It is
-- supposed to mean, however, that the device will not process data and will
-- not communicate with the CPU(s) and RAM until the subsystem-level resume
-- callback is executed for it. The runtime PM status of a device after
-- successful execution of the subsystem-level suspend callback is 'suspended'.
--
-- * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN,
-- the device's runtime PM status is 'active', which means that the device
-- _must_ be fully operational afterwards.
--
-- * If the subsystem-level suspend callback returns an error code different
-- from -EBUSY or -EAGAIN, the PM core regards this as a fatal error and will
-- refuse to run the helper functions described in Section 4 for the device,
-- until the status of it is directly set either to 'active', or to 'suspended'
-- (the PM core provides special helper functions for this purpose).
--
--In particular, if the driver requires remote wake-up capability (i.e. hardware
-+ * Once the subsystem-level suspend callback (or the driver suspend callback,
-+ if invoked directly) has completed successfully for the given device, the PM
-+ core regards the device as suspended, which need not mean that it has been
-+ put into a low power state. It is supposed to mean, however, that the
-+ device will not process data and will not communicate with the CPU(s) and
-+ RAM until the appropriate resume callback is executed for it. The runtime
-+ PM status of a device after successful execution of the suspend callback is
-+ 'suspended'.
-+
-+ * If the suspend callback returns -EBUSY or -EAGAIN, the device's runtime PM
-+ status remains 'active', which means that the device _must_ be fully
-+ operational afterwards.
-+
-+ * If the suspend callback returns an error code different from -EBUSY and
-+ -EAGAIN, the PM core regards this as a fatal error and will refuse to run
-+ the helper functions described in Section 4 for the device until its status
-+ is directly set to either'active', or 'suspended' (the PM core provides
-+ special helper functions for this purpose).
-+
-+In particular, if the driver requires remote wakeup capability (i.e. hardware
- mechanism allowing the device to request a change of its power state, such as
- PCI PME) for proper functioning and device_run_wake() returns 'false' for the
- device, then ->runtime_suspend() should return -EBUSY. On the other hand, if
--device_run_wake() returns 'true' for the device and the device is put into a low
--power state during the execution of the subsystem-level suspend callback, it is
--expected that remote wake-up will be enabled for the device. Generally, remote
--wake-up should be enabled for all input devices put into a low power state at
--run time.
--
--The subsystem-level resume callback is _entirely_ _responsible_ for handling the
--resume of the device as appropriate, which may, but need not include executing
--the device driver's own ->runtime_resume() callback (from the PM core's point of
--view it is not necessary to implement a ->runtime_resume() callback in a device
--driver as long as the subsystem-level resume callback knows what to do to handle
--the device).
--
-- * Once the subsystem-level resume callback has completed successfully, the PM
-- core regards the device as fully operational, which means that the device
-- _must_ be able to complete I/O operations as needed. The runtime PM status
-- of the device is then 'active'.
--
-- * If the subsystem-level resume callback returns an error code, the PM core
-- regards this as a fatal error and will refuse to run the helper functions
-- described in Section 4 for the device, until its status is directly set
-- either to 'active' or to 'suspended' (the PM core provides special helper
-- functions for this purpose).
--
--The subsystem-level idle callback is executed by the PM core whenever the device
--appears to be idle, which is indicated to the PM core by two counters, the
--device's usage counter and the counter of 'active' children of the device.
-+device_run_wake() returns 'true' for the device and the device is put into a
-+low-power state during the execution of the suspend callback, it is expected
-+that remote wakeup will be enabled for the device. Generally, remote wakeup
-+should be enabled for all input devices put into low-power states at run time.
-+
-+The subsystem-level resume callback, if present, is _entirely_ _responsible_ for
-+handling the resume of the device as appropriate, which may, but need not
-+include executing the device driver's own ->runtime_resume() callback (from the
-+PM core's point of view it is not necessary to implement a ->runtime_resume()
-+callback in a device driver as long as the subsystem-level resume callback knows
-+what to do to handle the device).
-+
-+ * Once the subsystem-level resume callback (or the driver resume callback, if
-+ invoked directly) has completed successfully, the PM core regards the device
-+ as fully operational, which means that the device _must_ be able to complete
-+ I/O operations as needed. The runtime PM status of the device is then
-+ 'active'.
-+
-+ * If the resume callback returns an error code, the PM core regards this as a
-+ fatal error and will refuse to run the helper functions described in Section
-+ 4 for the device, until its status is directly set to either 'active', or
-+ 'suspended' (by means of special helper functions provided by the PM core
-+ for this purpose).
-+
-+The idle callback (a subsystem-level one, if present, or the driver one) is
-+executed by the PM core whenever the device appears to be idle, which is
-+indicated to the PM core by two counters, the device's usage counter and the
-+counter of 'active' children of the device.
-
- * If any of these counters is decreased using a helper function provided by
- the PM core and it turns out to be equal to zero, the other counter is
- checked. If that counter also is equal to zero, the PM core executes the
-- subsystem-level idle callback with the device as an argument.
-+ idle callback with the device as its argument.
-
--The action performed by a subsystem-level idle callback is totally dependent on
--the subsystem in question, but the expected and recommended action is to check
-+The action performed by the idle callback is totally dependent on the subsystem
-+(or driver) in question, but the expected and recommended action is to check
- if the device can be suspended (i.e. if all of the conditions necessary for
- suspending the device are satisfied) and to queue up a suspend request for the
- device in that case. The value returned by this callback is ignored by the PM
- core.
-
- The helper functions provided by the PM core, described in Section 4, guarantee
--that the following constraints are met with respect to the bus type's runtime
--PM callbacks:
-+that the following constraints are met with respect to runtime PM callbacks for
-+one device:
-
- (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute
- ->runtime_suspend() in parallel with ->runtime_resume() or with another
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index b5cef7e..e2cc3d2 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -383,10 +383,15 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
- info = "EARLY class ";
- callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- info = "EARLY ";
-+ info = "EARLY bus ";
- callback = pm_noirq_op(dev->bus->pm, state);
- }
-
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "EARLY driver ";
-+ callback = pm_noirq_op(dev->driver->pm, state);
-+ }
-+
- error = dpm_run_callback(callback, dev, state, info);
-
- TRACE_RESUME(error);
-@@ -464,20 +469,20 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
- if (dev->pm_domain) {
- info = "power domain ";
- callback = pm_op(&dev->pm_domain->ops, state);
-- goto End;
-+ goto Driver;
- }
-
- if (dev->type && dev->type->pm) {
- info = "type ";
- callback = pm_op(dev->type->pm, state);
-- goto End;
-+ goto Driver;
- }
-
- if (dev->class) {
- if (dev->class->pm) {
- info = "class ";
- callback = pm_op(dev->class->pm, state);
-- goto End;
-+ goto Driver;
- } else if (dev->class->resume) {
- info = "legacy class ";
- callback = dev->class->resume;
-@@ -487,14 +492,21 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
-
- if (dev->bus) {
- if (dev->bus->pm) {
-- info = "";
-+ info = "bus ";
- callback = pm_op(dev->bus->pm, state);
- } else if (dev->bus->resume) {
-- info = "legacy ";
-+ info = "legacy bus ";
- callback = dev->bus->resume;
-+ goto End;
- }
- }
-
-+ Driver:
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "driver ";
-+ callback = pm_op(dev->driver->pm, state);
-+ }
-+
- End:
- error = dpm_run_callback(callback, dev, state, info);
- dev->power.is_suspended = false;
-@@ -588,24 +600,33 @@ void dpm_resume(pm_message_t state)
- */
- static void device_complete(struct device *dev, pm_message_t state)
- {
-+ void (*callback)(struct device *) = NULL;
-+ char *info = NULL;
-+
- device_lock(dev);
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "completing power domain ");
-- if (dev->pm_domain->ops.complete)
-- dev->pm_domain->ops.complete(dev);
-+ info = "completing power domain ";
-+ callback = dev->pm_domain->ops.complete;
- } else if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "completing type ");
-- if (dev->type->pm->complete)
-- dev->type->pm->complete(dev);
-+ info = "completing type ";
-+ callback = dev->type->pm->complete;
- } else if (dev->class && dev->class->pm) {
-- pm_dev_dbg(dev, state, "completing class ");
-- if (dev->class->pm->complete)
-- dev->class->pm->complete(dev);
-+ info = "completing class ";
-+ callback = dev->class->pm->complete;
- } else if (dev->bus && dev->bus->pm) {
-- pm_dev_dbg(dev, state, "completing ");
-- if (dev->bus->pm->complete)
-- dev->bus->pm->complete(dev);
-+ info = "completing bus ";
-+ callback = dev->bus->pm->complete;
-+ }
-+
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "completing driver ";
-+ callback = dev->driver->pm->complete;
-+ }
-+
-+ if (callback) {
-+ pm_dev_dbg(dev, state, info);
-+ callback(dev);
- }
-
- device_unlock(dev);
-@@ -704,10 +725,15 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
- info = "LATE class ";
- callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- info = "LATE ";
-+ info = "LATE bus ";
- callback = pm_noirq_op(dev->bus->pm, state);
- }
-
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "LATE driver ";
-+ callback = pm_noirq_op(dev->driver->pm, state);
-+ }
-+
- return dpm_run_callback(callback, dev, state, info);
- }
-
-@@ -832,16 +858,21 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
-
- if (dev->bus) {
- if (dev->bus->pm) {
-- info = "";
-+ info = "bus ";
- callback = pm_op(dev->bus->pm, state);
- } else if (dev->bus->suspend) {
-- pm_dev_dbg(dev, state, "legacy ");
-+ pm_dev_dbg(dev, state, "legacy bus ");
- error = legacy_suspend(dev, state, dev->bus->suspend);
- goto End;
- }
- }
-
- Run:
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "driver ";
-+ callback = pm_op(dev->driver->pm, state);
-+ }
-+
- error = dpm_run_callback(callback, dev, state, info);
-
- End:
-@@ -949,6 +980,8 @@ int dpm_suspend(pm_message_t state)
- */
- static int device_prepare(struct device *dev, pm_message_t state)
- {
-+ int (*callback)(struct device *) = NULL;
-+ char *info = NULL;
- int error = 0;
-
- device_lock(dev);
-@@ -956,25 +989,27 @@ static int device_prepare(struct device *dev, pm_message_t state)
- dev->power.wakeup_path = device_may_wakeup(dev);
-
- if (dev->pm_domain) {
-- pm_dev_dbg(dev, state, "preparing power domain ");
-- if (dev->pm_domain->ops.prepare)
-- error = dev->pm_domain->ops.prepare(dev);
-- suspend_report_result(dev->pm_domain->ops.prepare, error);
-+ info = "preparing power domain ";
-+ callback = dev->pm_domain->ops.prepare;
- } else if (dev->type && dev->type->pm) {
-- pm_dev_dbg(dev, state, "preparing type ");
-- if (dev->type->pm->prepare)
-- error = dev->type->pm->prepare(dev);
-- suspend_report_result(dev->type->pm->prepare, error);
-+ info = "preparing type ";
-+ callback = dev->type->pm->prepare;
- } else if (dev->class && dev->class->pm) {
-- pm_dev_dbg(dev, state, "preparing class ");
-- if (dev->class->pm->prepare)
-- error = dev->class->pm->prepare(dev);
-- suspend_report_result(dev->class->pm->prepare, error);
-+ info = "preparing class ";
-+ callback = dev->class->pm->prepare;
- } else if (dev->bus && dev->bus->pm) {
-- pm_dev_dbg(dev, state, "preparing ");
-- if (dev->bus->pm->prepare)
-- error = dev->bus->pm->prepare(dev);
-- suspend_report_result(dev->bus->pm->prepare, error);
-+ info = "preparing bus ";
-+ callback = dev->bus->pm->prepare;
-+ }
-+
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "preparing driver ";
-+ callback = dev->driver->pm->prepare;
-+ }
-+
-+ if (callback) {
-+ error = callback(dev);
-+ suspend_report_result(callback, error);
- }
-
- device_unlock(dev);
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 068f7ed..541f821 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -250,6 +250,9 @@ static int rpm_idle(struct device *dev, int rpmflags)
- else
- callback = NULL;
-
-+ if (!callback && dev->driver && dev->driver->pm)
-+ callback = dev->driver->pm->runtime_idle;
-+
- if (callback)
- __rpm_callback(callback, dev);
-
-@@ -485,6 +488,9 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- else
- callback = NULL;
-
-+ if (!callback && dev->driver && dev->driver->pm)
-+ callback = dev->driver->pm->runtime_suspend;
-+
- retval = rpm_callback(callback, dev);
- if (retval)
- goto fail;
-@@ -713,6 +719,9 @@ static int rpm_resume(struct device *dev, int rpmflags)
- else
- callback = NULL;
-
-+ if (!callback && dev->driver && dev->driver->pm)
-+ callback = dev->driver->pm->runtime_resume;
-+
- retval = rpm_callback(callback, dev);
- if (retval) {
- __update_runtime_status(dev, RPM_SUSPENDED);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0161-PM-Drop-generic_subsys_pm_ops.patch b/patches.runtime_pm/0161-PM-Drop-generic_subsys_pm_ops.patch
deleted file mode 100644
index 77181ed8727e99..00000000000000
--- a/patches.runtime_pm/0161-PM-Drop-generic_subsys_pm_ops.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From b6c13121853d97beae270e74ef8e151ab20c8ec9 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 18 Dec 2011 00:34:42 +0100
-Subject: PM: Drop generic_subsys_pm_ops
-
-Since the PM core is now going to execute driver callbacks directly
-if the corresponding subsystem callbacks are not present,
-forward-only subsystem callbacks (i.e. such that only execute the
-corresponding driver callbacks) are not necessary any more. Thus
-it is possible to remove generic_subsys_pm_ops, because the only
-callback in there that is not forward-only, .runtime_idle, is not
-really used by the only user of generic_subsys_pm_ops, which is
-vio_bus_type.
-
-However, the generic callback routines themselves cannot be removed
-from generic_ops.c, because they are used individually by a number
-of subsystems.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 90363ddf0a1a4dccfbb8d0c10b8f488bc7fa69f8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- arch/powerpc/kernel/vio.c | 1 -
- drivers/base/power/generic_ops.c | 25 -------------------------
- include/linux/pm.h | 13 -------------
- 3 files changed, 39 deletions(-)
-
-diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
-index 1b695fd..83387bf 100644
---- a/arch/powerpc/kernel/vio.c
-+++ b/arch/powerpc/kernel/vio.c
-@@ -1400,7 +1400,6 @@ static struct bus_type vio_bus_type = {
- .match = vio_bus_match,
- .probe = vio_bus_probe,
- .remove = vio_bus_remove,
-- .pm = GENERIC_SUBSYS_PM_OPS,
- };
-
- /**
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index 5a5b154..10bdd79 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -276,28 +276,3 @@ void pm_generic_complete(struct device *dev)
- pm_runtime_idle(dev);
- }
- #endif /* CONFIG_PM_SLEEP */
--
--struct dev_pm_ops generic_subsys_pm_ops = {
--#ifdef CONFIG_PM_SLEEP
-- .prepare = pm_generic_prepare,
-- .suspend = pm_generic_suspend,
-- .suspend_noirq = pm_generic_suspend_noirq,
-- .resume = pm_generic_resume,
-- .resume_noirq = pm_generic_resume_noirq,
-- .freeze = pm_generic_freeze,
-- .freeze_noirq = pm_generic_freeze_noirq,
-- .thaw = pm_generic_thaw,
-- .thaw_noirq = pm_generic_thaw_noirq,
-- .poweroff = pm_generic_poweroff,
-- .poweroff_noirq = pm_generic_poweroff_noirq,
-- .restore = pm_generic_restore,
-- .restore_noirq = pm_generic_restore_noirq,
-- .complete = pm_generic_complete,
--#endif
--#ifdef CONFIG_PM_RUNTIME
-- .runtime_suspend = pm_generic_runtime_suspend,
-- .runtime_resume = pm_generic_runtime_resume,
-- .runtime_idle = pm_generic_runtime_idle,
--#endif
--};
--EXPORT_SYMBOL_GPL(generic_subsys_pm_ops);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index a7676ef..e4982ac 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -300,19 +300,6 @@ const struct dev_pm_ops name = { \
- SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
- }
-
--/*
-- * Use this for subsystems (bus types, device types, device classes) that don't
-- * need any special suspend/resume handling in addition to invoking the PM
-- * callbacks provided by device drivers supporting both the system sleep PM and
-- * runtime PM, make the pm member point to generic_subsys_pm_ops.
-- */
--#ifdef CONFIG_PM
--extern struct dev_pm_ops generic_subsys_pm_ops;
--#define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops)
--#else
--#define GENERIC_SUBSYS_PM_OPS NULL
--#endif
--
- /**
- * PM_EVENT_ messages
- *
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0162-PM-QoS-Introduce-dev_pm_qos_add_ancestor_request.patch b/patches.runtime_pm/0162-PM-QoS-Introduce-dev_pm_qos_add_ancestor_request.patch
deleted file mode 100644
index df9dbbe58b227e..00000000000000
--- a/patches.runtime_pm/0162-PM-QoS-Introduce-dev_pm_qos_add_ancestor_request.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 6d3f38b0892bddfe81c70350d3cc11108f3157f8 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 23 Dec 2011 01:23:52 +0100
-Subject: PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
-
-Some devices, like the I2C controller on SH7372, are not
-necessary for providing power to their children or forwarding
-wakeup signals (and generally interrupts) from them. They are
-only needed by their children when there's some data to transfer,
-so they may be suspended for the majority of time and resumed
-on demand, when the children have data to send or receive. For this
-purpose, however, their power.ignore_children flags have to be set,
-or the PM core wouldn't allow them to be suspended while their
-children were active.
-
-Unfortunately, in some situations it may take too much time to
-resume such devices so that they can assist their children in
-transferring data. For example, if such a device belongs to a PM
-domain which goes to the "power off" state when that device is
-suspended, it may take too much time to restore power to the
-domain in response to the request from one of the device's
-children. In that case, if the parent's resume time is critical,
-the domain should stay in the "power on" state, although it still may
-be desirable to power manage the parent itself (e.g. by manipulating
-its clock).
-
-In general, device PM QoS may be used to address this problem.
-Namely, if the device's children added PM QoS latency constraints
-for it, they would be able to prevent it from being put into an
-overly deep low-power state. However, in some cases the devices
-needing to be serviced are not the immediate children of a
-"children-ignoring" device, but its grandchildren or even less
-direct descendants. In those cases, the entity wanting to add a
-PM QoS request for a given device's ancestor that ignores its
-children will have to find it in the first place, so introduce a new
-helper function that may be used to achieve that. This function,
-dev_pm_qos_add_ancestor_request(), will search for the first
-ancestor of the given device whose power.ignore_children flag is
-set and will add a device PM QoS latency request for that ancestor
-on behalf of the caller. The request added this way may be removed
-with the help of dev_pm_qos_remove_request() in the future, like
-any other device PM QoS latency request.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 40a5f8be2f482783de0f1f0fe856660e489734a8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/qos.c | 25 +++++++++++++++++++++++++
- include/linux/pm_qos.h | 5 +++++
- 2 files changed, 30 insertions(+)
-
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index 03f4bd0..c5d3588 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -420,3 +420,28 @@ int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
- return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
- }
- EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
-+
-+/**
-+ * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
-+ * @dev: Device whose ancestor to add the request for.
-+ * @req: Pointer to the preallocated handle.
-+ * @value: Constraint latency value.
-+ */
-+int dev_pm_qos_add_ancestor_request(struct device *dev,
-+ struct dev_pm_qos_request *req, s32 value)
-+{
-+ struct device *ancestor = dev->parent;
-+ int error = -ENODEV;
-+
-+ while (ancestor && !ancestor->power.ignore_children)
-+ ancestor = ancestor->parent;
-+
-+ if (ancestor)
-+ error = dev_pm_qos_add_request(ancestor, req, value);
-+
-+ if (error)
-+ req->dev = NULL;
-+
-+ return error;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 775a323..e5bbcba 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -92,6 +92,8 @@ int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
- int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
- void dev_pm_qos_constraints_init(struct device *dev);
- void dev_pm_qos_constraints_destroy(struct device *dev);
-+int dev_pm_qos_add_ancestor_request(struct device *dev,
-+ struct dev_pm_qos_request *req, s32 value);
- #else
- static inline int pm_qos_update_target(struct pm_qos_constraints *c,
- struct plist_node *node,
-@@ -153,6 +155,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev)
- {
- dev->power.power_state = PMSG_INVALID;
- }
-+static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
-+ struct dev_pm_qos_request *req, s32 value)
-+ { return 0; }
- #endif
-
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0163-power_supply-Add-initial-Charger-Manager-driver.patch b/patches.runtime_pm/0163-power_supply-Add-initial-Charger-Manager-driver.patch
deleted file mode 100644
index 8b7114bca07582..00000000000000
--- a/patches.runtime_pm/0163-power_supply-Add-initial-Charger-Manager-driver.patch
+++ /dev/null
@@ -1,1143 +0,0 @@
-From 7ab1eef699974deb1db6729dd425bffb063ff007 Mon Sep 17 00:00:00 2001
-From: Donggeun Kim <dg77.kim@samsung.com>
-Date: Tue, 27 Dec 2011 18:47:48 +0900
-Subject: power_supply: Add initial Charger-Manager driver
-
-Because battery health monitoring should be done even when suspended,
-it needs to wake up and suspend periodically. Thus, userspace battery
-monitoring may incur too much overhead; every device and task is woken
-up periodically. Charger Manager uses suspend-again to provide
-in-suspend monitoring.
-
-This patch allows to monitor battery health in-suspend state.
-
-Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
-Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
-(cherry picked from commit 3bb3dbbd56ea39e5537db8f8041ea95d28f16a7f)
-
-Conflicts:
-
- drivers/power/Kconfig
- drivers/power/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/charger-manager.txt | 149 ++++++
- drivers/power/Kconfig | 10 +
- drivers/power/Makefile | 1 +
- drivers/power/charger-manager.c | 779 +++++++++++++++++++++++++++++++
- include/linux/power/charger-manager.h | 130 ++++++
- 5 files changed, 1069 insertions(+)
- create mode 100644 Documentation/power/charger-manager.txt
- create mode 100644 drivers/power/charger-manager.c
- create mode 100644 include/linux/power/charger-manager.h
-
-diff --git a/Documentation/power/charger-manager.txt b/Documentation/power/charger-manager.txt
-new file mode 100644
-index 0000000..081489f
---- /dev/null
-+++ b/Documentation/power/charger-manager.txt
-@@ -0,0 +1,149 @@
-+Charger Manager
-+ (C) 2011 MyungJoo Ham <myungjoo.ham@samsung.com>, GPL
-+
-+Charger Manager provides in-kernel battery charger management that
-+requires temperature monitoring during suspend-to-RAM state
-+and where each battery may have multiple chargers attached and the userland
-+wants to look at the aggregated information of the multiple chargers.
-+
-+Charger Manager is a platform_driver with power-supply-class entries.
-+An instance of Charger Manager (a platform-device created with Charger-Manager)
-+represents an independent battery with chargers. If there are multiple
-+batteries with their own chargers acting independently in a system,
-+the system may need multiple instances of Charger Manager.
-+
-+1. Introduction
-+===============
-+
-+Charger Manager supports the following:
-+
-+* Support for multiple chargers (e.g., a device with USB, AC, and solar panels)
-+ A system may have multiple chargers (or power sources) and some of
-+ they may be activated at the same time. Each charger may have its
-+ own power-supply-class and each power-supply-class can provide
-+ different information about the battery status. This framework
-+ aggregates charger-related information from multiple sources and
-+ shows combined information as a single power-supply-class.
-+
-+* Support for in suspend-to-RAM polling (with suspend_again callback)
-+ While the battery is being charged and the system is in suspend-to-RAM,
-+ we may need to monitor the battery health by looking at the ambient or
-+ battery temperature. We can accomplish this by waking up the system
-+ periodically. However, such a method wakes up devices unncessary for
-+ monitoring the battery health and tasks, and user processes that are
-+ supposed to be kept suspended. That, in turn, incurs unnecessary power
-+ consumption and slow down charging process. Or even, such peak power
-+ consumption can stop chargers in the middle of charging
-+ (external power input < device power consumption), which not
-+ only affects the charging time, but the lifespan of the battery.
-+
-+ Charger Manager provides a function "cm_suspend_again" that can be
-+ used as suspend_again callback of platform_suspend_ops. If the platform
-+ requires tasks other than cm_suspend_again, it may implement its own
-+ suspend_again callback that calls cm_suspend_again in the middle.
-+ Normally, the platform will need to resume and suspend some devices
-+ that are used by Charger Manager.
-+
-+2. Global Charger-Manager Data related with suspend_again
-+========================================================
-+In order to setup Charger Manager with suspend-again feature
-+(in-suspend monitoring), the user should provide charger_global_desc
-+with setup_charger_manager(struct charger_global_desc *).
-+This charger_global_desc data for in-suspend monitoring is global
-+as the name suggests. Thus, the user needs to provide only once even
-+if there are multiple batteries. If there are multiple batteries, the
-+multiple instances of Charger Manager share the same charger_global_desc
-+and it will manage in-suspend monitoring for all instances of Charger Manager.
-+
-+The user needs to provide all the two entries properly in order to activate
-+in-suspend monitoring:
-+
-+struct charger_global_desc {
-+
-+char *rtc_name;
-+ : The name of rtc (e.g., "rtc0") used to wakeup the system from
-+ suspend for Charger Manager. The alarm interrupt (AIE) of the rtc
-+ should be able to wake up the system from suspend. Charger Manager
-+ saves and restores the alarm value and use the previously-defined
-+ alarm if it is going to go off earlier than Charger Manager so that
-+ Charger Manager does not interfere with previously-defined alarms.
-+
-+bool (*rtc_only_wakeup)(void);
-+ : This callback should let CM know whether
-+ the wakeup-from-suspend is caused only by the alarm of "rtc" in the
-+ same struct. If there is any other wakeup source triggered the
-+ wakeup, it should return false. If the "rtc" is the only wakeup
-+ reason, it should return true.
-+};
-+
-+3. How to setup suspend_again
-+=============================
-+Charger Manager provides a function "extern bool cm_suspend_again(void)".
-+When cm_suspend_again is called, it monitors every battery. The suspend_ops
-+callback of the system's platform_suspend_ops can call cm_suspend_again
-+function to know whether Charger Manager wants to suspend again or not.
-+If there are no other devices or tasks that want to use suspend_again
-+feature, the platform_suspend_ops may directly refer to cm_suspend_again
-+for its suspend_again callback.
-+
-+The cm_suspend_again() returns true (meaning "I want to suspend again")
-+if the system was woken up by Charger Manager and the polling
-+(in-suspend monitoring) results in "normal".
-+
-+4. Charger-Manager Data (struct charger_desc)
-+=============================================
-+For each battery charged independently from other batteries (if a series of
-+batteries are charged by a single charger, they are counted as one independent
-+battery), an instance of Charger Manager is attached to it.
-+
-+struct charger_desc {
-+
-+enum polling_modes polling_mode;
-+ : CM_POLL_DISABLE: do not poll this battery.
-+ CM_POLL_ALWAYS: always poll this battery.
-+ CM_POLL_EXTERNAL_POWER_ONLY: poll this battery if and only if
-+ an external power source is attached.
-+ CM_POLL_CHARGING_ONLY: poll this battery if and only if the
-+ battery is being charged.
-+
-+unsigned int polling_interval_ms;
-+ : Required polling interval in ms. Charger Manager will poll
-+ this battery every polling_interval_ms or more frequently.
-+
-+enum data_source battery_present;
-+ CM_FUEL_GAUGE: get battery presence information from fuel gauge.
-+ CM_CHARGER_STAT: get battery presence from chargers.
-+
-+char **psy_charger_stat;
-+ : An array ending with NULL that has power-supply-class names of
-+ chargers. Each power-supply-class should provide "PRESENT" (if
-+ battery_present is "CM_CHARGER_STAT"), "ONLINE" (shows whether an
-+ external power source is attached or not), and "STATUS" (shows whether
-+ the battery is {"FULL" or not FULL} or {"FULL", "Charging",
-+ "Discharging", "NotCharging"}).
-+
-+int num_charger_regulators;
-+struct regulator_bulk_data *charger_regulators;
-+ : Regulators representing the chargers in the form for
-+ regulator framework's bulk functions.
-+
-+char *psy_fuel_gauge;
-+ : Power-supply-class name of the fuel gauge.
-+
-+int (*temperature_out_of_range)(int *mC);
-+ : This callback returns 0 if the temperature is safe for charging,
-+ a positive number if it is too hot to charge, and a negative number
-+ if it is too cold to charge. With the variable mC, the callback returns
-+ the temperature in 1/1000 of centigrade.
-+};
-+
-+5. Other Considerations
-+=======================
-+
-+At the charger/battery-related events such as battery-pulled-out,
-+charger-pulled-out, charger-inserted, DCIN-over/under-voltage, charger-stopped,
-+and others critical to chargers, the system should be configured to wake up.
-+At least the following should wake up the system from a suspend:
-+a) charger-on/off b) external-power-in/out c) battery-in/out (while charging)
-+
-+It is usually accomplished by configuring the PMIC as a wakeup source.
-diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
-index e57b50b..8266193 100644
---- a/drivers/power/Kconfig
-+++ b/drivers/power/Kconfig
-@@ -235,4 +235,14 @@ config CHARGER_GPIO
- This driver can be build as a module. If so, the module will be
- called gpio-charger.
-
-+config CHARGER_MANAGER
-+ bool "Battery charger manager for multiple chargers"
-+ depends on REGULATOR && RTC_CLASS
-+ help
-+ Say Y to enable charger-manager support, which allows multiple
-+ chargers attached to a battery and multiple batteries attached to a
-+ system. The charger-manager also can monitor charging status in
-+ runtime and in suspend-to-RAM by waking up the system periodically
-+ with help of suspend_again support.
-+
- endif # POWER_SUPPLY
-diff --git a/drivers/power/Makefile b/drivers/power/Makefile
-index 009a90f..ca69761 100644
---- a/drivers/power/Makefile
-+++ b/drivers/power/Makefile
-@@ -36,3 +36,4 @@ obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
- obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
- obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
- obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o
-+obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o
-diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
-new file mode 100644
-index 0000000..727a259
---- /dev/null
-+++ b/drivers/power/charger-manager.c
-@@ -0,0 +1,779 @@
-+/*
-+ * Copyright (C) 2011 Samsung Electronics Co., Ltd.
-+ * MyungJoo Ham <myungjoo.ham@samsung.com>
-+ *
-+ * This driver enables to monitor battery health and control charger
-+ * during suspend-to-mem.
-+ * Charger manager depends on other devices. register this later than
-+ * the depending devices.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+**/
-+
-+#include <linux/io.h>
-+#include <linux/module.h>
-+#include <linux/irq.h>
-+#include <linux/interrupt.h>
-+#include <linux/rtc.h>
-+#include <linux/slab.h>
-+#include <linux/workqueue.h>
-+#include <linux/platform_device.h>
-+#include <linux/power/charger-manager.h>
-+#include <linux/regulator/consumer.h>
-+
-+/*
-+ * Regard CM_JIFFIES_SMALL jiffies is small enough to ignore for
-+ * delayed works so that we can run delayed works with CM_JIFFIES_SMALL
-+ * without any delays.
-+ */
-+#define CM_JIFFIES_SMALL (2)
-+
-+/* If y is valid (> 0) and smaller than x, do x = y */
-+#define CM_MIN_VALID(x, y) x = (((y > 0) && ((x) > (y))) ? (y) : (x))
-+
-+/*
-+ * Regard CM_RTC_SMALL (sec) is small enough to ignore error in invoking
-+ * rtc alarm. It should be 2 or larger
-+ */
-+#define CM_RTC_SMALL (2)
-+
-+#define UEVENT_BUF_SIZE 32
-+
-+static LIST_HEAD(cm_list);
-+static DEFINE_MUTEX(cm_list_mtx);
-+
-+/* About in-suspend (suspend-again) monitoring */
-+static struct rtc_device *rtc_dev;
-+/*
-+ * Backup RTC alarm
-+ * Save the wakeup alarm before entering suspend-to-RAM
-+ */
-+static struct rtc_wkalrm rtc_wkalarm_save;
-+/* Backup RTC alarm time in terms of seconds since 01-01-1970 00:00:00 */
-+static unsigned long rtc_wkalarm_save_time;
-+static bool cm_suspended;
-+static bool cm_rtc_set;
-+static unsigned long cm_suspend_duration_ms;
-+
-+/* Global charger-manager description */
-+static struct charger_global_desc *g_desc; /* init with setup_charger_manager */
-+
-+/**
-+ * is_batt_present - See if the battery presents in place.
-+ * @cm: the Charger Manager representing the battery.
-+ */
-+static bool is_batt_present(struct charger_manager *cm)
-+{
-+ union power_supply_propval val;
-+ bool present = false;
-+ int i, ret;
-+
-+ switch (cm->desc->battery_present) {
-+ case CM_FUEL_GAUGE:
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_PRESENT, &val);
-+ if (ret == 0 && val.intval)
-+ present = true;
-+ break;
-+ case CM_CHARGER_STAT:
-+ for (i = 0; cm->charger_stat[i]; i++) {
-+ ret = cm->charger_stat[i]->get_property(
-+ cm->charger_stat[i],
-+ POWER_SUPPLY_PROP_PRESENT, &val);
-+ if (ret == 0 && val.intval) {
-+ present = true;
-+ break;
-+ }
-+ }
-+ break;
-+ }
-+
-+ return present;
-+}
-+
-+/**
-+ * is_ext_pwr_online - See if an external power source is attached to charge
-+ * @cm: the Charger Manager representing the battery.
-+ *
-+ * Returns true if at least one of the chargers of the battery has an external
-+ * power source attached to charge the battery regardless of whether it is
-+ * actually charging or not.
-+ */
-+static bool is_ext_pwr_online(struct charger_manager *cm)
-+{
-+ union power_supply_propval val;
-+ bool online = false;
-+ int i, ret;
-+
-+ /* If at least one of them has one, it's yes. */
-+ for (i = 0; cm->charger_stat[i]; i++) {
-+ ret = cm->charger_stat[i]->get_property(
-+ cm->charger_stat[i],
-+ POWER_SUPPLY_PROP_ONLINE, &val);
-+ if (ret == 0 && val.intval) {
-+ online = true;
-+ break;
-+ }
-+ }
-+
-+ return online;
-+}
-+
-+/**
-+ * is_charging - Returns true if the battery is being charged.
-+ * @cm: the Charger Manager representing the battery.
-+ */
-+static bool is_charging(struct charger_manager *cm)
-+{
-+ int i, ret;
-+ bool charging = false;
-+ union power_supply_propval val;
-+
-+ /* If there is no battery, it cannot be charged */
-+ if (!is_batt_present(cm))
-+ return false;
-+
-+ /* If at least one of the charger is charging, return yes */
-+ for (i = 0; cm->charger_stat[i]; i++) {
-+ /* 1. The charger sholuld not be DISABLED */
-+ if (cm->emergency_stop)
-+ continue;
-+ if (!cm->charger_enabled)
-+ continue;
-+
-+ /* 2. The charger should be online (ext-power) */
-+ ret = cm->charger_stat[i]->get_property(
-+ cm->charger_stat[i],
-+ POWER_SUPPLY_PROP_ONLINE, &val);
-+ if (ret) {
-+ dev_warn(cm->dev, "Cannot read ONLINE value from %s.\n",
-+ cm->desc->psy_charger_stat[i]);
-+ continue;
-+ }
-+ if (val.intval == 0)
-+ continue;
-+
-+ /*
-+ * 3. The charger should not be FULL, DISCHARGING,
-+ * or NOT_CHARGING.
-+ */
-+ ret = cm->charger_stat[i]->get_property(
-+ cm->charger_stat[i],
-+ POWER_SUPPLY_PROP_STATUS, &val);
-+ if (ret) {
-+ dev_warn(cm->dev, "Cannot read STATUS value from %s.\n",
-+ cm->desc->psy_charger_stat[i]);
-+ continue;
-+ }
-+ if (val.intval == POWER_SUPPLY_STATUS_FULL ||
-+ val.intval == POWER_SUPPLY_STATUS_DISCHARGING ||
-+ val.intval == POWER_SUPPLY_STATUS_NOT_CHARGING)
-+ continue;
-+
-+ /* Then, this is charging. */
-+ charging = true;
-+ break;
-+ }
-+
-+ return charging;
-+}
-+
-+/**
-+ * is_polling_required - Return true if need to continue polling for this CM.
-+ * @cm: the Charger Manager representing the battery.
-+ */
-+static bool is_polling_required(struct charger_manager *cm)
-+{
-+ switch (cm->desc->polling_mode) {
-+ case CM_POLL_DISABLE:
-+ return false;
-+ case CM_POLL_ALWAYS:
-+ return true;
-+ case CM_POLL_EXTERNAL_POWER_ONLY:
-+ return is_ext_pwr_online(cm);
-+ case CM_POLL_CHARGING_ONLY:
-+ return is_charging(cm);
-+ default:
-+ dev_warn(cm->dev, "Incorrect polling_mode (%d)\n",
-+ cm->desc->polling_mode);
-+ }
-+
-+ return false;
-+}
-+
-+/**
-+ * try_charger_enable - Enable/Disable chargers altogether
-+ * @cm: the Charger Manager representing the battery.
-+ * @enable: true: enable / false: disable
-+ *
-+ * Note that Charger Manager keeps the charger enabled regardless whether
-+ * the charger is charging or not (because battery is full or no external
-+ * power source exists) except when CM needs to disable chargers forcibly
-+ * bacause of emergency causes; when the battery is overheated or too cold.
-+ */
-+static int try_charger_enable(struct charger_manager *cm, bool enable)
-+{
-+ int err = 0, i;
-+ struct charger_desc *desc = cm->desc;
-+
-+ /* Ignore if it's redundent command */
-+ if (enable && cm->charger_enabled)
-+ return 0;
-+ if (!enable && !cm->charger_enabled)
-+ return 0;
-+
-+ if (enable) {
-+ if (cm->emergency_stop)
-+ return -EAGAIN;
-+ err = regulator_bulk_enable(desc->num_charger_regulators,
-+ desc->charger_regulators);
-+ } else {
-+ /*
-+ * Abnormal battery state - Stop charging forcibly,
-+ * even if charger was enabled at the other places
-+ */
-+ err = regulator_bulk_disable(desc->num_charger_regulators,
-+ desc->charger_regulators);
-+
-+ for (i = 0; i < desc->num_charger_regulators; i++) {
-+ if (regulator_is_enabled(
-+ desc->charger_regulators[i].consumer)) {
-+ regulator_force_disable(
-+ desc->charger_regulators[i].consumer);
-+ dev_warn(cm->dev,
-+ "Disable regulator(%s) forcibly.\n",
-+ desc->charger_regulators[i].supply);
-+ }
-+ }
-+ }
-+
-+ if (!err)
-+ cm->charger_enabled = enable;
-+
-+ return err;
-+}
-+
-+/**
-+ * uevent_notify - Let users know something has changed.
-+ * @cm: the Charger Manager representing the battery.
-+ * @event: the event string.
-+ *
-+ * If @event is null, it implies that uevent_notify is called
-+ * by resume function. When called in the resume function, cm_suspended
-+ * should be already reset to false in order to let uevent_notify
-+ * notify the recent event during the suspend to users. While
-+ * suspended, uevent_notify does not notify users, but tracks
-+ * events so that uevent_notify can notify users later after resumed.
-+ */
-+static void uevent_notify(struct charger_manager *cm, const char *event)
-+{
-+ static char env_str[UEVENT_BUF_SIZE + 1] = "";
-+ static char env_str_save[UEVENT_BUF_SIZE + 1] = "";
-+
-+ if (cm_suspended) {
-+ /* Nothing in suspended-event buffer */
-+ if (env_str_save[0] == 0) {
-+ if (!strncmp(env_str, event, UEVENT_BUF_SIZE))
-+ return; /* status not changed */
-+ strncpy(env_str_save, event, UEVENT_BUF_SIZE);
-+ return;
-+ }
-+
-+ if (!strncmp(env_str_save, event, UEVENT_BUF_SIZE))
-+ return; /* Duplicated. */
-+ else
-+ strncpy(env_str_save, event, UEVENT_BUF_SIZE);
-+
-+ return;
-+ }
-+
-+ if (event == NULL) {
-+ /* No messages pending */
-+ if (!env_str_save[0])
-+ return;
-+
-+ strncpy(env_str, env_str_save, UEVENT_BUF_SIZE);
-+ kobject_uevent(&cm->dev->kobj, KOBJ_CHANGE);
-+ env_str_save[0] = 0;
-+
-+ return;
-+ }
-+
-+ /* status not changed */
-+ if (!strncmp(env_str, event, UEVENT_BUF_SIZE))
-+ return;
-+
-+ /* save the status and notify the update */
-+ strncpy(env_str, event, UEVENT_BUF_SIZE);
-+ kobject_uevent(&cm->dev->kobj, KOBJ_CHANGE);
-+
-+ dev_info(cm->dev, event);
-+}
-+
-+/**
-+ * _cm_monitor - Monitor the temperature and return true for exceptions.
-+ * @cm: the Charger Manager representing the battery.
-+ *
-+ * Returns true if there is an event to notify for the battery.
-+ * (True if the status of "emergency_stop" changes)
-+ */
-+static bool _cm_monitor(struct charger_manager *cm)
-+{
-+ struct charger_desc *desc = cm->desc;
-+ int temp = desc->temperature_out_of_range(&cm->last_temp_mC);
-+
-+ dev_dbg(cm->dev, "monitoring (%2.2d.%3.3dC)\n",
-+ cm->last_temp_mC / 1000, cm->last_temp_mC % 1000);
-+
-+ /* It has been stopped or charging already */
-+ if (!!temp == !!cm->emergency_stop)
-+ return false;
-+
-+ if (temp) {
-+ cm->emergency_stop = temp;
-+ if (!try_charger_enable(cm, false)) {
-+ if (temp > 0)
-+ uevent_notify(cm, "OVERHEAT");
-+ else
-+ uevent_notify(cm, "COLD");
-+ }
-+ } else {
-+ cm->emergency_stop = 0;
-+ if (!try_charger_enable(cm, true))
-+ uevent_notify(cm, "CHARGING");
-+ }
-+
-+ return true;
-+}
-+
-+/**
-+ * cm_monitor - Monitor every battery.
-+ *
-+ * Returns true if there is an event to notify from any of the batteries.
-+ * (True if the status of "emergency_stop" changes)
-+ */
-+static bool cm_monitor(void)
-+{
-+ bool stop = false;
-+ struct charger_manager *cm;
-+
-+ mutex_lock(&cm_list_mtx);
-+
-+ list_for_each_entry(cm, &cm_list, entry)
-+ stop = stop || _cm_monitor(cm);
-+
-+ mutex_unlock(&cm_list_mtx);
-+
-+ return stop;
-+}
-+
-+/**
-+ * cm_setup_timer - For in-suspend monitoring setup wakeup alarm
-+ * for suspend_again.
-+ *
-+ * Returns true if the alarm is set for Charger Manager to use.
-+ * Returns false if
-+ * cm_setup_timer fails to set an alarm,
-+ * cm_setup_timer does not need to set an alarm for Charger Manager,
-+ * or an alarm previously configured is to be used.
-+ */
-+static bool cm_setup_timer(void)
-+{
-+ struct charger_manager *cm;
-+ unsigned int wakeup_ms = UINT_MAX;
-+ bool ret = false;
-+
-+ mutex_lock(&cm_list_mtx);
-+
-+ list_for_each_entry(cm, &cm_list, entry) {
-+ /* Skip if polling is not required for this CM */
-+ if (!is_polling_required(cm) && !cm->emergency_stop)
-+ continue;
-+ if (cm->desc->polling_interval_ms == 0)
-+ continue;
-+ CM_MIN_VALID(wakeup_ms, cm->desc->polling_interval_ms);
-+ }
-+
-+ mutex_unlock(&cm_list_mtx);
-+
-+ if (wakeup_ms < UINT_MAX && wakeup_ms > 0) {
-+ pr_info("Charger Manager wakeup timer: %u ms.\n", wakeup_ms);
-+ if (rtc_dev) {
-+ struct rtc_wkalrm tmp;
-+ unsigned long time, now;
-+ unsigned long add = DIV_ROUND_UP(wakeup_ms, 1000);
-+
-+ /*
-+ * Set alarm with the polling interval (wakeup_ms)
-+ * except when rtc_wkalarm_save comes first.
-+ * However, the alarm time should be NOW +
-+ * CM_RTC_SMALL or later.
-+ */
-+ tmp.enabled = 1;
-+ rtc_read_time(rtc_dev, &tmp.time);
-+ rtc_tm_to_time(&tmp.time, &now);
-+ if (add < CM_RTC_SMALL)
-+ add = CM_RTC_SMALL;
-+ time = now + add;
-+
-+ ret = true;
-+
-+ if (rtc_wkalarm_save.enabled &&
-+ rtc_wkalarm_save_time &&
-+ rtc_wkalarm_save_time < time) {
-+ if (rtc_wkalarm_save_time < now + CM_RTC_SMALL)
-+ time = now + CM_RTC_SMALL;
-+ else
-+ time = rtc_wkalarm_save_time;
-+
-+ /* The timer is not appointed by CM */
-+ ret = false;
-+ }
-+
-+ pr_info("Waking up after %lu secs.\n",
-+ time - now);
-+
-+ rtc_time_to_tm(time, &tmp.time);
-+ rtc_set_alarm(rtc_dev, &tmp);
-+ cm_suspend_duration_ms += wakeup_ms;
-+ return ret;
-+ }
-+ }
-+
-+ if (rtc_dev)
-+ rtc_set_alarm(rtc_dev, &rtc_wkalarm_save);
-+ return false;
-+}
-+
-+/**
-+ * cm_suspend_again - Determine whether suspend again or not
-+ *
-+ * Returns true if the system should be suspended again
-+ * Returns false if the system should be woken up
-+ */
-+bool cm_suspend_again(void)
-+{
-+ struct charger_manager *cm;
-+ bool ret = false;
-+
-+ if (!g_desc || !g_desc->rtc_only_wakeup || !g_desc->rtc_only_wakeup() ||
-+ !cm_rtc_set)
-+ return false;
-+
-+ if (cm_monitor())
-+ goto out;
-+
-+ ret = true;
-+ mutex_lock(&cm_list_mtx);
-+ list_for_each_entry(cm, &cm_list, entry) {
-+ if (cm->status_save_ext_pwr_inserted != is_ext_pwr_online(cm) ||
-+ cm->status_save_batt != is_batt_present(cm))
-+ ret = false;
-+ }
-+ mutex_unlock(&cm_list_mtx);
-+
-+ cm_rtc_set = cm_setup_timer();
-+out:
-+ /* It's about the time when the non-CM appointed timer goes off */
-+ if (rtc_wkalarm_save.enabled) {
-+ unsigned long now;
-+ struct rtc_time tmp;
-+
-+ rtc_read_time(rtc_dev, &tmp);
-+ rtc_tm_to_time(&tmp, &now);
-+
-+ if (rtc_wkalarm_save_time &&
-+ now + CM_RTC_SMALL >= rtc_wkalarm_save_time)
-+ return false;
-+ }
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(cm_suspend_again);
-+
-+/**
-+ * setup_charger_manager - initialize charger_global_desc data
-+ * @gd: pointer to instance of charger_global_desc
-+ */
-+int setup_charger_manager(struct charger_global_desc *gd)
-+{
-+ if (!gd)
-+ return -EINVAL;
-+
-+ if (rtc_dev)
-+ rtc_class_close(rtc_dev);
-+ rtc_dev = NULL;
-+ g_desc = NULL;
-+
-+ if (!gd->rtc_only_wakeup) {
-+ pr_err("The callback rtc_only_wakeup is not given.\n");
-+ return -EINVAL;
-+ }
-+
-+ if (gd->rtc_name) {
-+ rtc_dev = rtc_class_open(gd->rtc_name);
-+ if (IS_ERR_OR_NULL(rtc_dev)) {
-+ rtc_dev = NULL;
-+ /* Retry at probe. RTC may be not registered yet */
-+ }
-+ } else {
-+ pr_warn("No wakeup timer is given for charger manager."
-+ "In-suspend monitoring won't work.\n");
-+ }
-+
-+ g_desc = gd;
-+ return 0;
-+}
-+EXPORT_SYMBOL_GPL(setup_charger_manager);
-+
-+static int charger_manager_probe(struct platform_device *pdev)
-+{
-+ struct charger_desc *desc = dev_get_platdata(&pdev->dev);
-+ struct charger_manager *cm;
-+ int ret = 0, i = 0;
-+
-+ if (g_desc && !rtc_dev && g_desc->rtc_name) {
-+ rtc_dev = rtc_class_open(g_desc->rtc_name);
-+ if (IS_ERR_OR_NULL(rtc_dev)) {
-+ rtc_dev = NULL;
-+ dev_err(&pdev->dev, "Cannot get RTC %s.\n",
-+ g_desc->rtc_name);
-+ ret = -ENODEV;
-+ goto err_alloc;
-+ }
-+ }
-+
-+ if (!desc) {
-+ dev_err(&pdev->dev, "No platform data (desc) found.\n");
-+ ret = -ENODEV;
-+ goto err_alloc;
-+ }
-+
-+ cm = kzalloc(sizeof(struct charger_manager), GFP_KERNEL);
-+ if (!cm) {
-+ dev_err(&pdev->dev, "Cannot allocate memory.\n");
-+ ret = -ENOMEM;
-+ goto err_alloc;
-+ }
-+
-+ /* Basic Values. Unspecified are Null or 0 */
-+ cm->dev = &pdev->dev;
-+ cm->desc = kzalloc(sizeof(struct charger_desc), GFP_KERNEL);
-+ if (!cm->desc) {
-+ dev_err(&pdev->dev, "Cannot allocate memory.\n");
-+ ret = -ENOMEM;
-+ goto err_alloc_desc;
-+ }
-+ memcpy(cm->desc, desc, sizeof(struct charger_desc));
-+ cm->last_temp_mC = INT_MIN; /* denotes "unmeasured, yet" */
-+
-+ if (!desc->charger_regulators || desc->num_charger_regulators < 1) {
-+ ret = -EINVAL;
-+ dev_err(&pdev->dev, "charger_regulators undefined.\n");
-+ goto err_no_charger;
-+ }
-+
-+ if (!desc->psy_charger_stat || !desc->psy_charger_stat[0]) {
-+ dev_err(&pdev->dev, "No power supply defined.\n");
-+ ret = -EINVAL;
-+ goto err_no_charger_stat;
-+ }
-+
-+ /* Counting index only */
-+ while (desc->psy_charger_stat[i])
-+ i++;
-+
-+ cm->charger_stat = kzalloc(sizeof(struct power_supply *) * (i + 1),
-+ GFP_KERNEL);
-+ if (!cm->charger_stat) {
-+ ret = -ENOMEM;
-+ goto err_no_charger_stat;
-+ }
-+
-+ for (i = 0; desc->psy_charger_stat[i]; i++) {
-+ cm->charger_stat[i] = power_supply_get_by_name(
-+ desc->psy_charger_stat[i]);
-+ if (!cm->charger_stat[i]) {
-+ dev_err(&pdev->dev, "Cannot find power supply "
-+ "\"%s\"\n",
-+ desc->psy_charger_stat[i]);
-+ ret = -ENODEV;
-+ goto err_chg_stat;
-+ }
-+ }
-+
-+ cm->fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);
-+ if (!cm->fuel_gauge) {
-+ dev_err(&pdev->dev, "Cannot find power supply \"%s\"\n",
-+ desc->psy_fuel_gauge);
-+ ret = -ENODEV;
-+ goto err_chg_stat;
-+ }
-+
-+ if (desc->polling_interval_ms == 0 ||
-+ msecs_to_jiffies(desc->polling_interval_ms) <= CM_JIFFIES_SMALL) {
-+ dev_err(&pdev->dev, "polling_interval_ms is too small\n");
-+ ret = -EINVAL;
-+ goto err_chg_stat;
-+ }
-+
-+ if (!desc->temperature_out_of_range) {
-+ dev_err(&pdev->dev, "there is no temperature_out_of_range\n");
-+ ret = -EINVAL;
-+ goto err_chg_stat;
-+ }
-+
-+ platform_set_drvdata(pdev, cm);
-+
-+ ret = regulator_bulk_get(&pdev->dev, desc->num_charger_regulators,
-+ desc->charger_regulators);
-+ if (ret) {
-+ dev_err(&pdev->dev, "Cannot get charger regulators.\n");
-+ goto err_chg_stat;
-+ }
-+
-+ ret = try_charger_enable(cm, true);
-+ if (ret) {
-+ dev_err(&pdev->dev, "Cannot enable charger regulators\n");
-+ goto err_chg_enable;
-+ }
-+
-+ /* Add to the list */
-+ mutex_lock(&cm_list_mtx);
-+ list_add(&cm->entry, &cm_list);
-+ mutex_unlock(&cm_list_mtx);
-+
-+ return 0;
-+
-+err_chg_enable:
-+ if (desc->charger_regulators)
-+ regulator_bulk_free(desc->num_charger_regulators,
-+ desc->charger_regulators);
-+err_chg_stat:
-+ kfree(cm->charger_stat);
-+err_no_charger_stat:
-+err_no_charger:
-+ kfree(cm->desc);
-+err_alloc_desc:
-+ kfree(cm);
-+err_alloc:
-+ return ret;
-+}
-+
-+static int __devexit charger_manager_remove(struct platform_device *pdev)
-+{
-+ struct charger_manager *cm = platform_get_drvdata(pdev);
-+ struct charger_desc *desc = cm->desc;
-+
-+ /* Remove from the list */
-+ mutex_lock(&cm_list_mtx);
-+ list_del(&cm->entry);
-+ mutex_unlock(&cm_list_mtx);
-+
-+ if (desc->charger_regulators)
-+ regulator_bulk_free(desc->num_charger_regulators,
-+ desc->charger_regulators);
-+ kfree(cm->charger_stat);
-+ kfree(cm->desc);
-+ kfree(cm);
-+
-+ return 0;
-+}
-+
-+const struct platform_device_id charger_manager_id[] = {
-+ { "charger-manager", 0 },
-+ { },
-+};
-+
-+static int cm_suspend_prepare(struct device *dev)
-+{
-+ struct platform_device *pdev = container_of(dev, struct platform_device,
-+ dev);
-+ struct charger_manager *cm = platform_get_drvdata(pdev);
-+
-+ if (!cm_suspended) {
-+ if (rtc_dev) {
-+ struct rtc_time tmp;
-+ unsigned long now;
-+
-+ rtc_read_alarm(rtc_dev, &rtc_wkalarm_save);
-+ rtc_read_time(rtc_dev, &tmp);
-+
-+ if (rtc_wkalarm_save.enabled) {
-+ rtc_tm_to_time(&rtc_wkalarm_save.time,
-+ &rtc_wkalarm_save_time);
-+ rtc_tm_to_time(&tmp, &now);
-+ if (now > rtc_wkalarm_save_time)
-+ rtc_wkalarm_save_time = 0;
-+ } else {
-+ rtc_wkalarm_save_time = 0;
-+ }
-+ }
-+ cm_suspended = true;
-+ }
-+
-+ cm->status_save_ext_pwr_inserted = is_ext_pwr_online(cm);
-+ cm->status_save_batt = is_batt_present(cm);
-+
-+ if (!cm_rtc_set) {
-+ cm_suspend_duration_ms = 0;
-+ cm_rtc_set = cm_setup_timer();
-+ }
-+
-+ return 0;
-+}
-+
-+static void cm_suspend_complete(struct device *dev)
-+{
-+ struct platform_device *pdev = container_of(dev, struct platform_device,
-+ dev);
-+ struct charger_manager *cm = platform_get_drvdata(pdev);
-+
-+ if (cm_suspended) {
-+ if (rtc_dev) {
-+ struct rtc_wkalrm tmp;
-+
-+ rtc_read_alarm(rtc_dev, &tmp);
-+ rtc_wkalarm_save.pending = tmp.pending;
-+ rtc_set_alarm(rtc_dev, &rtc_wkalarm_save);
-+ }
-+ cm_suspended = false;
-+ cm_rtc_set = false;
-+ }
-+
-+ uevent_notify(cm, NULL);
-+}
-+
-+static const struct dev_pm_ops charger_manager_pm = {
-+ .prepare = cm_suspend_prepare,
-+ .complete = cm_suspend_complete,
-+};
-+
-+static struct platform_driver charger_manager_driver = {
-+ .driver = {
-+ .name = "charger-manager",
-+ .owner = THIS_MODULE,
-+ .pm = &charger_manager_pm,
-+ },
-+ .probe = charger_manager_probe,
-+ .remove = __devexit_p(charger_manager_remove),
-+ .id_table = charger_manager_id,
-+};
-+
-+static int __init charger_manager_init(void)
-+{
-+ return platform_driver_register(&charger_manager_driver);
-+}
-+late_initcall(charger_manager_init);
-+
-+static void __exit charger_manager_cleanup(void)
-+{
-+ platform_driver_unregister(&charger_manager_driver);
-+}
-+module_exit(charger_manager_cleanup);
-+
-+MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
-+MODULE_DESCRIPTION("Charger Manager");
-+MODULE_LICENSE("GPL");
-+MODULE_ALIAS("charger-manager");
-diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
-new file mode 100644
-index 0000000..102c5b3
---- /dev/null
-+++ b/include/linux/power/charger-manager.h
-@@ -0,0 +1,130 @@
-+/*
-+ * Copyright (C) 2011 Samsung Electronics Co., Ltd.
-+ * MyungJoo.Ham <myungjoo.ham@samsung.com>
-+ *
-+ * Charger Manager.
-+ * This framework enables to control and multiple chargers and to
-+ * monitor charging even in the context of suspend-to-RAM with
-+ * an interface combining the chargers.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+**/
-+
-+#ifndef _CHARGER_MANAGER_H
-+#define _CHARGER_MANAGER_H
-+
-+#include <linux/power_supply.h>
-+
-+enum data_source {
-+ CM_FUEL_GAUGE,
-+ CM_CHARGER_STAT,
-+};
-+
-+enum polling_modes {
-+ CM_POLL_DISABLE = 0,
-+ CM_POLL_ALWAYS,
-+ CM_POLL_EXTERNAL_POWER_ONLY,
-+ CM_POLL_CHARGING_ONLY,
-+};
-+
-+/**
-+ * struct charger_global_desc
-+ * @rtc_name: the name of RTC used to wake up the system from suspend.
-+ * @rtc_only_wakeup:
-+ * If the system is woken up by waekup-sources other than the RTC or
-+ * callbacks, Charger Manager should recognize with
-+ * rtc_only_wakeup() returning false.
-+ * If the RTC given to CM is the only wakeup reason,
-+ * rtc_only_wakeup should return true.
-+ */
-+struct charger_global_desc {
-+ char *rtc_name;
-+
-+ bool (*rtc_only_wakeup)(void);
-+};
-+
-+/**
-+ * struct charger_desc
-+ * @polling_mode:
-+ * Determine which polling mode will be used
-+ * @polling_interval_ms: interval in millisecond at which
-+ * charger manager will monitor battery health
-+ * @battery_present:
-+ * Specify where information for existance of battery can be obtained
-+ * @psy_charger_stat: the names of power-supply for chargers
-+ * @num_charger_regulator: the number of entries in charger_regulators
-+ * @charger_regulators: array of regulator_bulk_data for chargers
-+ * @psy_fuel_gauge: the name of power-supply for fuel gauge
-+ * @temperature_out_of_range:
-+ * Determine whether the status is overheat or cold or normal.
-+ * return_value > 0: overheat
-+ * return_value == 0: normal
-+ * return_value < 0: cold
-+ */
-+struct charger_desc {
-+ enum polling_modes polling_mode;
-+ unsigned int polling_interval_ms;
-+
-+ enum data_source battery_present;
-+
-+ char **psy_charger_stat;
-+
-+ int num_charger_regulators;
-+ struct regulator_bulk_data *charger_regulators;
-+
-+ char *psy_fuel_gauge;
-+
-+ int (*temperature_out_of_range)(int *mC);
-+};
-+
-+#define PSY_NAME_MAX 30
-+
-+/**
-+ * struct charger_manager
-+ * @entry: entry for list
-+ * @dev: device pointer
-+ * @desc: instance of charger_desc
-+ * @fuel_gauge: power_supply for fuel gauge
-+ * @charger_stat: array of power_supply for chargers
-+ * @charger_enabled: the state of charger
-+ * @emergency_stop:
-+ * When setting true, stop charging
-+ * @last_temp_mC: the measured temperature in milli-Celsius
-+ * @status_save_ext_pwr_inserted:
-+ * saved status of external power before entering suspend-to-RAM
-+ * @status_save_batt:
-+ * saved status of battery before entering suspend-to-RAM
-+ */
-+struct charger_manager {
-+ struct list_head entry;
-+ struct device *dev;
-+ struct charger_desc *desc;
-+
-+ struct power_supply *fuel_gauge;
-+ struct power_supply **charger_stat;
-+
-+ bool charger_enabled;
-+
-+ int emergency_stop;
-+ int last_temp_mC;
-+
-+ bool status_save_ext_pwr_inserted;
-+ bool status_save_batt;
-+};
-+
-+#ifdef CONFIG_CHARGER_MANAGER
-+extern int setup_charger_manager(struct charger_global_desc *gd);
-+extern bool cm_suspend_again(void);
-+#else
-+static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd)
-+{ }
-+
-+static bool __maybe_unused cm_suspend_again(void)
-+{
-+ return false;
-+}
-+#endif
-+
-+#endif /* _CHARGER_MANAGER_H */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0164-PM-Hibernate-Implement-compat_ioctl-for-dev-snapshot.patch b/patches.runtime_pm/0164-PM-Hibernate-Implement-compat_ioctl-for-dev-snapshot.patch
deleted file mode 100644
index 11b5e747979238..00000000000000
--- a/patches.runtime_pm/0164-PM-Hibernate-Implement-compat_ioctl-for-dev-snapshot.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From e43993ecd9db0643ab3b09d3f228a15dfe4107d4 Mon Sep 17 00:00:00 2001
-From: Ben Hutchings <ben@decadent.org.uk>
-Date: Tue, 27 Dec 2011 22:54:52 +0100
-Subject: PM / Hibernate: Implement compat_ioctl for /dev/snapshot
-
-This allows uswsusp built for i386 to run on an x86_64 kernel (tested
-with Debian package version 1.0+20110509-2).
-
-References: http://bugs.debian.org/502816
-Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c336078bf65c4d38caa9a4b8b7b7261c778e622c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/user.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 64 insertions(+)
-
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 78bdb44..6b1ab7a 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -21,6 +21,7 @@
- #include <linux/swapops.h>
- #include <linux/pm.h>
- #include <linux/fs.h>
-+#include <linux/compat.h>
- #include <linux/console.h>
- #include <linux/cpu.h>
- #include <linux/freezer.h>
-@@ -380,6 +381,66 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- return error;
- }
-
-+#ifdef CONFIG_COMPAT
-+
-+struct compat_resume_swap_area {
-+ compat_loff_t offset;
-+ u32 dev;
-+} __packed;
-+
-+static long
-+snapshot_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-+{
-+ BUILD_BUG_ON(sizeof(loff_t) != sizeof(compat_loff_t));
-+
-+ switch (cmd) {
-+ case SNAPSHOT_GET_IMAGE_SIZE:
-+ case SNAPSHOT_AVAIL_SWAP_SIZE:
-+ case SNAPSHOT_ALLOC_SWAP_PAGE: {
-+ compat_loff_t __user *uoffset = compat_ptr(arg);
-+ loff_t offset;
-+ mm_segment_t old_fs;
-+ int err;
-+
-+ old_fs = get_fs();
-+ set_fs(KERNEL_DS);
-+ err = snapshot_ioctl(file, cmd, (unsigned long) &offset);
-+ set_fs(old_fs);
-+ if (!err && put_user(offset, uoffset))
-+ err = -EFAULT;
-+ return err;
-+ }
-+
-+ case SNAPSHOT_CREATE_IMAGE:
-+ return snapshot_ioctl(file, cmd,
-+ (unsigned long) compat_ptr(arg));
-+
-+ case SNAPSHOT_SET_SWAP_AREA: {
-+ struct compat_resume_swap_area __user *u_swap_area =
-+ compat_ptr(arg);
-+ struct resume_swap_area swap_area;
-+ mm_segment_t old_fs;
-+ int err;
-+
-+ err = get_user(swap_area.offset, &u_swap_area->offset);
-+ err |= get_user(swap_area.dev, &u_swap_area->dev);
-+ if (err)
-+ return -EFAULT;
-+ old_fs = get_fs();
-+ set_fs(KERNEL_DS);
-+ err = snapshot_ioctl(file, SNAPSHOT_SET_SWAP_AREA,
-+ (unsigned long) &swap_area);
-+ set_fs(old_fs);
-+ return err;
-+ }
-+
-+ default:
-+ return snapshot_ioctl(file, cmd, arg);
-+ }
-+}
-+
-+#endif /* CONFIG_COMPAT */
-+
- static const struct file_operations snapshot_fops = {
- .open = snapshot_open,
- .release = snapshot_release,
-@@ -387,6 +448,9 @@ static const struct file_operations snapshot_fops = {
- .write = snapshot_write,
- .llseek = no_llseek,
- .unlocked_ioctl = snapshot_ioctl,
-+#ifdef CONFIG_COMPAT
-+ .compat_ioctl = snapshot_compat_ioctl,
-+#endif
- };
-
- static struct miscdevice snapshot_device = {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0165-mm-more-intensive-memory-corruption-debugging.patch b/patches.runtime_pm/0165-mm-more-intensive-memory-corruption-debugging.patch
deleted file mode 100644
index d0fa66ce4abd8e..00000000000000
--- a/patches.runtime_pm/0165-mm-more-intensive-memory-corruption-debugging.patch
+++ /dev/null
@@ -1,266 +0,0 @@
-From b836013360f4a4faf35861534bba54fe7dc1538f Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka@redhat.com>
-Date: Tue, 10 Jan 2012 15:07:28 -0800
-Subject: mm: more intensive memory corruption debugging
-
-With CONFIG_DEBUG_PAGEALLOC configured, the CPU will generate an exception
-on access (read,write) to an unallocated page, which permits us to catch
-code which corrupts memory. However the kernel is trying to maximise
-memory usage, hence there are usually few free pages in the system and
-buggy code usually corrupts some crucial data.
-
-This patch changes the buddy allocator to keep more free/protected pages
-and to interlace free/protected and allocated pages to increase the
-probability of catching corruption.
-
-When the kernel is compiled with CONFIG_DEBUG_PAGEALLOC,
-debug_guardpage_minorder defines the minimum order used by the page
-allocator to grant a request. The requested size will be returned with
-the remaining pages used as guard pages.
-
-The default value of debug_guardpage_minorder is zero: no change from
-current behaviour.
-
-[akpm@linux-foundation.org: tweak documentation, s/flg/flag/]
-Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-Cc: Mel Gorman <mgorman@suse.de>
-Cc: Andrea Arcangeli <aarcange@redhat.com>
-Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
-Cc: Christoph Lameter <cl@linux-foundation.org>
-Cc: Pekka Enberg <penberg@cs.helsinki.fi>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit c0a32fc5a2e470d0b02597b23ad79a317735253e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/kernel-parameters.txt | 19 +++++++++
- include/linux/mm.h | 17 ++++++++
- include/linux/page-debug-flags.h | 4 +-
- mm/Kconfig.debug | 5 +++
- mm/page_alloc.c | 75 ++++++++++++++++++++++++++++++++---
- 5 files changed, 113 insertions(+), 7 deletions(-)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 09a5f8a..400b7be 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -599,6 +599,25 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- no_debug_objects
- [KNL] Disable object debugging
-
-+ debug_guardpage_minorder=
-+ [KNL] When CONFIG_DEBUG_PAGEALLOC is set, this
-+ parameter allows control of the order of pages that will
-+ be intentionally kept free (and hence protected) by the
-+ buddy allocator. Bigger value increase the probability
-+ of catching random memory corruption, but reduce the
-+ amount of memory for normal system use. The maximum
-+ possible value is MAX_ORDER/2. Setting this parameter
-+ to 1 or 2 should be enough to identify most random
-+ memory corruption problems caused by bugs in kernel or
-+ driver code when a CPU writes to (or reads from) a
-+ random memory location. Note that there exists a class
-+ of memory corruptions problems caused by buggy H/W or
-+ F/W or by drivers badly programing DMA (basically when
-+ memory is written at bus level and the CPU MMU is
-+ bypassed) which are not detectable by
-+ CONFIG_DEBUG_PAGEALLOC, hence this option will not help
-+ tracking down these problems.
-+
- debugpat [X86] Enable PAT debugging
-
- decnet.addr= [HW,NET]
-diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 18eea05..988b049 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1660,5 +1660,22 @@ extern void copy_user_huge_page(struct page *dst, struct page *src,
- unsigned int pages_per_huge_page);
- #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
-
-+#ifdef CONFIG_DEBUG_PAGEALLOC
-+extern unsigned int _debug_guardpage_minorder;
-+
-+static inline unsigned int debug_guardpage_minorder(void)
-+{
-+ return _debug_guardpage_minorder;
-+}
-+
-+static inline bool page_is_guard(struct page *page)
-+{
-+ return test_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags);
-+}
-+#else
-+static inline unsigned int debug_guardpage_minorder(void) { return 0; }
-+static inline bool page_is_guard(struct page *page) { return false; }
-+#endif /* CONFIG_DEBUG_PAGEALLOC */
-+
- #endif /* __KERNEL__ */
- #endif /* _LINUX_MM_H */
-diff --git a/include/linux/page-debug-flags.h b/include/linux/page-debug-flags.h
-index b0638fd..22691f61 100644
---- a/include/linux/page-debug-flags.h
-+++ b/include/linux/page-debug-flags.h
-@@ -13,6 +13,7 @@
-
- enum page_debug_flags {
- PAGE_DEBUG_FLAG_POISON, /* Page is poisoned */
-+ PAGE_DEBUG_FLAG_GUARD,
- };
-
- /*
-@@ -21,7 +22,8 @@ enum page_debug_flags {
- */
-
- #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS
--#if !defined(CONFIG_PAGE_POISONING) \
-+#if !defined(CONFIG_PAGE_POISONING) && \
-+ !defined(CONFIG_PAGE_GUARD) \
- /* && !defined(CONFIG_PAGE_DEBUG_SOMETHING_ELSE) && ... */
- #error WANT_PAGE_DEBUG_FLAGS is turned on with no debug features!
- #endif
-diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
-index 8b1a477..4b24432 100644
---- a/mm/Kconfig.debug
-+++ b/mm/Kconfig.debug
-@@ -4,6 +4,7 @@ config DEBUG_PAGEALLOC
- depends on !HIBERNATION || ARCH_SUPPORTS_DEBUG_PAGEALLOC && !PPC && !SPARC
- depends on !KMEMCHECK
- select PAGE_POISONING if !ARCH_SUPPORTS_DEBUG_PAGEALLOC
-+ select PAGE_GUARD if ARCH_SUPPORTS_DEBUG_PAGEALLOC
- ---help---
- Unmap pages from the kernel linear mapping after free_pages().
- This results in a large slowdown, but helps to find certain types
-@@ -22,3 +23,7 @@ config WANT_PAGE_DEBUG_FLAGS
- config PAGE_POISONING
- bool
- select WANT_PAGE_DEBUG_FLAGS
-+
-+config PAGE_GUARD
-+ bool
-+ select WANT_PAGE_DEBUG_FLAGS
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 947a7e9..b9995d6 100644
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -57,6 +57,7 @@
- #include <linux/ftrace_event.h>
- #include <linux/memcontrol.h>
- #include <linux/prefetch.h>
-+#include <linux/page-debug-flags.h>
-
- #include <asm/tlbflush.h>
- #include <asm/div64.h>
-@@ -402,6 +403,37 @@ static inline void prep_zero_page(struct page *page, int order, gfp_t gfp_flags)
- clear_highpage(page + i);
- }
-
-+#ifdef CONFIG_DEBUG_PAGEALLOC
-+unsigned int _debug_guardpage_minorder;
-+
-+static int __init debug_guardpage_minorder_setup(char *buf)
-+{
-+ unsigned long res;
-+
-+ if (kstrtoul(buf, 10, &res) < 0 || res > MAX_ORDER / 2) {
-+ printk(KERN_ERR "Bad debug_guardpage_minorder value\n");
-+ return 0;
-+ }
-+ _debug_guardpage_minorder = res;
-+ printk(KERN_INFO "Setting debug_guardpage_minorder to %lu\n", res);
-+ return 0;
-+}
-+__setup("debug_guardpage_minorder=", debug_guardpage_minorder_setup);
-+
-+static inline void set_page_guard_flag(struct page *page)
-+{
-+ __set_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags);
-+}
-+
-+static inline void clear_page_guard_flag(struct page *page)
-+{
-+ __clear_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags);
-+}
-+#else
-+static inline void set_page_guard_flag(struct page *page) { }
-+static inline void clear_page_guard_flag(struct page *page) { }
-+#endif
-+
- static inline void set_page_order(struct page *page, int order)
- {
- set_page_private(page, order);
-@@ -459,6 +491,11 @@ static inline int page_is_buddy(struct page *page, struct page *buddy,
- if (page_zone_id(page) != page_zone_id(buddy))
- return 0;
-
-+ if (page_is_guard(buddy) && page_order(buddy) == order) {
-+ VM_BUG_ON(page_count(buddy) != 0);
-+ return 1;
-+ }
-+
- if (PageBuddy(buddy) && page_order(buddy) == order) {
- VM_BUG_ON(page_count(buddy) != 0);
- return 1;
-@@ -515,11 +552,19 @@ static inline void __free_one_page(struct page *page,
- buddy = page + (buddy_idx - page_idx);
- if (!page_is_buddy(page, buddy, order))
- break;
--
-- /* Our buddy is free, merge with it and move up one order. */
-- list_del(&buddy->lru);
-- zone->free_area[order].nr_free--;
-- rmv_page_order(buddy);
-+ /*
-+ * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page,
-+ * merge with it and move up one order.
-+ */
-+ if (page_is_guard(buddy)) {
-+ clear_page_guard_flag(buddy);
-+ set_page_private(page, 0);
-+ __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
-+ } else {
-+ list_del(&buddy->lru);
-+ zone->free_area[order].nr_free--;
-+ rmv_page_order(buddy);
-+ }
- combined_idx = buddy_idx & page_idx;
- page = page + (combined_idx - page_idx);
- page_idx = combined_idx;
-@@ -745,6 +790,23 @@ static inline void expand(struct zone *zone, struct page *page,
- high--;
- size >>= 1;
- VM_BUG_ON(bad_range(zone, &page[size]));
-+
-+#ifdef CONFIG_DEBUG_PAGEALLOC
-+ if (high < debug_guardpage_minorder()) {
-+ /*
-+ * Mark as guard pages (or page), that will allow to
-+ * merge back to allocator when buddy will be freed.
-+ * Corresponding page table entries will not be touched,
-+ * pages will stay not present in virtual address space
-+ */
-+ INIT_LIST_HEAD(&page[size].lru);
-+ set_page_guard_flag(&page[size]);
-+ set_page_private(&page[size], high);
-+ /* Guard pages are not available for any usage */
-+ __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << high));
-+ continue;
-+ }
-+#endif
- list_add(&page[size].lru, &area->free_list[migratetype]);
- area->nr_free++;
- set_page_order(&page[size], high);
-@@ -1774,7 +1836,8 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
- va_list args;
- unsigned int filter = SHOW_MEM_FILTER_NODES;
-
-- if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
-+ if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs) ||
-+ debug_guardpage_minorder() > 0)
- return;
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0166-PM-Hibernate-do-not-count-debug-pages-as-savable.patch b/patches.runtime_pm/0166-PM-Hibernate-do-not-count-debug-pages-as-savable.patch
deleted file mode 100644
index fffd5acb51b0a0..00000000000000
--- a/patches.runtime_pm/0166-PM-Hibernate-do-not-count-debug-pages-as-savable.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From e422e7ec788f488a7815d3cbb23b88cba9735691 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka@redhat.com>
-Date: Tue, 10 Jan 2012 15:07:31 -0800
-Subject: PM/Hibernate: do not count debug pages as savable
-
-When debugging with CONFIG_DEBUG_PAGEALLOC and debug_guardpage_minorder >
-0, we have lot of free pages that are not marked so. Snapshot code
-account them as savable, what cause hibernate memory preallocation
-failure.
-
-It is pretty hard to make hibernate allocation succeed with
-debug_guardpage_minorder=1. This change at least make it possible when
-system has relatively big amount of RAM.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
-Cc: Andrea Arcangeli <aarcange@redhat.com>
-Cc: Christoph Lameter <cl@linux-foundation.org>
-Cc: Mel Gorman <mgorman@suse.de>
-Cc: Pekka Enberg <penberg@cs.helsinki.fi>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-(cherry picked from commit c6968e73b90c2a2fb9a32d4bad249f8f70f70125)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/snapshot.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
-index cbe2c14..1cf8890 100644
---- a/kernel/power/snapshot.c
-+++ b/kernel/power/snapshot.c
-@@ -858,6 +858,9 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
- PageReserved(page))
- return NULL;
-
-+ if (page_is_guard(page))
-+ return NULL;
-+
- return page;
- }
-
-@@ -920,6 +923,9 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
- && (!kernel_page_present(page) || pfn_is_nosave(pfn)))
- return NULL;
-
-+ if (page_is_guard(page))
-+ return NULL;
-+
- return page;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0167-power_supply-Charger-Manager-Add-properties-for-powe.patch b/patches.runtime_pm/0167-power_supply-Charger-Manager-Add-properties-for-powe.patch
deleted file mode 100644
index 815f3f2f514ac0..00000000000000
--- a/patches.runtime_pm/0167-power_supply-Charger-Manager-Add-properties-for-powe.patch
+++ /dev/null
@@ -1,475 +0,0 @@
-From e3ac50aa08a8a926883d7d319abbe1924f0c0ddf Mon Sep 17 00:00:00 2001
-From: Donggeun Kim <dg77.kim@samsung.com>
-Date: Tue, 27 Dec 2011 18:47:49 +0900
-Subject: power_supply: Charger-Manager: Add properties for power-supply-class
-
-Charger Manager provides power-supply-class aggregating
-information from multiple chargers and a fuel-gauge.
-
-Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
-Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
-(cherry picked from commit ad3d13eee78ec44194bf919a37e2f711e53cbdf0)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/charger-manager.txt | 14 ++
- drivers/power/charger-manager.c | 295 ++++++++++++++++++++++++++++++-
- include/linux/power/charger-manager.h | 17 ++
- 3 files changed, 325 insertions(+), 1 deletion(-)
-
-diff --git a/Documentation/power/charger-manager.txt b/Documentation/power/charger-manager.txt
-index 081489f..fdcca99 100644
---- a/Documentation/power/charger-manager.txt
-+++ b/Documentation/power/charger-manager.txt
-@@ -98,6 +98,11 @@ battery), an instance of Charger Manager is attached to it.
-
- struct charger_desc {
-
-+char *psy_name;
-+ : The power-supply-class name of the battery. Default is
-+ "battery" if psy_name is NULL. Users can access the psy entries
-+ at "/sys/class/power_supply/[psy_name]/".
-+
- enum polling_modes polling_mode;
- : CM_POLL_DISABLE: do not poll this battery.
- CM_POLL_ALWAYS: always poll this battery.
-@@ -106,6 +111,12 @@ enum polling_modes polling_mode;
- CM_POLL_CHARGING_ONLY: poll this battery if and only if the
- battery is being charged.
-
-+unsigned int fullbatt_uV;
-+ : If specified with a non-zero value, Charger Manager assumes
-+ that the battery is full (capacity = 100) if the battery is not being
-+ charged and the battery voltage is equal to or greater than
-+ fullbatt_uV.
-+
- unsigned int polling_interval_ms;
- : Required polling interval in ms. Charger Manager will poll
- this battery every polling_interval_ms or more frequently.
-@@ -131,10 +142,13 @@ char *psy_fuel_gauge;
- : Power-supply-class name of the fuel gauge.
-
- int (*temperature_out_of_range)(int *mC);
-+bool measure_battery_temp;
- : This callback returns 0 if the temperature is safe for charging,
- a positive number if it is too hot to charge, and a negative number
- if it is too cold to charge. With the variable mC, the callback returns
- the temperature in 1/1000 of centigrade.
-+ The source of temperature can be battery or ambient one according to
-+ the value of measure_battery_temp.
- };
-
- 5. Other Considerations
-diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
-index 727a259..0378d01 100644
---- a/drivers/power/charger-manager.c
-+++ b/drivers/power/charger-manager.c
-@@ -122,6 +122,32 @@ static bool is_ext_pwr_online(struct charger_manager *cm)
- }
-
- /**
-+ * get_batt_uV - Get the voltage level of the battery
-+ * @cm: the Charger Manager representing the battery.
-+ * @uV: the voltage level returned.
-+ *
-+ * Returns 0 if there is no error.
-+ * Returns a negative value on error.
-+ */
-+static int get_batt_uV(struct charger_manager *cm, int *uV)
-+{
-+ union power_supply_propval val;
-+ int ret;
-+
-+ if (cm->fuel_gauge)
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_VOLTAGE_NOW, &val);
-+ else
-+ return -ENODEV;
-+
-+ if (ret)
-+ return ret;
-+
-+ *uV = val.intval;
-+ return 0;
-+}
-+
-+/**
- * is_charging - Returns true if the battery is being charged.
- * @cm: the Charger Manager representing the battery.
- */
-@@ -369,6 +395,208 @@ static bool cm_monitor(void)
- return stop;
- }
-
-+static int charger_get_property(struct power_supply *psy,
-+ enum power_supply_property psp,
-+ union power_supply_propval *val)
-+{
-+ struct charger_manager *cm = container_of(psy,
-+ struct charger_manager, charger_psy);
-+ struct charger_desc *desc = cm->desc;
-+ int i, ret = 0, uV;
-+
-+ switch (psp) {
-+ case POWER_SUPPLY_PROP_STATUS:
-+ if (is_charging(cm))
-+ val->intval = POWER_SUPPLY_STATUS_CHARGING;
-+ else if (is_ext_pwr_online(cm))
-+ val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
-+ else
-+ val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
-+ break;
-+ case POWER_SUPPLY_PROP_HEALTH:
-+ if (cm->emergency_stop > 0)
-+ val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
-+ else if (cm->emergency_stop < 0)
-+ val->intval = POWER_SUPPLY_HEALTH_COLD;
-+ else
-+ val->intval = POWER_SUPPLY_HEALTH_GOOD;
-+ break;
-+ case POWER_SUPPLY_PROP_PRESENT:
-+ if (is_batt_present(cm))
-+ val->intval = 1;
-+ else
-+ val->intval = 0;
-+ break;
-+ case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-+ ret = get_batt_uV(cm, &i);
-+ val->intval = i;
-+ break;
-+ case POWER_SUPPLY_PROP_CURRENT_NOW:
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CURRENT_NOW, val);
-+ break;
-+ case POWER_SUPPLY_PROP_TEMP:
-+ /* in thenth of centigrade */
-+ if (cm->last_temp_mC == INT_MIN)
-+ desc->temperature_out_of_range(&cm->last_temp_mC);
-+ val->intval = cm->last_temp_mC / 100;
-+ if (!desc->measure_battery_temp)
-+ ret = -ENODEV;
-+ break;
-+ case POWER_SUPPLY_PROP_TEMP_AMBIENT:
-+ /* in thenth of centigrade */
-+ if (cm->last_temp_mC == INT_MIN)
-+ desc->temperature_out_of_range(&cm->last_temp_mC);
-+ val->intval = cm->last_temp_mC / 100;
-+ if (desc->measure_battery_temp)
-+ ret = -ENODEV;
-+ break;
-+ case POWER_SUPPLY_PROP_CAPACITY:
-+ if (!cm->fuel_gauge) {
-+ ret = -ENODEV;
-+ break;
-+ }
-+
-+ if (!is_batt_present(cm)) {
-+ /* There is no battery. Assume 100% */
-+ val->intval = 100;
-+ break;
-+ }
-+
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CAPACITY, val);
-+ if (ret)
-+ break;
-+
-+ if (val->intval > 100) {
-+ val->intval = 100;
-+ break;
-+ }
-+ if (val->intval < 0)
-+ val->intval = 0;
-+
-+ /* Do not adjust SOC when charging: voltage is overrated */
-+ if (is_charging(cm))
-+ break;
-+
-+ /*
-+ * If the capacity value is inconsistent, calibrate it base on
-+ * the battery voltage values and the thresholds given as desc
-+ */
-+ ret = get_batt_uV(cm, &uV);
-+ if (ret) {
-+ /* Voltage information not available. No calibration */
-+ ret = 0;
-+ break;
-+ }
-+
-+ if (desc->fullbatt_uV > 0 && uV >= desc->fullbatt_uV &&
-+ !is_charging(cm)) {
-+ val->intval = 100;
-+ break;
-+ }
-+
-+ break;
-+ case POWER_SUPPLY_PROP_ONLINE:
-+ if (is_ext_pwr_online(cm))
-+ val->intval = 1;
-+ else
-+ val->intval = 0;
-+ break;
-+ case POWER_SUPPLY_PROP_CHARGE_FULL:
-+ if (cm->fuel_gauge) {
-+ if (cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CHARGE_FULL, val) == 0)
-+ break;
-+ }
-+
-+ if (is_ext_pwr_online(cm)) {
-+ /* Not full if it's charging. */
-+ if (is_charging(cm)) {
-+ val->intval = 0;
-+ break;
-+ }
-+ /*
-+ * Full if it's powered but not charging andi
-+ * not forced stop by emergency
-+ */
-+ if (!cm->emergency_stop) {
-+ val->intval = 1;
-+ break;
-+ }
-+ }
-+
-+ /* Full if it's over the fullbatt voltage */
-+ ret = get_batt_uV(cm, &uV);
-+ if (!ret && desc->fullbatt_uV > 0 && uV >= desc->fullbatt_uV &&
-+ !is_charging(cm)) {
-+ val->intval = 1;
-+ break;
-+ }
-+
-+ /* Full if the cap is 100 */
-+ if (cm->fuel_gauge) {
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CAPACITY, val);
-+ if (!ret && val->intval >= 100 && !is_charging(cm)) {
-+ val->intval = 1;
-+ break;
-+ }
-+ }
-+
-+ val->intval = 0;
-+ ret = 0;
-+ break;
-+ case POWER_SUPPLY_PROP_CHARGE_NOW:
-+ if (is_charging(cm)) {
-+ ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CHARGE_NOW,
-+ val);
-+ if (ret) {
-+ val->intval = 1;
-+ ret = 0;
-+ } else {
-+ /* If CHARGE_NOW is supplied, use it */
-+ val->intval = (val->intval > 0) ?
-+ val->intval : 1;
-+ }
-+ } else {
-+ val->intval = 0;
-+ }
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+ return ret;
-+}
-+
-+#define NUM_CHARGER_PSY_OPTIONAL (4)
-+static enum power_supply_property default_charger_props[] = {
-+ /* Guaranteed to provide */
-+ POWER_SUPPLY_PROP_STATUS,
-+ POWER_SUPPLY_PROP_HEALTH,
-+ POWER_SUPPLY_PROP_PRESENT,
-+ POWER_SUPPLY_PROP_VOLTAGE_NOW,
-+ POWER_SUPPLY_PROP_CAPACITY,
-+ POWER_SUPPLY_PROP_ONLINE,
-+ POWER_SUPPLY_PROP_CHARGE_FULL,
-+ /*
-+ * Optional properties are:
-+ * POWER_SUPPLY_PROP_CHARGE_NOW,
-+ * POWER_SUPPLY_PROP_CURRENT_NOW,
-+ * POWER_SUPPLY_PROP_TEMP, and
-+ * POWER_SUPPLY_PROP_TEMP_AMBIENT,
-+ */
-+};
-+
-+static struct power_supply psy_default = {
-+ .name = "battery",
-+ .type = POWER_SUPPLY_TYPE_BATTERY,
-+ .properties = default_charger_props,
-+ .num_properties = ARRAY_SIZE(default_charger_props),
-+ .get_property = charger_get_property,
-+};
-+
- /**
- * cm_setup_timer - For in-suspend monitoring setup wakeup alarm
- * for suspend_again.
-@@ -532,6 +760,7 @@ static int charger_manager_probe(struct platform_device *pdev)
- struct charger_desc *desc = dev_get_platdata(&pdev->dev);
- struct charger_manager *cm;
- int ret = 0, i = 0;
-+ union power_supply_propval val;
-
- if (g_desc && !rtc_dev && g_desc->rtc_name) {
- rtc_dev = rtc_class_open(g_desc->rtc_name);
-@@ -626,11 +855,68 @@ static int charger_manager_probe(struct platform_device *pdev)
-
- platform_set_drvdata(pdev, cm);
-
-+ memcpy(&cm->charger_psy, &psy_default,
-+ sizeof(psy_default));
-+ if (!desc->psy_name) {
-+ strncpy(cm->psy_name_buf, psy_default.name,
-+ PSY_NAME_MAX);
-+ } else {
-+ strncpy(cm->psy_name_buf, desc->psy_name, PSY_NAME_MAX);
-+ }
-+ cm->charger_psy.name = cm->psy_name_buf;
-+
-+ /* Allocate for psy properties because they may vary */
-+ cm->charger_psy.properties = kzalloc(sizeof(enum power_supply_property)
-+ * (ARRAY_SIZE(default_charger_props) +
-+ NUM_CHARGER_PSY_OPTIONAL),
-+ GFP_KERNEL);
-+ if (!cm->charger_psy.properties) {
-+ dev_err(&pdev->dev, "Cannot allocate for psy properties.\n");
-+ ret = -ENOMEM;
-+ goto err_chg_stat;
-+ }
-+ memcpy(cm->charger_psy.properties, default_charger_props,
-+ sizeof(enum power_supply_property) *
-+ ARRAY_SIZE(default_charger_props));
-+ cm->charger_psy.num_properties = psy_default.num_properties;
-+
-+ /* Find which optional psy-properties are available */
-+ if (!cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
-+ cm->charger_psy.properties[cm->charger_psy.num_properties] =
-+ POWER_SUPPLY_PROP_CHARGE_NOW;
-+ cm->charger_psy.num_properties++;
-+ }
-+ if (!cm->fuel_gauge->get_property(cm->fuel_gauge,
-+ POWER_SUPPLY_PROP_CURRENT_NOW,
-+ &val)) {
-+ cm->charger_psy.properties[cm->charger_psy.num_properties] =
-+ POWER_SUPPLY_PROP_CURRENT_NOW;
-+ cm->charger_psy.num_properties++;
-+ }
-+ if (!desc->measure_battery_temp) {
-+ cm->charger_psy.properties[cm->charger_psy.num_properties] =
-+ POWER_SUPPLY_PROP_TEMP_AMBIENT;
-+ cm->charger_psy.num_properties++;
-+ }
-+ if (desc->measure_battery_temp) {
-+ cm->charger_psy.properties[cm->charger_psy.num_properties] =
-+ POWER_SUPPLY_PROP_TEMP;
-+ cm->charger_psy.num_properties++;
-+ }
-+
-+ ret = power_supply_register(NULL, &cm->charger_psy);
-+ if (ret) {
-+ dev_err(&pdev->dev, "Cannot register charger-manager with"
-+ " name \"%s\".\n", cm->charger_psy.name);
-+ goto err_register;
-+ }
-+
- ret = regulator_bulk_get(&pdev->dev, desc->num_charger_regulators,
- desc->charger_regulators);
- if (ret) {
- dev_err(&pdev->dev, "Cannot get charger regulators.\n");
-- goto err_chg_stat;
-+ goto err_bulk_get;
- }
-
- ret = try_charger_enable(cm, true);
-@@ -650,6 +936,10 @@ err_chg_enable:
- if (desc->charger_regulators)
- regulator_bulk_free(desc->num_charger_regulators,
- desc->charger_regulators);
-+err_bulk_get:
-+ power_supply_unregister(&cm->charger_psy);
-+err_register:
-+ kfree(cm->charger_psy.properties);
- err_chg_stat:
- kfree(cm->charger_stat);
- err_no_charger_stat:
-@@ -674,6 +964,9 @@ static int __devexit charger_manager_remove(struct platform_device *pdev)
- if (desc->charger_regulators)
- regulator_bulk_free(desc->num_charger_regulators,
- desc->charger_regulators);
-+
-+ power_supply_unregister(&cm->charger_psy);
-+ kfree(cm->charger_psy.properties);
- kfree(cm->charger_stat);
- kfree(cm->desc);
- kfree(cm);
-diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
-index 102c5b3..4f75e53 100644
---- a/include/linux/power/charger-manager.h
-+++ b/include/linux/power/charger-manager.h
-@@ -47,8 +47,12 @@ struct charger_global_desc {
-
- /**
- * struct charger_desc
-+ * @psy_name: the name of power-supply-class for charger manager
- * @polling_mode:
- * Determine which polling mode will be used
-+ * @fullbatt_uV: voltage in microvolt
-+ * If it is not being charged and VBATT >= fullbatt_uV,
-+ * it is assumed to be full.
- * @polling_interval_ms: interval in millisecond at which
- * charger manager will monitor battery health
- * @battery_present:
-@@ -62,11 +66,18 @@ struct charger_global_desc {
- * return_value > 0: overheat
- * return_value == 0: normal
- * return_value < 0: cold
-+ * @measure_battery_temp:
-+ * true: measure battery temperature
-+ * false: measure ambient temperature
- */
- struct charger_desc {
-+ char *psy_name;
-+
- enum polling_modes polling_mode;
- unsigned int polling_interval_ms;
-
-+ unsigned int fullbatt_uV;
-+
- enum data_source battery_present;
-
- char **psy_charger_stat;
-@@ -77,6 +88,7 @@ struct charger_desc {
- char *psy_fuel_gauge;
-
- int (*temperature_out_of_range)(int *mC);
-+ bool measure_battery_temp;
- };
-
- #define PSY_NAME_MAX 30
-@@ -92,6 +104,8 @@ struct charger_desc {
- * @emergency_stop:
- * When setting true, stop charging
- * @last_temp_mC: the measured temperature in milli-Celsius
-+ * @psy_name_buf: the name of power-supply-class for charger manager
-+ * @charger_psy: power_supply for charger manager
- * @status_save_ext_pwr_inserted:
- * saved status of external power before entering suspend-to-RAM
- * @status_save_batt:
-@@ -110,6 +124,9 @@ struct charger_manager {
- int emergency_stop;
- int last_temp_mC;
-
-+ char psy_name_buf[PSY_NAME_MAX + 1];
-+ struct power_supply charger_psy;
-+
- bool status_save_ext_pwr_inserted;
- bool status_save_batt;
- };
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0168-PM-Domains-Fix-build-for-CONFIG_PM_SLEEP-unset.patch b/patches.runtime_pm/0168-PM-Domains-Fix-build-for-CONFIG_PM_SLEEP-unset.patch
deleted file mode 100644
index f5ee60b01335a3..00000000000000
--- a/patches.runtime_pm/0168-PM-Domains-Fix-build-for-CONFIG_PM_SLEEP-unset.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 04a1d345aba69929681a8e902e398b2816bdf858 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 14 Jan 2012 00:39:25 +0100
-Subject: PM / Domains: Fix build for CONFIG_PM_SLEEP unset
-
-Some callback functions defined in drivers/base/power/domain.c are
-only necessary if CONFIG_PM_SLEEP is set and they call some other
-functions that are only available in that case. For this reason,
-they should not be compiled at all when CONFIG_PM_SLEEP is not set.
-
-Reported-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0f1d6986bae57b6d11e2c9ce5e66b6c6b0e3684d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 92e6a90..978bbf7 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -1429,6 +1429,8 @@ static int pm_genpd_default_restore_state(struct device *dev)
- return 0;
- }
-
-+#ifdef CONFIG_PM_SLEEP
-+
- /**
- * pm_genpd_default_suspend - Default "device suspend" for PM domians.
- * @dev: Device to handle.
-@@ -1517,6 +1519,19 @@ static int pm_genpd_default_thaw(struct device *dev)
- return cb ? cb(dev) : pm_generic_thaw(dev);
- }
-
-+#else /* !CONFIG_PM_SLEEP */
-+
-+#define pm_genpd_default_suspend NULL
-+#define pm_genpd_default_suspend_late NULL
-+#define pm_genpd_default_resume_early NULL
-+#define pm_genpd_default_resume NULL
-+#define pm_genpd_default_freeze NULL
-+#define pm_genpd_default_freeze_late NULL
-+#define pm_genpd_default_thaw_early NULL
-+#define pm_genpd_default_thaw NULL
-+
-+#endif /* !CONFIG_PM_SLEEP */
-+
- /**
- * pm_genpd_init - Initialize a generic I/O PM domain object.
- * @genpd: PM domain object to initialize.
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0169-PM-Domains-Skip-governor-functions-for-CONFIG_PM_RUN.patch b/patches.runtime_pm/0169-PM-Domains-Skip-governor-functions-for-CONFIG_PM_RUN.patch
deleted file mode 100644
index e95e7e0363673c..00000000000000
--- a/patches.runtime_pm/0169-PM-Domains-Skip-governor-functions-for-CONFIG_PM_RUN.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From cfff8ac55b042842b4b3bb543f4a5bd64190d04c Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 14 Jan 2012 00:39:36 +0100
-Subject: PM / Domains: Skip governor functions for CONFIG_PM_RUNTIME unset
-
-The governor functions in drivers/base/power/domain_governor.c
-are only used if CONFIG_PM_RUNTIME is set and they refer to data
-structures that are only present in that case. For this reason,
-they shouldn't be compiled at all when CONFIG_PM_RUNTIME is not set.
-
-Reported-by: Kukjin Kim <kgene.kim@samsung.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e59a8db8d9b7c02e0bbefbeb18a3836288a97b8a)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain_governor.c | 24 +++++++++++++++++++-----
- 1 file changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
-index 51527ee..66a265b 100644
---- a/drivers/base/power/domain_governor.c
-+++ b/drivers/base/power/domain_governor.c
-@@ -12,6 +12,8 @@
- #include <linux/pm_qos.h>
- #include <linux/hrtimer.h>
-
-+#ifdef CONFIG_PM_RUNTIME
-+
- /**
- * default_stop_ok - Default PM domain governor routine for stopping devices.
- * @dev: Device to check.
-@@ -137,16 +139,28 @@ static bool default_power_down_ok(struct dev_pm_domain *pd)
- return true;
- }
-
--struct dev_power_governor simple_qos_governor = {
-- .stop_ok = default_stop_ok,
-- .power_down_ok = default_power_down_ok,
--};
--
- static bool always_on_power_down_ok(struct dev_pm_domain *domain)
- {
- return false;
- }
-
-+#else /* !CONFIG_PM_RUNTIME */
-+
-+bool default_stop_ok(struct device *dev)
-+{
-+ return false;
-+}
-+
-+#define default_power_down_ok NULL
-+#define always_on_power_down_ok NULL
-+
-+#endif /* !CONFIG_PM_RUNTIME */
-+
-+struct dev_power_governor simple_qos_governor = {
-+ .stop_ok = default_stop_ok,
-+ .power_down_ok = default_power_down_ok,
-+};
-+
- /**
- * pm_genpd_gov_always_on - A governor implementing an always-on policy
- */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0170-PM-Documentation-Fix-spelling-mistake-in-basic-pm-de.patch b/patches.runtime_pm/0170-PM-Documentation-Fix-spelling-mistake-in-basic-pm-de.patch
deleted file mode 100644
index b6e7b12473d141..00000000000000
--- a/patches.runtime_pm/0170-PM-Documentation-Fix-spelling-mistake-in-basic-pm-de.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f1cb94feb8a611bd0d4d0bef6fb610b0979fb719 Mon Sep 17 00:00:00 2001
-From: Viresh Kumar <viresh.kumar@st.com>
-Date: Thu, 19 Jan 2012 23:22:38 +0100
-Subject: PM / Documentation: Fix spelling mistake in basic-pm-debugging.txt
-
-Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f581b63aa1049ac030d6eb6c24e1be1ce2072ae7)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/basic-pm-debugging.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt
-index 40a4c65..262acf5 100644
---- a/Documentation/power/basic-pm-debugging.txt
-+++ b/Documentation/power/basic-pm-debugging.txt
-@@ -15,7 +15,7 @@ test at least a couple of times in a row for confidence. [This is necessary,
- because some problems only show up on a second attempt at suspending and
- resuming the system.] Moreover, hibernating in the "reboot" and "shutdown"
- modes causes the PM core to skip some platform-related callbacks which on ACPI
--systems might be necessary to make hibernation work. Thus, if you machine fails
-+systems might be necessary to make hibernation work. Thus, if your machine fails
- to hibernate or resume in the "reboot" mode, you should try the "platform" mode:
-
- # echo platform > /sys/power/disk
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0171-PM-Documentation-Fix-minor-issue-in-freezing_of_task.patch b/patches.runtime_pm/0171-PM-Documentation-Fix-minor-issue-in-freezing_of_task.patch
deleted file mode 100644
index 3b5f7986482ea8..00000000000000
--- a/patches.runtime_pm/0171-PM-Documentation-Fix-minor-issue-in-freezing_of_task.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 7cc00c63b297865362af93050bd1abc40eee595f Mon Sep 17 00:00:00 2001
-From: Viresh Kumar <viresh.kumar@st.com>
-Date: Thu, 19 Jan 2012 23:22:49 +0100
-Subject: PM / Documentation: Fix minor issue in freezing_of_tasks.txt
-
-In a paragraph, "kernel thread" is mistakenly written as "kernel". Fix this by
-adding thread after word "kernel".
-
-Changes are shown in multiple lines, as they are realigned to 80 col width.
-
-Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
-Acked-by: Pavel Machek <pavel@ucw.cz>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 5eb6f9ad96967be4e0da55521a253e11b534bd3f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
-index 6ccb68f..ebd7490 100644
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -120,10 +120,10 @@ So in practice, the 'at all' may become a 'why freeze kernel threads?' and
- freezing user threads I don't find really objectionable."
-
- Still, there are kernel threads that may want to be freezable. For example, if
--a kernel that belongs to a device driver accesses the device directly, it in
--principle needs to know when the device is suspended, so that it doesn't try to
--access it at that time. However, if the kernel thread is freezable, it will be
--frozen before the driver's .suspend() callback is executed and it will be
-+a kernel thread that belongs to a device driver accesses the device directly, it
-+in principle needs to know when the device is suspended, so that it doesn't try
-+to access it at that time. However, if the kernel thread is freezable, it will
-+be frozen before the driver's .suspend() callback is executed and it will be
- thawed after the driver's .resume() callback has run, so it won't be accessing
- the device while it's suspended.
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0172-PM-Hibernate-Correct-additional-pages-number-calcula.patch b/patches.runtime_pm/0172-PM-Hibernate-Correct-additional-pages-number-calcula.patch
deleted file mode 100644
index f800f45806a4c4..00000000000000
--- a/patches.runtime_pm/0172-PM-Hibernate-Correct-additional-pages-number-calcula.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From bcde79abed47acf85fed2f7a6fb8a30797b88b65 Mon Sep 17 00:00:00 2001
-From: Namhyung Kim <namhyung.kim@lge.com>
-Date: Thu, 19 Jan 2012 23:23:10 +0100
-Subject: PM / Hibernate: Correct additional pages number calculation
-
-The struct bm_block is allocated by chain_alloc(),
-so it'd better counting it in LINKED_PAGE_DATA_SIZE.
-
-Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 160cb5a97daef0cb894685d84c9d4700bb7cccb4)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/snapshot.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
-index 1cf8890..6a768e5 100644
---- a/kernel/power/snapshot.c
-+++ b/kernel/power/snapshot.c
-@@ -812,7 +812,8 @@ unsigned int snapshot_additional_pages(struct zone *zone)
- unsigned int res;
-
- res = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK);
-- res += DIV_ROUND_UP(res * sizeof(struct bm_block), PAGE_SIZE);
-+ res += DIV_ROUND_UP(res * sizeof(struct bm_block),
-+ LINKED_PAGE_DATA_SIZE);
- return 2 * res;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0173-PM-Domains-Add-OF-support.patch b/patches.runtime_pm/0173-PM-Domains-Add-OF-support.patch
deleted file mode 100644
index fccf44fa7ac828..00000000000000
--- a/patches.runtime_pm/0173-PM-Domains-Add-OF-support.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From 314661eba783d9fa1cd1a2e10dc37479d432df35 Mon Sep 17 00:00:00 2001
-From: Thomas Abraham <thomas.abraham@linaro.org>
-Date: Fri, 27 Jan 2012 15:22:07 +0900
-Subject: PM / Domains: Add OF support
-
-A device node pointer is added to generic pm domain structure to associate
-the domain with a node in the device tree. The platform code parses the
-device tree to find available nodes representing the generic power domain,
-instantiates the available domains and initializes them by calling
-pm_genpd_init().
-
-Nodes representing the devices include a phandle of the power domain to
-which it belongs. As these devices get instantiated, the driver code
-checkes for availability of a power domain phandle, converts the phandle
-to a device node and uses the new pm_genpd_of_add_device() api to
-associate the device with a power domain.
-
-pm_genpd_of_add_device() runs through its list of registered power domains
-and matches the OF node of the domain with the one specified as the
-parameter. If a match is found, the device is associated with the matched
-domain.
-
-Cc: Rob Herring <rob.herring@calxeda.com>
-Cc: Grant Likely <grant.likely@secretlab.ca>
-Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
-Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
-Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-(cherry picked from commit c8aa130b74cc5b112cb2b119d3b477abaaf6e5b2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 32 ++++++++++++++++++++++++++++++++
- include/linux/pm_domain.h | 12 ++++++++++++
- 2 files changed, 44 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 978bbf7..939109b 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -1171,6 +1171,38 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
- }
-
- /**
-+ * __pm_genpd_of_add_device - Add a device to an I/O PM domain.
-+ * @genpd_node: Device tree node pointer representing a PM domain to which the
-+ * the device is added to.
-+ * @dev: Device to be added.
-+ * @td: Set of PM QoS timing parameters to attach to the device.
-+ */
-+int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev,
-+ struct gpd_timing_data *td)
-+{
-+ struct generic_pm_domain *genpd = NULL, *gpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev))
-+ return -EINVAL;
-+
-+ mutex_lock(&gpd_list_lock);
-+ list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
-+ if (gpd->of_node == genpd_node) {
-+ genpd = gpd;
-+ break;
-+ }
-+ }
-+ mutex_unlock(&gpd_list_lock);
-+
-+ if (!genpd)
-+ return -EINVAL;
-+
-+ return __pm_genpd_add_device(genpd, dev, td);
-+}
-+
-+/**
- * pm_genpd_remove_device - Remove a device from an I/O PM domain.
- * @genpd: PM domain to remove the device from.
- * @dev: Device to be removed.
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index a03a0ad..e3ff875 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -11,6 +11,7 @@
-
- #include <linux/device.h>
- #include <linux/err.h>
-+#include <linux/of.h>
-
- enum gpd_status {
- GPD_STATE_ACTIVE = 0, /* PM domain is active */
-@@ -70,6 +71,7 @@ struct generic_pm_domain {
- s64 break_even_ns; /* Power break even for the entire domain. */
- s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
- ktime_t power_off_time;
-+ struct device_node *of_node; /* Node in device tree */
- };
-
- static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
-@@ -117,12 +119,22 @@ extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev,
- struct gpd_timing_data *td);
-
-+extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
-+ struct device *dev,
-+ struct gpd_timing_data *td);
-+
- static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
- struct device *dev)
- {
- return __pm_genpd_add_device(genpd, dev, NULL);
- }
-
-+static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
-+ struct device *dev)
-+{
-+ return __pm_genpd_of_add_device(genpd_node, dev, NULL);
-+}
-+
- extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- struct device *dev);
- extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0174-PM-Hibernate-Fix-s2disk-regression-related-to-freezi.patch b/patches.runtime_pm/0174-PM-Hibernate-Fix-s2disk-regression-related-to-freezi.patch
deleted file mode 100644
index ee53598579de62..00000000000000
--- a/patches.runtime_pm/0174-PM-Hibernate-Fix-s2disk-regression-related-to-freezi.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 7076202f971b113497daf7a80c26cf16e59ef112 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 29 Jan 2012 20:35:52 +0100
-Subject: PM / Hibernate: Fix s2disk regression related to freezing workqueues
-
-Commit 2aede851ddf08666f68ffc17be446420e9d2a056
-
- PM / Hibernate: Freeze kernel threads after preallocating memory
-
-introduced a mechanism by which kernel threads were frozen after
-the preallocation of hibernate image memory to avoid problems with
-frozen kernel threads not responding to memory freeing requests.
-However, it overlooked the s2disk code path in which the
-SNAPSHOT_CREATE_IMAGE ioctl was run directly after SNAPSHOT_FREE,
-which caused freeze_workqueues_begin() to BUG(), because it saw
-that worqueues had been already frozen.
-
-Although in principle this issue might be addressed by removing
-the relevant BUG_ON() from freeze_workqueues_begin(), that would
-reintroduce the very problem that commit 2aede851ddf08666f68ffc17be4
-attempted to avoid into that particular code path. For this reason,
-to fix the issue at hand, introduce thaw_kernel_threads() and make
-the SNAPSHOT_FREE ioctl execute it.
-
-Special thanks to Srivatsa S. Bhat for detailed analysis of the
-problem.
-
-Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Cc: stable@kernel.org
-(cherry picked from commit 181e9bdef37bfcaa41f3ab6c948a2a0d60a268b5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/freezer.h | 2 ++
- kernel/power/process.c | 19 +++++++++++++++++++
- kernel/power/user.c | 9 +++++++++
- 3 files changed, 30 insertions(+)
-
-diff --git a/include/linux/freezer.h b/include/linux/freezer.h
-index b79db3d..a1e0727 100644
---- a/include/linux/freezer.h
-+++ b/include/linux/freezer.h
-@@ -44,6 +44,7 @@ extern bool __refrigerator(bool check_kthr_stop);
- extern int freeze_processes(void);
- extern int freeze_kernel_threads(void);
- extern void thaw_processes(void);
-+extern void thaw_kernel_threads(void);
-
- static inline bool try_to_freeze(void)
- {
-@@ -164,6 +165,7 @@ static inline bool __refrigerator(bool check_kthr_stop) { return false; }
- static inline int freeze_processes(void) { return -ENOSYS; }
- static inline int freeze_kernel_threads(void) { return -ENOSYS; }
- static inline void thaw_processes(void) {}
-+static inline void thaw_kernel_threads(void) {}
-
- static inline bool try_to_freeze(void) { return false; }
-
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 77274c9..eeca003 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -188,3 +188,22 @@ void thaw_processes(void)
- printk("done.\n");
- }
-
-+void thaw_kernel_threads(void)
-+{
-+ struct task_struct *g, *p;
-+
-+ pm_nosig_freezing = false;
-+ printk("Restarting kernel threads ... ");
-+
-+ thaw_workqueues();
-+
-+ read_lock(&tasklist_lock);
-+ do_each_thread(g, p) {
-+ if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
-+ __thaw_task(p);
-+ } while_each_thread(g, p);
-+ read_unlock(&tasklist_lock);
-+
-+ schedule();
-+ printk("done.\n");
-+}
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 6b1ab7a..e5a21a8 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -274,6 +274,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- swsusp_free();
- memset(&data->handle, 0, sizeof(struct snapshot_handle));
- data->ready = 0;
-+ /*
-+ * It is necessary to thaw kernel threads here, because
-+ * SNAPSHOT_CREATE_IMAGE may be invoked directly after
-+ * SNAPSHOT_FREE. In that case, if kernel threads were not
-+ * thawed, the preallocation of memory carried out by
-+ * hibernation_snapshot() might run into problems (i.e. it
-+ * might fail or even deadlock).
-+ */
-+ thaw_kernel_threads();
- break;
-
- case SNAPSHOT_PREF_IMAGE_SIZE:
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0175-PM-Sleep-Introduce-late-suspend-and-early-resume-of-.patch b/patches.runtime_pm/0175-PM-Sleep-Introduce-late-suspend-and-early-resume-of-.patch
deleted file mode 100644
index 99995d4a193253..00000000000000
--- a/patches.runtime_pm/0175-PM-Sleep-Introduce-late-suspend-and-early-resume-of-.patch
+++ /dev/null
@@ -1,979 +0,0 @@
-From dca3a5c3507d066f750ba2ce7ee8f8f695d75162 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 29 Jan 2012 20:38:29 +0100
-Subject: PM / Sleep: Introduce "late suspend" and "early resume" of devices
-
-The current device suspend/resume phases during system-wide power
-transitions appear to be insufficient for some platforms that want
-to use the same callback routines for saving device states and
-related operations during runtime suspend/resume as well as during
-system suspend/resume. In principle, they could point their
-.suspend_noirq() and .resume_noirq() to the same callback routines
-as their .runtime_suspend() and .runtime_resume(), respectively,
-but at least some of them require device interrupts to be enabled
-while the code in those routines is running.
-
-It also makes sense to have device suspend-resume callbacks that will
-be executed with runtime PM disabled and with device interrupts
-enabled in case someone needs to run some special code in that
-context during system-wide power transitions.
-
-Apart from this, .suspend_noirq() and .resume_noirq() were introduced
-as a workaround for drivers using shared interrupts and failing to
-prevent their interrupt handlers from accessing suspended hardware.
-It appears to be better not to use them for other porposes, or we may
-have to deal with some serious confusion (which seems to be happening
-already).
-
-For the above reasons, introduce new device suspend/resume phases,
-"late suspend" and "early resume" (and analogously for hibernation)
-whose callback will be executed with runtime PM disabled and with
-device interrupts enabled and whose callback pointers generally may
-point to runtime suspend/resume routines.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-(cherry picked from commit cf579dfb82550e34de7ccf3ef090d8b834ccd3a9)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/devices.txt | 93 ++++++++++-----
- arch/x86/kernel/apm_32.c | 11 +-
- drivers/base/power/main.c | 247 +++++++++++++++++++++++++++++++++++----
- drivers/xen/manage.c | 6 +-
- include/linux/pm.h | 43 +++++--
- include/linux/suspend.h | 4 +
- kernel/kexec.c | 8 +-
- kernel/power/hibernate.c | 24 ++--
- kernel/power/main.c | 8 +-
- kernel/power/suspend.c | 4 +-
- 10 files changed, 357 insertions(+), 91 deletions(-)
-
-diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
-index 20af7de..872815c 100644
---- a/Documentation/power/devices.txt
-+++ b/Documentation/power/devices.txt
-@@ -96,6 +96,12 @@ struct dev_pm_ops {
- int (*thaw)(struct device *dev);
- int (*poweroff)(struct device *dev);
- int (*restore)(struct device *dev);
-+ int (*suspend_late)(struct device *dev);
-+ int (*resume_early)(struct device *dev);
-+ int (*freeze_late)(struct device *dev);
-+ int (*thaw_early)(struct device *dev);
-+ int (*poweroff_late)(struct device *dev);
-+ int (*restore_early)(struct device *dev);
- int (*suspend_noirq)(struct device *dev);
- int (*resume_noirq)(struct device *dev);
- int (*freeze_noirq)(struct device *dev);
-@@ -305,7 +311,7 @@ Entering System Suspend
- -----------------------
- When the system goes into the standby or memory sleep state, the phases are:
-
-- prepare, suspend, suspend_noirq.
-+ prepare, suspend, suspend_late, suspend_noirq.
-
- 1. The prepare phase is meant to prevent races by preventing new devices
- from being registered; the PM core would never know that all the
-@@ -324,7 +330,12 @@ When the system goes into the standby or memory sleep state, the phases are:
- appropriate low-power state, depending on the bus type the device is on,
- and they may enable wakeup events.
-
-- 3. The suspend_noirq phase occurs after IRQ handlers have been disabled,
-+ 3 For a number of devices it is convenient to split suspend into the
-+ "quiesce device" and "save device state" phases, in which cases
-+ suspend_late is meant to do the latter. It is always executed after
-+ runtime power management has been disabled for all devices.
-+
-+ 4. The suspend_noirq phase occurs after IRQ handlers have been disabled,
- which means that the driver's interrupt handler will not be called while
- the callback method is running. The methods should save the values of
- the device's registers that weren't saved previously and finally put the
-@@ -359,7 +370,7 @@ Leaving System Suspend
- ----------------------
- When resuming from standby or memory sleep, the phases are:
-
-- resume_noirq, resume, complete.
-+ resume_noirq, resume_early, resume, complete.
-
- 1. The resume_noirq callback methods should perform any actions needed
- before the driver's interrupt handlers are invoked. This generally
-@@ -375,14 +386,18 @@ When resuming from standby or memory sleep, the phases are:
- device driver's ->pm.resume_noirq() method to perform device-specific
- actions.
-
-- 2. The resume methods should bring the the device back to its operating
-+ 2. The resume_early methods should prepare devices for the execution of
-+ the resume methods. This generally involves undoing the actions of the
-+ preceding suspend_late phase.
-+
-+ 3 The resume methods should bring the the device back to its operating
- state, so that it can perform normal I/O. This generally involves
- undoing the actions of the suspend phase.
-
-- 3. The complete phase uses only a bus callback. The method should undo the
-- actions of the prepare phase. Note, however, that new children may be
-- registered below the device as soon as the resume callbacks occur; it's
-- not necessary to wait until the complete phase.
-+ 4. The complete phase should undo the actions of the prepare phase. Note,
-+ however, that new children may be registered below the device as soon as
-+ the resume callbacks occur; it's not necessary to wait until the
-+ complete phase.
-
- At the end of these phases, drivers should be as functional as they were before
- suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are
-@@ -429,8 +444,8 @@ an image of the system memory while everything is stable, reactivate all
- devices (thaw), write the image to permanent storage, and finally shut down the
- system (poweroff). The phases used to accomplish this are:
-
-- prepare, freeze, freeze_noirq, thaw_noirq, thaw, complete,
-- prepare, poweroff, poweroff_noirq
-+ prepare, freeze, freeze_late, freeze_noirq, thaw_noirq, thaw_early,
-+ thaw, complete, prepare, poweroff, poweroff_late, poweroff_noirq
-
- 1. The prepare phase is discussed in the "Entering System Suspend" section
- above.
-@@ -441,7 +456,11 @@ system (poweroff). The phases used to accomplish this are:
- save time it's best not to do so. Also, the device should not be
- prepared to generate wakeup events.
-
-- 3. The freeze_noirq phase is analogous to the suspend_noirq phase discussed
-+ 3. The freeze_late phase is analogous to the suspend_late phase described
-+ above, except that the device should not be put in a low-power state and
-+ should not be allowed to generate wakeup events by it.
-+
-+ 4. The freeze_noirq phase is analogous to the suspend_noirq phase discussed
- above, except again that the device should not be put in a low-power
- state and should not be allowed to generate wakeup events.
-
-@@ -449,15 +468,19 @@ At this point the system image is created. All devices should be inactive and
- the contents of memory should remain undisturbed while this happens, so that the
- image forms an atomic snapshot of the system state.
-
-- 4. The thaw_noirq phase is analogous to the resume_noirq phase discussed
-+ 5. The thaw_noirq phase is analogous to the resume_noirq phase discussed
- above. The main difference is that its methods can assume the device is
- in the same state as at the end of the freeze_noirq phase.
-
-- 5. The thaw phase is analogous to the resume phase discussed above. Its
-+ 6. The thaw_early phase is analogous to the resume_early phase described
-+ above. Its methods should undo the actions of the preceding
-+ freeze_late, if necessary.
-+
-+ 7. The thaw phase is analogous to the resume phase discussed above. Its
- methods should bring the device back to an operating state, so that it
- can be used for saving the image if necessary.
-
-- 6. The complete phase is discussed in the "Leaving System Suspend" section
-+ 8. The complete phase is discussed in the "Leaving System Suspend" section
- above.
-
- At this point the system image is saved, and the devices then need to be
-@@ -465,16 +488,19 @@ prepared for the upcoming system shutdown. This is much like suspending them
- before putting the system into the standby or memory sleep state, and the phases
- are similar.
-
-- 7. The prepare phase is discussed above.
-+ 9. The prepare phase is discussed above.
-+
-+ 10. The poweroff phase is analogous to the suspend phase.
-
-- 8. The poweroff phase is analogous to the suspend phase.
-+ 11. The poweroff_late phase is analogous to the suspend_late phase.
-
-- 9. The poweroff_noirq phase is analogous to the suspend_noirq phase.
-+ 12. The poweroff_noirq phase is analogous to the suspend_noirq phase.
-
--The poweroff and poweroff_noirq callbacks should do essentially the same things
--as the suspend and suspend_noirq callbacks. The only notable difference is that
--they need not store the device register values, because the registers should
--already have been stored during the freeze or freeze_noirq phases.
-+The poweroff, poweroff_late and poweroff_noirq callbacks should do essentially
-+the same things as the suspend, suspend_late and suspend_noirq callbacks,
-+respectively. The only notable difference is that they need not store the
-+device register values, because the registers should already have been stored
-+during the freeze, freeze_late or freeze_noirq phases.
-
-
- Leaving Hibernation
-@@ -518,22 +544,25 @@ To achieve this, the image kernel must restore the devices' pre-hibernation
- functionality. The operation is much like waking up from the memory sleep
- state, although it involves different phases:
-
-- restore_noirq, restore, complete
-+ restore_noirq, restore_early, restore, complete
-
- 1. The restore_noirq phase is analogous to the resume_noirq phase.
-
-- 2. The restore phase is analogous to the resume phase.
-+ 2. The restore_early phase is analogous to the resume_early phase.
-+
-+ 3. The restore phase is analogous to the resume phase.
-
-- 3. The complete phase is discussed above.
-+ 4. The complete phase is discussed above.
-
--The main difference from resume[_noirq] is that restore[_noirq] must assume the
--device has been accessed and reconfigured by the boot loader or the boot kernel.
--Consequently the state of the device may be different from the state remembered
--from the freeze and freeze_noirq phases. The device may even need to be reset
--and completely re-initialized. In many cases this difference doesn't matter, so
--the resume[_noirq] and restore[_norq] method pointers can be set to the same
--routines. Nevertheless, different callback pointers are used in case there is a
--situation where it actually matters.
-+The main difference from resume[_early|_noirq] is that restore[_early|_noirq]
-+must assume the device has been accessed and reconfigured by the boot loader or
-+the boot kernel. Consequently the state of the device may be different from the
-+state remembered from the freeze, freeze_late and freeze_noirq phases. The
-+device may even need to be reset and completely re-initialized. In many cases
-+this difference doesn't matter, so the resume[_early|_noirq] and
-+restore[_early|_norq] method pointers can be set to the same routines.
-+Nevertheless, different callback pointers are used in case there is a situation
-+where it actually does matter.
-
-
- Device Power Management Domains
-diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
-index 965a766..99f4ffe 100644
---- a/arch/x86/kernel/apm_32.c
-+++ b/arch/x86/kernel/apm_32.c
-@@ -1236,8 +1236,7 @@ static int suspend(int vetoable)
- struct apm_user *as;
-
- dpm_suspend_start(PMSG_SUSPEND);
--
-- dpm_suspend_noirq(PMSG_SUSPEND);
-+ dpm_suspend_end(PMSG_SUSPEND);
-
- local_irq_disable();
- syscore_suspend();
-@@ -1261,9 +1260,9 @@ static int suspend(int vetoable)
- syscore_resume();
- local_irq_enable();
-
-- dpm_resume_noirq(PMSG_RESUME);
--
-+ dpm_resume_start(PMSG_RESUME);
- dpm_resume_end(PMSG_RESUME);
-+
- queue_event(APM_NORMAL_RESUME, NULL);
- spin_lock(&user_list_lock);
- for (as = user_list; as != NULL; as = as->next) {
-@@ -1279,7 +1278,7 @@ static void standby(void)
- {
- int err;
-
-- dpm_suspend_noirq(PMSG_SUSPEND);
-+ dpm_suspend_end(PMSG_SUSPEND);
-
- local_irq_disable();
- syscore_suspend();
-@@ -1293,7 +1292,7 @@ static void standby(void)
- syscore_resume();
- local_irq_enable();
-
-- dpm_resume_noirq(PMSG_RESUME);
-+ dpm_resume_start(PMSG_RESUME);
- }
-
- static apm_event_t get_event(void)
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index e2cc3d2..b462c0e 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -47,6 +47,7 @@ typedef int (*pm_callback_t)(struct device *);
- LIST_HEAD(dpm_list);
- LIST_HEAD(dpm_prepared_list);
- LIST_HEAD(dpm_suspended_list);
-+LIST_HEAD(dpm_late_early_list);
- LIST_HEAD(dpm_noirq_list);
-
- struct suspend_stats suspend_stats;
-@@ -246,6 +247,40 @@ static pm_callback_t pm_op(const struct dev_pm_ops *ops, pm_message_t state)
- }
-
- /**
-+ * pm_late_early_op - Return the PM operation appropriate for given PM event.
-+ * @ops: PM operations to choose from.
-+ * @state: PM transition of the system being carried out.
-+ *
-+ * Runtime PM is disabled for @dev while this function is being executed.
-+ */
-+static pm_callback_t pm_late_early_op(const struct dev_pm_ops *ops,
-+ pm_message_t state)
-+{
-+ switch (state.event) {
-+#ifdef CONFIG_SUSPEND
-+ case PM_EVENT_SUSPEND:
-+ return ops->suspend_late;
-+ case PM_EVENT_RESUME:
-+ return ops->resume_early;
-+#endif /* CONFIG_SUSPEND */
-+#ifdef CONFIG_HIBERNATE_CALLBACKS
-+ case PM_EVENT_FREEZE:
-+ case PM_EVENT_QUIESCE:
-+ return ops->freeze_late;
-+ case PM_EVENT_HIBERNATE:
-+ return ops->poweroff_late;
-+ case PM_EVENT_THAW:
-+ case PM_EVENT_RECOVER:
-+ return ops->thaw_early;
-+ case PM_EVENT_RESTORE:
-+ return ops->restore_early;
-+#endif /* CONFIG_HIBERNATE_CALLBACKS */
-+ }
-+
-+ return NULL;
-+}
-+
-+/**
- * pm_noirq_op - Return the PM operation appropriate for given PM event.
- * @ops: PM operations to choose from.
- * @state: PM transition of the system being carried out.
-@@ -374,21 +409,21 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
- TRACE_RESUME(0);
-
- if (dev->pm_domain) {
-- info = "EARLY power domain ";
-+ info = "noirq power domain ";
- callback = pm_noirq_op(&dev->pm_domain->ops, state);
- } else if (dev->type && dev->type->pm) {
-- info = "EARLY type ";
-+ info = "noirq type ";
- callback = pm_noirq_op(dev->type->pm, state);
- } else if (dev->class && dev->class->pm) {
-- info = "EARLY class ";
-+ info = "noirq class ";
- callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- info = "EARLY bus ";
-+ info = "noirq bus ";
- callback = pm_noirq_op(dev->bus->pm, state);
- }
-
- if (!callback && dev->driver && dev->driver->pm) {
-- info = "EARLY driver ";
-+ info = "noirq driver ";
- callback = pm_noirq_op(dev->driver->pm, state);
- }
-
-@@ -399,13 +434,13 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
- }
-
- /**
-- * dpm_resume_noirq - Execute "early resume" callbacks for non-sysdev devices.
-+ * dpm_resume_noirq - Execute "noirq resume" callbacks for all devices.
- * @state: PM transition of the system being carried out.
- *
-- * Call the "noirq" resume handlers for all devices marked as DPM_OFF_IRQ and
-+ * Call the "noirq" resume handlers for all devices in dpm_noirq_list and
- * enable device drivers to receive interrupts.
- */
--void dpm_resume_noirq(pm_message_t state)
-+static void dpm_resume_noirq(pm_message_t state)
- {
- ktime_t starttime = ktime_get();
-
-@@ -415,7 +450,7 @@ void dpm_resume_noirq(pm_message_t state)
- int error;
-
- get_device(dev);
-- list_move_tail(&dev->power.entry, &dpm_suspended_list);
-+ list_move_tail(&dev->power.entry, &dpm_late_early_list);
- mutex_unlock(&dpm_list_mtx);
-
- error = device_resume_noirq(dev, state);
-@@ -423,6 +458,80 @@ void dpm_resume_noirq(pm_message_t state)
- suspend_stats.failed_resume_noirq++;
- dpm_save_failed_step(SUSPEND_RESUME_NOIRQ);
- dpm_save_failed_dev(dev_name(dev));
-+ pm_dev_err(dev, state, " noirq", error);
-+ }
-+
-+ mutex_lock(&dpm_list_mtx);
-+ put_device(dev);
-+ }
-+ mutex_unlock(&dpm_list_mtx);
-+ dpm_show_time(starttime, state, "noirq");
-+ resume_device_irqs();
-+}
-+
-+/**
-+ * device_resume_early - Execute an "early resume" callback for given device.
-+ * @dev: Device to handle.
-+ * @state: PM transition of the system being carried out.
-+ *
-+ * Runtime PM is disabled for @dev while this function is being executed.
-+ */
-+static int device_resume_early(struct device *dev, pm_message_t state)
-+{
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
-+ int error = 0;
-+
-+ TRACE_DEVICE(dev);
-+ TRACE_RESUME(0);
-+
-+ if (dev->pm_domain) {
-+ info = "early power domain ";
-+ callback = pm_late_early_op(&dev->pm_domain->ops, state);
-+ } else if (dev->type && dev->type->pm) {
-+ info = "early type ";
-+ callback = pm_late_early_op(dev->type->pm, state);
-+ } else if (dev->class && dev->class->pm) {
-+ info = "early class ";
-+ callback = pm_late_early_op(dev->class->pm, state);
-+ } else if (dev->bus && dev->bus->pm) {
-+ info = "early bus ";
-+ callback = pm_late_early_op(dev->bus->pm, state);
-+ }
-+
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "early driver ";
-+ callback = pm_late_early_op(dev->driver->pm, state);
-+ }
-+
-+ error = dpm_run_callback(callback, dev, state, info);
-+
-+ TRACE_RESUME(error);
-+ return error;
-+}
-+
-+/**
-+ * dpm_resume_early - Execute "early resume" callbacks for all devices.
-+ * @state: PM transition of the system being carried out.
-+ */
-+static void dpm_resume_early(pm_message_t state)
-+{
-+ ktime_t starttime = ktime_get();
-+
-+ mutex_lock(&dpm_list_mtx);
-+ while (!list_empty(&dpm_late_early_list)) {
-+ struct device *dev = to_device(dpm_late_early_list.next);
-+ int error;
-+
-+ get_device(dev);
-+ list_move_tail(&dev->power.entry, &dpm_suspended_list);
-+ mutex_unlock(&dpm_list_mtx);
-+
-+ error = device_resume_early(dev, state);
-+ if (error) {
-+ suspend_stats.failed_resume_early++;
-+ dpm_save_failed_step(SUSPEND_RESUME_EARLY);
-+ dpm_save_failed_dev(dev_name(dev));
- pm_dev_err(dev, state, " early", error);
- }
-
-@@ -431,9 +540,18 @@ void dpm_resume_noirq(pm_message_t state)
- }
- mutex_unlock(&dpm_list_mtx);
- dpm_show_time(starttime, state, "early");
-- resume_device_irqs();
- }
--EXPORT_SYMBOL_GPL(dpm_resume_noirq);
-+
-+/**
-+ * dpm_resume_start - Execute "noirq" and "early" device callbacks.
-+ * @state: PM transition of the system being carried out.
-+ */
-+void dpm_resume_start(pm_message_t state)
-+{
-+ dpm_resume_noirq(state);
-+ dpm_resume_early(state);
-+}
-+EXPORT_SYMBOL_GPL(dpm_resume_start);
-
- /**
- * device_resume - Execute "resume" callbacks for given device.
-@@ -716,21 +834,21 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
- char *info = NULL;
-
- if (dev->pm_domain) {
-- info = "LATE power domain ";
-+ info = "noirq power domain ";
- callback = pm_noirq_op(&dev->pm_domain->ops, state);
- } else if (dev->type && dev->type->pm) {
-- info = "LATE type ";
-+ info = "noirq type ";
- callback = pm_noirq_op(dev->type->pm, state);
- } else if (dev->class && dev->class->pm) {
-- info = "LATE class ";
-+ info = "noirq class ";
- callback = pm_noirq_op(dev->class->pm, state);
- } else if (dev->bus && dev->bus->pm) {
-- info = "LATE bus ";
-+ info = "noirq bus ";
- callback = pm_noirq_op(dev->bus->pm, state);
- }
-
- if (!callback && dev->driver && dev->driver->pm) {
-- info = "LATE driver ";
-+ info = "noirq driver ";
- callback = pm_noirq_op(dev->driver->pm, state);
- }
-
-@@ -738,21 +856,21 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
- }
-
- /**
-- * dpm_suspend_noirq - Execute "late suspend" callbacks for non-sysdev devices.
-+ * dpm_suspend_noirq - Execute "noirq suspend" callbacks for all devices.
- * @state: PM transition of the system being carried out.
- *
- * Prevent device drivers from receiving interrupts and call the "noirq" suspend
- * handlers for all non-sysdev devices.
- */
--int dpm_suspend_noirq(pm_message_t state)
-+static int dpm_suspend_noirq(pm_message_t state)
- {
- ktime_t starttime = ktime_get();
- int error = 0;
-
- suspend_device_irqs();
- mutex_lock(&dpm_list_mtx);
-- while (!list_empty(&dpm_suspended_list)) {
-- struct device *dev = to_device(dpm_suspended_list.prev);
-+ while (!list_empty(&dpm_late_early_list)) {
-+ struct device *dev = to_device(dpm_late_early_list.prev);
-
- get_device(dev);
- mutex_unlock(&dpm_list_mtx);
-@@ -761,7 +879,7 @@ int dpm_suspend_noirq(pm_message_t state)
-
- mutex_lock(&dpm_list_mtx);
- if (error) {
-- pm_dev_err(dev, state, " late", error);
-+ pm_dev_err(dev, state, " noirq", error);
- suspend_stats.failed_suspend_noirq++;
- dpm_save_failed_step(SUSPEND_SUSPEND_NOIRQ);
- dpm_save_failed_dev(dev_name(dev));
-@@ -776,10 +894,95 @@ int dpm_suspend_noirq(pm_message_t state)
- if (error)
- dpm_resume_noirq(resume_event(state));
- else
-+ dpm_show_time(starttime, state, "noirq");
-+ return error;
-+}
-+
-+/**
-+ * device_suspend_late - Execute a "late suspend" callback for given device.
-+ * @dev: Device to handle.
-+ * @state: PM transition of the system being carried out.
-+ *
-+ * Runtime PM is disabled for @dev while this function is being executed.
-+ */
-+static int device_suspend_late(struct device *dev, pm_message_t state)
-+{
-+ pm_callback_t callback = NULL;
-+ char *info = NULL;
-+
-+ if (dev->pm_domain) {
-+ info = "late power domain ";
-+ callback = pm_late_early_op(&dev->pm_domain->ops, state);
-+ } else if (dev->type && dev->type->pm) {
-+ info = "late type ";
-+ callback = pm_late_early_op(dev->type->pm, state);
-+ } else if (dev->class && dev->class->pm) {
-+ info = "late class ";
-+ callback = pm_late_early_op(dev->class->pm, state);
-+ } else if (dev->bus && dev->bus->pm) {
-+ info = "late bus ";
-+ callback = pm_late_early_op(dev->bus->pm, state);
-+ }
-+
-+ if (!callback && dev->driver && dev->driver->pm) {
-+ info = "late driver ";
-+ callback = pm_late_early_op(dev->driver->pm, state);
-+ }
-+
-+ return dpm_run_callback(callback, dev, state, info);
-+}
-+
-+/**
-+ * dpm_suspend_late - Execute "late suspend" callbacks for all devices.
-+ * @state: PM transition of the system being carried out.
-+ */
-+static int dpm_suspend_late(pm_message_t state)
-+{
-+ ktime_t starttime = ktime_get();
-+ int error = 0;
-+
-+ mutex_lock(&dpm_list_mtx);
-+ while (!list_empty(&dpm_suspended_list)) {
-+ struct device *dev = to_device(dpm_suspended_list.prev);
-+
-+ get_device(dev);
-+ mutex_unlock(&dpm_list_mtx);
-+
-+ error = device_suspend_late(dev, state);
-+
-+ mutex_lock(&dpm_list_mtx);
-+ if (error) {
-+ pm_dev_err(dev, state, " late", error);
-+ suspend_stats.failed_suspend_late++;
-+ dpm_save_failed_step(SUSPEND_SUSPEND_LATE);
-+ dpm_save_failed_dev(dev_name(dev));
-+ put_device(dev);
-+ break;
-+ }
-+ if (!list_empty(&dev->power.entry))
-+ list_move(&dev->power.entry, &dpm_late_early_list);
-+ put_device(dev);
-+ }
-+ mutex_unlock(&dpm_list_mtx);
-+ if (error)
-+ dpm_resume_early(resume_event(state));
-+ else
- dpm_show_time(starttime, state, "late");
-+
- return error;
- }
--EXPORT_SYMBOL_GPL(dpm_suspend_noirq);
-+
-+/**
-+ * dpm_suspend_end - Execute "late" and "noirq" device suspend callbacks.
-+ * @state: PM transition of the system being carried out.
-+ */
-+int dpm_suspend_end(pm_message_t state)
-+{
-+ int error = dpm_suspend_late(state);
-+
-+ return error ? : dpm_suspend_noirq(state);
-+}
-+EXPORT_SYMBOL_GPL(dpm_suspend_end);
-
- /**
- * legacy_suspend - Execute a legacy (bus or class) suspend callback for device.
-diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
-index 0b5366b..3fce572 100644
---- a/drivers/xen/manage.c
-+++ b/drivers/xen/manage.c
-@@ -128,9 +128,9 @@ static void do_suspend(void)
- printk(KERN_DEBUG "suspending xenstore...\n");
- xs_suspend();
-
-- err = dpm_suspend_noirq(PMSG_FREEZE);
-+ err = dpm_suspend_end(PMSG_FREEZE);
- if (err) {
-- printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err);
-+ printk(KERN_ERR "dpm_suspend_end failed: %d\n", err);
- goto out_resume;
- }
-
-@@ -148,7 +148,7 @@ static void do_suspend(void)
-
- err = stop_machine(xen_suspend, &si, cpumask_of(0));
-
-- dpm_resume_noirq(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
-+ dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
-
- if (err) {
- printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index e4982ac..c68e1f2 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -110,6 +110,10 @@ typedef struct pm_message {
- * Subsystem-level @suspend() is executed for all devices after invoking
- * subsystem-level @prepare() for all of them.
- *
-+ * @suspend_late: Continue operations started by @suspend(). For a number of
-+ * devices @suspend_late() may point to the same callback routine as the
-+ * runtime suspend callback.
-+ *
- * @resume: Executed after waking the system up from a sleep state in which the
- * contents of main memory were preserved. The exact action to perform
- * depends on the device's subsystem, but generally the driver is expected
-@@ -122,6 +126,10 @@ typedef struct pm_message {
- * Subsystem-level @resume() is executed for all devices after invoking
- * subsystem-level @resume_noirq() for all of them.
- *
-+ * @resume_early: Prepare to execute @resume(). For a number of devices
-+ * @resume_early() may point to the same callback routine as the runtime
-+ * resume callback.
-+ *
- * @freeze: Hibernation-specific, executed before creating a hibernation image.
- * Analogous to @suspend(), but it should not enable the device to signal
- * wakeup events or change its power state. The majority of subsystems
-@@ -131,6 +139,10 @@ typedef struct pm_message {
- * Subsystem-level @freeze() is executed for all devices after invoking
- * subsystem-level @prepare() for all of them.
- *
-+ * @freeze_late: Continue operations started by @freeze(). Analogous to
-+ * @suspend_late(), but it should not enable the device to signal wakeup
-+ * events or change its power state.
-+ *
- * @thaw: Hibernation-specific, executed after creating a hibernation image OR
- * if the creation of an image has failed. Also executed after a failing
- * attempt to restore the contents of main memory from such an image.
-@@ -140,15 +152,23 @@ typedef struct pm_message {
- * subsystem-level @thaw_noirq() for all of them. It also may be executed
- * directly after @freeze() in case of a transition error.
- *
-+ * @thaw_early: Prepare to execute @thaw(). Undo the changes made by the
-+ * preceding @freeze_late().
-+ *
- * @poweroff: Hibernation-specific, executed after saving a hibernation image.
- * Analogous to @suspend(), but it need not save the device's settings in
- * memory.
- * Subsystem-level @poweroff() is executed for all devices after invoking
- * subsystem-level @prepare() for all of them.
- *
-+ * @poweroff_late: Continue operations started by @poweroff(). Analogous to
-+ * @suspend_late(), but it need not save the device's settings in memory.
-+ *
- * @restore: Hibernation-specific, executed after restoring the contents of main
- * memory from a hibernation image, analogous to @resume().
- *
-+ * @restore_early: Prepare to execute @restore(), analogous to @resume_early().
-+ *
- * @suspend_noirq: Complete the actions started by @suspend(). Carry out any
- * additional operations required for suspending the device that might be
- * racing with its driver's interrupt handler, which is guaranteed not to
-@@ -158,9 +178,10 @@ typedef struct pm_message {
- * @suspend_noirq() has returned successfully. If the device can generate
- * system wakeup signals and is enabled to wake up the system, it should be
- * configured to do so at that time. However, depending on the platform
-- * and device's subsystem, @suspend() may be allowed to put the device into
-- * the low-power state and configure it to generate wakeup signals, in
-- * which case it generally is not necessary to define @suspend_noirq().
-+ * and device's subsystem, @suspend() or @suspend_late() may be allowed to
-+ * put the device into the low-power state and configure it to generate
-+ * wakeup signals, in which case it generally is not necessary to define
-+ * @suspend_noirq().
- *
- * @resume_noirq: Prepare for the execution of @resume() by carrying out any
- * operations required for resuming the device that might be racing with
-@@ -171,9 +192,9 @@ typedef struct pm_message {
- * additional operations required for freezing the device that might be
- * racing with its driver's interrupt handler, which is guaranteed not to
- * run while @freeze_noirq() is being executed.
-- * The power state of the device should not be changed by either @freeze()
-- * or @freeze_noirq() and it should not be configured to signal system
-- * wakeup by any of these callbacks.
-+ * The power state of the device should not be changed by either @freeze(),
-+ * or @freeze_late(), or @freeze_noirq() and it should not be configured to
-+ * signal system wakeup by any of these callbacks.
- *
- * @thaw_noirq: Prepare for the execution of @thaw() by carrying out any
- * operations required for thawing the device that might be racing with its
-@@ -249,6 +270,12 @@ struct dev_pm_ops {
- int (*thaw)(struct device *dev);
- int (*poweroff)(struct device *dev);
- int (*restore)(struct device *dev);
-+ int (*suspend_late)(struct device *dev);
-+ int (*resume_early)(struct device *dev);
-+ int (*freeze_late)(struct device *dev);
-+ int (*thaw_early)(struct device *dev);
-+ int (*poweroff_late)(struct device *dev);
-+ int (*restore_early)(struct device *dev);
- int (*suspend_noirq)(struct device *dev);
- int (*resume_noirq)(struct device *dev);
- int (*freeze_noirq)(struct device *dev);
-@@ -584,13 +611,13 @@ struct dev_pm_domain {
-
- #ifdef CONFIG_PM_SLEEP
- extern void device_pm_lock(void);
--extern void dpm_resume_noirq(pm_message_t state);
-+extern void dpm_resume_start(pm_message_t state);
- extern void dpm_resume_end(pm_message_t state);
- extern void dpm_resume(pm_message_t state);
- extern void dpm_complete(pm_message_t state);
-
- extern void device_pm_unlock(void);
--extern int dpm_suspend_noirq(pm_message_t state);
-+extern int dpm_suspend_end(pm_message_t state);
- extern int dpm_suspend_start(pm_message_t state);
- extern int dpm_suspend(pm_message_t state);
- extern int dpm_prepare(pm_message_t state);
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index c08069d..43f0421 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -41,8 +41,10 @@ enum suspend_stat_step {
- SUSPEND_FREEZE = 1,
- SUSPEND_PREPARE,
- SUSPEND_SUSPEND,
-+ SUSPEND_SUSPEND_LATE,
- SUSPEND_SUSPEND_NOIRQ,
- SUSPEND_RESUME_NOIRQ,
-+ SUSPEND_RESUME_EARLY,
- SUSPEND_RESUME
- };
-
-@@ -52,8 +54,10 @@ struct suspend_stats {
- int failed_freeze;
- int failed_prepare;
- int failed_suspend;
-+ int failed_suspend_late;
- int failed_suspend_noirq;
- int failed_resume;
-+ int failed_resume_early;
- int failed_resume_noirq;
- #define REC_FAILED_NUM 2
- int last_failed_dev;
-diff --git a/kernel/kexec.c b/kernel/kexec.c
-index 581b553..4f86631 100644
---- a/kernel/kexec.c
-+++ b/kernel/kexec.c
-@@ -1518,13 +1518,13 @@ int kernel_kexec(void)
- if (error)
- goto Resume_console;
- /* At this point, dpm_suspend_start() has been called,
-- * but *not* dpm_suspend_noirq(). We *must* call
-- * dpm_suspend_noirq() now. Otherwise, drivers for
-+ * but *not* dpm_suspend_end(). We *must* call
-+ * dpm_suspend_end() now. Otherwise, drivers for
- * some devices (e.g. interrupt controllers) become
- * desynchronized with the actual state of the
- * hardware at resume time, and evil weirdness ensues.
- */
-- error = dpm_suspend_noirq(PMSG_FREEZE);
-+ error = dpm_suspend_end(PMSG_FREEZE);
- if (error)
- goto Resume_devices;
- error = disable_nonboot_cpus();
-@@ -1551,7 +1551,7 @@ int kernel_kexec(void)
- local_irq_enable();
- Enable_cpus:
- enable_nonboot_cpus();
-- dpm_resume_noirq(PMSG_RESTORE);
-+ dpm_resume_start(PMSG_RESTORE);
- Resume_devices:
- dpm_resume_end(PMSG_RESTORE);
- Resume_console:
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 7bef755..f3b03d4 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -245,8 +245,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop,
- * create_image - Create a hibernation image.
- * @platform_mode: Whether or not to use the platform driver.
- *
-- * Execute device drivers' .freeze_noirq() callbacks, create a hibernation image
-- * and execute the drivers' .thaw_noirq() callbacks.
-+ * Execute device drivers' "late" and "noirq" freeze callbacks, create a
-+ * hibernation image and run the drivers' "noirq" and "early" thaw callbacks.
- *
- * Control reappears in this routine after the subsequent restore.
- */
-@@ -254,7 +254,7 @@ static int create_image(int platform_mode)
- {
- int error;
-
-- error = dpm_suspend_noirq(PMSG_FREEZE);
-+ error = dpm_suspend_end(PMSG_FREEZE);
- if (error) {
- printk(KERN_ERR "PM: Some devices failed to power down, "
- "aborting hibernation\n");
-@@ -306,7 +306,7 @@ static int create_image(int platform_mode)
- Platform_finish:
- platform_finish(platform_mode);
-
-- dpm_resume_noirq(in_suspend ?
-+ dpm_resume_start(in_suspend ?
- (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
-
- return error;
-@@ -394,16 +394,16 @@ int hibernation_snapshot(int platform_mode)
- * resume_target_kernel - Restore system state from a hibernation image.
- * @platform_mode: Whether or not to use the platform driver.
- *
-- * Execute device drivers' .freeze_noirq() callbacks, restore the contents of
-- * highmem that have not been restored yet from the image and run the low-level
-- * code that will restore the remaining contents of memory and switch to the
-- * just restored target kernel.
-+ * Execute device drivers' "noirq" and "late" freeze callbacks, restore the
-+ * contents of highmem that have not been restored yet from the image and run
-+ * the low-level code that will restore the remaining contents of memory and
-+ * switch to the just restored target kernel.
- */
- static int resume_target_kernel(bool platform_mode)
- {
- int error;
-
-- error = dpm_suspend_noirq(PMSG_QUIESCE);
-+ error = dpm_suspend_end(PMSG_QUIESCE);
- if (error) {
- printk(KERN_ERR "PM: Some devices failed to power down, "
- "aborting resume\n");
-@@ -460,7 +460,7 @@ static int resume_target_kernel(bool platform_mode)
- Cleanup:
- platform_restore_cleanup(platform_mode);
-
-- dpm_resume_noirq(PMSG_RECOVER);
-+ dpm_resume_start(PMSG_RECOVER);
-
- return error;
- }
-@@ -518,7 +518,7 @@ int hibernation_platform_enter(void)
- goto Resume_devices;
- }
-
-- error = dpm_suspend_noirq(PMSG_HIBERNATE);
-+ error = dpm_suspend_end(PMSG_HIBERNATE);
- if (error)
- goto Resume_devices;
-
-@@ -549,7 +549,7 @@ int hibernation_platform_enter(void)
- Platform_finish:
- hibernation_ops->finish();
-
-- dpm_resume_noirq(PMSG_RESTORE);
-+ dpm_resume_start(PMSG_RESTORE);
-
- Resume_devices:
- entering_platform_hibernation = false;
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 9824b41e..8c5014a 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -165,16 +165,20 @@ static int suspend_stats_show(struct seq_file *s, void *unused)
- last_errno %= REC_FAILED_NUM;
- last_step = suspend_stats.last_failed_step + REC_FAILED_NUM - 1;
- last_step %= REC_FAILED_NUM;
-- seq_printf(s, "%s: %d\n%s: %d\n%s: %d\n%s: %d\n"
-- "%s: %d\n%s: %d\n%s: %d\n%s: %d\n",
-+ seq_printf(s, "%s: %d\n%s: %d\n%s: %d\n%s: %d\n%s: %d\n"
-+ "%s: %d\n%s: %d\n%s: %d\n%s: %d\n%s: %d\n",
- "success", suspend_stats.success,
- "fail", suspend_stats.fail,
- "failed_freeze", suspend_stats.failed_freeze,
- "failed_prepare", suspend_stats.failed_prepare,
- "failed_suspend", suspend_stats.failed_suspend,
-+ "failed_suspend_late",
-+ suspend_stats.failed_suspend_late,
- "failed_suspend_noirq",
- suspend_stats.failed_suspend_noirq,
- "failed_resume", suspend_stats.failed_resume,
-+ "failed_resume_early",
-+ suspend_stats.failed_resume_early,
- "failed_resume_noirq",
- suspend_stats.failed_resume_noirq);
- seq_printf(s, "failures:\n last_failed_dev:\t%-s\n",
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 4fd51be..560a639 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -147,7 +147,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
- goto Platform_finish;
- }
-
-- error = dpm_suspend_noirq(PMSG_SUSPEND);
-+ error = dpm_suspend_end(PMSG_SUSPEND);
- if (error) {
- printk(KERN_ERR "PM: Some devices failed to power down\n");
- goto Platform_finish;
-@@ -189,7 +189,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
- if (suspend_ops->wake)
- suspend_ops->wake();
-
-- dpm_resume_noirq(PMSG_RESUME);
-+ dpm_resume_start(PMSG_RESUME);
-
- Platform_finish:
- if (suspend_ops->finish)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0176-PM-Sleep-Introduce-generic-callbacks-for-new-device-.patch b/patches.runtime_pm/0176-PM-Sleep-Introduce-generic-callbacks-for-new-device-.patch
deleted file mode 100644
index 0d967a20d5f245..00000000000000
--- a/patches.runtime_pm/0176-PM-Sleep-Introduce-generic-callbacks-for-new-device-.patch
+++ /dev/null
@@ -1,316 +0,0 @@
-From 6b9458e73d77e875f3800ae15ef0500fde2e09e2 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 29 Jan 2012 20:38:41 +0100
-Subject: PM / Sleep: Introduce generic callbacks for new device PM phases
-
-Introduce generic subsystem callbacks for the new phases of device
-suspend/resume during system power transitions: "late suspend",
-"early resume", "late freeze", "early thaw", "late poweroff",
-"early restore".
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit e470d06655e00749f6f9372e4fa4f20cea7ed7c5)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/generic_ops.c | 157 +++++++++++++++++++++++++-------------
- include/linux/pm.h | 6 ++
- 2 files changed, 110 insertions(+), 53 deletions(-)
-
-diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
-index 10bdd79..d03d290 100644
---- a/drivers/base/power/generic_ops.c
-+++ b/drivers/base/power/generic_ops.c
-@@ -92,59 +92,28 @@ int pm_generic_prepare(struct device *dev)
- }
-
- /**
-- * __pm_generic_call - Generic suspend/freeze/poweroff/thaw subsystem callback.
-- * @dev: Device to handle.
-- * @event: PM transition of the system under way.
-- * @bool: Whether or not this is the "noirq" stage.
-- *
-- * Execute the PM callback corresponding to @event provided by the driver of
-- * @dev, if defined, and return its error code. Return 0 if the callback is
-- * not present.
-+ * pm_generic_suspend_noirq - Generic suspend_noirq callback for subsystems.
-+ * @dev: Device to suspend.
- */
--static int __pm_generic_call(struct device *dev, int event, bool noirq)
-+int pm_generic_suspend_noirq(struct device *dev)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-- int (*callback)(struct device *);
--
-- if (!pm)
-- return 0;
--
-- switch (event) {
-- case PM_EVENT_SUSPEND:
-- callback = noirq ? pm->suspend_noirq : pm->suspend;
-- break;
-- case PM_EVENT_FREEZE:
-- callback = noirq ? pm->freeze_noirq : pm->freeze;
-- break;
-- case PM_EVENT_HIBERNATE:
-- callback = noirq ? pm->poweroff_noirq : pm->poweroff;
-- break;
-- case PM_EVENT_RESUME:
-- callback = noirq ? pm->resume_noirq : pm->resume;
-- break;
-- case PM_EVENT_THAW:
-- callback = noirq ? pm->thaw_noirq : pm->thaw;
-- break;
-- case PM_EVENT_RESTORE:
-- callback = noirq ? pm->restore_noirq : pm->restore;
-- break;
-- default:
-- callback = NULL;
-- break;
-- }
-
-- return callback ? callback(dev) : 0;
-+ return pm && pm->suspend_noirq ? pm->suspend_noirq(dev) : 0;
- }
-+EXPORT_SYMBOL_GPL(pm_generic_suspend_noirq);
-
- /**
-- * pm_generic_suspend_noirq - Generic suspend_noirq callback for subsystems.
-+ * pm_generic_suspend_late - Generic suspend_late callback for subsystems.
- * @dev: Device to suspend.
- */
--int pm_generic_suspend_noirq(struct device *dev)
-+int pm_generic_suspend_late(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_SUSPEND, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->suspend_late ? pm->suspend_late(dev) : 0;
- }
--EXPORT_SYMBOL_GPL(pm_generic_suspend_noirq);
-+EXPORT_SYMBOL_GPL(pm_generic_suspend_late);
-
- /**
- * pm_generic_suspend - Generic suspend callback for subsystems.
-@@ -152,7 +121,9 @@ EXPORT_SYMBOL_GPL(pm_generic_suspend_noirq);
- */
- int pm_generic_suspend(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_SUSPEND, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->suspend ? pm->suspend(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_suspend);
-
-@@ -162,17 +133,33 @@ EXPORT_SYMBOL_GPL(pm_generic_suspend);
- */
- int pm_generic_freeze_noirq(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_FREEZE, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->freeze_noirq ? pm->freeze_noirq(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_freeze_noirq);
-
- /**
-+ * pm_generic_freeze_late - Generic freeze_late callback for subsystems.
-+ * @dev: Device to freeze.
-+ */
-+int pm_generic_freeze_late(struct device *dev)
-+{
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->freeze_late ? pm->freeze_late(dev) : 0;
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_freeze_late);
-+
-+/**
- * pm_generic_freeze - Generic freeze callback for subsystems.
- * @dev: Device to freeze.
- */
- int pm_generic_freeze(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_FREEZE, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->freeze ? pm->freeze(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_freeze);
-
-@@ -182,17 +169,33 @@ EXPORT_SYMBOL_GPL(pm_generic_freeze);
- */
- int pm_generic_poweroff_noirq(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_HIBERNATE, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->poweroff_noirq ? pm->poweroff_noirq(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_poweroff_noirq);
-
- /**
-+ * pm_generic_poweroff_late - Generic poweroff_late callback for subsystems.
-+ * @dev: Device to handle.
-+ */
-+int pm_generic_poweroff_late(struct device *dev)
-+{
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->poweroff_late ? pm->poweroff_late(dev) : 0;
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_poweroff_late);
-+
-+/**
- * pm_generic_poweroff - Generic poweroff callback for subsystems.
- * @dev: Device to handle.
- */
- int pm_generic_poweroff(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_HIBERNATE, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->poweroff ? pm->poweroff(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_poweroff);
-
-@@ -202,17 +205,33 @@ EXPORT_SYMBOL_GPL(pm_generic_poweroff);
- */
- int pm_generic_thaw_noirq(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_THAW, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->thaw_noirq ? pm->thaw_noirq(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_thaw_noirq);
-
- /**
-+ * pm_generic_thaw_early - Generic thaw_early callback for subsystems.
-+ * @dev: Device to thaw.
-+ */
-+int pm_generic_thaw_early(struct device *dev)
-+{
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->thaw_early ? pm->thaw_early(dev) : 0;
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_thaw_early);
-+
-+/**
- * pm_generic_thaw - Generic thaw callback for subsystems.
- * @dev: Device to thaw.
- */
- int pm_generic_thaw(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_THAW, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->thaw ? pm->thaw(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_thaw);
-
-@@ -222,17 +241,33 @@ EXPORT_SYMBOL_GPL(pm_generic_thaw);
- */
- int pm_generic_resume_noirq(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_RESUME, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->resume_noirq ? pm->resume_noirq(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_resume_noirq);
-
- /**
-+ * pm_generic_resume_early - Generic resume_early callback for subsystems.
-+ * @dev: Device to resume.
-+ */
-+int pm_generic_resume_early(struct device *dev)
-+{
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->resume_early ? pm->resume_early(dev) : 0;
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_resume_early);
-+
-+/**
- * pm_generic_resume - Generic resume callback for subsystems.
- * @dev: Device to resume.
- */
- int pm_generic_resume(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_RESUME, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->resume ? pm->resume(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_resume);
-
-@@ -242,17 +277,33 @@ EXPORT_SYMBOL_GPL(pm_generic_resume);
- */
- int pm_generic_restore_noirq(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_RESTORE, true);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->restore_noirq ? pm->restore_noirq(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_restore_noirq);
-
- /**
-+ * pm_generic_restore_early - Generic restore_early callback for subsystems.
-+ * @dev: Device to resume.
-+ */
-+int pm_generic_restore_early(struct device *dev)
-+{
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->restore_early ? pm->restore_early(dev) : 0;
-+}
-+EXPORT_SYMBOL_GPL(pm_generic_restore_early);
-+
-+/**
- * pm_generic_restore - Generic restore callback for subsystems.
- * @dev: Device to restore.
- */
- int pm_generic_restore(struct device *dev)
- {
-- return __pm_generic_call(dev, PM_EVENT_RESTORE, false);
-+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
-+
-+ return pm && pm->restore ? pm->restore(dev) : 0;
- }
- EXPORT_SYMBOL_GPL(pm_generic_restore);
-
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index c68e1f2..73c6105 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -632,17 +632,23 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
- extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
-
- extern int pm_generic_prepare(struct device *dev);
-+extern int pm_generic_suspend_late(struct device *dev);
- extern int pm_generic_suspend_noirq(struct device *dev);
- extern int pm_generic_suspend(struct device *dev);
-+extern int pm_generic_resume_early(struct device *dev);
- extern int pm_generic_resume_noirq(struct device *dev);
- extern int pm_generic_resume(struct device *dev);
- extern int pm_generic_freeze_noirq(struct device *dev);
-+extern int pm_generic_freeze_late(struct device *dev);
- extern int pm_generic_freeze(struct device *dev);
- extern int pm_generic_thaw_noirq(struct device *dev);
-+extern int pm_generic_thaw_early(struct device *dev);
- extern int pm_generic_thaw(struct device *dev);
- extern int pm_generic_restore_noirq(struct device *dev);
-+extern int pm_generic_restore_early(struct device *dev);
- extern int pm_generic_restore(struct device *dev);
- extern int pm_generic_poweroff_noirq(struct device *dev);
-+extern int pm_generic_poweroff_late(struct device *dev);
- extern int pm_generic_poweroff(struct device *dev);
- extern void pm_generic_complete(struct device *dev);
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0177-PM-Domains-Run-late-early-device-suspend-callbacks-a.patch b/patches.runtime_pm/0177-PM-Domains-Run-late-early-device-suspend-callbacks-a.patch
deleted file mode 100644
index 4a8810884b8b2d..00000000000000
--- a/patches.runtime_pm/0177-PM-Domains-Run-late-early-device-suspend-callbacks-a.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-From a6fd82b4d0598a3e72e5803f44de38ddfe6a0151 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sun, 29 Jan 2012 20:39:02 +0100
-Subject: PM / Domains: Run late/early device suspend callbacks at the right
- time
-
-After the introduction of the late/early phases of device
-suspend/resume during system-wide power transitions it is possible
-to make the generic PM domains code execute its default late/early
-device suspend/resume callbacks during those phases instead of the
-corresponding _noirq phases. The _noirq device suspend/resume
-phases were only used for executing those callbacks, because this
-was the only way it could be done, but now we can do better.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 0496c8ae366724a0a2136cec09a2e277e782c126)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 157 ++++++++++++++++++++++++++++++-------------
- 1 file changed, 111 insertions(+), 46 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 939109b..d2c0323 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -820,17 +820,16 @@ static int pm_genpd_suspend(struct device *dev)
- }
-
- /**
-- * pm_genpd_suspend_noirq - Late suspend of a device from an I/O PM domain.
-+ * pm_genpd_suspend_late - Late suspend of a device from an I/O PM domain.
- * @dev: Device to suspend.
- *
- * Carry out a late suspend of a device under the assumption that its
- * pm_domain field points to the domain member of an object of type
- * struct generic_pm_domain representing a PM domain consisting of I/O devices.
- */
--static int pm_genpd_suspend_noirq(struct device *dev)
-+static int pm_genpd_suspend_late(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-- int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -838,14 +837,28 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off)
-- return 0;
-+ return genpd->suspend_power_off ? 0 : genpd_suspend_late(genpd, dev);
-+}
-
-- ret = genpd_suspend_late(genpd, dev);
-- if (ret)
-- return ret;
-+/**
-+ * pm_genpd_suspend_noirq - Completion of suspend of device in an I/O PM domain.
-+ * @dev: Device to suspend.
-+ *
-+ * Stop the device and remove power from the domain if all devices in it have
-+ * been stopped.
-+ */
-+static int pm_genpd_suspend_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-
-- if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
-+ if (genpd->suspend_power_off
-+ || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
- return 0;
-
- genpd_stop_dev(genpd, dev);
-@@ -862,13 +875,10 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- }
-
- /**
-- * pm_genpd_resume_noirq - Early resume of a device from an I/O power domain.
-+ * pm_genpd_resume_noirq - Start of resume of device in an I/O PM domain.
- * @dev: Device to resume.
- *
-- * Carry out an early resume of a device under the assumption that its
-- * pm_domain field points to the domain member of an object of type
-- * struct generic_pm_domain representing a power domain consisting of I/O
-- * devices.
-+ * Restore power to the device's PM domain, if necessary, and start the device.
- */
- static int pm_genpd_resume_noirq(struct device *dev)
- {
-@@ -890,13 +900,34 @@ static int pm_genpd_resume_noirq(struct device *dev)
- */
- pm_genpd_poweron(genpd);
- genpd->suspended_count--;
-- genpd_start_dev(genpd, dev);
-
-- return genpd_resume_early(genpd, dev);
-+ return genpd_start_dev(genpd, dev);
- }
-
- /**
-- * pm_genpd_resume - Resume a device belonging to an I/O power domain.
-+ * pm_genpd_resume_early - Early resume of a device in an I/O PM domain.
-+ * @dev: Device to resume.
-+ *
-+ * Carry out an early resume of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_resume_early(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : genpd_resume_early(genpd, dev);
-+}
-+
-+/**
-+ * pm_genpd_resume - Resume of device in an I/O PM domain.
- * @dev: Device to resume.
- *
- * Resume a device under the assumption that its pm_domain field points to the
-@@ -917,7 +948,7 @@ static int pm_genpd_resume(struct device *dev)
- }
-
- /**
-- * pm_genpd_freeze - Freeze a device belonging to an I/O power domain.
-+ * pm_genpd_freeze - Freezing a device in an I/O PM domain.
- * @dev: Device to freeze.
- *
- * Freeze a device under the assumption that its pm_domain field points to the
-@@ -938,7 +969,29 @@ static int pm_genpd_freeze(struct device *dev)
- }
-
- /**
-- * pm_genpd_freeze_noirq - Late freeze of a device from an I/O power domain.
-+ * pm_genpd_freeze_late - Late freeze of a device in an I/O PM domain.
-+ * @dev: Device to freeze.
-+ *
-+ * Carry out a late freeze of a device under the assumption that its
-+ * pm_domain field points to the domain member of an object of type
-+ * struct generic_pm_domain representing a power domain consisting of I/O
-+ * devices.
-+ */
-+static int pm_genpd_freeze_late(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-+
-+ dev_dbg(dev, "%s()\n", __func__);
-+
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : genpd_freeze_late(genpd, dev);
-+}
-+
-+/**
-+ * pm_genpd_freeze_noirq - Completion of freezing a device in an I/O PM domain.
- * @dev: Device to freeze.
- *
- * Carry out a late freeze of a device under the assumption that its
-@@ -949,7 +1002,6 @@ static int pm_genpd_freeze(struct device *dev)
- static int pm_genpd_freeze_noirq(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-- int ret;
-
- dev_dbg(dev, "%s()\n", __func__);
-
-@@ -957,20 +1009,31 @@ static int pm_genpd_freeze_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off)
-- return 0;
-+ return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev);
-+}
-
-- ret = genpd_freeze_late(genpd, dev);
-- if (ret)
-- return ret;
-+/**
-+ * pm_genpd_thaw_noirq - Early thaw of device in an I/O PM domain.
-+ * @dev: Device to thaw.
-+ *
-+ * Start the device, unless power has been removed from the domain already
-+ * before the system transition.
-+ */
-+static int pm_genpd_thaw_noirq(struct device *dev)
-+{
-+ struct generic_pm_domain *genpd;
-
-- genpd_stop_dev(genpd, dev);
-+ dev_dbg(dev, "%s()\n", __func__);
-
-- return 0;
-+ genpd = dev_to_genpd(dev);
-+ if (IS_ERR(genpd))
-+ return -EINVAL;
-+
-+ return genpd->suspend_power_off ? 0 : genpd_start_dev(genpd, dev);
- }
-
- /**
-- * pm_genpd_thaw_noirq - Early thaw of a device from an I/O power domain.
-+ * pm_genpd_thaw_early - Early thaw of device in an I/O PM domain.
- * @dev: Device to thaw.
- *
- * Carry out an early thaw of a device under the assumption that its
-@@ -978,7 +1041,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
- * struct generic_pm_domain representing a power domain consisting of I/O
- * devices.
- */
--static int pm_genpd_thaw_noirq(struct device *dev)
-+static int pm_genpd_thaw_early(struct device *dev)
- {
- struct generic_pm_domain *genpd;
-
-@@ -988,12 +1051,7 @@ static int pm_genpd_thaw_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off)
-- return 0;
--
-- genpd_start_dev(genpd, dev);
--
-- return genpd_thaw_early(genpd, dev);
-+ return genpd->suspend_power_off ? 0 : genpd_thaw_early(genpd, dev);
- }
-
- /**
-@@ -1018,13 +1076,11 @@ static int pm_genpd_thaw(struct device *dev)
- }
-
- /**
-- * pm_genpd_restore_noirq - Early restore of a device from an I/O power domain.
-+ * pm_genpd_restore_noirq - Start of restore of device in an I/O PM domain.
- * @dev: Device to resume.
- *
-- * Carry out an early restore of a device under the assumption that its
-- * pm_domain field points to the domain member of an object of type
-- * struct generic_pm_domain representing a power domain consisting of I/O
-- * devices.
-+ * Make sure the domain will be in the same power state as before the
-+ * hibernation the system is resuming from and start the device if necessary.
- */
- static int pm_genpd_restore_noirq(struct device *dev)
- {
-@@ -1054,9 +1110,8 @@ static int pm_genpd_restore_noirq(struct device *dev)
-
- pm_genpd_poweron(genpd);
- genpd->suspended_count--;
-- genpd_start_dev(genpd, dev);
-
-- return genpd_resume_early(genpd, dev);
-+ return genpd_start_dev(genpd, dev);
- }
-
- /**
-@@ -1099,11 +1154,15 @@ static void pm_genpd_complete(struct device *dev)
-
- #define pm_genpd_prepare NULL
- #define pm_genpd_suspend NULL
-+#define pm_genpd_suspend_late NULL
- #define pm_genpd_suspend_noirq NULL
-+#define pm_genpd_resume_early NULL
- #define pm_genpd_resume_noirq NULL
- #define pm_genpd_resume NULL
- #define pm_genpd_freeze NULL
-+#define pm_genpd_freeze_late NULL
- #define pm_genpd_freeze_noirq NULL
-+#define pm_genpd_thaw_early NULL
- #define pm_genpd_thaw_noirq NULL
- #define pm_genpd_thaw NULL
- #define pm_genpd_restore_noirq NULL
-@@ -1482,7 +1541,7 @@ static int pm_genpd_default_suspend_late(struct device *dev)
- {
- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend_late;
-
-- return cb ? cb(dev) : pm_generic_suspend_noirq(dev);
-+ return cb ? cb(dev) : pm_generic_suspend_late(dev);
- }
-
- /**
-@@ -1493,7 +1552,7 @@ static int pm_genpd_default_resume_early(struct device *dev)
- {
- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume_early;
-
-- return cb ? cb(dev) : pm_generic_resume_noirq(dev);
-+ return cb ? cb(dev) : pm_generic_resume_early(dev);
- }
-
- /**
-@@ -1526,7 +1585,7 @@ static int pm_genpd_default_freeze_late(struct device *dev)
- {
- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-
-- return cb ? cb(dev) : pm_generic_freeze_noirq(dev);
-+ return cb ? cb(dev) : pm_generic_freeze_late(dev);
- }
-
- /**
-@@ -1537,7 +1596,7 @@ static int pm_genpd_default_thaw_early(struct device *dev)
- {
- int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-
-- return cb ? cb(dev) : pm_generic_thaw_noirq(dev);
-+ return cb ? cb(dev) : pm_generic_thaw_early(dev);
- }
-
- /**
-@@ -1596,16 +1655,22 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->domain.ops.runtime_idle = pm_generic_runtime_idle;
- genpd->domain.ops.prepare = pm_genpd_prepare;
- genpd->domain.ops.suspend = pm_genpd_suspend;
-+ genpd->domain.ops.suspend_late = pm_genpd_suspend_late;
- genpd->domain.ops.suspend_noirq = pm_genpd_suspend_noirq;
- genpd->domain.ops.resume_noirq = pm_genpd_resume_noirq;
-+ genpd->domain.ops.resume_early = pm_genpd_resume_early;
- genpd->domain.ops.resume = pm_genpd_resume;
- genpd->domain.ops.freeze = pm_genpd_freeze;
-+ genpd->domain.ops.freeze_late = pm_genpd_freeze_late;
- genpd->domain.ops.freeze_noirq = pm_genpd_freeze_noirq;
- genpd->domain.ops.thaw_noirq = pm_genpd_thaw_noirq;
-+ genpd->domain.ops.thaw_early = pm_genpd_thaw_early;
- genpd->domain.ops.thaw = pm_genpd_thaw;
- genpd->domain.ops.poweroff = pm_genpd_suspend;
-+ genpd->domain.ops.poweroff_late = pm_genpd_suspend_late;
- genpd->domain.ops.poweroff_noirq = pm_genpd_suspend_noirq;
- genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
-+ genpd->domain.ops.restore_early = pm_genpd_resume_early;
- genpd->domain.ops.restore = pm_genpd_resume;
- genpd->domain.ops.complete = pm_genpd_complete;
- genpd->dev_ops.save_state = pm_genpd_default_save_state;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0178-PM-QoS-Simplify-PM-QoS-expansion-merge.patch b/patches.runtime_pm/0178-PM-QoS-Simplify-PM-QoS-expansion-merge.patch
deleted file mode 100644
index 6e6269fe772104..00000000000000
--- a/patches.runtime_pm/0178-PM-QoS-Simplify-PM-QoS-expansion-merge.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 13e5f915ea6eb2bb64310f9b922ecc0b54f70267 Mon Sep 17 00:00:00 2001
-From: Alex Frid <afrid@nvidia.com>
-Date: Sun, 29 Jan 2012 20:39:25 +0100
-Subject: PM / QoS: Simplify PM QoS expansion/merge
-
- - Replace class ID #define with enumeration
- - Loop through PM QoS objects during initialization (rather than
- initializing them one-by-one)
-
-Signed-off-by: Alex Frid <afrid@nvidia.com>
-Reviewed-by: Antti Miettinen <amiettinen@nvidia.com>
-Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
-Reviewed-by: Scott Williams <scwilliams@nvidia.com>
-Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-Acked-by: markgross <markgross@thegnar.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d031e1de2c5ba91e67ed83f6adf624543ab2b03d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 14 +++++++++-----
- kernel/power/qos.c | 23 ++++++++++-------------
- 2 files changed, 19 insertions(+), 18 deletions(-)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index e5bbcba..5ac91d8 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -9,12 +9,16 @@
- #include <linux/miscdevice.h>
- #include <linux/device.h>
-
--#define PM_QOS_RESERVED 0
--#define PM_QOS_CPU_DMA_LATENCY 1
--#define PM_QOS_NETWORK_LATENCY 2
--#define PM_QOS_NETWORK_THROUGHPUT 3
-+enum {
-+ PM_QOS_RESERVED = 0,
-+ PM_QOS_CPU_DMA_LATENCY,
-+ PM_QOS_NETWORK_LATENCY,
-+ PM_QOS_NETWORK_THROUGHPUT,
-+
-+ /* insert new class ID */
-+ PM_QOS_NUM_CLASSES,
-+};
-
--#define PM_QOS_NUM_CLASSES 4
- #define PM_QOS_DEFAULT_VALUE -1
-
- #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index 995e3bd..d6d6dbd 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -469,21 +469,18 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
- static int __init pm_qos_power_init(void)
- {
- int ret = 0;
-+ int i;
-
-- ret = register_pm_qos_misc(&cpu_dma_pm_qos);
-- if (ret < 0) {
-- printk(KERN_ERR "pm_qos_param: cpu_dma_latency setup failed\n");
-- return ret;
-- }
-- ret = register_pm_qos_misc(&network_lat_pm_qos);
-- if (ret < 0) {
-- printk(KERN_ERR "pm_qos_param: network_latency setup failed\n");
-- return ret;
-+ BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES);
-+
-+ for (i = 1; i < PM_QOS_NUM_CLASSES; i++) {
-+ ret = register_pm_qos_misc(pm_qos_array[i]);
-+ if (ret < 0) {
-+ printk(KERN_ERR "pm_qos_param: %s setup failed\n",
-+ pm_qos_array[i]->name);
-+ return ret;
-+ }
- }
-- ret = register_pm_qos_misc(&network_throughput_pm_qos);
-- if (ret < 0)
-- printk(KERN_ERR
-- "pm_qos_param: network_throughput setup failed\n");
-
- return ret;
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0179-PM-Hibernate-Thaw-kernel-threads-in-SNAPSHOT_CREATE_.patch b/patches.runtime_pm/0179-PM-Hibernate-Thaw-kernel-threads-in-SNAPSHOT_CREATE_.patch
deleted file mode 100644
index e38db217ec23f5..00000000000000
--- a/patches.runtime_pm/0179-PM-Hibernate-Thaw-kernel-threads-in-SNAPSHOT_CREATE_.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 0d3b27d7ec5e0e8c4ec4f18e0543bd9a307519ee Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Wed, 1 Feb 2012 22:16:36 +0100
-Subject: PM / Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl
- path
-
-In the SNAPSHOT_CREATE_IMAGE ioctl, if the call to hibernation_snapshot()
-fails, the frozen tasks are not thawed.
-
-And in the case of success, if we happen to exit due to a successful freezer
-test, all tasks (including those of userspace) are thawed, whereas actually
-we should have thawed only the kernel threads at that point. Fix both these
-issues.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Cc: stable@vger.kernel.org
-(cherry picked from commit fe9161db2e6053da21e4649d77bbefaf3030b11d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/user.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index e5a21a8..3e10007 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -249,13 +249,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- }
- pm_restore_gfp_mask();
- error = hibernation_snapshot(data->platform_support);
-- if (!error) {
-+ if (error) {
-+ thaw_kernel_threads();
-+ } else {
- error = put_user(in_suspend, (int __user *)arg);
- if (!error && !freezer_test_done)
- data->ready = 1;
- if (freezer_test_done) {
- freezer_test_done = false;
-- thaw_processes();
-+ thaw_kernel_threads();
- }
- }
- break;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0180-PM-Freezer-Thaw-only-kernel-threads-if-freezing-of-k.patch b/patches.runtime_pm/0180-PM-Freezer-Thaw-only-kernel-threads-if-freezing-of-k.patch
deleted file mode 100644
index 02c7394c5353f3..00000000000000
--- a/patches.runtime_pm/0180-PM-Freezer-Thaw-only-kernel-threads-if-freezing-of-k.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 6d62dfd237637ac51b285e869bcd3c03326681fd Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Fri, 3 Feb 2012 22:22:41 +0100
-Subject: PM / Freezer: Thaw only kernel threads if freezing of kernel threads
- fails
-
-If freezing of kernel threads fails, we are expected to automatically
-thaw tasks in the error recovery path. However, at times, we encounter
-situations in which we would like the automatic error recovery path
-to thaw only the kernel threads, because we want to be able to do
-some more cleanup before we thaw userspace. Something like:
-
-error = freeze_kernel_threads();
-if (error) {
- /* Do some cleanup */
-
- /* Only then thaw userspace tasks*/
- thaw_processes();
-}
-
-An example of such a situation is where we freeze/thaw filesystems
-during suspend/hibernation. There, if freezing of kernel threads
-fails, we would like to thaw the frozen filesystems before thawing
-the userspace tasks.
-
-So, modify freeze_kernel_threads() to thaw only kernel threads in
-case of freezing failure. And change suspend_freeze_processes()
-accordingly. (At the same time, let us also get rid of the rather
-cryptic usage of the conditional operator (:?) in that function.)
-
-[rjw: In fact, this patch fixes a regression introduced during the
- 3.3 merge window, because without it thaw_processes() may be called
- before swsusp_free() in some situations and that may lead to massive
- memory allocation failures.]
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Acked-by: Tejun Heo <tj@kernel.org>
-Acked-by: Nigel Cunningham <nigel@tuxonice.net>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 379e0be812ab8a2a351e784b0c987788f5123090)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/power.h | 24 ++++++++++++++++++++++--
- kernel/power/process.c | 7 +++++--
- 2 files changed, 27 insertions(+), 4 deletions(-)
-
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 0c4defe..21724ee 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -231,8 +231,28 @@ extern int pm_test_level;
- #ifdef CONFIG_SUSPEND_FREEZER
- static inline int suspend_freeze_processes(void)
- {
-- int error = freeze_processes();
-- return error ? : freeze_kernel_threads();
-+ int error;
-+
-+ error = freeze_processes();
-+
-+ /*
-+ * freeze_processes() automatically thaws every task if freezing
-+ * fails. So we need not do anything extra upon error.
-+ */
-+ if (error)
-+ goto Finish;
-+
-+ error = freeze_kernel_threads();
-+
-+ /*
-+ * freeze_kernel_threads() thaws only kernel threads upon freezing
-+ * failure. So we have to thaw the userspace tasks ourselves.
-+ */
-+ if (error)
-+ thaw_processes();
-+
-+ Finish:
-+ return error;
- }
-
- static inline void suspend_thaw_processes(void)
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index eeca003..7e42645 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -143,7 +143,10 @@ int freeze_processes(void)
- /**
- * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
- *
-- * On success, returns 0. On failure, -errno and system is fully thawed.
-+ * On success, returns 0. On failure, -errno and only the kernel threads are
-+ * thawed, so as to give a chance to the caller to do additional cleanups
-+ * (if any) before thawing the userspace tasks. So, it is the responsibility
-+ * of the caller to thaw the userspace tasks, when the time is right.
- */
- int freeze_kernel_threads(void)
- {
-@@ -159,7 +162,7 @@ int freeze_kernel_threads(void)
- BUG_ON(in_atomic());
-
- if (error)
-- thaw_processes();
-+ thaw_kernel_threads();
- return error;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0181-PM-QoS-CPU-C-state-breakage-with-PM-Qos-change.patch b/patches.runtime_pm/0181-PM-QoS-CPU-C-state-breakage-with-PM-Qos-change.patch
deleted file mode 100644
index b217d0bcb09e0a..00000000000000
--- a/patches.runtime_pm/0181-PM-QoS-CPU-C-state-breakage-with-PM-Qos-change.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 2e9454c75fb01bd194f45e92f5211fa276b733cd Mon Sep 17 00:00:00 2001
-From: Venkatesh Pallipadi <venki@google.com>
-Date: Fri, 3 Feb 2012 22:22:25 +0100
-Subject: PM / QoS: CPU C-state breakage with PM Qos change
-
-Looks like change "PM QoS: Move and rename the implementation files"
-merged during the 3.2 development cycle made PM QoS depend on
-CONFIG_PM which depends on (PM_SLEEP || PM_RUNTIME).
-
-That breaks CPU C-states with kernels not having these CONFIGs, causing CPUs
-to spend time in Polling loop idle instead of going into deep C-states,
-consuming way way more power. This is with either acpi idle or intel idle
-enabled.
-
-Either CONFIG_PM should be enabled with any pm_qos users or
-the !CONFIG_PM pm_qos_request() should return sane defaults not to break
-the existing users. Here's is the patch for the latter option.
-
-[rjw: Modified the changelog slightly.]
-
-Signed-off-by: Venkatesh Pallipadi <venki@google.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Cc: stable@vger.kernel.org
-(cherry picked from commit d020283dc694c9ec31b410f522252f7a8397e67d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 5ac91d8..67c5217 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -114,7 +114,19 @@ static inline void pm_qos_remove_request(struct pm_qos_request *req)
- { return; }
-
- static inline int pm_qos_request(int pm_qos_class)
-- { return 0; }
-+{
-+ switch (pm_qos_class) {
-+ case PM_QOS_CPU_DMA_LATENCY:
-+ return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
-+ case PM_QOS_NETWORK_LATENCY:
-+ return PM_QOS_NETWORK_LAT_DEFAULT_VALUE;
-+ case PM_QOS_NETWORK_THROUGHPUT:
-+ return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE;
-+ default:
-+ return PM_QOS_DEFAULT_VALUE;
-+ }
-+}
-+
- static inline int pm_qos_add_notifier(int pm_qos_class,
- struct notifier_block *notifier)
- { return 0; }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0182-PM-Suspend-Avoid-code-duplication-in-suspend-statist.patch b/patches.runtime_pm/0182-PM-Suspend-Avoid-code-duplication-in-suspend-statist.patch
deleted file mode 100644
index 021adb7d1e75ef..00000000000000
--- a/patches.runtime_pm/0182-PM-Suspend-Avoid-code-duplication-in-suspend-statist.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 8c3cb27999de30afd71511f033f7ac9f9899ed1f Mon Sep 17 00:00:00 2001
-From: Marcos Paulo de Souza <marcos.mage@gmail.com>
-Date: Sat, 4 Feb 2012 22:26:13 +0100
-Subject: PM / Suspend: Avoid code duplication in suspend statistics update
-
-The code
- if (error) {
- suspend_stats.fail++;
- dpm_save_failed_errno(error);
- } else
- suspend_stats.success++;
-
-Appears in the kernel/power/main.c and kernel/power/suspend.c.
-
-This patch just creates a new function to avoid duplicated code.
-
-Suggested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 8916e3702ec422b57cc549fbae3986106292100f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/suspend.h | 16 ++++++++++++++++
- kernel/power/main.c | 6 +-----
- kernel/power/suspend.c | 6 +-----
- 3 files changed, 18 insertions(+), 10 deletions(-)
-
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index 43f0421..ec59fb0 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -94,6 +94,22 @@ static inline void dpm_save_failed_step(enum suspend_stat_step step)
- }
-
- /**
-+ * suspend_stats_update - Update success/failure statistics of suspend-to-ram
-+ *
-+ * @error: Value returned by enter_state() function
-+ */
-+static inline void suspend_stats_update(int error)
-+{
-+ if (error) {
-+ suspend_stats.fail++;
-+ dpm_save_failed_errno(error);
-+ } else {
-+ suspend_stats.success++;
-+ }
-+}
-+
-+
-+/**
- * struct platform_suspend_ops - Callbacks for managing platform dependent
- * system sleep states.
- *
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 8c5014a..b1e3248 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -296,11 +296,7 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
- }
- if (state < PM_SUSPEND_MAX && *s) {
- error = enter_state(state);
-- if (error) {
-- suspend_stats.fail++;
-- dpm_save_failed_errno(error);
-- } else
-- suspend_stats.success++;
-+ suspend_stats_update(error);
- }
- #endif
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 560a639..03bc92b 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -321,11 +321,7 @@ int pm_suspend(suspend_state_t state)
- int ret;
- if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) {
- ret = enter_state(state);
-- if (ret) {
-- suspend_stats.fail++;
-- dpm_save_failed_errno(ret);
-- } else
-- suspend_stats.success++;
-+ suspend_stats_update(ret);
- return ret;
- }
- return -EINVAL;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0183-PM-Freezer-Docs-Document-the-beauty-of-freeze-thaw-s.patch b/patches.runtime_pm/0183-PM-Freezer-Docs-Document-the-beauty-of-freeze-thaw-s.patch
deleted file mode 100644
index fa39badeb41968..00000000000000
--- a/patches.runtime_pm/0183-PM-Freezer-Docs-Document-the-beauty-of-freeze-thaw-s.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From d1b7eced0184f8fb0776c37885e5897eb072173d Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 4 Feb 2012 22:26:26 +0100
-Subject: PM / Freezer / Docs: Document the beauty of freeze/thaw semantics
-
-The way the different freeze/thaw functions encapsulate each other are quite
-lovely from a design point of view. And as a side-effect, the way in which
-they are invoked (cleaning up on failure for example) differs significantly
-from how usual functions are dealt with. This is because of the underlying
-semantics that govern the freezing and thawing of various tasks.
-
-This subtle aspect that differentiates these functions from the rest, is
-worth documenting.
-
-Many thanks to Tejun Heo for providing enlightenment on this topic.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9045a05044268b075c13bb0284601b24959dc3c6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/power/freezing-of-tasks.txt | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
-
-diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
-index ebd7490..ec715cd 100644
---- a/Documentation/power/freezing-of-tasks.txt
-+++ b/Documentation/power/freezing-of-tasks.txt
-@@ -63,6 +63,27 @@ devices have been reinitialized, the function thaw_processes() is called in
- order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that
- have been frozen leave __refrigerator() and continue running.
-
-+
-+Rationale behind the functions dealing with freezing and thawing of tasks:
-+-------------------------------------------------------------------------
-+
-+freeze_processes():
-+ - freezes only userspace tasks
-+
-+freeze_kernel_threads():
-+ - freezes all tasks (including kernel threads) because we can't freeze
-+ kernel threads without freezing userspace tasks
-+
-+thaw_kernel_threads():
-+ - thaws only kernel threads; this is particularly useful if we need to do
-+ anything special in between thawing of kernel threads and thawing of
-+ userspace tasks, or if we want to postpone the thawing of userspace tasks
-+
-+thaw_processes():
-+ - thaws all tasks (including kernel threads) because we can't thaw userspace
-+ tasks without thawing kernel threads
-+
-+
- III. Which kernel threads are freezable?
-
- Kernel threads are not freezable by default. However, a kernel thread may clear
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0184-PM-Hibernate-Thaw-kernel-threads-in-hibernation_snap.patch b/patches.runtime_pm/0184-PM-Hibernate-Thaw-kernel-threads-in-hibernation_snap.patch
deleted file mode 100644
index a59bbea8a9a594..00000000000000
--- a/patches.runtime_pm/0184-PM-Hibernate-Thaw-kernel-threads-in-hibernation_snap.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 77e33b76bdc5b44c3ae937e3d309ea66af7f59ac Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 4 Feb 2012 22:26:38 +0100
-Subject: PM / Hibernate: Thaw kernel threads in hibernation_snapshot() in
- error/test path
-
-In the hibernation call path, the kernel threads are frozen inside
-hibernation_snapshot(). If we happen to encounter an error further down
-the road or if we are exiting early due to a successful freezer test,
-then thaw kernel threads before returning to the caller.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Acked-by: Tejun Heo <tj@kernel.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 51d6ff7acd920379f54d0be4dbe844a46178a65f)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 6 ++++--
- kernel/power/user.c | 8 ++------
- 2 files changed, 6 insertions(+), 8 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index f3b03d4..23c1fe3 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -343,13 +343,13 @@ int hibernation_snapshot(int platform_mode)
- * successful freezer test.
- */
- freezer_test_done = true;
-- goto Cleanup;
-+ goto Thaw;
- }
-
- error = dpm_prepare(PMSG_FREEZE);
- if (error) {
- dpm_complete(PMSG_RECOVER);
-- goto Cleanup;
-+ goto Thaw;
- }
-
- suspend_console();
-@@ -385,6 +385,8 @@ int hibernation_snapshot(int platform_mode)
- platform_end(platform_mode);
- return error;
-
-+ Thaw:
-+ thaw_kernel_threads();
- Cleanup:
- swsusp_free();
- goto Close;
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 3e10007..7bee91f 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -249,16 +249,12 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- }
- pm_restore_gfp_mask();
- error = hibernation_snapshot(data->platform_support);
-- if (error) {
-- thaw_kernel_threads();
-- } else {
-+ if (!error) {
- error = put_user(in_suspend, (int __user *)arg);
- if (!error && !freezer_test_done)
- data->ready = 1;
-- if (freezer_test_done) {
-+ if (freezer_test_done)
- freezer_test_done = false;
-- thaw_kernel_threads();
-- }
- }
- break;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0185-PM-Hibernate-Refactor-and-simplify-freezer_test_done.patch b/patches.runtime_pm/0185-PM-Hibernate-Refactor-and-simplify-freezer_test_done.patch
deleted file mode 100644
index 2546f8cf6d33af..00000000000000
--- a/patches.runtime_pm/0185-PM-Hibernate-Refactor-and-simplify-freezer_test_done.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 1200a11c7f5d2b2e984bd84ccec59bad00bb5b5c Mon Sep 17 00:00:00 2001
-From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
-Date: Sat, 4 Feb 2012 23:39:56 +0100
-Subject: PM / Hibernate: Refactor and simplify freezer_test_done
-
-The code related to 'freezer_test_done' is needlessly convoluted.
-Refactor the code and simplify the implementation.
-
-Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a556d5b58345ccf51826b9ceac078072f830738b)
-
-Conflicts:
-
- kernel/power/hibernate.c
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 10 +++++-----
- kernel/power/user.c | 6 ++----
- 2 files changed, 7 insertions(+), 9 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 23c1fe3..0a186cf 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -629,12 +629,8 @@ int hibernate(void)
- goto Free_bitmaps;
-
- error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
-- if (error)
-- goto Thaw;
-- if (freezer_test_done) {
-- freezer_test_done = false;
-+ if (error || freezer_test_done)
- goto Thaw;
-- }
-
- if (in_suspend) {
- unsigned int flags = 0;
-@@ -659,6 +655,10 @@ int hibernate(void)
-
- Thaw:
- thaw_processes();
-+
-+ /* Don't bother checking whether freezer_test_done is true */
-+ freezer_test_done = false;
-+
- Free_bitmaps:
- free_basic_memory_bitmaps();
- Enable_umh:
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 7bee91f..33c4329 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -251,10 +251,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- error = hibernation_snapshot(data->platform_support);
- if (!error) {
- error = put_user(in_suspend, (int __user *)arg);
-- if (!error && !freezer_test_done)
-- data->ready = 1;
-- if (freezer_test_done)
-- freezer_test_done = false;
-+ data->ready = !freezer_test_done && !error;
-+ freezer_test_done = false;
- }
- break;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0186-PM-Domains-Provide-a-dummy-dev_gpd_data-when-generic.patch b/patches.runtime_pm/0186-PM-Domains-Provide-a-dummy-dev_gpd_data-when-generic.patch
deleted file mode 100644
index c35374c1ceef00..00000000000000
--- a/patches.runtime_pm/0186-PM-Domains-Provide-a-dummy-dev_gpd_data-when-generic.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 9d12ae0814fa170619c2cfe00194e8801e3b16c9 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Sat, 4 Feb 2012 22:26:49 +0100
-Subject: PM / Domains: Provide a dummy dev_gpd_data() when generic domains
- are not used
-
-dev_gpd_data() is a generic macro, also useful for drivers. Hence it should
-be available also when CONFIG_PM_GENERIC_DOMAINS is not selected. OTOH,
-to_gpd_data() is so far unused outside of the generic PM domain code and
-does not seem to be very useful without CONFIG_PM_GENERIC_DOMAINS.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 9b4f617b1c2004332113b4a2c89dfb6e8029c987)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_domain.h | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index e3ff875..e76cc9a 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -101,12 +101,12 @@ struct generic_pm_domain_data {
- bool need_restore;
- };
-
-+#ifdef CONFIG_PM_GENERIC_DOMAINS
- static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd)
- {
- return container_of(pdd, struct generic_pm_domain_data, base);
- }
-
--#ifdef CONFIG_PM_GENERIC_DOMAINS
- static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
- {
- return to_gpd_data(dev->power.subsys_data->domain_data);
-@@ -207,6 +207,10 @@ static inline bool default_stop_ok(struct device *dev)
- return false;
- }
- #define pm_domain_always_on_gov NULL
-+static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
-+{
-+ return NULL;
-+}
- #endif
-
- static inline int pm_genpd_remove_callbacks(struct device *dev)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0187-PM-Make-sysrq-o-be-available-for-CONFIG_PM-unset.patch b/patches.runtime_pm/0187-PM-Make-sysrq-o-be-available-for-CONFIG_PM-unset.patch
deleted file mode 100644
index 32dc1877707dcb..00000000000000
--- a/patches.runtime_pm/0187-PM-Make-sysrq-o-be-available-for-CONFIG_PM-unset.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7089d03dd9df82aa9f6f08743eeadad0aa682b53 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 14 Jan 2012 00:33:03 +0100
-Subject: PM: Make sysrq-o be available for CONFIG_PM unset
-
-After commit 1eb208aea3179dd2fc0cdeea45ef869d75b4fe70, "PM: Make
-CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME)", the
-files under kernel/power are not built unless CONFIG_PM_SLEEP or
-CONFIG_PM_RUNTIME is set. In particular, this causes
-kernel/power/poweroff.c to be omitted, even though it should be
-compiled, because CONFIG_MAGIC_SYSRQ is set.
-
-Fix the problem by causing kernel/power/Makefile to be processed
-for CONFIG_PM unset too.
-
-Reported-and-tested-by: Phil Oester <kernel@linuxace.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit dae5cbc2440b1d21a15715d0f1fb20f632dd38ee)
-
-Conflicts:
-
- kernel/Makefile
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/Makefile b/kernel/Makefile
-index de5198f..856f9d6 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -24,6 +24,8 @@ CFLAGS_REMOVE_sched_clock.o = -pg
- CFLAGS_REMOVE_irq_work.o = -pg
- endif
-
-+obj-y += power/
-+
- obj-$(CONFIG_FREEZER) += freezer.o
- obj-$(CONFIG_PROFILING) += profile.o
- obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
-@@ -52,8 +54,6 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
- obj-$(CONFIG_UID16) += uid16.o
- obj-$(CONFIG_MODULES) += module.o
- obj-$(CONFIG_KALLSYMS) += kallsyms.o
--obj-$(CONFIG_PM) += power/
--obj-$(CONFIG_FREEZER) += power/
- obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
- obj-$(CONFIG_KEXEC) += kexec.o
- obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0188-PM-QoS-unconditionally-build-the-feature.patch b/patches.runtime_pm/0188-PM-QoS-unconditionally-build-the-feature.patch
deleted file mode 100644
index 995ee114d546d8..00000000000000
--- a/patches.runtime_pm/0188-PM-QoS-unconditionally-build-the-feature.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 2af3898d131f8372e89abca681a971abffa9b51a Mon Sep 17 00:00:00 2001
-From: Jean Pihet <jean.pihet@newoldbits.com>
-Date: Mon, 13 Feb 2012 16:23:42 +0100
-Subject: PM / QoS: unconditionally build the feature
-
-The PM QoS feature originally didn't depend on CONFIG_PM, which was
-mistakenly changed by commit e8db0be1245de16a6cc6365506abc392c3c212d4
-
- PM QoS: Move and rename the implementation files
-
-Later, commit d020283dc694c9ec31b410f522252f7a8397e67d
-
- PM / QoS: CPU C-state breakage with PM Qos change
-
-partially fixed that by introducing a static inline definition of
-pm_qos_request(), but that still didn't allow user space to use
-the PM QoS interface if CONFIG_PM was unset (which had been possible
-before). For this reason, remove the dependency of PM QoS on
-CONFIG_PM to make it work (as intended) with CONFIG_PM unset.
-
-[rjw: Replaced the original changelog with a new one.]
-
-Signed-off-by: Jean Pihet <j-pihet@ti.com>
-Reported-by: Venkatesh Pallipadi <venki@google.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit a9b542ee607a8afafa9447292394959fc84ea650)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 41 +----------------------------------------
- kernel/power/Makefile | 3 ++-
- 2 files changed, 3 insertions(+), 41 deletions(-)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 67c5217..c8a541e 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -67,7 +67,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
- return req->dev != 0;
- }
-
--#ifdef CONFIG_PM
- int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
- enum pm_qos_req_action action, int value);
- void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
-@@ -82,6 +81,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
- int pm_qos_request_active(struct pm_qos_request *req);
- s32 pm_qos_read_value(struct pm_qos_constraints *c);
-
-+#ifdef CONFIG_PM
- s32 __dev_pm_qos_read_value(struct device *dev);
- s32 dev_pm_qos_read_value(struct device *dev);
- int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
-@@ -99,45 +99,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
- int dev_pm_qos_add_ancestor_request(struct device *dev,
- struct dev_pm_qos_request *req, s32 value);
- #else
--static inline int pm_qos_update_target(struct pm_qos_constraints *c,
-- struct plist_node *node,
-- enum pm_qos_req_action action,
-- int value)
-- { return 0; }
--static inline void pm_qos_add_request(struct pm_qos_request *req,
-- int pm_qos_class, s32 value)
-- { return; }
--static inline void pm_qos_update_request(struct pm_qos_request *req,
-- s32 new_value)
-- { return; }
--static inline void pm_qos_remove_request(struct pm_qos_request *req)
-- { return; }
--
--static inline int pm_qos_request(int pm_qos_class)
--{
-- switch (pm_qos_class) {
-- case PM_QOS_CPU_DMA_LATENCY:
-- return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
-- case PM_QOS_NETWORK_LATENCY:
-- return PM_QOS_NETWORK_LAT_DEFAULT_VALUE;
-- case PM_QOS_NETWORK_THROUGHPUT:
-- return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE;
-- default:
-- return PM_QOS_DEFAULT_VALUE;
-- }
--}
--
--static inline int pm_qos_add_notifier(int pm_qos_class,
-- struct notifier_block *notifier)
-- { return 0; }
--static inline int pm_qos_remove_notifier(int pm_qos_class,
-- struct notifier_block *notifier)
-- { return 0; }
--static inline int pm_qos_request_active(struct pm_qos_request *req)
-- { return 0; }
--static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
-- { return 0; }
--
- static inline s32 __dev_pm_qos_read_value(struct device *dev)
- { return 0; }
- static inline s32 dev_pm_qos_read_value(struct device *dev)
-diff --git a/kernel/power/Makefile b/kernel/power/Makefile
-index 07e0e28..66d808e 100644
---- a/kernel/power/Makefile
-+++ b/kernel/power/Makefile
-@@ -1,7 +1,8 @@
-
- ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG
-
--obj-$(CONFIG_PM) += main.o qos.o
-+obj-y += qos.o
-+obj-$(CONFIG_PM) += main.o
- obj-$(CONFIG_VT_CONSOLE_SLEEP) += console.o
- obj-$(CONFIG_FREEZER) += process.o
- obj-$(CONFIG_SUSPEND) += suspend.o
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0189-PM-Sleep-Initialize-wakeup-source-locks-in-wakeup_so.patch b/patches.runtime_pm/0189-PM-Sleep-Initialize-wakeup-source-locks-in-wakeup_so.patch
deleted file mode 100644
index 4cc744249a90aa..00000000000000
--- a/patches.runtime_pm/0189-PM-Sleep-Initialize-wakeup-source-locks-in-wakeup_so.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 786f7c4222b9aaf620afad10c7474d9d60b2d2e5 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 11 Feb 2012 00:00:11 +0100
-Subject: PM / Sleep: Initialize wakeup source locks in wakeup_source_add()
-
-Initialize wakeup source locks in wakeup_source_add() instead of
-wakeup_source_create(), because otherwise the locks of the wakeup
-sources that haven't been allocated with wakeup_source_create()
-aren't initialized and handled properly.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 7c95149b7f1f61201b12c73c4862a41bf2428961)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/wakeup.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index caf995f..6e591a8 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -64,7 +64,6 @@ struct wakeup_source *wakeup_source_create(const char *name)
- if (!ws)
- return NULL;
-
-- spin_lock_init(&ws->lock);
- if (name)
- ws->name = kstrdup(name, GFP_KERNEL);
-
-@@ -105,6 +104,7 @@ void wakeup_source_add(struct wakeup_source *ws)
- if (WARN_ON(!ws))
- return;
-
-+ spin_lock_init(&ws->lock);
- setup_timer(&ws->timer, pm_wakeup_timer_fn, (unsigned long)ws);
- ws->active = false;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0190-PM-Sleep-Do-not-check-wakeup-too-often-in-try_to_fre.patch b/patches.runtime_pm/0190-PM-Sleep-Do-not-check-wakeup-too-often-in-try_to_fre.patch
deleted file mode 100644
index ab39b1428553c0..00000000000000
--- a/patches.runtime_pm/0190-PM-Sleep-Do-not-check-wakeup-too-often-in-try_to_fre.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From e3a42333a2ec0816f4d42a72281291919a7c9da8 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 11 Feb 2012 00:00:34 +0100
-Subject: PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()
-
-Use the observation that it is more efficient to check the wakeup
-variable once before the loop reporting tasks that were not
-frozen in try_to_freeze_tasks() than to do that in every step of that
-loop.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 6c83b4818dd65eb17e633b6b629a81da7bed90b3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/process.c | 16 +++++++++-------
- 1 file changed, 9 insertions(+), 7 deletions(-)
-
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 7e42645..6aeb5ef 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -98,13 +98,15 @@ static int try_to_freeze_tasks(bool user_only)
- elapsed_csecs / 100, elapsed_csecs % 100,
- todo - wq_busy, wq_busy);
-
-- read_lock(&tasklist_lock);
-- do_each_thread(g, p) {
-- if (!wakeup && !freezer_should_skip(p) &&
-- p != current && freezing(p) && !frozen(p))
-- sched_show_task(p);
-- } while_each_thread(g, p);
-- read_unlock(&tasklist_lock);
-+ if (!wakeup) {
-+ read_lock(&tasklist_lock);
-+ do_each_thread(g, p) {
-+ if (p != current && !freezer_should_skip(p)
-+ && freezing(p) && !frozen(p))
-+ sched_show_task(p);
-+ } while_each_thread(g, p);
-+ read_unlock(&tasklist_lock);
-+ }
- } else {
- printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
- elapsed_csecs % 100);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0191-PM-Sleep-Remove-unnecessary-label-from-suspend_freez.patch b/patches.runtime_pm/0191-PM-Sleep-Remove-unnecessary-label-from-suspend_freez.patch
deleted file mode 100644
index 9d316f9190d2c5..00000000000000
--- a/patches.runtime_pm/0191-PM-Sleep-Remove-unnecessary-label-from-suspend_freez.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 2924f4c473f6328ddc56bf54b6b5779d65d3b9e8 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Sat, 11 Feb 2012 22:40:23 +0100
-Subject: PM / Sleep: Remove unnecessary label from suspend_freeze_processes()
-
-The Finish label in suspend_freeze_processes() is in fact unnecessary
-and makes the function look more complicated than it really is, so
-remove that label (along with a few empty lines).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit 6f585f750d792652f33b6e85b1ee205be4b5e572)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/power.h | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 21724ee..398d42b 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -234,16 +234,14 @@ static inline int suspend_freeze_processes(void)
- int error;
-
- error = freeze_processes();
--
- /*
- * freeze_processes() automatically thaws every task if freezing
- * fails. So we need not do anything extra upon error.
- */
- if (error)
-- goto Finish;
-+ return error;
-
- error = freeze_kernel_threads();
--
- /*
- * freeze_kernel_threads() thaws only kernel threads upon freezing
- * failure. So we have to thaw the userspace tasks ourselves.
-@@ -251,7 +249,6 @@ static inline int suspend_freeze_processes(void)
- if (error)
- thaw_processes();
-
-- Finish:
- return error;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0192-PM-Sleep-Unify-kerneldoc-comments-in-kernel-power-su.patch b/patches.runtime_pm/0192-PM-Sleep-Unify-kerneldoc-comments-in-kernel-power-su.patch
deleted file mode 100644
index 11fb2340e816f2..00000000000000
--- a/patches.runtime_pm/0192-PM-Sleep-Unify-kerneldoc-comments-in-kernel-power-su.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From a6f7306c0933fa6c5e5e707d5a87bf53fbefeef1 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 13 Feb 2012 16:29:14 +0100
-Subject: PM / Sleep: Unify kerneldoc comments in kernel/power/suspend.c
-
-The kerneldoc comments in kernel/power/suspend.c are not formatted
-in the same way and the quality of some of them is questionable.
-Unify the formatting and improve the contents.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit 55ae451918ec62e553f11b6118fec157f90c31c3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/suspend.c | 56 +++++++++++++++++++++++-------------------------
- 1 file changed, 27 insertions(+), 29 deletions(-)
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 03bc92b..e6b5ef9 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -37,8 +37,8 @@ const char *const pm_states[PM_SUSPEND_MAX] = {
- static const struct platform_suspend_ops *suspend_ops;
-
- /**
-- * suspend_set_ops - Set the global suspend method table.
-- * @ops: Pointer to ops structure.
-+ * suspend_set_ops - Set the global suspend method table.
-+ * @ops: Suspend operations to use.
- */
- void suspend_set_ops(const struct platform_suspend_ops *ops)
- {
-@@ -58,11 +58,11 @@ bool valid_state(suspend_state_t state)
- }
-
- /**
-- * suspend_valid_only_mem - generic memory-only valid callback
-+ * suspend_valid_only_mem - Generic memory-only valid callback.
- *
-- * Platform drivers that implement mem suspend only and only need
-- * to check for that in their .valid callback can use this instead
-- * of rolling their own .valid callback.
-+ * Platform drivers that implement mem suspend only and only need to check for
-+ * that in their .valid() callback can use this instead of rolling their own
-+ * .valid() callback.
- */
- int suspend_valid_only_mem(suspend_state_t state)
- {
-@@ -83,10 +83,11 @@ static int suspend_test(int level)
- }
-
- /**
-- * suspend_prepare - Do prep work before entering low-power state.
-+ * suspend_prepare - Prepare for entering system sleep state.
- *
-- * This is common code that is called for each state that we're entering.
-- * Run suspend notifiers, allocate a console and stop all processes.
-+ * Common code run for every system sleep state that can be entered (except for
-+ * hibernation). Run suspend notifiers, allocate the "suspend" console and
-+ * freeze processes.
- */
- static int suspend_prepare(void)
- {
-@@ -131,9 +132,9 @@ void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
- }
-
- /**
-- * suspend_enter - enter the desired system sleep state.
-- * @state: State to enter
-- * @wakeup: Returns information that suspend should not be entered again.
-+ * suspend_enter - Make the system enter the given sleep state.
-+ * @state: System sleep state to enter.
-+ * @wakeup: Returns information that the sleep state should not be re-entered.
- *
- * This function should be called after devices have been suspended.
- */
-@@ -199,9 +200,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
- }
-
- /**
-- * suspend_devices_and_enter - suspend devices and enter the desired system
-- * sleep state.
-- * @state: state to enter
-+ * suspend_devices_and_enter - Suspend devices and enter system sleep state.
-+ * @state: System sleep state to enter.
- */
- int suspend_devices_and_enter(suspend_state_t state)
- {
-@@ -251,10 +251,10 @@ int suspend_devices_and_enter(suspend_state_t state)
- }
-
- /**
-- * suspend_finish - Do final work before exiting suspend sequence.
-+ * suspend_finish - Clean up before finishing the suspend sequence.
- *
-- * Call platform code to clean up, restart processes, and free the
-- * console that we've allocated. This is not called for suspend-to-disk.
-+ * Call platform code to clean up, restart processes, and free the console that
-+ * we've allocated. This routine is not called for hibernation.
- */
- static void suspend_finish(void)
- {
-@@ -265,14 +265,12 @@ static void suspend_finish(void)
- }
-
- /**
-- * enter_state - Do common work of entering low-power state.
-- * @state: pm_state structure for state we're entering.
-+ * enter_state - Do common work needed to enter system sleep state.
-+ * @state: System sleep state to enter.
- *
-- * Make sure we're the only ones trying to enter a sleep state. Fail
-- * if someone has beat us to it, since we don't want anything weird to
-- * happen when we wake up.
-- * Then, do the setup for suspend, enter the state, and cleaup (after
-- * we've woken up).
-+ * Make sure that no one else is trying to put the system into a sleep state.
-+ * Fail if that's not the case. Otherwise, prepare for system suspend, make the
-+ * system enter the given sleep state and clean up after wakeup.
- */
- int enter_state(suspend_state_t state)
- {
-@@ -310,11 +308,11 @@ int enter_state(suspend_state_t state)
- }
-
- /**
-- * pm_suspend - Externally visible function for suspending system.
-- * @state: Enumerated value of state to enter.
-+ * pm_suspend - Externally visible function for suspending the system.
-+ * @state: System sleep state to enter.
- *
-- * Determine whether or not value is within range, get state
-- * structure, and enter (above).
-+ * Check if the value of @state represents one of the supported states,
-+ * execute enter_state() and update system suspend statistics.
- */
- int pm_suspend(suspend_state_t state)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0193-PM-Sleep-Make-enter_state-in-kernel-power-suspend.c-.patch b/patches.runtime_pm/0193-PM-Sleep-Make-enter_state-in-kernel-power-suspend.c-.patch
deleted file mode 100644
index 32530fac160d45..00000000000000
--- a/patches.runtime_pm/0193-PM-Sleep-Make-enter_state-in-kernel-power-suspend.c-.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From e63cf3569f9135e10ee055a63a7dcbeeb00c1678 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 13 Feb 2012 16:29:24 +0100
-Subject: PM / Sleep: Make enter_state() in kernel/power/suspend.c static
-
-The enter_state() function in kernel/power/suspend.c should be
-static and state_store() in kernel/power/suspend.c should call
-pm_suspend() instead of it, so make that happen (which also reduces
-code duplication related to suspend statistics).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit 93e1ee43a72b11e1b50aab87046c131a836a4456)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/main.c | 8 +++-----
- kernel/power/power.h | 2 --
- kernel/power/suspend.c | 2 +-
- 3 files changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index b1e3248..1c12581 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -291,12 +291,10 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
-
- #ifdef CONFIG_SUSPEND
- for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
-- if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
-+ if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) {
-+ error = pm_suspend(state);
- break;
-- }
-- if (state < PM_SUSPEND_MAX && *s) {
-- error = enter_state(state);
-- suspend_stats_update(error);
-+ }
- }
- #endif
-
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 398d42b..98f3622 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -177,13 +177,11 @@ extern const char *const pm_states[];
-
- extern bool valid_state(suspend_state_t state);
- extern int suspend_devices_and_enter(suspend_state_t state);
--extern int enter_state(suspend_state_t state);
- #else /* !CONFIG_SUSPEND */
- static inline int suspend_devices_and_enter(suspend_state_t state)
- {
- return -ENOSYS;
- }
--static inline int enter_state(suspend_state_t state) { return -ENOSYS; }
- static inline bool valid_state(suspend_state_t state) { return false; }
- #endif /* !CONFIG_SUSPEND */
-
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index e6b5ef9..4914358 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -272,7 +272,7 @@ static void suspend_finish(void)
- * Fail if that's not the case. Otherwise, prepare for system suspend, make the
- * system enter the given sleep state and clean up after wakeup.
- */
--int enter_state(suspend_state_t state)
-+static int enter_state(suspend_state_t state)
- {
- int error;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0194-PM-Sleep-Drop-suspend_stats_update.patch b/patches.runtime_pm/0194-PM-Sleep-Drop-suspend_stats_update.patch
deleted file mode 100644
index 0d77fd18f02176..00000000000000
--- a/patches.runtime_pm/0194-PM-Sleep-Drop-suspend_stats_update.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 0574d62c60934e0ea28337532f8ea85a8de63068 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 13 Feb 2012 16:29:33 +0100
-Subject: PM / Sleep: Drop suspend_stats_update()
-
-Since suspend_stats_update() is only called from pm_suspend(),
-move its code directly into that function and remove the static
-inline definition from include/linux/suspend.h. Clean_up
-pm_suspend() in the process.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-(cherry picked from commit bc25cf508942c56810d4fb623ef27b56ccef7783)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/suspend.h | 16 ----------------
- kernel/power/suspend.c | 18 ++++++++++++------
- 2 files changed, 12 insertions(+), 22 deletions(-)
-
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index ec59fb0..43f0421 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -94,22 +94,6 @@ static inline void dpm_save_failed_step(enum suspend_stat_step step)
- }
-
- /**
-- * suspend_stats_update - Update success/failure statistics of suspend-to-ram
-- *
-- * @error: Value returned by enter_state() function
-- */
--static inline void suspend_stats_update(int error)
--{
-- if (error) {
-- suspend_stats.fail++;
-- dpm_save_failed_errno(error);
-- } else {
-- suspend_stats.success++;
-- }
--}
--
--
--/**
- * struct platform_suspend_ops - Callbacks for managing platform dependent
- * system sleep states.
- *
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 4914358..88e5c96 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -316,12 +316,18 @@ static int enter_state(suspend_state_t state)
- */
- int pm_suspend(suspend_state_t state)
- {
-- int ret;
-- if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) {
-- ret = enter_state(state);
-- suspend_stats_update(ret);
-- return ret;
-+ int error;
-+
-+ if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
-+ return -EINVAL;
-+
-+ error = enter_state(state);
-+ if (error) {
-+ suspend_stats.fail++;
-+ dpm_save_failed_errno(error);
-+ } else {
-+ suspend_stats.success++;
- }
-- return -EINVAL;
-+ return error;
- }
- EXPORT_SYMBOL(pm_suspend);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0195-PM-Add-comment-describing-relationships-between-PM-c.patch b/patches.runtime_pm/0195-PM-Add-comment-describing-relationships-between-PM-c.patch
deleted file mode 100644
index 152482458fc43b..00000000000000
--- a/patches.runtime_pm/0195-PM-Add-comment-describing-relationships-between-PM-c.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 128b07acc4338764497410536d61c3e19056243d Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 13 Feb 2012 16:29:47 +0100
-Subject: PM: Add comment describing relationships between PM callbacks to
- pm.h
-
-The UNIVERSAL_DEV_PM_OPS() macro is slightly misleading, because it
-may suggest that it's a good idea to point runtime PM callback
-pointers to the same routines as system suspend/resume callbacks
-.suspend() and .resume(), which is not the case. For this reason,
-add a comment to include/linux/pm.h, next to the definition of
-UNIVERSAL_DEV_PM_OPS(), describing how device PM callbacks are
-related to each other.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c48825251cf5950da9d618144c4db6c130e6c0cd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm.h | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index 73c6105..d6dd6f6 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -320,6 +320,15 @@ const struct dev_pm_ops name = { \
- /*
- * Use this for defining a set of PM operations to be used in all situations
- * (sustem suspend, hibernation or runtime PM).
-+ * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should
-+ * be different from the corresponding runtime PM callbacks, .runtime_suspend(),
-+ * and .runtime_resume(), because .runtime_suspend() always works on an already
-+ * quiescent device, while .suspend() should assume that the device may be doing
-+ * something when it is called (it should ensure that the device will be
-+ * quiescent after it has returned). Therefore it's better to point the "late"
-+ * suspend and "early" resume callback pointers, .suspend_late() and
-+ * .resume_early(), to the same routines as .runtime_suspend() and
-+ * .runtime_resume(), respectively (and analogously for hibernation).
- */
- #define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
- const struct dev_pm_ops name = { \
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0196-PM-Hibernate-print-physical-addresses-consistently-w.patch b/patches.runtime_pm/0196-PM-Hibernate-print-physical-addresses-consistently-w.patch
deleted file mode 100644
index 16bae613269f8e..00000000000000
--- a/patches.runtime_pm/0196-PM-Hibernate-print-physical-addresses-consistently-w.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 3ac512d1edc96811715f8e35d7e66bed2dc23f16 Mon Sep 17 00:00:00 2001
-From: Bjorn Helgaas <bhelgaas@google.com>
-Date: Tue, 14 Feb 2012 22:20:52 +0100
-Subject: PM / Hibernate: print physical addresses consistently with other
- parts of kernel
-
-Print physical address info in a style consistent with the %pR style used
-elsewhere in the kernel.
-
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 69f1d475cc80c55121852b3030873cdd407fd31c)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/snapshot.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
-index 6a768e5..8e2e746 100644
---- a/kernel/power/snapshot.c
-+++ b/kernel/power/snapshot.c
-@@ -711,9 +711,10 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
- list_for_each_entry(region, &nosave_regions, list) {
- unsigned long pfn;
-
-- pr_debug("PM: Marking nosave pages: %016lx - %016lx\n",
-- region->start_pfn << PAGE_SHIFT,
-- region->end_pfn << PAGE_SHIFT);
-+ pr_debug("PM: Marking nosave pages: [mem %#010llx-%#010llx]\n",
-+ (unsigned long long) region->start_pfn << PAGE_SHIFT,
-+ ((unsigned long long) region->end_pfn << PAGE_SHIFT)
-+ - 1);
-
- for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++)
- if (pfn_valid(pfn)) {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0197-PM-Sleep-Fix-possible-infinite-loop-during-wakeup-so.patch b/patches.runtime_pm/0197-PM-Sleep-Fix-possible-infinite-loop-during-wakeup-so.patch
deleted file mode 100644
index caf02a3f31de11..00000000000000
--- a/patches.runtime_pm/0197-PM-Sleep-Fix-possible-infinite-loop-during-wakeup-so.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 93978bb39092e1f4118fc414f7b0f817858c30ec Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 17 Feb 2012 23:39:20 +0100
-Subject: PM / Sleep: Fix possible infinite loop during wakeup source
- destruction
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-If wakeup_source_destroy() is called for an active wakeup source that
-is never deactivated, it will spin forever. To prevent that from
-happening, make wakeup_source_destroy() call __pm_relax() for the
-wakeup source object it is about to free instead of waiting until
-it will be deactivated by someone else. However, for this to work
-it also needs to make sure that the timer function will not be
-executed after the final __pm_relax(), so make it run
-del_timer_sync() on the wakeup source's timer beforehand.
-
-Additionally, update the kerneldoc comment to document the
-requirement that __pm_stay_awake() and __pm_wakeup_event() must not
-be run in parallel with wakeup_source_destroy().
-
-Reported-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit d94aff87826ee6aa43032f4c0263482913f4e2c8)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/wakeup.c | 15 +++++----------
- 1 file changed, 5 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index 6e591a8..d279f46 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -74,22 +74,17 @@ EXPORT_SYMBOL_GPL(wakeup_source_create);
- /**
- * wakeup_source_destroy - Destroy a struct wakeup_source object.
- * @ws: Wakeup source to destroy.
-+ *
-+ * Callers must ensure that __pm_stay_awake() or __pm_wakeup_event() will never
-+ * be run in parallel with this function for the same wakeup source object.
- */
- void wakeup_source_destroy(struct wakeup_source *ws)
- {
- if (!ws)
- return;
-
-- spin_lock_irq(&ws->lock);
-- while (ws->active) {
-- spin_unlock_irq(&ws->lock);
--
-- schedule_timeout_interruptible(msecs_to_jiffies(TIMEOUT));
--
-- spin_lock_irq(&ws->lock);
-- }
-- spin_unlock_irq(&ws->lock);
--
-+ del_timer_sync(&ws->timer);
-+ __pm_relax(ws);
- kfree(ws->name);
- kfree(ws);
- }
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0198-PM-Sleep-Fix-race-conditions-related-to-wakeup-sourc.patch b/patches.runtime_pm/0198-PM-Sleep-Fix-race-conditions-related-to-wakeup-sourc.patch
deleted file mode 100644
index 21d7f4669daba2..00000000000000
--- a/patches.runtime_pm/0198-PM-Sleep-Fix-race-conditions-related-to-wakeup-sourc.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From ddd503dabe15f74329b9b5c13968ac4cd14bffe6 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Fri, 17 Feb 2012 23:39:33 +0100
-Subject: PM / Sleep: Fix race conditions related to wakeup source timer
- function
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-If __pm_wakeup_event() has been used (with a nonzero timeout) to
-report a wakeup event and then __pm_relax() immediately followed by
-__pm_stay_awake() is called or __pm_wakeup_event() is called once
-again for the same wakeup source object before its timer expires, the
-timer function pm_wakeup_timer_fn() may still be run as a result of
-the previous __pm_wakeup_event() call. In either of those cases it
-may mistakenly deactivate the wakeup source that has just been
-activated.
-
-To prevent that from happening, make wakeup_source_deactivate()
-clear the wakeup source's timer_expires field and make
-pm_wakeup_timer_fn() check if timer_expires is different from zero
-and if it's not in future before calling wakeup_source_deactivate()
-(if timer_expires is 0, it means that the timer has just been
-deleted and if timer_expires is in future, it means that the timer
-has just been rescheduled to a different time).
-
-Reported-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit da863cddd831b0f4bf2d067f8b75254f1be94590)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/wakeup.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index d279f46..b38bb9a 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -433,6 +433,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws)
- ws->max_time = duration;
-
- del_timer(&ws->timer);
-+ ws->timer_expires = 0;
-
- /*
- * Increment the counter of registered wakeup events and decrement the
-@@ -487,11 +488,22 @@ EXPORT_SYMBOL_GPL(pm_relax);
- * pm_wakeup_timer_fn - Delayed finalization of a wakeup event.
- * @data: Address of the wakeup source object associated with the event source.
- *
-- * Call __pm_relax() for the wakeup source whose address is stored in @data.
-+ * Call wakeup_source_deactivate() for the wakeup source whose address is stored
-+ * in @data if it is currently active and its timer has not been canceled and
-+ * the expiration time of the timer is not in future.
- */
- static void pm_wakeup_timer_fn(unsigned long data)
- {
-- __pm_relax((struct wakeup_source *)data);
-+ struct wakeup_source *ws = (struct wakeup_source *)data;
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&ws->lock, flags);
-+
-+ if (ws->active && ws->timer_expires
-+ && time_after_eq(jiffies, ws->timer_expires))
-+ wakeup_source_deactivate(ws);
-+
-+ spin_unlock_irqrestore(&ws->lock, flags);
- }
-
- /**
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0199-PM-Sleep-Add-more-wakeup-source-initialization-routi.patch b/patches.runtime_pm/0199-PM-Sleep-Add-more-wakeup-source-initialization-routi.patch
deleted file mode 100644
index a2d089417caf63..00000000000000
--- a/patches.runtime_pm/0199-PM-Sleep-Add-more-wakeup-source-initialization-routi.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From b27f07ce7cda0ac82f2f9907c51ea41ddb8f62f2 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 21 Feb 2012 23:47:56 +0100
-Subject: PM / Sleep: Add more wakeup source initialization routines
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The existing wakeup source initialization routines are not
-particularly useful for wakeup sources that aren't created by
-wakeup_source_create(), because their users have to open code
-filling the objects with zeros and setting their names. For this
-reason, introduce routines that can be used for initializing, for
-example, static wakeup source objects.
-
-Requested-by: Arve Hjønnevåg <arve@android.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 8671bbc1bd0442ef0eab27f7d56216431c490820)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/wakeup.c | 50 +++++++++++++++++++++++++++++++++++--------
- include/linux/pm_wakeup.h | 22 ++++++++++++++++++-
- 2 files changed, 62 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index b38bb9a..4ef3223 100644
---- a/drivers/base/power/wakeup.c
-+++ b/drivers/base/power/wakeup.c
-@@ -53,6 +53,23 @@ static void pm_wakeup_timer_fn(unsigned long data);
- static LIST_HEAD(wakeup_sources);
-
- /**
-+ * wakeup_source_prepare - Prepare a new wakeup source for initialization.
-+ * @ws: Wakeup source to prepare.
-+ * @name: Pointer to the name of the new wakeup source.
-+ *
-+ * Callers must ensure that the @name string won't be freed when @ws is still in
-+ * use.
-+ */
-+void wakeup_source_prepare(struct wakeup_source *ws, const char *name)
-+{
-+ if (ws) {
-+ memset(ws, 0, sizeof(*ws));
-+ ws->name = name;
-+ }
-+}
-+EXPORT_SYMBOL_GPL(wakeup_source_prepare);
-+
-+/**
- * wakeup_source_create - Create a struct wakeup_source object.
- * @name: Name of the new wakeup source.
- */
-@@ -60,31 +77,44 @@ struct wakeup_source *wakeup_source_create(const char *name)
- {
- struct wakeup_source *ws;
-
-- ws = kzalloc(sizeof(*ws), GFP_KERNEL);
-+ ws = kmalloc(sizeof(*ws), GFP_KERNEL);
- if (!ws)
- return NULL;
-
-- if (name)
-- ws->name = kstrdup(name, GFP_KERNEL);
--
-+ wakeup_source_prepare(ws, name ? kstrdup(name, GFP_KERNEL) : NULL);
- return ws;
- }
- EXPORT_SYMBOL_GPL(wakeup_source_create);
-
- /**
-- * wakeup_source_destroy - Destroy a struct wakeup_source object.
-- * @ws: Wakeup source to destroy.
-+ * wakeup_source_drop - Prepare a struct wakeup_source object for destruction.
-+ * @ws: Wakeup source to prepare for destruction.
- *
- * Callers must ensure that __pm_stay_awake() or __pm_wakeup_event() will never
- * be run in parallel with this function for the same wakeup source object.
- */
--void wakeup_source_destroy(struct wakeup_source *ws)
-+void wakeup_source_drop(struct wakeup_source *ws)
- {
- if (!ws)
- return;
-
- del_timer_sync(&ws->timer);
- __pm_relax(ws);
-+}
-+EXPORT_SYMBOL_GPL(wakeup_source_drop);
-+
-+/**
-+ * wakeup_source_destroy - Destroy a struct wakeup_source object.
-+ * @ws: Wakeup source to destroy.
-+ *
-+ * Use only for wakeup source objects created with wakeup_source_create().
-+ */
-+void wakeup_source_destroy(struct wakeup_source *ws)
-+{
-+ if (!ws)
-+ return;
-+
-+ wakeup_source_drop(ws);
- kfree(ws->name);
- kfree(ws);
- }
-@@ -147,8 +177,10 @@ EXPORT_SYMBOL_GPL(wakeup_source_register);
- */
- void wakeup_source_unregister(struct wakeup_source *ws)
- {
-- wakeup_source_remove(ws);
-- wakeup_source_destroy(ws);
-+ if (ws) {
-+ wakeup_source_remove(ws);
-+ wakeup_source_destroy(ws);
-+ }
- }
- EXPORT_SYMBOL_GPL(wakeup_source_unregister);
-
-diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
-index a32da96..d9f0511 100644
---- a/include/linux/pm_wakeup.h
-+++ b/include/linux/pm_wakeup.h
-@@ -41,7 +41,7 @@
- * @active: Status of the wakeup source.
- */
- struct wakeup_source {
-- char *name;
-+ const char *name;
- struct list_head entry;
- spinlock_t lock;
- struct timer_list timer;
-@@ -73,7 +73,9 @@ static inline bool device_may_wakeup(struct device *dev)
- }
-
- /* drivers/base/power/wakeup.c */
-+extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
- extern struct wakeup_source *wakeup_source_create(const char *name);
-+extern void wakeup_source_drop(struct wakeup_source *ws);
- extern void wakeup_source_destroy(struct wakeup_source *ws);
- extern void wakeup_source_add(struct wakeup_source *ws);
- extern void wakeup_source_remove(struct wakeup_source *ws);
-@@ -103,11 +105,16 @@ static inline bool device_can_wakeup(struct device *dev)
- return dev->power.can_wakeup;
- }
-
-+static inline void wakeup_source_prepare(struct wakeup_source *ws,
-+ const char *name) {}
-+
- static inline struct wakeup_source *wakeup_source_create(const char *name)
- {
- return NULL;
- }
-
-+static inline void wakeup_source_drop(struct wakeup_source *ws) {}
-+
- static inline void wakeup_source_destroy(struct wakeup_source *ws) {}
-
- static inline void wakeup_source_add(struct wakeup_source *ws) {}
-@@ -165,4 +172,17 @@ static inline void pm_wakeup_event(struct device *dev, unsigned int msec) {}
-
- #endif /* !CONFIG_PM_SLEEP */
-
-+static inline void wakeup_source_init(struct wakeup_source *ws,
-+ const char *name)
-+{
-+ wakeup_source_prepare(ws, name);
-+ wakeup_source_add(ws);
-+}
-+
-+static inline void wakeup_source_trash(struct wakeup_source *ws)
-+{
-+ wakeup_source_remove(ws);
-+ wakeup_source_drop(ws);
-+}
-+
- #endif /* _LINUX_PM_WAKEUP_H */
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0200-PM-Freezer-Remove-references-to-TIF_FREEZE-in-commen.patch b/patches.runtime_pm/0200-PM-Freezer-Remove-references-to-TIF_FREEZE-in-commen.patch
deleted file mode 100644
index af02390f33b1dd..00000000000000
--- a/patches.runtime_pm/0200-PM-Freezer-Remove-references-to-TIF_FREEZE-in-commen.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 17dc21d7e8b6f977d7bb35f7905a7be427e6c24e Mon Sep 17 00:00:00 2001
-From: Marcos Paulo de Souza <marcos.mage@gmail.com>
-Date: Tue, 21 Feb 2012 23:57:47 +0100
-Subject: PM / Freezer: Remove references to TIF_FREEZE in comments
-
-This patch removes all the references in the code about the TIF_FREEZE
-flag removed by commit a3201227f803ad7fd43180c5195dbe5a2bf998aa
-
- freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
-
-There still are some references to TIF_FREEZE in
-Documentation/power/freezing-of-tasks.txt, but it looks like that
-documentation needs more thorough work to reflect how the new
-freezer works, and hence merely removing the references to TIF_FREEZE
-won't really help. So I have not touched that part in this patch.
-
-Suggested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 37f08be11be9a7d9351fb1b9b408259519a126f3)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/exit.c | 2 +-
- kernel/freezer.c | 6 +++---
- kernel/power/process.c | 8 +++-----
- 3 files changed, 7 insertions(+), 9 deletions(-)
-
-diff --git a/kernel/exit.c b/kernel/exit.c
-index 437d0cf..eb96623 100644
---- a/kernel/exit.c
-+++ b/kernel/exit.c
-@@ -437,7 +437,7 @@ void daemonize(const char *name, ...)
- */
- exit_mm(current);
- /*
-- * We don't want to have TIF_FREEZE set if the system-wide hibernation
-+ * We don't want to get frozen, in case system-wide hibernation
- * or suspend transition begins right now.
- */
- current->flags |= (PF_NOFREEZE | PF_KTHREAD);
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index 9adeebe..82434ea 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -118,9 +118,9 @@ static void fake_signal_wake_up(struct task_struct *p)
- * freeze_task - send a freeze request to given task
- * @p: task to send the request to
- *
-- * If @p is freezing, the freeze request is sent by setting %TIF_FREEZE
-- * flag and either sending a fake signal to it or waking it up, depending
-- * on whether it has %PF_FREEZER_NOSIG set.
-+ * If @p is freezing, the freeze request is sent either by sending a fake
-+ * signal (if it's not a kernel thread) or waking it up (if it's a kernel
-+ * thread).
- *
- * RETURNS:
- * %false, if @p is not freezing or already frozen; %true, otherwise
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 6aeb5ef..0d2aeb2 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -53,11 +53,9 @@ static int try_to_freeze_tasks(bool user_only)
- * It is "frozen enough". If the task does wake
- * up, it will immediately call try_to_freeze.
- *
-- * Because freeze_task() goes through p's
-- * scheduler lock after setting TIF_FREEZE, it's
-- * guaranteed that either we see TASK_RUNNING or
-- * try_to_stop() after schedule() in ptrace/signal
-- * stop sees TIF_FREEZE.
-+ * Because freeze_task() goes through p's scheduler lock, it's
-+ * guaranteed that TASK_STOPPED/TRACED -> TASK_RUNNING
-+ * transition can't race with task state testing here.
- */
- if (!task_is_stopped_or_traced(p) &&
- !freezer_should_skip(p))
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0201-PM-Domains-Fix-include-for-PM_GENERIC_DOMAINS-n-case.patch b/patches.runtime_pm/0201-PM-Domains-Fix-include-for-PM_GENERIC_DOMAINS-n-case.patch
deleted file mode 100644
index 8c17fb809a238f..00000000000000
--- a/patches.runtime_pm/0201-PM-Domains-Fix-include-for-PM_GENERIC_DOMAINS-n-case.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From d0793693ca877b8614d64bcd70051351df4f6c44 Mon Sep 17 00:00:00 2001
-From: Magnus Damm <damm@opensource.se>
-Date: Sat, 25 Feb 2012 22:14:18 +0100
-Subject: PM / Domains: Fix include for PM_GENERIC_DOMAINS=n case
-
-Fix pm_genpd_init() arguments and make sure dev_gpd_data() and
-simple_qos_governor exist regardless of CONFIG_PM_GENERIC_DOMAINS
-setting.
-
-Signed-off-by: Magnus Damm <damm@opensource.se>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit b642631d38c28fefd1232a6b96713eb54b60130d)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_domain.h | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index e76cc9a..5c2bbc2 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -155,6 +155,10 @@ extern bool default_stop_ok(struct device *dev);
- extern struct dev_power_governor pm_domain_always_on_gov;
- #else
-
-+static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
-+{
-+ return ERR_PTR(-ENOSYS);
-+}
- static inline struct generic_pm_domain *dev_to_genpd(struct device *dev)
- {
- return ERR_PTR(-ENOSYS);
-@@ -195,7 +199,8 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
- {
- return -ENOSYS;
- }
--static inline void pm_genpd_init(struct generic_pm_domain *genpd, bool is_off)
-+static inline void pm_genpd_init(struct generic_pm_domain *genpd,
-+ struct dev_power_governor *gov, bool is_off)
- {
- }
- static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
-@@ -206,11 +211,8 @@ static inline bool default_stop_ok(struct device *dev)
- {
- return false;
- }
-+#define simple_qos_governor NULL
- #define pm_domain_always_on_gov NULL
--static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
--{
-- return NULL;
--}
- #endif
-
- static inline int pm_genpd_remove_callbacks(struct device *dev)
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0202-PM-QoS-Make-it-possible-to-expose-PM-QoS-latency-con.patch b/patches.runtime_pm/0202-PM-QoS-Make-it-possible-to-expose-PM-QoS-latency-con.patch
deleted file mode 100644
index 8a9f983a76711c..00000000000000
--- a/patches.runtime_pm/0202-PM-QoS-Make-it-possible-to-expose-PM-QoS-latency-con.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-From 93d69cf1fff51419dd636b72da27e92c62638682 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 13 Mar 2012 01:01:39 +0100
-Subject: PM / QoS: Make it possible to expose PM QoS latency constraints
-
-A runtime suspend of a device (e.g. an MMC controller) belonging to
-a power domain or, in a more complicated scenario, a runtime suspend
-of another device in the same power domain, may cause power to be
-removed from the entire domain. In that case, the amount of time
-necessary to runtime-resume the given device (e.g. the MMC
-controller) is often substantially greater than the time needed to
-run its driver's runtime resume callback. That may hurt performance
-in some situations, because user data may need to wait for the
-device to become operational, so we should make it possible to
-prevent that from happening.
-
-For this reason, introduce a new sysfs attribute for devices,
-power/pm_qos_resume_latency_us, allowing user space to specify the
-upper bound of the time necessary to bring the (runtime-suspended)
-device up after the resume of it has been requested. However, make
-that attribute appear only for the devices whose drivers declare
-support for it by calling the (new) dev_pm_qos_expose_latency_limit()
-helper function with the appropriate initial value of the attribute.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Reviewed-by: Kevin Hilman <khilman@ti.com>
-Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Acked-by: Linus Walleij <linus.walleij@linaro.org>
-(cherry picked from commit 85dc0b8a4019e38ad4fd0c008f89a5c241805ac2)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- Documentation/ABI/testing/sysfs-devices-power | 18 ++++++++
- drivers/base/power/power.h | 4 ++
- drivers/base/power/qos.c | 61 +++++++++++++++++++++++++
- drivers/base/power/sysfs.c | 47 +++++++++++++++++++
- include/linux/pm.h | 1 +
- include/linux/pm_qos.h | 9 ++++
- 6 files changed, 140 insertions(+)
-
-diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
-index 8ffbc25..840f7d6 100644
---- a/Documentation/ABI/testing/sysfs-devices-power
-+++ b/Documentation/ABI/testing/sysfs-devices-power
-@@ -165,3 +165,21 @@ Description:
-
- Not all drivers support this attribute. If it isn't supported,
- attempts to read or write it will yield I/O errors.
-+
-+What: /sys/devices/.../power/pm_qos_latency_us
-+Date: March 2012
-+Contact: Rafael J. Wysocki <rjw@sisk.pl>
-+Description:
-+ The /sys/devices/.../power/pm_qos_resume_latency_us attribute
-+ contains the PM QoS resume latency limit for the given device,
-+ which is the maximum allowed time it can take to resume the
-+ device, after it has been suspended at run time, from a resume
-+ request to the moment the device will be ready to process I/O,
-+ in microseconds. If it is equal to 0, however, this means that
-+ the PM QoS resume latency may be arbitrary.
-+
-+ Not all drivers support this attribute. If it isn't supported,
-+ it is not present.
-+
-+ This attribute has no effect on system-wide suspend/resume and
-+ hibernation.
-diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
-index 9bf6232..eeb4bff 100644
---- a/drivers/base/power/power.h
-+++ b/drivers/base/power/power.h
-@@ -71,6 +71,8 @@ extern void dpm_sysfs_remove(struct device *dev);
- extern void rpm_sysfs_remove(struct device *dev);
- extern int wakeup_sysfs_add(struct device *dev);
- extern void wakeup_sysfs_remove(struct device *dev);
-+extern int pm_qos_sysfs_add(struct device *dev);
-+extern void pm_qos_sysfs_remove(struct device *dev);
-
- #else /* CONFIG_PM */
-
-@@ -79,5 +81,7 @@ static inline void dpm_sysfs_remove(struct device *dev) {}
- static inline void rpm_sysfs_remove(struct device *dev) {}
- static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
- static inline void wakeup_sysfs_remove(struct device *dev) {}
-+static inline int pm_qos_sysfs_add(struct device *dev) { return 0; }
-+static inline void pm_qos_sysfs_remove(struct device *dev) {}
-
- #endif
-diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
-index c5d3588..7185557 100644
---- a/drivers/base/power/qos.c
-+++ b/drivers/base/power/qos.c
-@@ -41,6 +41,7 @@
- #include <linux/mutex.h>
- #include <linux/export.h>
-
-+#include "power.h"
-
- static DEFINE_MUTEX(dev_pm_qos_mtx);
-
-@@ -166,6 +167,12 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
- struct dev_pm_qos_request *req, *tmp;
- struct pm_qos_constraints *c;
-
-+ /*
-+ * If the device's PM QoS resume latency limit has been exposed to user
-+ * space, it has to be hidden at this point.
-+ */
-+ dev_pm_qos_hide_latency_limit(dev);
-+
- mutex_lock(&dev_pm_qos_mtx);
-
- dev->power.power_state = PMSG_INVALID;
-@@ -445,3 +452,57 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
- return error;
- }
- EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
-+
-+#ifdef CONFIG_PM_RUNTIME
-+static void __dev_pm_qos_drop_user_request(struct device *dev)
-+{
-+ dev_pm_qos_remove_request(dev->power.pq_req);
-+ dev->power.pq_req = 0;
-+}
-+
-+/**
-+ * dev_pm_qos_expose_latency_limit - Expose PM QoS latency limit to user space.
-+ * @dev: Device whose PM QoS latency limit is to be exposed to user space.
-+ * @value: Initial value of the latency limit.
-+ */
-+int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
-+{
-+ struct dev_pm_qos_request *req;
-+ int ret;
-+
-+ if (!device_is_registered(dev) || value < 0)
-+ return -EINVAL;
-+
-+ if (dev->power.pq_req)
-+ return -EEXIST;
-+
-+ req = kzalloc(sizeof(*req), GFP_KERNEL);
-+ if (!req)
-+ return -ENOMEM;
-+
-+ ret = dev_pm_qos_add_request(dev, req, value);
-+ if (ret < 0)
-+ return ret;
-+
-+ dev->power.pq_req = req;
-+ ret = pm_qos_sysfs_add(dev);
-+ if (ret)
-+ __dev_pm_qos_drop_user_request(dev);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_expose_latency_limit);
-+
-+/**
-+ * dev_pm_qos_hide_latency_limit - Hide PM QoS latency limit from user space.
-+ * @dev: Device whose PM QoS latency limit is to be hidden from user space.
-+ */
-+void dev_pm_qos_hide_latency_limit(struct device *dev)
-+{
-+ if (dev->power.pq_req) {
-+ pm_qos_sysfs_remove(dev);
-+ __dev_pm_qos_drop_user_request(dev);
-+ }
-+}
-+EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_limit);
-+#endif /* CONFIG_PM_RUNTIME */
-diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
-index ac63d48..7f3d5d8 100644
---- a/drivers/base/power/sysfs.c
-+++ b/drivers/base/power/sysfs.c
-@@ -5,6 +5,7 @@
- #include <linux/device.h>
- #include <linux/string.h>
- #include <linux/export.h>
-+#include <linux/pm_qos.h>
- #include <linux/pm_runtime.h>
- #include <asm/atomic.h>
- #include <linux/jiffies.h>
-@@ -217,6 +218,31 @@ static ssize_t autosuspend_delay_ms_store(struct device *dev,
- static DEVICE_ATTR(autosuspend_delay_ms, 0644, autosuspend_delay_ms_show,
- autosuspend_delay_ms_store);
-
-+static ssize_t pm_qos_latency_show(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ return sprintf(buf, "%d\n", dev->power.pq_req->node.prio);
-+}
-+
-+static ssize_t pm_qos_latency_store(struct device *dev,
-+ struct device_attribute *attr,
-+ const char *buf, size_t n)
-+{
-+ s32 value;
-+ int ret;
-+
-+ if (kstrtos32(buf, 0, &value))
-+ return -EINVAL;
-+
-+ if (value < 0)
-+ return -EINVAL;
-+
-+ ret = dev_pm_qos_update_request(dev->power.pq_req, value);
-+ return ret < 0 ? ret : n;
-+}
-+
-+static DEVICE_ATTR(pm_qos_resume_latency_us, 0644,
-+ pm_qos_latency_show, pm_qos_latency_store);
- #endif /* CONFIG_PM_RUNTIME */
-
- #ifdef CONFIG_PM_SLEEP
-@@ -490,6 +516,17 @@ static struct attribute_group pm_runtime_attr_group = {
- .attrs = runtime_attrs,
- };
-
-+static struct attribute *pm_qos_attrs[] = {
-+#ifdef CONFIG_PM_RUNTIME
-+ &dev_attr_pm_qos_resume_latency_us.attr,
-+#endif /* CONFIG_PM_RUNTIME */
-+ NULL,
-+};
-+static struct attribute_group pm_qos_attr_group = {
-+ .name = power_group_name,
-+ .attrs = pm_qos_attrs,
-+};
-+
- int dpm_sysfs_add(struct device *dev)
- {
- int rc;
-@@ -530,6 +567,16 @@ void wakeup_sysfs_remove(struct device *dev)
- sysfs_unmerge_group(&dev->kobj, &pm_wakeup_attr_group);
- }
-
-+int pm_qos_sysfs_add(struct device *dev)
-+{
-+ return sysfs_merge_group(&dev->kobj, &pm_qos_attr_group);
-+}
-+
-+void pm_qos_sysfs_remove(struct device *dev)
-+{
-+ sysfs_unmerge_group(&dev->kobj, &pm_qos_attr_group);
-+}
-+
- void rpm_sysfs_remove(struct device *dev)
- {
- sysfs_unmerge_group(&dev->kobj, &pm_runtime_attr_group);
-diff --git a/include/linux/pm.h b/include/linux/pm.h
-index d6dd6f6..715305e 100644
---- a/include/linux/pm.h
-+++ b/include/linux/pm.h
-@@ -546,6 +546,7 @@ struct dev_pm_info {
- unsigned long accounting_timestamp;
- ktime_t suspend_time;
- s64 max_time_suspended_ns;
-+ struct dev_pm_qos_request *pq_req;
- #endif
- struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
- struct pm_qos_constraints *constraints;
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index c8a541e..2e9191a 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -137,4 +137,13 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
- { return 0; }
- #endif
-
-+#ifdef CONFIG_PM_RUNTIME
-+int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
-+void dev_pm_qos_hide_latency_limit(struct device *dev);
-+#else
-+static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
-+ { return 0; }
-+static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {}
-+#endif
-+
- #endif
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0203-PM-Domains-Fix-handling-of-wakeup-devices-during-sys.patch b/patches.runtime_pm/0203-PM-Domains-Fix-handling-of-wakeup-devices-during-sys.patch
deleted file mode 100644
index 42d58443378561..00000000000000
--- a/patches.runtime_pm/0203-PM-Domains-Fix-handling-of-wakeup-devices-during-sys.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 6993891333e6d261a80c7ef73066d993f473c4da Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 13 Mar 2012 22:39:31 +0100
-Subject: PM / Domains: Fix handling of wakeup devices during system resume
-
-During system suspend pm_genpd_suspend_noirq() checks if the given
-device is in a wakeup path (i.e. it appears to be needed for one or
-more wakeup devices to work or is a wakeup device itself) and if it
-needs to be "active" for wakeup to work. If that is the case, the
-function returns 0 without incrementing the device domain's counter
-of suspended devices and without executing genpd_stop_dev() for the
-device. In consequence, the device is not stopped (e.g. its clock
-isn't disabled) and power is always supplied to its domain in the
-resulting system sleep state.
-
-However, pm_genpd_resume_noirq() doesn't repeat that check and it
-runs genpd_start_dev() and decrements the domain's counter of
-suspended devices even for the wakeup device that weren't stopped by
-pm_genpd_suspend_noirq(). As a result, the start callback may be run
-unnecessarily for them and their domains' counters of suspended
-devices may become negative. Both outcomes aren't desirable, so fix
-pm_genpd_resume_noirq() to look for wakeup devices that might not be
-stopped by during system suspend.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Tested-by: Simon Horman <horms@verge.net.au>
-Cc: stable@vger.kernel.org
-(cherry picked from commit cc85b20780562d404e18a47b9b55b4a5102ae53e)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index d2c0323..e79228c 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -890,7 +890,8 @@ static int pm_genpd_resume_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off)
-+ if (genpd->suspend_power_off
-+ || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
- return 0;
-
- /*
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0204-PM-Domains-Fix-hibernation-restore-of-devices-v2.patch b/patches.runtime_pm/0204-PM-Domains-Fix-hibernation-restore-of-devices-v2.patch
deleted file mode 100644
index a8b4e476727e27..00000000000000
--- a/patches.runtime_pm/0204-PM-Domains-Fix-hibernation-restore-of-devices-v2.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From beb3fd5a129cc47ded8c0b7ece93597d6188ad91 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 13 Mar 2012 22:39:37 +0100
-Subject: PM / Domains: Fix hibernation restore of devices, v2
-
-During resume from hibernation pm_genpd_restore_noirq() should only
-power off domains whose suspend_power_off flags are set once and
-not every time it is called for a device in the given domain.
-Moreover, it shouldn't decrement genpd->suspended_count, because
-that field is not touched during device freezing and therefore it is
-always equal to 0 when pm_genpd_restore_noirq() runs for the first
-device in the given domain.
-
-This means pm_genpd_restore_noirq() may use genpd->suspended_count
-to determine whether or not it it has been called for the domain in
-question already in this cycle (it only needs to increment that
-field every time it runs for this purpose) and whether or not it
-should check if the domain needs to be powered off. For that to
-work, though, pm_genpd_prepare() has to clear genpd->suspended_count
-when it runs for the first device in the given domain (in which case
-that flag need not be cleared during domain initialization).
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Cc: stable@vger.kernel.org
-(cherry picked from commit 65533bbf63b4f37723fdfedc73d0653958973323)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 31 +++++++++++++++++++++----------
- 1 file changed, 21 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index e79228c..84f4bee 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -764,8 +764,10 @@ static int pm_genpd_prepare(struct device *dev)
-
- genpd_acquire_lock(genpd);
-
-- if (genpd->prepared_count++ == 0)
-+ if (genpd->prepared_count++ == 0) {
-+ genpd->suspended_count = 0;
- genpd->suspend_power_off = genpd->status == GPD_STATE_POWER_OFF;
-+ }
-
- genpd_release_lock(genpd);
-
-@@ -1097,20 +1099,30 @@ static int pm_genpd_restore_noirq(struct device *dev)
- * Since all of the "noirq" callbacks are executed sequentially, it is
- * guaranteed that this function will never run twice in parallel for
- * the same PM domain, so it is not necessary to use locking here.
-+ *
-+ * At this point suspended_count == 0 means we are being run for the
-+ * first time for the given domain in the present cycle.
- */
-- genpd->status = GPD_STATE_POWER_OFF;
-- if (genpd->suspend_power_off) {
-+ if (genpd->suspended_count++ == 0) {
- /*
-- * The boot kernel might put the domain into the power on state,
-- * so make sure it really is powered off.
-+ * The boot kernel might put the domain into arbitrary state,
-+ * so make it appear as powered off to pm_genpd_poweron(), so
-+ * that it tries to power it on in case it was really off.
- */
-- if (genpd->power_off)
-- genpd->power_off(genpd);
-- return 0;
-+ genpd->status = GPD_STATE_POWER_OFF;
-+ if (genpd->suspend_power_off) {
-+ /*
-+ * If the domain was off before the hibernation, make
-+ * sure it will be off going forward.
-+ */
-+ if (genpd->power_off)
-+ genpd->power_off(genpd);
-+
-+ return 0;
-+ }
- }
-
- pm_genpd_poweron(genpd);
-- genpd->suspended_count--;
-
- return genpd_start_dev(genpd, dev);
- }
-@@ -1649,7 +1661,6 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
- genpd->poweroff_task = NULL;
- genpd->resume_count = 0;
- genpd->device_count = 0;
-- genpd->suspended_count = 0;
- genpd->max_off_time_ns = -1;
- genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
- genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume;
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0205-PM-Domains-Introduce-always-on-device-flag.patch b/patches.runtime_pm/0205-PM-Domains-Introduce-always-on-device-flag.patch
deleted file mode 100644
index ec38c85c29b194..00000000000000
--- a/patches.runtime_pm/0205-PM-Domains-Introduce-always-on-device-flag.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From d3ade56cdfb6d8f10e32198ba9f998396189a885 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Tue, 13 Mar 2012 22:39:48 +0100
-Subject: PM / Domains: Introduce "always on" device flag
-
-The TMU device on the Mackerel board belongs to the A4R power domain
-and loses power when the domain is turned off. Unfortunately, the
-TMU driver is not prepared to cope with such situations and crashes
-the system when that happens. To work around this problem introduce
-a new helper function, pm_genpd_dev_always_on(), allowing a device
-driver to mark its device as "always on" in case it belongs to a PM
-domain, which will make the generic PM domains core code avoid
-powering off the domain containing the device, both at run time and
-during system suspend.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Tested-by: Simon Horman <horms@verge.net.au>
-Acked-by: Paul Mundt <lethal@linux-sh.org>
-Cc: stable@vger.kernel.org
-(cherry picked from commit 1e78a0c7fc92aee076965d516cf54475c39e9894)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 37 +++++++++++++++++++++++++++++++------
- include/linux/pm_domain.h | 3 +++
- 2 files changed, 34 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 84f4bee..b6ff6ec 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -366,7 +366,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
- not_suspended = 0;
- list_for_each_entry(pdd, &genpd->dev_list, list_node)
- if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev)
-- || pdd->dev->power.irq_safe))
-+ || pdd->dev->power.irq_safe || to_gpd_data(pdd)->always_on))
- not_suspended++;
-
- if (not_suspended > genpd->in_progress)
-@@ -503,6 +503,9 @@ static int pm_genpd_runtime_suspend(struct device *dev)
-
- might_sleep_if(!genpd->dev_irq_safe);
-
-+ if (dev_gpd_data(dev)->always_on)
-+ return -EBUSY;
-+
- stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
- if (stop_ok && !stop_ok(dev))
- return -EBUSY;
-@@ -859,7 +862,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off
-+ if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on
- || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
- return 0;
-
-@@ -892,7 +895,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- if (genpd->suspend_power_off
-+ if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on
- || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
- return 0;
-
-@@ -1012,7 +1015,8 @@ static int pm_genpd_freeze_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev);
-+ return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ?
-+ 0 : genpd_stop_dev(genpd, dev);
- }
-
- /**
-@@ -1032,7 +1036,8 @@ static int pm_genpd_thaw_noirq(struct device *dev)
- if (IS_ERR(genpd))
- return -EINVAL;
-
-- return genpd->suspend_power_off ? 0 : genpd_start_dev(genpd, dev);
-+ return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ?
-+ 0 : genpd_start_dev(genpd, dev);
- }
-
- /**
-@@ -1124,7 +1129,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
-
- pm_genpd_poweron(genpd);
-
-- return genpd_start_dev(genpd, dev);
-+ return dev_gpd_data(dev)->always_on ? 0 : genpd_start_dev(genpd, dev);
- }
-
- /**
-@@ -1320,6 +1325,26 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- }
-
- /**
-+ * pm_genpd_dev_always_on - Set/unset the "always on" flag for a given device.
-+ * @dev: Device to set/unset the flag for.
-+ * @val: The new value of the device's "always on" flag.
-+ */
-+void pm_genpd_dev_always_on(struct device *dev, bool val)
-+{
-+ struct pm_subsys_data *psd;
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&dev->power.lock, flags);
-+
-+ psd = dev_to_psd(dev);
-+ if (psd && psd->domain_data)
-+ to_gpd_data(psd->domain_data)->always_on = val;
-+
-+ spin_unlock_irqrestore(&dev->power.lock, flags);
-+}
-+EXPORT_SYMBOL_GPL(pm_genpd_dev_always_on);
-+
-+/**
- * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
- * @genpd: Master PM domain to add the subdomain to.
- * @subdomain: Subdomain to be added.
-diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 5c2bbc2..1236d26 100644
---- a/include/linux/pm_domain.h
-+++ b/include/linux/pm_domain.h
-@@ -99,6 +99,7 @@ struct generic_pm_domain_data {
- struct gpd_dev_ops ops;
- struct gpd_timing_data td;
- bool need_restore;
-+ bool always_on;
- };
-
- #ifdef CONFIG_PM_GENERIC_DOMAINS
-@@ -137,6 +138,7 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
-
- extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- struct device *dev);
-+extern void pm_genpd_dev_always_on(struct device *dev, bool val);
- extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *new_subdomain);
- extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
-@@ -179,6 +181,7 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
- {
- return -ENOSYS;
- }
-+static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {}
- static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
- struct generic_pm_domain *new_sd)
- {
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0206-PM-Domains-Check-domain-status-during-hibernation-re.patch b/patches.runtime_pm/0206-PM-Domains-Check-domain-status-during-hibernation-re.patch
deleted file mode 100644
index 57cb29bdd35717..00000000000000
--- a/patches.runtime_pm/0206-PM-Domains-Check-domain-status-during-hibernation-re.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 264e68cf49260d40ee819c43c38fe763c4955442 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Mon, 19 Mar 2012 10:38:14 +0100
-Subject: PM / Domains: Check domain status during hibernation restore of
- devices
-
-Power domains that were off before hibernation shouldn't be turned on
-during device restore, so prevent that from happening.
-
-This change fixes up commit 65533bbf63b4f37723fdfedc73d0653958973323
-
- PM / Domains: Fix hibernation restore of devices, v2
-
-that didn't include it by mistake.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit 18dd2ece3cde14cfd42e95a89eb14016699a5f15)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/domain.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index b6ff6ec..73ce9fb 100644
---- a/drivers/base/power/domain.c
-+++ b/drivers/base/power/domain.c
-@@ -1127,6 +1127,9 @@ static int pm_genpd_restore_noirq(struct device *dev)
- }
- }
-
-+ if (genpd->suspend_power_off)
-+ return 0;
-+
- pm_genpd_poweron(genpd);
-
- return dev_gpd_data(dev)->always_on ? 0 : genpd_start_dev(genpd, dev);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0207-PM-Runtime-don-t-forget-to-wake-up-waitqueue-on-fail.patch b/patches.runtime_pm/0207-PM-Runtime-don-t-forget-to-wake-up-waitqueue-on-fail.patch
deleted file mode 100644
index 0704462c55724f..00000000000000
--- a/patches.runtime_pm/0207-PM-Runtime-don-t-forget-to-wake-up-waitqueue-on-fail.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d8f3d391ef39a0fd57c67ecd770d3c7ac48294a1 Mon Sep 17 00:00:00 2001
-From: Alan Stern <stern@rowland.harvard.edu>
-Date: Mon, 26 Mar 2012 22:46:52 +0200
-Subject: PM / Runtime: don't forget to wake up waitqueue on failure
-
-This patch (as1535) fixes a bug in the runtime PM core. When a
-runtime suspend attempt completes, whether successfully or not, the
-device's power.wait_queue is supposed to be signalled. But this
-doesn't happen in the failure pathway of rpm_suspend() when another
-autosuspend attempt is rescheduled. As a result, a task can get stuck
-indefinitely on the wait queue (I have seen this happen in testing).
-
-The patch fixes the problem by moving the wake_up_all() call up near
-the start of the failure code.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-CC: <stable@vger.kernel.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit f2791d733a2f06997b573d1a3cfde21e6f529826)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- drivers/base/power/runtime.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index 541f821..bd0f394 100644
---- a/drivers/base/power/runtime.c
-+++ b/drivers/base/power/runtime.c
-@@ -532,6 +532,8 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- dev->power.suspend_time = ktime_set(0, 0);
- dev->power.max_time_suspended_ns = -1;
- dev->power.deferred_resume = false;
-+ wake_up_all(&dev->power.wait_queue);
-+
- if (retval == -EAGAIN || retval == -EBUSY) {
- dev->power.runtime_error = 0;
-
-@@ -547,7 +549,6 @@ static int rpm_suspend(struct device *dev, int rpmflags)
- } else {
- pm_runtime_cancel_pending(dev);
- }
-- wake_up_all(&dev->power.wait_queue);
- goto out;
- }
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0208-PM-Hibernate-Disable-usermode-helpers-right-before-f.patch b/patches.runtime_pm/0208-PM-Hibernate-Disable-usermode-helpers-right-before-f.patch
deleted file mode 100644
index a1cbfb4c97c5d0..00000000000000
--- a/patches.runtime_pm/0208-PM-Hibernate-Disable-usermode-helpers-right-before-f.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From e6b0b85e018ebd712c50402d9850afe725edc618 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 28 Mar 2012 23:30:14 +0200
-Subject: PM / Hibernate: Disable usermode helpers right before freezing tasks
-
-There is no reason to call usermodehelper_disable() before creating
-memory bitmaps in hibernate() and software_resume(), so call it right
-before freeze_processes(), in accordance with the other suspend and
-hibernation code. Consequently, call usermodehelper_enable() right
-after the thawing of tasks rather than after freeing the memory
-bitmaps.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Cc: stable@vger.kernel.org
-(cherry picked from commit 7b5179ac14dbad945647ac9e76bbbf14ed9e0dbe)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 23 ++++++++++-------------
- 1 file changed, 10 insertions(+), 13 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 0a186cf..639ff6e 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -611,19 +611,19 @@ int hibernate(void)
- if (error)
- goto Exit;
-
-- error = usermodehelper_disable();
-- if (error)
-- goto Exit;
--
- /* Allocate memory management structures */
- error = create_basic_memory_bitmaps();
- if (error)
-- goto Enable_umh;
-+ goto Exit;
-
- printk(KERN_INFO "PM: Syncing filesystems ... ");
- sys_sync();
- printk("done.\n");
-
-+ error = usermodehelper_disable();
-+ if (error)
-+ goto Exit;
-+
- error = freeze_processes();
- if (error)
- goto Free_bitmaps;
-@@ -660,9 +660,8 @@ int hibernate(void)
- freezer_test_done = false;
-
- Free_bitmaps:
-- free_basic_memory_bitmaps();
-- Enable_umh:
- usermodehelper_enable();
-+ free_basic_memory_bitmaps();
- Exit:
- pm_notifier_call_chain(PM_POST_HIBERNATION);
- pm_restore_console();
-@@ -777,15 +776,13 @@ static int software_resume(void)
- if (error)
- goto close_finish;
-
-- error = usermodehelper_disable();
-+ error = create_basic_memory_bitmaps();
- if (error)
- goto close_finish;
-
-- error = create_basic_memory_bitmaps();
-- if (error) {
-- usermodehelper_enable();
-+ error = usermodehelper_disable();
-+ if (error)
- goto close_finish;
-- }
-
- pr_debug("PM: Preparing processes for restore.\n");
- error = freeze_processes();
-@@ -805,8 +802,8 @@ static int software_resume(void)
- swsusp_free();
- thaw_processes();
- Done:
-- free_basic_memory_bitmaps();
- usermodehelper_enable();
-+ free_basic_memory_bitmaps();
- Finish:
- pm_notifier_call_chain(PM_POST_RESTORE);
- pm_restore_console();
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0209-PM-Sleep-Move-disabling-of-usermode-helpers-to-the-f.patch b/patches.runtime_pm/0209-PM-Sleep-Move-disabling-of-usermode-helpers-to-the-f.patch
deleted file mode 100644
index 242b046b43c564..00000000000000
--- a/patches.runtime_pm/0209-PM-Sleep-Move-disabling-of-usermode-helpers-to-the-f.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From af996e4f80cea15bc92578f2dbc358e29cc6e9c0 Mon Sep 17 00:00:00 2001
-From: "Rafael J. Wysocki" <rjw@sisk.pl>
-Date: Wed, 28 Mar 2012 23:30:21 +0200
-Subject: PM / Sleep: Move disabling of usermode helpers to the freezer
-
-The core suspend/hibernation code calls usermodehelper_disable() to
-avoid race conditions between the freezer and the starting of
-usermode helpers and each code path has to do that on its own.
-However, it is always called right before freeze_processes()
-and usermodehelper_enable() is always called right after
-thaw_processes(). For this reason, to avoid code duplication and
-to make the connection between usermodehelper_disable() and the
-freezer more visible, make freeze_processes() call it and remove the
-direct usermodehelper_disable() and usermodehelper_enable() calls
-from all suspend/hibernation code paths.
-
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Cc: stable@vger.kernel.org
-(cherry picked from commit 1e73203cd1157a03facc41ffb54050f5b28e55bd)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- kernel/power/hibernate.c | 11 -----------
- kernel/power/process.c | 7 +++++++
- kernel/power/suspend.c | 7 -------
- kernel/power/user.c | 10 +---------
- 4 files changed, 8 insertions(+), 27 deletions(-)
-
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index 639ff6e..e09dfbf 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -16,7 +16,6 @@
- #include <linux/string.h>
- #include <linux/device.h>
- #include <linux/async.h>
--#include <linux/kmod.h>
- #include <linux/delay.h>
- #include <linux/fs.h>
- #include <linux/mount.h>
-@@ -620,10 +619,6 @@ int hibernate(void)
- sys_sync();
- printk("done.\n");
-
-- error = usermodehelper_disable();
-- if (error)
-- goto Exit;
--
- error = freeze_processes();
- if (error)
- goto Free_bitmaps;
-@@ -660,7 +655,6 @@ int hibernate(void)
- freezer_test_done = false;
-
- Free_bitmaps:
-- usermodehelper_enable();
- free_basic_memory_bitmaps();
- Exit:
- pm_notifier_call_chain(PM_POST_HIBERNATION);
-@@ -780,10 +774,6 @@ static int software_resume(void)
- if (error)
- goto close_finish;
-
-- error = usermodehelper_disable();
-- if (error)
-- goto close_finish;
--
- pr_debug("PM: Preparing processes for restore.\n");
- error = freeze_processes();
- if (error) {
-@@ -802,7 +792,6 @@ static int software_resume(void)
- swsusp_free();
- thaw_processes();
- Done:
-- usermodehelper_enable();
- free_basic_memory_bitmaps();
- Finish:
- pm_notifier_call_chain(PM_POST_RESTORE);
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 0d2aeb2..56eaac7 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -16,6 +16,7 @@
- #include <linux/freezer.h>
- #include <linux/delay.h>
- #include <linux/workqueue.h>
-+#include <linux/kmod.h>
-
- /*
- * Timeout for stopping processes
-@@ -122,6 +123,10 @@ int freeze_processes(void)
- {
- int error;
-
-+ error = usermodehelper_disable();
-+ if (error)
-+ return error;
-+
- if (!pm_freezing)
- atomic_inc(&system_freezing_cnt);
-
-@@ -187,6 +192,8 @@ void thaw_processes(void)
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
-
-+ usermodehelper_enable();
-+
- schedule();
- printk("done.\n");
- }
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index 88e5c96..396d262 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -12,7 +12,6 @@
- #include <linux/delay.h>
- #include <linux/errno.h>
- #include <linux/init.h>
--#include <linux/kmod.h>
- #include <linux/console.h>
- #include <linux/cpu.h>
- #include <linux/syscalls.h>
-@@ -102,17 +101,12 @@ static int suspend_prepare(void)
- if (error)
- goto Finish;
-
-- error = usermodehelper_disable();
-- if (error)
-- goto Finish;
--
- error = suspend_freeze_processes();
- if (!error)
- return 0;
-
- suspend_stats.failed_freeze++;
- dpm_save_failed_step(SUSPEND_FREEZE);
-- usermodehelper_enable();
- Finish:
- pm_notifier_call_chain(PM_POST_SUSPEND);
- pm_restore_console();
-@@ -259,7 +253,6 @@ int suspend_devices_and_enter(suspend_state_t state)
- static void suspend_finish(void)
- {
- suspend_thaw_processes();
-- usermodehelper_enable();
- pm_notifier_call_chain(PM_POST_SUSPEND);
- pm_restore_console();
- }
-diff --git a/kernel/power/user.c b/kernel/power/user.c
-index 33c4329..91b0fd0 100644
---- a/kernel/power/user.c
-+++ b/kernel/power/user.c
-@@ -12,7 +12,6 @@
- #include <linux/suspend.h>
- #include <linux/syscalls.h>
- #include <linux/reboot.h>
--#include <linux/kmod.h>
- #include <linux/string.h>
- #include <linux/device.h>
- #include <linux/miscdevice.h>
-@@ -222,14 +221,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- sys_sync();
- printk("done.\n");
-
-- error = usermodehelper_disable();
-- if (error)
-- break;
--
- error = freeze_processes();
-- if (error)
-- usermodehelper_enable();
-- else
-+ if (!error)
- data->frozen = 1;
- break;
-
-@@ -238,7 +231,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
- break;
- pm_restore_gfp_mask();
- thaw_processes();
-- usermodehelper_enable();
- data->frozen = 0;
- break;
-
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.runtime_pm/0210-PM-QoS-add-pm_qos_update_request_timeout-API.patch b/patches.runtime_pm/0210-PM-QoS-add-pm_qos_update_request_timeout-API.patch
deleted file mode 100644
index 65d5640a2ff103..00000000000000
--- a/patches.runtime_pm/0210-PM-QoS-add-pm_qos_update_request_timeout-API.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From 2f11aa1bec43368e9e6d8706d18b3dbb5c5f7569 Mon Sep 17 00:00:00 2001
-From: MyungJoo Ham <myungjoo.ham@samsung.com>
-Date: Wed, 28 Mar 2012 23:31:24 +0200
-Subject: PM / QoS: add pm_qos_update_request_timeout() API
-
-The new API, pm_qos_update_request_timeout() is to provide a timeout
-with pm_qos_update_request.
-
-For example, pm_qos_update_request_timeout(req, 100, 1000), means that
-QoS request on req with value 100 will be active for 1000 microseconds.
-After 1000 microseconds, the QoS request thru req is reset. If there
-were another pm_qos_update_request(req, x) during the 1000 us, this
-new request with value x will override as this is another request on the
-same req handle. A new request on the same req handle will always
-override the previous request whether it is the conventional request or
-it is the new timeout request.
-
-Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-Acked-by: Mark Gross <markgross@thegnar.org>
-Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-(cherry picked from commit c4772d192c70b61d52262b0db76f7abd8aeb51c6)
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
----
- include/linux/pm_qos.h | 4 ++++
- kernel/power/qos.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 54 insertions(+)
-
-diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
-index 2e9191a..233149c 100644
---- a/include/linux/pm_qos.h
-+++ b/include/linux/pm_qos.h
-@@ -8,6 +8,7 @@
- #include <linux/notifier.h>
- #include <linux/miscdevice.h>
- #include <linux/device.h>
-+#include <linux/workqueue.h>
-
- enum {
- PM_QOS_RESERVED = 0,
-@@ -29,6 +30,7 @@ enum {
- struct pm_qos_request {
- struct plist_node node;
- int pm_qos_class;
-+ struct delayed_work work; /* for pm_qos_update_request_timeout */
- };
-
- struct dev_pm_qos_request {
-@@ -73,6 +75,8 @@ void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
- s32 value);
- void pm_qos_update_request(struct pm_qos_request *req,
- s32 new_value);
-+void pm_qos_update_request_timeout(struct pm_qos_request *req,
-+ s32 new_value, unsigned long timeout_us);
- void pm_qos_remove_request(struct pm_qos_request *req);
-
- int pm_qos_request(int pm_qos_class);
-diff --git a/kernel/power/qos.c b/kernel/power/qos.c
-index d6d6dbd..6a031e6 100644
---- a/kernel/power/qos.c
-+++ b/kernel/power/qos.c
-@@ -230,6 +230,21 @@ int pm_qos_request_active(struct pm_qos_request *req)
- EXPORT_SYMBOL_GPL(pm_qos_request_active);
-
- /**
-+ * pm_qos_work_fn - the timeout handler of pm_qos_update_request_timeout
-+ * @work: work struct for the delayed work (timeout)
-+ *
-+ * This cancels the timeout request by falling back to the default at timeout.
-+ */
-+static void pm_qos_work_fn(struct work_struct *work)
-+{
-+ struct pm_qos_request *req = container_of(to_delayed_work(work),
-+ struct pm_qos_request,
-+ work);
-+
-+ pm_qos_update_request(req, PM_QOS_DEFAULT_VALUE);
-+}
-+
-+/**
- * pm_qos_add_request - inserts new qos request into the list
- * @req: pointer to a preallocated handle
- * @pm_qos_class: identifies which list of qos request to use
-@@ -253,6 +268,7 @@ void pm_qos_add_request(struct pm_qos_request *req,
- return;
- }
- req->pm_qos_class = pm_qos_class;
-+ INIT_DELAYED_WORK(&req->work, pm_qos_work_fn);
- pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints,
- &req->node, PM_QOS_ADD_REQ, value);
- }
-@@ -279,6 +295,9 @@ void pm_qos_update_request(struct pm_qos_request *req,
- return;
- }
-
-+ if (delayed_work_pending(&req->work))
-+ cancel_delayed_work_sync(&req->work);
-+
- if (new_value != req->node.prio)
- pm_qos_update_target(
- pm_qos_array[req->pm_qos_class]->constraints,
-@@ -287,6 +306,34 @@ void pm_qos_update_request(struct pm_qos_request *req,
- EXPORT_SYMBOL_GPL(pm_qos_update_request);
-
- /**
-+ * pm_qos_update_request_timeout - modifies an existing qos request temporarily.
-+ * @req : handle to list element holding a pm_qos request to use
-+ * @new_value: defines the temporal qos request
-+ * @timeout_us: the effective duration of this qos request in usecs.
-+ *
-+ * After timeout_us, this qos request is cancelled automatically.
-+ */
-+void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value,
-+ unsigned long timeout_us)
-+{
-+ if (!req)
-+ return;
-+ if (WARN(!pm_qos_request_active(req),
-+ "%s called for unknown object.", __func__))
-+ return;
-+
-+ if (delayed_work_pending(&req->work))
-+ cancel_delayed_work_sync(&req->work);
-+
-+ if (new_value != req->node.prio)
-+ pm_qos_update_target(
-+ pm_qos_array[req->pm_qos_class]->constraints,
-+ &req->node, PM_QOS_UPDATE_REQ, new_value);
-+
-+ schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us));
-+}
-+
-+/**
- * pm_qos_remove_request - modifies an existing qos request
- * @req: handle to request list element
- *
-@@ -305,6 +352,9 @@ void pm_qos_remove_request(struct pm_qos_request *req)
- return;
- }
-
-+ if (delayed_work_pending(&req->work))
-+ cancel_delayed_work_sync(&req->work);
-+
- pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints,
- &req->node, PM_QOS_REMOVE_REQ,
- PM_QOS_DEFAULT_VALUE);
---
-1.7.10.1.362.g242cab3
-
diff --git a/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch b/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
deleted file mode 100644
index 1bc26a6c4c5641..00000000000000
--- a/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
+++ /dev/null
@@ -1,595 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:52 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:46:46 +0900
-Subject: [LTSI-dev] [PATCH 01/21] spi: add support for Renesas RSPI
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC34986.1000802@renesas.com>
-
-
->From 3516d99256cdaef9cbcf5c69b5a538713c006be1 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 7 Mar 2012 14:46:25 +0900
-Subject: spi: add support for Renesas RSPI
-
-The SH7757 has RSPI module. This patch supports it.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 0b2182ddac4b8837bbba996d03b7b28f4346db0a)
-
-Conflicts:
-
- drivers/spi/Makefile
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/spi/Kconfig | 6 +
- drivers/spi/Makefile | 1 +
- drivers/spi/spi-rspi.c | 521 ++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 528 insertions(+), 0 deletions(-)
- create mode 100644 drivers/spi/spi-rspi.c
-
-diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
-index de35c3a..bf331ab 100644
---- a/drivers/spi/Kconfig
-+++ b/drivers/spi/Kconfig
-@@ -310,6 +310,12 @@ config SPI_PXA2XX
- config SPI_PXA2XX_PCI
- def_bool SPI_PXA2XX && X86_32 && PCI
-
-+config SPI_RSPI
-+ tristate "Renesas RSPI controller"
-+ depends on SUPERH
-+ help
-+ SPI driver for Renesas RSPI blocks.
-+
- config SPI_S3C24XX
- tristate "Samsung S3C24XX series SPI"
- depends on ARCH_S3C2410 && EXPERIMENTAL
-diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
-index 0f8c69b..5997465 100644
---- a/drivers/spi/Makefile
-+++ b/drivers/spi/Makefile
-@@ -42,6 +42,7 @@ obj-$(CONFIG_SPI_FSL_LIB) += spi_fsl_lib.o
- obj-$(CONFIG_SPI_FSL_ESPI) += spi_fsl_espi.o
- obj-$(CONFIG_SPI_FSL_SPI) += spi_fsl_spi.o
- obj-$(CONFIG_SPI_PPC4xx) += spi_ppc4xx.o
-+obj-$(CONFIG_SPI_RSPI) += spi-rspi.o
- obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
- obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx_hw.o
- obj-$(CONFIG_SPI_S3C64XX) += spi_s3c64xx.o
-diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
-new file mode 100644
-index 0000000..354f170
---- /dev/null
-+++ b/drivers/spi/spi-rspi.c
-@@ -0,0 +1,521 @@
-+/*
-+ * SH RSPI driver
-+ *
-+ * Copyright (C) 2012 Renesas Solutions Corp.
-+ *
-+ * Based on spi-sh.c:
-+ * Copyright (C) 2011 Renesas Solutions Corp.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; version 2 of the License.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/sched.h>
-+#include <linux/errno.h>
-+#include <linux/list.h>
-+#include <linux/workqueue.h>
-+#include <linux/interrupt.h>
-+#include <linux/platform_device.h>
-+#include <linux/io.h>
-+#include <linux/clk.h>
-+#include <linux/spi/spi.h>
-+
-+#define RSPI_SPCR 0x00
-+#define RSPI_SSLP 0x01
-+#define RSPI_SPPCR 0x02
-+#define RSPI_SPSR 0x03
-+#define RSPI_SPDR 0x04
-+#define RSPI_SPSCR 0x08
-+#define RSPI_SPSSR 0x09
-+#define RSPI_SPBR 0x0a
-+#define RSPI_SPDCR 0x0b
-+#define RSPI_SPCKD 0x0c
-+#define RSPI_SSLND 0x0d
-+#define RSPI_SPND 0x0e
-+#define RSPI_SPCR2 0x0f
-+#define RSPI_SPCMD0 0x10
-+#define RSPI_SPCMD1 0x12
-+#define RSPI_SPCMD2 0x14
-+#define RSPI_SPCMD3 0x16
-+#define RSPI_SPCMD4 0x18
-+#define RSPI_SPCMD5 0x1a
-+#define RSPI_SPCMD6 0x1c
-+#define RSPI_SPCMD7 0x1e
-+
-+/* SPCR */
-+#define SPCR_SPRIE 0x80
-+#define SPCR_SPE 0x40
-+#define SPCR_SPTIE 0x20
-+#define SPCR_SPEIE 0x10
-+#define SPCR_MSTR 0x08
-+#define SPCR_MODFEN 0x04
-+#define SPCR_TXMD 0x02
-+#define SPCR_SPMS 0x01
-+
-+/* SSLP */
-+#define SSLP_SSL1P 0x02
-+#define SSLP_SSL0P 0x01
-+
-+/* SPPCR */
-+#define SPPCR_MOIFE 0x20
-+#define SPPCR_MOIFV 0x10
-+#define SPPCR_SPOM 0x04
-+#define SPPCR_SPLP2 0x02
-+#define SPPCR_SPLP 0x01
-+
-+/* SPSR */
-+#define SPSR_SPRF 0x80
-+#define SPSR_SPTEF 0x20
-+#define SPSR_PERF 0x08
-+#define SPSR_MODF 0x04
-+#define SPSR_IDLNF 0x02
-+#define SPSR_OVRF 0x01
-+
-+/* SPSCR */
-+#define SPSCR_SPSLN_MASK 0x07
-+
-+/* SPSSR */
-+#define SPSSR_SPECM_MASK 0x70
-+#define SPSSR_SPCP_MASK 0x07
-+
-+/* SPDCR */
-+#define SPDCR_SPLW 0x20
-+#define SPDCR_SPRDTD 0x10
-+#define SPDCR_SLSEL1 0x08
-+#define SPDCR_SLSEL0 0x04
-+#define SPDCR_SLSEL_MASK 0x0c
-+#define SPDCR_SPFC1 0x02
-+#define SPDCR_SPFC0 0x01
-+
-+/* SPCKD */
-+#define SPCKD_SCKDL_MASK 0x07
-+
-+/* SSLND */
-+#define SSLND_SLNDL_MASK 0x07
-+
-+/* SPND */
-+#define SPND_SPNDL_MASK 0x07
-+
-+/* SPCR2 */
-+#define SPCR2_PTE 0x08
-+#define SPCR2_SPIE 0x04
-+#define SPCR2_SPOE 0x02
-+#define SPCR2_SPPE 0x01
-+
-+/* SPCMDn */
-+#define SPCMD_SCKDEN 0x8000
-+#define SPCMD_SLNDEN 0x4000
-+#define SPCMD_SPNDEN 0x2000
-+#define SPCMD_LSBF 0x1000
-+#define SPCMD_SPB_MASK 0x0f00
-+#define SPCMD_SPB_8_TO_16(bit) (((bit - 1) << 8) & SPCMD_SPB_MASK)
-+#define SPCMD_SPB_20BIT 0x0000
-+#define SPCMD_SPB_24BIT 0x0100
-+#define SPCMD_SPB_32BIT 0x0200
-+#define SPCMD_SSLKP 0x0080
-+#define SPCMD_SSLA_MASK 0x0030
-+#define SPCMD_BRDV_MASK 0x000c
-+#define SPCMD_CPOL 0x0002
-+#define SPCMD_CPHA 0x0001
-+
-+struct rspi_data {
-+ void __iomem *addr;
-+ u32 max_speed_hz;
-+ struct spi_master *master;
-+ struct list_head queue;
-+ struct work_struct ws;
-+ wait_queue_head_t wait;
-+ spinlock_t lock;
-+ struct clk *clk;
-+ unsigned char spsr;
-+};
-+
-+static void rspi_write8(struct rspi_data *rspi, u8 data, u16 offset)
-+{
-+ iowrite8(data, rspi->addr + offset);
-+}
-+
-+static void rspi_write16(struct rspi_data *rspi, u16 data, u16 offset)
-+{
-+ iowrite16(data, rspi->addr + offset);
-+}
-+
-+static u8 rspi_read8(struct rspi_data *rspi, u16 offset)
-+{
-+ return ioread8(rspi->addr + offset);
-+}
-+
-+static u16 rspi_read16(struct rspi_data *rspi, u16 offset)
-+{
-+ return ioread16(rspi->addr + offset);
-+}
-+
-+static unsigned char rspi_calc_spbr(struct rspi_data *rspi)
-+{
-+ int tmp;
-+ unsigned char spbr;
-+
-+ tmp = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
-+ spbr = clamp(tmp, 0, 255);
-+
-+ return spbr;
-+}
-+
-+static void rspi_enable_irq(struct rspi_data *rspi, u8 enable)
-+{
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | enable, RSPI_SPCR);
-+}
-+
-+static void rspi_disable_irq(struct rspi_data *rspi, u8 disable)
-+{
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~disable, RSPI_SPCR);
-+}
-+
-+static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask,
-+ u8 enable_bit)
-+{
-+ int ret;
-+
-+ rspi->spsr = rspi_read8(rspi, RSPI_SPSR);
-+ rspi_enable_irq(rspi, enable_bit);
-+ ret = wait_event_timeout(rspi->wait, rspi->spsr & wait_mask, HZ);
-+ if (ret == 0 && !(rspi->spsr & wait_mask))
-+ return -ETIMEDOUT;
-+
-+ return 0;
-+}
-+
-+static void rspi_assert_ssl(struct rspi_data *rspi)
-+{
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR);
-+}
-+
-+static void rspi_negate_ssl(struct rspi_data *rspi)
-+{
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
-+}
-+
-+static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
-+{
-+ /* Sets output mode(CMOS) and MOSI signal(from previous transfer) */
-+ rspi_write8(rspi, 0x00, RSPI_SPPCR);
-+
-+ /* Sets transfer bit rate */
-+ rspi_write8(rspi, rspi_calc_spbr(rspi), RSPI_SPBR);
-+
-+ /* Sets number of frames to be used: 1 frame */
-+ rspi_write8(rspi, 0x00, RSPI_SPDCR);
-+
-+ /* Sets RSPCK, SSL, next-access delay value */
-+ rspi_write8(rspi, 0x00, RSPI_SPCKD);
-+ rspi_write8(rspi, 0x00, RSPI_SSLND);
-+ rspi_write8(rspi, 0x00, RSPI_SPND);
-+
-+ /* Sets parity, interrupt mask */
-+ rspi_write8(rspi, 0x00, RSPI_SPCR2);
-+
-+ /* Sets SPCMD */
-+ rspi_write16(rspi, SPCMD_SPB_8_TO_16(access_size) | SPCMD_SSLKP,
-+ RSPI_SPCMD0);
-+
-+ /* Sets RSPI mode */
-+ rspi_write8(rspi, SPCR_MSTR, RSPI_SPCR);
-+
-+ return 0;
-+}
-+
-+static int rspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
-+ struct spi_transfer *t)
-+{
-+ int remain = t->len;
-+ u8 *data;
-+
-+ data = (u8 *)t->tx_buf;
-+ while (remain > 0) {
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_TXMD,
-+ RSPI_SPCR);
-+
-+ if (rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE) < 0) {
-+ dev_err(&rspi->master->dev,
-+ "%s: tx empty timeout\n", __func__);
-+ return -ETIMEDOUT;
-+ }
-+
-+ rspi_write16(rspi, *data, RSPI_SPDR);
-+ data++;
-+ remain--;
-+ }
-+
-+ /* Waiting for the last transmition */
-+ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
-+
-+ return 0;
-+}
-+
-+static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
-+ struct spi_transfer *t)
-+{
-+ int remain = t->len;
-+ u8 *data;
-+ unsigned char spsr;
-+
-+ spsr = rspi_read8(rspi, RSPI_SPSR);
-+ if (spsr & SPSR_SPRF)
-+ rspi_read16(rspi, RSPI_SPDR); /* dummy read */
-+ if (spsr & SPSR_OVRF)
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPSR) & ~SPSR_OVRF,
-+ RSPI_SPCR);
-+
-+ data = (u8 *)t->rx_buf;
-+ while (remain > 0) {
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_TXMD,
-+ RSPI_SPCR);
-+
-+ if (rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE) < 0) {
-+ dev_err(&rspi->master->dev,
-+ "%s: tx empty timeout\n", __func__);
-+ return -ETIMEDOUT;
-+ }
-+ /* dummy write for generate clock */
-+ rspi_write16(rspi, 0x00, RSPI_SPDR);
-+
-+ if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
-+ dev_err(&rspi->master->dev,
-+ "%s: receive timeout\n", __func__);
-+ return -ETIMEDOUT;
-+ }
-+ /* SPDR allows 16 or 32-bit access only */
-+ *data = (u8)rspi_read16(rspi, RSPI_SPDR);
-+
-+ data++;
-+ remain--;
-+ }
-+
-+ return 0;
-+}
-+
-+static void rspi_work(struct work_struct *work)
-+{
-+ struct rspi_data *rspi = container_of(work, struct rspi_data, ws);
-+ struct spi_message *mesg;
-+ struct spi_transfer *t;
-+ unsigned long flags;
-+ int ret;
-+
-+ spin_lock_irqsave(&rspi->lock, flags);
-+ while (!list_empty(&rspi->queue)) {
-+ mesg = list_entry(rspi->queue.next, struct spi_message, queue);
-+ list_del_init(&mesg->queue);
-+ spin_unlock_irqrestore(&rspi->lock, flags);
-+
-+ rspi_assert_ssl(rspi);
-+
-+ list_for_each_entry(t, &mesg->transfers, transfer_list) {
-+ if (t->tx_buf) {
-+ ret = rspi_send_pio(rspi, mesg, t);
-+ if (ret < 0)
-+ goto error;
-+ }
-+ if (t->rx_buf) {
-+ ret = rspi_receive_pio(rspi, mesg, t);
-+ if (ret < 0)
-+ goto error;
-+ }
-+ mesg->actual_length += t->len;
-+ }
-+ rspi_negate_ssl(rspi);
-+
-+ mesg->status = 0;
-+ mesg->complete(mesg->context);
-+
-+ spin_lock_irqsave(&rspi->lock, flags);
-+ }
-+
-+ return;
-+
-+error:
-+ mesg->status = ret;
-+ mesg->complete(mesg->context);
-+}
-+
-+static int rspi_setup(struct spi_device *spi)
-+{
-+ struct rspi_data *rspi = spi_master_get_devdata(spi->master);
-+
-+ if (!spi->bits_per_word)
-+ spi->bits_per_word = 8;
-+ rspi->max_speed_hz = spi->max_speed_hz;
-+
-+ rspi_set_config_register(rspi, 8);
-+
-+ return 0;
-+}
-+
-+static int rspi_transfer(struct spi_device *spi, struct spi_message *mesg)
-+{
-+ struct rspi_data *rspi = spi_master_get_devdata(spi->master);
-+ unsigned long flags;
-+
-+ mesg->actual_length = 0;
-+ mesg->status = -EINPROGRESS;
-+
-+ spin_lock_irqsave(&rspi->lock, flags);
-+ list_add_tail(&mesg->queue, &rspi->queue);
-+ schedule_work(&rspi->ws);
-+ spin_unlock_irqrestore(&rspi->lock, flags);
-+
-+ return 0;
-+}
-+
-+static void rspi_cleanup(struct spi_device *spi)
-+{
-+}
-+
-+static irqreturn_t rspi_irq(int irq, void *_sr)
-+{
-+ struct rspi_data *rspi = (struct rspi_data *)_sr;
-+ unsigned long spsr;
-+ irqreturn_t ret = IRQ_NONE;
-+ unsigned char disable_irq = 0;
-+
-+ rspi->spsr = spsr = rspi_read8(rspi, RSPI_SPSR);
-+ if (spsr & SPSR_SPRF)
-+ disable_irq |= SPCR_SPRIE;
-+ if (spsr & SPSR_SPTEF)
-+ disable_irq |= SPCR_SPTIE;
-+
-+ if (disable_irq) {
-+ ret = IRQ_HANDLED;
-+ rspi_disable_irq(rspi, disable_irq);
-+ wake_up(&rspi->wait);
-+ }
-+
-+ return ret;
-+}
-+
-+static int __devexit rspi_remove(struct platform_device *pdev)
-+{
-+ struct rspi_data *rspi = dev_get_drvdata(&pdev->dev);
-+
-+ spi_unregister_master(rspi->master);
-+ free_irq(platform_get_irq(pdev, 0), rspi);
-+ clk_put(rspi->clk);
-+ iounmap(rspi->addr);
-+ spi_master_put(rspi->master);
-+
-+ return 0;
-+}
-+
-+static int __devinit rspi_probe(struct platform_device *pdev)
-+{
-+ struct resource *res;
-+ struct spi_master *master;
-+ struct rspi_data *rspi;
-+ int ret, irq;
-+ char clk_name[16];
-+
-+ /* get base addr */
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ if (unlikely(res == NULL)) {
-+ dev_err(&pdev->dev, "invalid resource\n");
-+ return -EINVAL;
-+ }
-+
-+ irq = platform_get_irq(pdev, 0);
-+ if (irq < 0) {
-+ dev_err(&pdev->dev, "platform_get_irq error\n");
-+ return -ENODEV;
-+ }
-+
-+ master = spi_alloc_master(&pdev->dev, sizeof(struct rspi_data));
-+ if (master == NULL) {
-+ dev_err(&pdev->dev, "spi_alloc_master error.\n");
-+ return -ENOMEM;
-+ }
-+
-+ rspi = spi_master_get_devdata(master);
-+ dev_set_drvdata(&pdev->dev, rspi);
-+
-+ rspi->master = master;
-+ rspi->addr = ioremap(res->start, resource_size(res));
-+ if (rspi->addr == NULL) {
-+ dev_err(&pdev->dev, "ioremap error.\n");
-+ ret = -ENOMEM;
-+ goto error1;
-+ }
-+
-+ snprintf(clk_name, sizeof(clk_name), "rspi%d", pdev->id);
-+ rspi->clk = clk_get(&pdev->dev, clk_name);
-+ if (IS_ERR(rspi->clk)) {
-+ dev_err(&pdev->dev, "cannot get clock\n");
-+ ret = PTR_ERR(rspi->clk);
-+ goto error2;
-+ }
-+ clk_enable(rspi->clk);
-+
-+ INIT_LIST_HEAD(&rspi->queue);
-+ spin_lock_init(&rspi->lock);
-+ INIT_WORK(&rspi->ws, rspi_work);
-+ init_waitqueue_head(&rspi->wait);
-+
-+ master->num_chipselect = 2;
-+ master->bus_num = pdev->id;
-+ master->setup = rspi_setup;
-+ master->transfer = rspi_transfer;
-+ master->cleanup = rspi_cleanup;
-+
-+ ret = request_irq(irq, rspi_irq, 0, dev_name(&pdev->dev), rspi);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "request_irq error\n");
-+ goto error3;
-+ }
-+
-+ ret = spi_register_master(master);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "spi_register_master error.\n");
-+ goto error4;
-+ }
-+
-+ dev_info(&pdev->dev, "probed\n");
-+
-+ return 0;
-+
-+error4:
-+ free_irq(irq, rspi);
-+error3:
-+ clk_put(rspi->clk);
-+error2:
-+ iounmap(rspi->addr);
-+error1:
-+ spi_master_put(master);
-+
-+ return ret;
-+}
-+
-+static struct platform_driver rspi_driver = {
-+ .probe = rspi_probe,
-+ .remove = __devexit_p(rspi_remove),
-+ .driver = {
-+ .name = "rspi",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+module_platform_driver(rspi_driver);
-+
-+MODULE_DESCRIPTION("Renesas RSPI bus driver");
-+MODULE_LICENSE("GPL v2");
-+MODULE_AUTHOR("Yoshihiro Shimoda");
-+MODULE_ALIAS("platform:rspi");
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch b/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
deleted file mode 100644
index 76087d06c9b63b..00000000000000
--- a/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:54 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:46:50 +0900
-Subject: [LTSI-dev] [PATCH 02/21] spi: irq: Remove IRQF_DISABLED
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC3498A.2000303@renesas.com>
-
-
->From 561d8e1807f2cc13d47f22c0caf210b123aea24d Mon Sep 17 00:00:00 2001
-From: Yong Zhang <yong.zhang0@gmail.com>
-Date: Sat, 22 Oct 2011 17:56:55 +0800
-Subject: spi: irq: Remove IRQF_DISABLED
-
-Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
-We run all interrupt handlers with interrupts disabled
-and we even check and yell when an interrupt handler
-returns with interrupts enabled (see commit [b738a50a:
-genirq: Warn when handler enables interrupts]).
-
-So now this flag is a NOOP and can be removed.
-
-Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 38ada214fad79ff5ebbed58932c5f0c9969d9c91)
-
-Conflicts:
-
- drivers/spi/spi-bfin5xx.c
- drivers/spi/spi-ppc4xx.c
- drivers/spi/spi-coldfire-qspi.c
- drivers/spi/spi-sh-msiof.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/spi/spi_sh.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
-index 9eedd71..e0343d4 100644
---- a/drivers/spi/spi_sh.c
-+++ b/drivers/spi/spi_sh.c
-@@ -484,7 +484,7 @@ static int __devinit spi_sh_probe(struct platform_device *pdev)
- goto error2;
- }
-
-- ret = request_irq(irq, spi_sh_irq, IRQF_DISABLED, "spi_sh", ss);
-+ ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
- if (ret < 0) {
- dev_err(&pdev->dev, "request_irq error\n");
- goto error3;
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch b/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
deleted file mode 100644
index 760ab79cbaca7b..00000000000000
--- a/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:58 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:46:55 +0900
-Subject: [LTSI-dev] [PATCH 03/21] drivercore: Add helper macro for platform_driver boilerplate
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC3498F.9030400@renesas.com>
-
-
->From 0ac87d22b5e2f88fcaf9888496c8e7b1100ee87c Mon Sep 17 00:00:00 2001
-From: Grant Likely <grant.likely@secretlab.ca>
-Date: Wed, 5 Oct 2011 11:29:49 -0600
-Subject: drivercore: Add helper macro for platform_driver boilerplate
-
-For simple modules that contain a single platform_driver without any
-additional setup code then ends up being a block of duplicated
-boilerplate. This patch adds a new macro, module_platform_driver(),
-which replaces the module_init()/module_exit() registrations with
-template functions.
-
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
-Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
-Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
-(cherry picked from commit 940ab88962bc1aff3273a8356d64577a6e386736)
-
-Conflicts:
-
- drivers/spi/spi-altera.c
- drivers/spi/spi-ath79.c
- drivers/spi/spi-atmel.c
- drivers/spi/spi-bfin-sport.c
- drivers/spi/spi-coldfire-qspi.c
- drivers/spi/spi-davinci.c
- drivers/spi/spi-dw-mmio.c
- drivers/spi/spi-ep93xx.c
- drivers/spi/spi-fsl-espi.c
- drivers/spi/spi-gpio.c
- drivers/spi/spi-imx.c
- drivers/spi/spi-mpc512x-psc.c
- drivers/spi/spi-mpc52xx-psc.c
- drivers/spi/spi-mpc52xx.c
- drivers/spi/spi-nuc900.c
- drivers/spi/spi-oc-tiny.c
- drivers/spi/spi-ppc4xx.c
- drivers/spi/spi-s3c24xx.c
- drivers/spi/spi-sh-msiof.c
- drivers/spi/spi-sh-sci.c
- drivers/spi/spi-stmp.c
- drivers/spi/spi-tegra.c
- drivers/spi/spi-ti-ssp.c
- drivers/spi/spi-xilinx.c
- drivers/tty/serial/of_serial.c
- include/linux/platform_device.h
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/spi/spi_sh.c | 13 +------------
- 1 files changed, 1 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
-index e0343d4..70c8af9 100644
---- a/drivers/spi/spi_sh.c
-+++ b/drivers/spi/spi_sh.c
-@@ -524,18 +524,7 @@ static struct platform_driver spi_sh_driver = {
- .owner = THIS_MODULE,
- },
- };
--
--static int __init spi_sh_init(void)
--{
-- return platform_driver_register(&spi_sh_driver);
--}
--module_init(spi_sh_init);
--
--static void __exit spi_sh_exit(void)
--{
-- platform_driver_unregister(&spi_sh_driver);
--}
--module_exit(spi_sh_exit);
-+module_platform_driver(spi_sh_driver);
-
- MODULE_DESCRIPTION("SH SPI bus driver");
- MODULE_LICENSE("GPL");
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch b/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
deleted file mode 100644
index 694d166dffbd31..00000000000000
--- a/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:02 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:46:59 +0900
-Subject: [LTSI-dev] [PATCH 04/21] spi/spi-sh: add IORESOURCE_MEM_TYPE_MASK decoding for access size
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC34993.60503@renesas.com>
-
-
->From 766fd7edb8a1479627d7819b220469a2fe985491 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 7 Mar 2012 14:45:37 +0900
-Subject: spi/spi-sh: add IORESOURCE_MEM_TYPE_MASK decoding for access size
-
-This SPI controller's access size is 32, or 8-bit. The previous driver
-supported 32-bit only. So, this patch adds IORESOURCE_MEM_TYPE_MASK
-decoding, an then, the driver can handle the SPI controller of 8-bit.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-(cherry picked from commit 0eb8880fac7b0f32ebab33f99e758c6b308e3aa1)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- drivers/spi/spi_sh.c | 25 +++++++++++++++++++++++--
- 1 files changed, 23 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
-index 70c8af9..79442c3 100644
---- a/drivers/spi/spi_sh.c
-+++ b/drivers/spi/spi_sh.c
-@@ -92,17 +92,26 @@ struct spi_sh_data {
- unsigned long cr1;
- wait_queue_head_t wait;
- spinlock_t lock;
-+ int width;
- };
-
- static void spi_sh_write(struct spi_sh_data *ss, unsigned long data,
- unsigned long offset)
- {
-- writel(data, ss->addr + offset);
-+ if (ss->width == 8)
-+ iowrite8(data, ss->addr + (offset >> 2));
-+ else if (ss->width == 32)
-+ iowrite32(data, ss->addr + offset);
- }
-
- static unsigned long spi_sh_read(struct spi_sh_data *ss, unsigned long offset)
- {
-- return readl(ss->addr + offset);
-+ if (ss->width == 8)
-+ return ioread8(ss->addr + (offset >> 2));
-+ else if (ss->width == 32)
-+ return ioread32(ss->addr + offset);
-+ else
-+ return 0;
- }
-
- static void spi_sh_set_bit(struct spi_sh_data *ss, unsigned long val,
-@@ -464,6 +473,18 @@ static int __devinit spi_sh_probe(struct platform_device *pdev)
- ss = spi_master_get_devdata(master);
- dev_set_drvdata(&pdev->dev, ss);
-
-+ switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
-+ case IORESOURCE_MEM_8BIT:
-+ ss->width = 8;
-+ break;
-+ case IORESOURCE_MEM_32BIT:
-+ ss->width = 32;
-+ break;
-+ default:
-+ dev_err(&pdev->dev, "No support width\n");
-+ ret = -ENODEV;
-+ goto error1;
-+ }
- ss->irq = irq;
- ss->master = master;
- ss->addr = ioremap(res->start, resource_size(res));
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch b/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
deleted file mode 100644
index 3e458e444f5498..00000000000000
--- a/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:07 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:03 +0900
-Subject: [LTSI-dev] [PATCH 05/21] sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC34997.7040605@renesas.com>
-
-
->From f996c223aca0fc81406daff93810f530d6543399 Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 6 Jul 2011 01:18:27 +0000
-Subject: sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 9b41757107a7fcabcf83bf2f04938dc8e596464c)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 35 +++++++------------------------
- 1 files changed, 8 insertions(+), 27 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-index eedddad..86bf188 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -102,6 +102,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- };
-
- #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
-+#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
-
- static struct clk_lookup lookups[] = {
- /* main clocks */
-@@ -116,33 +117,13 @@ static struct clk_lookup lookups[] = {
- /* MSTP32 clocks */
- CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
- CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
-- {
-- /* TMU0 */
-- .dev_id = "sh_tmu.0",
-- .con_id = "tmu_fck",
-- .clk = &mstp_clks[MSTP113],
-- }, {
-- /* TMU1 */
-- .dev_id = "sh_tmu.1",
-- .con_id = "tmu_fck",
-- .clk = &mstp_clks[MSTP114],
-- },
-- {
-- /* SCIF4 (But, ID is 2) */
-- .dev_id = "sh-sci.2",
-- .con_id = "sci_fck",
-- .clk = &mstp_clks[MSTP112],
-- }, {
-- /* SCIF3 */
-- .dev_id = "sh-sci.1",
-- .con_id = "sci_fck",
-- .clk = &mstp_clks[MSTP111],
-- }, {
-- /* SCIF2 */
-- .dev_id = "sh-sci.0",
-- .con_id = "sci_fck",
-- .clk = &mstp_clks[MSTP110],
-- },
-+
-+ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
-+ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
-+ CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
-+ CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
-+ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
-+
- CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
- CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
- };
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch b/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
deleted file mode 100644
index 2bb3628d80d58a..00000000000000
--- a/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:12 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:07 +0900
-Subject: [LTSI-dev] [PATCH 06/21] sh: move CLKDEV_xxx_ID macro to sh_clk.h
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC3499B.9050300@renesas.com>
-
-
->From 540cdd813dd77275e44ec24701364e1895cd98bd Mon Sep 17 00:00:00 2001
-From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Date: Wed, 6 Jul 2011 02:54:11 +0000
-Subject: sh: move CLKDEV_xxx_ID macro to sh_clk.h
-
-Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 1522043bf73ef0e9e61dc512a0f3cdbec1cbf89f)
-
-Conflicts:
-
- arch/sh/kernel/cpu/sh4a/clock-sh7343.c
- arch/sh/kernel/cpu/sh4a/clock-sh7366.c
- arch/sh/kernel/cpu/sh4a/clock-sh7722.c
- arch/sh/kernel/cpu/sh4a/clock-sh7723.c
- arch/sh/kernel/cpu/sh4a/clock-sh7724.c
- arch/sh/kernel/cpu/sh4a/clock-sh7785.c
- arch/sh/kernel/cpu/sh4a/clock-sh7786.c
- arch/sh/kernel/cpu/sh4a/clock-shx3.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 3 ---
- 1 files changed, 0 insertions(+), 3 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-index 86bf188..3b097b0 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -101,9 +101,6 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP220] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 20, 0),
- };
-
--#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
--#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
--
- static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("extal", &extal_clk),
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch b/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
deleted file mode 100644
index ef2e2dd099ca21..00000000000000
--- a/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:15 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:11 +0900
-Subject: [LTSI-dev] [PATCH 07/21] sh: fix the compile error in setup-sh7757.c
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC3499F.9020208@renesas.com>
-
-
->From 8912bc4c88e6690ff125f20a053961d71919c1be Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 23 Aug 2011 09:15:46 +0000
-Subject: sh: fix the compile error in setup-sh7757.c
-
-Fix the following build errors:
-
- CC arch/sh/kernel/cpu/sh4a/setup-sh7757.o
-arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: implicit declaration of function ‘DMA_BIT_MASK’
-arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: initializer element is not constant
-arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: (near initialization for ‘usb_ehci_device.dev.coherent_dma_mask’)
-arch/sh/kernel/cpu/sh4a/setup-sh7757.c:705: error: initializer element is not constant
-arch/sh/kernel/cpu/sh4a/setup-sh7757.c:705: error: (near initialization for ‘usb_ohci_device.dev.coherent_dma_mask’)
-make[3]: *** [arch/sh/kernel/cpu/sh4a/setup-sh7757.o] Error 1
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 21d41f2b312231536cf981c960c83cc4493c0293)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-index e915dea..0555929 100644
---- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-@@ -15,6 +15,7 @@
- #include <linux/serial_sci.h>
- #include <linux/io.h>
- #include <linux/mm.h>
-+#include <linux/dma-mapping.h>
- #include <linux/sh_timer.h>
- #include <linux/sh_dma.h>
-
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch b/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
deleted file mode 100644
index 42a89bd59d7a58..00000000000000
--- a/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:19 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:15 +0900
-Subject: [LTSI-dev] [PATCH 08/21] sh: add parameters for EHCI and RIIC in clock-sh7757.c
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349A3.7010304@renesas.com>
-
-
->From 93827b13e428bfc4e2323ab8006e170bc530906e Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 26 Sep 2011 17:41:28 +0900
-Subject: sh: add parameters for EHCI and RIIC in clock-sh7757.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 5261b0a290a87fa448fd1fd125baeab42603a318)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 10 +++++++++-
- 1 files changed, 9 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-index 3b097b0..19222da 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -113,7 +113,14 @@ static struct clk_lookup lookups[] = {
-
- /* MSTP32 clocks */
- CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
-- CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic3", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic4", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic5", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
-+ CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
-
- CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
- CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
-@@ -121,6 +128,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
- CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
-
-+ CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
- CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
- CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
- };
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch b/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
deleted file mode 100644
index 4818a3ae21ecbf..00000000000000
--- a/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:24 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:20 +0900
-Subject: [LTSI-dev] [PATCH 09/21] sh: add a resource name for shdma
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349A8.5020108@renesas.com>
-
-
->From 97de925e1dbf4faa708110d1441ea1d585d4a913 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 10 Jan 2012 14:20:58 +0900
-Subject: sh: add a resource name for shdma
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a4d5247310c993b6b30f1686be12ddacfc41142a)
-
-Conflicts:
- arch/sh/kernel/cpu/sh4a/setup-sh7722.c
- arch/sh/kernel/cpu/sh4a/setup-sh7724.c
- arch/sh/kernel/cpu/sh4a/setup-sh7780.c
- arch/sh/kernel/cpu/sh4a/setup-sh7785.c
- arch/sh/kernel/cpu/sh4a/setup-sh7786.c
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-index 0555929..a7b2da6 100644
---- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-@@ -465,6 +465,7 @@ static struct resource sh7757_dmae0_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- {
-+ .name = "error_irq",
- .start = 34,
- .end = 34,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
-@@ -486,7 +487,7 @@ static struct resource sh7757_dmae1_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error */
-+ .name = "error_irq",
- .start = 34,
- .end = 34,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
-@@ -556,7 +557,7 @@ static struct resource sh7757_dmae2_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error */
-+ .name = "error_irq",
- .start = 323,
- .end = 323,
- .flags = IORESOURCE_IRQ,
-@@ -590,7 +591,7 @@ static struct resource sh7757_dmae3_resources[] = {
- .flags = IORESOURCE_MEM,
- },
- {
-- /* DMA error */
-+ .name = "error_irq",
- .start = 324,
- .end = 324,
- .flags = IORESOURCE_IRQ,
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch b/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
deleted file mode 100644
index 42b4d3e8f0c0d5..00000000000000
--- a/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:27 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:23 +0900
-Subject: [LTSI-dev] [PATCH 10/21] sh: modify resource for SPI0 in setup-sh7757
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349AB.3020600@renesas.com>
-
-
->From 8b983d13cd434f9ecaaf59bb4407ab7f212134d5 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 26 Jan 2012 17:44:05 +0900
-Subject: sh: modify resource for SPI0 in setup-sh7757
-
-The new spi-sh driver decodes the IORESOURCE_MEM_TYPE_MASK. So, the
-resource needs the IORESOURCE_MEM_32BIT.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 11c582e32c664f67e2518b9f97e6c91918617274)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-index a7b2da6..226d809 100644
---- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-@@ -133,7 +133,7 @@ static struct resource spi0_resources[] = {
- [0] = {
- .start = 0xfe002000,
- .end = 0xfe0020ff,
-- .flags = IORESOURCE_MEM,
-+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
- },
- [1] = {
- .start = 86,
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch b/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
deleted file mode 100644
index 8d28d66a1bc180..00000000000000
--- a/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:32 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:28 +0900
-Subject: [LTSI-dev] [PATCH 11/21] sh: add platform_device for SPI1 in setup-sh7757
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349B0.20603@renesas.com>
-
-
->From 207bfa238e5788eed6ec68738127ddb5f702f70d Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 26 Jan 2012 17:44:07 +0900
-Subject: sh: add platform_device for SPI1 in setup-sh7757
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a206c0087323337595de1284feb09a98c2a389d2)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 20 ++++++++++++++++++++
- 1 files changed, 20 insertions(+), 0 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-index 226d809..2875e8b 100644
---- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-@@ -661,6 +661,25 @@ static struct platform_device spi0_device = {
- .resource = spi0_resources,
- };
-
-+static struct resource spi1_resources[] = {
-+ {
-+ .start = 0xffd8ee70,
-+ .end = 0xffd8eeff,
-+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-+ },
-+ {
-+ .start = 54,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device spi1_device = {
-+ .name = "sh_spi",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(spi1_resources),
-+ .resource = spi1_resources,
-+};
-+
- static struct resource usb_ehci_resources[] = {
- [0] = {
- .start = 0xfe4f1000,
-@@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
- &dma2_device,
- &dma3_device,
- &spi0_device,
-+ &spi1_device,
- &usb_ehci_device,
- &usb_ohci_device,
- };
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch b/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
deleted file mode 100644
index 9aa2bacfae77f9..00000000000000
--- a/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:36 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:32 +0900
-Subject: [LTSI-dev] [PATCH 12/21] sh: modify clock-sh7757 for renesas_usbhs
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349B4.1090603@renesas.com>
-
-
->From 2f2fc2bf63c60852a8ddd817a29df482bd18486f Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 5 Jan 2012 14:08:03 +0900
-Subject: sh: modify clock-sh7757 for renesas_usbhs
-
-The renesas_usbhs driver doesn't use the clk functions. So, even if we
-adds "CLKDEV_DEV_ID("renesas_usbhs.0", ...)" only, we cannot use the USB
-controller because clk_late_init() will disable the clock by "usb0".
-So, the patch also removes the "CLKDEV_CON_ID("usb0", ...)".
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 1760e371a9038329190f0fdd051776ae76aca083)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-index 19222da..0fbff14 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -129,7 +129,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
-
- CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
-- CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
-+ CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
- CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
- };
-
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch b/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
deleted file mode 100644
index 02152f203d74de..00000000000000
--- a/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:40 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:36 +0900
-Subject: [LTSI-dev] [PATCH 13/21] sh: add parameter for RSPI in clock-sh7757
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349B8.8010109@renesas.com>
-
-
->From dc2ff8b7383140efe6afe755620137ea6a156602 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 7 Mar 2012 14:46:38 +0900
-Subject: sh: add parameter for RSPI in clock-sh7757
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit fb4340656fda27bd38914ef382ee3235c23d8f58)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-index 0fbff14..0bd21c8 100644
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -79,7 +79,7 @@ struct clk div4_clks[DIV4_NR] = {
- #define MSTPCR1 0xffc80034
- #define MSTPCR2 0xffc10028
-
--enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112,
-+enum { MSTP004, MSTP000, MSTP127, MSTP114, MSTP113, MSTP112,
- MSTP111, MSTP110, MSTP103, MSTP102, MSTP220,
- MSTP_NR };
-
-@@ -89,6 +89,7 @@ static struct clk mstp_clks[MSTP_NR] = {
- [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0),
-
- /* MSTPCR1 */
-+ [MSTP127] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 27, 0),
- [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0),
- [MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0),
- [MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0),
-@@ -131,6 +132,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
- CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
- CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
-+ CLKDEV_CON_ID("rspi2", &mstp_clks[MSTP127]),
- };
-
- int __init arch_clk_init(void)
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch b/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
deleted file mode 100644
index 56504b9e5726df..00000000000000
--- a/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:43 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:40 +0900
-Subject: [LTSI-dev] [PATCH 14/21] sh: modify the asm/sh_eth.h to linux/sh_eth.h in sh7757lcr
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349BC.6030503@renesas.com>
-
-
->From 457c07a09f4564cc6051e2ab982520a26b236d4e Mon Sep 17 00:00:00 2001
-From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Date: Tue, 1 Nov 2011 14:54:38 +0900
-Subject: sh: modify the asm/sh_eth.h to linux/sh_eth.h in sh7757lcr
-
-Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 389cc10cbdde1a9225eac51318fb30e2039135ad)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/boards/board-sh7757lcr.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index fa2a208..ec8c84c 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -18,8 +18,8 @@
- #include <linux/mmc/host.h>
- #include <linux/mmc/sh_mmcif.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
-+#include <linux/sh_eth.h>
- #include <cpu/sh7757.h>
--#include <asm/sh_eth.h>
- #include <asm/heartbeat.h>
-
- static struct resource heartbeat_resource = {
---
-1.7.1
-
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch b/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
deleted file mode 100644
index 04bc589c4a397e..00000000000000
--- a/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:47 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:43 +0900
-Subject: [LTSI-dev] [PATCH 15/21] sh: add platform_device for RSPI in setup-sh7757
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349BF.3080703@renesas.com>
-
-
->From 309c52cddb5ae308683d74591b6a00a25b2898fc Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 7 Mar 2012 14:46:41 +0900
-Subject: sh: add platform_device for RSPI in setup-sh7757
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 10a068f27ac2200c83f6d13f5e03f6e48cf06d10)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 20 ++++++++++++++++++++
- 1 files changed, 20 insertions(+), 0 deletions(-)
-
-diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-index 2875e8b..c8836cf 100644
---- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
-@@ -680,6 +680,25 @@ static struct platform_device spi1_device = {
- .resource = spi1_resources,
- };
-
-+static struct resource rspi_resources[] = {
-+ {
-+ .start = 0xfe480000,
-+ .end = 0xfe4800ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = 220,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device rspi_device = {
-+ .name = "rspi",
-+ .id = 2,
-+ .num_resources = ARRAY_SIZE(rspi_resources),
-+ .resource = rspi_resources,
-+};
-+
- static struct resource usb_ehci_resources[] = {
- [0] = {
- .start = 0xfe4f1000,
-@@ -740,6 +759,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
- &dma3_device,
- &spi0_device,
- &spi1_device,
-+ &rspi_device,
- &usb_ehci_device,
- &usb_ohci_device,
- };
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch b/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
deleted file mode 100644
index babac18bdb6691..00000000000000
--- a/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:50 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:46 +0900
-Subject: [LTSI-dev] [PATCH 16/21] sh: fix build warning in board-sh7757lcr
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349C2.9050303@renesas.com>
-
-
->From 2df9254111cd82738d8dc57a989f67a998c5540d Mon Sep 17 00:00:00 2001
-From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Date: Fri, 18 Nov 2011 16:32:34 +0900
-Subject: sh: fix build warning in board-sh7757lcr
-
-This patch fixed the following build warnings:
-
- CC arch/sh/boards/board-sh7757lcr.o
-arch/sh/boards/board-sh7757lcr.c:77: warning: initialization from incompatible pointer type
-arch/sh/boards/board-sh7757lcr.c:106: warning: initialization from incompatible pointer type
-arch/sh/boards/board-sh7757lcr.c:151: warning: initialization from incompatible pointer type
-arch/sh/boards/board-sh7757lcr.c:181: warning: initialization from incompatible pointer type
-arch/sh/boards/board-sh7757lcr.c:213: warning: missing braces around initializer
-arch/sh/boards/board-sh7757lcr.c:213: warning: (near initialization for ‘sh7757lcr_mmcif_dma.chan_priv_tx’)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 19d7ca2998e095086869318dd2ad966952f5ac82)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/boards/board-sh7757lcr.c | 16 ++++++++++------
- 1 files changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index ec8c84c..895e337 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -50,9 +50,9 @@ static struct platform_device heartbeat_device = {
- #define GBECONT 0xffc10100
- #define GBECONT_RMII1 BIT(17)
- #define GBECONT_RMII0 BIT(16)
--static void sh7757_eth_set_mdio_gate(unsigned long addr)
-+static void sh7757_eth_set_mdio_gate(void *addr)
- {
-- if ((addr & 0x00000fff) < 0x0800)
-+ if (((unsigned long)addr & 0x00000fff) < 0x0800)
- writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
- else
- writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
-@@ -116,9 +116,9 @@ static struct platform_device sh7757_eth1_device = {
- },
- };
-
--static void sh7757_eth_giga_set_mdio_gate(unsigned long addr)
-+static void sh7757_eth_giga_set_mdio_gate(void *addr)
- {
-- if ((addr & 0x00000fff) < 0x0800) {
-+ if (((unsigned long)addr & 0x00000fff) < 0x0800) {
- gpio_set_value(GPIO_PTT4, 1);
- writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
- } else {
-@@ -210,8 +210,12 @@ static struct resource sh_mmcif_resources[] = {
- };
-
- static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
-- .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX,
-- .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX,
-+ .chan_priv_tx = {
-+ .slave_id = SHDMA_SLAVE_MMCIF_TX,
-+ },
-+ .chan_priv_rx = {
-+ .slave_id = SHDMA_SLAVE_MMCIF_RX,
-+ }
- };
-
- static struct sh_mmcif_plat_data sh_mmcif_plat = {
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch b/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
deleted file mode 100644
index 8de58457816a12..00000000000000
--- a/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:54 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:49 +0900
-Subject: [LTSI-dev] [PATCH 17/21] sh: add platform_device for renesas_usbhs in board-sh7757lcr
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349C5.2080607@renesas.com>
-
-
->From 88b6a3d039fde3e966f002b64afe8c3e833f2902 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Thu, 5 Jan 2012 14:08:12 +0900
-Subject: sh: add platform_device for renesas_usbhs in board-sh7757lcr
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 7afb4e9a92e42e66124b7043405bbca82680aa96)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/boards/board-sh7757lcr.c | 39 ++++++++++++++++++++++++++++++++++++++
- 1 files changed, 39 insertions(+), 0 deletions(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index 895e337..0838154 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -19,6 +19,7 @@
- #include <linux/mmc/sh_mmcif.h>
- #include <linux/mmc/sh_mobile_sdhi.h>
- #include <linux/sh_eth.h>
-+#include <linux/usb/renesas_usbhs.h>
- #include <cpu/sh7757.h>
- #include <asm/heartbeat.h>
-
-@@ -264,6 +265,43 @@ static struct platform_device sdhi_device = {
- },
- };
-
-+static int usbhs0_get_id(struct platform_device *pdev)
-+{
-+ return USBHS_GADGET;
-+}
-+
-+static struct renesas_usbhs_platform_info usb0_data = {
-+ .platform_callback = {
-+ .get_id = usbhs0_get_id,
-+ },
-+ .driver_param = {
-+ .buswait_bwait = 5,
-+ }
-+};
-+
-+static struct resource usb0_resources[] = {
-+ [0] = {
-+ .start = 0xfe450000,
-+ .end = 0xfe4501ff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = 50,
-+ .end = 50,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device usb0_device = {
-+ .name = "renesas_usbhs",
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &usb0_data,
-+ },
-+ .num_resources = ARRAY_SIZE(usb0_resources),
-+ .resource = usb0_resources,
-+};
-+
- static struct platform_device *sh7757lcr_devices[] __initdata = {
- &heartbeat_device,
- &sh7757_eth0_device,
-@@ -272,6 +310,7 @@ static struct platform_device *sh7757lcr_devices[] __initdata = {
- &sh7757_eth_giga1_device,
- &sh_mmcif_device,
- &sdhi_device,
-+ &usb0_device,
- };
-
- static struct flash_platform_data spi_flash_data = {
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch b/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
deleted file mode 100644
index e03925afd9d764..00000000000000
--- a/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:56 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:53 +0900
-Subject: [LTSI-dev] [PATCH 18/21] sh: fix the sh_mmcif_plat_data in board-sh7757lcr
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349C9.8000304@renesas.com>
-
-
->From 6238a9aa21a471e435ff0bc6106d477edfbe6865 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Tue, 17 Jan 2012 17:49:38 +0900
-Subject: sh: fix the sh_mmcif_plat_data in board-sh7757lcr
-
-The board has an eMMC chip, so we cannot remove the chip.
-In this case, we have to set the MMC_CAP_NONREMOVABLE to the caps
-parameter.
-
-Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 78da107a7ed14fbc6ef77ff4c41d92b11edc9036)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/boards/board-sh7757lcr.c | 3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index 0838154..33dc5b6 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -222,7 +222,8 @@ static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
- static struct sh_mmcif_plat_data sh_mmcif_plat = {
- .dma = &sh7757lcr_mmcif_dma,
- .sup_pclk = 0x0f,
-- .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
-+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
-+ MMC_CAP_NONREMOVABLE,
- .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
- };
-
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch b/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
deleted file mode 100644
index 536cd3bba908da..00000000000000
--- a/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:00 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:47:56 +0900
-Subject: [LTSI-dev] [PATCH 19/21] sh: modify a resource of sh_eth_giga1_resources in board-sh7757lcr
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349CC.9000006@renesas.com>
-
-
->From c17794efb2da1484cf80a5421a55fd8e99951b60 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 20 Feb 2012 17:26:50 +0900
-Subject: sh: modify a resource of sh_eth_giga1_resources in board-sh7757lcr
-
-The latest sh_eth driver needs a resource of TSU in the channel 1,
-if the controller has TSU registers. So, this patch adds the resource.
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit befe0756d5fa5841f02e2029bbcc77225b9a13bb)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/boards/board-sh7757lcr.c | 5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
-
-diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
-index 33dc5b6..14b0dae 100644
---- a/arch/sh/boards/board-sh7757lcr.c
-+++ b/arch/sh/boards/board-sh7757lcr.c
-@@ -169,6 +169,11 @@ static struct resource sh_eth_giga1_resources[] = {
- .end = 0xfee00fff,
- .flags = IORESOURCE_MEM,
- }, {
-+ /* TSU */
-+ .start = 0xfee01800,
-+ .end = 0xfee01fff,
-+ .flags = IORESOURCE_MEM,
-+ }, {
- .start = 316,
- .end = 316,
- .flags = IORESOURCE_IRQ,
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch b/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
deleted file mode 100644
index 60836e96bbf428..00000000000000
--- a/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:04 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:48:00 +0900
-Subject: [LTSI-dev] [PATCH 20/21] sh: kexec: Register crashk_res
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349D0.4060007@renesas.com>
-
-
->From c6776324925d4d939667e9a7dd28079b35349e98 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Fri, 2 Sep 2011 03:47:12 +0000
-Subject: sh: kexec: Register crashk_res
-
-Register crashk_res so that it can be used by kexec-tools
-via /proc/iomem.
-
-The crash kernel resource needs to be requested the same as the
-other kernel resources due to the fact that it's handled during
-the common path for adding new memory ranges, so it's added in to
-__add_active_range() with the others. This ensures that the crash
-kernel is properly reserved regardless of which memory range it's
-placed in.
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 41309b7a22805f1650c600723d729af453d52719)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/kernel/setup.c | 9 ++++++---
- 1 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
-index 58bff45..1a0e946 100644
---- a/arch/sh/kernel/setup.c
-+++ b/arch/sh/kernel/setup.c
-@@ -211,13 +211,16 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
- }
-
- /*
-- * We don't know which RAM region contains kernel data,
-- * so we try it repeatedly and let the resource manager
-- * test it.
-+ * We don't know which RAM region contains kernel data or
-+ * the reserved crashkernel region, so try it repeatedly
-+ * and let the resource manager test it.
- */
- request_resource(res, &code_resource);
- request_resource(res, &data_resource);
- request_resource(res, &bss_resource);
-+#ifdef CONFIG_KEXEC
-+ request_resource(res, &crashk_res);
-+#endif
-
- /*
- * Also make sure that there is a PMB mapping that covers this
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch b/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch
deleted file mode 100644
index b816516b597aed..00000000000000
--- a/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:07 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Mon, 28 May 2012 18:48:04 +0900
-Subject: [LTSI-dev] [PATCH 21/21] sh: kexec: Add PHYSICAL_START
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FC349D4.5090003@renesas.com>
-
-
->From e5e6ee27709b81739b5c22123e5b4c2f81303570 Mon Sep 17 00:00:00 2001
-From: Simon Horman <horms@verge.net.au>
-Date: Thu, 15 Sep 2011 20:13:00 +0900
-Subject: sh: kexec: Add PHYSICAL_START
-
-Add PHYSICAL_START kernel configuration parameter to set the address at
-which the kernel should be loaded.
-
-It has been observed on an sh7757lcr that simply modifying MEMORY_START
-does not achieve this goal for 32bit sh. This is due to MEMORY_OFFSET in
-arch/sh/kernel/vmlinux.lds.S bot being based on MEMORY_START on such
-systems.
-
-Signed-off-by: Simon Horman <horms@verge.net.au>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit e66ac3f26aef131f5ca60350d25fba95f43acd0d)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
----
- arch/sh/Kconfig | 13 ++++++++++++-
- arch/sh/boot/Makefile | 6 ++++--
- arch/sh/include/asm/page.h | 10 ++++++++++
- arch/sh/kernel/vmlinux.lds.S | 2 +-
- arch/sh/mm/init.c | 8 ++++----
- 5 files changed, 31 insertions(+), 8 deletions(-)
-
-diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
-index bbdeb48..0d07d40 100644
---- a/arch/sh/Kconfig
-+++ b/arch/sh/Kconfig
-@@ -648,7 +648,7 @@ config CRASH_DUMP
- a specially reserved region and then later executed after
- a crash by kdump/kexec. The crash dump kernel must be compiled
- to a memory address not used by the main kernel using
-- MEMORY_START.
-+ PHYSICAL_START.
-
- For more details see Documentation/kdump/kdump.txt
-
-@@ -659,6 +659,17 @@ config KEXEC_JUMP
- Jump between original kernel and kexeced kernel and invoke
- code via KEXEC
-
-+config PHYSICAL_START
-+ hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
-+ default MEMORY_START
-+ ---help---
-+ This gives the physical address where the kernel is loaded
-+ and is ordinarily the same as MEMORY_START.
-+
-+ Different values are primarily used in the case of kexec on panic
-+ where the fail safe kernel needs to run at a different address
-+ than the panic-ed kernel.
-+
- config SECCOMP
- bool "Enable seccomp to safely compute untrusted bytecode"
- depends on PROC_FS
-diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
-index ba515d8..e4ea31a 100644
---- a/arch/sh/boot/Makefile
-+++ b/arch/sh/boot/Makefile
-@@ -19,6 +19,7 @@ CONFIG_MEMORY_START ?= 0x0c000000
- CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
- CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
- CONFIG_ENTRY_OFFSET ?= 0x00001000
-+CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
-
- suffix-y := bin
- suffix-$(CONFIG_KERNEL_GZIP) := gz
-@@ -48,7 +49,7 @@ $(obj)/romimage/vmlinux: $(obj)/zImage FORCE
- $(Q)$(MAKE) $(build)=$(obj)/romimage $@
-
- KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
-- $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
-+ $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
-
- KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_PAGE_OFFSET) + \
-@@ -114,4 +115,5 @@ $(obj)/uImage: $(obj)/uImage.$(suffix-y)
- @echo ' Image $@ is ready'
-
- export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
-- CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
-+ CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
-+ KERNEL_MEMORY suffix-y
-diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
-index abcc4dc..15d9703 100644
---- a/arch/sh/include/asm/page.h
-+++ b/arch/sh/include/asm/page.h
-@@ -113,6 +113,16 @@ typedef struct page *pgtable_t;
- #define __MEMORY_SIZE CONFIG_MEMORY_SIZE
-
- /*
-+ * PHYSICAL_OFFSET is the offset in physical memory where the base
-+ * of the kernel is loaded.
-+ */
-+#ifdef CONFIG_PHYSICAL_START
-+#define PHYSICAL_OFFSET (CONFIG_PHYSICAL_START - __MEMORY_START)
-+#else
-+#define PHYSICAL_OFFSET 0
-+#endif
-+
-+/*
- * PAGE_OFFSET is the virtual address of the start of kernel address
- * space.
- */
-diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
-index 731c10c..c98905f 100644
---- a/arch/sh/kernel/vmlinux.lds.S
-+++ b/arch/sh/kernel/vmlinux.lds.S
-@@ -23,7 +23,7 @@ OUTPUT_ARCH(sh)
- ENTRY(_start)
- SECTIONS
- {
-- . = PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
-+ . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
-
- _text = .; /* Text and read-only data */
-
-diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
-index 58a93fb..c9dbace 100644
---- a/arch/sh/mm/init.c
-+++ b/arch/sh/mm/init.c
-@@ -287,6 +287,8 @@ static void __init do_init_bootmem(void)
- static void __init early_reserve_mem(void)
- {
- unsigned long start_pfn;
-+ u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
-+ u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET;
-
- /*
- * Partially used pages are not usable - thus
-@@ -300,15 +302,13 @@ static void __init early_reserve_mem(void)
- * this catches the (definitely buggy) case of us accidentally
- * initializing the bootmem allocator with an invalid RAM area.
- */
-- memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
-- (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) -
-- (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
-+ memblock_reserve(start, (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - start);
-
- /*
- * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
- */
- if (CONFIG_ZERO_PAGE_OFFSET != 0)
-- memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
-+ memblock_reserve(zero_base, CONFIG_ZERO_PAGE_OFFSET);
-
- /*
- * Handle additional early reservations
---
-1.7.1
-_______________________________________________
-LTSI-dev mailing list
-LTSI-dev@lists.linuxfoundation.org
-https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
-
diff --git a/patches.sh7757lcr/drivers-sh-generalize-runtime-pm-platform-stub.patch b/patches.sh7757lcr/drivers-sh-generalize-runtime-pm-platform-stub.patch
deleted file mode 100644
index f9d1a536719b3a..00000000000000
--- a/patches.sh7757lcr/drivers-sh-generalize-runtime-pm-platform-stub.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jul 10 22:13:21 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 11 Jul 2012 14:13:16 +0900
-Subject: drivers: sh: Generalize runtime PM platform stub.
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FFD0B6C.1060006@renesas.com>
-
-
->From 11b01cfe8fbb175d81f1049e7c265d5618234357 Mon Sep 17 00:00:00 2001
-From: Paul Mundt <lethal@linux-sh.org>
-Date: Fri, 11 Nov 2011 15:41:50 +0900
-Subject: drivers: sh: Generalize runtime PM platform stub.
-
-The runtime PM platform support stub in use by ARM-based SH/R-Mobile
-platforms contains nothing that's specifically ARM-related and instead of
-wholly generic to anything using the clock framework.
-
-The recent runtime PM changes interact rather badly with the lazy
-disabling of clocks late in the boot process through the clock framework,
-leading to situations where the runtime suspend/resume paths are entered
-without a clock being actively driven due to having been lazily gated
-off.
-
-In order to correct this we can trivially tie in the aforementioned stub
-as a general fallback for all SH platforms that don't presently have
-their own runtime PM implementations (the corner case being SH-based
-SH-Mobile platforms, which have their own stub through the hwblk API --
-which in turn has bitrotted and will be subsequently adapted to use the
-same stub as everyone else), regardless of whether the platforms choose
-to define power domains of their own or not.
-
-This fixes up regressions for clock framework users who also build in
-runtime PM support without any specific power domains of their own, which
-was previously causing the serial console to be lost when warring with
-lazy clock disabling.
-
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit 750a7eee7395492960a7aeb3a3a1aa74158ec326)
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
----
- arch/arm/mach-shmobile/Makefile | 2 -
- arch/arm/mach-shmobile/pm_runtime.c | 59 ------------------------------------
- drivers/sh/Makefile | 8 ++++
- drivers/sh/pm_runtime.c | 59 ++++++++++++++++++++++++++++++++++++
- 4 files changed, 68 insertions(+), 60 deletions(-)
- delete mode 100644 arch/arm/mach-shmobile/pm_runtime.c
- create mode 100644 drivers/sh/pm_runtime.c
-
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -3,7 +3,7 @@
- #
-
- # Common objects
--obj-y := timer.o console.o clock.o pm_runtime.o
-+obj-y := timer.o console.o clock.o
-
- # CPU objects
- obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
---- a/arch/arm/mach-shmobile/pm_runtime.c
-+++ /dev/null
-@@ -1,59 +0,0 @@
--/*
-- * arch/arm/mach-shmobile/pm_runtime.c
-- *
-- * Runtime PM support code for SuperH Mobile ARM
-- *
-- * Copyright (C) 2009-2010 Magnus Damm
-- *
-- * This file is subject to the terms and conditions of the GNU General Public
-- * License. See the file "COPYING" in the main directory of this archive
-- * for more details.
-- */
--
--#include <linux/init.h>
--#include <linux/kernel.h>
--#include <linux/io.h>
--#include <linux/pm_runtime.h>
--#include <linux/pm_clock.h>
--#include <linux/platform_device.h>
--#include <linux/clk.h>
--#include <linux/sh_clk.h>
--#include <linux/bitmap.h>
--#include <linux/slab.h>
--
--#ifdef CONFIG_PM_RUNTIME
--
--static int default_platform_runtime_idle(struct device *dev)
--{
-- /* suspend synchronously to disable clocks immediately */
-- return pm_runtime_suspend(dev);
--}
--
--static struct dev_pm_domain default_pm_domain = {
-- .ops = {
-- .runtime_suspend = pm_clk_suspend,
-- .runtime_resume = pm_clk_resume,
-- .runtime_idle = default_platform_runtime_idle,
-- USE_PLATFORM_PM_SLEEP_OPS
-- },
--};
--
--#define DEFAULT_PM_DOMAIN_PTR (&default_pm_domain)
--
--#else
--
--#define DEFAULT_PM_DOMAIN_PTR NULL
--
--#endif /* CONFIG_PM_RUNTIME */
--
--static struct pm_clk_notifier_block platform_bus_notifier = {
-- .pm_domain = DEFAULT_PM_DOMAIN_PTR,
-- .con_ids = { NULL, },
--};
--
--static int __init sh_pm_runtime_init(void)
--{
-- pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
-- return 0;
--}
--core_initcall(sh_pm_runtime_init);
---- a/drivers/sh/Makefile
-+++ b/drivers/sh/Makefile
-@@ -7,3 +7,11 @@ obj-$(CONFIG_HAVE_CLK) += clk/
- obj-$(CONFIG_MAPLE) += maple/
- obj-$(CONFIG_SUPERHYWAY) += superhyway/
- obj-$(CONFIG_GENERIC_GPIO) += pfc.o
-+
-+#
-+# For the moment we only use this framework for ARM-based SH/R-Mobile
-+# platforms and generic SH. SH-based SH-Mobile platforms are still using
-+# an older framework that is pending up-porting, at which point this
-+# special casing can go away.
-+#
-+obj-$(CONFIG_SUPERH)$(CONFIG_ARCH_SHMOBILE) += pm_runtime.o
---- /dev/null
-+++ b/drivers/sh/pm_runtime.c
-@@ -0,0 +1,59 @@
-+/*
-+ * arch/arm/mach-shmobile/pm_runtime.c
-+ *
-+ * Runtime PM support code for SuperH Mobile ARM
-+ *
-+ * Copyright (C) 2009-2010 Magnus Damm
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+#include <linux/pm_runtime.h>
-+#include <linux/pm_clock.h>
-+#include <linux/platform_device.h>
-+#include <linux/clk.h>
-+#include <linux/sh_clk.h>
-+#include <linux/bitmap.h>
-+#include <linux/slab.h>
-+
-+#ifdef CONFIG_PM_RUNTIME
-+
-+static int default_platform_runtime_idle(struct device *dev)
-+{
-+ /* suspend synchronously to disable clocks immediately */
-+ return pm_runtime_suspend(dev);
-+}
-+
-+static struct dev_pm_domain default_pm_domain = {
-+ .ops = {
-+ .runtime_suspend = pm_clk_suspend,
-+ .runtime_resume = pm_clk_resume,
-+ .runtime_idle = default_platform_runtime_idle,
-+ USE_PLATFORM_PM_SLEEP_OPS
-+ },
-+};
-+
-+#define DEFAULT_PM_DOMAIN_PTR (&default_pm_domain)
-+
-+#else
-+
-+#define DEFAULT_PM_DOMAIN_PTR NULL
-+
-+#endif /* CONFIG_PM_RUNTIME */
-+
-+static struct pm_clk_notifier_block platform_bus_notifier = {
-+ .pm_domain = DEFAULT_PM_DOMAIN_PTR,
-+ .con_ids = { NULL, },
-+};
-+
-+static int __init sh_pm_runtime_init(void)
-+{
-+ pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
-+ return 0;
-+}
-+core_initcall(sh_pm_runtime_init);
diff --git a/patches.sh7757lcr/sh-also-without-pm_runtime-pm_runtime.o-must-be-built.patch b/patches.sh7757lcr/sh-also-without-pm_runtime-pm_runtime.o-must-be-built.patch
deleted file mode 100644
index 32a8aee0d9bab4..00000000000000
--- a/patches.sh7757lcr/sh-also-without-pm_runtime-pm_runtime.o-must-be-built.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jul 10 22:13:24 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 11 Jul 2012 14:13:20 +0900
-Subject: sh: also without PM_RUNTIME pm_runtime.o must be built
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FFD0B70.1010608@renesas.com>
-
-
->From c219336ade79e8ce6f70b527c20391a239278ce3 Mon Sep 17 00:00:00 2001
-From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Date: Tue, 10 Jan 2012 16:04:11 +0100
-Subject: sh: also without PM_RUNTIME pm_runtime.o must be built
-
-When CONFIG_PM_RUNTIME is off, drivers/sh/pm_runtime.o still has to be
-built on sh platforms, because then it provides means to statically
-switch on device PM clocks.
-
-Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit d3442b2bb7ce4089fadcf483b8ae9766ab480238)
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
----
- drivers/sh/Makefile | 9 +--------
- 1 file changed, 1 insertion(+), 8 deletions(-)
-
---- a/drivers/sh/Makefile
-+++ b/drivers/sh/Makefile
-@@ -7,11 +7,4 @@ obj-$(CONFIG_HAVE_CLK) += clk/
- obj-$(CONFIG_MAPLE) += maple/
- obj-$(CONFIG_SUPERHYWAY) += superhyway/
- obj-$(CONFIG_GENERIC_GPIO) += pfc.o
--
--#
--# For the moment we only use this framework for ARM-based SH/R-Mobile
--# platforms and generic SH. SH-based SH-Mobile platforms are still using
--# an older framework that is pending up-porting, at which point this
--# special casing can go away.
--#
--obj-$(CONFIG_SUPERH)$(CONFIG_ARCH_SHMOBILE) += pm_runtime.o
-+obj-y += pm_runtime.o
diff --git a/patches.sh7757lcr/sh-fix-clock-sh7757-for-the-latest-sh_mobile_sdhi-driver.patch b/patches.sh7757lcr/sh-fix-clock-sh7757-for-the-latest-sh_mobile_sdhi-driver.patch
deleted file mode 100644
index 89f047dddc9c60..00000000000000
--- a/patches.sh7757lcr/sh-fix-clock-sh7757-for-the-latest-sh_mobile_sdhi-driver.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From ltsi-dev-bounces@lists.linuxfoundation.org Tue Jul 10 22:14:44 2012
-From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 11 Jul 2012 14:13:25 +0900
-Subject: sh: fix clock-sh7757 for the latest sh_mobile_sdhi driver
-To: ltsi-dev@lists.linuxfoundation.org
-Message-ID: <4FFD0B75.1040907@renesas.com>
-
-
->From 87fa88ba8cdcd7425e8d941fef3e5a904da37cc8 Mon Sep 17 00:00:00 2001
-From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
-Date: Wed, 4 Apr 2012 11:56:07 +0900
-Subject: sh: fix clock-sh7757 for the latest sh_mobile_sdhi driver
-
-The commit 996bc8aebd2cd5b6d4c5d85085f171fa2447f364 (mmc: sh_mobile_sdhi:
-do not manage PM clocks manually) modified the sh_mobile_sdhi driver to
-remove the clk_enable/clk_disable. So, we need to change
-the "CLKDEV_CON_ID" to "CLKDEV_DEV_ID".
-
-If we don't change this, we will see the following error from the driver:
- sh_mobile_sdhi sh_mobile_sdhi.0: timeout waiting for hardware interrupt (CMD52)
-
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-(cherry picked from commit a052d2c31b7b87e9b4bdee634af666b5e830e56f)
-Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
-Tested-by: Simon Horman <horms@verge.net.au>
----
- arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
-@@ -113,7 +113,7 @@ static struct clk_lookup lookups[] = {
- CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
-
- /* MSTP32 clocks */
-- CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
-+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP004]),
- CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]),
- CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]),
- CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]),
diff --git a/series b/series
index 78832d33121a45..d0618c18210e5e 100644
--- a/series
+++ b/series
@@ -22,313 +22,9 @@ patches.ltsi/ltsi-makefile-addition.patch
#
# Upstream patches
# 3.2.0 through 3.3-rc3
-patches.android/android-0001-Revert-Staging-android-delete-android-drivers.patch
-patches.android/android-0002-staging-android-fix-build-issues.patch
-patches.android/android-0003-android-common-include-linux-slab.h.patch
-patches.android/android-0004-android-common-Fix-slab.h-includes-for-2.6.34-rc4.patch
-patches.android/android-0005-Revert-Staging-android-mark-subsystem-as-broken.patch
-patches.android/android-0006-staging-android-ramconsole-Ensure-ramconsole-does-not-get-cl.patch
-patches.android/android-0007-Staging-android-ram_console-Start-ram-console-earlier.patch
-patches.android/android-0008-Staging-android-timed_gpio-Request-gpios.patch
-patches.android/android-0009-android-logger-Add-new-system-log-for-framework-system-log-m.patch
-patches.android/android-0010-binder-Use-seq_file-for-debug-interface.patch
-patches.android/android-0011-staging-android-binder-Move-debugging-information-from-procf.patch
-patches.android/android-0012-Staging-android-timed_gpio-Properly-discard-invalid-timeout-.patch
-patches.android/android-0013-Staging-android-binder-Create-dedicated-workqueue-for-binder.patch
-patches.android/android-0014-staging-android-lowmemorykiller-Don-t-try-to-kill-the-same-p.patch
-patches.android/android-0015-staging-android-lowmemkiller-Substantially-reduce-overhead-d.patch
-patches.android/android-0016-staging-binder-Fix-memory-corruption-via-page-aliasing.patch
-patches.android/android-0017-staging-android-lowmemorykiller-Remove-bitrotted-codepath.patch
-patches.android/android-0018-staging-android-lowmemorykiller-Update-arguments-of-shrinker.patch
-patches.android/android-0019-staging-android-lowmemorykiller-Ignore-shmem-pages-in-page-c.patch
-patches.android/android-0020-android-lowmemorykiller-Fix-arguments-to-lowmem_shrink.patch
-patches.android/android-0021-android-logger-bump-up-the-logger-buffer-sizes.patch
-patches.android/android-0022-staging-android-ram_console-pass-in-a-boot-info-string.patch
-patches.android/android-0023-Staging-android-fixed-white-spaces-coding-style-issue-in-log.patch
-patches.android/android-0024-staging-android-switch-switch-class-and-GPIO-drivers.patch
-patches.android/android-0025-staging-android-switch-minor-code-formatting-cleanups.patch
-patches.android/android-0026-staging-android-add-pmem-driver.patch
-patches.android/android-0027-ashmem-Anonymous-shared-memory-subsystem.patch
-patches.android/android-0028-ashmem-Implement-read-2-in-ashmem-driver.patch
-patches.android/android-0029-ashmem-Fix-ASHMEM_SET_PROT_MASK.patch
-patches.android/android-0030-ashmem-Update-arguments-of-shrinker-for-2.6.35.patch
-patches.android/android-0031-ashmem-Support-lseek-2-in-ashmem-driver.patch
-patches.android/android-0032-ashmem-Fix-arguments-to-ashmem_shrink.patch
-patches.android/android-0033-ashmem-Whitespace-cleanups.patch
-patches.android/android-0034-Staging-android-fixed-a-space-warning-in-binder.h.patch
-patches.android/android-0035-Staging-android-fixed-80-characters-warnings-in-lowmemorykil.patch
-patches.android/android-0036-Staging-android-binder-Don-t-call-dump_stack-in-binder_vma_o.patch
-patches.android/android-0037-Staging-android-Remove-pmem-driver.patch
-patches.android/android-0038-Staging-android-binder-Fix-crashes-when-sharing-a-binder-fil.patch
-patches.android/android-0039-staging-android-lowmemorykiller-Don-t-wait-more-than-one-sec.patch
-patches.android/android-0040-staging-android-ram_console-Don-t-build-on-arches-w-o-iorema.patch
-patches.android/staging-android-add-the-code-back-to-the-build.patch
#############################################################################
-# backport of the armadillo800eva board and dependencies to
-# enable the SH Ethernet, LCDC (framebuffer), ST131232 (touchscreen), GPIO keys
-# and SCIF (sereial) drivers.
-patches.armadillo800eva/0001-module.h-split-out-the-EXPORT_SYMBOL-into-export.h.patch
-patches.armadillo800eva/0002-arm-Add-export.h-to-ARM-specific-files-as-required.patch
-patches.armadillo800eva/0003-ARM-mach-shmobile-cpuidle-single-global-and-last_sta.patch
-patches.armadillo800eva/0004-ARM-entry-re-allocate-registers-in-irq-entry-assembl.patch
-patches.armadillo800eva/0005-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
-patches.armadillo800eva/0006-ARM-mach-shmobile-add-shmobile_earlytimer_init.patch
-patches.armadillo800eva/0007-ARM-mach-shmobile-default-to-no-earlytimer.patch
-patches.armadillo800eva/0008-ARM-shmobile-Consolidate-time-keeping-and-irq-enable.patch
-patches.armadillo800eva/0009-sh-pfc-get_config_reg-shift-clean-up.patch
-patches.armadillo800eva/0010-sh-pfc-Remove-unused-gpio_in_use-member.patch
-patches.armadillo800eva/0011-sh-pfc-Add-GPIO-IRQ-support.patch
-patches.armadillo800eva/0012-ARM-mach-shmobile-move-helper-macro-PORT_DATA_xx-to-.patch
-patches.armadillo800eva/0013-ARM-mach-shmobile-move-helper-macro-PORT_xx-to-sh_pf.patch
-patches.armadillo800eva/0014-ARM-mach-shmobile-move-helper-macro-PORTCR-to-sh_pfc.patch
-patches.armadillo800eva/0015-sh-pfc-ioremap-support.patch
-patches.armadillo800eva/0016-sh-pfc-Add-gpio_read_bit-for-data-register-access.patch
-patches.armadillo800eva/0017-sh-pfc-Convert-index-to-field-and-value-pair.patch
-patches.armadillo800eva/0018-sh-pfc-Add-config_reg_helper-function.patch
-patches.armadillo800eva/0019-sh-pfc-Variable-bitfield-width-config-register-suppo.patch
-patches.armadillo800eva/0020-sh-pfc-Unlock-register-support.patch
-patches.armadillo800eva/0021-ARM-mach-shmobile-Break-out-INTC-IRQ-code.patch
-patches.armadillo800eva/0022-sh-intc-enable-both-edges-GPIO-interrupts-on-sh7372.patch
-patches.armadillo800eva/0023-sh-intc-Add-IRQ-trigger-bit-field-check.patch
-patches.armadillo800eva/0024-sh-userimask.c-needs-linux-stat.h.patch
-patches.armadillo800eva/0025-sh-fix-implicit-use-of-stat.h-in-arch-sh-specific-fi.patch
-patches.armadillo800eva/0026-sh-Add-module.h-to-arch-sh-specific-files-as-require.patch
-patches.armadillo800eva/0027-sh-Add-export.h-to-arch-sh-specific-files-as-require.patch
-patches.armadillo800eva/0028-drivers-sh-Add-export.h-for-EXPORT_SYMBOL-to-intc-vi.patch
-patches.armadillo800eva/0029-driver-core-implement-sysdev-functionality-for-regul.patch
-patches.armadillo800eva/0030-sh-intc-Allow-triggering-on-both-edges-for-ARM-SoCs.patch
-patches.armadillo800eva/0031-sh-intc-convert-sysdev_class-to-a-regular-subsystem.patch
-patches.armadillo800eva/0032-PM-shmobile-Don-t-include-SH7372-s-INTCS-in-syscore-.patch
-patches.armadillo800eva/0033-sh-intc-unify-evt2irq-irq2evt-macros-for-sh-and-arm.patch
-patches.armadillo800eva/0034-sh-intc-Make-global-intc-controller-counter-static.patch
-patches.armadillo800eva/0035-genirq-Add-IRQCHIP_SKIP_SET_WAKE-flag.patch
-patches.armadillo800eva/0036-sh-intc-Prefer-IRQCHIP_SKIP_SET_WAKE-over-a-dummy-se.patch
-patches.armadillo800eva/0037-sh-intc-Kill-off-superfluous-irq_shutdown-hooking.patch
-patches.armadillo800eva/0038-sh-intc-Use-IRQ_SET_MASK_OK_NOCOPY-for-intc_set_affi.patch
-patches.armadillo800eva/0039-sh-intc-optimize-intc-IRQ-lookup.patch
-patches.armadillo800eva/0040-sh-intc-remove-dependency-on-NR_IRQS.patch
-patches.armadillo800eva/0041-sh-intc-Fix-up-section-mismatch-for-intc_ack_data.patch
-patches.armadillo800eva/0042-drivers-sh-late-disabling-of-clocks-V2.patch
-patches.armadillo800eva/0043-sh-clkfwk-Convert-to-IS_ERR_OR_NULL.patch
-patches.armadillo800eva/0044-sh-move-CLKDEV_xxx_ID-macro-to-sh_clk.h.patch
-patches.armadillo800eva/0045-switch-assorted-clock-drivers-to-debugfs_remove_recu.patch
-patches.armadillo800eva/0046-sh-clkfwk-add-clk_rate_mult_range_round.patch
-patches.armadillo800eva/0047-sh-clkfwk-Kill-off-remaining-debugfs-cruft.patch
-patches.armadillo800eva/0048-sh-clkfwk-setup-clock-parent-from-current-register-v.patch
-patches.armadillo800eva/0049-sh-extend-clock-struct-with-mapped_reg-member.patch
-patches.armadillo800eva/0050-sh-use-ioread32-iowrite32-and-mapped_reg-for-mstp32.patch
-patches.armadillo800eva/0051-sh-use-ioread32-iowrite32-and-mapped_reg-for-div4.patch
-patches.armadillo800eva/0052-sh-use-ioread32-iowrite32-and-mapped_reg-for-div6.patch
-patches.armadillo800eva/0053-sh-clkfwk-sh_clk_init_parent-should-be-called-after-.patch
-patches.armadillo800eva/0054-sh-clkfwk-bugfix-use-clk_reparent-for-div6-clocks.patch
-patches.armadillo800eva/0055-sh-introduce-sh_clk_ops-in-parallel-with-clk_ops.patch
-patches.armadillo800eva/0056-sh-convert-cpg-code-to-sh_clk_ops.patch
-patches.armadillo800eva/0057-ARM-mach-shmobile-R-Mobile-A1-support.patch
-patches.armadillo800eva/0058-ARM-mach-shmobile-r8a7740-add-PFC-support.patch
-patches.armadillo800eva/0059-ARM-mach-shmobile-r8a7740-add-i2c-support.patch
-patches.armadillo800eva/0060-ARM-mach-shmobile-r8a7740-add-INTC-support.patch
-patches.armadillo800eva/0061-ARM-mach-shmobile-bonito-Add-LCDC0-support.patch
-patches.armadillo800eva/0062-ARM-mach-shmobile-r8a7740-sh_clk_ops-rename.patch
-patches.armadillo800eva/0063-ARM-mach-shmobile-r8a7740-map_io-and-init_early-upda.patch
-patches.armadillo800eva/0064-ARM-mach-shmobile-rename-clk_init-to-shmobile_clk_in.patch
-patches.armadillo800eva/0065-ARM-mach-shmobile-r8a7740-and-Bonito-timer-rework.patch
-patches.armadillo800eva/0066-ARM-mach-shmobile-pfc-r8a7740-add-gpio_irq-support.patch
-patches.armadillo800eva/0067-net-sh_eth-tidyup-compile-warning.patch
-patches.armadillo800eva/0068-net-sh_eth-remove-__flush_purge_region.patch
-patches.armadillo800eva/0069-sh_eth-Move-the-Renesas-SuperH-driver.patch
-patches.armadillo800eva/0070-net-sh_eth-Fix-build-by-forgot-including-linux-inter.patch
-patches.armadillo800eva/0071-net-remove-use-of-ndo_set_multicast_list-in-drivers.patch
-patches.armadillo800eva/0072-net-sh_eth-fix-the-compile-error.patch
-patches.armadillo800eva/0073-net-sh_eth-use-ioremap.patch
-patches.armadillo800eva/0074-sh-modify-prototype-in-sh_eth.h.patch
-patches.armadillo800eva/0075-net-sh_eth-move-the-asm-sh_eth.h-to-include-linux.patch
-patches.armadillo800eva/0076-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-some.patch
-patches.armadillo800eva/0077-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh77.patch
-patches.armadillo800eva/0078-net-sh_eth-fix-build-failure.patch
-patches.armadillo800eva/0079-net-ethernet-convert-drivers-net-ethernet-to-use-mod.patch
-patches.armadillo800eva/0080-net-make-ethtool_ops-const.patch
-patches.armadillo800eva/0081-sh-eth-use-an-unique-MDIO-bus-name.patch
-patches.armadillo800eva/0082-net-sh-eth-Fix-build-error-by-the-value-which-is-not.patch
-patches.armadillo800eva/0083-drivers-net-Remove-alloc_etherdev-error-messages.patch
-patches.armadillo800eva/0084-net-sh_eth-fix-skb_over_panic-happen.patch
-patches.armadillo800eva/0085-sh-eth-use-netdev-stats-structure-and-fix-dma_map_si.patch
-patches.armadillo800eva/0086-netdev-ethernet-dev_alloc_skb-to-netdev_alloc_skb.patch
-patches.armadillo800eva/0087-renesas-sh_eth.c-fix-linux-interrupt.h-included-twic.patch
-patches.armadillo800eva/0088-net-sh_eth-add-the-value-of-tsu-to-the-SH7757-s-GETH.patch
-patches.armadillo800eva/0089-net-sh_eth-change-the-condition-of-initialization.patch
-patches.armadillo800eva/0090-net-sh_eth-modify-a-condition-of-ioremap-for-TSU.patch
-patches.armadillo800eva/0091-net-sh_eth-add-support-for-multicast-filtering.patch
-patches.armadillo800eva/0092-net-sh_eth-add-support-for-VLAN-tag-filtering.patch
-patches.armadillo800eva/0093-net-sh_eth-Add-support-SH7734.patch
-patches.armadillo800eva/0094-net-sh_eth-fix-endian-check-for-architecture-indepen.patch
-patches.armadillo800eva/0095-net-sh_eth-add-support-R8A7740.patch
-patches.armadillo800eva/0096-atomic-use-linux-atomic.h.patch
-patches.armadillo800eva/0097-fbdev-sh_mobile_meram-Enable-runtime-PM.patch
-patches.armadillo800eva/0098-fbdev-sh_mobile_meram-Enable-disable-MERAM-along-wit.patch
-patches.armadillo800eva/0099-fbdev-sh_mobile_meram-Move-private-data-from-.h-to-..patch
-patches.armadillo800eva/0100-fbdev-sh_mobile_meram-Backup-restore-device-register.patch
-patches.armadillo800eva/0101-drivercore-Add-helper-macro-for-platform_driver-boil.patch
-patches.armadillo800eva/0102-drivercore-Generalize-module_platform_driver.patch
-patches.armadillo800eva/0103-fbdev-sh_mobile_lcdc-Turn-dot-clock-on-before-resumi.patch
-patches.armadillo800eva/0104-fbdev-sh_mobile_lcdc-Replace-hardcoded-register-valu.patch
-patches.armadillo800eva/0105-fbdev-sh_mobile_lcdc-Don-t-acknowlege-interrupts-uni.patch
-patches.armadillo800eva/0106-fbdev-sh_mobile_lcdc-Compute-clock-pattern-using-div.patch
-patches.armadillo800eva/0107-fbdev-sh_mobile_lcdc-Split-LCDC-start-code-from-sh_m.patch
-patches.armadillo800eva/0108-fbdev-sh_mobile_lcdc-Store-the-frame-buffer-base-add.patch
-patches.armadillo800eva/0109-fbdev-sh_mobile_lcdc-Restart-LCDC-in-runtime-PM-resu.patch
-patches.armadillo800eva/0110-fbdev-sh_mobile_meram-Replace-hardcoded-register-val.patch
-patches.armadillo800eva/0111-fbdev-sh_mobile_meram-Validate-ICB-configuration-out.patch
-patches.armadillo800eva/0112-fbdev-sh_mobile_meram-Fix-MExxCTL-register-save-on-r.patch
-patches.armadillo800eva/0113-fbdev-sh_mobile_meram-Remove-unneeded-sh_mobile_mera.patch
-patches.armadillo800eva/0114-sh_mobile_meram-Reset-ICBs-at-unregistration-time.patch
-patches.armadillo800eva/0115-fbdev-sh_mobile_lcdc-Adjust-requested-parameters-in-.patch
-patches.armadillo800eva/0116-fbdev-sh_mobile_lcdc-Add-support-for-format-changes-.patch
-patches.armadillo800eva/0117-fbdev-sh_mobile_lcdc-use-display-information-in-info.patch
-patches.armadillo800eva/0118-fbdev-sh_mobile_lcdc-Update-fix.line_length-in-.fb_s.patch
-patches.armadillo800eva/0119-fbdev-sh_mobile_lcdc-Avoid-forward-declarations.patch
-patches.armadillo800eva/0120-fbdev-sh_mobile_lcdc-Split-channel-initialization-fr.patch
-patches.armadillo800eva/0121-fbdev-sh_mobile_lcdc-Remove-sh_mobile_lcdc_set_bpp.patch
-patches.armadillo800eva/0122-video-irq-Remove-IRQF_DISABLED.patch
-patches.armadillo800eva/0123-video-Add-module.h-to-drivers-video-files-who-really.patch
-patches.armadillo800eva/0124-fbdev-sh_mobile_lcdcfb-fixup-LDHAJR-HSYNPAJ-needs-ma.patch
-patches.armadillo800eva/0125-fbdev-sh_mipi_dsi-tidyup-dsip_clk.patch
-patches.armadillo800eva/0126-fbdev-sh_mipi_dsi-typo-fix-of-SH_MIPI_DSI_HBPBM.patch
-patches.armadillo800eva/0127-fbdev-sh_mipi_dsi-tidyup-VMCTR2-parameter-expression.patch
-patches.armadillo800eva/0128-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_HFPBM-flag.patch
-patches.armadillo800eva/0129-fbdev-sh_mipi_dsi-add-SH_MIPI_DSI_BL2E-flag.patch
-patches.armadillo800eva/0130-fbdev-sh_mipi_dsi-add-lane-control-support.patch
-patches.armadillo800eva/0131-fbdev-sh_mipi_dsi-add-sync_pulses-sync_events-burst-.patch
-patches.armadillo800eva/0132-fbdev-sh_mipi_dsi-add-VMLEN1-VMLEN2-calculation.patch
-patches.armadillo800eva/0133-fbdev-sh_mipi_dsi-add-set_dot_clock-for-each-platfor.patch
-patches.armadillo800eva/0134-fbdev-sh_mipi_dsi-add-HSxxCLK-support.patch
-patches.armadillo800eva/0135-fbdev-sh_mipi_dsi-sh_mipi-has-pdata-instead-of-dev.patch
-patches.armadillo800eva/0136-fbdev-sh_mipi_dsi-fixup-setup-timing-of-sh_mipi_setu.patch
-patches.armadillo800eva/0137-fbdev-sh_mipi_dsi-fixup-setup-timing-of-SYSCONF.patch
-patches.armadillo800eva/0138-fbdev-sh_mipi_dsi-fixup-setup-timing-DSICTRL.patch
-patches.armadillo800eva/0139-video-convert-drivers-video-to-use-module_platform_d.patch
-patches.armadillo800eva/0140-fbdev-Add-FOURCC-based-format-configuration-API.patch
-patches.armadillo800eva/0141-v4l-Add-V4L2_PIX_FMT_NV24-and-V4L2_PIX_FMT_NV42-form.patch
-patches.armadillo800eva/0142-arm-fix-compile-failure-in-mach-shmobile-board-ag5ev.patch
-patches.armadillo800eva/0143-sh-se7724-fix-compile-breakage.patch
-patches.armadillo800eva/0144-fbdev-sh_mobile_lcdc-Support-FOURCC-based-format-API.patch
-patches.armadillo800eva/0145-fbdev-sh_mobile_lcdc-Reorder-code-into-sections.patch
-patches.armadillo800eva/0146-fbdev-sh_mobile_lcdc-Mark-init-only-symbols-with-__d.patch
-patches.armadillo800eva/0147-fbdev-sh_mobile_lcdc-Move-pm-runtime-enable-to-probe.patch
-patches.armadillo800eva/0148-fbdev-sh_mobile_lcdc-Don-t-pass-struct-device-around.patch
-patches.armadillo800eva/0149-fbdev-sh_mobile_lcdc-Create-functions-to-turn-the-di.patch
-patches.armadillo800eva/0150-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-channel-in-no.patch
-patches.armadillo800eva/0151-sh_mobile_hdmi-Remove-platform-data-lcd_dev-field.patch
-patches.armadillo800eva/0152-fbdev-sh_mobile_lcdc-Add-sh_mobile_lcdc_entity-defin.patch
-patches.armadillo800eva/0153-fbdev-sh_mobile_hdmi-Implement-sh_mobile_lcdc_entity.patch
-patches.armadillo800eva/0154-fbdev-sh_mipi_dsi-Implement-sh_mobile_lcdc_entity-in.patch
-patches.armadillo800eva/0155-fbdev-sh_mobile_lcdc-Handle-HDMI-MIPI-transmitter-de.patch
-patches.armadillo800eva/0156-fbdev-sh_mipi_dsi-Don-t-hook-up-into-board_cfg-displ.patch
-patches.armadillo800eva/0157-fbdev-sh_mobile_hdmi-Don-t-hook-up-into-board_cfg-di.patch
-patches.armadillo800eva/0158-arm-mach-shmobile-Don-t-initialize-the-hdmi_info-lcd.patch
-patches.armadillo800eva/0159-fbdev-sh_mobile_hdmi-Remove-sh_mobile_hdmi_info-lcd_.patch
-patches.armadillo800eva/0160-fbdev-sh_mobile_lcdc-Remove-board-configuration-owne.patch
-patches.armadillo800eva/0161-fbdev-sh_mobile_lcdc-Remove-board-configuration-boar.patch
-patches.armadillo800eva/0162-fbdev-sh_mobile_lcdc-Move-brightness-ops-to-sh_mobil.patch
-patches.armadillo800eva/0163-fbdev-sh_mobile_lcdc-Merge-board_cfg-and-lcd_size_cf.patch
-patches.armadillo800eva/0164-sh_mobile_lcdc-Add-an-lcdc-channel-pointer-to-sh_mob.patch
-patches.armadillo800eva/0165-sh_mobile_hdmi-Use-sh_mobile_lcdc_entity-channel-to-.patch
-patches.armadillo800eva/0166-fbdev-sh_mobile_lcdc-Remove-fb_info-parameter-to-dis.patch
-patches.armadillo800eva/0167-fbdev-sh_mobile_lcdc-Return-display-connection-state.patch
-patches.armadillo800eva/0168-sh_mobile_lcdc-Add-display-notify-callback-to-sh_mob.patch
-patches.armadillo800eva/0169-sh_mobile_hdmi-Use-LCDC-notification-callback.patch
-patches.armadillo800eva/0170-fbdev-sh_mobile_lcdc-Pass-a-video-mode-to-the-notify.patch
-patches.armadillo800eva/0171-fbdev-sh_mobile_hdmi-Don-t-set-sh_hdmi-mode-in-the-d.patch
-patches.armadillo800eva/0172-fbdev-sh_mobile_hdmi-Don-t-access-LCDC-fb_info.patch
-patches.armadillo800eva/0173-fbdev-sh_mobile_lcdc-Store-display-mode-in-a-struct-.patch
-patches.armadillo800eva/0174-fbdev-sh_mobile_lcdc-Rename-lcd-num-_cfg-lcd-num-_mo.patch
-patches.armadillo800eva/0175-fbdev-sh_mobile_lcdc-Reorganize-the-sh_mobile_lcdc_c.patch
-patches.armadillo800eva/0176-fbdev-sh_mobile_lcdc-Add-sh_mobile_format_info-funct.patch
-patches.armadillo800eva/0177-fbdev-sh_mobile_lcdc-Store-the-format-in-struct-sh_m.patch
-patches.armadillo800eva/0178-fbdev-sh_mobile_lcdc-Split-fb-init-cleanup-from-chan.patch
-patches.armadillo800eva/0179-fbdev-sh_mobile_lcdc-Pass-physical-device-pointer-to.patch
-patches.armadillo800eva/0180-fbdev-sh_mobile_lcdc-Store-configuration-in-channel-.patch
-patches.armadillo800eva/0181-fbdev-sh_mobile_lcdc-Pass-channel-pointer-to-sh_mobi.patch
-patches.armadillo800eva/0182-fbdev-sh_mobile_meram-Request-memory-regions-for-mem.patch
-patches.armadillo800eva/0183-fbdev-sh_mobile_meram-Add-_cfg-suffix-to-struct-sh_m.patch
-patches.armadillo800eva/0184-fbdev-sh_mobile_meram-Make-variables-unsigned-where-.patch
-patches.armadillo800eva/0185-fbdev-sh_mobile_meram-Make-current_reg-field-store-t.patch
-patches.armadillo800eva/0186-fbdev-sh_mobile_meram-Add-struct-sh_mobile_meram_icb.patch
-patches.armadillo800eva/0187-fbdev-sh_mobile_meram-Don-t-inline-everything.patch
-patches.armadillo800eva/0188-fbdev-sh_mobile_meram-Divide-the-code-into-sections.patch
-patches.armadillo800eva/0189-fbdev-sh_mobile_meram-Use-genalloc-to-manage-MERAM-a.patch
-patches.armadillo800eva/0190-fbdev-sh_mobile_meram-Allocate-ICBs-automatically.patch
-patches.armadillo800eva/0191-arm-mach-shmobile-Don-t-set-MERAM-ICB-numbers-in-pla.patch
-patches.armadillo800eva/0192-fbdev-sh_mobile_meram-Remove-unused-sh_mobile_meram_.patch
-patches.armadillo800eva/0193-fbdev-sh_mobile_lcdc-Don-t-store-copy-of-platform-da.patch
-patches.armadillo800eva/0194-fbdev-sh_mobile_meram-Don-t-perform-update-in-regist.patch
-patches.armadillo800eva/0195-fbdev-sh_mobile_meram-Remove-unneeded-sanity-checks.patch
-patches.armadillo800eva/0196-fbdev-sh_mobile_meram-Implement-system-suspend-resum.patch
-patches.armadillo800eva/0197-fbdev-sh_mipi_dsi-add-extra-phyctrl-for-sh_mipi_dsi_.patch
-patches.armadillo800eva/0198-serial-sh-sci-Kill-off-bitrotted-H8-300-support.patch
-patches.armadillo800eva/0199-serial-sh-sci-Tidy-up-ioread-write-wrappers-kill-off.patch
-patches.armadillo800eva/0200-serial-sh-sci-Kill-off-some-more-unused-definitions.patch
-patches.armadillo800eva/0201-serial-sh-sci-Generalize-overrun-handling.patch
-patches.armadillo800eva/0202-serial-sh-sci-Consolidate-RXD-pin-handling.patch
-patches.armadillo800eva/0203-serial-sh-sci-More-unused-define-purging.patch
-patches.armadillo800eva/0204-serial-sh-sci-Abstract-register-maps.patch
-patches.armadillo800eva/0205-serial-sh-sci-FIFO-sizing-helper-consolidation.patch
-patches.armadillo800eva/0206-serial-sh-sci-Support-generic-SCLSR-overrun-detectio.patch
-patches.armadillo800eva/0207-serial-sh-sci-Regtype-probing-doesn-t-need-to-be-fat.patch
-patches.armadillo800eva/0208-serial-sh-sci-Add-missing-module-description-author-.patch
-patches.armadillo800eva/0209-serial-sh-sci-Kill-off-per-port-enable-disable-callb.patch
-patches.armadillo800eva/0210-serial-sh-sci-Fix-up-pretty-name-printing-for-port-I.patch
-patches.armadillo800eva/0211-serial-sh-sci-Fix-up-default-regtype-probing.patch
-patches.armadillo800eva/0212-serial-sh-sci-fix-DMA-build-by-including-dma-mapping.patch
-patches.armadillo800eva/0213-serial-sh-sci-console-Runtime-PM-support.patch
-patches.armadillo800eva/0214-sh-sci-PM-Use-power.irq_safe.patch
-patches.armadillo800eva/0215-serial-sh-sci-report-CTS-as-active-for-get_mctrl.patch
-patches.armadillo800eva/0216-serial-sh-sci-don-t-filter-on-DMA-device-use-only-ch.patch
-patches.armadillo800eva/0217-TTY-irq-Remove-IRQF_DISABLED.patch
-patches.armadillo800eva/0218-serial-sh-sci-Fix-up-SH-2A-SCIF-support.patch
-patches.armadillo800eva/0219-serial-sh-sci-Fix-up-SCFCR-handling.patch
-patches.armadillo800eva/0220-serial-sh-sci-Support-icount-statistics-for-error-ca.patch
-patches.armadillo800eva/0221-serial-sh-sci-Clarify-enable_ms-break_ctl-comments.patch
-patches.armadillo800eva/0222-serial-sh-sci-Fix-up-modem-control-handling.patch
-patches.armadillo800eva/0223-serial-sh-sci-Add-support-for-loopback-mode.patch
-patches.armadillo800eva/0224-serial-sh-sci-per-port-modem-control.patch
-patches.armadillo800eva/0225-serial-sh-sci-Avoid-FIFO-clear-for-MCE-toggle.patch
-patches.armadillo800eva/0226-serial-sh-sci-Handle-GPIO-function-requests.patch
-patches.armadillo800eva/0227-Input-gpio_keys-switch-to-using-threaded-IRQs.patch
-patches.armadillo800eva/0228-Input-gpio_keys-move-to-late_initcall.patch
-patches.armadillo800eva/0229-Input-gpio_keys-fix-a-memory-leak.patch
-patches.armadillo800eva/0230-Input-gpio_keys-add-support-for-device-tree-platform.patch
-patches.armadillo800eva/0231-Input-gpio_keys-switch-to-using-SIMPLE_DEV_PM_OPS.patch
-patches.armadillo800eva/0232-Input-gpio_keys-return-proper-error-code-if-memory-a.patch
-patches.armadillo800eva/0233-Input-gpio_keys-fix-two-typos-in-devicetree-document.patch
-patches.armadillo800eva/0234-Input-gpio_keys-use-of_property_read_u32.patch
-patches.armadillo800eva/0235-Input-gpio_keys-fix-struct-device-declared-inside-pa.patch
-patches.armadillo800eva/0236-Input-gpio_keys-constify-platform-data.patch
-patches.armadillo800eva/0237-Input-revert-gpio_keys-switch-to-using-threaded-IRQs.patch
-patches.armadillo800eva/0238-Input-gpio_keys-consolidate-key-destructor-code.patch
-patches.armadillo800eva/0239-Input-gpio_keys-add-support-for-interrupt-only-keys.patch
-patches.armadillo800eva/0240-Input-sh_keysc-fix-compile-warning.patch
-patches.armadillo800eva/0241-Input-keyboard-use-macro-module_platform_driver.patch
-patches.armadillo800eva/0242-Update-Nook-Color-machine-3284-to-common-Encore-name.patch
-patches.armadillo800eva/0243-ARM-7051-1-cpuimx-boards-fix-mach-types-errors.patch
-patches.armadillo800eva/0244-ARM-Add-a-few-machine-types-to-mach-types.patch
-patches.armadillo800eva/0245-ARM-Update-mach-types-to-fix-mxs-build-breakage.patch
-patches.armadillo800eva/0246-ARM-7193-1-Fix-machine_is_xxx-naming-for-eSata-Sheev.patch
-patches.armadillo800eva/0247-ARM-Update-mach-types.patch
-patches.armadillo800eva/0248-ARM-mach-shmobile-add-armadillo800eva-board-support.patch
-patches.armadillo800eva/0249-ARM-mach-shmobile-armadillo800eva-add-defconfig.patch
-patches.armadillo800eva/0250-ARM-mach-shmobile-armadillo800eva-add-support-LCDC0.patch
-patches.armadillo800eva/0251-ARM-mach-shmobile-armadillo800eva-add-support-ST1232.patch
-patches.armadillo800eva/0252-ARM-mach-shmobile-armadillo800eva-add-support-gpio_k.patch
-patches.armadillo800eva/0253-ARM-mach-shmobile-armadillo800eva-add-support-sh_eth.patch
-patches.armadillo800eva/arm-mach-shmobile-sh7372-ap4evb-and-mackerel-timer-rework.patch
-patches.armadillo800eva/ltsi-bugfix-armadillo800eva-sh_eth-needs-net_ethernet-on-defconfig.patch
-patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-update.patch
-patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-allow-use-of-armhf-userspace.patch
-patches.armadillo800eva/arm-mach-shmobile-armadillo800eva-defconfig-disable-config_sysfs_deprecated.patch
-
-#############################################################################
# LTTNG
# Patches came from short-lived experiment when they were added to the staging
# tree for a week or so.
@@ -365,216 +61,6 @@ patches.lttng/lttng-update-to-v2.0.1.patch
patches.lttng/lttng-update-2.0.1-to-2.0.4.patch
patches.lttng/lttng-fix-module-name-lttng-relay.ko-lttng-tracer.ko.patch
-patches.runtime_pm/0001-Revert-PM-Runtime-Automatically-retry-failed-autosus.patch
-patches.runtime_pm/0002-PM-Domains-Rename-struct-dev_power_domain-to-struct-.patch
-patches.runtime_pm/0003-PM-subsys_data-in-struct-dev_pm_info-need-not-depend.patch
-patches.runtime_pm/0004-PM-Domains-Support-for-generic-I-O-PM-domains-v8.patch
-patches.runtime_pm/0005-PM-Introduce-generic-noirq-callback-routines-for-sub.patch
-patches.runtime_pm/0006-PM-Domains-Move-code-from-under-ifdef-CONFIG_PM_RUNT.patch
-patches.runtime_pm/0007-PM-Domains-System-wide-transitions-support-for-gener.patch
-patches.runtime_pm/0008-PM-Domains-Wakeup-devices-support-for-system-sleep-t.patch
-patches.runtime_pm/0009-PM-Allow-the-clocks-management-code-to-be-used-durin.patch
-patches.runtime_pm/0010-PM-Rename-clock-management-functions.patch
-patches.runtime_pm/0011-PM-Runtime-Update-documentation-of-interactions-with.patch
-patches.runtime_pm/0012-PM-Runtime-Return-special-error-code-if-runtime-PM-i.patch
-patches.runtime_pm/0013-PM-Limit-race-conditions-between-runtime-PM-and-syst.patch
-patches.runtime_pm/0014-PM-Runtime-Improve-documentation-of-enable-disable-a.patch
-patches.runtime_pm/0015-PM-Runtime-Replace-run-time-with-runtime-in-document.patch
-patches.runtime_pm/0016-PM-Runtime-Prevent-runtime_resume-from-racing-with-p.patch
-patches.runtime_pm/0017-PM-Runtime-Consistent-utilization-of-deferred_resume.patch
-patches.runtime_pm/0018-PM-Domains-Export-pm_genpd_poweron-in-header.patch
-patches.runtime_pm/0019-doc-Konfig-Documentation-power-pm-apm-acpi-.txt.patch
-patches.runtime_pm/0020-PM-Domains-Set-device-state-to-active-during-system-.patch
-patches.runtime_pm/0021-PM-Domains-Make-failing-pm_genpd_prepare-clean-up-pr.patch
-patches.runtime_pm/0022-PM-Domains-Do-not-execute-device-callbacks-under-loc.patch
-patches.runtime_pm/0023-PM-Domains-Allow-callbacks-to-execute-all-runtime-PM.patch
-patches.runtime_pm/0024-PM-Domains-Do-not-restore-all-devices-on-power-off-e.patch
-patches.runtime_pm/0025-PM-Domains-Improve-handling-of-wakeup-devices-during.patch
-patches.runtime_pm/0026-PM-Domains-Queue-up-power-off-work-only-if-it-is-not.patch
-patches.runtime_pm/0027-PM-Runtime-Add-new-helper-function-pm_runtime_status.patch
-patches.runtime_pm/0028-PM-Domains-Introduce-function-to-power-off-all-unuse.patch
-patches.runtime_pm/0029-ARM-shmobile-Use-genpd_queue_power_off_work.patch
-patches.runtime_pm/0030-PM-Domains-Take-.power_off-error-code-into-account.patch
-patches.runtime_pm/0031-PM-OPP-Introduce-function-to-free-cpufreq-table.patch
-patches.runtime_pm/0032-PM-Suspend-Add-.suspend_again-callback-to-suspend_op.patch
-patches.runtime_pm/0033-PM-Suspend-Export-suspend_set_ops-suspend_valid_only.patch
-patches.runtime_pm/0034-PM-Add-RTC-to-PM-trace-time-stamps-to-avoid-confusio.patch
-patches.runtime_pm/0035-PM-Improve-error-code-of-pm_notifier_call_chain.patch
-patches.runtime_pm/0036-drivers-base-power-opp.c-fix-dev_opp-initial-value.patch
-patches.runtime_pm/0037-PM-Domains-Fix-pm_genpd_poweron.patch
-patches.runtime_pm/0038-PM-Runtime-Allow-_put_sync-from-interrupts-disabled-.patch
-patches.runtime_pm/0039-PM-Domains-Fix-build-for-CONFIG_PM_RUNTIME-unset.patch
-patches.runtime_pm/0040-PM-Runtime-Add-might_sleep-to-runtime-PM-functions.patch
-patches.runtime_pm/0041-PM-Runtime-Add-macro-to-test-for-runtime-PM-events.patch
-patches.runtime_pm/0042-PM-Use-spinlock-instead-of-mutex-in-clock-management.patch
-patches.runtime_pm/0043-PM-Runtime-Correct-documentation-of-pm_runtime_irq_s.patch
-patches.runtime_pm/0044-PM-Domains-Implement-subdomain-counters-as-atomic-fi.patch
-patches.runtime_pm/0045-PM-Domains-Do-not-take-parent-locks-to-modify-subdom.patch
-patches.runtime_pm/0046-PM-Domains-Make-pm_genpd_poweron-always-survive-pare.patch
-patches.runtime_pm/0047-PM-Domains-Add-wait-for-parent-status-for-generic-PM.patch
-patches.runtime_pm/0048-PM-Domains-Allow-generic-PM-domains-to-have-multiple.patch
-patches.runtime_pm/0049-PM-Domains-Rename-GPD_STATE_WAIT_PARENT-to-GPD_STATE.patch
-patches.runtime_pm/0050-PM-Domains-Rename-argument-of-pm_genpd_add_subdomain.patch
-patches.runtime_pm/0051-PM-Introduce-struct-pm_subsys_data.patch
-patches.runtime_pm/0052-PM-Reference-counting-of-power.subsys_data.patch
-patches.runtime_pm/0053-PM-Domains-Use-power.sybsys_data-to-reduce-overhead.patch
-patches.runtime_pm/0054-PM-QoS-Move-and-rename-the-implementation-files.patch
-patches.runtime_pm/0055-plist-Remove-the-need-to-supply-locks-to-plist-heads.patch
-patches.runtime_pm/0056-PM-QoS-Minor-clean-ups.patch
-patches.runtime_pm/0057-PM-QoS-Code-reorganization.patch
-patches.runtime_pm/0058-PM-QoS-Reorganize-data-structs.patch
-patches.runtime_pm/0059-PM-QoS-Generalize-and-export-constraints-management-.patch
-patches.runtime_pm/0060-PM-QoS-Implement-per-device-PM-QoS-constraints.patch
-patches.runtime_pm/0061-PM-QoS-Add-global-notification-mechanism-for-device-.patch
-patches.runtime_pm/0062-PM-Domains-Preliminary-support-for-devices-with-powe.patch
-patches.runtime_pm/0063-PM-Runtime-pm_runtime_idle-can-be-called-in-atomic-c.patch
-patches.runtime_pm/0064-cpu_pm-Add-cpu-power-management-notifiers.patch
-patches.runtime_pm/0065-PM-Clocks-Do-not-acquire-a-mutex-under-a-spinlock.patch
-patches.runtime_pm/0066-PM-Domains-Split-device-PM-domain-data-into-base-and.patch
-patches.runtime_pm/0067-doc-fix-broken-references.patch
-patches.runtime_pm/0068-PM-Runtime-Don-t-run-callbacks-under-lock-for-power..patch
-patches.runtime_pm/0069-PM-Runtime-Introduce-trace-points-for-tracing-rpm_-f.patch
-patches.runtime_pm/0070-PM-Tracing-build-rpm-traces.c-only-if-CONFIG_PM_RUNT.patch
-patches.runtime_pm/0071-PM-Runtime-Replace-dev_dbg-with-trace_rpm_.patch
-patches.runtime_pm/0072-PM-OPP-Add-OPP-availability-change-notifier.patch
-patches.runtime_pm/0073-PM-OPP-Fix-build-when-CONFIG_PM_OPP-is-not-set.patch
-patches.runtime_pm/0074-PM-QoS-Add-function-dev_pm_qos_read_value-v3.patch
-patches.runtime_pm/0075-PM-QoS-Update-Documentation-for-the-pm_qos-and-dev_p.patch
-patches.runtime_pm/0076-regulator-Fix-some-bitrot-in-the-machine-driver-docu.patch
-patches.runtime_pm/0077-regulator-Clarify-documentation-for-regulator-regula.patch
-patches.runtime_pm/0078-PM-Runtime-Update-document-about-callbacks.patch
-patches.runtime_pm/0079-PM-Runtime-Fix-kerneldoc-comment-for-rpm_suspend.patch
-patches.runtime_pm/0080-PM-Runtime-Handle-.runtime_suspend-failure-correctly.patch
-patches.runtime_pm/0081-PM-Suspend-Add-statistics-debugfs-file-for-suspend-t.patch
-patches.runtime_pm/0082-PM-Fix-build-issue-in-main.c-for-CONFIG_PM_SLEEP-uns.patch
-patches.runtime_pm/0083-PM-Hibernate-Include-storage-keys-in-hibernation-ima.patch
-patches.runtime_pm/0084-PM-VT-Cleanup-if-defined-uglyness-and-fix-compile-er.patch
-patches.runtime_pm/0085-PM-Update-the-policy-on-default-wakeup-settings.patch
-patches.runtime_pm/0086-PM-Hibernate-Freeze-kernel-threads-after-preallocati.patch
-patches.runtime_pm/0087-PM-Hibernate-Fix-typo-in-a-kerneldoc-comment.patch
-patches.runtime_pm/0088-PM-Hibernate-Add-resumewait-param-to-support-MMC-lik.patch
-patches.runtime_pm/0089-PM-Hibernate-Add-resumedelay-kernel-param-in-additio.patch
-patches.runtime_pm/0090-PM-Hibernate-Do-not-initialize-static-and-extern-var.patch
-patches.runtime_pm/0091-PM-Hibernate-Improve-performance-of-LZO-plain-hibern.patch
-patches.runtime_pm/0092-PM-Sleep-Mark-devices-involved-in-wakeup-signaling-d.patch
-patches.runtime_pm/0093-PM-Documentation-Update-docs-about-suspend-and-CPU-h.patch
-patches.runtime_pm/0094-PM-Clocks-Remove-redundant-NULL-checks-before-kfree.patch
-patches.runtime_pm/0095-kernel-fix-several-implicit-usasges-of-kmod.h.patch
-patches.runtime_pm/0096-kernel-Fix-files-explicitly-needing-EXPORT_SYMBOL-in.patch
-patches.runtime_pm/0097-drivers-base-Add-export.h-for-EXPORT_SYMBOL-THIS_MOD.patch
-patches.runtime_pm/0098-drivers-base-change-module.h-export.h-in-power-commo.patch
-patches.runtime_pm/0099-pm_runtime.h-explicitly-requires-notifier.h.patch
-patches.runtime_pm/0100-PM-Sleep-Update-freezer-documentation.patch
-patches.runtime_pm/0101-PM-Runtime-Fix-runtime-accounting-calculation-error.patch
-patches.runtime_pm/0102-PM-QoS-Remove-redundant-check.patch
-patches.runtime_pm/0103-PM-Runtime-Automatically-retry-failed-autosuspends.patch
-patches.runtime_pm/0104-PM-QoS-Set-cpu_dma_pm_qos-name.patch
-patches.runtime_pm/0105-PM-OPP-Use-ERR_CAST-instead-of-ERR_PTR-PTR_ERR.patch
-patches.runtime_pm/0106-PM-Clocks-Only-disable-enabled-clocks-in-pm_clk_susp.patch
-patches.runtime_pm/0107-PM-QoS-Properly-use-the-WARN-macro-in-dev_pm_qos_add.patch
-patches.runtime_pm/0108-PM-Sleep-Do-not-extend-wakeup-paths-to-devices-with-.patch
-patches.runtime_pm/0109-PM-Hibernate-Fix-the-early-termination-of-test-modes.patch
-patches.runtime_pm/0110-PM-Suspend-Fix-bug-in-suspend-statistics-update.patch
-patches.runtime_pm/0111-freezer-don-t-unnecessarily-set-PF_NOFREEZE-explicit.patch
-patches.runtime_pm/0112-freezer-fix-current-state-restoration-race-in-refrig.patch
-patches.runtime_pm/0113-freezer-unexport-refrigerator-and-update-try_to_free.patch
-patches.runtime_pm/0114-oom-thaw-threads-if-oom-killed-thread-is-frozen-befo.patch
-patches.runtime_pm/0115-freezer-implement-and-use-kthread_freezable_should_s.patch
-patches.runtime_pm/0116-freezer-rename-thaw_process-to-__thaw_task-and-simpl.patch
-patches.runtime_pm/0117-freezer-remove-racy-clear_freeze_flag-and-set-PF_NOF.patch
-patches.runtime_pm/0118-freezer-don-t-distinguish-nosig-tasks-on-thaw.patch
-patches.runtime_pm/0119-freezer-use-dedicated-lock-instead-of-task_lock-memo.patch
-patches.runtime_pm/0120-freezer-make-freezing-indicate-freeze-condition-in-e.patch
-patches.runtime_pm/0121-freezer-test-freezable-conditions-while-holding-free.patch
-patches.runtime_pm/0122-freezer-clean-up-freeze_processes-failure-path.patch
-patches.runtime_pm/0123-cgroup_freezer-prepare-for-removal-of-TIF_FREEZE.patch
-patches.runtime_pm/0124-freezer-make-freezing-test-freeze-conditions-in-effe.patch
-patches.runtime_pm/0125-Freezer-fix-more-fallout-from-the-thaw_process-renam.patch
-patches.runtime_pm/0126-freezer-remove-unused-sig_only-from-freeze_task.patch
-patches.runtime_pm/0127-PM-Hibernate-Do-not-leak-memory-in-error-test-code-p.patch
-patches.runtime_pm/0128-PM-Fix-indentation-and-remove-extraneous-whitespaces.patch
-patches.runtime_pm/0129-PM-Sleep-Remove-unnecessary-label-and-jumps-to-it-fo.patch
-patches.runtime_pm/0130-PM-Sleep-Simplify-device_suspend_noirq.patch
-patches.runtime_pm/0131-PM-Hibernate-Refactor-and-simplify-hibernation_snaps.patch
-patches.runtime_pm/0132-PM-Domains-Document-how-PM-domains-are-used-by-the-P.patch
-patches.runtime_pm/0133-PM-Sleep-Correct-inaccurate-information-in-devices.t.patch
-patches.runtime_pm/0134-PM-Runtime-Make-documentation-follow-the-new-behavio.patch
-patches.runtime_pm/0135-PM-Sleep-Update-documentation-related-to-system-wake.patch
-patches.runtime_pm/0136-PM-Update-comments-describing-device-power-managemen.patch
-patches.runtime_pm/0137-PM-Runtime-Use-device-PM-QoS-constraints-v2.patch
-patches.runtime_pm/0138-PM-Domains-Make-it-possible-to-use-per-device-domain.patch
-patches.runtime_pm/0139-PM-Domains-Introduce-save-restore-state-device-callb.patch
-patches.runtime_pm/0140-PM-Domains-Rework-system-suspend-callback-routines-v.patch
-patches.runtime_pm/0141-PM-Domains-Add-device-stop-governor-function-v4.patch
-patches.runtime_pm/0142-PM-Domains-Add-default-power-off-governor-function-v.patch
-patches.runtime_pm/0143-PM-Domains-Automatically-update-overoptimistic-laten.patch
-patches.runtime_pm/0144-PM-Domains-fix-compilation-failure-for-CONFIG_PM_GEN.patch
-patches.runtime_pm/0145-regulator-Fix-regulator_register-API-signature-in-Do.patch
-patches.runtime_pm/0146-PM-Hibernate-Enable-usermodehelpers-in-software_resu.patch
-patches.runtime_pm/0147-PM-Hibernate-Thaw-processes-in-SNAPSHOT_CREATE_IMAGE.patch
-patches.runtime_pm/0148-PM-Hibernate-Remove-deprecated-hibernation-test-mode.patch
-patches.runtime_pm/0149-PM-Sleep-Unify-diagnostic-messages-from-device-suspe.patch
-patches.runtime_pm/0150-PM-Hibernate-Replace-unintuitive-if-condition-in-ker.patch
-patches.runtime_pm/0151-PM-Domains-Make-it-possible-to-assign-names-to-gener.patch
-patches.runtime_pm/0152-PM-Domains-Fix-default-system-suspend-resume-operati.patch
-patches.runtime_pm/0153-PM-Sleep-Replace-mutex_-un-lock-pm_mutex-with-un-loc.patch
-patches.runtime_pm/0154-PM-Sleep-Recommend-un-lock_system_sleep-over-using-p.patch
-patches.runtime_pm/0155-PM-Domains-Provide-an-always-on-power-domain-governo.patch
-patches.runtime_pm/0156-PM-Hibernate-Remove-deprecated-hibernation-snapshot-.patch
-patches.runtime_pm/0157-PM-Sleep-Simplify-generic-system-suspend-callbacks.patch
-patches.runtime_pm/0158-PM-Sleep-Merge-internal-functions-in-generic_ops.c.patch
-patches.runtime_pm/0159-PM-Sleep-Make-pm_op-and-pm_noirq_op-return-callback-.patch
-patches.runtime_pm/0160-PM-Run-the-driver-callback-directly-if-the-subsystem.patch
-patches.runtime_pm/0161-PM-Drop-generic_subsys_pm_ops.patch
-patches.runtime_pm/0162-PM-QoS-Introduce-dev_pm_qos_add_ancestor_request.patch
-patches.runtime_pm/0163-power_supply-Add-initial-Charger-Manager-driver.patch
-patches.runtime_pm/0164-PM-Hibernate-Implement-compat_ioctl-for-dev-snapshot.patch
-patches.runtime_pm/0165-mm-more-intensive-memory-corruption-debugging.patch
-patches.runtime_pm/0166-PM-Hibernate-do-not-count-debug-pages-as-savable.patch
-patches.runtime_pm/0167-power_supply-Charger-Manager-Add-properties-for-powe.patch
-patches.runtime_pm/0168-PM-Domains-Fix-build-for-CONFIG_PM_SLEEP-unset.patch
-patches.runtime_pm/0169-PM-Domains-Skip-governor-functions-for-CONFIG_PM_RUN.patch
-patches.runtime_pm/0170-PM-Documentation-Fix-spelling-mistake-in-basic-pm-de.patch
-patches.runtime_pm/0171-PM-Documentation-Fix-minor-issue-in-freezing_of_task.patch
-patches.runtime_pm/0172-PM-Hibernate-Correct-additional-pages-number-calcula.patch
-patches.runtime_pm/0173-PM-Domains-Add-OF-support.patch
-patches.runtime_pm/0174-PM-Hibernate-Fix-s2disk-regression-related-to-freezi.patch
-patches.runtime_pm/0175-PM-Sleep-Introduce-late-suspend-and-early-resume-of-.patch
-patches.runtime_pm/0176-PM-Sleep-Introduce-generic-callbacks-for-new-device-.patch
-patches.runtime_pm/0177-PM-Domains-Run-late-early-device-suspend-callbacks-a.patch
-patches.runtime_pm/0178-PM-QoS-Simplify-PM-QoS-expansion-merge.patch
-patches.runtime_pm/0179-PM-Hibernate-Thaw-kernel-threads-in-SNAPSHOT_CREATE_.patch
-patches.runtime_pm/0180-PM-Freezer-Thaw-only-kernel-threads-if-freezing-of-k.patch
-patches.runtime_pm/0181-PM-QoS-CPU-C-state-breakage-with-PM-Qos-change.patch
-patches.runtime_pm/0182-PM-Suspend-Avoid-code-duplication-in-suspend-statist.patch
-patches.runtime_pm/0183-PM-Freezer-Docs-Document-the-beauty-of-freeze-thaw-s.patch
-patches.runtime_pm/0184-PM-Hibernate-Thaw-kernel-threads-in-hibernation_snap.patch
-patches.runtime_pm/0185-PM-Hibernate-Refactor-and-simplify-freezer_test_done.patch
-patches.runtime_pm/0186-PM-Domains-Provide-a-dummy-dev_gpd_data-when-generic.patch
-patches.runtime_pm/0187-PM-Make-sysrq-o-be-available-for-CONFIG_PM-unset.patch
-patches.runtime_pm/0188-PM-QoS-unconditionally-build-the-feature.patch
-patches.runtime_pm/0189-PM-Sleep-Initialize-wakeup-source-locks-in-wakeup_so.patch
-patches.runtime_pm/0190-PM-Sleep-Do-not-check-wakeup-too-often-in-try_to_fre.patch
-patches.runtime_pm/0191-PM-Sleep-Remove-unnecessary-label-from-suspend_freez.patch
-patches.runtime_pm/0192-PM-Sleep-Unify-kerneldoc-comments-in-kernel-power-su.patch
-patches.runtime_pm/0193-PM-Sleep-Make-enter_state-in-kernel-power-suspend.c-.patch
-patches.runtime_pm/0194-PM-Sleep-Drop-suspend_stats_update.patch
-patches.runtime_pm/0195-PM-Add-comment-describing-relationships-between-PM-c.patch
-patches.runtime_pm/0196-PM-Hibernate-print-physical-addresses-consistently-w.patch
-patches.runtime_pm/0197-PM-Sleep-Fix-possible-infinite-loop-during-wakeup-so.patch
-patches.runtime_pm/0198-PM-Sleep-Fix-race-conditions-related-to-wakeup-sourc.patch
-patches.runtime_pm/0199-PM-Sleep-Add-more-wakeup-source-initialization-routi.patch
-patches.runtime_pm/0200-PM-Freezer-Remove-references-to-TIF_FREEZE-in-commen.patch
-patches.runtime_pm/0201-PM-Domains-Fix-include-for-PM_GENERIC_DOMAINS-n-case.patch
-patches.runtime_pm/0202-PM-QoS-Make-it-possible-to-expose-PM-QoS-latency-con.patch
-patches.runtime_pm/0203-PM-Domains-Fix-handling-of-wakeup-devices-during-sys.patch
-patches.runtime_pm/0204-PM-Domains-Fix-hibernation-restore-of-devices-v2.patch
-patches.runtime_pm/0205-PM-Domains-Introduce-always-on-device-flag.patch
-patches.runtime_pm/0206-PM-Domains-Check-domain-status-during-hibernation-re.patch
-patches.runtime_pm/0207-PM-Runtime-don-t-forget-to-wake-up-waitqueue-on-fail.patch
-patches.runtime_pm/0208-PM-Hibernate-Disable-usermode-helpers-right-before-f.patch
-patches.runtime_pm/0209-PM-Sleep-Move-disabling-of-usermode-helpers-to-the-f.patch
-patches.runtime_pm/0210-PM-QoS-add-pm_qos_update_request_timeout-API.patch
patches.pramfs/01-pramfs-documentation.patch
patches.pramfs/02-pramfs-super-operations.patch
@@ -595,325 +81,3 @@ patches.pramfs/16-pramfs-ioctl-operations.patch
patches.pramfs/17-pramfs-makefile-and-kconfig.patch
-patches.kzm9g/0001-net-remove-mm.h-inclusion-from-netdevice.h.patch
-patches.kzm9g/0002-Include-linux-dma-mapping.h-in-linux-dmaengine.h.patch
-patches.kzm9g/0003-dmaengine-failure-to-get-a-specific-DMA-channel-is-n.patch
-patches.kzm9g/0004-Improve-slave-cyclic-DMA-engine-documentation.patch
-patches.kzm9g/0005-dmaengine-use-DEFINE_IDR-for-static-initialization.patch
-patches.kzm9g/0006-dmaengine-add-helper-function-for-slave_single.patch
-patches.kzm9g/0007-dmaengine-remove-struct-scatterlist-for-header.patch
-patches.kzm9g/0008-dmaengine-add-new-enum-dma_transfer_direction.patch
-patches.kzm9g/0009-linux-dmaengine.h-fix-implicit-use-of-bitmap.h-and-a.patch
-patches.kzm9g/0010-DMAEngine-Define-interleaved-transfer-request-api.patch
-patches.kzm9g/0011-dmaengine-add-DMA_TRANS_NONE-to-dma_transfer_directi.patch
-patches.kzm9g/0012-dmaengine-Add-flow-controller-information-to-dma_sla.patch
-patches.kzm9g/0013-dma-dmaengine-Distinguish-between-dmaengine-failed-t.patch
-patches.kzm9g/0014-dmaengine-add-private-header-file.patch
-patches.kzm9g/0015-dmaengine-dma_slave-introduce-inline-wrappers.patch
-patches.kzm9g/0016-ARM-Add-init_consistent_dma_size.patch
-patches.kzm9g/0017-mmc-add-a-card-hotplug-handler-context.patch
-patches.kzm9g/0018-mmc-add-a-generic-GPIO-card-detect-helper.patch
-patches.kzm9g/0019-mmc-simplify-mmc_cd_gpio_request-by-removing-two-par.patch
-patches.kzm9g/0020-mmc-Standardize-header-file-inclusion-checks.patch
-patches.kzm9g/0021-mmc-tmio-name-0xd8-as-CTL_DMA_ENABLE.patch
-patches.kzm9g/0022-mmc-tmio-Share-register-access-functions.patch
-patches.kzm9g/0023-mmc-sdhi-Add-write16_hook.patch
-patches.kzm9g/0024-mmc-tmio-Fix-race-condition-resulting-in-spurious-in.patch
-patches.kzm9g/0025-mmc-tmio-fix-recursive-spinlock-don-t-schedule-with-.patch
-patches.kzm9g/0026-mmc-tmio-maximize-power-saving.patch
-patches.kzm9g/0027-mmc-tmio-fix-a-recently-introduced-bug-in-DMA-code.patch
-patches.kzm9g/0028-mmc-tmio-fix-a-deadlock.patch
-patches.kzm9g/0029-net-remove-mm.h-inclusion-from-netdevice.h.patch
-patches.kzm9g/0030-MMC-TMIO-Fix-build-issue-related-to-struct-scatterli.patch
-patches.kzm9g/0031-mmc-tmio-eliminate-unused-variable-mmc-warning.patch
-patches.kzm9g/0032-mmc-sdhi-initialise-mmc_data-flags-before-use.patch
-patches.kzm9g/0033-mmc-tmio-Cache-interrupt-masks.patch
-patches.kzm9g/0034-mmc-tmio-Provide-separate-interrupt-handlers.patch
-patches.kzm9g/0035-mmc-sdhi-Allow-named-IRQs-to-use-specific-handlers.patch
-patches.kzm9g/0036-mmc-irq-Remove-IRQF_DISABLED.patch
-patches.kzm9g/0037-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
-patches.kzm9g/0038-mmc-replace-printk-with-appropriate-display-macro.patch
-patches.kzm9g/0039-mmc-tmio-fix-clock-gating-on-platforms-with-a-.set_p.patch
-patches.kzm9g/0040-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
-patches.kzm9g/0041-mmc-remove-the-second-argument-of-k-un-map_atomic.patch
-patches.kzm9g/0042-mmc-tmio_mmc-Hotplug-code-regrouping.patch
-patches.kzm9g/0043-mmc-host-move-to-dma_transfer_direction.patch
-patches.kzm9g/0044-mmc-tmio_mmc-fix-card-eject-during-IO-with-DMA.patch
-patches.kzm9g/0045-mmc-tmio_mmc-do-not-enable-card-hotplug-interrupts-i.patch
-patches.kzm9g/0046-mmc-tmio-calculate-the-native-hotplug-condition-only.patch
-patches.kzm9g/0047-mmc-tmio_mmc-support-the-generic-MMC-GPIO-card-hotpl.patch
-patches.kzm9g/0048-mmc-sh_mobile_sdhi-pass-card-hotplug-GPIO-number-to-.patch
-patches.kzm9g/0049-mmc-tmio_mmc-power-status-flag-doesn-t-have-to-be-ex.patch
-patches.kzm9g/0050-mmc-tmio_mmc-remove-unused-sdio_irq_enabled-flag.patch
-patches.kzm9g/0051-mmc-sh_mobile_sdhi-do-not-manage-PM-clocks-manually.patch
-patches.kzm9g/0052-mmc-tmio-cosmetic-prettify-the-tmio_mmc_set_ios-func.patch
-patches.kzm9g/0053-mmc-sh_mobile_sdhi-add-a-callback-for-board-specific.patch
-patches.kzm9g/0054-mmc-sh_mobile_sdhi-support-modular-mmc-core-with-non.patch
-patches.kzm9g/0055-mmc-Standardize-header-file-inclusion-checks.patch
-patches.kzm9g/0056-mmc-sh_mmcif-maximize-power-saving.patch
-patches.kzm9g/0057-mmc-sh_mmcif-simplify-platform-data.patch
-patches.kzm9g/0058-mmc-Add-module.h-to-drivers-mmc-users-assuming-impli.patch
-patches.kzm9g/0059-mmc-host-move-to-dma_transfer_direction.patch
-patches.kzm9g/0060-mmc-sh_mmcif-fix-clock-gating-on-platforms-with-a-.d.patch
-patches.kzm9g/0061-mmc-sh_mmcif-simplify-clock-divisor-calculation.patch
-patches.kzm9g/0062-mmc-convert-drivers-mmc-host-to-use-module_platform_.patch
-patches.kzm9g/0063-mmc-sh_mmcif-process-error-interrupts-first.patch
-patches.kzm9g/0064-mmc-sh_mmcif-cosmetic-clean-up.patch
-patches.kzm9g/0065-mmc-sh_mmcif-process-requests-asynchronously.patch
-patches.kzm9g/0066-mmc-sh_mmcif-remove-now-superfluous-sh_mmcif_host-da.patch
-patches.kzm9g/0067-mmc-sh_mmcif-fix-MMC_GEN_CMD-setting.patch
-patches.kzm9g/0068-mmc-sh_mmcif-simplify-bitmask-macros.patch
-patches.kzm9g/0069-mmc-sh_mmcif-double-clock-speed.patch
-patches.kzm9g/0070-mmc-sh_mmcif-mmc-f_max-should-be-half-of-the-bus-clo.patch
-patches.kzm9g/0071-mmc-sh_mmcif-Simplify-calculation-of-mmc-f_min.patch
-patches.kzm9g/0072-ARM-mach-shmobile-clock-r8a7740-add-USB-clock.patch
-patches.kzm9g/0073-ALSA-workaround-change-the-timing-of-alsa_sound_last.patch
-patches.kzm9g/0074-ASoC-core-Optimise-and-refactor-pcm_new-to-pass-only.patch
-patches.kzm9g/0075-ASoC-core-Allow-components-to-probe-remove-in-sequen.patch
-patches.kzm9g/0076-ASoC-core-Separate-out-PCM-operations-into-new-file.patch
-patches.kzm9g/0077-ASoC-core-PCM-mutex-per-rtd.patch
-patches.kzm9g/0078-ASoC-Allow-DAI-formats-to-be-specified-in-the-dai_li.patch
-patches.kzm9g/0079-ASoC-Hold-runtime-PM-references-to-components-of-act.patch
-patches.kzm9g/0080-ASoC-sh-fsi-tidyup-parameter-of-fsi_stream_push.patch
-patches.kzm9g/0081-ASoC-sh-fsi-add-fsi_set_master_clk.patch
-patches.kzm9g/0082-ASoC-sh-fsi-irq-control-moves-to-fsi_port_start-stop.patch
-patches.kzm9g/0083-ASoC-sh-fsi-tidyup-unclear-variable-naming.patch
-patches.kzm9g/0084-ASoC-sh-fsi-remove-pm_runtime-from-fsi_dai_set_fmt.patch
-patches.kzm9g/0085-ASoC-sh-fsi-make-sure-fsi_stream_push-pop-access-by-.patch
-patches.kzm9g/0086-ASoC-sh-fsi-remove-fsi_module_init-kill.patch
-patches.kzm9g/0087-ASoC-sh-fsi-cleanup-suspend-resume.patch
-patches.kzm9g/0088-ASoC-sh-fsi-add-fsi_hw_startup-shutdown.patch
-patches.kzm9g/0089-sound-irq-Remove-IRQF_DISABLED.patch
-patches.kzm9g/0090-ASoC-sh-use-correct-__iomem-annotations.patch
-patches.kzm9g/0091-sound-Add-module.h-to-the-previously-silent-sound-us.patch
-patches.kzm9g/0092-ASoC-fsi-fixup-compile-warning.patch
-patches.kzm9g/0093-ASoC-fsi-add-valid-data-position-control-support.patch
-patches.kzm9g/0094-ASoC-Constify-snd_soc_dai_ops-structs.patch
-patches.kzm9g/0095-ASoC-fsi-ak4642-modify-specification-method-of-FSI-a.patch
-patches.kzm9g/0096-ASoC-Convert-sh-directory-to-module_platform_driver.patch
-patches.kzm9g/0097-ASoC-Use-core-pm_runtime-callbacks-for-fsi.patch
-patches.kzm9g/0098-ASoC-sh-Add-.owner-to-struct-snd_soc_card.patch
-patches.kzm9g/0099-ASoC-fsi-Remove-unneeded-empty-runtime-PM-callbacks.patch
-patches.kzm9g/0100-ASoC-fsi-reduce-runtime-calculation-by-using-pre-set.patch
-patches.kzm9g/0101-ASoC-fsi-tidyup-fsi_stream_xx-functions-were-gathere.patch
-patches.kzm9g/0102-ASoC-fsi-data-push-pop-calculation-part-was-divided.patch
-patches.kzm9g/0103-ASoC-fsi-rename-fsi_dma_soft_xxx-to-fsi_pio_xxx.patch
-patches.kzm9g/0104-ASoC-fsi-tidyup-move-fsi_fifo_init-onto-fsi_hw_start.patch
-patches.kzm9g/0105-ASoC-fsi-remove-unnecessary-parameter-from-fsi_hw_sh.patch
-patches.kzm9g/0106-ASoC-fsi-rename-fsi_stream_push-pop-to-fsi_stream_in.patch
-patches.kzm9g/0107-ASoC-fsi-modify-fsi_pio_get_area-parameter-and-using.patch
-patches.kzm9g/0108-ASoC-fsi-re-define-fsi_is_play-and-fsi_stream_is_pla.patch
-patches.kzm9g/0109-ASoC-fsi-use-fsi_stream-in-fsi_get_current_fifo_samp.patch
-patches.kzm9g/0110-ASoC-fsi-add-fsi_stream_handler-and-PIO-handler.patch
-patches.kzm9g/0111-ASoC-fsi-tidyup-fsi_pio_xxx-are-gathered.patch
-patches.kzm9g/0112-ASoC-fsi-don-t-use-is_play-as-a-parameter-of-fsi-fun.patch
-patches.kzm9g/0113-ASoC-fsi-add-.start_stop-handler-to-fsi_stream_handl.patch
-patches.kzm9g/0114-ASoC-fsi-fsi_stream_is_working-care-substream-runtim.patch
-patches.kzm9g/0115-ASoC-fsi-PortA-B-information-was-controlled-by-sh_fs.patch
-patches.kzm9g/0116-ASoC-fsi-add-.init-.quit-handler-support.patch
-patches.kzm9g/0117-ASoC-fsi-fixup-fsi_pointer-calculation-method.patch
-patches.kzm9g/0118-ASoC-fsi-Add-DMAEngine-support.patch
-patches.kzm9g/0119-ASoC-fsi-update-for-dmaengine-prep_slave_sg-fallout.patch
-patches.kzm9g/0120-ASoC-add-generic-simple-card-support.patch
-patches.kzm9g/0121-ASoC-sh-fsi-select-simple-card-on-Kconfig.patch
-patches.kzm9g/0122-ASoC-ak4642-convert-to-soc-cache.patch
-patches.kzm9g/0123-ASoC-ak4642-ak4642-was-tested.patch
-patches.kzm9g/0124-ASoC-ak4642-add-ak4642_set_bias_level.patch
-patches.kzm9g/0125-ASoC-ak4642-add-DAPM-support-for-HeadPhone-Output.patch
-patches.kzm9g/0126-ASoC-ak4642-add-headphone-mute-switch-control.patch
-patches.kzm9g/0127-ASoC-ak4642-add-Line-out-support.patch
-patches.kzm9g/0128-ASoC-ak4642-add-ak4648-support.patch
-patches.kzm9g/0129-ASoC-Remove-driver-versioning-from-ak4642.patch
-patches.kzm9g/0130-ASoC-Convert-ak4642-to-devm_kzalloc.patch
-patches.kzm9g/0131-ASoC-ak4642-fixup-HeadPhone-L-R-dapm-settings.patch
-patches.kzm9g/0132-ARM-mach-shmobile-clock-r8a7740-add-SDHI-clock.patch
-patches.kzm9g/0133-ARM-mach-shmobile-clock-r8a7740-add-MMCIF-clock.patch
-patches.kzm9g/0134-ARM-mach-shmobile-r8a7740-reserve-DMA-memory-for-the.patch
-patches.kzm9g/0135-ARM-mach-shmobile-clock-r8a7740-add-FSI-clock.patch
-patches.kzm9g/0136-ARM-mach-shmobile-armadillo800eva-add-SDHI0-support.patch
-patches.kzm9g/0137-ARM-mach-shmobile-armadillo800eva-add-SDHI1-support.patch
-patches.kzm9g/0138-ARM-mach-shmobile-armadillo800eva-add-MMCIF-support.patch
-patches.kzm9g/0139-ARM-mach-shmobile-armadillo800eva-Add-FSI-WM8978-sup.patch
-patches.kzm9g/0140-ARM-mach-shmobile-Add-support-for-PINT-though-INTC-m.patch
-patches.kzm9g/0141-irq-Track-the-owner-of-irq-descriptor.patch
-patches.kzm9g/0142-irq-add-irq_domain-translation-infrastructure.patch
-patches.kzm9g/of-address-add-of_find_matching_node_by_address-helper.patch
-patches.kzm9g/0143-dt-irq-add-irq_domain_generate_simple-helper.patch
-patches.kzm9g/0144-irq-Add-declaration-of-irq_domain_simple_ops-to-irqd.patch
-patches.kzm9g/0145-irq-Fix-check-for-already-initialized-irq_domain-in-.patch
-patches.kzm9g/0146-irq-support-domains-with-non-zero-hwirq-base.patch
-patches.kzm9g/0147-genirq-Add-support-for-per-cpu-dev_id-interrupts.patch
-patches.kzm9g/0148-ARM-introduce-handle_IRQ-not-to-dump-exception-stack.patch
-patches.kzm9g/0149-ARM-GIC-move-gic_chip_data-structure-declaration-to-.patch
-patches.kzm9g/0150-ARM-CPU-hotplug-fix-abuse-of-irqdesc-node.patch
-patches.kzm9g/0151-ARM-GIC-avoid-routing-interrupts-to-offline-CPUs.patch
-patches.kzm9g/0152-ARM-gic-Use-cpu-pm-notifiers-to-save-gic-state.patch
-patches.kzm9g/0153-ARM-7011-1-Add-ARM-cpu-topology-definition.patch
-patches.kzm9g/0154-ARM-7060-1-smp-populate-logical-CPU-mapping-during-b.patch
-patches.kzm9g/0155-ARM-gic-Allow-gic-arch-extensions-to-provide-irqchip.patch
-patches.kzm9g/0156-ARM-7061-1-gic-convert-logical-CPU-numbers-into-phys.patch
-patches.kzm9g/0157-ARM-7123-1-smp-Add-an-IPI-handler-callable-from-C-co.patch
-patches.kzm9g/0158-ARM-7124-1-smp-Add-a-localtimer-handler-callable-fro.patch
-patches.kzm9g/0159-ARM-gic-consolidate-PPI-handling.patch
-patches.kzm9g/0160-ARM-GIC-Add-global-gic_handle_irq-function.patch
-patches.kzm9g/0161-ARM-twd-register-clockevents-device-before-enabling-.patch
-patches.kzm9g/0162-ARM-EXYNOS4-set-the-affinity-of-mct1-interrupt-using.patch
-patches.kzm9g/0163-genirq-percpu-allow-interrupt-type-to-be-set-at-enab.patch
-patches.kzm9g/0164-ARM-gic-local-timers-use-the-request_percpu_irq-inte.patch
-patches.kzm9g/0165-ARM-gic-add-irq_domain-support.patch
-patches.kzm9g/0166-ARM-gic-add-OF-based-initialization.patch
-patches.kzm9g/0167-ARM-gic-fix-irq_alloc_descs-handling-for-sparse-irq.patch
-patches.kzm9g/0168-ARM-gic-use-module.h-instead-of-export.h.patch
-patches.kzm9g/0169-ARM-7176-1-cpu_pm-register-GIC-PM-notifier-only-once.patch
-patches.kzm9g/0170-ARM-7177-1-GIC-avoid-skipping-non-existent-PPIs-in-i.patch
-patches.kzm9g/0171-ARM-mach-shmobile-clock-sh73a0-tidyup-CKSCR-main-clo.patch
-patches.kzm9g/0172-ARM-mach-shmobile-sh73a0-PFC-pull-up-support-for-SDH.patch
-patches.kzm9g/0173-ARM-shmobile-convert-logical-CPU-numbers-to-physical.patch
-patches.kzm9g/0174-ARM-mach-shmobile-sh73a0-GPIO-IRQ-support.patch
-patches.kzm9g/0175-ARM-mach-shmobile-Use-common-INTC-IRQ-code-on-sh73a0.patch
-patches.kzm9g/0176-ARM-mach-shmobile-sh73a0-and-AG5EVM-PINT-support.patch
-patches.kzm9g/0177-ARM-mach-shmobile-Kota2-TPU-LED-platform-data.patch
-patches.kzm9g/0178-ARM-mach-shmobile-SH73A0-external-Ethernet-fix.patch
-patches.kzm9g/0179-sh-clkfwk-clock-sh73a0-all-div6_clks-use-SH_CLK_DIV6.patch
-patches.kzm9g/0180-arm-mach-shmobile-add-a-resource-name-for-shdma.patch
-patches.kzm9g/0181-ARM-mach-shmobile-sh73a0-PINT-IRQ-base-fix.patch
-patches.kzm9g/0182-ARM-mach-shmobile-sh73a0-IRQ-sparse-alloc-fix.patch
-patches.kzm9g/0183-ARM-mach-shmobile-clock-sh73a0-add-DSIxPHY-clock-sup.patch
-patches.kzm9g/0184-ARM-shmobile-remove-NR_IRQS.patch
-patches.kzm9g/0185-ARM-mach-shmobile-sh73a0-PSTR-32-bit-access-fix.patch
-patches.kzm9g/0186-ARM-mach-shmobile-sh73a0-sh_clk_ops-rename.patch
-patches.kzm9g/0187-ARM-mach-shmobile-sh73a0-map_io-and-init_early-updat.patch
-patches.kzm9g/0188-ARM-mach-shmobile-sh73a0-AG5EVM-and-Kota2-timer-rewo.patch
-patches.kzm9g/0189-ARM-mach-shmobile-sh73a0-add-MMC-data-pin-pull-up.patch
-patches.kzm9g/0190-ARM-Update-mach-types.patch
-patches.kzm9g/0191-ARM-mach-shmobile-add-KZM-A9-GT-board-support.patch
-patches.kzm9g/0192-ARM-mach-shmobile-kzm9g-add-defconfig.patch
-patches.kzm9g/0193-ARM-mach-shmobile-Invalidate-caches-when-booting-sec.patch
-patches.kzm9g/0194-ARM-mach-shmobile-kzm9g-enable-SMP-boot.patch
-patches.kzm9g/0195-ARM-mach-shmobile-kzm9g-add-LCDC-support.patch
-patches.kzm9g/0196-ARM-mach-shmobile-kzm9g-add-ST1232-Touchscreen-suppo.patch
-patches.kzm9g/0197-ARM-mach-shmobile-pfc-sh73a0-fixup-MSEL2CR-MSEL18-fo.patch
-patches.kzm9g/0198-ARM-mach-shmobile-sh73a0.h-add-GPIO_NR.patch
-patches.kzm9g/0199-ARM-mach-shmobile-kzm9g-correct-screen-direction.patch
-patches.kzm9g/0200-ARM-mach-shmobile-kzm9g-add-MMCIF-support.patch
-patches.kzm9g/0201-ARM-mach-shmobile-kzm9g-add-SDHI-support.patch
-patches.kzm9g/0202-ARM-mach-shmobile-kzm9g-add-PCF8757-gpio-key.patch
-patches.kzm9g/0203-ARM-mach-shmobile-kzm9g-defconfig-update.patch
-patches.kzm9g/0204-ARM-mach-shmobile-clock-sh73a0-add-FSI-clock.patch
-patches.kzm9g/0205-ARM-mach-shmobile-kzm9g-add-FSI-AK4648-support.patch
-
-patches.kzm9g/0001-tty-serial-allow-ports-to-override-the-irq-handler.patch
-patches.kzm9g/0002-serial-introduce-generic-port-in-out-helpers.patch
-patches.kzm9g/0003-serial-8250-increase-PASS_LIMIT.patch
-patches.kzm9g/0004-serial-Fix-wakeup-init-logic-to-speed-up-startup.patch
-patches.kzm9g/0005-tty-serial8250-allow-platforms-to-override-irq-handl.patch
-patches.kzm9g/0006-tty-serial8250-remove-UPIO_DWAPB-32.patch
-patches.kzm9g/0007-tty-8250-export-serial8250_handle_irq.patch
-patches.kzm9g/0008-serial-8250-Move-UPIO_TSI-to-powerpc.patch
-patches.kzm9g/0009-serial-Support-the-EFR-register-of-XR1715x-uarts.patch
-patches.kzm9g/0010-8250-ratelimit-LSR-safety-check-engaged-warning.patch
-patches.kzm9g/0011-serial-8250-replace-hardcoded-0xbf-with-define.patch
-patches.kzm9g/0012-serial-move-struct-uart_8250_port-from-8250.c-to-825.patch
-patches.kzm9g/0013-serial-clean-up-parameter-passing-for-8250-Rx-IRQ-ha.patch
-patches.kzm9g/0014-serial-export-the-key-functions-for-an-8250-IRQ-hand.patch
-patches.kzm9g/0015-serial-make-8250-timeout-use-the-specified-IRQ-handl.patch
-patches.kzm9g/0016-serial-manually-inline-serial8250_handle_port.patch
-patches.kzm9g/0017-serial-group-all-the-8250-related-code-together.patch
-patches.kzm9g/0018-serial-Kill-off-NO_IRQ.patch
-patches.kzm9g/0019-tty-fix-a-build-failure-on-sparc.patch
-patches.kzm9g/0020-tty-sparc-rename-drivers-tty-serial-suncore.h-includ.patch
-patches.kzm9g/0021-serial-delete-last-unused-traces-of-pausing-I-O-in-8.patch
-patches.kzm9g/0022-serial-make-8250-s-serial_in-shareable-to-other-driv.patch
-patches.kzm9g/0023-serial-delete-useless-void-casts-in-8250.c.patch
-patches.kzm9g/0024-serial-reduce-number-of-indirections-in-8250-code.patch
-patches.kzm9g/0025-serial-use-serial_port_in-out-vs-serial_in-out-in-82.patch
-patches.kzm9g/0026-serial-remove-back-and-forth-conversions-in-serial_o.patch
-patches.kzm9g/0027-serial-8250_pci-add-a-force-background-timer-flag-an.patch
-patches.kzm9g/0028-8250.c-less-than-2400-baud-fix.patch
-patches.kzm9g/0029-serial8250-Add-dl_read-dl_write-callbacks.patch
-patches.kzm9g/0030-serial8250-Use-dl_read-dl_write-on-Alchemy.patch
-patches.kzm9g/0031-serial8250-Use-dl_read-dl_write-on-RM9K.patch
-patches.kzm9g/0032-serial8250-Clean-up-default-map-and-dl-code.patch
-patches.kzm9g/0033-serial8250-Introduce-serial8250_register_8250_port.patch
-patches.kzm9g/0034-serial8250-em-Emma-Mobile-UART-driver-V2.patch
-patches.kzm9g/0035-serial8250-em-clk_get-IS_ERR-error-handling-fix.patch
-patches.kzm9g/0036-cpuidle-create-bootparam-cpuidle.off-1.patch
-patches.kzm9g/0037-cpuidle-replace-xen-access-to-x86-pm_idle-and-defaul.patch
-patches.kzm9g/0038-cpuidle-stop-depending-on-pm_idle.patch
-patches.kzm9g/0039-cpuidle-Consistent-spelling-of-cpuidle_idle_call.patch
-patches.kzm9g/0040-sh-Fix-up-fallout-from-cpuidle-changes.patch
-patches.kzm9g/0041-cpuidle-Add-module.h-to-drivers-cpuidle-files-as-req.patch
-patches.kzm9g/0042-cpuidle-Move-dev-last_residency-update-to-driver-ent.patch
-patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
-patches.kzm9g/0044-cpuidle-Split-cpuidle_state-structure-and-move-per-c.patch
-patches.kzm9g/0045-cpuidle-Single-Global-registration-of-idle-states.patch
-patches.kzm9g/0046-cpuidle-Add-common-time-keeping-and-irq-enabling.patch
-patches.kzm9g/0047-mm-add-vm_area_add_early.patch
-patches.kzm9g/0048-clockevents-Make-clockevents_config-a-global-symbol.patch
-patches.kzm9g/0049-clocksource-em_sti-Emma-Mobile-STI-driver-V2.patch
-patches.kzm9g/0050-ARM-move-initialization-of-the-high_memory-variable-.patch
-patches.kzm9g/0051-ARM-move-iotable-mappings-within-the-vmalloc-region.patch
-patches.kzm9g/0052-ARM-simplify-__iounmap-when-dealing-with-section-bas.patch
-patches.kzm9g/0053-ARM-add-generic-ioremap-optimization-by-reusing-stat.patch
-patches.kzm9g/0054-ARM-mach-shmobile-Introduce-shmobile_setup_delay.patch
-patches.kzm9g/0055-ARM-mach-shmobile-Allow-SoC-specific-CPU-kill-code.patch
-patches.kzm9g/0056-ARM-mach-shmobile-Use-preset_lpj-with-calibrate_dela.patch
-patches.kzm9g/0057-ARM-Undelete-KZM9D-mach-type.patch
-patches.kzm9g/0058-gpio-Emma-Mobile-GPIO-driver.patch
-patches.kzm9g/0059-mach-shmobile-Emma-Mobile-EV2-SoC-base-support-V3.patch
-patches.kzm9g/0060-mach-shmobile-KZM9D-board-support-V3.patch
-patches.kzm9g/0061-mach-shmobile-Emma-Mobile-EV2-SMP-support-V3.patch
-patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch
-patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch
-
-patches.kzm9g/ltsi-arm-shmobile-kzm9g-support-real-time-clock.patch
-patches.kzm9g/ltsi-bugfix-add-config_i2c-to-kzm9g_defconfig.patch
-patches.kzm9g/arm-shmobile-sh73a0-bugfix-sy-dmac-number.patch
-
-patches.kzm9g/001-ltsi-backport-arm-mach-shmobile-kzm9g-add-smsc-9221-support.patch
-patches.kzm9g/002-lsti-backport-arm-mach-shmobile-kzm9g-add-external-usb-host-support.patch
-patches.kzm9g/003-ltsi-bugfix-sh73a0-add-lost-clk_enable_on_init-for-div6_zb1.patch
-patches.kzm9g/004-ltsi-arm-mach_shmobile-kzm9g-update-defconfig.patch
-patches.kzm9g/arm-mach-shmobile-kzm9d-add-defconfig.patch
-patches.kzm9g/arm-mach-shmobile-kzm9d-defconfig-enable-net_ethernet.patch
-
-
-patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
-patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
-patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
-patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
-patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
-patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
-patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
-patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
-patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
-patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
-patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
-patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
-patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
-#patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
-patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
-patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
-patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
-patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
-patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
-patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
-patches.sh7757lcr/021-sh-kexec-add-physical_start.patch
-patches.sh7757lcr/drivers-sh-generalize-runtime-pm-platform-stub.patch
-patches.sh7757lcr/sh-also-without-pm_runtime-pm_runtime.o-must-be-built.patch
-patches.sh7757lcr/sh-fix-clock-sh7757-for-the-latest-sh_mobile_sdhi-driver.patch
-
-
-patches.r8a66597-udc/001-usb-gadget-add-platform-module-alias-where-it-is-missing.patch
-patches.r8a66597-udc/002-usb-update-email-address-in-r8a66597-udc-and-m66592-udc.patch
-patches.r8a66597-udc/003-usb-gadget-r8a66597-udc-make-buswait-configurable-through-platform-data.patch
-patches.r8a66597-udc/004-usb-gadget-r8a66597-udc-add-support-for-test_mode.patch
-patches.r8a66597-udc/005-usb-gadget-clean-up-fsf-boilerplate-text.patch
-patches.r8a66597-udc/006-usb-irq-remove-irqf_disabled.patch
-patches.r8a66597-udc/007-usb-gadget-r8a66597-udc-change-prototype-of-r8a66597_write_fifo.patch
-patches.r8a66597-udc/008-usb-r8a66597-hcd-add-function-for-external-controller.patch
-patches.r8a66597-udc/009-usb-gadget-r8a66597-udc-add-function-for-external-controller.patch
-patches.r8a66597-udc/010-usb-gadget-r8a66597-udc-use-dev_-instead-of-printk.patch
-patches.r8a66597-udc/011-usb-gadget-r8a66597-udc-add-support-for-sudmac.patch
-patches.r8a66597-udc/012-usb-gadget-r8a66597-udc-fix-flush-fifo-handling.patch
-